Hello together,

I am currently implementing the ChangeLog functionality on server side and have 
a question concerning the spec conformant behavior of Discovery Service 
„getContentChanges“:

Due to get the very first change event the CMIS spec 1.1 says I need to pass a 
null changeLogToken parameter:


  *   String changeLogToken: If specified, then the repository MUST return the 
change event corresponding to the value of the specified change log token as the 
first result in the output.

If not specified, then the repository MUST return the first change event recorded 
in the change log.

So did I understand it correctly that at server side I should only pass ONE 
change event which must be the very first event (either from beginning if 
ChangeLog capability provides complete log or otherwise from the point in time 
when changes were recorded)?

So if I am on the right track I think to get ALL change events from beginning 
of the ChangeLog on client-side I should first ask for the first change event 
with token parameter null and then ask for the events since that token.
So client-code should look like that imho:

// get very first change event
ItemIterable<ChangeEvent> contentChanges = cmisSession.getContentChanges(null, 
includeProperties);
ChangeEvent veryFirstChangeEvent = contentChanges.iterator().next();

// get change log token of very first event and ask for the first page of 
change events on going-forward basis
CmisObject veryFirstCmisObject = 
cmisSession.getObject(veryFirstChangeEvent.getObjectId());
ChangeEvents allContentChangesFirstPage = 
cmisSession.getContentChanges(veryFirstCmisObject.getChangeToken(), 
includeProperties, maxItems);

It would be nice if someone could just confirm if this is the intended and spec 
compliant repository behaviour.
I am not fully sure if the server reply for a null token parameter should 
really only be ONE change event (the very first) or ALL change events beginning 
with the very first.


thx in advance.

Cheers
Sascha

Reply via email to