Function.js
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* 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'
}
}
});