Commit 1fc076b5ac85e1f25efe09dd7b564e3ec839b66c

Authored by Erdogan Furkan
1 parent 21ff9173

#9660 - Adding description case

js/app/views/CatalogUI.js
... ... @@ -870,7 +870,7 @@ Ext.define('amdaUI.CatalogUI', {
870 870 var window = Ext.create('Ext.window.Window', {
871 871 title: (isNew) ? 'New Column' : 'Edit Column',
872 872 width: 275,
873   - height: 155,
  873 + height: 210,
874 874 closable:false,
875 875 modal:true,
876 876 resizable: false,
... ... @@ -917,7 +917,17 @@ Ext.define('amdaUI.CatalogUI', {
917 917 minValue: 1,
918 918 allowBlank: false,
919 919 tooltip: 'For exemple: 1 for scalar type or 3 for a vector'
920   - }],
  920 + },
  921 + {
  922 + // Name
  923 + xtype:'textarea',
  924 + fieldLabel: 'Description',
  925 + name: 'descriptionColumn',
  926 + height:50,
  927 + value: (isNew) ? null : columnInfo.description,
  928 + allowBlank: true,
  929 + }
  930 + ],
921 931  
922 932 buttons: [{
923 933 text: 'Save',
... ... @@ -937,6 +947,7 @@ Ext.define('amdaUI.CatalogUI', {
937 947 this.up('form').getForm().findField('nameColumn').getValue(),
938 948 this.up('form').getForm().findField('typeColumn').getValue(),
939 949 this.up('form').getForm().findField('sizeColumn').getValue(),
  950 + this.up('form').getForm().findField('descriptionColumn').getValue(),
940 951 function(result, e){
941 952 if(result){
942 953 me.toReconfigure = true;
... ... @@ -949,6 +960,7 @@ Ext.define('amdaUI.CatalogUI', {
949 960 var newName = null;
950 961 var newType = null;
951 962 var newSize = null;
  963 + var newDescription = null;
952 964  
953 965 // Check if there is modifications
954 966 if(this.up('form').getForm().findField('nameColumn').getValue() != columnInfo.name){
... ... @@ -960,10 +972,13 @@ Ext.define('amdaUI.CatalogUI', {
960 972 if(this.up('form').getForm().findField('sizeColumn').getValue() != columnInfo.size){
961 973 newSize = this.up('form').getForm().findField('sizeColumn').getValue();
962 974 }
  975 + if(this.up('form').getForm().findField('descriptionColumn').getValue() != columnInfo.description){
  976 + newDescription = this.up('form').getForm().findField('descriptionColumn').getValue();
  977 + }
963 978  
964   - if(newName != null || newType != null || newSize != null)
  979 + if(newName != null || newType != null || newSize != null || newDescription != null)
965 980 {
966   - AmdaAction.editColumn(columnInfo.id, newName, newType, newSize, function(result, e){
  981 + AmdaAction.editColumn(columnInfo.id, newName, newType, newSize, newDescription, function(result, e){
967 982 if(result){
968 983 me.toReconfigure = true;
969 984 me.onAfterInit(result);
... ...
php/classes/AmdaAction.php
... ... @@ -1659,9 +1659,9 @@ class AmdaAction
1659 1659 return $cacheMgr->deleteColumn($id);
1660 1660 }
1661 1661  
1662   - public function addColumn($id, $name, $type, $size){
  1662 + public function addColumn($id, $name, $type, $size, $description){
1663 1663 $cacheMgr = new CatalogCacheMgr();
1664   - return $cacheMgr->addColumn($id,$name, $type,$size);
  1664 + return $cacheMgr->addColumn($id,$name, $type,$size,$description);
1665 1665 }
1666 1666  
1667 1667 public function getCatColumnInfo($id){
... ... @@ -1669,9 +1669,9 @@ class AmdaAction
1669 1669 return $cacheMgr->getCatColumnInfo($id);
1670 1670 }
1671 1671  
1672   - public function editColumn($id, $name, $type, $size){
  1672 + public function editColumn($id, $name, $type, $size,$description){
1673 1673 $cacheMgr = new CatalogCacheMgr();
1674   - return $cacheMgr->editColumn($id,$name, $type,$size);
  1674 + return $cacheMgr->editColumn($id,$name, $type,$size,$description);
1675 1675 }
1676 1676 }
1677 1677 ?>
... ...
php/classes/CatalogCacheMgr.php
... ... @@ -160,11 +160,11 @@ class CatalogCacheMgr extends TimeTableCacheMgr
160 160 return array('success' => $result , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo());
161 161 }
162 162  
163   - public function addColumn($id,$name, $type,$size){
  163 + public function addColumn($id,$name, $type,$size, $description){
164 164 if (!$this->loadFromFile())
165 165 return array('success' => false, 'message' => 'Cannot load cache file');
166 166 $isNew=true;
167   - $this->cache->addParameter($id,$name, $size, $type, "", $isNew);
  167 + $this->cache->addParameter($id,$name, $size, $type, $description , $isNew);
168 168 $this->saveToFile();
169 169 return array('success' => true , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo());
170 170 }
... ... @@ -176,11 +176,11 @@ class CatalogCacheMgr extends TimeTableCacheMgr
176 176 return $this->cache->getParameterInfo($id);
177 177 }
178 178  
179   - public function editColumn($id,$name, $type,$size){
  179 + public function editColumn($id,$name, $type,$size, $description){
180 180 if (!$this->loadFromFile())
181 181 return array('success' => false, 'message' => 'Cannot load cache file');
182 182  
183   - $this->cache->editParameter($id,$name, $type, $size);
  183 + $this->cache->editParameter($id,$name, $type, $size, $description);
184 184  
185 185 $this->saveToFile();
186 186 return array('success' => true , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo());
... ...
php/classes/CatalogCacheObject.php
... ... @@ -52,7 +52,7 @@ class CatalogCacheObject extends TimeTableCacheObject
52 52 return false;
53 53 }
54 54  
55   - public function editParameter($id, $name, $type, $size)
  55 + public function editParameter($id, $name, $type, $size, $description)
56 56 {
57 57 foreach ($this->parameters as $index=>$param){
58 58 if($id == $param['id']){
... ... @@ -62,6 +62,8 @@ class CatalogCacheObject extends TimeTableCacheObject
62 62 $this->parameters[$index]['type'] = $type;
63 63 if(isset($size))
64 64 $this->parameters[$index]['size'] = $size;
  65 + if(isset($description))
  66 + $this->parameters[$index]['description'] = $description;
65 67 $this->isModified = TRUE;
66 68 return true;
67 69 }
... ...
php/config.php
... ... @@ -200,9 +200,9 @@ $API = array(
200 200 'parseTemplatedParam' => array('len'=>1),
201 201 // Furkan - New Catalog Options
202 202 'deleteColumn' => array('len'=> 1),
203   - 'addColumn' => array('len' => 4),
  203 + 'addColumn' => array('len' => 5),
204 204 'getCatColumnInfo' => array('len' => 1),
205   - 'editColumn' => array('len' => 4)
  205 + 'editColumn' => array('len' => 5)
206 206 )
207 207 )
208 208 );
... ...