/** * {@inheritDoc} */ @Override public IApplicationSession getApplicationSession() { return getBackendController().getApplicationSession(); }
/** * {@inheritDoc} */ public IApplicationSession getApplicationSession() { return getBackendController().getApplicationSession(); }
/** * Gets the current application session. * * @param context * the action context. * @return the current application session. */ protected IApplicationSession getApplicationSession( Map<String, Object> context) { return getController(context).getApplicationSession(); }
/** * Gets the current application session. * * @param context * the action context. * @return the current application session. */ protected IApplicationSession getApplicationSession( Map<String, Object> context) { return getController(context).getApplicationSession(); }
/** * Gets the principal of the application session. * <p/> * {@inheritDoc} */ @Override protected UserPrincipal getPrincipal() { return getBackendController().getApplicationSession().getPrincipal(); } }
/** * Gets the principal of the application session. * <p/> * {@inheritDoc} * * @return the principal */ protected UserPrincipal getPrincipal() { return getBackendController().getApplicationSession().getPrincipal(); }
/** * {@inheritDoc} */ @Override protected UserPrincipal getPrincipal() { return getBackendController().getApplicationSession().getPrincipal(); }
/** * Gets the locale. * * @return the locale. */ public Locale getLocale() { return getBackendController().getApplicationSession().getLocale(); }
/** * Configures session on the backend controller. * * @param subject * the JAAS subject containing the user principal. * @param locale * the locale to use. */ protected void configureApplicationSession(Subject subject, Locale locale) { IApplicationSession session = getBackendController() .getApplicationSession(); session.setSubject(subject); session.setLocale(locale); }
String sessionProperty = ((String) initializedAttributeValue) .substring(SESSION_PROPERTY_PREFIX.length()); IApplicationSession applicationSession = getBackendController().getApplicationSession(); if (applicationSession != null) { Class<?> sessionContract = applicationSession.getClass();
/** * This method installs the security subject into the application session. * * @param subject * the authenticated user subject. */ protected void loginSuccess(Subject subject) { getBackendController().getApplicationSession().setSubject(subject); String userPreferredLanguageCode = (String) getBackendController() .getApplicationSession().getPrincipal().getCustomProperty( UserPrincipal.LANGUAGE_PROPERTY); if (userPreferredLanguageCode != null) { getBackendController().getApplicationSession().setLocale( new Locale(userPreferredLanguageCode)); } if (workspaces != null) { for (Workspace workspace : workspaces.values()) { translateWorkspace(workspace); } getBackendController().installWorkspaces(workspaces); } }
/** * 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)); }
/** * Sets the JAAS subject to subject aware extensions. Sets the backend * controller to entity lifecycle handler aware extensions. * <p/> * {@inheritDoc} */ @Override protected void configureExtension(IComponentExtension<IComponent> extension) { super.configureExtension(extension); if (getBackendController() != null) { if (extension instanceof ISubjectAware) { ((ISubjectAware) extension).setSubject(getBackendController().getApplicationSession().getSubject()); } if (extension instanceof IApplicationSessionAware) { ((IApplicationSessionAware) extension).setApplicationSession(getBackendController().getApplicationSession()); } } if (extension instanceof IEntityLifecycleHandlerAware) { ((IEntityLifecycleHandlerAware) extension).setEntityLifecycleHandler(getBackendController()); } }
/** * Sets the JAAS subject to subject aware extensions. * <p> * {@inheritDoc} */ @Override protected void configureExtension(IComponentExtension<IComponent> extension) { super.configureExtension(extension); if (getBackendController() != null) { if (extension instanceof ISubjectAware) { ((ISubjectAware) extension).setSubject(getBackendController() .getApplicationSession().getSubject()); } if (extension instanceof IApplicationSessionAware) { ((IApplicationSessionAware) extension) .setApplicationSession(getBackendController() .getApplicationSession()); } } if (extension instanceof IEntityLifecycleHandlerAware) { ((IEntityLifecycleHandlerAware) extension) .setEntityLifecycleHandler(getBackendController()); } }
reportDesign.getContext()); reportContext.putAll(context); UserPrincipal user = getController(context).getApplicationSession() .getPrincipal(); reportContext.putAll(user.getCustomProperties());
/** * {@inheritDoc} */ @Override public Locale getLocale() { if (getBackendController() != null) { Locale sessionLocale = getBackendController().getApplicationSession().getLocale(); if (sessionLocale != null) { return sessionLocale; } } if (getForcedStartingLocale() != null) { return LocaleUtils.toLocale(getForcedStartingLocale()); } return clientLocale; }
reportDesign.getContext()); reportContext.putAll(context); UserPrincipal user = getController(context).getApplicationSession() .getPrincipal(); reportContext.putAll(user.getCustomProperties());
/** * Executes frontend actions and delegates backend actions execution to its * peer backend controller. * <p> * {@inheritDoc} */ public boolean execute(IAction action, Map<String, Object> context) { if (action == null) { return true; } Map<String, Object> actionContext = getInitialActionContext(); context.putAll(actionContext); try { SecurityHelper.checkAccess(getBackendController().getApplicationSession() .getSubject(), action, getTranslationProvider(), getLocale()); if (action.isBackend()) { return executeBackend(action, context); } return executeFrontend(action, context); } catch (Throwable ex) { handleException(ex, context); return false; } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = getDialogActions(context); context.put(ModalDialogAction.DIALOG_ACTIONS, actions); IViewDescriptor editViewDescriptor = getViewDescriptor(context); IView<E> dialogView = getViewFactory(context).createView(editViewDescriptor, actionHandler, getLocale(context)); String dialogTitle = getI18nName(getTranslationProvider(context), getLocale(context)); if (dialogTitle != null && dialogTitle.length() > 0) { context.put(ModalDialogAction.DIALOG_TITLE, dialogTitle); } context.put(ModalDialogAction.DIALOG_VIEW, dialogView); Object component = getComponentToEdit(context); IModelDescriptor modelDescriptor = getEditModelDescriptor(context); if (modelDescriptor == null && editViewDescriptor instanceof ICardViewDescriptor) { ICardViewDescriptor cvd = (ICardViewDescriptor) editViewDescriptor; String cardName = cvd.getCardNameForModel(component, getBackendController(context).getApplicationSession() .getSubject()); IViewDescriptor vd = cvd.getCardViewDescriptor(cardName); modelDescriptor = vd.getModelDescriptor(); } IValueConnector componentConnector = getBackendController(context).createModelConnector(ACTION_MODEL_NAME, modelDescriptor); componentConnector.setConnectorValue(component); getMvcBinder(context).bind(dialogView.getConnector(), componentConnector); return super.execute(actionHandler, context); }