/** * Constructor used by the container for creating the {@link WindowContextQuotaHandler} based on the given * {@link WindowContextConfig} * @param windowContextConfig current window-context-config */ @Inject public DefaultWindowContextQuotaHandler(WindowContextConfig windowContextConfig) { this.maxWindowContextCount = windowContextConfig.getMaxWindowContextCount(); }
/** * {@inheritDoc} */ @Override public int getWindowContextTimeoutInMinutes() { return CodiUtils.lookupConfigFromEnvironment(null, Integer.class, super.getWindowContextTimeoutInMinutes()); }
/** * {@inheritDoc} */ @Override public boolean isAddWindowIdToActionUrlsEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isAddWindowIdToActionUrlsEnabled()); }
protected DefaultWindowContextManager(WindowContextConfig windowContextConfig, ConversationConfig conversationConfig, ProjectStage projectStage, BeanManager beanManager) { this.windowContextConfig = windowContextConfig; this.conversationConfig = conversationConfig; this.projectStage = projectStage; this.beanManager = beanManager; this.createWindowContextEventEnable = windowContextConfig.isCreateWindowContextEventEnabled(); this.closeWindowContextEventEnable = windowContextConfig.isCloseWindowContextEventEnabled(); init(); }
protected void init() { this.windowHandler = CodiUtils.getContextualReferenceByClass(WindowHandler.class); this.windowContextQuotaHandler = CodiUtils.getContextualReferenceByClass(WindowContextQuotaHandler.class); this.allowUnknownWindowIds = this.windowContextConfig.isUnknownWindowIdsAllowed(); this.urlParameterSupported = this.windowContextConfig.isUrlParameterSupported(); this.projectStageDevelopment = ProjectStage.Development == this.projectStage; }
public static void tryToRestoreTheWindowIdEagerly(FacesContext facesContext, EditableWindowContextManager windowContextManager, WindowHandler windowHandler, WindowContextConfig windowContextConfig) { if (RequestCache.getCurrentWindowContext() == null && windowContextConfig.isEagerWindowContextDetectionEnabled()) { //don't use: windowContextManager.getCurrentWindowContext(); //it would create a new window-id immediately and //it would break other features. String windowId = resolveWindowContextId(windowHandler, windowContextConfig.isUrlParameterSupported(), windowContextConfig.isUnknownWindowIdsAllowed()); if (windowId != null) { boolean active = windowContextManager.isWindowContextActive(windowId); if (active) { RequestCache.setCurrentWindowContext(windowContextManager.getWindowContext(windowId)); //don't remove it - e.g. needed as marker for the view-handler facesContext.getExternalContext().getRequestMap() .put(WindowContextManager.WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId); } } } }
/** * {@inheritDoc} */ @Override public boolean isCloseEmptyWindowContextsEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isCloseEmptyWindowContextsEnabled()); }
@Inject protected DefaultWindowHandler(WindowContextConfig config) { this.useWindowAwareUrlEncoding = config.isUrlParameterSupported(); }
/** * {@inheritDoc} */ @Override public boolean isCloseWindowContextEventEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isCloseWindowContextEventEnabled()); } }
/** * {@inheritDoc} */ @Override public boolean isUnknownWindowIdsAllowed() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isUnknownWindowIdsAllowed()); }
/** * {@inheritDoc} */ @Override public boolean isCreateWindowContextEventEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isCreateWindowContextEventEnabled()); }
/** * {@inheritDoc} */ @Override public boolean isEagerWindowContextDetectionEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isEagerWindowContextDetectionEnabled()); }
public static void tryToRestoreTheWindowIdEagerly(FacesContext facesContext, EditableWindowContextManager windowContextManager, WindowHandler windowHandler, WindowContextConfig windowContextConfig) { if (RequestCache.getCurrentWindowContext() == null && windowContextConfig.isEagerWindowContextDetectionEnabled()) { //don't use: windowContextManager.getCurrentWindowContext(); //it would create a new window-id immediately and //it would break other features. String windowId = resolveWindowContextId(windowHandler, windowContextConfig.isUrlParameterSupported(), windowContextConfig.isUnknownWindowIdsAllowed()); if (windowId != null) { boolean active = windowContextManager.isWindowContextActive(windowId); if (active) { RequestCache.setCurrentWindowContext(windowContextManager.getWindowContext(windowId)); //don't remove it - e.g. needed as marker for the view-handler facesContext.getExternalContext().getRequestMap() .put(WindowContextManager.WINDOW_CONTEXT_ID_PARAMETER_KEY, windowId); } } } }
protected void init() { this.windowHandler = CodiUtils.getContextualReferenceByClass(WindowHandler.class); this.windowContextQuotaHandler = CodiUtils.getContextualReferenceByClass(WindowContextQuotaHandler.class); this.allowUnknownWindowIds = this.windowContextConfig.isUnknownWindowIdsAllowed(); this.urlParameterSupported = this.windowContextConfig.isUrlParameterSupported(); this.projectStageDevelopment = ProjectStage.Development == this.projectStage; }
protected DefaultWindowContextManager(WindowContextConfig windowContextConfig, ConversationConfig conversationConfig, ProjectStage projectStage, BeanManager beanManager) { this.windowContextConfig = windowContextConfig; this.conversationConfig = conversationConfig; this.projectStage = projectStage; this.beanManager = beanManager; this.createWindowContextEventEnable = windowContextConfig.isCreateWindowContextEventEnabled(); this.closeWindowContextEventEnable = windowContextConfig.isCloseWindowContextEventEnabled(); init(); }
/** * {@inheritDoc} */ @Override public boolean isCloseEmptyWindowContextsEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isCloseEmptyWindowContextsEnabled()); }
@Inject protected DefaultWindowHandler(WindowContextConfig config) { this.useWindowAwareUrlEncoding = config.isUrlParameterSupported(); }
/** * {@inheritDoc} */ @Override public boolean isCloseWindowContextEventEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isCloseWindowContextEventEnabled()); } }
/** * {@inheritDoc} */ @Override public boolean isUnknownWindowIdsAllowed() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isUnknownWindowIdsAllowed()); }
/** * {@inheritDoc} */ @Override public boolean isCreateWindowContextEventEnabled() { return CodiUtils.lookupConfigFromEnvironment(null, Boolean.class, super.isCreateWindowContextEventEnabled()); }