{http://www.alfresco.org/model/application/1.0}interface-language
/{http://www.alfresco.org/model/system/1.0}system/{http://www.alfresco.org/model/system/1.0}people/{ht...
app:configurations/app:preferences
Bonjour,
C'est la valeurs de la méta donnée
{http://www.alfresco.org/model/application/1.0}interface-language
Et elle se trouve via le navigateur de nœud :
/{http://www.alfresco.org/model/system/1.0}system/{http://www.alfresco.org/model/system/1.0}people/{ht...
Donc pour ce faire, il faut rechercher l'utilisateur courant (qui est de type cmerson) et puis sur cette node prendre le XPath:
app:configurations/app:preferences
Et au final, avec le nodeService prendre la propriété nommée plus haut.
Bien à Toi.
NodeRef nodeRef = personService.getPerson(userName);
locale = (Locale)nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE);
StoreRef store = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
String query = "+TYPE:\"cm:person\" +@cm\\:userName:\"USER_NAME\"";
ResultSet rs = searchService.query(store, SearchService.LANGUAGE_LUCENE, query);
if(rs !=null && rs.length()>0) {
NodeRef node = rs.getNodeRef(0);
NodeRef child =nodeService.getChildByName(node, QName.createQName("{http://www.alfresco.org/model/application/1.0}configurations"), "{http://www.alfresco.org/model/application/1.0}configurations");
child = nodeService.getChildByName(child, ContentModel.ASSOC_CONTAINS, "{http://www.alfresco.org/model/application/1.0}preferences");
String locale = (String)nodeService.getProperty(child, QName.createQName("{http://www.alfresco.org/model/application/1.0}interface-language"));
}
serviceRegistry.getNodeService().getProperty(person, ContentModel.PROP_LOCALE).toString()
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.