[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] Created: (CMIS-492) Add distinguishingattributes to REST binding
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]