How to change name property in metadata extracter ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2009 09:28 AM
I create a custom metadata extracter in order to gather some additional information (i just add some code to a copy of OfficeMetadataExtracter).
Now, when i add an office document to alfresco, some custom properties and even some default properties(like: title, description) automaticaly receiv some values chosen by me.
But, i was unable to change the name property of the document.
I used putRawValue method:
Does anybody know how to change the name property ? Or, it is impossible to change it in the extracter ?
Now, when i add an office document to alfresco, some custom properties and even some default properties(like: title, description) automaticaly receiv some values chosen by me.
But, i was unable to change the name property of the document.
I used putRawValue method:
putRawValue("alfname", "New NAME chosen by Me", rawProperties); putRawValue("alfdesc", "my file description", rawProperties);
and alfname is declared in custom-metadata-extractors-context.xml: <prop key="alfname">cm:name</prop> <prop key="alfdesc">cm:description</prop>
Does anybody know how to change the name property ? Or, it is impossible to change it in the extracter ?
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2009 10:17 AM
Maybe you can use method:
NodeService.setProperty(nodeRef, qname, value)
something like:
NodeService nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
nodeService.setProperty(nodeRef, QName.createQName(Constants.PROP_NAME), "New NAME chosen by Me")
NodeService.setProperty(nodeRef, qname, value)
something like:
NodeService nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
nodeService.setProperty(nodeRef, QName.createQName(Constants.PROP_NAME), "New NAME chosen by Me")

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2009 08:39 AM
dacedos thanks for your very quick reply.
Unfortunately, i didn't manage to run the code.. i have no ideea who is nodeRef or how to get the noderef for curent node (while being in the extractor method).
I made some other researches and i think i found the solution. it seems that it works if i change the overwritePolicy to EAGER (PRAGMATIC was the default one).
Unfortunately, i didn't manage to run the code.. i have no ideea who is nodeRef or how to get the noderef for curent node (while being in the extractor method).
I made some other researches and i think i found the solution. it seems that it works if i change the overwritePolicy to EAGER (PRAGMATIC was the default one).
