chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "linzhixing (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CMIS-722) getContentChanges doesn't renew Holder<String>changeLogToken in AtomPub Client
Date Mon, 16 Sep 2013 16:13:53 GMT

    [ https://issues.apache.org/jira/browse/CMIS-722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13768455#comment-13768455
] 

linzhixing commented on CMIS-722:
---------------------------------

If the next link always shows like "<atom:link rel="next" href="http://<RepositoryPath>/changes?changeLogToken=xxxxxx"
type="application/atom+xml;type=feed"/>",

In org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl,

The present: 
Line:84
for (AtomElement element : feed.getElements()) {
    if (element.getObject() instanceof AtomLink) {
        if (isNextLink(element)) {
            result.setHasMoreItems(Boolean.TRUE);
        }
    }
}


So, simply modify it to something like:
for (AtomElement element : feed.getElements()) {
    if (element.getObject() instanceof AtomLink) {
        if (isNextLink(element)) {
            Map<String,String> map = extractUrlParameters(element.getHref());
            changeLogToken.setValue(map.get("changeLogToken")); //Holder<String>changeLogToken
is renewed
            result.setHasMoreItems(Boolean.TRUE);
        }
    }
}
if(!result.hasMoreItems){
    //No next link means the next latestChangeLogToken is RepositoryInfo's token.
    changeLogToken.setValue(getRepoitoryInfo().getLatestChangeLogToken());
}

And the Client API could get a renewed Holder<String>changeToken argument, though I've
never touched codes(especially AtomFeed) in API...
                
> getContentChanges doesn't renew Holder<String>changeLogToken in AtomPub Client
> ------------------------------------------------------------------------------
>
>                 Key: CMIS-722
>                 URL: https://issues.apache.org/jira/browse/CMIS-722
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client-bindings
>    Affects Versions: OpenCMIS 0.10.0
>            Reporter: linzhixing
>
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl#getContentChanges,
which is called from SessionImpl(Line:326), seems not to return a new Holder<String>changeLogToken
argument. When I execute getContentChange from OpenCMIS client, changeLogToken remains the
same as its input value. 
> I confirmed that my CMIS server updates Holder<String>changeLogToken to the latest
token in the returned list both in debugging and Atom feed <atom:link rel="next">.
> To see org.apache.chemistry.opencmis.client.bindings.spi.webservices.DiscoveryServiceImpl#getContentChanges(Line:66),
one can find
>     setHolderValue(portChangeLokToken, changeLogToken);
> but I can't find any such code in atompub DiscoveryServiceImpl.
> So I suppose some codes should be added that sets a renewed changeLogToken reading from
an atom feed page link.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message