Topic
7 replies Latest Post - ‏2013-01-14T03:36:51Z by SystemAdmin
SystemAdmin
SystemAdmin
76 Posts
ACCEPTED ANSWER

Pinned topic Atom Entry for Creating Document in Filenet P8 - Document Class

‏2013-01-12T12:47:38Z |
Hi,

I am trying to create a document using CMIS in Filenet P8 (IBM Case Manager installation). I can do it but I cannot assign a class in document (Eg. Email).

This is the xml code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<atom:entry xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasisopen.org/ns/cmis/restatom/200908/">
<atom:content type="application/msword">
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAOwADAP7/CQAGAAAAAAAAAAAAAAACAAAA
gwAAAAAAAAAAEAAAAgAAAAEAAAD+////AAAAAAAAAACAAAAA////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
…SNIP…
</atom:content>
<atom:id>urn:uuid:d6ea99e2-ef5e-4bbb-97fafeeae20d0f94</atom:id>
<atom:link rel="self" href="http://www-03.ibm.com/press/de/de/pressrelease/32044.wss"/>
<atom:title type="text">ATestDocument9</atom:title>
<atom:updated>2010-11-17T18:47:32.906+01:00</atom:updated>
<cmisra:object>
<cmis:properties>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId"> <cmis:value>cmis:document</cmis:value> </cmis:propertyId>
</cmis:properties>
</cmisra:object>
</atom:entry>

Using this, the class will be 'Document', but I would like to choose other one.

What do I need to do?

Thanks
Carlo
Updated on 2013-01-14T03:36:51Z at 2013-01-14T03:36:51Z by SystemAdmin
  • Dave Sanders
    Dave Sanders
    19 Posts
    ACCEPTED ANSWER

    Re: Atom Entry for Creating Document in Filenet P8 - Document Class

    ‏2013-01-12T18:10:55Z  in response to SystemAdmin
    The CMIS spec says for createDocument [1]:
    Description: Creates a document object of the specified type (given by the cmis:objectTypeId property) in the (optionally) specified location.

    Example: Create a doc of type Email:
    <cmis:propertyId propertyDefinitionId="cmis:objectTypeId"> <cmis:value>Email</cmis:value> </cmis:propertyId>

    To find the Ids of the subtypes of the base Document class, call getTypeChildren("cmis:document").
    Or, browse the type hierarchy with CMIS Workbench [2].
    [1] http://docs.oasis-open.org/cmis/CMIS/v1.0/errata-01/os/cmis-spec-v1.0-errata-01-os-complete.html#_Toc243905449
    [2] http://chemistry.apache.org/java/developing/tools/dev-tools-workbench.html
    • SystemAdmin
      SystemAdmin
      76 Posts
      ACCEPTED ANSWER

      Re: Atom Entry for Creating Document in Filenet P8 - Document Class

      ‏2013-01-14T00:35:17Z  in response to Dave Sanders
      Hi,

      Thank you for your answer but I still have a problem.
      I did what you suggest but it was not working for assign the class.

      I also do other tests and I guess the system is ignoring all configuration inside <cmisra:object>.
      For example, when I put cmis:folder, a document was created. If I remove all <cmisra:object>, the document was created normally.

      Some information about my installation and test:

      1) I had install an IBM Case Manager 5.1, using automatic installation (CMPIT).
      2) I did not install any CMIS software after ICM installation.
      3) I am using Poster add on in Firefox to perform the tests.
      4) I am using the url: http://server:9080/CaseManager/resources/TARGET/ContentFlat/idf_3CAF4191-BBF0-4415-9FBB-B5B1926E0A93
      5) The Content Type are: application/atom+xml
      6) Using this Content to Send it create a document in Filenet:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <atom:entry xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasisopen.org/ns/cmis/restatom/200908/">
      <atom:link rel="self" href="http://www-03.ibm.com/press/de/de/pressrelease/32044.wss"/>
      <atom:title type="text">ATestDocument</atom:title>
      </atom:entry>
      How can I investigate how the <cmisra:object> are working in my system ? Or other way to test and solve the problem.

      Thanks in advance,
      Carlo
      • Dave Sanders
        Dave Sanders
        19 Posts
        ACCEPTED ANSWER

        Re: Atom Entry for Creating Document in Filenet P8 - Document Class

        ‏2013-01-14T01:02:33Z  in response to SystemAdmin
        A good way to find the correct HTTP request is to use CMIS Workbench with an HTTP proxy server.

        Example:
        1) Start Fiddler [1].
        2) Start CMIS Workbench. 0.8.0 [2] and later automatically proxies requests, at least on Windows 7.
        3) Logon to a repository
        4) Optionally navigate to a folder.
        5) Create Document. Leave the Generate content field at 0 bytes if creating a doc without a content stream. Select Email or other type.
        6) Go to Fiddler and find the POST (status code will be 201).
        The request should have Content-Type: application/atom+xml;type=entry, and the properties, cmis:name and cmis:objectTypeid, in the cmisra:object element.
        [1] http://www.fiddler2.com/fiddler2/
        [2] http://chemistry.apache.org/java/download.html
        • SystemAdmin
          SystemAdmin
          76 Posts
          ACCEPTED ANSWER

          Re: Atom Entry for Creating Document in Filenet P8 - Document Class

          ‏2013-01-14T01:26:49Z  in response to Dave Sanders
          I tried to use the CMIS Workbench but I cannot load repository in the first screen. The login is OK.

          I guess the url is not good or the system is not 100% prepare. I was using some combination of the url: http://server:9080/CaseManager/resources/TARGET/
          • Dave Sanders
            Dave Sanders
            19 Posts
            ACCEPTED ANSWER

            Re: Atom Entry for Creating Document in Filenet P8 - Document Class

            ‏2013-01-14T02:32:28Z  in response to SystemAdmin
            Try http://+server+:9080/CaseManager/resources/Service for AtomPub service doc URL.
            • SystemAdmin
              SystemAdmin
              76 Posts
              ACCEPTED ANSWER

              Re: Atom Entry for Creating Document in Filenet P8 - Document Class

              ‏2013-01-14T03:34:55Z  in response to Dave Sanders
              Fantastic, it is working !

              Thank you for your hints. I use Fiddler and I get the XML which I would like to share:

              <?xml version='1.0' encoding='UTF-8'?>
              <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:chemistry="http://chemistry.apache.org/">
              <atom:id>urn:uuid:00000000-0000-0000-0000-00000000000</atom:id>
              <atom:title>TEste3</atom:title>
              <atom:updated>2013-01-14T03:25:23Z</atom:updated>
              <cmisra:content>
              <cmisra:mediatype>application/octet-stream</cmisra:mediatype><chemistry:filename>TEste3</chemistry:filename><cmisra:base64 />
              </cmisra:content>

              <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
              <cmis:properties>
              <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
              <cmis:value>GLM_ListadeMaterial</cmis:value>
              </cmis:propertyId>
              <cmis:propertyString propertyDefinitionId="cmis:name">
              <cmis:value>TEste3</cmis:value>
              </cmis:propertyString>
              </cmis:properties>
              </cmisra:object>
              </atom:entry>
            • SystemAdmin
              SystemAdmin
              76 Posts
              ACCEPTED ANSWER

              Re: Atom Entry for Creating Document in Filenet P8 - Document Class

              ‏2013-01-14T03:36:51Z  in response to Dave Sanders
              Fantastic, it is working !

              Thank you for your hints. I use Fiddler and I get the XML which I would like to share:

              <?xml version='1.0' encoding='UTF-8'?>
              <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:chemistry="http://chemistry.apache.org/">
              <atom:id>urn:uuid:00000000-0000-0000-0000-00000000000</atom:id>
              <atom:title>TEste3</atom:title>
              <atom:updated>2013-01-14T03:25:23Z</atom:updated>
              <cmisra:content>
              <cmisra:mediatype>application/octet-stream</cmisra:mediatype><chemistry:filename>TEste3</chemistry:filename><cmisra:base64 />
              </cmisra:content>

              <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
              <cmis:properties>
              <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
              <cmis:value>Email</cmis:value>
              </cmis:propertyId>
              <cmis:propertyString propertyDefinitionId="cmis:name">
              <cmis:value>TEste3</cmis:value>
              </cmis:propertyString>
              </cmis:properties>
              </cmisra:object>
              </atom:entry>