Topic
  • 12 replies
  • Latest Post - ‏2012-08-23T16:22:32Z by SystemAdmin
SystemAdmin
SystemAdmin
76 Posts

Pinned topic CMIS: how to include Document SubClass in cmis query

‏2012-08-22T20:15:38Z |
I was wondering how I can limit the scope of the query from an entire Document class to Document SubClass.

(1) Initial query in cmis web service

SELECT DocumentTitle
from Document INNER JOIN classdefinition c
on Document.object_class_id = c.Id
WHERE (Document.Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4')
AND (c.symbolic_name = 'DocumentSubClassTest')


(2) The query sent to P8 cmis web service captured by TCP monitor

SELECT TOP 26 * FROM Document
INNER JOIN classdefinition AS c
ON Document.object_class_id = c.Id
WHERE ( ( Document.Id = {4E684F06-AE8E-4891-8388-8BB85D5B8EB4}
AND c.symbolic_name = 'DocumentSubClassTest' )
AND (DOCUMENT.IsCurrentVersion=TRUE
AND DOCUMENT.IsReserved=FALSE) )
OPTIONS(TIMELIMIT 180 )

(3) Error received on client
Content server exception: The property object_class_id is not defined.

Also I noticed that in retrieveProperties operation, DocumentSubClass is present in <cmis:ObjectTypeId> tag, however the localName is empty.
I'd like to know how to use the existing Document Subclass in cmis query.
Thanks
Updated on 2012-08-23T16:22:32Z at 2012-08-23T16:22:32Z by SystemAdmin
  • jay.brown
    jay.brown
    41 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-22T20:29:34Z  
    If I am understanding your question then you find the QueryName for the document subclass you want to limit to. Eg. DocSub1

    then just change your FROM clause to incdicate the subclass query name.

    SELECT ... FROM DocSub1 WHERE...
  • SystemAdmin
    SystemAdmin
    76 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-22T20:50:13Z  
    I already tried it, and got the error.
    (I'm using P8CEV5.1)

    SELECT DocumentTitle from DocumentSubClassTest WHERE Document.Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4'

    CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Explanation: Either the specified object type ID does not exist or is not a valid argument for the query.
    Action: Verify that the object type is spelled correctly and is a supported OASIS CMIS object type, such as cmis:document or cmis:folder.
    If the problem persists, see the "Query Language Definition" section of the OASIS CMIS specification for more information. </faultstring><detail><ns2:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/"><ns2:type>objectNotFound</ns2:type><ns2:code>404</ns2:code><ns2:message>CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Explanation: Either the specified object type ID does not exist or is not a valid argument for the query.
  • doongjk
    doongjk
    4 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-22T21:22:03Z  
    I already tried it, and got the error.
    (I'm using P8CEV5.1)

    SELECT DocumentTitle from DocumentSubClassTest WHERE Document.Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4'

    CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Explanation: Either the specified object type ID does not exist or is not a valid argument for the query.
    Action: Verify that the object type is spelled correctly and is a supported OASIS CMIS object type, such as cmis:document or cmis:folder.
    If the problem persists, see the "Query Language Definition" section of the OASIS CMIS specification for more information. </faultstring><detail><ns2:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/"><ns2:type>objectNotFound</ns2:type><ns2:code>404</ns2:code><ns2:message>CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Explanation: Either the specified object type ID does not exist or is not a valid argument for the query.
    Hi, I think the error was complaining about the Document, which is no longer in your FROM. Have you tried this syntax below?

    SELECT DocumentTitle from DocumentSubClassTest WHERE Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4'
  • jay.brown
    jay.brown
    41 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-22T21:23:40Z  
    I already tried it, and got the error.
    (I'm using P8CEV5.1)

    SELECT DocumentTitle from DocumentSubClassTest WHERE Document.Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4'

    CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Explanation: Either the specified object type ID does not exist or is not a valid argument for the query.
    Action: Verify that the object type is spelled correctly and is a supported OASIS CMIS object type, such as cmis:document or cmis:folder.
    If the problem persists, see the "Query Language Definition" section of the OASIS CMIS specification for more information. </faultstring><detail><ns2:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/"><ns2:type>objectNotFound</ns2:type><ns2:code>404</ns2:code><ns2:message>CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Explanation: Either the specified object type ID does not exist or is not a valid argument for the query.
    You should use the Queryname (cmis:objectId) not the localname (id)
  • SystemAdmin
    SystemAdmin
    76 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T13:37:06Z  
    yes I tried:

    SELECT DocumentTitle from DocumentSubClassTest
    WHERE Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4

    and got the same error.
    CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
  • cwoliveira
    cwoliveira
    4 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T14:45:04Z  
    yes I tried:

    SELECT DocumentTitle from DocumentSubClassTest
    WHERE Id='idd_4E684F06-AE8E-4891-8388-8BB85D5B8EB4

    and got the same error.
    CIL1217: The query contains an invalid object type ID.
    Object type ID: DocumentSubClassTest
    Hi,

    Did you run some testing using the Apache CMIS Workbench ?

    http://chemistry.apache.org/java/developing/tools/dev-tools-workbench.html

    I like this tool to navigate within CMIS repository and look for (in addition to other things) differences from Local Names to Query Names and test the queries.

    Regards,

    Carlos Wagner
  • SystemAdmin
    SystemAdmin
    76 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T14:48:20Z  
    no, my client is a pure cmis wsdl client.
  • SystemAdmin
    SystemAdmin
    76 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T15:21:17Z  
    Has anyone tried Document Subclass as the table name in cmis query using the Apache CMIS Workbench and does it work? The backend is P8CEV51-CMIS. If it does, it is strange to me becasue from my test P8 CMIS does not recognize the Document Subclass as the virtual table name. I wonder how the Apache CMIS Workbench is able to make it work.
  • cwoliveira
    cwoliveira
    4 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T15:35:25Z  
    no, my client is a pure cmis wsdl client.
    OK, how could you ensure that exactly name "DocumentSubClassTest" is assigned for CMIS to your Class as a Object ID / Query Name ?

    Take a look on the attachment. If I query by local name, your error is throwed. Querying by query name, it works fine.

    Regards,

    Carlos
  • jay.brown
    jay.brown
    41 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T15:50:36Z  
    Has anyone tried Document Subclass as the table name in cmis query using the Apache CMIS Workbench and does it work? The backend is P8CEV51-CMIS. If it does, it is strange to me becasue from my test P8 CMIS does not recognize the Document Subclass as the virtual table name. I wonder how the Apache CMIS Workbench is able to make it work.
    Absolutely this works. I do this almost every day in workbench.
    Note you must use the query name not the localname!
  • jay.brown
    jay.brown
    41 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T15:53:46Z  
    OK, how could you ensure that exactly name "DocumentSubClassTest" is assigned for CMIS to your Class as a Object ID / Query Name ?

    Take a look on the attachment. If I query by local name, your error is throwed. Querying by query name, it works fine.

    Regards,

    Carlos
    The localname is not for use in query. You must only use the querynames for both types and properties in your queries. This is very clear in the spec.
  • SystemAdmin
    SystemAdmin
    76 Posts

    Re: CMIS: how to include Document SubClass in cmis query

    ‏2012-08-23T16:22:32Z  
    Thanks all! now it works.