if (!isEnabled() || !filter(action)) { return; traceResults(currentSession, currentUser, currentWorkspace, currentModule, callStack, actionEndEntry.context, actionEndEntry.startTimestamp, endTimestamp); if (currentCallStack.isEmpty()) {
/** * Process. * * @param action * the action * @param path * the path */ @Override protected void process(IDisplayableAction action, String path) { if (!isEnabled() || !filter(action)) { return; } if (LovAction.class.equals(action.getClass())) { String referencePropertyName = path; if (referencePropertyName != null) { int lastDotIndex = referencePropertyName.lastIndexOf("."); if (lastDotIndex >= 0) { referencePropertyName = referencePropertyName.substring(lastDotIndex + 1); } } lovActions.put(referencePropertyName, action); } else { userActions.add(action); } }
/** * Action start. * * @param action * the action * @param context * the context */ @Override public void actionStart(IAction action, Map<String, Object> context) { if (!isEnabled() || !filter(action)) { return; } Date startTimestamp = new Date(); if (currentCallStack.isEmpty()) { IFrontendController<?, ?, ?> frontendController = getFrontendController(context); if (frontendController != null) { currentSession = frontendController.getApplicationSession(); currentUser = currentSession.getPrincipal(); currentWorkspace = frontendController.getSelectedWorkspace(); currentModule = frontendController.getSelectedModule(); } else { IBackendController backendController = getBackendController(context); currentSession = backendController.getApplicationSession(); currentUser = backendController.getApplicationSession().getPrincipal(); } } currentCallStack.add(new ActionEntry(action, new HashMap<>(context), startTimestamp)); }
/** * Starts the plugin. * * @param context * the context */ @Override public synchronized void start(Map<String, Object> context) { if (!started) { IFrontendController<?, ?, ?> frontendController = getFrontendController(context); ActionsDirectoryBuilder actionsDirectoryBuilder = new ActionsDirectoryBuilder(); actionsDirectoryBuilder.process(frontendController); traceUserActionsInventory(actionsDirectoryBuilder.getUserActions(), actionsDirectoryBuilder.getLovActions(), frontendController); started = true; } } }