java - CMIS Versioning not working as expected -
i'm creating file on document service cmis api using following code:
zipmapfile.put(propertyids.object_type_id, "sap:versioned"); zipmapfile.put(propertyids.name, "g" + g.getid() + ".zip"); document versioneddocument = opencmissession.getrootfolder().createdocument(zipmapfile, contentstream, versioningstate.major); newzipfileid = versioneddocument.checkout(); ...
the code above working , file being correctly generated. when run following code:
cmissession.getobject(newzipfileid.getid());
i file created before, no errors.
however, i'm having problem when try upload new version file.
to this, i'm using following piece of code:
oldzipfileid = newzipfileid; document pwc = (document) cmissession.getobject(oldzipfileid); pwc.setcontentstream(contentstream, true); newzipfileid = pwc.checkin(false, null, null, null);
whenever this, can access newer version no problems running following code:
cmissession.getobject(newzipfileid.getid());
however, can't access older version anymore! if try run:
cmissession.getobject(oldzipfileid);
i cmisobjectnotfoundexception
the moment lose access older version when method pwc.checkin(false, null, null, null);
executed. after call, trying object referenced oldzipid gives me cmisobjectnotfoundexception.
i'm using mongodb.
any appreciated! thank you!
although i'm not expert versioning in hcp document service write works designed afaik. when checkin pwc there new actual version (latest version in history), , pwc gone. consequently, oldzipfileid identifying pwc becomes invalid. new actual version pwc became gets new object id. seems observed.
Comments
Post a Comment