As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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; }