OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cmis message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Commented: (CMIS-492) Add distinguishingattributes to REST binding



    [ http://tools.oasis-open.org/issues/browse/CMIS-492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15559#action_15559 ] 

Steve Roth commented on CMIS-492:
---------------------------------

The engineer who originally reported this issue and I have discussed it.  The general discussion parallels that of the web binding approach.   We generally agree with David N. that there is unfortunately nothing simple which can be done to facilitate the XML clientside consumption, with one possible exception (described below).

The one possible exception is a suggestion that in the type structure, it would be helpful if the type id was present on the outer element structure, because it would allow the client to easily select a type by ID when navigating over a set of types.

For example, instead of this:  (which requires a DOM client to iterate over all content types checking the type cmis:id, then go up and then down to find the rest of the type settings)

    <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="cmis:cmisTypeDocumentDefinitionType">
        <cmis:id>dtdocument-invoice</cmis:id>
        <cmis:localName>myrepname-document-invoice</cmis:localName>
        <cmis:displayName>document-invoice</cmis:displayName>
        <cmis:queryName>document-invoice</cmis:queryName>
...
    </cmisra:type>
    <cmisra:type ...>
...
    </cmisra:type>


This would be easier for a client to walk:
    <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="cmis:cmisTypeDocumentDefinitionType"  cmis:id="dtdocument-invoice">
        <cmis:localName>myrepname-document-invoice</cmis:localName>
        <cmis:displayName>document-invoice</cmis:displayName>
        <cmis:queryName>document-invoice</cmis:queryName>
...
    </cmisra:type>

Basically, we just move the cmis:id to an attribute on the cmisra:type element, and this allows a client to easily select on the appropriate type by id.

We had originally setup a working group to discuss this issue; if other parties are interested, I'd be happy to discuss.  But if this is the only suggestion, perhaps it would be easier to simply discuss it in the TC meeting.

> Add distinguishing attributes to REST binding
> ---------------------------------------------
>
>                 Key: CMIS-492
>                 URL: http://tools.oasis-open.org/issues/browse/CMIS-492
>             Project: OASIS Content Management Interoperability Services (CMIS) TC
>          Issue Type: Bug
>          Components: REST/AtomPub Binding
>    Affects Versions: Draft 0.62
>            Reporter: Steve Roth
>            Assignee: Al Brown
>
> A simple change would facilitate consumption of the REST binding for non-ATOM clients.
> For instance to create a query I currently need to do:
> 1. repoDoc = parse(http://...)
>     1. collections = repoDoc.getElementsByTagNameNS("http://www.w3.org/2007/app";, "collection")
>     2. for (collection : collections)
>         1. if ("types".equals(collection.getAttributeNS("http://docs.oasis-open.org/ns/cmis/restatom/200901";, "collectionType"))
>             1. typesUrl = collection.getAttribute("href");
>     3. templates = repoDoc.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/restatom/200901";, "uritemplate")
>     4. for (template : templates)
>         1. if ("query".equals(template.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/restatom/200901";, "type")[0].getText()))
>             1. queryTemplate = template.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/restatom/200901";, "template")[0].getText()
> 2. typesDoc = parse(typesUrl)
>     1. types = typeDoc.getElementsByTagNameNS("http://www.w3.org/2005/Atom";, "entry")
>     2. for (type : types)
>         1. links = type.getElementsByTagNameNS("http://www.w3.org/2005/Atom";, "link")
>         2. for (link : links)
>             1. if ("application/cmistree+xml;type=feed".equals(link.getAttribute("type"))
>                 1. descendantsUrl = link.getAttribute("href")
> 3. descendantsDoc = parse(descendantsUrl)
>     1. types = typeDoc.getElementsByTagNameNS("http://www.w3.org/2005/Atom";, "entry")
>     2. for (type : types)
>         1. localName = type.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/core/200901";, "localName")
>         2. if ("MyTypeName".equals(localName.getText())
>             1. links = type.getElementsByTagNameNS("http://www.w3.org/2005/Atom";, "link")
>             2. for (link : links)
>                 1. if ("self".equals(link.getAttribute("rel"))
>                     1. myTypeUrl = link.getAttribute("href")
> 4. myTypeDoc = parse(myTypeUrl)
>     1. tableName = myTypeDoc.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/core/200901";, "queryName")[0].getText()
>     2. propNames = type.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/core/200901";, "localName")
>     3. for (propName : propNames) {
>         1. if ("myPropName".equals(propName.getText())
>             1. propQueryName = propName.getParenter.getElementsByTagNameNS("http://docs.oasis-open.org/ns/cmis/core/200901";, "queryName")[0].getText()
> 5. query = "SELECT * FROM " + tableName + "WHERE " propQueryName + " = \"myValue\""
> 6. queryUrl.replace("{query}", query)
> 7. reultsDoc = parse(queryUrl)
>     1. Similarly parse the query response

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]