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,7 +870,7 @@ Ext.define('amdaUI.CatalogUI', {
870 var window = Ext.create('Ext.window.Window', { 870 var window = Ext.create('Ext.window.Window', {
871 title: (isNew) ? 'New Column' : 'Edit Column', 871 title: (isNew) ? 'New Column' : 'Edit Column',
872 width: 275, 872 width: 275,
873 - height: 155, 873 + height: 210,
874 closable:false, 874 closable:false,
875 modal:true, 875 modal:true,
876 resizable: false, 876 resizable: false,
@@ -917,7 +917,17 @@ Ext.define('amdaUI.CatalogUI', { @@ -917,7 +917,17 @@ Ext.define('amdaUI.CatalogUI', {
917 minValue: 1, 917 minValue: 1,
918 allowBlank: false, 918 allowBlank: false,
919 tooltip: 'For exemple: 1 for scalar type or 3 for a vector' 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 buttons: [{ 932 buttons: [{
923 text: 'Save', 933 text: 'Save',
@@ -937,6 +947,7 @@ Ext.define('amdaUI.CatalogUI', { @@ -937,6 +947,7 @@ Ext.define('amdaUI.CatalogUI', {
937 this.up('form').getForm().findField('nameColumn').getValue(), 947 this.up('form').getForm().findField('nameColumn').getValue(),
938 this.up('form').getForm().findField('typeColumn').getValue(), 948 this.up('form').getForm().findField('typeColumn').getValue(),
939 this.up('form').getForm().findField('sizeColumn').getValue(), 949 this.up('form').getForm().findField('sizeColumn').getValue(),
  950 + this.up('form').getForm().findField('descriptionColumn').getValue(),
940 function(result, e){ 951 function(result, e){
941 if(result){ 952 if(result){
942 me.toReconfigure = true; 953 me.toReconfigure = true;
@@ -949,6 +960,7 @@ Ext.define('amdaUI.CatalogUI', { @@ -949,6 +960,7 @@ Ext.define('amdaUI.CatalogUI', {
949 var newName = null; 960 var newName = null;
950 var newType = null; 961 var newType = null;
951 var newSize = null; 962 var newSize = null;
  963 + var newDescription = null;
952 964
953 // Check if there is modifications 965 // Check if there is modifications
954 if(this.up('form').getForm().findField('nameColumn').getValue() != columnInfo.name){ 966 if(this.up('form').getForm().findField('nameColumn').getValue() != columnInfo.name){
@@ -960,10 +972,13 @@ Ext.define('amdaUI.CatalogUI', { @@ -960,10 +972,13 @@ Ext.define('amdaUI.CatalogUI', {
960 if(this.up('form').getForm().findField('sizeColumn').getValue() != columnInfo.size){ 972 if(this.up('form').getForm().findField('sizeColumn').getValue() != columnInfo.size){
961 newSize = this.up('form').getForm().findField('sizeColumn').getValue(); 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 if(result){ 982 if(result){
968 me.toReconfigure = true; 983 me.toReconfigure = true;
969 me.onAfterInit(result); 984 me.onAfterInit(result);
php/classes/AmdaAction.php
@@ -1659,9 +1659,9 @@ class AmdaAction @@ -1659,9 +1659,9 @@ class AmdaAction
1659 return $cacheMgr->deleteColumn($id); 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 $cacheMgr = new CatalogCacheMgr(); 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 public function getCatColumnInfo($id){ 1667 public function getCatColumnInfo($id){
@@ -1669,9 +1669,9 @@ class AmdaAction @@ -1669,9 +1669,9 @@ class AmdaAction
1669 return $cacheMgr->getCatColumnInfo($id); 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 $cacheMgr = new CatalogCacheMgr(); 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,11 +160,11 @@ class CatalogCacheMgr extends TimeTableCacheMgr
160 return array('success' => $result , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo()); 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 if (!$this->loadFromFile()) 164 if (!$this->loadFromFile())
165 return array('success' => false, 'message' => 'Cannot load cache file'); 165 return array('success' => false, 'message' => 'Cannot load cache file');
166 $isNew=true; 166 $isNew=true;
167 - $this->cache->addParameter($id,$name, $size, $type, "", $isNew); 167 + $this->cache->addParameter($id,$name, $size, $type, $description , $isNew);
168 $this->saveToFile(); 168 $this->saveToFile();
169 return array('success' => true , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo()); 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,11 +176,11 @@ class CatalogCacheMgr extends TimeTableCacheMgr
176 return $this->cache->getParameterInfo($id); 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 if (!$this->loadFromFile()) 180 if (!$this->loadFromFile())
181 return array('success' => false, 'message' => 'Cannot load cache file'); 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 $this->saveToFile(); 185 $this->saveToFile();
186 return array('success' => true , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo()); 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,7 +52,7 @@ class CatalogCacheObject extends TimeTableCacheObject
52 return false; 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 foreach ($this->parameters as $index=>$param){ 57 foreach ($this->parameters as $index=>$param){
58 if($id == $param['id']){ 58 if($id == $param['id']){
@@ -62,6 +62,8 @@ class CatalogCacheObject extends TimeTableCacheObject @@ -62,6 +62,8 @@ class CatalogCacheObject extends TimeTableCacheObject
62 $this->parameters[$index]['type'] = $type; 62 $this->parameters[$index]['type'] = $type;
63 if(isset($size)) 63 if(isset($size))
64 $this->parameters[$index]['size'] = $size; 64 $this->parameters[$index]['size'] = $size;
  65 + if(isset($description))
  66 + $this->parameters[$index]['description'] = $description;
65 $this->isModified = TRUE; 67 $this->isModified = TRUE;
66 return true; 68 return true;
67 } 69 }
php/config.php
@@ -200,9 +200,9 @@ $API = array( @@ -200,9 +200,9 @@ $API = array(
200 'parseTemplatedParam' => array('len'=>1), 200 'parseTemplatedParam' => array('len'=>1),
201 // Furkan - New Catalog Options 201 // Furkan - New Catalog Options
202 'deleteColumn' => array('len'=> 1), 202 'deleteColumn' => array('len'=> 1),
203 - 'addColumn' => array('len' => 4), 203 + 'addColumn' => array('len' => 5),
204 'getCatColumnInfo' => array('len' => 1), 204 'getCatColumnInfo' => array('len' => 1),
205 - 'editColumn' => array('len' => 4) 205 + 'editColumn' => array('len' => 5)
206 ) 206 )
207 ) 207 )
208 ); 208 );