Function.js 1.41 KB
/**
  * Project      :  AMDA-NG
  * Name         : Function.js
  * @plugin 	  amdaModel.Function
  * @extends 	  Ext.data.Model
  * @brief		 Data model for functions definition
  * @author Benjamin
  * @version $Id: Function.js 1399 2013-03-27 12:44:50Z elena $
  ********************************************************************************
  *    FT Id     :   Date   : Name - Description
  *******************************************************************************
  *  :          
  */

Ext.define('amdaModel.Function', {
	
  extend: 'Ext.data.Model',
  idProperty: 'text',
  
  fields : [
	{name: 'name', mapping: '@name', type:'string'},
	{name: 'kind', mapping: '@kind', type: 'string', defaultValue: 'amda'},
	{name: 'args', mapping: '@args', type: 'int', defaultValue: 0},
	{name: 'argv', mapping: '@argv', type: 'string'},
	{name: 'params', mapping: '@params', type:'int', defaultValue: 1},
	{name: 'prompt', type: 'string', defaultValue: ''},
	{name: 'info_brief', type: 'string', defaultValue: ''}
  ],
  
  validations: [
    {type: 'presence', field: 'name'},
    {type: 'presence', field: 'kind'},
    {type: 'inclusion', field: 'kind', list: ['idl','amda','time','sliding']}
  ],
  
  proxy: {
      type: 'ajax',
//TODO url into generique settings      
      url : 'generic_data/Functions/functions.xml',
      reader: {
          type: 'xml',
          root: 'functions',
          record: 'function'
      }
  }
});