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();
}