this.assetLoaderEnvironment.prepareEndpoints();
}
//PlaygroundEnvironment env = DataAccessBean.get().findCurrentEnvironment();
Database db = ExtLibUtil.getCurrentDatabase();
View v = db.getView("AllSnippetsFlat");
try {
RootNode root = new RootNode();
String apisSearch = (String)ExtLibUtil.getViewScope().get("assetSearch");
if(StringUtil.isNotEmpty(apisSearch)) {
v.FTSearch(apisSearch);
//ViewEntryCollection col = v.getAllEntriesByKey(getAssetForm());
ViewEntryCollection col = v.getAllEntries();
for(ViewEntry e=col.getFirstEntry(); e!=null; e=col.getNextEntry()) {
Vector<?> values = e.getColumnValues();
String notesUnid = e.getUniversalID();
// 2 type
String type = (String)values.get(0);
if(!StringUtil.equals(type, getAssetForm())) {
// Ignore if it is not of the right type
continue;
}
String cat = (String)values.get(1);
String name = (String)values.get(2);
String jspUrl = (String)values.get(3);
// 4 ImportSource
// 5 CreateDate
// 6 Description
String filterRuntimes = (String)values.get(7);
String filterLibraries = (String)values.get(8);
if(acceptAsset(e, filterRuntimes, filterLibraries)) {
CategoryNode c = findCategory(root, cat);
AssetNode node = createAssetNode(notesUnid,c,name,cat,jspUrl);
node.setTooltip((String)values.get(6));
c.getChildren().add(node);
}
}
} else {
v.setAutoUpdate(false);
ViewNavigator nav = v.createViewNavFromCategory(getAssetForm());
nav.setBufferMaxEntries(500);
for(ViewEntry e=nav.getFirst(); e!=null; e=nav.getNext()) {
Vector<?> values = e.getColumnValues();
String notesUnid = e.getUniversalID();
// 2 type
String cat = (String)values.get(1);
String name = (String)values.get(2);
String assetId = (String)values.get(3);
// 4 ImportSource
// 5 CreateDate
// 6 Description
String filterRuntimes = (String)values.get(7);
String filterLibraries = (String)values.get(8);
if(acceptAsset(e, filterRuntimes, filterLibraries)) {
CategoryNode c = findCategory(root, cat);
AssetNode node = createAssetNode(notesUnid,c,name,cat,findUniqueUrl(c,notesUnid,assetId));
node.setTooltip((String)values.get(6));
c.getChildren().add(node);
}
}
}
return root;
} finally {
v.recycle();
}
} finally {
this.assetLoaderEnvironment = null;
}
}