Package com.ibm.sbt.playground.assets

Examples of com.ibm.sbt.playground.assets.RootNode


   * @param nodeFactory The NodeFactory of the type of snippet to be retrieved.
   * @param path The path to the root of the snippets to be retrieved.
   * @return RootNode of the Snippets.
   */
  private static RootNode getSnippets(ServletContext context, NodeFactory nodeFactory, String path, HttpServletRequest request){
    RootNode root;
    try {
      VFSFile file = getRootFile(context, path);
      root = readAssets(context, file, nodeFactory, request);
    } catch(IOException ex) {
      root = new RootNode();
    }
    return root;
  }
View Full Code Here


   * @throws IOException
   */
  private static RootNode readAssets(ServletContext context, VFSFile file, NodeFactory nodeFactory, HttpServletRequest request) throws IOException{
      AssetBrowser imp = new AssetBrowser(file, nodeFactory, getRuntimes(request), getJsLibId(request));
     
    return (RootNode)imp.readAssets(new RootNode(), null);
  }
View Full Code Here

   * @param context
   * @param request
   * @return JSSnippets in JSON format.
   */
  public static String getJsSnippetsAsJson(ServletContext context, HttpServletRequest request) {
      RootNode root = getJsSnippets(context, request);
      String json = root.getAsJson();
      String jsonEx = readRemoteJson(context, request);
      if (StringUtil.isNotEmpty(jsonEx)&&jsonEx.contains("children")) {
          jsonEx = jsonEx.substring("[{\"id\":\"_root\",\"name\":\"_root\",\"children\":[".length());
          json = json.substring(0, json.length()-3) + "," + jsonEx;
      }
View Full Code Here

   * @param rootPath
   * @return
   */
  private static Asset getAsset(ServletContext context, HttpServletRequest request, String assetName, NodeFactory nodeFactory, String rootPath){
    try {
          RootNode root = getSnippets(context, nodeFactory, rootPath, request);
          return root.loadAsset(getRootFile(context, rootPath), assetName);
      } catch (IOException ioe) {
          return null;
      }
  }
View Full Code Here

   * @param nodeFactory The NodeFactory of the type of snippet to be retrieved.
   * @param path The path to the root of the snippets to be retrieved.
   * @return RootNode of the Snippets.
   */
  private static RootNode getSnippets(ServletContext context, NodeFactory nodeFactory, String path, HttpServletRequest request){
    RootNode root;
    try {
      VFSFile file = getRootFile(context, path);
      root = readAssets(context, file, nodeFactory, request);
    } catch(IOException ex) {
      root = new RootNode();
    }
    return root;
  }
View Full Code Here

   * @throws IOException
   */
  private static RootNode readAssets(ServletContext context, VFSFile file, NodeFactory nodeFactory, HttpServletRequest request) throws IOException{
      AssetBrowser imp = new AssetBrowser(file, nodeFactory, getRuntimes(request), getJsLibId(request));
     
    return (RootNode)imp.readAssets(new RootNode(), null);
  }
View Full Code Here

   * @param context
   * @param request
   * @return JSSnippets in JSON format.
   */
  public static String getJsSnippetsAsJson() {
      RootNode root = getJsSnippets();
      String json = root.getAsJson();
      return json;
  }
View Full Code Here

   * @param rootPath
   * @return
   */
  private static Asset getAsset(String assetName, NodeFactory nodeFactory, String rootPath){
    try {
          RootNode root = getSnippets(nodeFactory, rootPath);
          return root.loadAsset(getRootFile(rootPath), assetName);
      } catch (IOException ioe) {
          return null;
      }
  }
View Full Code Here

   * @param nodeFactory The NodeFactory of the type of snippet to be retrieved.
   * @param path The path to the root of the snippets to be retrieved.
   * @return RootNode of the Snippets.
   */
  private static RootNode getSnippets( NodeFactory nodeFactory, String path){
    RootNode root;
    try {
      VFSFile file = getRootFile(path);
      root = readAssets(file, nodeFactory);
    } catch(IOException ex) {
      root = new RootNode();
    }
    return root;
  }
View Full Code Here

   * @throws IOException
   */
  private static RootNode readAssets(VFSFile file, NodeFactory nodeFactory) throws IOException{
      AssetBrowser imp = new AssetBrowser(file, nodeFactory);
     
    return (RootNode)imp.readAssets(new RootNode(), null);
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.playground.assets.RootNode

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.