Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.ThemedAssetLocation


    }
  }
 
  private ThemedAssetLocation getThemedResourceLocation(AssetContainer container, String themeName){
   
    ThemedAssetLocation result = null;
    for(AssetLocation location: container.assetLocations()){
      if (location instanceof ThemedAssetLocation){
        String locationThemeName = ((ThemedAssetLocation)location).getThemeName();
        if(locationThemeName.equals(themeName)){
          result = ((ThemedAssetLocation)location);
View Full Code Here


      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"));
View Full Code Here

  {
    File assetLocationParentDir = assetLocation.dir().getParentFile();
    //TODO: this is wrong, it relies on knowledge of the app structure which should be in the model. How do we tell if an asset location is inside 'themes'?
    if (assetLocation instanceof ThemedAssetLocation && assetLocationParentDir.getName().equals("themes")) {
      if (themeRequestName != null) {
        ThemedAssetLocation themeAssetLocation = (ThemedAssetLocation) assetLocation;
        String assetPath = RelativePathUtility.get(brjs.getFileInfoAccessor(), assetLocation.dir(), file);
        String[] createRequestArgs = ArrayUtils.addAll( requestArgs, new String[] { themeAssetLocation.getThemeName(), assetPath } );
        String request = contentPathParser.createRequest(themeRequestName, createRequestArgs);
        contentPaths.add(request );
      }
    } else {
      if (resourcesRequestName != null) {
View Full Code Here

    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;
        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.BLADESET_THEME_REQUEST, bladeset.getName(), theme.dir().getName(), resourcePath);
        } else {
          String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), bladeset.dir(), imageFile);
          targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.BLADESET_RESOURCE_REQUEST, bladeset.getName(), resourcePath);
        }
      }
      else if(assetContainer instanceof Blade) {
        Blade blade = (Blade) assetContainer;
        Bladeset bladeset = blade.parent();
        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.BLADE_THEME_REQUEST, bladeset.getName(), blade.getName(), theme.dir().getName(), resourcePath);
        } else {
          String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), blade.dir(), imageFile);
          targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.BLADE_RESOURCE_REQUEST, bladeset.getName(), blade.getName(), resourcePath);
        }
      }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.ThemedAssetLocation

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.