08-10-2010 05:46 AM
FacesContext fc = FacesContext.getCurrentInstance();
NavigationBean navBean = (NavigationBean)fc.getExternalContext().getSessionMap().get(NavigationBean.BEAN_NAME);
containerNodeRef = navBean.getCurrentNode().getNodeRef();
return containerNodeRef;
08-10-2010 09:07 AM
08-10-2010 09:58 AM
08-10-2010 10:47 AM
public NodeRef getDashletTemplateNodeRef(String templateName) {
NodeRef templateNodeRef = null;
SearchParameters sp = new SearchParameters();
sp.addStore(new StoreRef("workspace://SpacesStore"));
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
// encode space chars
String cnNameNoWhiteSpaces = templateName.replace(" ", "_x0020_");
String query = "";
// search in 'Dashlets templates' space to increase research speed
query = " +PATH:\"/app:company_home/app:dictionary/cm:Dashlets_x0020_Templates//.\"";
query += " AND +QNAME:\"cm:" + cnNameNoWhiteSpaces + "\"";
sp.setQuery(query);
ResultSet results = null;
try {
results = searchService.query(sp);
} finally {
if (results != null) {
if (results.length() > 0) {
templateNodeRef = results.getNodeRef(0);
} else {
logger.warn("aucun résultat trouvé pour recherche de " + templateName);
}
// close the result set
results.close();
}
}
return templateNodeRef;
}
08-10-2010 11:23 AM
08-10-2010 12:25 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.