Package com.ibm.sbt.playground.assets.javasnippets

Examples of com.ibm.sbt.playground.assets.javasnippets.JavaSnippet


   * @param request
   * @param snippetName
   * @return JavaSnippet corresponding to snippetName
   */
  public static JavaSnippet getJavaSnippet(ServletContext context, HttpServletRequest request, String snippetName) {
    JavaSnippet result = (JavaSnippet) getAsset(context, request, snippetName, new JavaSnippetNodeFactory(), javaRootPath);
        return result;
    }
View Full Code Here


   * @param request
   * @param snippetName
   * @return JavaSnippet corresponding to snippetName
   */
  public static JavaSnippet getJavaSnippet(ServletContext context, HttpServletRequest request, String snippetName) {
    JavaSnippet result = (JavaSnippet) getAsset(context, request, snippetName, new JavaSnippetNodeFactory(), javaRootPath);
        return result;
    }
View Full Code Here

   * @param request
   * @param snippetName
   * @return JavaSnippet corresponding to snippetName
   */
  public static JavaSnippet getJavaSnippet(String snippetName) {
    JavaSnippet result = (JavaSnippet) getAsset(snippetName, new JavaSnippetNodeFactory(), javaRootPath);
        return result;
    }
View Full Code Here

    return new JavaSnippetNodeFactory();
  }

  @Override
  protected void saveAsset(ImportSource source, VFSFile root, AssetNode node, Asset asset) throws Exception {
    JavaSnippet snippet = (JavaSnippet)asset;
    Document doc = getDatabase().createDocument();
    try {
      setItemValue(doc,"Form", FORM);
      setItemValue(doc,"Author", doc.getParentDatabase().getParent().getEffectiveUserName()); // Should we make this private (reader field)?
      setItemValue(doc,"Id", node.getUnid());
      setItemValue(doc,"Category", node.getCategory());
      setItemValue(doc,"Name", node.getName());
      setItemValue(doc,"Description", snippet.getProperty("description"));
      setItemValue(doc,"FilterRuntimes", snippet.getProperty("runtimes"));
      setItemValues(doc,"Tags", snippet.getProperty("tags"));
      setItemValue(doc,"ImportSource", source.getName());
      setItemValueRichText(doc,"Jsp", snippet.getJsp());
      snippet.getProperties().remove("endpoints");
      snippet.getProperties().remove("description");
      setItemValueRichText(doc,"Properties", snippet.getPropertiesAsString());
      setItemValueRichText(doc,"Documentation", snippet.getDocHtml());
     
      doc.save();
    } finally {
      doc.recycle();
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.playground.assets.javasnippets.JavaSnippet

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.