Hi,
I have a couple of questions regarding to the use of version.
Firstly, it is my understanding that there is no built-in support to save
the username who check in the node in version history. So I use a property
"createdBy".
// set createdBy
node.setProperty("createdBy", session.getUserID());
session.save();
node.checkin();
Then I found that I cannot retrieve it from base version or version history.
// retrieve from base version
String createdBy;
Version baseVersion = node.getBaseVersion();
if (baseVersion.hasProperty("createdBy")) {
createdBy = baseVersion.getProperty("createdBy").getString();
}
But it is saved correctly and can be retrieved from node.
// retrieve from node
String createdBy = node.getProperty("createdBy").getString();
I know that versions are different nodes in repository. Don't they keep all
the data that is saved before checkin? Did I do something wrong?
Secondly, is there built-in support to generate the version numbers like
1.1, 1.2, when checkin or do I have to set version label manually?
Thank you very much.