Sascha Homeier created CMIS-1074:
------------------------------------

             Summary: getContentStream returns null for renditions if link 
cache is cold
                 Key: CMIS-1074
                 URL: https://issues.apache.org/jira/browse/CMIS-1074
             Project: Chemistry
          Issue Type: Bug
          Components: opencmis-client
    Affects Versions: OpenCMIS 1.0.0
            Reporter: Sascha Homeier


A direct request for a rendition stream returns null:
{code}
ContentStream contentStream = cmisSession.getContentStream(objectId, 
originalId, null, null);
// contentStream is null here 
{code}

Used binding: AtomPub

I am not sure if I understand the AtomPub binding with its links well enough 
but for me it seems the link cache is cold and the client wants to heat it up 
by getting the main document. This is done by getting the object by id with 
rendition filter "cmis:none". I guess this rendition filter is the reason there 
is no "alternate" link found in link cache which could be used to actually 
request the content stream.

If you heat up the cache manually by getting the main document including 
renditions first it works:
{code}
OperationContext opCtx = OperationContextUtils.createMinimumOperationContext();
opCtx.setRenditionFilterString("*");
ObjectId objectId = cmisSession.createObjectId(coid);
Document document = (Document) cmisSession.getObject(objectId, opCtx);
ContentStream contentStream = cmisSession.getContentStream(objectId, 
originalId, null, null);
{code}

Also getting the contentStream via document object works:
{code}
OperationContext opCtx = OperationContextUtils.createMinimumOperationContext();
opCtx.setRenditionFilterString("*");
ObjectId objectId = cmisSession.createObjectId(coid);
Document document = (Document) cmisSession.getObject(objectId, opCtx);
ContentStream contentStream = document.getContentStream(originalId);
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to