I am trying to load atom pub CMIS 1.0 binding into EXTJS and the colons in the tags are stopping the XML reader from doing its work. For instance the xml looks like:
<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:app="http://www.w3.org/2007/app">
<atom:author>
<atom:name>system</atom:name>
</atom:author>
<atom:id>http://chemistry.apache.org/MTAz</atom:id>
<atom:published>2013-11-28T00:01:22Z</atom:published>
<atom:title>Folder1</atom:title>
<app:edited>2013-11-28T00:01:22Z</app:edited>
<atom:updated>2013-11-28T00:01:22Z</atom:updated>
<cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
<cmis:properties>
<cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds">
<cmis:value>*</cmis:value>
</cmis:propertyId>
<cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId">
<cmis:value>cmis:folder</cmis:value>
</cmis:propertyId>
<cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path">
<cmis:value>/Root/396271/Folder1</cmis:value>
</cmis:propertyString>
<cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name">
<cmis:value>Folder1</cmis:value>
</cmis:propertyString>
..... etc.
For example if I consider a simple example
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user attr="test ed">
<id:number>1</id:number>
<name>Ed Spencer</name>
<email>ed@sencha.com</email>
</user>
<user attr="test abe">
<id:number>2</id:number>
<name>Abe Elias</name>
<email>abe@sencha.com</email>
</user>
</users>
And I use EXTJS code
Ext.onReady(function () {
Ext.define('User', {
extend: 'Ext.data.Model',
autoload: true,
fields: [{ name: "id", mapping: 'id:number'},
{ name: "name", mapping: 'name'},
{ name: "email", mapping: 'email'},
{ name: "attr", mapping: '@attr'}]
});
var store = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url : 'users.xml',
reader: {
type: 'xml',
record: 'user',
root: 'users'
}
}
});
store.load();
});
What do I put down for the mapping for id, or alternate code?
fields: [{ name: "id", mapping: 'id:number'} ????? escape the ':' some how?
I am trying to avoid writing a lot of custom XML parsing code if possible and rely on the EXTJS reader, and the CMIS 1.1 browser binding is not available for my ECM.