Search in sources :

Example 1 with ApplicationEventGroup

use of com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup in project cia by Hack23.

the class PageActionEventHelperImpl method createPageEvent.

@Override
public void createPageEvent(final ViewAction viewAction, final ApplicationEventGroup applicationEventGroup, final String page, final String pageMode, final String elementId) {
    String pageModeToUse;
    if (pageMode != null && elementId != null && pageMode.contains(elementId)) {
        pageModeToUse = pageMode.replace(elementId, "").replace("/", "");
    } else {
        pageModeToUse = pageMode;
    }
    if ((pageModeToUse == null || "".equals(pageModeToUse)) && ApplicationEventGroup.USER == applicationEventGroup) {
        pageModeToUse = "Overview";
    }
    final CreateApplicationEventRequest serviceRequest = new CreateApplicationEventRequest();
    serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    serviceRequest.setEventGroup(applicationEventGroup);
    serviceRequest.setApplicationOperation(ApplicationOperationType.READ);
    serviceRequest.setPage(StringUtils.defaultString(page));
    serviceRequest.setPageMode(StringUtils.defaultString(pageModeToUse));
    serviceRequest.setElementId(StringUtils.defaultString(elementId));
    serviceRequest.setActionName(viewAction.toString());
    serviceRequest.setUserId(UserContextUtil.getUserIdFromSecurityContext());
    serviceRequest.setApplicationMessage(viewAction.toString());
    applicationManager.service(serviceRequest);
}
Also used : CreateApplicationEventRequest(com.hack23.cia.service.api.action.application.CreateApplicationEventRequest)

Aggregations

CreateApplicationEventRequest (com.hack23.cia.service.api.action.application.CreateApplicationEventRequest)1