Package org.apache.myfaces.extensions.cdi.jsf.impl.config.view.spi

Examples of org.apache.myfaces.extensions.cdi.jsf.impl.config.view.spi.ViewConfigEntry


        }
    }

    protected void addPageDefinition(Class pageDefinitionClass)
    {
        ViewConfigEntry newEntry = createViewConfigEntry(pageDefinitionClass);

        if(newEntry != null)
        {
            ViewConfigEntry existingEntry = ViewConfigCache.getViewDefinition(newEntry.getViewDefinitionClass());

            //TODO introduce an SPI with a better name
            if(/*viewConfigEntry != null*/existingEntry instanceof DefaultViewConfigEntry
                    && ((DefaultViewConfigEntry)existingEntry).isSimpleEntryMode())
            {
                //in this case the alternative view-controller approach which just adds page-beans was invoked before
                //-> we just have to use the page bean of the existing entry

                //here we have a simple-entry!   (which just contains page-bean definitions)
                for(PageBeanConfigEntry pageBeanConfigEntry : existingEntry.getPageBeanDefinitions())
                {
                    //add page-beans to the real entry
                    newEntry.addPageBean(pageBeanConfigEntry.getBeanClass());
                }
                ViewConfigCache.replaceViewDefinition(newEntry.getViewId(), newEntry);
View Full Code Here


        }

        String viewId;
        for(Class<? extends ViewConfig> viewConfigClass : view.value())
        {
            ViewConfigEntry viewConfigEntry = ViewConfigCache.getViewDefinition(viewConfigClass);

            if(viewConfigEntry == null)
            {
                ViewConfigEntry entry = createViewConfigEntry(viewConfigClass);

                if(entry != null)
                {
                    entry.addPageBean(annotatedType.getJavaClass());

                    //TODO introduce an SPI with a better name
                    if(entry instanceof DefaultViewConfigEntry)
                    {
                        ((DefaultViewConfigEntry)entry).activateSimpleEntryMode();
                    }
                    ViewConfigCache.addViewDefinition(entry.getViewId(), entry);
                }
            }
            else
            {
                viewConfigEntry.addPageBean(annotatedType.getJavaClass());
View Full Code Here

        if(viewConfigExtractor == null)
        {
            viewConfigExtractor = new DefaultViewConfigExtractor();
        }

        ViewConfigEntry result = viewConfigExtractor.extractViewConfig(viewDefinitionClass);
        return result;
    }
View Full Code Here

class DefaultViewConfigExtractor implements ViewConfigExtractor
{
    public ViewConfigEntry extractViewConfig(Class<? extends ViewConfig> viewDefinitionClass)
    {
        //use the interface to make clear which information we really need
        ViewConfigEntry scannedViewConfig = new DefaultViewConfigDefinitionEntry(viewDefinitionClass);

        scanViewConfigClass(viewDefinitionClass, (DefaultViewConfigDefinitionEntry)scannedViewConfig);

        return new DefaultViewConfigEntry(scannedViewConfig.getViewId(),
                                          viewDefinitionClass,
                                          scannedViewConfig.getNavigationMode(),
                                          scannedViewConfig.getViewParameter(),
                                          scannedViewConfig.getAccessDecisionVoters(),
                                          scannedViewConfig.getErrorView(),
                                          scannedViewConfig.getMetaData());
    }
View Full Code Here

    protected void initBeans(
            @Observes @BeforePhase(JsfPhaseId.RENDER_RESPONSE) PhaseEvent event, BeanManager beanManager)
    {
        String viewId = event.getFacesContext().getViewRoot().getViewId();

        ViewConfigEntry viewDefinitionEntry = ViewConfigCache.getViewDefinition(viewId);

        if(viewDefinitionEntry == null)
        {
            return;
        }

        List<PageBeanConfigEntry> beanEntries = viewDefinitionEntry.getPageBeanDefinitions();

        for(PageBeanConfigEntry beanEntry : beanEntries)
        {
            //resolve bean to trigger @PostConstruct if it isn't scoped
            CodiUtils.getOrCreateScopedInstanceOfBeanByName(beanManager, beanEntry.getBeanName(), Object.class);
View Full Code Here

            return;
        }

        this.windowContext.setAttribute(INITIALIZED_VIEW_ID_MARKER_KEY, viewId);

        ViewConfigEntry viewDefinitionEntry = ViewConfigCache.getViewDefinition(viewId);

        if (viewDefinitionEntry != null)
        {
            viewDefinitionEntry.invokeInitViewMethods();
        }
    }
View Full Code Here

        }
    }

    private void processPreRenderView(String viewId)
    {
        ViewConfigEntry viewDefinitionEntry = ViewConfigCache.getViewDefinition(viewId);

        if (viewDefinitionEntry != null)
        {
            viewDefinitionEntry.invokePreRenderViewMethods();
        }
    }
View Full Code Here

        }
    }

    private void processPostRenderView(String viewId)
    {
        ViewConfigEntry viewDefinitionEntry = ViewConfigCache.getViewDefinition(viewId);

        if (viewDefinitionEntry != null)
        {
            viewDefinitionEntry.invokePostRenderViewMethods();
        }
    }
View Full Code Here

            return;
        }

        String viewId = viewRoot.getViewId();

        ViewConfigEntry viewDefinitionEntry = ViewConfigCache.getViewDefinition(viewId);

        if(viewDefinitionEntry == null)
        {
            return;
        }

        List<PageBeanConfigEntry> beanEntries = viewDefinitionEntry.getPageBeanDefinitions();

        Object bean;
        RequestLifecycleCallbackEntry phasesLifecycleCallbackEntry;
        List<Method> lifecycleCallbacks;
View Full Code Here

        if(this.deactivated)
        {
            return;
        }
       
        ViewConfigEntry viewConfigEntry =
                ViewConfigCache.getViewDefinition(FacesContext.getCurrentInstance().getViewRoot().getViewId());

        if(viewConfigEntry != null)
        {
            viewConfigEntry.invokePrePageActionMethods();
        }

        this.wrapped.processAction(actionEvent);
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.jsf.impl.config.view.spi.ViewConfigEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.