cancel
Showing results for 
Search instead for 
Did you mean: 

get the author after 'modify content propertie'

tchotchatown
Champ in-the-making
Champ in-the-making
hello ,
i'm using SVN for developing on alfresco and i need to copie the properties(author ,description) that we added in the wizar "modify content properties" but i cant find how  to do.
i tried to get the author after this code lignes   

Map<QName, Serializable> authorProps = new HashMap<QName, Serializable>(1, 1.0f);
      authorProps.put(ContentModel.PROP_AUTHOR, this.author);
      this.getNodeService().addAspect(fileNodeRef, ContentModel.ASPECT_AUTHOR, authorProps);

       writeAuthor(author);  //this will write the author in a text file



in BaseContentWizard.java but i see that it's null and it's normal because the file don't have an author
so i cant see where to get the author String after that i added an author from (modify content properties)
1 REPLY 1

jbarmash
Champ in-the-making
Champ in-the-making
If you are modifying the content wizard, I'd assume after the node is created, you can pull that information out of the newly created node.  I.e. somewhere in finishImpl, after you save the node, you should be able to get the author information (if it gets set automatically by the repo - i am not sure about the specifics there).

Additionally, here are two alternatives:  One of two (or both) ways should work:

1. Crate a content rule that runs a JavaScript script when a document gets added.  The script can copy the author information elsewhere.

2. Create a behavior that gets triggered onCreateNode that captures the same information.  The behavior can point to either java code or javascript. .
  http://ecmarchitect.com/images/articles/alfresco-behavior/behavior-article.pdf