04-20-2006 04:26 AM
Node document = folder.addNode("cm:aweTestDoc", "cm:content");
document.setProperty("cm:name", "AWE test doc");
document.setProperty("cm:description", "AWE test document, created with JCR");
document.setProperty("cm:title", "AWE document");
document.setProperty("cm:content", "xxxxxxxxxxxxx");
document.addMixin("mix:versionable");
document.checkin();
session.save();
06-13-2006 03:13 PM
> I am migrating some documents over from another type of repository, and would like to just create the version nodes myself rather than doing a checkin/checkout each time for the new version as I have specific version labels as well.
You might be able to use the Alfresco VersionService interface directly to create versions of a node. I think you can set the version label too.
An alternative approach is to use the Importer to populate the version store directly. For an example of the xml, you can perform a 'Complete Repository Export' in v1.3 and view the contents of the file 'xxx_version.acp'.
06-13-2006 05:07 PM
The problem here is that the JCR API is following the versioning semantics of the JSR-170 specification, which are different to those exposed in the Alfresco Web Client. When a JSR-170 node supports mix:versionable, it is locked whilst checked-in and unlocked whilst checked-out. Essentially, you are seeing the checked-in item in the Web Client, but it's locked, which is why there's a lock icon and no associated working copy.
The workaround for Alfresco Web Client compatibility is to assign the cm:versionable aspect via the JSR-170 api, and then use the Alfresco native api calls on the COCIService to checkin/out. This will provide the same behaviour as exhibited in the web client.
It's possible to mix JCR/Alfresco native api calls as described in http://wiki.alfresco.com/wiki/Introducing_the_Alfresco_Java_Content_Repository_API#Mixing_JCR_and_Al....
09-21-2009 02:30 AM
The workaround for Alfresco Web Client compatibility is to assign the cm:versionable aspect via the JSR-170 api, and then use the Alfresco native api calls on the COCIService to checkin/out. This will provide the same behaviour as exhibited in the web client.
09-22-2009 03:02 AM
The problem here is that the JCR API is following the versioning semantics of the JSR-170 specification, which are different to those exposed in the Alfresco Web Client. When a JSR-170 node supports mix:versionable, it is locked whilst checked-in and unlocked whilst checked-out.
Note that it is possible to lock a node even if it is checked-in (the lock-related properties will be changed despite the checked-in status).
:
Note also that it is possible to unlock a node even if it is checked-in (the lock-related properties will be changed despite the checked-in status).
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.