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=15219#action_15219 ] 

David Nuescheler commented on CMIS-492:
---------------------------------------

i would definitely recommend *not* to rely on js frameworks such as "dojo" or for this particular matter probably more adequately "jquery".
js frameworks are very much in flux and a dependency would be very undesirable. 

i think we should not gloss over the complexity introduced in the xml by just using machinery on the consumer side that fights the symptom. the very problem of processing complex xml is not unique to js but will be found in every lightweight scripting consumer be it in a server-to-server environment or in a browser environment.

i think to change this for good we would have to take some time to invest into a more simplified, easy to consume version of cmis which is what i think the web/browser-bindings attempt to do.

for v1.0 i would almost be tempted to say that i don't see a simple fix.

> 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]