<aspect name="lpr:ASPECT_BASE_CONTENT">
<title>ASPECT_BASE_CONTENT</title>
<properties>
<property name="lpr:ASPECT_BASE_CONTENT">
<type>d:text</type>
</property>
</properties>
</aspect>
nodeService.setProperty(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT, NodeBase);
NodeBase = (NodeRef)nodeService.getProperty(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT);
workspace://SpacesStore/14f53fc4-0620-11dd-882d-2f9ed3253cba
14f53fc4-0620-11dd-882d-2f9ed3253cba
<aspect name="lpr:ASPECT_BASE_CONTENT">
<title>ASPECT_BASE_CONTENT</title>
<properties>
<property name="lpr:ASPECT_BASE_CONTENT">
<type>d:noderef</type>
</property>
</properties>
</aspect>
Comme ça tu peux manipuler directement des NodeRef dans la propriété.
Bonjour,
Trois solutions :
- sauvegarder le NodeRef sous forme de chaîne (nodeRef.toString()) ; le récupérer aussi sous forme de chaîne, puis reconstruire le NodeRef à partir de cette chaîne (new NodeRef(valeur))
- sauvegarder juste l'UUID du doc (propriété ContentModel.PROP_NODE_UUID) comme tu le suggères et reconstruire le NodeRef à partir de l'UUID sauvegardé (new NodeRef("workspace", "SpacesStore", uuid)
- utiliser directement une propriété de type d:noderef et pas d:text dans le modèle :Comme ça tu peux manipuler directement des NodeRef dans la propriété.<aspect name="lpr:ASPECT_BASE_CONTENT">
<title>ASPECT_BASE_CONTENT</title>
<properties>
<property name="lpr:ASPECT_BASE_CONTENT">
<type>d:noderef</type>
</property>
</properties>
</aspect>
if (nodeService.hasAspect(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT) == false) {
nodeService.addAspect(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT, null);
nodeService.setProperty(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT, NodeBase.getId());
}
NodeBase = new NodeRef((String)(BASE_WORKSPACE + "/" + nodeService.getProperty(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT)));
NodeBase = new NodeRef("workspace", "SpacesStore", nodeService.getProperty(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT)));
NodeBase = nodeService.getProperty(sessionNodeRef, LprContentModel.ASPECT_BASE_CONTENT);
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.