FacesContext fc = FacesContext.getCurrentInstance();
NavigationBean navBean = (NavigationBean)fc.getExternalContext().getSessionMap().get(NavigationBean.BEAN_NAME);
containerNodeRef = navBean.getCurrentNode().getNodeRef();
return containerNodeRef;
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;
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.