Blame view

js/app/models/Function.js 1.23 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
/**
  * Project      :  AMDA-NG
  * Name         : Function.js
  * @plugin 	  amdaModel.Function
  * @extends 	  Ext.data.Model
  * @brief		 Data model for functions definition
ab55087c   Elena.Budnik   idl => math
7
  * @author Benjamin      
16035364   Benjamin Renard   First commit
8
9
10
  */

Ext.define('amdaModel.Function', {
ab55087c   Elena.Budnik   idl => math
11
12
13
14
15
16
17

	extend: 'Ext.data.Model',
	idProperty: 'text',

	fields : [
		{name: 'name', mapping: '@name', type:'string'},
		{name: 'kind', mapping: '@kind', type: 'string', defaultValue: 'amda'},
9521cade   Elena.Budnik   rm 8441
18
        {name: 'group', mapping: '@group', type: 'string', defaultValue: 'space'},
3cedc95c   Benjamin Renard   Fix functions def...
19
		{name: 'args', mapping: '@args', type: 'int', defaultValue: 1},
ab55087c   Elena.Budnik   idl => math
20
		{name: 'argv', mapping: '@argv', type: 'string'},
ab55087c   Elena.Budnik   idl => math
21
		{name: 'prompt', type: 'string', defaultValue: ''},
4dadc8ac   Elena.Budnik   rm 8444 +
22
23
        {name: 'prompt_param', type: 'string', defaultValue: ''},
        {name: 'default_args', type: 'string', defaultValue: ''},
ab55087c   Elena.Budnik   idl => math
24
25
		{name: 'info_brief', type: 'string', defaultValue: ''}
	],
16035364   Benjamin Renard   First commit
26
  
ab55087c   Elena.Budnik   idl => math
27
28
29
	validations: [
		{type: 'presence', field: 'name'},
		{type: 'presence', field: 'kind'},
9521cade   Elena.Budnik   rm 8441
30
31
        {type: 'presence', field: 'group'}/*,
		{type: 'inclusion', field: 'kind', list: ['amda','time']}*/
ab55087c   Elena.Budnik   idl => math
32
	],
16035364   Benjamin Renard   First commit
33
  
ab55087c   Elena.Budnik   idl => math
34
35
36
37
38
39
40
41
42
	proxy: {
			type: 'ajax',    
			url : 'generic_data/Functions/functions.xml',
			reader: {
				type: 'xml',
				root: 'functions',
				record: 'function'
			}
	}
3cedc95c   Benjamin Renard   Fix functions def...
43
});