Search in sources :

Example 1 with BaseAction

use of com.agiletec.apsadmin.system.BaseAction in project entando-core by entando.

the class ActionLoggerInterceptor method intercept.

@Override
public String intercept(ActionInvocation invocation) throws Exception {
    ActionLogRecord actionRecord = null;
    String result = null;
    try {
        actionRecord = this.buildActionRecord(invocation);
        result = invocation.invoke();
        List<ActivityStreamInfo> asiList = null;
        Object actionObject = invocation.getAction();
        if (actionObject instanceof BaseAction) {
            BaseAction action = (BaseAction) actionObject;
            asiList = action.getActivityStreamInfos();
        }
        if (null == asiList || asiList.isEmpty()) {
            this.getActionLoggerManager().addActionRecord(actionRecord);
        } else {
            for (int i = 0; i < asiList.size(); i++) {
                ActivityStreamInfo asi = asiList.get(i);
                ActionLogRecord clone = this.createClone(actionRecord);
                clone.setActivityStreamInfo(asi);
                this.getActionLoggerManager().addActionRecord(clone);
            }
        }
    } catch (Throwable t) {
        _logger.error("error in intercept", t);
    // ApsSystemUtils.logThrowable(t, this, "intercept");
    }
    return result;
}
Also used : ActionLogRecord(org.entando.entando.aps.system.services.actionlog.model.ActionLogRecord) ActivityStreamInfo(org.entando.entando.aps.system.services.actionlog.model.ActivityStreamInfo) BaseAction(com.agiletec.apsadmin.system.BaseAction)

Aggregations

BaseAction (com.agiletec.apsadmin.system.BaseAction)1 ActionLogRecord (org.entando.entando.aps.system.services.actionlog.model.ActionLogRecord)1 ActivityStreamInfo (org.entando.entando.aps.system.services.actionlog.model.ActivityStreamInfo)1