[ 
https://issues.apache.org/jira/browse/CMIS-808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristopher Kees updated CMIS-808:
---------------------------------

    Description: 
First timer to JIRA here so please forgive any oversights on my part.

When getContentStream gets called, it passes a NULL value for the 
renditionFilter field on the URL which causes EMC's code to throw a 
NullPointerException.  If an asterisk is passed instead, the EMC code returns 
URLs successfully and allows for successful retrieval of the content.

>From AbstractAtomPubService.java:

    public String loadLink(String repositoryId, String id, String rel, String 
type) {
        String link = getLink(repositoryId, id, rel, type);
        if (link == null) {
            getObjectInternal(repositoryId, IdentifierType.ID, id, 
ReturnVersion.THIS, null, null, null, NULL, null,
                    null, null);
            link = getLink(repositoryId, id, rel, type);
        }

        return link;
    }

The above code results in a URL that looks something like this and returns a 
500 response:

http://server:port/cmis/resources/repositories/repo1/objects/0901ba9d8029b1ac?filter=&includeAllowableActions=&includePolicyIds=&includeRelationships=&includeACL=&renditionFilter=

One simple tweak and the GET results in a 200 response as expected:

http://epdamdmmk1.fmr.com:12100/cmis/resources/repositories/dctfepsdev1/objects/0901ba9d8029b1ac?filter=&includeAllowableActions=&includePolicyIds=&includeRelationships=&includeACL=&renditionFilter=*

The easy fix would be to change the call to getObjectInternal to:

getObjectInternal(repositoryId, IdentifierType.ID, id, ReturnVersion.THIS, 
null, null, null, "*", null, null, null);

Even better would be to retrieve the specified value for renditionFilter on the 
session context.  However, BindingSession objects do not appear to share the 
OperationContext which is set on the SessionImpl object and which is used by 
the Session.getObject() call.

  was:
First timer to JIRA here so please forgive any oversights on my part.

When getContentStream gets called, it passes a NULL value for the 
renditionFilter field on the URL which causes EMC's code to throw a 
NullPointerException.  If an asterisk is passed instead, the EMC code returns 
URLs successfully and allows for successful retrieval of the content.

>From AbstractAtomPubService.java:

    public String loadLink(String repositoryId, String id, String rel, String 
type) {
        String link = getLink(repositoryId, id, rel, type);
        if (link == null) {
            getObjectInternal(repositoryId, IdentifierType.ID, id, 
ReturnVersion.THIS, null, null, null, NULL, null,
                    null, null);
            link = getLink(repositoryId, id, rel, type);
        }

        return link;
    }

One alternative would be to call change the call to getObjectInternal to:

getObjectInternal(repositoryId, IdentifierType.ID, id, ReturnVersion.THIS, 
null, null, null, "*", null, null, null);

Even better would be to retrieve the specified value for renditionFilter on the 
session context.  However, BindingSession objects do not appear to share the 
OperationContext which is set on the SessionImpl object and which is used by 
the Session.getObject() call.


> Document.getContentStream() does not work with EMC Documentum
> -------------------------------------------------------------
>
>                 Key: CMIS-808
>                 URL: https://issues.apache.org/jira/browse/CMIS-808
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-client-bindings
>    Affects Versions: OpenCMIS 0.11.0
>         Environment: Java
>            Reporter: Kristopher Kees
>            Priority: Minor
>              Labels: documentum, renditions
>
> First timer to JIRA here so please forgive any oversights on my part.
> When getContentStream gets called, it passes a NULL value for the 
> renditionFilter field on the URL which causes EMC's code to throw a 
> NullPointerException.  If an asterisk is passed instead, the EMC code returns 
> URLs successfully and allows for successful retrieval of the content.
> From AbstractAtomPubService.java:
>     public String loadLink(String repositoryId, String id, String rel, String 
> type) {
>         String link = getLink(repositoryId, id, rel, type);
>         if (link == null) {
>             getObjectInternal(repositoryId, IdentifierType.ID, id, 
> ReturnVersion.THIS, null, null, null, NULL, null,
>                     null, null);
>             link = getLink(repositoryId, id, rel, type);
>         }
>         return link;
>     }
> The above code results in a URL that looks something like this and returns a 
> 500 response:
> http://server:port/cmis/resources/repositories/repo1/objects/0901ba9d8029b1ac?filter=&includeAllowableActions=&includePolicyIds=&includeRelationships=&includeACL=&renditionFilter=
> One simple tweak and the GET results in a 200 response as expected:
> http://epdamdmmk1.fmr.com:12100/cmis/resources/repositories/dctfepsdev1/objects/0901ba9d8029b1ac?filter=&includeAllowableActions=&includePolicyIds=&includeRelationships=&includeACL=&renditionFilter=*
> The easy fix would be to change the call to getObjectInternal to:
> getObjectInternal(repositoryId, IdentifierType.ID, id, ReturnVersion.THIS, 
> null, null, null, "*", null, null, null);
> Even better would be to retrieve the specified value for renditionFilter on 
> the session context.  However, BindingSession objects do not appear to share 
> the OperationContext which is set on the SessionImpl object and which is used 
> by the Session.getObject() call.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to