public FaceletViewDeclarationLanguageStrategy() { FacesContext context = FacesContext.getCurrentInstance(); ExternalContext eContext = context.getExternalContext(); _acceptPatterns = loadAcceptPattern(eContext); _extension = loadFaceletExtension(eContext); _language = new FaceletViewDeclarationLanguage(context); }
/** * Initialize the ViewHandler during its first request. */ protected void initialize(FacesContext context) { log.finest("Initializing"); Compiler compiler = createCompiler(context); _faceletFactory = createFaceletFactory(context, compiler); ExternalContext eContext = context.getExternalContext(); _initializeBuffer(eContext); _initializeMode(eContext); log.finest("Initialization Successful"); }
/** * {@inheritDoc} */ @Override public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) { // Use partial state saving strategy only if javax.faces.PARTIAL_STATE_SAVING is "true" and // the current view is not on javax.faces.FULL_STATE_SAVING_VIEW_IDS. if (_partialStateSaving && _stateMgmtStrategy == null) { _stateMgmtStrategy = new DefaultFaceletsStateManagementStrategy(); } return _usePartialStateSavingOnThisView(viewId) ? _stateMgmtStrategy : null; }
public static void markComponentToRestoreFully(FacesContext context, UIComponent component) { if (MyfacesConfig.getCurrentInstance(context.getExternalContext()).isRefreshTransientBuildOnPSSPreserveState()) { component.getAttributes().put(DefaultFaceletsStateManagementStrategy.COMPONENT_ADDED_AFTER_BUILD_VIEW, ComponentState.REMOVE_ADD); } //component.subscribeToEvent(PostAddToViewEvent.class, new RestoreComponentFullyListener()); if (FaceletViewDeclarationLanguage.isRefreshTransientBuildOnPSSAuto(context)) { FaceletViewDeclarationLanguage.cleanTransientBuildOnRestore(context); } }
public void buildView(FacesContext context, UIViewRoot view) throws IOException if (isFilledView(context, view)) return; String renderedViewId = getRenderedViewId(context, view.getViewId()); boolean usePartialStateSavingOnThisView = _usePartialStateSavingOnThisView(renderedViewId); boolean refreshTransientBuild = (view.getChildCount() > 0); boolean refreshTransientBuildOnPSS = (usePartialStateSavingOnThisView && _refreshTransientBuildOnPSS); _getFacelet(renderedViewId).apply(context, view); FaceletViewDeclarationLanguage._publishPostBuildComponentTreeOnRestoreViewEvent(context, view); setFilledView(context, view); setFilledView(context, view); setFilledView(context, view); ((DefaultFaceletsStateManagementStrategy) getStateManagementStrategy(context, view.getViewId())).suscribeListeners(view);
ResponseWriter origWriter = createResponseWriter(context); handleFaceletNotFound(context, view.getViewId()); handleRenderException(context, e);
_publishPostBuildComponentTreeOnRestoreViewEvent(context, child); currentChild = child; child = children.get(i); _publishPostBuildComponentTreeOnRestoreViewEvent(context, child);
if (mctx.isUsingPSSOnThisView()) FaceletViewDeclarationLanguage.cleanTransientBuildOnRestore(faces);
public void buildView(FacesContext context, UIViewRoot view) throws IOException if (isFilledView(context, view)) return; String renderedViewId = getRenderedViewId(context, view.getViewId()); boolean usePartialStateSavingOnThisView = _usePartialStateSavingOnThisView(renderedViewId); boolean refreshTransientBuild = (view.getChildCount() > 0); boolean refreshTransientBuildOnPSS = (usePartialStateSavingOnThisView && _refreshTransientBuildOnPSS); _getFacelet(renderedViewId).apply(context, view); FaceletViewDeclarationLanguage._publishPostBuildComponentTreeOnRestoreViewEvent(context, view); setFilledView(context, view); setFilledView(context, view); setFilledView(context, view); _markInitialStateOnView(view, refreshTransientBuildOnPSS); context.getAttributes().remove(StateManager.IS_BUILDING_INITIAL_STATE); context.getAttributes().remove(MARK_INITIAL_STATE_KEY); ((DefaultFaceletsStateManagementStrategy) getStateManagementStrategy(context, view.getViewId())).suscribeListeners(view);
ResponseWriter origWriter = createResponseWriter(context); handleFaceletNotFound(context, view.getViewId()); handleRenderException(context, e);
public static void markComponentToRestoreFully(FacesContext context, UIComponent component) { if (MyfacesConfig.getCurrentInstance(context.getExternalContext()).isRefreshTransientBuildOnPSSPreserveState()) { component.getAttributes().put(DefaultFaceletsStateManagementStrategy.COMPONENT_ADDED_AFTER_BUILD_VIEW, ComponentState.REMOVE_ADD); } //component.subscribeToEvent(PostAddToViewEvent.class, new RestoreComponentFullyListener()); if (FaceletViewDeclarationLanguage.isRefreshTransientBuildOnPSSAuto(context)) { FaceletViewDeclarationLanguage.cleanTransientBuildOnRestore(context); } } }
_publishPostBuildComponentTreeOnRestoreViewEvent(context, child); currentChild = child; _publishPostBuildComponentTreeOnRestoreViewEvent(context, child);
if (isFilledView(context, view)) String renderedViewId = getRenderedViewId(context, previousViewId); boolean usePartialStateSavingOnThisView = _usePartialStateSavingOnThisView(renderedViewId); boolean refreshTransientBuild = (view.getChildCount() > 0); boolean refreshTransientBuildOnPSS = (usePartialStateSavingOnThisView && _refreshTransientBuildOnPSS); RestoreViewFromPoolResult result = tryRestoreViewFromCache(context, view); if (result != null) getStateManagementStrategy(context, view.getViewId())). suscribeListeners(view); setFilledView(context, view); setFilledView(context, view); _getFacelet(context, renderedViewId).apply(context, view); VisitContext visitContext = (VisitContext) getVisitContextFactory(). getVisitContext(context, null, VISIT_HINTS_DYN_REFRESH); view.visitTree(visitContext, new PublishDynamicComponentRefreshTransientBuildCallback()); FaceletViewDeclarationLanguage._publishPostBuildComponentTreeOnRestoreViewEvent(context, view); setFilledView(context, view); setFilledView(context, view);
/** * Initialize the ViewHandler during its first request. */ protected void initialize(FacesContext context) { log.finest("Initializing"); Compiler compiler = createCompiler(context); _faceletFactory = createFaceletFactory(context, compiler); ExternalContext eContext = context.getExternalContext(); _initializeBuffer(eContext); _initializeMode(eContext); log.finest("Initialization Successful"); }
ResponseWriter origWriter = createResponseWriter(context); handleFaceletNotFound(context, view.getViewId()); handleRenderException(context, e);
public static void markComponentToRestoreFully(FacesContext context, UIComponent component) { if (MyfacesConfig.getCurrentInstance(context.getExternalContext()).isRefreshTransientBuildOnPSSPreserveState()) { component.getAttributes().put(DefaultFaceletsStateManagementStrategy.COMPONENT_ADDED_AFTER_BUILD_VIEW, ComponentState.REMOVE_ADD); } //component.subscribeToEvent(PostAddToViewEvent.class, new RestoreComponentFullyListener()); if (FaceletViewDeclarationLanguage.isRefreshTransientBuildOnPSSAuto(context)) { FaceletViewDeclarationLanguage.cleanTransientBuildOnRestore(context); } } }
public FaceletViewDeclarationLanguageStrategy() { FacesContext context = FacesContext.getCurrentInstance(); ExternalContext eContext = context.getExternalContext(); _acceptPatterns = loadAcceptPattern(eContext); _extension = loadFaceletExtension(eContext); _language = new FaceletViewDeclarationLanguage(context, this); }
/** * {@inheritDoc} */ @Override public StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId) { // Use partial state saving strategy only if javax.faces.PARTIAL_STATE_SAVING is "true" and // the current view is not on javax.faces.FULL_STATE_SAVING_VIEW_IDS. if (_partialStateSaving && _stateMgmtStrategy == null) { _stateMgmtStrategy = new DefaultFaceletsStateManagementStrategy(context); } return _usePartialStateSavingOnThisView(viewId) ? _stateMgmtStrategy : null; }
_publishPostBuildComponentTreeOnRestoreViewEvent(context, child); currentChild = child; _publishPostBuildComponentTreeOnRestoreViewEvent(context, child);
/** * Initialize the ViewHandler during its first request. */ protected void initialize(FacesContext context) { log.finest("Initializing"); Compiler compiler = createCompiler(context); _faceletFactory = createFaceletFactory(context, compiler); ExternalContext eContext = context.getExternalContext(); _initializeBuffer(eContext); _initializeMode(eContext); _initializeContractMappings(eContext); // Create a component ids cache and store it on application map to // reduce the overhead associated with create such ids over and over. MyfacesConfig mfConfig = MyfacesConfig.getCurrentInstance(eContext); if (mfConfig.getComponentUniqueIdsCacheSize() > 0) { String[] componentIdsCached = SectionUniqueIdCounter.generateUniqueIdCache("_", mfConfig.getComponentUniqueIdsCacheSize()); eContext.getApplicationMap().put( CACHED_COMPONENT_IDS, componentIdsCached); } _viewPoolProcessor = ViewPoolProcessor.getInstance(context); log.finest("Initialization Successful"); }