Package javax.faces.application

Examples of javax.faces.application.ProjectStage


            // print out a very prominent log message if the project stage is != Production
            if (!facesContext.isProjectStage(ProjectStage.Production) &&
                !facesContext.isProjectStage(ProjectStage.UnitTest))
            {
                ProjectStage projectStage = facesContext.getApplication().getProjectStage();
                StringBuilder message = new StringBuilder("\n\n");
                message.append("*******************************************************************\n");
                message.append("*** WARNING: Apache MyFaces-2 is running in ");
                message.append(projectStage.name().toUpperCase());       
                message.append(" mode.");
                int length = projectStage.name().length();
                for (int i = 0; i < 11 - length; i++)
                {
                    message.append(" ");
                }
                message.append("   ***\n");
 
View Full Code Here


         * Warn the user if the ALT attribute is missing.
         */               
        if (uiComponent.getAttributes().get(HTML.ALT_ATTR) == null)
        {
            //we don't want to flood logs with warnings in production and system test environments
            ProjectStage projectStage = facesContext.getApplication().getProjectStage();
            if(projectStage.equals(ProjectStage.Development) || projectStage.equals(ProjectStage.UnitTest))
                log.warning("ALT attribute is missing for : " + uiComponent.getId());
        }

        if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
        {
View Full Code Here

            ResourceKey.create("less.instant.js", "less"));

    @Override
    public Iterable<ResourceKey> getResources() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ProjectStage stage = facesContext.getApplication().getProjectStage();
        Boolean isResponsive = ConfigurationServiceHelper
                .getBooleanConfigurationValue(facesContext, BootstrapConfiguration.Items.responsiveDesign);
        Boolean isClientSideStyle = ConfigurationServiceHelper
                .getBooleanConfigurationValue(facesContext, BootstrapConfiguration.Items.clientSideStyle);
View Full Code Here

            _dispatchApplicationEvent(servletContext, PostConstructApplicationEvent.class);
           
            // print out a very prominent log message if the project stage is != Production
            if (!facesContext.isProjectStage(ProjectStage.Production))
            {
                ProjectStage projectStage = facesContext.getApplication().getProjectStage();
                StringBuilder message = new StringBuilder("\n\n");
                message.append("*******************************************************************\n");
                message.append("*** WARNING: Apache MyFaces-2 is running in ");
                message.append(projectStage.name().toUpperCase());       
                message.append(" mode.");
                int length = projectStage.name().length();
                for (int i = 0; i < 11 - length; i++)
                {
                    message.append(" ");
                }
                message.append("   ***\n");
 
View Full Code Here

        // try all detectors
        for(ProjectStageDetector detector : detectors) {

            // lets the detector do its job
            ProjectStage stage = detector.getProjectStage();

            if (log.isTraceEnabled()) {
                log.trace("Detector " + detector.getClass().getName() + " returned: " + stage);
            }
View Full Code Here

        if (localePrefix != null) {
            uri += ((queryStarted) ? "&loc=" : "?loc=") + localePrefix;
            queryStarted = true;
        }
        if ("jsf.js".equals(getResourceName()) && "javax.faces".equals(getLibraryName())) {
            ProjectStage stage = context.getApplication().getProjectStage();
            switch (stage) {
                case Development:
                    uri += ((queryStarted) ? "&stage=Development" : "?stage=Development" );
                    break;
                case SystemTest:
                    uri += ((queryStarted) ? "&stage=SystemTest" : "?stage=SystemTest" );
                    break;
                case UnitTest:
                    uri += ((queryStarted) ? "&stage=UnitTest" : "?stage=UnitTest" );
                    break;
                default:
                    assert(stage.equals(ProjectStage.Production));
            }
        }

        uri = context.getApplication().getViewHandler()
              .getResourceURL(context,
View Full Code Here

        if (localePrefix != null) {
            uri += ((queryStarted) ? "&loc=" : "?loc=") + localePrefix;
            queryStarted = true;
        }
        if ("jsf.js".equals(getResourceName()) && "javax.faces".equals(getLibraryName())) {
            ProjectStage stage = context.getApplication().getProjectStage();
            switch (stage) {
                case Development:
                    uri += ((queryStarted) ? "&stage=Development" : "?stage=Development" );
                    break;
                case SystemTest:
                    uri += ((queryStarted) ? "&stage=SystemTest" : "?stage=SystemTest" );
                    break;
                case UnitTest:
                    uri += ((queryStarted) ? "&stage=UnitTest" : "?stage=UnitTest" );
                    break;
                default:
                    assert(stage.equals(ProjectStage.Production));
            }
        }

        uri = context.getApplication().getViewHandler()
              .getResourceURL(context,
View Full Code Here

      final Result result;
      Project project = getSelectedProject(context.getUIContext());
      FacesFacet facesFacet = project.getFacet(FacesFacet.class);
      if (stage.hasValue())
      {
         ProjectStage projectStage = stage.getValue();
         facesFacet.setProjectStage(projectStage);
         result = Results.success("Faces PROJECT_STAGE updated to: " + projectStage);
      }
      else
      {
View Full Code Here

    private boolean isDevModeEnabled(ServletContext sc) {
        return getProjectStage(sc).equals(ProjectStage.Development);
    }
   
    private ProjectStage getProjectStage(ServletContext sc) {
        ProjectStage projectStage = null;
        final String projectStageKey = AbstractConfigProcessor.class.getName() + ".PROJECTSTAGE";
        projectStage = (ProjectStage) sc.getAttribute(projectStageKey);
       
        if (projectStage == null) {
            WebConfiguration webConfig =
View Full Code Here

            uri += ((queryStarted) ? "&con=" : "?con=") + contract;
            queryStarted = true;
        }
       
        if ("jsf.js".equals(getResourceName()) && "javax.faces".equals(getLibraryName())) {
            ProjectStage stage = context.getApplication().getProjectStage();
            switch (stage) {
                case Development:
                    uri += ((queryStarted) ? "&stage=Development" : "?stage=Development" );
                    break;
                case SystemTest:
                    uri += ((queryStarted) ? "&stage=SystemTest" : "?stage=SystemTest" );
                    break;
                case UnitTest:
                    uri += ((queryStarted) ? "&stage=UnitTest" : "?stage=UnitTest" );
                    break;
                default:
                    assert(stage.equals(ProjectStage.Production));
            }
        }

        uri = context.getApplication().getViewHandler()
              .getResourceURL(context,
View Full Code Here

TOP

Related Classes of javax.faces.application.ProjectStage

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.