Package org.bladerunnerjs.plugin

Examples of org.bladerunnerjs.plugin.ContentPlugin


      if (parsedRequest.formName.equals(UNVERSIONED_BUNDLE_REQUEST)) {
        /* since unversioned requests (/myApp/somePlugin/file.txt) could also be a request to a custom servlet
         * if the request type is an unversioned bundle request we must first check that a content plugin can ultimately handle it
         */
        String contentPath = parsedRequest.properties.get("content-path");
        ContentPlugin contentProvider = app.root().plugins().contentPluginForLogicalPath(contentPath);
        if (contentProvider == null) {
          return false;
        }
        return true;
      }
View Full Code Here


     
      localeForwardingPage.write("<head>\n");
      localeForwardingPage.write("<noscript><meta http-equiv='refresh' content='0; url=" + app.appConf().getDefaultLocale() + "/'></noscript>\n");
      localeForwardingPage.write("<script type='text/javascript'>\n");
     
      ContentPlugin appVersionContentPlugin = app.root().plugins().contentPlugin("app-meta");
      ContentPathParser appVersionContentPathParser = appVersionContentPlugin.getContentPathParser();
      String appVersionContentPath = appVersionContentPathParser.createRequest("app-meta-request");
      ResponseContent responseContent = appVersionContentPlugin.handleRequest(appVersionContentPathParser.parse(appVersionContentPath), bundleSet, contentAccessor, appVersionContentPath);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      responseContent.write(baos);
      localeForwardingPage.write( baos.toString() );
     
      localeForwardingPage.write("\n");
View Full Code Here

    logger.debug(Messages.REQUEST_HANDLED_MSG, logicalRequestpath, app.getName());
   
    String name = (bundlableNode instanceof NamedNode) ? ((NamedNode) bundlableNode).getName() : "default";
    logger.debug(Messages.CONTEXT_IDENTIFIED_MSG, bundlableNode.getTypeName(), name, logicalRequestpath);
   
    ContentPlugin contentProvider = app.root().plugins().contentPluginForLogicalPath(logicalRequestpath);
   
    if(contentProvider == null) {
      throw new ResourceNotFoundException("No content provider could be found found the logical request path '" + logicalRequestpath + "'");
    }
   
    logger.debug(Messages.BUNDLER_IDENTIFIED_MSG, contentProvider.getPluginClass().getSimpleName(), logicalRequestpath);
   
    ParsedContentPath contentPath = contentProvider.getContentPathParser().parse(logicalRequestpath);
    return contentProvider.handleRequest(contentPath, bundleSet, contentAccessor, version);
  }
View Full Code Here

   
    return verifierChainer;
  }
 
  private VerifierChainer verifyProdAndDevRequestsForContentPluginsAre(String contentPluginPrefix, String... expectedRequests) throws Exception {
    ContentPlugin contentPlugin = bundlableNode.root().plugins().contentPlugin(contentPluginPrefix);
    List<String> actualDevRequests = contentPlugin.getValidDevContentPaths(bundlableNode.getBundleSet(), bundlableNode.app().appConf().getLocales());
    List<String> actualProdRequests = contentPlugin.getValidProdContentPaths(bundlableNode.getBundleSet(), bundlableNode.app().appConf().getLocales());
   
    assertEquals("dev requests didn't match", Joiner.on(", ").join(expectedRequests), Joiner.on(", ").join(actualDevRequests));
    assertEquals("prod requests didn't match", Joiner.on(", ").join(expectedRequests), Joiner.on(", ").join(actualProdRequests));
   
    return verifierChainer;
View Full Code Here

   
    return verifierChainer;
  }
 
  public VerifierChainer devRequestsForContentPluginsAre(String contentPluginPrefix, String... expectedRequests) throws Exception {
    ContentPlugin contentPlugin = bundlableNode.root().plugins().contentPlugin(contentPluginPrefix);
    List<String> actualRequests = contentPlugin.getValidDevContentPaths(bundlableNode.getBundleSet(), bundlableNode.app().appConf().getLocales());
   
    assertEquals("dev requests didn't match", Joiner.on(", ").join(expectedRequests), Joiner.on(", ").join(actualRequests));
   
    return verifierChainer;
  }
View Full Code Here

   
    return verifierChainer;
  }
 
  public VerifierChainer prodRequestsForContentPluginsAre(String contentPluginPrefix, String... expectedRequests) throws Exception {
    ContentPlugin contentPlugin = bundlableNode.root().plugins().contentPlugin(contentPluginPrefix);
    List<String> actualRequests = contentPlugin.getValidProdContentPaths(bundlableNode.getBundleSet(), bundlableNode.app().appConf().getLocales());
   
    assertEquals("prod requests didn't match", Joiner.on(", ").join(expectedRequests), Joiner.on(", ").join(actualRequests));
   
    return verifierChainer;
  }
View Full Code Here

            || contentPluginProdRequestsMap.get(requestPrefix).contains(versionedContentPath) ) {
          writeContentFile(bundleSet, urlContentAccessor, target, appRequestHandler, version, aspectRequestPrefix, contentPlugin, contentPath);
        }
      }
    } else {
      ContentPlugin plugin = (contentPlugin instanceof VirtualProxyContentPlugin) ? (ContentPlugin) ((VirtualProxyContentPlugin) contentPlugin).getUnderlyingPlugin() : contentPlugin;
      bundleSet.getBundlableNode().root().logger(AppBuilderUtilis.class).info("The content plugin '%s' is part of a composite content plugin so no files will be generated. " +
          "If content bundles should be generated for this content plugin, you should set it's composite group name to null.", plugin.getClass().getSimpleName());
    }
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.plugin.ContentPlugin

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.