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

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


            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


   private Archive<?> handleArchive(WebArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, WebArchive protocol, Processor processor)
   {
      ArchivePath webXmlPath = ArchivePaths.create("WEB-INF/web.xml");
      if(applicationArchive.contains(webXmlPath))
      {
         WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).from(
               applicationArchive.get(webXmlPath).getAsset().openStream());
        
         applicationArchive.setWebXML(
               new StringAsset(
                     mergeWithDescriptor(applicationWebXml).exportAsString()));
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

         }

         FileResource<?> descriptor = getConfigFile();
         if (!descriptor.exists())
         {
            WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
                     .displayName(projectName)
                     .sessionTimeout(30);

            descriptor.setContents(unit.exportAsString());
         }

      }
      return super.install();
   }
View Full Code Here

    */
   @Override
   public WebAppDescriptor getConfig()
   {
      DescriptorImporter<WebAppDescriptor> importer = Descriptors.importAs(WebAppDescriptor.class);
      WebAppDescriptor descriptor = importer.from(getConfigFile().getResourceInputStream());
      return descriptor;
   }
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

   @Override
   public FacesProjectStage getProjectStage()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor config = facet.getConfig();
      return config.getFacesProjectStage();
   }
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

   @Override
   public List<String> getEffectiveFacesServletMappings()
   {
      List<String> results = new ArrayList<String>();
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();

      // TODO should probably take into account facelets view mappings
      // facelets.VIEW_MAPPINGS

      if (webXml.hasFacesServlet())
      {
         results.addAll(getExplicitFacesServletMappings(webXml));
      }
      else
      {
         if (webXml.getVersion().startsWith("3"))
         {
            results.add("*.jsf");
            results.add("/faces/*");
         }
         else
View Full Code Here

   @Override
   public List<String> getFacesDefaultSuffixes()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return webXml.getFacesDefaultSuffixes();
   }
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.