Récupérer NodeRef d'un espace de travail Via NavigationBean

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 05:46 AM
Bonjour,
Comment faire pour récupérer le nodeRef d'un espace de travail bien précis via NavigationBean: par exemple : company home/PME/industrie
j'ai déja le code suivant pour récupérer le nodeRef du l'espace courant
Comment faire pour adapter ce code à mon besoin???
Merci
Comment faire pour récupérer le nodeRef d'un espace de travail bien précis via NavigationBean: par exemple : company home/PME/industrie
j'ai déja le code suivant pour récupérer le nodeRef du l'espace courant
FacesContext fc = FacesContext.getCurrentInstance(); NavigationBean navBean = (NavigationBean)fc.getExternalContext().getSessionMap().get(NavigationBean.BEAN_NAME); containerNodeRef = navBean.getCurrentNode().getNodeRef(); return containerNodeRef;
Comment faire pour adapter ce code à mon besoin???
Merci
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 09:07 AM
recherche Lucene / XPath

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 09:58 AM
Pouvez vous me donner un bout de code à titre d'exemple ?
Merci Rodel
Merci Rodel

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 10:47 AM
Très rapidement, un code qui permet de chercher un fichier précis dans Dictionnaire des données / Dashlets templates, à partir du nom du fichier
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; }

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 11:23 AM
Merci Rodel,
C'est exactement ce que je cherche.
Bonne continuation
C'est exactement ce que je cherche.
Bonne continuation

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 12:25 PM
pas de problèmes, bonne chance !

