Package org.jboss.forge.addon.projects.facets

Examples of org.jboss.forge.addon.projects.facets.WebResourcesFacet


   @Override
   public List<String> getWebPaths(final Resource<?> r)
   {
      if (r != null)
      {
         WebResourcesFacet web = getFaceted().getFacet(WebResourcesFacet.class);
         List<DirectoryResource> webRootDirectories = web.getWebRootDirectories();
         for (DirectoryResource d : webRootDirectories)
         {
            if (r.getFullyQualifiedName().startsWith(d.getFullyQualifiedName()))
            {
               String path = r.getFullyQualifiedName().substring(d.getFullyQualifiedName().length());
View Full Code Here


   @Override
   public Resource<?> getResourceForWebPath(String path)
   {
      if (path != null)
      {
         WebResourcesFacet web = getFaceted().getFacet(WebResourcesFacet.class);
         List<DirectoryResource> webRootDirectories = web.getWebRootDirectories();

         boolean matches = false;
         for (String mapping : getEffectiveFacesServletMappings())
         {
            Matcher matcher = ServletUtil.mappingToRegex(mapping).matcher(path);
View Full Code Here

      String targetDir = setupContext.getTargetDirectory();
      targetDir = (targetDir == null) ? "" : targetDir;

      // Setup static resources.
      ArrayList<Resource<?>> result = new ArrayList<>();
      WebResourcesFacet web = project.getFacet(WebResourcesFacet.class);
      ProcessingStrategy strategy = new CopyResourcesStrategy(web);
      for (ScaffoldResource scaffoldResource : getStatics(targetDir, strategy)) {
         result.add(scaffoldResource.generate());
      }
View Full Code Here

      String targetDir = setupContext.getTargetDirectory();
      targetDir = targetDir == null ? "" : targetDir;
      if (project.hasAllFacets(WebResourcesFacet.class, DependencyFacet.class, JPAFacet.class, EJBFacet.class,
               CDIFacet.class, RestFacet.class))
      {
         WebResourcesFacet web = project.getFacet(WebResourcesFacet.class);
         boolean areResourcesInstalled = web.getWebResource(targetDir + GLYPHICONS_SVG).exists()
                  && web.getWebResource(targetDir + GLYPHICONS_EOT).exists()
                  && web.getWebResource(targetDir + GLYPHICONS_SVG).exists()
                  && web.getWebResource(targetDir + GLYPHICONS_TTF).exists()
                  && web.getWebResource(targetDir + GLYPHICONS_WOFF).exists()
                  && web.getWebResource(targetDir + FORGE_LOGO_PNG).exists()
                  && web.getWebResource(targetDir + ANGULAR_RESOURCE_JS).exists()
                  && web.getWebResource(targetDir + ANGULAR_ROUTE_JS).exists()
                  && web.getWebResource(targetDir + ANGULAR_JS).exists()
                  && web.getWebResource(targetDir + MODERNIZR_JS).exists()
                  && web.getWebResource(targetDir + JQUERY_JS).exists()
                  && web.getWebResource(targetDir + BOOTSTRAP_JS).exists()
                  && web.getWebResource(targetDir + OFFCANVAS_JS).exists()
                  && web.getWebResource(targetDir + MAIN_CSS).exists()
                  && web.getWebResource(targetDir + BOOTSTRAP_CSS).exists()
                  && web.getWebResource(targetDir + BOOTSTRAP_THEME_CSS).exists()
                  && web.getWebResource(targetDir + LANDING_VIEW).exists();
         return areResourcesInstalled;
      }
      return false;
   }
View Full Code Here

         dataModel.put("resourcePath", entityResourcePath);
         dataModel.put("parentDirectories", getParentDirectories(targetDir));

         // Process the Freemarker templates with the Freemarker data model and retrieve the generated resources from
         // the registry.
         WebResourcesFacet web = project.getFacet(WebResourcesFacet.class);
         ProcessingStrategy strategy = new ProcessTemplateStrategy(web, resourceFactory, project, templateFactory, dataModel);
         List<ScaffoldResource> scaffoldResources = getEntityTemplates(targetDir, entityName, strategy);
         scaffoldResources.add(new ScaffoldResource("/views/detail.html.ftl", targetDir + "/views/" + entityName
                  + "/detail.html", new DetailTemplateStrategy(web, resourceFactory, project, templateFactory, dataModel)));
         scaffoldResources.add(new ScaffoldResource("/views/search.html.ftl", targetDir + "/views/" + entityName
View Full Code Here

            return true;
         }
      };

      WebResourcesFacet web = this.project.getFacet(WebResourcesFacet.class);
      List<Resource<?>> resources = web.getWebResource(targetDir + "/views/").listResources(filter);
      List<String> entityNames = new ArrayList<>();
      List<String> pluralizedEntityNames = new ArrayList<>();
      for (Resource<?> resource : resources)
      {
         String resourceName = resource.getName();
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.projects.facets.WebResourcesFacet

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.