cancel
Showing results for 
Search instead for 
Did you mean: 

get the list of modified properties and the list of modifiers from content

wajdi_ghribi
Champ in-the-making
Champ in-the-making
HI,
After a content in repository get modifyied several time, how can i get the list of modified properties and the list of modifiers for each modification(please note that using the versionnable aspect does not seem to be useful for my case).
I will apreciate any help .
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
Why does version history not help?  That would be the primary way to solve this sort of requirement.   Next would be auditing.   And after that some sort of DIY version/audit.

wajdi_ghribi
Champ in-the-making
Champ in-the-making
Hi mrogers, thanks for replying,
So if i change the version of the document before editing it with this code below,
    Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(2, 1.0f);
    versionProperties.put(Version.PROP_DESCRIPTION, "");
    versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
    versionService.createVersion(nodeRef, versionProperties);


i have this Error :

org.springframework.extensions.webscripts.WebScriptException: 05200002 Wrapped Exception (with status template): 05200092 The current version label of the node does not exist in the version history.
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)

mrogers
Star Contributor
Star Contributor
Alfresco will deal with creating the versions for you.    Why are you trying to call createVersion directly?

wajdi_ghribi
Champ in-the-making
Champ in-the-making
Hi mrogers,
When editing a content which has the aspect versionnable, it does not change the version after editing, that's why i tryied to create version programmatically.

Solved,

i changed the property "cm:versionLabel" in the contentmodel.xml from :
  <property name="cm:versionLabel">
               <title>Version Label</title>
               <type>d:text</type>
               <protected>true</protected>
            </property>

To:
  <property name="cm:versionLabel">
               <title>Version Label</title>
               <type>d:text</type>
               <default>1.0</default>
            </property>


and then in the edit code i used "nodeService.setProperty" for each property instead of "nodeService.setProperties".