Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.BundlableNode


   
    return reverseDependencyGraph;
  }
 
  private static DependencyInfo buildDependencyGraphFromBundleSet(BundleSet bundleSet, DependencyAdder dependencyAdder) throws ModelOperationException {
    BundlableNode bundlableNode = bundleSet.getBundlableNode();
    DependencyInfo dependencyInfo = new DependencyInfo();
   
    addSeedDependencies(dependencyAdder, bundlableNode, dependencyInfo);
   
    for(AssetLocation assetLocation : bundleSet.getResourceNodes()) {
View Full Code Here


  }
 
  @Override
  public ResponseContent handleRequest(ParsedContentPath contentPath, BundleSet bundleSet, UrlContentAccessor contentAccessor, String version) throws ContentProcessingException {
   
    BundlableNode bundlableNode = bundleSet.getBundlableNode();
    String theme = contentPath.properties.get("theme");
    String resourcePath = contentPath.properties.get("resourcePath");
    File resourceFile = null;
   
    if (contentPath.formName.equals(ASPECT_THEME_REQUEST))
    {
      String aspectName = contentPath.properties.get("aspect");
      Aspect aspect =  bundlableNode.app().aspect(aspectName);
      List<ResourcesAssetLocation> resourceAssetLocations = getResourceAssetLocations(aspect);
      for (ResourcesAssetLocation location : resourceAssetLocations) {
        if (location.getThemeName().equals(theme)){
          resourceFile = location.file(resourcePath);
        }
      }
    }
    else if (contentPath.formName.equals(ASPECT_RESOURCE_REQUEST))
    {
      String aspectName = contentPath.properties.get("aspect");
      Aspect aspect =  bundlableNode.app().aspect(aspectName);
      resourceFile = aspect.file(resourcePath);
    }
    else if (contentPath.formName.equals(BLADESET_THEME_REQUEST))
    {
      Bladeset bladeset = bundlableNode.app().bladeset(contentPath.properties.get("bladeset"));
      ThemedAssetLocation location = getThemedResourceLocation(bladeset, theme);
      resourceFile = location.file(resourcePath);
    }
    else if (contentPath.formName.equals(BLADESET_RESOURCE_REQUEST))
    {
      Bladeset bladeset = bundlableNode.app().bladeset(contentPath.properties.get("bladeset"));
      resourceFile = bladeset.file(resourcePath);
    }
    else if (contentPath.formName.equals(BLADE_THEME_REQUEST))
    {
      Bladeset bladeset = bundlableNode.app().bladeset(contentPath.properties.get("bladeset"));
      Blade blade = bladeset.blade(contentPath.properties.get("blade"));
      ThemedAssetLocation location = getThemedResourceLocation(blade, theme);
      resourceFile = location.file(resourcePath);
    }
    else if (contentPath.formName.equals(BLADE_RESOURCE_REQUEST))
    {
      Bladeset bladeset = bundlableNode.app().bladeset(contentPath.properties.get("bladeset"));
      Blade blade = bladeset.blade(contentPath.properties.get("blade"));
      resourceFile = blade.file(resourcePath);
    }
    else if (contentPath.formName.equals(WORKBENCH_THEME_REQUEST))
    {
      //TODO: this needs implementing
      // Workbenches dont have themes ?
    }
    else if (contentPath.formName.equals(WORKBENCH_RESOURCE_REQUEST))
    {
      Bladeset bladeset = bundlableNode.app().bladeset(contentPath.properties.get("bladeset"));
      Blade blade = bladeset.blade(contentPath.properties.get("blade"));
      Workbench workbench = blade.workbench();
      resourceFile = workbench.file(resourcePath);
    }
    else if (contentPath.formName.equals(LIB_REQUEST))
    {
      JsLib jsLib = bundlableNode.app().jsLib(contentPath.properties.get("lib"));
      resourceFile = jsLib.file(resourcePath);
    }
    else
    {
      throw new ContentProcessingException("Cannot handle request with form name " + contentPath.formName);
View Full Code Here

        Trie<AssetReference> trie = new Trie<AssetReference>( '/', new Character[]{'.', '/'} );
       
        for (AssetContainer assetContainer : assetContainer.scopeAssetContainers()) {
          try {
            if(assetContainer instanceof BundlableNode) {
              BundlableNode bundlableNode = (BundlableNode) assetContainer;
             
              for(AliasOverride aliasOverride : bundlableNode.aliasesFile().aliasOverrides()) {
                addToTrie(trie, aliasOverride.getName(), new AliasOverrideReference(aliasOverride), ALIAS_MATCHER_PATTERN);
              }
            }
           
            for(LinkedAsset asset : assetContainer.linkedAssets()) {
View Full Code Here

    public static final String CONTEXT_IDENTIFIED_MSG = "%s '%s' identified as context for request '%s'.";
    public static final String BUNDLER_IDENTIFIED_MSG = "Bundler '%s' identified as handler for request '%s'.";
  }
 
  public static ResponseContent handle(BundleSet bundleSet, String logicalRequestpath, UrlContentAccessor contentAccessor, String version) throws MalformedRequestException, ResourceNotFoundException, ContentProcessingException {
    BundlableNode bundlableNode = bundleSet.getBundlableNode();
    App app = bundlableNode.app();
    Logger logger = app.root().logger(BundleSetRequestHandler.class);
   
    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 + "'");
View Full Code Here

   
    if(!bundlableDir.exists()) throw new DirectoryDoesNotExistCommandException(relativePath, this);
   
   
    try {
      BundlableNode bundlableNode = brjs.locateFirstBundlableAncestorNode(bundlableDir);
      logger.println(DependencyGraphReportBuilder.createReport(bundlableNode, showAllDependencies));
    }
    catch (ModelOperationException e) {
      throw new CommandOperationException(e);
    }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.BundlableNode

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.