Package org.jboss.shrinkwrap.descriptor.api.spec.servlet.web

Examples of org.jboss.shrinkwrap.descriptor.api.spec.servlet.web.WebAppDescriptor


   @Override
   public List<String> getFaceletsViewMapping()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return webXml.getFaceletsViewMappings();
   }
View Full Code Here


   @Command("project-stage")
   public void setProjectStage(@Option(name = "set") final FacesProjectStage stage, final PipeOut out)
   {
      ServletFacet srv = project.getFacet(ServletFacet.class);
      WebAppDescriptor config = srv.getConfig();
      if (stage == null)
      {
         ShellMessages.info(out, "Project stage is currently: " + config.getFacesProjectStage().getStage());
      }
      else
      {
         config.facesProjectStage(stage);
         srv.saveConfig(config);
         ShellMessages.success(out, "Faces PROJECT_STAGE updated to: " + stage.getStage());
      }
   }
View Full Code Here

               "/org/jboss/forge/web/bkg.gif"));
      ((FileResource<?>) webRoot.getChild("favicon.ico")).setContents(getClass().getResourceAsStream(
               "/org/jboss/forge/web/favicon.ico"));

      FileResource<?> descriptor = project.getFacet(ServletFacet.class).getConfigFile();
      WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
               .welcomeFile("/index.html");

      unit.errorPage(404, "/404.html");
      unit.errorPage(500, "/500.html");

      descriptor.setContents(unit.exportAsString());
   }
View Full Code Here

   public WebAppDescriptor getConfig()
   {
      DescriptorImporter<WebAppDescriptor> importer = Descriptors.importAs(WebAppDescriptor.class);
      FileResource<?> configFile = getConfigFile();
      InputStream inputStream = configFile.getResourceInputStream();
      WebAppDescriptor descriptor = importer.from(inputStream);
      return descriptor;
   }
View Full Code Here

            public InputStream getResourceInputStream()
            {
               if (!exists())
               {
                  String projectName = project.getFacet(MetadataFacet.class).getProjectName();
                  WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
                           .displayName(projectName)
                           .sessionTimeout(30);
                  return Streams.fromString(unit.exportAsString());
               }
               else
               {
                  return super.getResourceInputStream();
               }
View Full Code Here

            public InputStream getResourceInputStream()
            {
               if (!exists())
               {
                  String projectName = project.getFacet(MetadataFacet.class).getProjectName();
                  WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
                           .displayName(projectName)
                           .sessionTimeout(30);
                  return Streams.fromString(unit.exportAsString());
               }
               else
               {
                  return super.getResourceInputStream();
               }
View Full Code Here

   public WebAppDescriptor getConfig()
   {
      DescriptorImporter<WebAppDescriptor> importer = Descriptors.importAs(WebAppDescriptor.class);
      FileResource<?> configFile = getConfigFile();
      InputStream inputStream = configFile.getResourceInputStream();
      WebAppDescriptor descriptor = importer.from(inputStream);
      return descriptor;
   }
View Full Code Here

   @Override
   public FacesProjectStage getProjectStage()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor config = facet.getConfig();
      return config.getFacesProjectStage();
   }
View Full Code Here

            public InputStream getResourceInputStream()
            {
               if (!exists())
               {
                  String projectName = project.getFacet(MetadataFacet.class).getProjectName();
                  WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
                           .displayName(projectName)
                           .sessionTimeout(30);
                  return Streams.fromString(unit.exportAsString());
               }
               else
               {
                  return super.getResourceInputStream();
               }
View Full Code Here

   @Override
   public List<String> getFacesServletMappings()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return getExplicitFacesServletMappings(webXml);
   }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.descriptor.api.spec.servlet.web.WebAppDescriptor

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.