Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.AssetContainer


  private String getTargetPath(File imageFile) throws ContentProcessingException
  {

    Node firstAncestorNode = brjs.locateFirstAncestorNode(imageFile);
    AssetLocation assetLocation  = null;
    AssetContainer assetContainer = null;
    if (firstAncestorNode instanceof AssetLocation){
       assetLocation = (AssetLocation)firstAncestorNode;
       assetContainer = assetLocation.assetContainer();
    } else {
      assetContainer = (AssetContainer) firstAncestorNode;
      assetLocation = assetContainer.assetLocation(".");
    }
    String targetPath = null;
   
    File assetLocationParentDir = assetLocation.dir().getParentFile();
    BRJS root = assetContainer.root();
    try {
      if(assetContainer instanceof Aspect) {
        Aspect aspect = (Aspect) assetContainer;
        if (assetLocation instanceof ThemedAssetLocation && assetLocationParentDir.getName().equals("themes")) {
          ThemedAssetLocation theme = (ThemedAssetLocation) assetLocation;
          String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), theme.dir(), imageFile);
          targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.ASPECT_THEME_REQUEST, ((Aspect) assetContainer).getName(), theme.dir().getName(), resourcePath);
        } else {
          String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), assetContainer.dir(), imageFile);
          targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.ASPECT_RESOURCE_REQUEST, aspect.getName(), resourcePath);
        }
      }
      else if(assetContainer instanceof Bladeset) {
        Bladeset bladeset = (Bladeset) assetContainer;
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.AssetContainer

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.