Package org.apache.myfaces.extensions.cdi.jsf.api.config.view

Examples of org.apache.myfaces.extensions.cdi.jsf.api.config.view.Page


        List<Annotation> viewMetaDataList = new ArrayList<Annotation>();
        List<Class<? extends Annotation>> foundAndBlockedMetaDataTypes = new ArrayList<Class<? extends Annotation>>();

        //TODO
        Page pageAnnotation;
        Secured securedAnnotation;
        while(!Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if(currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                Collections.addAll(foundVoters, securedAnnotation.value());

                if(errorView == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    errorView = securedAnnotation.errorView();
                }
            }

            //meta-data
            viewMetaDataList.addAll(extractViewMetaData(currentClass, foundAndBlockedMetaDataTypes));

            //page definition
            if(currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if(!pageAnnotation.extension().equals(defaultExtension))
                {
                    extension = pageAnnotation.extension();
                }

                if(!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if(!".".equals(currentBasePath))
                    {
                        simpleClassNameToPathMapping.put(currentClass.getSimpleName(), currentBasePath);
                    }

                    if(rootPath.equals(basePath))
                    {
                        basePath = currentBasePath;
                    }
                }

                if(navigationMode == null && !pageAnnotation.navigation().equals(defaultNavigationMode))
                {
                    navigationMode = pageAnnotation.navigation();
                }

                if(viewParameter == null && !pageAnnotation.viewParams().equals(defaultViewParameter))
                {
                    viewParameter = pageAnnotation.viewParams();
                }

                if(!pageAnnotation.name().equals(defaultPageName))
                {
                    pageName = pageAnnotation.name();
                }
            }

            currentClass = currentClass.getSuperclass();
        }
View Full Code Here


        String defaultExtension = DefaultViewConfigDefinitionEntry.DEFAULT_EXTENSION;
        String defaultPageName = DefaultViewConfigDefinitionEntry.DEFAULT_PAGE_NAME;
        String rootPath = DefaultViewConfigDefinitionEntry.ROOT_PATH;

        String currentBasePath;
        Page pageAnnotation;
        Secured securedAnnotation;

        Class<?> currentClass = viewDefinitionClass;
        while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if (currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                scannedViewConfig.addAccessDecisionVoters(securedAnnotation.value());

                if (scannedViewConfig.getErrorView() == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    scannedViewConfig.setErrorView(securedAnnotation.errorView());
                }
            }

            //meta-data
            scannedViewConfig.addMetaData(
                    extractViewMetaData(currentClass, scannedViewConfig));

            //page definition
            if (currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if (!pageAnnotation.extension().equals(defaultExtension))
                {
                    scannedViewConfig.setExtension(pageAnnotation.extension());
                }

                if (!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if (!".".equals(currentBasePath))
                    {
                        scannedViewConfig
                                .setSimpleClassNameToPathMapping(currentClass.getSimpleName(), currentBasePath);
                    }

                    if (rootPath.equals(scannedViewConfig.getBasePath()))
                    {
                        scannedViewConfig.setBasePath(currentBasePath);
                    }
                }

                if (!scannedViewConfig.isKnownNavigationMode() &&
                        !pageAnnotation.navigation().equals(Page.NavigationMode.DEFAULT))
                {
                    scannedViewConfig.setNavigationMode(pageAnnotation.navigation());
                }

                if (!scannedViewConfig.isKnownViewParameter() &&
                        !pageAnnotation.viewParams().equals(Page.ViewParameter.DEFAULT))
                {
                    scannedViewConfig.setViewParameter(pageAnnotation.viewParams());
                }

                if (!pageAnnotation.name().equals(defaultPageName))
                {
                    scannedViewConfig.setPageName(pageAnnotation.name());
                }
            }

            //scan interfaces
            for(Class interfaceClass : currentClass.getInterfaces())
View Full Code Here

        String defaultExtension = ExtractedViewConfigDefinitionEntry.DEFAULT_EXTENSION;
        String defaultPageName = ExtractedViewConfigDefinitionEntry.DEFAULT_PAGE_NAME;
        String rootPath = ExtractedViewConfigDefinitionEntry.ROOT_PATH;

        String currentBasePath;
        Page pageAnnotation;
        Secured securedAnnotation;

        Class<?> currentClass = viewDefinitionClass;
        while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if (currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                scannedViewConfig.addAccessDecisionVoters(securedAnnotation.value());

                if (scannedViewConfig.getErrorView() == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    scannedViewConfig.setErrorView(securedAnnotation.errorView());
                }
            }

            //meta-data
            scannedViewConfig.addMetaData(
                    extractViewMetaData(currentClass, scannedViewConfig));

            //page definition
            if (currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if (!pageAnnotation.extension().equals(defaultExtension))
                {
                    scannedViewConfig.setExtension(pageAnnotation.extension());
                }

                if (!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if (!".".equals(currentBasePath))
                    {
                        scannedViewConfig
                                .setSimpleClassNameToPathMapping(currentClass.getSimpleName(), currentBasePath);
                    }

                    if (rootPath.equals(scannedViewConfig.getBasePath()))
                    {
                        scannedViewConfig.setBasePath(currentBasePath);
                    }
                }

                if (!scannedViewConfig.isKnownNavigationMode() &&
                        !pageAnnotation.navigation().equals(Page.NavigationMode.DEFAULT))
                {
                    scannedViewConfig.setNavigationMode(pageAnnotation.navigation());
                }

                if (!scannedViewConfig.isKnownViewParameter() &&
                        !pageAnnotation.viewParams().equals(Page.ViewParameter.DEFAULT))
                {
                    scannedViewConfig.setViewParameter(pageAnnotation.viewParams());
                }

                if (!pageAnnotation.name().equals(defaultPageName))
                {
                    scannedViewConfig.setPageName(pageAnnotation.name());
                }
            }

            //scan interfaces
            for(Class interfaceClass : currentClass.getInterfaces())
View Full Code Here

        String defaultExtension = ExtractedViewConfigDefinitionEntry.DEFAULT_EXTENSION;
        String defaultPageName = ExtractedViewConfigDefinitionEntry.DEFAULT_PAGE_NAME;
        String rootPath = ExtractedViewConfigDefinitionEntry.ROOT_PATH;

        String currentBasePath;
        Page pageAnnotation;
        Secured securedAnnotation;

        Class<?> currentClass = viewDefinitionClass;
        while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if (currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                scannedViewConfig.addAccessDecisionVoters(securedAnnotation.value());

                if (scannedViewConfig.getErrorView() == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    scannedViewConfig.setErrorView(securedAnnotation.errorView());
                }
            }

            //meta-data
            scannedViewConfig.addMetaData(
                    extractViewMetaData(currentClass, scannedViewConfig));

            //page definition
            if (currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if (!pageAnnotation.extension().equals(defaultExtension))
                {
                    scannedViewConfig.setExtension(pageAnnotation.extension());
                }

                if (!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if (!".".equals(currentBasePath))
                    {
                        scannedViewConfig
                                .setSimpleClassNameToPathMapping(currentClass.getSimpleName(), currentBasePath);
                    }

                    if (rootPath.equals(scannedViewConfig.getBasePath()))
                    {
                        scannedViewConfig.setBasePath(currentBasePath);
                    }
                }

                if (!scannedViewConfig.isKnownNavigationMode() &&
                        !pageAnnotation.navigation().equals(Page.NavigationMode.DEFAULT))
                {
                    scannedViewConfig.setNavigationMode(pageAnnotation.navigation());
                }

                if (!scannedViewConfig.isKnownViewParameterMode() &&
                        !pageAnnotation.viewParams().equals(Page.ViewParameterMode.DEFAULT))
                {
                    scannedViewConfig.setViewParameterMode(pageAnnotation.viewParams());
                }

                if (!pageAnnotation.name().equals(defaultPageName))
                {
                    scannedViewConfig.setPageName(pageAnnotation.name());
                }
            }

            //scan interfaces
            for(Class interfaceClass : currentClass.getInterfaces())
View Full Code Here

        String defaultExtension = ExtractedViewConfigDefinitionEntry.DEFAULT_EXTENSION;
        String defaultPageName = ExtractedViewConfigDefinitionEntry.DEFAULT_PAGE_NAME;
        String rootPath = ExtractedViewConfigDefinitionEntry.ROOT_PATH;

        String currentBasePath;
        Page pageAnnotation;
        Secured securedAnnotation;

        Class<?> currentClass = viewDefinitionClass;
        while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if (currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                scannedViewConfig.addAccessDecisionVoters(securedAnnotation.value());

                if (scannedViewConfig.getErrorView() == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    scannedViewConfig.setErrorView(securedAnnotation.errorView());
                }
            }

            //meta-data
            scannedViewConfig.addMetaData(
                    extractViewMetaData(currentClass, scannedViewConfig));

            //page definition
            if (currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if (!pageAnnotation.extension().equals(defaultExtension))
                {
                    scannedViewConfig.setExtension(pageAnnotation.extension());
                }

                if (!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if (!".".equals(currentBasePath))
                    {
                        scannedViewConfig
                                .setSimpleClassNameToPathMapping(currentClass.getSimpleName(), currentBasePath);
                    }

                    if (rootPath.equals(scannedViewConfig.getBasePath()))
                    {
                        scannedViewConfig.setBasePath(currentBasePath);
                    }
                }

                if (!scannedViewConfig.isKnownNavigationMode() &&
                        !pageAnnotation.navigation().equals(Page.NavigationMode.DEFAULT))
                {
                    scannedViewConfig.setNavigationMode(pageAnnotation.navigation());
                }

                if (!scannedViewConfig.isKnownViewParameterMode() &&
                        !pageAnnotation.viewParams().equals(Page.ViewParameterMode.DEFAULT))
                {
                    scannedViewConfig.setViewParameterMode(pageAnnotation.viewParams());
                }

                if (!pageAnnotation.name().equals(defaultPageName))
                {
                    scannedViewConfig.setPageName(pageAnnotation.name());
                }
            }

            //scan interfaces
            for(Class interfaceClass : currentClass.getInterfaces())
View Full Code Here

        String defaultExtension = ExtractedViewConfigDefinitionEntry.DEFAULT_EXTENSION;
        String defaultPageName = ExtractedViewConfigDefinitionEntry.DEFAULT_PAGE_NAME;
        String rootPath = ExtractedViewConfigDefinitionEntry.ROOT_PATH;

        String currentBasePath;
        Page pageAnnotation;
        Secured securedAnnotation;

        Class<?> currentClass = viewDefinitionClass;
        while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if (currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                scannedViewConfig.addAccessDecisionVoters(securedAnnotation.value());

                if (scannedViewConfig.getErrorView() == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    scannedViewConfig.setErrorView(securedAnnotation.errorView());
                }
            }

            //meta-data
            scannedViewConfig.addMetaData(
                    extractViewMetaData(currentClass, scannedViewConfig));

            //page definition
            if (currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if (!pageAnnotation.extension().equals(defaultExtension))
                {
                    scannedViewConfig.setExtension(pageAnnotation.extension());
                }

                if (!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if (!".".equals(currentBasePath))
                    {
                        scannedViewConfig
                                .setSimpleClassNameToPathMapping(currentClass.getSimpleName(), currentBasePath);
                    }
                    else if (rootPath.equals(scannedViewConfig.getBasePath()))
                    {
                        scannedViewConfig.setBasePath(currentBasePath);
                    }
                }

                if (!scannedViewConfig.isKnownNavigationMode() &&
                        !pageAnnotation.navigation().equals(Page.NavigationMode.DEFAULT))
                {
                    scannedViewConfig.setNavigationMode(pageAnnotation.navigation());
                }

                if (!scannedViewConfig.isKnownViewParameterMode() &&
                        !pageAnnotation.viewParams().equals(Page.ViewParameterMode.DEFAULT))
                {
                    scannedViewConfig.setViewParameterMode(pageAnnotation.viewParams());
                }

                if (!pageAnnotation.name().equals(defaultPageName))
                {
                    scannedViewConfig.setPageName(pageAnnotation.name());
                }
            }

            //scan interfaces
            for(Class interfaceClass : currentClass.getInterfaces())
View Full Code Here

        String defaultExtension = ExtractedViewConfigDefinitionEntry.DEFAULT_EXTENSION;
        String defaultPageName = ExtractedViewConfigDefinitionEntry.DEFAULT_PAGE_NAME;
        String rootPath = ExtractedViewConfigDefinitionEntry.ROOT_PATH;

        String currentBasePath;
        Page pageAnnotation;
        Secured securedAnnotation;

        Class<?> currentClass = viewDefinitionClass;
        while (currentClass != null && !Object.class.getName().equals(currentClass.getName()))
        {
            //security
            if (currentClass.isAnnotationPresent(Secured.class))
            {
                securedAnnotation = currentClass.getAnnotation(Secured.class);
                scannedViewConfig.addAccessDecisionVoters(securedAnnotation.value());

                if (scannedViewConfig.getErrorView() == null &&
                        !DefaultErrorView.class.getName().equals(securedAnnotation.errorView().getName()))
                {
                    scannedViewConfig.setErrorView(securedAnnotation.errorView());
                }
            }

            //meta-data
            scannedViewConfig.addMetaData(
                    extractViewMetaData(currentClass, scannedViewConfig));

            //page definition
            if (currentClass.isAnnotationPresent(Page.class))
            {
                pageAnnotation = currentClass.getAnnotation(Page.class);

                if (!pageAnnotation.extension().equals(defaultExtension))
                {
                    scannedViewConfig.setExtension(pageAnnotation.extension());
                }

                if (!pageAnnotation.basePath().equals(rootPath))
                {
                    currentBasePath = pageAnnotation.basePath();

                    if (!".".equals(currentBasePath))
                    {
                        scannedViewConfig
                                .setSimpleClassNameToPathMapping(currentClass.getSimpleName(), currentBasePath);
                    }

                    if (rootPath.equals(scannedViewConfig.getBasePath()))
                    {
                        scannedViewConfig.setBasePath(currentBasePath);
                    }
                }

                if (!scannedViewConfig.isKnownNavigationMode() &&
                        !pageAnnotation.navigation().equals(Page.NavigationMode.DEFAULT))
                {
                    scannedViewConfig.setNavigationMode(pageAnnotation.navigation());
                }

                if (!scannedViewConfig.isKnownViewParameterMode() &&
                        !pageAnnotation.viewParams().equals(Page.ViewParameterMode.DEFAULT))
                {
                    scannedViewConfig.setViewParameterMode(pageAnnotation.viewParams());
                }

                if (!pageAnnotation.name().equals(defaultPageName))
                {
                    scannedViewConfig.setPageName(pageAnnotation.name());
                }
            }

            //scan interfaces
            for(Class interfaceClass : currentClass.getInterfaces())
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.jsf.api.config.view.Page

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.