Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.Aspect


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


    String[] requestArgs = new String[0];
   
   
    if (assetContainer instanceof Aspect)
    {
      Aspect aspect = (Aspect) assetContainer;
      themeRequestName = ASPECT_THEME_REQUEST;
      resourcesRequestName = ASPECT_RESOURCE_REQUEST;
      requestArgs = new String[] { aspect.getName() };
    }
    else if (assetContainer instanceof Bladeset)
    {
      Bladeset bladeset = (Bladeset) assetContainer;
      themeRequestName = BLADESET_THEME_REQUEST;
View Full Code Here

    String appName = parsedArgs.getString("app-name");
    String aspectName = parsedArgs.getString("aspect-name");
    boolean showAllDependencies = parsedArgs.getBoolean("all");
   
    App app = brjs.app(appName);
    Aspect aspect = app.aspect(aspectName);
   
    if(!app.dirExists()) throw new NodeDoesNotExistException(app, this);
    if(!aspect.dirExists()) throw new NodeDoesNotExistException(aspect, this);
   
    try {
      logger.println(DependencyGraphReportBuilder.createReport(aspect, showAllDependencies)+"\n");
    }
    catch (ModelOperationException e) {
View Full Code Here

   
    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;
        if (assetLocation instanceof ThemedAssetLocation && assetLocationParentDir.getName().equals("themes")) {
View Full Code Here

      .and(brjs).usesProductionTemplates()
      .and(brjs).usedForServletModel();
   
    // generate the app structure
    App app = brjs.app("app");
    Aspect aspect = app.defaultAspect();
    Bladeset bs = app.bladeset("bs");
    Blade b1 = bs.blade("b1");
    Workbench workbench = b1.workbench();
   
    given(app).hasBeenPopulated()
View Full Code Here

  protected int doCommand(JSAPResult parsedArgs) throws CommandArgumentsException, CommandOperationException {
    String appName = parsedArgs.getString("target-app-name");
    String aspectName = parsedArgs.getString("new-aspect-name");
   
    App app = brjs.app(appName);
    Aspect aspect = app.aspect(aspectName);
   
    if(!app.dirExists()) throw new NodeDoesNotExistException(app, this);
    if(aspect.dirExists()) throw new NodeAlreadyExistsException(aspect, this);
   
    try {
      aspect.populate();
    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create aspect '" + aspect.dir().getPath() + "'", e);
    }
   
    logger.println(Messages.ASPECT_CREATE_SUCCESS_CONSOLE_MSG, aspectName);
    logger.println(Messages.ASPECT_PATH_CONSOLE_MSG, aspect.dir().getPath());
   
    return 0;
  }
View Full Code Here

    boolean isRequirePrefix = parsedArgs.getBoolean("prefix");
    boolean isAlias = parsedArgs.getBoolean("alias");
    boolean showAllDependencies = parsedArgs.getBoolean("all");
   
    App app = brjs.app(appName);
    Aspect aspect = app.aspect(aspectName);
   
    if(isRequirePrefix && isAlias) throw new CommandArgumentsException("The --prefix and --alias switches can't both be used at the same time", this);
    if(!app.dirExists()) throw new NodeDoesNotExistException(app, this);
    if(!aspect.dirExists()) throw new NodeDoesNotExistException(aspect, this);
   
    try {
      if(isRequirePrefix) {
        logger.println(DependencyGraphReportBuilder.createReportForRequirePrefix(aspect, requirePathOrAlias, showAllDependencies));
      }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.Aspect

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.