cancel
Showing results for 
Search instead for 
Did you mean: 

copying properties node with the new version

anton_trofimchu
Champ in-the-making
Champ in-the-making
I have two node, old and new version. I want to copy the properties from the old to the new without damaging the version information.

Now I do so:

Map<String, Serializable> properties = new HashMap<String, Serializable>();
properties.put(VersionModel.PROP_VERSION_TYPE,VersionType.MAJOR); 

getServiceRegistry().getVersionService().createVersion(oldTestNodeRef, properties);

getServiceRegistry().getNodeService().setProperties(oldTestNodeRef, getServiceRegistry().getNodeService().getProperties(testNodeRef));

as a result I overwrites the properties and version information.
And when you try to create a new version get an error "The current version label of the node does not exist in the version history."
4 REPLIES 4

mitpatoliya
Star Collaborator
Star Collaborator
I do not understand your requirement.
When you create new version the only property which you have modified get changed in new version.
Rest of them are already there in new version.
Why you trying to do this?

anton_trofimchu
Champ in-the-making
Champ in-the-making
I copy node(test) in the new folder  then am submitting changes, after the changes I need to make it a new version of the source node in the source folder

anton_trofimchu
Champ in-the-making
Champ in-the-making
the old version continues to be used as long as there is a development of a new

mitpatoliya
Star Collaborator
Star Collaborator
If you simply enable the versioning on any file then also I think you will be able to achieve this.
If versioning is enabled and you try to check in the changes it will always ask for creation of new version you can give new version no and then new file will act base for all futures use.
I do not see anything which you cannot achieve with the out of box features.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.