cancel
Showing results for 
Search instead for 
Did you mean: 

Add an aspect based on document content

pau_carre
Champ in-the-making
Champ in-the-making
Hi guys, I would like to add an aspect to a document node wich value depends on the content of that document. What I would like to do is to sign the document and then add the signature as an aspect of the document.
The problem is that I don't know how to get the document content within a dialog ( BaseDialogBean ). I tried to look for nodeService field but it seems it doesn't have any operation to get the document content.
I'm using SDK's Custom Dialog as the code base to develop the module

Any idea?

Thanks in advance,
Pau Carré Cardona
3 REPLIES 3

jm_pascal
Star Contributor
Star Contributor
Hello,

you can use filefolderService to get your content.
For example, you can user this method : serviceRegistry.getFileFolderService().getReader(nodeRef)
JavaDoc : http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/model/FileFolderServi...

or you can use ContentService with this function : serviceRegistry.getContentService().getReader(nodeRef, propertyQName)
JavaDoc :http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/repository/ContentSer...

It's a beginning…

pau_carre
Champ in-the-making
Champ in-the-making
Hi, thanks for the reply. Now the problem I have is that I don't know how to get the current NodeRef. It seems I have to use createStore from NodeService and then use the StoreRef to get the root/current NodeRef using getRootNode. But, I don't know what parameters I have to use in createStore.
Is createStore + getRootNode the right way to get the current node? If yes, how is the right way to call create store?

Thanks,
Pau Carré Cardona

jm_pascal
Star Contributor
Star Contributor
It's not necessary to create a store for this action.
If you follow the SDK sample, you already have a NodeRef (for a node space! not for a node document!).
So it's not really what you want. But if you have changed this for a node document it's ok.

If you want to have a good start for creating an action, follow this link : http://www.ecmarchitect.com/images/articles/alfresco-actions/actions-article.pdf

Regards,