Blame view

js/app/models/Function.js 1.05 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
18
19
20
21
22
23

	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: ''}
	],
16035364   Benjamin Renard   First commit
24
  
ab55087c   Elena.Budnik   idl => math
25
26
27
28
29
	validations: [
		{type: 'presence', field: 'name'},
		{type: 'presence', field: 'kind'},
		{type: 'inclusion', field: 'kind', list: ['math','amda','time','sliding']}
	],
16035364   Benjamin Renard   First commit
30
  
ab55087c   Elena.Budnik   idl => math
31
32
33
34
35
36
37
38
39
	proxy: {
			type: 'ajax',    
			url : 'generic_data/Functions/functions.xml',
			reader: {
				type: 'xml',
				root: 'functions',
				record: 'function'
			}
	}
16035364   Benjamin Renard   First commit
40
});