Topic
  • 16 replies
  • Latest Post - ‏2016-08-25T06:45:30Z by Srinivas_Gannavarapu
drdamour
drdamour
15 Posts

Pinned topic Support Documents for multiple content elements in P8 Content Engine

‏2012-02-03T23:39:48Z |
What kind of support does CMIS for FileNet P8 have for multi content element documents?

When i make a request to the Content resource for a document with multiple content elements, is there a good strategy to identify that it is a multi content element document or how to determine all the content stream URI's for each piece of content. All i'm seeing is that there is additional atom:link elements with an incremented relationship attribute. IE for a 5 element document:
<atom:link length="1" title="New Text Document 1.txt" type="text/plain" rel="edit-media"...
<atom:link length="1" title="New Text Document 2.txt" type="text/plain" rel="p8-stream1"...
<atom:link length="1" title="New Text Document 3.txt" type="text/plain" rel="p8-stream2"...
<atom:link length="1" title="New Text Document 4.txt" type="text/plain" rel="p8-stream3"...
<atom:link length="1" title="New Text Document 5.txt" type="text/plain" rel="p8-stream4"...
Is that what i'm limited to?

I am Just a new Boy,
A Stranger in this Town,
Where are All the Good Times,
Who's Gonna Show this Stranger Around?
Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
Updated on 2012-02-09T15:14:31Z at 2012-02-09T15:14:31Z by drdamour
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-04T01:07:47Z  
    Yes. The existence of additional re=="p8-stream<x>" links indicates that there are additional content elements present (on top of the single one that CMIS clients will acknowledge) These extra links are to be considered extensions and are there for internal use between other IBM products that require visibility into the additional content streams. I don't expect this notation to change but its not impossible so use caution when baking this into your client code. Support for these is readonly in p8 CMIS.
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-04T05:37:46Z  
    • jay.brown
    • ‏2012-02-04T01:07:47Z
    Yes. The existence of additional re=="p8-stream<x>" links indicates that there are additional content elements present (on top of the single one that CMIS clients will acknowledge) These extra links are to be considered extensions and are there for internal use between other IBM products that require visibility into the additional content streams. I don't expect this notation to change but its not impossible so use caution when baking this into your client code. Support for these is readonly in p8 CMIS.
    thanks for the quick response.

    so is there any way to determine that a document is multi-content elemented other than looking for these relationships? perhaps a property i can add to the meta data filter? it's kind of an ugly (and expensive) operation to go find all nodes that have an attribute that starts with a a string...


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-04T05:54:02Z  
    • jay.brown
    • ‏2012-02-04T01:07:47Z
    Yes. The existence of additional re=="p8-stream<x>" links indicates that there are additional content elements present (on top of the single one that CMIS clients will acknowledge) These extra links are to be considered extensions and are there for internal use between other IBM products that require visibility into the additional content streams. I don't expect this notation to change but its not impossible so use caution when baking this into your client code. Support for these is readonly in p8 CMIS.
    and i'm not sure if this is a bug or not, but these extra content element's URI's all point to the first content element

    rel="p8-stream2" href="http://192.168.122.157:9080/CaseManager/resources/CMTOS/ContentStream/idd_EA7A28D2-4F80-409E-8989-8F66091DE691/-1/New+Text+Document+3.txt"
    rel="p8-stream3" href="http://192.168.122.157:9080/CaseManager/resources/CMTOS/ContentStream/idd_EA7A28D2-4F80-409E-8989-8F66091DE691/-1/New+Text+Document+4.txt"

    notice they are both -1, shouldn't that number be the content element index (per the other post @ https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14785945 )? when i access them the content is always the first content element.


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-06T22:07:41Z  
    Thank you for the heads up. We will go an see if we can reproduce this in our latest build. If so we will get this fixed.
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-06T22:10:17Z  
    • drdamour
    • ‏2012-02-04T05:37:46Z
    thanks for the quick response.

    so is there any way to determine that a document is multi-content elemented other than looking for these relationships? perhaps a property i can add to the meta data filter? it's kind of an ugly (and expensive) operation to go find all nodes that have an attribute that starts with a a string...


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
    Unfortunately not. We would need to add that as an extension or add something to the specification for CMIS 1.1.
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-07T02:07:05Z  
    • jay.brown
    • ‏2012-02-06T22:10:17Z
    Unfortunately not. We would need to add that as an extension or add something to the specification for CMIS 1.1.
    i think it would be a pretty useful extension/addition, it would make the document atom entry more query-able, descriptive, & declarative. I know atom:content can have child nodes if it's type is xml, that would be a natural extension point in Atom (not sure about CMIS).

    Alternatively, it would be just as useful (and more in high performance retrieval on the client side) to offer a content url that would be all content elements zip'd up. This could be accomplished as a CMIS rendition within the confines of the existing CMIS 1.0 specification. It would likely decrease the number of http handshakes. If you skip compression (docs are usually compressed anyways) then you can stream the content as a flat zip structure and the server has very little overhead.



    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-07T19:11:15Z  
    • drdamour
    • ‏2012-02-04T05:54:02Z
    and i'm not sure if this is a bug or not, but these extra content element's URI's all point to the first content element

    rel="p8-stream2" href="http://192.168.122.157:9080/CaseManager/resources/CMTOS/ContentStream/idd_EA7A28D2-4F80-409E-8989-8F66091DE691/-1/New+Text+Document+3.txt"
    rel="p8-stream3" href="http://192.168.122.157:9080/CaseManager/resources/CMTOS/ContentStream/idd_EA7A28D2-4F80-409E-8989-8F66091DE691/-1/New+Text+Document+4.txt"

    notice they are both -1, shouldn't that number be the content element index (per the other post @ https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14785945 )? when i access them the content is always the first content element.


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
    I have verified this is a bug in our link extensions. Probably never noticed before since pure CMIS clients would be ignoring this link. We will add this to the list of items to address for the next CMIS fixpack.

    Thank you for finding this!
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-07T19:39:40Z  
    • jay.brown
    • ‏2012-02-07T19:11:15Z
    I have verified this is a bug in our link extensions. Probably never noticed before since pure CMIS clients would be ignoring this link. We will add this to the list of items to address for the next CMIS fixpack.

    Thank you for finding this!
    cool, look forward to the fix, for now we'll have to replicate the bug in our P8 CMIS mock for unit test.

    Any thoughts on rendering a multi content element doc as a CMIS Rendition zip file?


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-07T20:44:11Z  
    • drdamour
    • ‏2012-02-07T19:39:40Z
    cool, look forward to the fix, for now we'll have to replicate the bug in our P8 CMIS mock for unit test.

    Any thoughts on rendering a multi content element doc as a CMIS Rendition zip file?


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
    It is an interesting idea (I like it) but I think using a rendition object for this would be confusing to pure CMIS clients. Since CMIS clients only know about that first element it would be weird for them to see a rendition that is a collection of elements that they cannot see otherwise. (Wouldn't it?) Perhaps it would be better to support that as an additional p8 extension link like we do with our extra streams today. E.g rel="p8-zipstream" or something to that effect.
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-07T23:51:11Z  
    • jay.brown
    • ‏2012-02-07T20:44:11Z
    It is an interesting idea (I like it) but I think using a rendition object for this would be confusing to pure CMIS clients. Since CMIS clients only know about that first element it would be weird for them to see a rendition that is a collection of elements that they cannot see otherwise. (Wouldn't it?) Perhaps it would be better to support that as an additional p8 extension link like we do with our extra streams today. E.g rel="p8-zipstream" or something to that effect.
    i think most clients understand and expose renditions, i know the Chemistry library certainly does: http://chemistry.apache.org/java/0.4.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/class-use/Rendition.html
    you can enumerate them, and easily retrieve them, and there can be 0 or more of them. They don't replace the existence of streams (or the all important atom:content element.

    the spec things of pdf's or thumbnails http://docs.oasis-open.org/cmis/CMIS/v1.0/cd04/cmis-spec-v1.0.html#_Toc243712501 but i would argue a zip file of all content is equivalent to a pdf, is just as an accepted standard, and has some serious performance benefits for certain scenarios.

    also since renditions are read only, P8 CMIS wouldn't have to deal with accepting zip files (though you'd still have to kinda come up with a spec for the zip structure as content elements can have the same name, maybe name them after their position just like streams and include a simple manifest with names).

    I'm not advocating it as a replacement to streams, stick to streams for updating & low level operations for sure, but offering all content in an easy way would be useful in it's own right as HTTP is expensive.

    examples:
    CMIS viewers could retrieve the first element to display and retrieve the entire zip in a second request in the background anticipating the user paging.
    Document Extractors could retrieve a multi content element doc in a single request and deflate locally.
    It might even prove faster in some scenarios to create a compound document in CE and then request it's contents rendered as a zip.

    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-08T00:16:44Z  
    I agree with your assessment of Renditions. I think you missed my point. I was trying to explain that a CMIS client can see the first (and only the first) content stream. A CMIS client can also see the renditions collection. A CMIS client expects the renditions collection to contain renditions of the content stream that it can see (the first one). In the case where there are multiple content streams, the client will get a rendition that will not correspond to the only stream they can see. Thus the inconsistency. This is why I was suggesting that since multiple content streams are not part of the 1.0 spec (and are extensions for p8) so should a zip of multiple content streams.
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-08T19:50:09Z  
    • jay.brown
    • ‏2012-02-08T00:16:44Z
    I agree with your assessment of Renditions. I think you missed my point. I was trying to explain that a CMIS client can see the first (and only the first) content stream. A CMIS client can also see the renditions collection. A CMIS client expects the renditions collection to contain renditions of the content stream that it can see (the first one). In the case where there are multiple content streams, the client will get a rendition that will not correspond to the only stream they can see. Thus the inconsistency. This is why I was suggesting that since multiple content streams are not part of the 1.0 spec (and are extensions for p8) so should a zip of multiple content streams.
    yup, i missed your point but now i get it.

    however i don't think it matters that the rendition will include extra content. The rendition is not guaranteed to be limited to what the atom:content stream has, the existing examples (thumbnail/pdf) certainly are limited to this, but it doesn't have to be. As long as you define that rendition with your own type, the contract of what that rendition contains is well defined.

    By having it as a rendition (vs extension) it would be made available in any OOTB ui or API that exposes renditions. Isn't it be best to avoid extensions whenever possible?

    I do see where you're coming from, because if you did do it as a rendition, someone somewhere will make the assumption that the the url at atom:content will have all the documents included in the zip. but think the benefit of implementing within the spec greatly outweighs this misinformed expectation.


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • jay.brown
    jay.brown
    41 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-09T00:21:43Z  
    • drdamour
    • ‏2012-02-08T19:50:09Z
    yup, i missed your point but now i get it.

    however i don't think it matters that the rendition will include extra content. The rendition is not guaranteed to be limited to what the atom:content stream has, the existing examples (thumbnail/pdf) certainly are limited to this, but it doesn't have to be. As long as you define that rendition with your own type, the contract of what that rendition contains is well defined.

    By having it as a rendition (vs extension) it would be made available in any OOTB ui or API that exposes renditions. Isn't it be best to avoid extensions whenever possible?

    I do see where you're coming from, because if you did do it as a rendition, someone somewhere will make the assumption that the the url at atom:content will have all the documents included in the zip. but think the benefit of implementing within the spec greatly outweighs this misinformed expectation.


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
    I agree that it could be useful in some cases and I certainly like using a pure CMIS 1.0 compliant method to do get it done. So my next question is do we have a customer that has a requirement to be able to do this. Keep in mind my perspective: Every feature that we add; IBM will be committed to supporting for 8 or more years. :)
  • drdamour
    drdamour
    15 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2012-02-09T15:14:31Z  
    • jay.brown
    • ‏2012-02-09T00:21:43Z
    I agree that it could be useful in some cases and I certainly like using a pure CMIS 1.0 compliant method to do get it done. So my next question is do we have a customer that has a requirement to be able to do this. Keep in mind my perspective: Every feature that we add; IBM will be committed to supporting for 8 or more years. :)
    oh yeah, i'm not coming up with this in a vaccuum.

    this all comes from an enhancement to our Agile Document Export tool ( http://ecm.pyramidsolutions.com/products/document-export-repackaging/ ), we're adding P8 CE support and are looking to leverage CMIS to perform the extraction.


    I am Just a new Boy,
    A Stranger in this Town,
    Where are All the Good Times,
    Who's Gonna Show this Stranger Around?
    Check out our Agile ACM Catalogue: Widgets, APIs, & Components for Building Solutions
  • RahulRP14
    RahulRP14
    5 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2016-08-02T09:32:34Z  
    • jay.brown
    • ‏2012-02-07T20:44:11Z
    It is an interesting idea (I like it) but I think using a rendition object for this would be confusing to pure CMIS clients. Since CMIS clients only know about that first element it would be weird for them to see a rendition that is a collection of elements that they cannot see otherwise. (Wouldn't it?) Perhaps it would be better to support that as an additional p8 extension link like we do with our extra streams today. E.g rel="p8-zipstream" or something to that effect.

    Hi,

    Is  the bug fixed now,

    Can you give an idea how can we get the whole Content Stream    Content using CMIS of a multiple content document, Currently when we get the content stream it shows only  the first content element .

     

    Please help,

    Thanks,

    Rahul

  • Srinivas_Gannavarapu
    13 Posts

    Re: Support Documents for multiple content elements in P8 Content Engine

    ‏2016-08-25T06:45:30Z  
    • RahulRP14
    • ‏2016-08-02T09:32:34Z

    Hi,

    Is  the bug fixed now,

    Can you give an idea how can we get the whole Content Stream    Content using CMIS of a multiple content document, Currently when we get the content stream it shows only  the first content element .

     

    Please help,

    Thanks,

    Rahul

    This bug is fixed as per CMIS specification i.e we only get one element (top) when a document is having multiple content streams.