1 /*! 2 * This file is part of Aloha Editor Project http://aloha-editor.org 3 * Copyright � 2010-2011 Gentics Software GmbH, aloha@gentics.com 4 * Contributors http://aloha-editor.org/contribution.php 5 * Licensed unter the terms of http://www.aloha-editor.org/license.html 6 *//* 7 * Aloha Editor is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU Affero General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version.* 11 * 12 * Aloha Editor is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU Affero General Public License for more details. 16 * 17 * You should have received a copy of the GNU Affero General Public License 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 define( 22 ['aloha/ext'], 23 function(Ext) { 24 "use strict"; 25 26 Ext.data.AlohaObjectReader = function(meta, recordType) { 27 meta = {}; 28 Ext.applyIf(meta, { 29 idProperty: 'id', 30 root: 'items', 31 totalProperty: 'results', 32 // TODO implement all defined optional attributes 33 fields: [ 34 'id', 35 'url', 36 'name', 37 'type', 38 'weight', 39 'path', 40 'repositoryId' 41 ] 42 }); 43 Ext.data.JsonReader.superclass.constructor.call(this, meta, meta.fields); 44 }; 45 46 Ext.extend(Ext.data.AlohaObjectReader, Ext.data.JsonReader, { 47 // extend of necessary 48 }); 49 50 }); 51