Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.App$Messages


  public String getApp(String appName) throws Exception
  {
    StringBuilder response = new StringBuilder();
    response.append("{");
   
    App app = brjs.userApp(appName);
    if (!app.dirExists())
    {
      throw new Exception("App " + app.getName() + " does not exist");
    }
   
    List<Bladeset> bladesets = app.bladesets();
    for (int i = 0; i < bladesets.size(); i++)
    {
      Bladeset bladeset = bladesets.get(i);
      response.append("\""+bladeset.getName()+"\"" + ":[");
      List<Blade> blades = bladeset.blades();
View Full Code Here


    if (destinationWar.exists())
    {
      destinationWar.delete();
    }
   
    App app = brjs.userApp(appName);
    if (!app.dirExists()) {
      throw new Exception("Unable to export, the app '" + appName + "' doesn't exist.");
    }
   
    app.buildWar(destinationWar);
  }
View Full Code Here

  }
 
  @Override
  protected int doCommand(JSAPResult parsedArgs) throws CommandArgumentsException, CommandOperationException {
    String appName = parsedArgs.getString("app-name");
    App app = brjs.app(appName);
   
    if(!app.dirExists()) throw new CommandArgumentsException( String.format(Messages.APP_DOES_NOT_EXIST_EXCEPTION, appName), this );
   
    Map<String, String> transformations = new HashMap<>();
    transformations.put("app-name", app.getName());
    try
    {
      TemplateUtility.installTemplate(app, "j2eeify-app", transformations, true );
      String webXmlContents =  IOUtils.toString( ApplicationServerUtils.getDefaultWebXmlResourceLocation() );
      FileUtils.write( app.file("WEB-INF/web.xml") , webXmlContents );
      FileUtils.copyDirectory(brjs.appJars().dir(), app.file("WEB-INF/lib"));
    }
    catch (TemplateInstallationException | IOException ex)
    {
      throw new CommandOperationException(ex);
    }
   
    String relativeWebInf = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.root().dir(), app.file("WEB-INF"));
    logger.println(Messages.SUCCESSFULLY_J2EEIFIED_APP_MESSAGE, appName, relativeWebInf);
   
    return 0;
  }
View Full Code Here

  protected int doCommand(JSAPResult parsedArgs) throws CommandArgumentsException, CommandOperationException {
    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");
    }
View Full Code Here

  }


  private boolean isAppDirWithDeployFile(File dir)
  {
    App app = brjs.locateAncestorNodeOfClass(dir, App.class);
    return app != null && ApplicationServerUtils.getDeployFileForApp(app).isFile();
  }
View Full Code Here

    return app != null && ApplicationServerUtils.getDeployFileForApp(app).isFile();
  }

  private void deployApp(File appDir)
  {
    App app = brjs.locateAncestorNodeOfClass(appDir, App.class);
    try
    {
      logger.debug(NEW_APP_MESSAGE, this.getClass().getSimpleName(), app.getName());
      appServer.deployApp(app);
    }
    catch (Exception ex)
    {
      logger.warn(ERROR_DEPLOYING_APP_MSG, app.getName(), ex.toString());
    }
  }
View Full Code Here

  public void initTestObjects() throws Exception {
    given(brjs).automaticallyFindsBundlerPlugins()
      .and(brjs).automaticallyFindsMinifierPlugins()
      .and(brjs).hasBeenCreated();
   
    App app = brjs.app("app1");
    aspect = app.aspect("default");
    bladeset = app.bladeset("bs");
    blade = bladeset.blade("b1");
    workbench = blade.workbench();
    response = new StringBuffer();
    userLib = app.jsLib("userLib");
   
    given(aspect).hasClass("appns/Class1")
      .and(aspect).indexPageRefersTo("appns.Class1");
  }
View Full Code Here

  }
 
  public List<StylesheetRequest> getOrderedStylesheets(boolean isDev, Map<String, String> tagAttributes, BundleSet bundleSet, Locale locale, String version) throws MalformedTokenException, ContentProcessingException, IOException
  {
    try {
      App app = bundleSet.getBundlableNode().app();
      String theme = getTheme(tagAttributes);
      List<String> alternateThemes = getAlternateThemes(tagAttributes);
      List<String> contentPaths = (isDev) ? cssContentPlugin.getValidDevContentPaths(bundleSet, locale) : cssContentPlugin.getValidProdContentPaths(bundleSet, locale);
      List<StylesheetRequest> stylesheetRequests = new ArrayList<>();
     
View Full Code Here

  }

  @Override
  public void onEventEmitted(Event event, Node node)
  {
    App app = (App) node;
   
    try
    {
      if (isAppServerRunning()) {
        logger.debug(Messages.NEW_APP_LOG_MSG, app.getName());
        app.file(BRJSApplicationServer.DEPLOY_APP_FILENAME).createNewFile();
      } else {
        logger.debug(Messages.NEW_APP_APPSERVER_NOT_RUNNING_MSG, app.getName());
      }
    }
    catch(Exception ex)
    {
      throw new RuntimeException(ex);
View Full Code Here

  }
 
  @Test
  public void templateCanBeInstalledWithoutTransformations() throws Exception
  {
    App app = brjs.app("app");
    assertFalse("app dir does not exist", app.dirExists());
   
    TemplateUtility.installTemplate(brjs.app("app"), "app", new HashMap<String, String>());
   
    assertTrue("app dir exists", app.dirExists());
   
    assertTrue("root dir exists", app.file("root-@dir").exists());
    assertTrue("root dir is a directory", app.file("root-@dir").isDirectory());
    assertTrue("root text file exists", app.file("root-@dir/root-text-file.txt").exists());
    assertEquals("root text file has correct contents", "this is the root text file (in root @dir)", fileUtil.readFileToString(app.file("root-@dir/root-text-file.txt")));
    assertTrue("root binary file exists", app.file("root-@dir/root-binary-file.bin").exists());
    assertEquals("root binary file has correct contents", "this is the root binary file (in root @dir)", fileUtil.readFileToString(app.file("root-@dir/root-binary-file.bin")));
    assertFalse("hidden file does not exist", app.file("root-@dir/.unix-hidden-file.txt").exists());
   
    assertTrue("child dir exists", app.file("root-@dir/child-@dir").exists());
    assertTrue("child dir is a directory", app.file("root-@dir/child-@dir").isDirectory());
    assertTrue("child text file exists", app.file("root-@dir/child-@dir/child-text-file.txt").exists());
    assertEquals("child text file has correct contents", "this is the child text file (in child @dir)", fileUtil.readFileToString(app.file("root-@dir/child-@dir/child-text-file.txt")));
    assertTrue("child binary file exists", app.file("root-@dir/child-@dir/child-binary-file.bin").exists());
    assertEquals("child binary file has correct contents", "this is the child binary file (in child @dir)", fileUtil.readFileToString(app.file("root-@dir/child-@dir/child-binary-file.bin")));
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.App$Messages

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.