Topic
15 replies Latest Post - ‏2010-12-16T18:58:15Z by SystemAdmin
SystemAdmin
SystemAdmin
32 Posts
ACCEPTED ANSWER

Pinned topic Need help retrieving a document using CMIS

‏2010-12-06T00:19:21Z |
I am trying to retrive a document from IBM CM using CMIS. At this point, I am not sure how to proceed. Can someone outline a procedure to retreive a document.

I am able to retrieve a document. Within the document object, the following properties are missing.

cmis:contentStreamLength
cmis:contentStreamMimeType
cmis:contentStreamFileName
cmis:contentStreamId

Is this limitation within the Tech Preview release ? or am I missing something.

Thank you.
Updated on 2010-12-16T18:58:15Z at 2010-12-16T18:58:15Z by SystemAdmin
  • jay.brown
    jay.brown
    18 Posts
    ACCEPTED ANSWER

    Re: Need help retrieving a document using CMIS

    ‏2010-12-06T17:54:22Z  in response to SystemAdmin
    Is the document in question a metadata only doc (i.e. no content stream associated) ? If so then you should see a property collection where the properties are present but empty since there is no conntentStream; like this:

    <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Size" localName="ContentSize" propertyDefinitionId="cmis:contentStreamLength"/>

    Is this what you are seeing?
    • SystemAdmin
      SystemAdmin
      32 Posts
      ACCEPTED ANSWER

      Re: Need help retrieving a document using CMIS

      ‏2010-12-06T22:16:02Z  in response to jay.brown
      It is a Document and not a Folder in IBM Content Management terms.

      I have analyzed this problem in many ways.

      Using OpenCMIS from Apache Chemistry, query for documents and from the results, when I click on 'download' link .. I get the following exception.

      =============================
      com.ibm.ecm.cmis.app.exceptions.ConstraintViolationException: CIL1614: The content stream cannot be retrieved because the streamId -1 is not valid.
      Explanation: The value that was specified for the streamId is outside the range of valid streamIds on the content server.
      Action: Specify the streamId of an existing content stream.
      For more information about streamIds, see the OASIS CMIS API specification.

      com.ibm.ecm.cmis.app.exceptions.ConstraintViolationException: CIL1614: The content stream cannot be retrieved because the streamId -1 is not valid.
      Explanation: The value that was specified for the streamId is outside the range of valid streamIds on the content server.
      Action: Specify the streamId of an existing content stream.
      For more information about streamIds, see the OASIS CMIS API specification.
      at com.ibm.ecm.cmis.app.cmis.ContentStream.get(ContentStream.java:195)
      at com.ibm.ecm.cmis.app.servlet.CMISServlet.doGet(CMISServlet.java:156)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
      at com.ibm.ecm.cmis.app.servlet.ParamMappingServlet.service(ParamMappingServlet.java:246)
      at com.ibm.ecm.cmis.app.servlet.CMISServlet.service(CMISServlet.java:501)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
      ============================================================================================

      Also here is Atom response to the request: http://localhost:9080/cm8cmis/resources/icmnlsdb/Query?q=select * from MEMBER_DOC WHERE ( MEMBER_ID='100021')

      It does not have the 'ContentStream' properties as part of the document object.

      
      <?xml version=
      "1.0" encoding=
      "utf-8" standalone=
      "yes" ?> - <atom:feed xmlns:app=
      "http://www.w3.org/2007/app" xmlns:atom=
      "http://www.w3.org/2005/Atom" xmlns:cmisra=
      "http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis=
      "http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism=
      "http://docs.oasis-open.org/ns/cmis/messaging/200908/"> - <atom:author> <atom:name>System</atom:name> </atom:author> <atom:link type=
      "application/atom+xml;type=entry" rel=
      "via" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Query/?maxItems=25" /> <atom:link type=
      "application/atomsvc+xml" rel=
      "service" href=
      "http://localhost:9080/cm8cmis/resources/Service?repositoryId=icmnlsdb" /> <atom:link type=
      "application/atom+xml;type=feed" rel=
      "self" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Query/?q=select+*+from+MEMBER_DOC+WHERE+%28+MEMBER_ID%3D%27100021%27%29" /> <atom:link type=
      "application/atom+xml;type=feed" rel=
      "first" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Query/?skipCount=0&q=select+*+from+MEMBER_DOC+WHERE+%28+MEMBER_ID%3D%27100021%27%29" /> <atom:id>urn:uuid:queryresult</atom:id> <atom:title>Query on icmnlsdb select * from MEMBER_DOC WHERE ( MEMBER_ID=
      '100021')</atom:title> <atom:updated>2010-12-06T09:29:44.926-05:00</atom:updated> <atom:generator version=
      "1.0">IBM Content Management Interoperability Services 
      
      for IBM Content Manager</atom:generator> <cmisra:numItems>1</cmisra:numItems> - <atom:entry> - <cmisra:object> - <cmis:properties> - <cmis:propertyString queryName=
      "cmis:name" displayName=
      "label (or short name / file name)" localName=
      "clbContent.clbLabel" propertyDefinitionId=
      "cmis:name"> <cmis:value>100021</cmis:value> </cmis:propertyString> - <cmis:propertyId queryName=
      "cmis:objectId" displayName=
      "ID" propertyDefinitionId=
      "cmis:objectId"> <cmis:value>1076_A1001001A10L05B03815I33691v1</cmis:value> </cmis:propertyId> - <cmis:propertyId queryName=
      "cmis:objectTypeId" displayName=
      "type ID" propertyDefinitionId=
      "cmis:objectTypeId"> <cmis:value>d_-2_MEMBER_DOCv-1</cmis:value> </cmis:propertyId> - <cmis:propertyId queryName=
      "cmis:baseTypeId" propertyDefinitionId=
      "cmis:baseTypeId"> <cmis:value>cmis:document</cmis:value> </cmis:propertyId> - <cmis:propertyString queryName=
      "cmis:createdBy" displayName=
      "Created By User Name" localName=
      "CREATEUSERID" propertyDefinitionId=
      "cmis:createdBy"> <cmis:value>ICMADMIN</cmis:value> </cmis:propertyString> - <cmis:propertyDateTime queryName=
      "cmis:creationDate" displayName=
      "Created Date" localName=
      "CREATETS" propertyDefinitionId=
      "cmis:creationDate"> <cmis:value>2010-12-05T10:38:17.000-05:00</cmis:value> </cmis:propertyDateTime> - <cmis:propertyString queryName=
      "cmis:lastModifiedBy" displayName=
      "Last Modified By User Name" localName=
      "LASTCHANGEDUSERID" propertyDefinitionId=
      "cmis:lastModifiedBy"> <cmis:value>ICMADMIN</cmis:value> </cmis:propertyString> - <cmis:propertyDateTime queryName=
      "cmis:lastModificationDate" displayName=
      "Last Modified Date" localName=
      "LASTCHANGEDTS" propertyDefinitionId=
      "cmis:lastModificationDate"> <cmis:value>2010-12-05T10:38:17.000-05:00</cmis:value> </cmis:propertyDateTime> - <cmis:propertyString queryName=
      "cmis:changeToken" propertyDefinitionId=
      "cmis:changeToken"> <cmis:value>unknown</cmis:value> </cmis:propertyString> - <cmis:propertyDateTime queryName=
      "clbNonGroup.DOC_RECV_DATE" displayName=
      "DOC_RECV_DATE" localName=
      "DOC_RECV_DATE" propertyDefinitionId=
      "clbNonGroup.DOC_RECV_DATE"> <cmis:value>2010-12-05T07:00:00.000-05:00</cmis:value> </cmis:propertyDateTime> - <cmis:propertyString queryName=
      "clbNonGroup.MEMBER_ID" displayName=
      "MEMBER_ID" localName=
      "MEMBER_ID" propertyDefinitionId=
      "clbNonGroup.MEMBER_ID"> <cmis:value>100021</cmis:value> </cmis:propertyString> - <cmis:propertyString queryName=
      "clbNonGroup.POLICY_NUMBER" displayName=
      "POLICY_NUMBER" localName=
      "POLICY_NUMBER" propertyDefinitionId=
      "clbNonGroup.POLICY_NUMBER"> <cmis:value>6301234581</cmis:value> </cmis:propertyString> - <cmis:propertyString queryName=
      "clbNonGroup.LAST_NAME" displayName=
      "LAST_NAME" localName=
      "LAST_NAME" propertyDefinitionId=
      "clbNonGroup.LAST_NAME"> <cmis:value>Kumar</cmis:value> </cmis:propertyString> - <cmis:propertyString queryName=
      "clbNonGroup.FIRST_NAME" displayName=
      "FIRST_NAME" localName=
      "FIRST_NAME" propertyDefinitionId=
      "clbNonGroup.FIRST_NAME"> <cmis:value>Anil</cmis:value> </cmis:propertyString> - <cmis:propertyString queryName=
      "clbNonGroup.STATE" displayName=
      "STATE" localName=
      "STATE" propertyDefinitionId=
      "clbNonGroup.STATE"> <cmis:value>IL</cmis:value> </cmis:propertyString> - <cmis:propertyBoolean queryName=
      "cmis:isLatestVersion" propertyDefinitionId=
      "cmis:isLatestVersion"> <cmis:value>true</cmis:value> </cmis:propertyBoolean> - <cmis:propertyBoolean queryName=
      "cmis:isMajorVersion" propertyDefinitionId=
      "cmis:isMajorVersion"> <cmis:value>true</cmis:value> </cmis:propertyBoolean> - <cmis:propertyBoolean queryName=
      "cmis:isLatestMajorVersion" propertyDefinitionId=
      "cmis:isLatestMajorVersion"> <cmis:value>true</cmis:value> </cmis:propertyBoolean> - <cmis:propertyString queryName=
      "cmis:versionLabel" displayName=
      "Version Labels" localName=
      "clbVersion.clbVerLabels" propertyDefinitionId=
      "cmis:versionLabel"> <cmis:value>1</cmis:value> </cmis:propertyString> - <cmis:propertyId queryName=
      "cmis:versionSeriesId" displayName=
      "ID" propertyDefinitionId=
      "cmis:versionSeriesId"> <cmis:value>1076_A1001001A10L05B03815I33691v1</cmis:value> </cmis:propertyId> - <cmis:propertyBoolean queryName=
      "cmis:isVersionSeriesCheckedOut" propertyDefinitionId=
      "cmis:isVersionSeriesCheckedOut"> <cmis:value>false</cmis:value> </cmis:propertyBoolean> - <cmis:propertyId queryName=
      "cmis:baseTypeId" propertyDefinitionId=
      "cmis:baseTypeId"> <cmis:value>cmis:document</cmis:value> </cmis:propertyId> - <cmis:propertyId queryName=
      "cmis:objectTypeId" displayName=
      "type ID" propertyDefinitionId=
      "cmis:objectTypeId"> <cmis:value>d_-2_MEMBER_DOCv-1</cmis:value> </cmis:propertyId> </cmis:properties> <p8ext:ClassDisplayName xmlns:p8ext=
      "http://www.ibm.com/xmlns/prod/ecm/cmis/p8extensions">MEMBER_DOC</p8ext:ClassDisplayName> </cmisra:object> <atom:id>http:
      //localhost:9080/cm8cmis/resources/icmnlsdb/Content/1076_A1001001A10L05B03815I33691v1</atom:id>  <atom:updated>2010-12-05T10:38:17.000-05:00</atom:updated> <app:edited>2010-12-05T10:38:17.000-05:00</app:edited> <atom:published>2010-12-05T10:38:17.000-05:00</atom:published> <atom:title>100021</atom:title> <atom:summary>100021</atom:summary> <atom:content src=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/ContentStream/1076_A1001001A10L05B03815I33691v1/-1" /> - <atom:author> <atom:name>ICMADMIN</atom:name> </atom:author> <atom:link type=
      "application/atom+xml;type=entry" rel=
      "self" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Content/1076_A1001001A10L05B03815I33691v1" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/atom+xml;type=entry" rel=
      "edit" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Content/1076_A1001001A10L05B03815I33691v1" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/cmisallowableactions+xml" rel=
      "http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/AllowableActions/1076_A1001001A10L05B03815I33691v1" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/atom+xml;type=feed" rel=
      "up" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Parents/d_-2_MEMBER_DOCv-1/1076_A1001001A10L05B03815I33691v1?maxItems=25" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/atom+xml;type=feed" rel=
      "version-history" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Allversions/1076_A1001001A10L05B03815I33691v1" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/atom+xml;type=entry" rel=
      "current-version" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/LatestVersion/1076_A1001001A10L05B03815I33691v1" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/atom+xml;type=feed" rel=
      "http://docs.oasis-open.org/ns/cmis/link/200908/relationships" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Relationships/d_-2_MEMBER_DOCv-1/1076_A1001001A10L05B03815I33691v1?maxItems=25" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> <atom:link type=
      "application/atom+xml;type=entry" rel=
      "describedby" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/Type/d_-2_MEMBER_DOCv-1?includePropertyDefinitions=true" cmisra:id=
      "d_-2_MEMBER_DOCv-1" /> <atom:link type=
      "application/atomsvc+xml" rel=
      "service" href=
      "http://localhost:9080/cm8cmis/resources/Service?repositoryId=icmnlsdb" /> <atom:link length=
      "0" rel=
      "edit-media" href=
      "http://localhost:9080/cm8cmis/resources/icmnlsdb/ContentStream/1076_A1001001A10L05B03815I33691v1/-1" cmisra:id=
      "1076_A1001001A10L05B03815I33691v1" /> </atom:entry> </atom:feed>
      
  • jay.brown
    jay.brown
    18 Posts
    ACCEPTED ANSWER

    Re: Need help retrieving a document using CMIS

    ‏2010-12-06T23:15:22Z  in response to SystemAdmin
    This is an area that could be a bit more clear in the spec perhaps. In the case where the document does not have an optional content-element set there will be an edit-media link present which cannot be retrieved. This is because the edit-media link must always be present regardless of if the content is present or not. In the case where content is not present (this case) the edit-media link must be used by a client to PUT content to the document.
    When you retrieve an edit-media link for a doc that does not have a content element you should get an appropriate error response.
    In this case I think the message :

    com.ibm.ecm.cmis.app.exceptions.ConstraintViolationException: CIL1614: The content stream cannot be retrieved because the streamId -1 is not valid.
    Explanation: The value that was specified for the streamId is outside the range of valid streamIds on the content server.
    Action: Specify the streamId of an existing content stream.
    For more information about streamIds, see the OASIS CMIS API specification.

    is quite specific.

    In this case it is easy for a client to tell if there are content elements present by looking at the other content stream metadata on the doc. If they are not set then there is no content element.
    • SystemAdmin
      SystemAdmin
      32 Posts
      ACCEPTED ANSWER

      Re: Need help retrieving a document using CMIS

      ‏2010-12-06T23:39:40Z  in response to jay.brown
      Jay,

      But the document exists in IBM Content Manager. I am getting this error message even though the document exists in IBM Content Manager.

      Sreeni
      • SystemAdmin
        SystemAdmin
        32 Posts
        ACCEPTED ANSWER

        Re: Need help retrieving a document using CMIS

        ‏2010-12-06T23:42:22Z  in response to SystemAdmin
        Sorry, I clicked too early before another clarification.

        "In the case where the document does not have an optional content-element set there will be an edit-media link present which cannot be retrieved."

        Where do we set content-element ?
  • jay.brown
    jay.brown
    18 Posts
    ACCEPTED ANSWER

    Re: Need help retrieving a document using CMIS

    ‏2010-12-07T00:13:20Z  in response to SystemAdmin
    You can create a document with content by setting the cmisra:content (see spec section 3.4.1.3.6) as part of the create op.
    Or you can create a document in a checked out state (without content) and then do a PUT to the edit-media link with the binary content you wish to set.

    Our poster videos (on the right column of this page:
    http://www-01.ibm.com/software/data/content-management/cm-interoperablity-services.html
    give some examples of the former.
    • SystemAdmin
      SystemAdmin
      32 Posts
      ACCEPTED ANSWER

      Re: Need help retrieving a document using CMIS

      ‏2010-12-07T13:52:10Z  in response to jay.brown
      Jay,

      The videos were a big help and are invaluable to people like me. Please keep them coming.

      I have followed up on your responses and come to a conclusion that ...

      We have a problem with CMIS implementation for IBM Content Manager. Using OpenCMIS, I am able to get a list of documents. When I click on one of the links to show the document, it fails. I can use e-Client for IBM Content Manager and view the same document without any problems. The document is a PDF document in IBM Content Manager.

      Sreeni
      • jay.brown
        jay.brown
        18 Posts
        ACCEPTED ANSWER

        Re: Need help retrieving a document using CMIS

        ‏2010-12-07T17:43:16Z  in response to SystemAdmin
        Ok. This is looking like an issue with the tech preview on our side. Unfortunately we have some staff that supports this module on vacation this week so we will address this on Monday the 13th when they return.

        Glad that the videos helped. :)

        Jay
        • SystemAdmin
          SystemAdmin
          32 Posts
          ACCEPTED ANSWER

          Re: Need help retrieving a document using CMIS

          ‏2010-12-13T19:28:33Z  in response to jay.brown
          Any update would be appreciated.

          Thank you Sreeni
          • TigerTrix
            TigerTrix
            30 Posts
            ACCEPTED ANSWER

            Re: Need help retrieving a document using CMIS

            ‏2010-12-13T23:52:02Z  in response to SystemAdmin
            The content stream -1 is still an issue on the webservices side. I have escalated the priority of this fix to see if we can get it in soon. It is solved in the REST code. I believe -1 should be treated as default stream, and if the document doesn't have a content stream yet, it will likely just stream a 0-byte stream if requested.

            This could also depend on your document type between the 3 CM8 classifications of item types-- metadata only ("item"), optimized single binary (best) ("resource"), and compound document supporting multiple binaries ("document"). If it is a compound document, an empty binary part doesn't exist by default in the CM8 repository, but should be virtualized a 0-byte stream until a >0 byte stream created for the first time. However, it is also possible that on metadata only items, or compound documents without a stream, it might not report a content stream if none exist yet. But we do expect it to work within the CMIS spec. If content stream should always exist, then they should always report. But I don't recall that being the case. I do believe more likely than not, the CM8 implementation will always report 1 stream, 0 bytes, even when not existing. It will be a limitation that you cannot remove the stream.

            So let's see if we can get that fixed. I cannot commit to a solution time frame officially at this time. My unofficial hope is that we might be able to fix in an update this week. But if it cannot complete this week, it will not happen until January at the earliest.
            • SystemAdmin
              SystemAdmin
              32 Posts
              ACCEPTED ANSWER

              Re: Need help retrieving a document using CMIS

              ‏2010-12-14T03:34:56Z  in response to TigerTrix
              Is there a way to get this fix for REST Services only. At this point, this has become a road block for our PoC.

              At this time we are using "Document" only. If there is a happy path way of viewing a document using CMIS, we would be more than happy to use it.
              Thanks again
              Sreenivas
              sangara@syscom.com
              • TigerTrix
                TigerTrix
                30 Posts
                ACCEPTED ANSWER

                Re: Need help retrieving a document using CMIS

                ‏2010-12-14T19:30:16Z  in response to SystemAdmin
                It was my belief that REST worked fine in this respect, and only WS still had this -1 problem. However, if you say that you are finding the problem on REST, then I can accept that it perhaps is still a problem for REST. This issue has already been fixed in the current code stream and should fix it for both REST & WS. The unknown right now is if the next tech preview update will include this fix or not. The next update I had planned was going to be a previous build and a newer build will possibly cause a delay. I might think of updating twice. (Again, this statement makes no guarantees of availability or time lines, just informal plan).

                But we did confirm the problem exists only for compound documents supporting multiple binary parts. The best practices recommended will always be for normal single binary documents, which is the "resource" classification. We strongly recommend using "resource" classification. All statements of current feature support in the tech preview are tested against normal single binary documents ("resource" classification). We had confirmed previously that you can view documents against such documents. For a PoC, I would strongly recommend resource classification for now. The "document" classification will be supported (same as in Quickr). But remember if you use compound documents to store a single binary document, it is far less optimal than an item type optimized for single binary normal documents. They should work fine. But we will always recommend the most optimal case. But for the tech preview, the target case is the best practices case at the moment.

                Because you can work around this by following recommended best practices, which is normal document types optimized for single binaries, I am thinking we might not need to rush out a fix for this. Do you think you can use the recommended best practices? Do you have a legitamite need to use compound documents with multiple binaries? Keep in mind that CMIS doesn't even support multiple binaries as a spec. So at most you would see the "primary" binary, selected by an algorithm to detect based on binary part type, part #, etc.

                Also, beware that you need to understand how document & part versioning works together if you use versioning because the binary elements can be versionined independently of the metadata. It just means you must understand this more complicated case and configure your item type accordingly and it will show through in CMIS. A common mistake is to configure the document item type for automatic versioning, and the part types associated with it for manual or no versioning, and then you will find the metadata changes but the binary doesn't change.
                • TigerTrix
                  TigerTrix
                  30 Posts
                  ACCEPTED ANSWER

                  Re: Need help retrieving a document using CMIS

                  ‏2010-12-16T18:53:35Z  in response to TigerTrix
                  The tech preview has been updated with this fix. The latest version is still named "003", but when you unzip, you should see a version.txt that identifies version 1.0.003.2 instead of 1.0.003, and build number cm8cmis100.026.
                  • TigerTrix
                    TigerTrix
                    30 Posts
                    ACCEPTED ANSWER

                    Re: Need help retrieving a document using CMIS

                    ‏2010-12-16T18:54:28Z  in response to TigerTrix
                    Although I still recommend "resource" item types for reasons stated previously.
                    • SystemAdmin
                      SystemAdmin
                      32 Posts
                      ACCEPTED ANSWER

                      Re: Need help retrieving a document using CMIS

                      ‏2010-12-16T18:58:15Z  in response to TigerTrix
                      Thank you very much.

                      I will work with this release over the next couple of days.