First commit waiting for Budget Alert
This commit is contained in:
@ -0,0 +1,285 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.exception;
|
||||
|
||||
import com.axelor.db.EntityHelper;
|
||||
import com.axelor.db.Model;
|
||||
|
||||
/** Exception specific to Axelor. */
|
||||
public class AxelorException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1028105628735355226L;
|
||||
|
||||
private final int category;
|
||||
private final Class<? extends Model> refClass;
|
||||
private final Long refId;
|
||||
|
||||
/** Default constructor */
|
||||
@Deprecated
|
||||
public AxelorException() {
|
||||
this.refClass = null;
|
||||
this.refId = 0L;
|
||||
this.category = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with his message and his type.
|
||||
*
|
||||
* @param message The exception message
|
||||
* @param category
|
||||
* <ul>
|
||||
* <li>1: Missing field
|
||||
* <li>2: No unique key
|
||||
* <li>3: No value
|
||||
* <li>4: configuration error
|
||||
* <li>5: CATEGORY_INCONSISTENCY
|
||||
* </ul>
|
||||
*/
|
||||
@Deprecated
|
||||
public AxelorException(String message, int category, Object... messageArgs) {
|
||||
this(category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a category and a message.
|
||||
*
|
||||
* @param category
|
||||
* @param message
|
||||
* @param messageArgs
|
||||
*/
|
||||
public AxelorException(int category, String message, Object... messageArgs) {
|
||||
this(category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
public AxelorException(int category, String message) {
|
||||
super(message);
|
||||
this.refClass = null;
|
||||
this.refId = 0L;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with his cause and his type.
|
||||
*
|
||||
* @param cause The exception cause
|
||||
* @param category
|
||||
* <ul>
|
||||
* <li>1: Missing field
|
||||
* <li>2: No unique key
|
||||
* <li>3: No value
|
||||
* <li>4: configuration error
|
||||
* <li>5: CATEGORY_INCONSISTENCY
|
||||
* </ul>
|
||||
*
|
||||
* @see Throwable
|
||||
*/
|
||||
public AxelorException(Throwable cause, int category) {
|
||||
super(cause);
|
||||
this.refClass = null;
|
||||
this.refId = 0L;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with his message, his cause and his type.
|
||||
*
|
||||
* @param message The exception message
|
||||
* @param cause The exception cause
|
||||
* @param category The exception category
|
||||
* <ul>
|
||||
* <li>1: Missing field
|
||||
* <li>2: No unique key
|
||||
* <li>3: No value
|
||||
* <li>4: configuration error
|
||||
* <li>5: CATEGORY_INCONSISTENCY
|
||||
* </ul>
|
||||
*
|
||||
* @see Throwable
|
||||
*/
|
||||
@Deprecated
|
||||
public AxelorException(String message, Throwable cause, int category, Object... messageArgs) {
|
||||
this(cause, category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a cause, a category, and a message.
|
||||
*
|
||||
* @param cause
|
||||
* @param category
|
||||
* @param message
|
||||
* @param messageArgs
|
||||
*/
|
||||
public AxelorException(Throwable cause, int category, String message, Object... messageArgs) {
|
||||
this(cause, category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
public AxelorException(Throwable cause, int category, String message) {
|
||||
super(message, cause);
|
||||
this.refClass = null;
|
||||
this.refId = 0L;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a reference class, a category, and a message.
|
||||
*
|
||||
* @param refClass
|
||||
* @param category
|
||||
* @param message
|
||||
* @param messageArgs
|
||||
*/
|
||||
public AxelorException(
|
||||
Class<? extends Model> refClass, int category, String message, Object... messageArgs) {
|
||||
this(refClass, category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
public AxelorException(Class<? extends Model> refClass, int category, String message) {
|
||||
super(message);
|
||||
this.refClass = refClass;
|
||||
this.refId = 0L;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a cause, a reference class, and a category.
|
||||
*
|
||||
* @param cause
|
||||
* @param refClass
|
||||
* @param category
|
||||
*/
|
||||
public AxelorException(Throwable cause, Class<? extends Model> refClass, int category) {
|
||||
super(cause);
|
||||
this.refClass = refClass;
|
||||
this.refId = 0L;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a cause, a reference class, a category, and a message.
|
||||
*
|
||||
* @param cause
|
||||
* @param refClass
|
||||
* @param category
|
||||
* @param message
|
||||
* @param messageArgs
|
||||
*/
|
||||
public AxelorException(
|
||||
Throwable cause,
|
||||
Class<? extends Model> refClass,
|
||||
int category,
|
||||
String message,
|
||||
Object... messageArgs) {
|
||||
this(cause, refClass, category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
public AxelorException(
|
||||
Throwable cause, Class<? extends Model> refClass, int category, String message) {
|
||||
super(message, cause);
|
||||
this.refClass = refClass;
|
||||
this.refId = 0L;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a reference, a category, and a message.
|
||||
*
|
||||
* @param ref
|
||||
* @param category
|
||||
* @param message
|
||||
* @param messageArgs
|
||||
*/
|
||||
public AxelorException(Model ref, int category, String message, Object... messageArgs) {
|
||||
this(ref, category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
public AxelorException(Model ref, int category, String message) {
|
||||
super(message);
|
||||
this.refClass = EntityHelper.getEntityClass(ref);
|
||||
this.refId = ref.getId();
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a cause, a reference, and a category.
|
||||
*
|
||||
* @param cause
|
||||
* @param ref
|
||||
* @param category
|
||||
*/
|
||||
public AxelorException(Throwable cause, Model ref, int category) {
|
||||
super(cause);
|
||||
this.refClass = EntityHelper.getEntityClass(ref);
|
||||
this.refId = ref.getId();
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an exception with a cause, a reference, a category, and a message.
|
||||
*
|
||||
* @param cause
|
||||
* @param ref
|
||||
* @param category
|
||||
* @param message
|
||||
* @param messageArgs
|
||||
*/
|
||||
public AxelorException(
|
||||
Throwable cause, Model ref, int category, String message, Object... messageArgs) {
|
||||
this(cause, ref, category, String.format(message, messageArgs));
|
||||
}
|
||||
|
||||
public AxelorException(Throwable cause, Model ref, int category, String message) {
|
||||
super(message, cause);
|
||||
this.refClass = EntityHelper.getEntityClass(ref);
|
||||
this.refId = ref.getId();
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the category of exception
|
||||
*
|
||||
* @return
|
||||
* <ul>
|
||||
* <li>1: Missing field
|
||||
* <li>2: No unique key
|
||||
* <li>3: No value
|
||||
* <li>4: configuration error
|
||||
* <li>5: CATEGORY_INCONSISTENCY
|
||||
* </ul>
|
||||
*/
|
||||
public int getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get reference class.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Class<? extends Model> getRefClass() {
|
||||
return refClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get reference ID.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getRefId() {
|
||||
return refId;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.exception;
|
||||
|
||||
import com.axelor.rpc.ActionResponse;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public enum ResponseMessageType {
|
||||
INFORMATION(ActionResponse::setFlash),
|
||||
WARNING(ActionResponse::setAlert),
|
||||
ERROR(ActionResponse::setError),
|
||||
NOTIFICATION(ActionResponse::setNotify);
|
||||
|
||||
private BiConsumer<ActionResponse, String> messageMethod;
|
||||
|
||||
ResponseMessageType(BiConsumer<ActionResponse, String> messageMethod) {
|
||||
this.messageMethod = messageMethod;
|
||||
}
|
||||
|
||||
public void setMessage(ActionResponse response, String message) {
|
||||
messageMethod.accept(response, message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,241 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.exception.service;
|
||||
|
||||
import com.axelor.auth.AuthUtils;
|
||||
import com.axelor.db.JPA;
|
||||
import com.axelor.exception.AxelorException;
|
||||
import com.axelor.exception.ResponseMessageType;
|
||||
import com.axelor.exception.db.TraceBack;
|
||||
import com.axelor.exception.db.repo.TraceBackRepository;
|
||||
import com.axelor.inject.Beans;
|
||||
import com.axelor.rpc.ActionResponse;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.time.ZonedDateTime;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Classe implémentant l'ensemble des services pouvant être utiles dans la gestion des exceptions
|
||||
* Axelor.
|
||||
*/
|
||||
public class TraceBackService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
// TYPE SELECT
|
||||
protected static final int TYPE_TECHNICAL = 0;
|
||||
protected static final int TYPE_FUNCTIONAL = 1;
|
||||
|
||||
/**
|
||||
* Créer un log des exceptions en tant qu'anomalie.
|
||||
*
|
||||
* @param e L'exception générée.
|
||||
* @param categorySelect <code>0 = Champ manquant</code> <code>1 = Clef non unique</code> <code>
|
||||
* 2 = Aucune valeur retournée</code> <code>3 = Problème de configuration</code>
|
||||
*/
|
||||
private static TraceBack _create(
|
||||
Throwable e, String origin, int typeSelect, int categorySelect, long batchId) {
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw));
|
||||
|
||||
TraceBack traceBack = new TraceBack();
|
||||
traceBack.setException(e.toString());
|
||||
traceBack.setDate(ZonedDateTime.now());
|
||||
traceBack.setError(
|
||||
e.getStackTrace() != null && e.getStackTrace().length > 0
|
||||
? e.getStackTrace()[0].toString()
|
||||
: e.getMessage());
|
||||
|
||||
traceBack.setOrigin(origin);
|
||||
traceBack.setTypeSelect(typeSelect);
|
||||
traceBack.setCategorySelect(categorySelect);
|
||||
traceBack.setBatchId(batchId);
|
||||
|
||||
if (AuthUtils.getSubject() != null) {
|
||||
traceBack.setInternalUser(AuthUtils.getUser());
|
||||
}
|
||||
if (e.getCause() != null) {
|
||||
traceBack.setCause(e.getCause().toString());
|
||||
}
|
||||
if (e.getMessage() != null) {
|
||||
traceBack.setMessage(e.getMessage());
|
||||
}
|
||||
|
||||
traceBack.setTrace(sw.toString());
|
||||
Beans.get(TraceBackRepository.class).persist(traceBack);
|
||||
|
||||
return traceBack;
|
||||
}
|
||||
|
||||
private static TraceBack _create(Throwable e, String origin, int categorySelect, long batchId) {
|
||||
return _create(e, origin, TYPE_TECHNICAL, categorySelect, batchId);
|
||||
}
|
||||
|
||||
private static TraceBack _create(AxelorException e, String origin, long batchId) {
|
||||
TraceBack traceBack = _create(e, origin, TYPE_FUNCTIONAL, e.getCategory(), batchId);
|
||||
|
||||
if (e.getRefClass() != null) {
|
||||
traceBack.setRef(e.getRefClass().getName());
|
||||
traceBack.setRefId(e.getRefId());
|
||||
}
|
||||
|
||||
return traceBack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche à l'écran par l'intermédiaire d'une popup le message d'une exception.
|
||||
*
|
||||
* @param response
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
private static void _response(
|
||||
ActionResponse response, Throwable e, ResponseMessageType responseMessageType) {
|
||||
|
||||
String message = e.getMessage() != null ? e.getMessage() : e.toString();
|
||||
responseMessageType.setMessage(response, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à un bug.
|
||||
*
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
public static void trace(final Throwable e, final String origin) {
|
||||
|
||||
JPA.runInTransaction(
|
||||
() -> {
|
||||
if (e instanceof AxelorException) {
|
||||
|
||||
LOG.trace(_create((AxelorException) e, origin, 0).getTrace());
|
||||
|
||||
} else {
|
||||
|
||||
LOG.error(_create(e, origin, 0, 0).getTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à un bug.
|
||||
*
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
public static void trace(final AxelorException e, final String origin, final long batchId) {
|
||||
|
||||
JPA.runInTransaction(() -> LOG.trace(_create(e, origin, batchId).getTrace()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à un bug.
|
||||
*
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
public static void trace(final Throwable e, final String origin, final long batchId) {
|
||||
|
||||
JPA.runInTransaction(() -> LOG.error(_create(e, origin, 0, batchId).getTrace()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à un bug.
|
||||
*
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
public static void trace(Throwable e) {
|
||||
|
||||
trace(e, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à une anomalie.
|
||||
*
|
||||
* @param e L'exception cible.
|
||||
* @param categorySelect <code>0 = Champ manquant</code> <code>1 = Clef non unique</code> <code>
|
||||
* 2 = Aucune valeur retournée</code> <code>3 = Problème de configuration</code>
|
||||
*/
|
||||
public static void trace(AxelorException e) {
|
||||
|
||||
trace(e, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à un bug et affiche à l'écran par
|
||||
* l'intermédiaire d'une popup le message de l'exception.
|
||||
*
|
||||
* @param response
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
public static void trace(ActionResponse response, Throwable e, String origin) {
|
||||
|
||||
trace(e, origin);
|
||||
_response(response, e, ResponseMessageType.INFORMATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracer une exception dans Traceback correspondant à un bug et affiche à l'écran par
|
||||
* l'intermédiaire d'une popup le message de l'exception.
|
||||
*
|
||||
* @param response
|
||||
* @param e L'exception cible.
|
||||
*/
|
||||
public static void trace(ActionResponse response, Throwable e) {
|
||||
|
||||
trace(response, e, (String) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace an exception into the traceback and show it to the client with the specified response
|
||||
* message type.
|
||||
*
|
||||
* @param response
|
||||
* @param e
|
||||
* @param origin
|
||||
* @param responseMessageType
|
||||
*/
|
||||
public static void trace(
|
||||
ActionResponse response,
|
||||
Throwable e,
|
||||
String origin,
|
||||
ResponseMessageType responseMessageType) {
|
||||
|
||||
trace(e, origin);
|
||||
_response(response, e, responseMessageType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace an exception into the traceback and show it to the client with the specified response
|
||||
* message type.
|
||||
*
|
||||
* @param response
|
||||
* @param e
|
||||
* @param responseMessageType
|
||||
*/
|
||||
public static void trace(
|
||||
ActionResponse response, Throwable e, ResponseMessageType responseMessageType) {
|
||||
|
||||
trace(response, e, null, responseMessageType);
|
||||
}
|
||||
|
||||
/** @return "Axelor Exception" */
|
||||
public String toString() {
|
||||
return "Axelor Exception";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.exception.web;
|
||||
|
||||
import com.axelor.common.Inflector;
|
||||
import com.axelor.db.JPA;
|
||||
import com.axelor.exception.db.TraceBack;
|
||||
import com.axelor.i18n.I18n;
|
||||
import com.axelor.meta.schema.actions.ActionView;
|
||||
import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder;
|
||||
import com.axelor.rpc.ActionRequest;
|
||||
import com.axelor.rpc.ActionResponse;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Singleton;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Singleton
|
||||
public class TraceBackController {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* Show reference view.
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
public void showReference(ActionRequest request, ActionResponse response) {
|
||||
TraceBack traceBack = request.getContext().asType(TraceBack.class);
|
||||
|
||||
if (Strings.isNullOrEmpty(traceBack.getRef())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Class<?> modelClass = JPA.model(traceBack.getRef());
|
||||
final Inflector inflector = Inflector.getInstance();
|
||||
String viewName = inflector.dasherize(modelClass.getSimpleName());
|
||||
|
||||
LOG.debug("Showing anomaly reference ::: {}", viewName);
|
||||
|
||||
ActionViewBuilder actionViewBuilder = ActionView.define(I18n.get("Reference"));
|
||||
actionViewBuilder.model(traceBack.getRef());
|
||||
|
||||
if (traceBack.getRefId() != null) {
|
||||
actionViewBuilder.context("_showRecord", traceBack.getRefId());
|
||||
} else {
|
||||
actionViewBuilder.add("grid", String.format("%s-grid", viewName));
|
||||
}
|
||||
|
||||
actionViewBuilder.add("form", String.format("%s-form", viewName));
|
||||
response.setView(actionViewBuilder.map());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<csv-inputs xmlns="http://axelor.com/xml/ns/data-import"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://axelor.com/xml/ns/data-import http://axelor.com/xml/ns/data-import/data-import_5.2.xsd">
|
||||
|
||||
<input file="auth_role.csv" separator=";" type="com.axelor.auth.db.Role" search="self.name = :name"/>
|
||||
|
||||
<input file="auth_permission.csv" separator=";" type="com.axelor.auth.db.Permission" search="self.name = :name" call="com.axelor.csv.script.ImportPermission:importPermissionToRole">
|
||||
<bind to="canRead" eval="can_read == 'x' ? 'true' : 'false'"/>
|
||||
<bind to="canWrite" eval="can_write == 'x' ? 'true' : 'false'"/>
|
||||
<bind to="canCreate" eval="can_create == 'x' ? 'true' : 'false'"/>
|
||||
<bind to="canRemove" eval="can_remove == 'x' ? 'true' : 'false'"/>
|
||||
<bind to="canExport" eval="can_export == 'x' ? 'true' : 'false'"/>
|
||||
</input>
|
||||
|
||||
</csv-inputs>
|
||||
@ -0,0 +1,2 @@
|
||||
"name";"object";"can_read";"can_write";"can_create";"can_remove";"can_export";"condition";"conditionParams";"roleName"
|
||||
"perm.exception.all";"com.axelor.exception.db.*";"x";"x";"x";"x";"x";;;"Admin"
|
||||
|
@ -0,0 +1,2 @@
|
||||
"name";"description"
|
||||
"Admin";
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<domain-models xmlns="http://axelor.com/xml/ns/domain-models" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
|
||||
|
||||
<module name="exception" package="com.axelor.exception.db"/>
|
||||
|
||||
<entity name="ExceptionOrigin" lang="java">
|
||||
|
||||
<extra-code>
|
||||
<![CDATA[
|
||||
/**Origin select*/
|
||||
|
||||
]]>
|
||||
</extra-code>
|
||||
</entity>
|
||||
|
||||
</domain-models>
|
||||
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<domain-models xmlns="http://axelor.com/xml/ns/domain-models" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
|
||||
|
||||
<module name="exception" package="com.axelor.exception.db"/>
|
||||
|
||||
<entity sequential="true" name="TraceBack" lang="java">
|
||||
|
||||
<string title="Anomaly" name="exception" required="true" large="true"/>
|
||||
<integer title="Type" name="typeSelect" selection="trace.back.type.select"/>
|
||||
<integer title="Category" name="categorySelect" selection="trace.back.category.select"/>
|
||||
<string name="origin" selection="trace.back.origin.select" title="Origin" />
|
||||
<datetime title="Date" tz="true" name="date" required="true" column="date_val"/>
|
||||
<many-to-one ref="com.axelor.auth.db.User" title="User" name="internalUser"/>
|
||||
<string title="Error" name="error" large="true"/>
|
||||
<string title="Cause" name="cause" large="true"/>
|
||||
<string title="Message" name="message" large="true"/>
|
||||
<string title="Trace" name="trace" large="true"/>
|
||||
<long name="batchId" title="Batch" />
|
||||
<string name="ref" title="Reference" />
|
||||
<long name="refId" title="Reference ID" nullable="true" />
|
||||
|
||||
<string search="id,date" name="name" namecolumn="true">
|
||||
|
||||
return this.id + " : " + this.date;
|
||||
|
||||
</string>
|
||||
|
||||
<extra-code><![CDATA[
|
||||
|
||||
// TYPE SELECT
|
||||
/**
|
||||
* @deprecated With current implementation of TraceBackService, all exceptions of type
|
||||
* AxelorException are flagged as functional exceptions. However there are many cases of
|
||||
* misuses of AxelorException due to confusion between TYPE and CATEGORY.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int TYPE_TECHNICAL = 0;
|
||||
/**
|
||||
* @deprecated With current implementation of TraceBackService, all exceptions of type
|
||||
* AxelorException are flagged as functional exceptions. However there are many cases of
|
||||
* misuses of AxelorException due to confusion between TYPE and CATEGORY.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int TYPE_FUNCTIONNAL = 1;
|
||||
|
||||
// CATEGORY SELECT
|
||||
public static final int CATEGORY_MISSING_FIELD = 1;
|
||||
public static final int CATEGORY_NO_UNIQUE_KEY = 2;
|
||||
public static final int CATEGORY_NO_VALUE = 3;
|
||||
public static final int CATEGORY_CONFIGURATION_ERROR = 4;
|
||||
public static final int CATEGORY_INCONSISTENCY = 5;
|
||||
|
||||
]]></extra-code>
|
||||
|
||||
</entity>
|
||||
</domain-models>
|
||||
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly",,,
|
||||
"Batch",,,
|
||||
"CRM",,,
|
||||
"Category",,,
|
||||
"Cause",,,
|
||||
"Configuration problem",,,
|
||||
"Date",,,
|
||||
"Debt recovery",,,
|
||||
"Direct debit",,,
|
||||
"Doubtful customer",,,
|
||||
"Error",,,
|
||||
"Functional anomaly",,,
|
||||
"ID",,,
|
||||
"Inconsistency",,,
|
||||
"Interbank payment order",,,
|
||||
"Invoicing",,,
|
||||
"Message",,,
|
||||
"Missing field",,,
|
||||
"Name",,,
|
||||
"No Return Value",,,
|
||||
"Non-unique key",,,
|
||||
"Origin",,,
|
||||
"Reference",,,
|
||||
"Reference ID",,,
|
||||
"Reimbursement",,,
|
||||
"Reminder",,,
|
||||
"Reported balance",,,
|
||||
"Show the batch",,,
|
||||
"Show the reference",,,
|
||||
"Technical anomaly",,,
|
||||
"Trace",,,
|
||||
"TraceBack",,,
|
||||
"Type",,,
|
||||
"User",,,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalie",,
|
||||
"Batch","Charge",,
|
||||
"CRM","CRM",,
|
||||
"Category","Kategorie",,
|
||||
"Cause","Ursache",,
|
||||
"Configuration problem","Konfigurationsproblem",,
|
||||
"Date","Datum",,
|
||||
"Debt recovery","Forderungseintreibung",,
|
||||
"Direct debit","Lastschriftverfahren",,
|
||||
"Doubtful customer","Zweifelhafter Kunde",,
|
||||
"Error","Fehler",,
|
||||
"Functional anomaly","Funktionelle Anomalie",,
|
||||
"ID","ID",,
|
||||
"Inconsistency","Inkonsistenz",,
|
||||
"Interbank payment order","Interbank-Zahlungsauftrag",,
|
||||
"Invoicing","Rechnungsstellung",,
|
||||
"Message","Nachricht",,
|
||||
"Missing field","Fehlende Felder",,
|
||||
"Name","Name",,
|
||||
"No Return Value","Kein Rückgabewert",,
|
||||
"Non-unique key","Nicht eindeutiger Schlüssel",,
|
||||
"Origin","Herkunft",,
|
||||
"Reference","Referenz",,
|
||||
"Reference ID","Referenz-ID",,
|
||||
"Reimbursement","Erstattung",,
|
||||
"Reminder","Erinnerung",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Anzeige der Charge",,
|
||||
"Show the reference","Zeigen Sie die Referenz",,
|
||||
"Technical anomaly","Technische Anomalie",,
|
||||
"Trace","Trace",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Typ",,
|
||||
"User","Benutzer",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly",,,
|
||||
"Batch",,,
|
||||
"CRM",,,
|
||||
"Category",,,
|
||||
"Cause",,,
|
||||
"Configuration problem",,,
|
||||
"Date",,,
|
||||
"Debt recovery",,,
|
||||
"Direct debit",,,
|
||||
"Doubtful customer",,,
|
||||
"Error",,,
|
||||
"Functional anomaly",,,
|
||||
"ID",,,
|
||||
"Inconsistency",,,
|
||||
"Interbank payment order",,,
|
||||
"Invoicing",,,
|
||||
"Message",,,
|
||||
"Missing field",,,
|
||||
"Name",,,
|
||||
"No Return Value",,,
|
||||
"Non-unique key",,,
|
||||
"Origin",,,
|
||||
"Reference",,,
|
||||
"Reference ID",,,
|
||||
"Reimbursement",,,
|
||||
"Reminder",,,
|
||||
"Reported balance",,,
|
||||
"Show the batch",,,
|
||||
"Show the reference",,,
|
||||
"Technical anomaly",,,
|
||||
"Trace",,,
|
||||
"TraceBack",,,
|
||||
"Type",,,
|
||||
"User",,,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalía",,
|
||||
"Batch","Lote",,
|
||||
"CRM","CRM",,
|
||||
"Category","Categoría",,
|
||||
"Cause","Causa",,
|
||||
"Configuration problem","Problema de configuración",,
|
||||
"Date","Fecha",,
|
||||
"Debt recovery","Recuperación de deudas",,
|
||||
"Direct debit","Domiciliación bancaria",,
|
||||
"Doubtful customer","Cliente dudoso",,
|
||||
"Error","Error",,
|
||||
"Functional anomaly","Anomalía funcional",,
|
||||
"ID","CARNÉ DE IDENTIDAD",,
|
||||
"Inconsistency","Inconsistencia",,
|
||||
"Interbank payment order","Orden de pago interbancaria",,
|
||||
"Invoicing","Facturación",,
|
||||
"Message","Mensaje",,
|
||||
"Missing field","Campo que falta",,
|
||||
"Name","Nombre",,
|
||||
"No Return Value","Sin valor de retorno",,
|
||||
"Non-unique key","Tecla no unívoca",,
|
||||
"Origin","Origen",,
|
||||
"Reference","Referencia",,
|
||||
"Reference ID","ID de referencia",,
|
||||
"Reimbursement","Reembolso",,
|
||||
"Reminder","Recordatorio",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Mostrar el lote",,
|
||||
"Show the reference","Mostrar la referencia",,
|
||||
"Technical anomaly","Anomalía técnica",,
|
||||
"Trace","Rastros",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Tipo",,
|
||||
"User","Usuario",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalie",,
|
||||
"Batch","Batch",,
|
||||
"CRM","CRM",,
|
||||
"Category","Catégorie",,
|
||||
"Cause","Cause",,
|
||||
"Configuration problem","Problème de configuration",,
|
||||
"Date","Date",,
|
||||
"Debt recovery","Recouvrement",,
|
||||
"Direct debit","Prélèvement",,
|
||||
"Doubtful customer","Client douteux",,
|
||||
"Error","Erreur",,
|
||||
"Functional anomaly","Anomalie fonctionnelle",,
|
||||
"ID",,,
|
||||
"Inconsistency","Incohérence",,
|
||||
"Interbank payment order","Ordre de paiement interbancaire",,
|
||||
"Invoicing","Facturation",,
|
||||
"Message","Message",,
|
||||
"Missing field","Champ manquant",,
|
||||
"Name","Nom",,
|
||||
"No Return Value","Aucune valeur",,
|
||||
"Non-unique key","Clé non unique",,
|
||||
"Origin","Origine",,
|
||||
"Reference","Référence",,
|
||||
"Reference ID","ID référence",,
|
||||
"Reimbursement","Remboursement",,
|
||||
"Reminder","Relance",,
|
||||
"Reported balance","A nouveaux",,
|
||||
"Show the batch","Afficher le batch",,
|
||||
"Show the reference","Afficher la référence",,
|
||||
"Technical anomaly","Anomalie technique",,
|
||||
"Trace","Trace",,
|
||||
"TraceBack","TraceBacks",,
|
||||
"Type","Type",,
|
||||
"User","Utilisateur",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalia",,
|
||||
"Batch","Lotto",,
|
||||
"CRM","CRM",,
|
||||
"Category","Categoria",,
|
||||
"Cause","Causa",,
|
||||
"Configuration problem","Problema di configurazione",,
|
||||
"Date","Data",,
|
||||
"Debt recovery","Recupero crediti",,
|
||||
"Direct debit","Addebito diretto",,
|
||||
"Doubtful customer","Cliente dubbioso",,
|
||||
"Error","Errore",,
|
||||
"Functional anomaly","Anomalia funzionale",,
|
||||
"ID","ID",,
|
||||
"Inconsistency","Incoerenza",,
|
||||
"Interbank payment order","Ordine di pagamento interbancario",,
|
||||
"Invoicing","Fatturazione",,
|
||||
"Message","Messaggio",,
|
||||
"Missing field","Campo mancante",,
|
||||
"Name","Nome",,
|
||||
"No Return Value","Nessun valore di ritorno",,
|
||||
"Non-unique key","Chiave non univoca",,
|
||||
"Origin","Origine",,
|
||||
"Reference","Riferimento",,
|
||||
"Reference ID","ID di riferimento",,
|
||||
"Reimbursement","Rimborso",,
|
||||
"Reminder","Promemoria",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Mostra il lotto",,
|
||||
"Show the reference","Mostra il riferimento",,
|
||||
"Technical anomaly","Anomalia tecnica",,
|
||||
"Trace","Traccia",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Tipo",,
|
||||
"User","Utente",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalie",,
|
||||
"Batch","Batch",,
|
||||
"CRM","CRM",,
|
||||
"Category","Categorie",,
|
||||
"Cause","Oorzaak",,
|
||||
"Configuration problem","Configuratie probleem",,
|
||||
"Date","Datum",,
|
||||
"Debt recovery","Invordering van schulden",,
|
||||
"Direct debit","Automatische incasso",,
|
||||
"Doubtful customer","Twijfelachtige klant",,
|
||||
"Error","Fout",,
|
||||
"Functional anomaly","Functionele anomalie",,
|
||||
"ID","ID",,
|
||||
"Inconsistency","Inconsistentie",,
|
||||
"Interbank payment order","Interbancaire betalingsopdracht",,
|
||||
"Invoicing","Facturatie",,
|
||||
"Message","Bericht",,
|
||||
"Missing field","Ontbrekend veld",,
|
||||
"Name","Naam",,
|
||||
"No Return Value","Geen retourwaarde",,
|
||||
"Non-unique key","Niet-unieke sleutel",,
|
||||
"Origin","Oorsprong",,
|
||||
"Reference","Referentie",,
|
||||
"Reference ID","Referentie-ID",,
|
||||
"Reimbursement","Vergoeding",,
|
||||
"Reminder","Herinnering",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Toon de batch",,
|
||||
"Show the reference","Toon de referentie",,
|
||||
"Technical anomaly","Technische anomalie",,
|
||||
"Trace","Sporen",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Type",,
|
||||
"User","Gebruiker",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalia",,
|
||||
"Batch","Partia",,
|
||||
"CRM","CRM",,
|
||||
"Category","Kategoria",,
|
||||
"Cause","Przyczyna",,
|
||||
"Configuration problem","Problem konfiguracji",,
|
||||
"Date","Data",,
|
||||
"Debt recovery","Odzyskiwanie długów",,
|
||||
"Direct debit","Polecenie zapłaty",,
|
||||
"Doubtful customer","Wątpliwy klient",,
|
||||
"Error","Błąd",,
|
||||
"Functional anomaly","Anomalia funkcjonalna",,
|
||||
"ID","IDENTYFIKATOR",,
|
||||
"Inconsistency","Niespójność",,
|
||||
"Interbank payment order","Międzybankowe zlecenie płatnicze",,
|
||||
"Invoicing","Fakturowanie",,
|
||||
"Message","Wiadomość",,
|
||||
"Missing field","Brakujące pole",,
|
||||
"Name","Nazwa",,
|
||||
"No Return Value","Nr Wartość zwrotu",,
|
||||
"Non-unique key","Klucz niejednoznaczny",,
|
||||
"Origin","Pochodzenie",,
|
||||
"Reference","Odniesienie",,
|
||||
"Reference ID","Identyfikator referencyjny",,
|
||||
"Reimbursement","Zwrot kosztów",,
|
||||
"Reminder","Przypomnienie",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Pokaż partię.",,
|
||||
"Show the reference","Pokaż odniesienie",,
|
||||
"Technical anomaly","Anomalia techniczna",,
|
||||
"Trace","Ścieżka",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Typ",,
|
||||
"User","Użytkownik",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Anomalia",,
|
||||
"Batch","Lote",,
|
||||
"CRM","CRM",,
|
||||
"Category","Categoria: Categoria",,
|
||||
"Cause","Causa",,
|
||||
"Configuration problem","Problema de configuração",,
|
||||
"Date","Data",,
|
||||
"Debt recovery","Recuperação de dívidas",,
|
||||
"Direct debit","Débito directo",,
|
||||
"Doubtful customer","Cliente duvidoso",,
|
||||
"Error","Erro",,
|
||||
"Functional anomaly","Anomalia funcional",,
|
||||
"ID","ID",,
|
||||
"Inconsistency","Inconsistência",,
|
||||
"Interbank payment order","Ordem de pagamento interbancária",,
|
||||
"Invoicing","Facturação",,
|
||||
"Message","Mensagem",,
|
||||
"Missing field","Campo em falta",,
|
||||
"Name","Nome e Sobrenome",,
|
||||
"No Return Value","Sem valor de retorno",,
|
||||
"Non-unique key","Chave não exclusiva",,
|
||||
"Origin","Origem",,
|
||||
"Reference","Referência",,
|
||||
"Reference ID","ID de referência",,
|
||||
"Reimbursement","Reembolso",,
|
||||
"Reminder","Lembrete",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Mostrar o lote",,
|
||||
"Show the reference","Mostrar a referência",,
|
||||
"Technical anomaly","Anomalia técnica",,
|
||||
"Trace","Rastrear",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Tipo de",,
|
||||
"User","Usuário",,
|
||||
|
@ -0,0 +1,35 @@
|
||||
"key","message","comment","context"
|
||||
"Anomaly","Аномалия",,
|
||||
"Batch","Пакет",,
|
||||
"CRM","CRM",,
|
||||
"Category","Категория",,
|
||||
"Cause","Потому что",,
|
||||
"Configuration problem","Проблема конфигурации",,
|
||||
"Date","Дата",,
|
||||
"Debt recovery","Взыскание задолженности",,
|
||||
"Direct debit","Прямой дебет",,
|
||||
"Doubtful customer","Сомнительный клиент",,
|
||||
"Error","Ошибка",,
|
||||
"Functional anomaly","Функциональная аномалия",,
|
||||
"ID","УДОСТОВЕРЕНИЕ ЛИЧНОСТИ",,
|
||||
"Inconsistency","несоответствие",,
|
||||
"Interbank payment order","Межбанковское платежное поручение",,
|
||||
"Invoicing","выставление счетов",,
|
||||
"Message","Сообщение",,
|
||||
"Missing field","Отсутствующее поле",,
|
||||
"Name","Имя",,
|
||||
"No Return Value","Нет возвратной стоимости",,
|
||||
"Non-unique key","Не-уникальный ключ",,
|
||||
"Origin","Происхождение",,
|
||||
"Reference","Ссылка",,
|
||||
"Reference ID","Ссылочный ID",,
|
||||
"Reimbursement","Возмещение",,
|
||||
"Reminder","Напоминание",,
|
||||
"Reported balance",,,
|
||||
"Show the batch","Показать партию",,
|
||||
"Show the reference","Показать ссылку",,
|
||||
"Technical anomaly","Техническая аномалия",,
|
||||
"Trace","Трассировка",,
|
||||
"TraceBack","TraceBack",,
|
||||
"Type","Тип",,
|
||||
"User","Пользователь",,
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<object-views xmlns="http://axelor.com/xml/ns/object-views"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">
|
||||
|
||||
<selection name='trace.back.type.select'>
|
||||
<option value='0'>Technical anomaly</option>
|
||||
<option value='1'>Functional anomaly</option>
|
||||
</selection>
|
||||
|
||||
<selection name='trace.back.category.select'>
|
||||
<option value='1'>Missing field</option>
|
||||
<option value='2'>Non-unique key</option>
|
||||
<option value='3'>No Return Value</option>
|
||||
<option value='4'>Configuration problem</option>
|
||||
<option value='5'>Inconsistency</option>
|
||||
</selection>
|
||||
|
||||
<selection name='trace.back.origin.select'>
|
||||
<option value='invoice'>Invoicing</option>
|
||||
<option value='reminder'>Reminder</option>
|
||||
<option value='debtRecovery'>Debt recovery</option>
|
||||
<option value='doubtfulCustomer'>Doubtful customer</option>
|
||||
<option value='reimbursement'>Reimbursement</option>
|
||||
<option value='directDebit'>Direct debit</option>
|
||||
<option value="interbankPaymentOrder">Interbank payment order</option>
|
||||
<option value="crm">CRM</option>
|
||||
<option value="reportedBalance">Reported balance</option>
|
||||
</selection>
|
||||
|
||||
</object-views>
|
||||
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<object-views xmlns="http://axelor.com/xml/ns/object-views"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">
|
||||
|
||||
<grid name="trace-back-grid" title="TraceBack" model="com.axelor.exception.db.TraceBack" orderBy="-id">
|
||||
<toolbar>
|
||||
<button name="newBtn" title="" hidden="true"/>
|
||||
<button name="editBtn" title="" hidden="true"/>
|
||||
<button name="saveBtn" title="" hidden="true"/>
|
||||
<button name="deleteBtn" title="" hidden="true"/>
|
||||
<button name="copyBtn" title="" hidden="true"/>
|
||||
<button name="cancelBtn" title="" hidden="true"/>
|
||||
</toolbar>
|
||||
<hilite color="danger" if="typeSelect == 0" />
|
||||
<field name="id"/>
|
||||
<field name="date"/>
|
||||
<field name="internalUser"/>
|
||||
<field name="origin" />
|
||||
<field name="typeSelect"/>
|
||||
<field name="categorySelect"/>
|
||||
<field name="exception"/>
|
||||
</grid>
|
||||
|
||||
<form name="trace-back-form" title="TraceBack" model="com.axelor.exception.db.TraceBack" onLoad="action-trace-back-load">
|
||||
<toolbar>
|
||||
<button name="newBtn" title="" hidden="true"/>
|
||||
<button name="editBtn" title="" hidden="true"/>
|
||||
<button name="saveBtn" title="" hidden="true"/>
|
||||
<button name="deleteBtn" title="" hidden="true"/>
|
||||
<button name="copyBtn" title="" hidden="true"/>
|
||||
<button name="cancelBtn" title="" hidden="true"/>
|
||||
</toolbar>
|
||||
<panel name="mainPanel" sidebar="true">
|
||||
<field name="date"/>
|
||||
<field name="internalUser"/>
|
||||
<field name="origin" />
|
||||
<field name="typeSelect"/>
|
||||
<field name="categorySelect"/>
|
||||
</panel>
|
||||
<panel name="referencePanel" title="Reference" showIf="ref" sidebar="true">
|
||||
<field name="ref" colSpan="10" />
|
||||
<field name="refId" title="ID" showIf="refId" colSpan="2" />
|
||||
<button name="showReferenceBtn" title="Show the reference" icon="fa-share" css="btn-primary" onClick="action-traceback-show-reference" />
|
||||
</panel>
|
||||
<panel name="batchPanel" title="Batch" showIf="batchId" sidebar="true" if="__config__.app.isApp('base')">
|
||||
<field name="batchId" colSpan="4" />
|
||||
<button name="showBatchBtn" title="Show the batch" icon="fa-share" css="btn-primary" onClick="action-batch-show-batch" colSpan="8" />
|
||||
</panel>
|
||||
<panel name="exceptionGroupPanel" title="Anomaly" canCollapse="true">
|
||||
<field name="exception" showTitle="false" colSpan="12"/>
|
||||
</panel>
|
||||
<panel name="errorGroupPanel" title="Error" canCollapse="true">
|
||||
<field name="error" showTitle="false" colSpan="12"/>
|
||||
</panel>
|
||||
<panel name="causeGroupPanel" title="Cause" canCollapse="true">
|
||||
<field name="cause" showTitle="false" colSpan="12"/>
|
||||
</panel>
|
||||
<panel name="messageGroupPanel" title="Message" canCollapse="true">
|
||||
<field name="message" showTitle="false" colSpan="12"/>
|
||||
</panel>
|
||||
<panel name="traceGroupPanel" title="Trace" canCollapse="true">
|
||||
<field name="trace" showTitle="false" colSpan="12"/>
|
||||
</panel>
|
||||
</form>
|
||||
|
||||
<action-attrs name="action-trace-back-load">
|
||||
<attribute name="hidden" for="categorySelect" expr="eval: !categorySelect"/>
|
||||
<attribute name="hidden" for="errorGroupPanel" expr="eval: !error"/>
|
||||
<attribute name="hidden" for="causeGroupPanel" expr="eval: !cause"/>
|
||||
<attribute name="hidden" for="messageGroupPanel" expr="eval: !message"/>
|
||||
<attribute name="hidden" for="traceGroupPanel" expr="eval: !trace"/>
|
||||
</action-attrs>
|
||||
|
||||
<action-method name="action-traceback-show-reference">
|
||||
<call class="com.axelor.exception.web.TraceBackController"
|
||||
method="showReference" />
|
||||
</action-method>
|
||||
|
||||
</object-views>
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.exception;
|
||||
|
||||
import com.axelor.auth.AuthModule;
|
||||
import com.axelor.db.JpaModule;
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class TestModule extends AbstractModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
install(new JpaModule("testUnit", true, true));
|
||||
install(new AuthModule());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.exception.db;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class TraceBackTest {
|
||||
|
||||
@Test
|
||||
public void testPersist() {
|
||||
|
||||
System.out.println("Test");
|
||||
String str = "test.test1.test2";
|
||||
String tab[] = str.split("\\.");
|
||||
System.out.println(tab.length);
|
||||
System.out.println(tab[0]);
|
||||
System.out.println(tab[1]);
|
||||
System.out.println(tab[2]);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
|
||||
<persistence-unit name="testUnit" transaction-type="RESOURCE_LOCAL">
|
||||
<provider>org.hibernate.ejb.HibernatePersistence</provider>
|
||||
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
|
||||
<properties>
|
||||
|
||||
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
|
||||
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/axelor-test" />
|
||||
|
||||
<property name="javax.persistence.jdbc.user" value="axelor" />
|
||||
<property name="javax.persistence.jdbc.password" value="" />
|
||||
|
||||
<!--
|
||||
value="create" to build a new database on each run;
|
||||
value="update" to modify an existing database;
|
||||
value="create-drop" means the same as "create" but also drops tables when Hibernate closes;
|
||||
value="validate" makes no changes to the database
|
||||
-->
|
||||
<property name="hibernate.hbm2ddl.auto" value="update" />
|
||||
|
||||
<!--
|
||||
<property name="hibernate.show_sql" value="true"/>
|
||||
-->
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
Reference in New Issue
Block a user