Blame view

js/app/models/Function.js 1011 Bytes
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'},
3cedc95c   Benjamin Renard   Fix functions def...
18
		{name: 'args', mapping: '@args', type: 'int', defaultValue: 1},
ab55087c   Elena.Budnik   idl => math
19
		{name: 'argv', mapping: '@argv', type: 'string'},
ab55087c   Elena.Budnik   idl => math
20
21
22
		{name: 'prompt', type: 'string', defaultValue: ''},
		{name: 'info_brief', type: 'string', defaultValue: ''}
	],
16035364   Benjamin Renard   First commit
23
  
ab55087c   Elena.Budnik   idl => math
24
25
26
27
28
	validations: [
		{type: 'presence', field: 'name'},
		{type: 'presence', field: 'kind'},
		{type: 'inclusion', field: 'kind', list: ['math','amda','time','sliding']}
	],
16035364   Benjamin Renard   First commit
29
  
ab55087c   Elena.Budnik   idl => math
30
31
32
33
34
35
36
37
38
	proxy: {
			type: 'ajax',    
			url : 'generic_data/Functions/functions.xml',
			reader: {
				type: 'xml',
				root: 'functions',
				record: 'function'
			}
	}
3cedc95c   Benjamin Renard   Fix functions def...
39
});