if(!dojo._hasResource["fieldmapper.IDL"]) {
- dojo.require('dojox.data.dom');
dojo.provide("fieldmapper.IDL");
dojo.declare('fieldmapper.IDL', null, {
},
_parse : function(xmlNode, callback) {
+ var classes = xmlNode.getElementsByTagName('class');
var idl = fieldmapper.IDL.fmclasses = {};
-
- dojo.forEach( dojo.query('class', xmlNode), function (node) {
+
+ for(var i = 0; i < classes.length; i++) {
+ var node = classes[i];
var id = node.getAttribute('id');
- var fields = dojo.query('fields', node)[0];
+ var fields = node.getElementsByTagName('fields')[0];
window.fmclasses[id] = [];
- var fieldData = this._parseFields( node, id );
+ var fieldData = this._parseFields(node, id);
var obj = {
fields : fieldData.list,
obj.core = (obj.core == 'true');
obj.label = (obj.label) ? obj.label : obj.name;
idl[id] = obj;
- });
+ }
- if(callback) callback();
+ if(callback)
+ callback();
},
/* parses the links and fields portion of the IDL */
var data = [];
var map = {};
- var links = dojo.query('links', node);
+ var fields = node.getElementsByTagName('fields')[0];
+ fields = fields.getElementsByTagName('field');
+
+ var links = node.getElementsByTagName('links')[0];
+ if( links ) links = links.getElementsByTagName('link');
+ else links = [];
+
var position = 0;
- dojo.forEach(dojo.query('fields field', node), function (field) {
+ for(var i = 0; i < fields.length; i++) {
+ var field = fields[i];
var name = field.getAttribute('name');
if(name == 'isnew' || name == 'ischanged' || name == 'isdeleted')
- return;
-
+ continue;
var obj = {
field : field,
selector : field.getAttributeNS(this.NS_REPORTS,'selector'),
array_position : position++,
type : 'field',
- virtual : (field.getAttributeNS(this.NS_PERSIST, 'virtual') == 'true')
+ virtual : (fields[i].getAttributeNS(this.NS_PERSIST, 'virtual') == 'true')
};
obj.label = obj.label || obj.name;
window.fmclasses[classname].push(obj.name);
- var link = dojo.query('links link[field=' + name + ']', node)[0];
+ var link = null;
+ for(var l = 0; l < links.length; l++) {
+ if(links[l].getAttribute('field') == name) {
+ link = links[l];
+ break;
+ }
+ }
+
if(link) {
obj.type = 'link';
obj.key = link.getAttribute('key');
data.push(obj);
map[obj.name] = obj;
- });
+ }
dojo.forEach(['isnew', 'ischanged', 'isdeleted'],
function(name) {