Commit 0dc31ba8dacd9f7b471568a1ab4dba316727f7ac

Authored by Elena.Budnik
1 parent 74b77f58

remoteParamManager instaed of ParamManager

php/RemoteDataCenter/RemoteParamManager.php
@@ -12,7 +12,7 @@ class RemoteParamManager @@ -12,7 +12,7 @@ class RemoteParamManager
12 protected $center; 12 protected $center;
13 13
14 public $xmlDom, $xmlName; 14 public $xmlDom, $xmlName;
15 - public $paramId, $remoteViId, $localInfo, $paramDom, $paramXML; 15 + public $baseId, $paramId, $remoteViId, $localInfo, $paramDom, $paramXML;
16 16
17 function __construct() 17 function __construct()
18 { 18 {
@@ -30,6 +30,12 @@ class RemoteParamManager @@ -30,6 +30,12 @@ class RemoteParamManager
30 if (!file_exists(USERWSDIR."RemoteParams.xml")) 30 if (!file_exists(USERWSDIR."RemoteParams.xml"))
31 return array("err" => "No RemoteParams.xml"); 31 return array("err" => "No RemoteParams.xml");
32 32
  33 + if (!is_dir(RemoteData."/PARAMS"))
  34 + mkdir(RemoteData."/PARAMS", 0755, true);
  35 +
  36 + if (!is_dir(RemoteData."/PARAMS_INFO"))
  37 + mkdir(RemoteData."/PARAMS_INFO", 0755, true);
  38 +
33 $this->xmlName = USERWSDIR."RemoteParams.xml"; 39 $this->xmlName = USERWSDIR."RemoteParams.xml";
34 $this->xmlDom = new DomDocument("1.0"); 40 $this->xmlDom = new DomDocument("1.0");
35 $this->xmlDom->load($this->xmlName); 41 $this->xmlDom->load($this->xmlName);
@@ -81,7 +87,7 @@ class RemoteParamManager @@ -81,7 +87,7 @@ class RemoteParamManager
81 $paramNode->appendChild($xml->createElement("process")); 87 $paramNode->appendChild($xml->createElement("process"));
82 $paramNode->appendChild($xml->createElement("output")); 88 $paramNode->appendChild($xml->createElement("output"));
83 89
84 - return $xml->save(RemoteData.$this->center->baseID."/".$this->paramId.".xml"); 90 + return $xml->save(RemoteData."/PARAMS/".$this->paramId.".xml");
85 } 91 }
86 92
87 // TODO not used - too complicated 93 // TODO not used - too complicated
@@ -291,5 +297,13 @@ class RemoteParamManager @@ -291,5 +297,13 @@ class RemoteParamManager
291 297
292 return array('res'=> $obj->id); 298 return array('res'=> $obj->id);
293 } 299 }
  300 +
  301 + public function getInfoName($datasetId) {
  302 +
  303 +// if ($this->baseId == 'CDAWEB')
  304 +// return strtolower($datasetId)."_00000000_v01.cdf";
  305 + return $datasetId.'.xml';
  306 +
  307 + }
294 } 308 }
295 ?> 309 ?>
296 \ No newline at end of file 310 \ No newline at end of file
php/classes/AmdaAction.php
@@ -575,27 +575,34 @@ class AmdaAction @@ -575,27 +575,34 @@ class AmdaAction
575 return $childrenToReturn; 575 return $childrenToReturn;
576 } 576 }
577 577
  578 + /*
  579 + * add Remote Parameter to user RemoteParams.xml
  580 + * send request to DDServer to AddVi if Vi doesn't exist
  581 + * create Remote Parameter Description
  582 + */
578 public function saveTree($obj) 583 public function saveTree($obj)
579 { 584 {
580 - $paramMgr = new ParamMgr(); 585 + $paramMgr = new RemoteParamManager();
581 return $paramMgr->saveTree($obj); 586 return $paramMgr->saveTree($obj);
582 } 587 }
583 -  
584 - public function doNothing($obj)  
585 - {  
586 - return array("res" => 'ok');  
587 -  
588 - }  
589 - 588 +
  589 + /*
  590 + * delete Remote Parameter from user RemoteParams.xml
  591 + */
590 public function deleteFromTree($obj) 592 public function deleteFromTree($obj)
591 { 593 {
592 - $paramMgr = new ParamMgr(); 594 + $paramMgr = new RemoteParamManager();
593 return $paramMgr->deleteFromTree($obj); 595 return $paramMgr->deleteFromTree($obj);
594 } 596 }
  597 +
  598 + public function doNothing($obj)
  599 + {
  600 + return array("res" => 'ok');
  601 + }
595 602
596 -/*  
597 -* temporary object fromUpload  
598 -*/ 603 + /*
  604 + * get temporary object from Upload
  605 + */
599 public function getUploadedObject($name, $format, $nodeType) 606 public function getUploadedObject($name, $format, $nodeType)
600 { 607 {
601 switch ($nodeType) 608 switch ($nodeType)
@@ -612,14 +619,12 @@ class AmdaAction @@ -612,14 +619,12 @@ class AmdaAction
612 default: 619 default:
613 return array("error" => $nodeType." NOT_IMPLEMENTED_YET"); 620 return array("error" => $nodeType." NOT_IMPLEMENTED_YET");
614 } 621 }
615 -  
616 return $objectMgr->getUploadedObject($name, $format, true); 622 return $objectMgr->getUploadedObject($name, $format, true);
617 -  
618 } 623 }
619 624
620 -/*  
621 -* fill ascii file into grid  
622 -*/ 625 + /*
  626 + * fill ascii file into grid
  627 + */
623 public function getAsciiFile($obj) 628 public function getAsciiFile($obj)
624 { 629 {
625 $objectMgr = new FilesMgr(); 630 $objectMgr = new FilesMgr();
@@ -632,9 +637,9 @@ class AmdaAction @@ -632,9 +637,9 @@ class AmdaAction
632 return $objectMgr->getParamInfo($object); 637 return $objectMgr->getParamInfo($object);
633 } 638 }
634 639
635 -/*  
636 -* temporary object from Search  
637 -*/ 640 + /*
  641 + * get temporary object from Search
  642 + */
638 public function getTmpObject($folderId, $name, $nodeType) 643 public function getTmpObject($folderId, $name, $nodeType)
639 { 644 {
640 switch ($nodeType) 645 switch ($nodeType)
php/classes/UserMgr.php
@@ -77,7 +77,7 @@ class UserMgr @@ -77,7 +77,7 @@ class UserMgr
77 $this->user = $_GET['sessionID']; 77 $this->user = $_GET['sessionID'];
78 else if (isset($sessionID)) 78 else if (isset($sessionID))
79 $this->user = $sessionID; 79 $this->user = $sessionID;
80 - $this->amdaClient = new AmdaClient(); 80 + // $this->amdaClient = new AmdaClient();
81 } 81 }
82 82
83 //TODO if needed?? set session ID 83 //TODO if needed?? set session ID
@@ -260,7 +260,7 @@ class UserMgr @@ -260,7 +260,7 @@ class UserMgr
260 { 260 {
261 $remoteBases = new DomDocument("1.0"); 261 $remoteBases = new DomDocument("1.0");
262 $availableMis = $this->userMissions['external']; 262 $availableMis = $this->userMissions['external'];
263 - 263 +unlink(USERWSDIR.'RemoteParams.xml');
264 if (file_exists(USERWSDIR.'RemoteParams.xml')) 264 if (file_exists(USERWSDIR.'RemoteParams.xml'))
265 { 265 {
266 // replace IMPEX nodes 266 // replace IMPEX nodes
@@ -325,7 +325,7 @@ class UserMgr @@ -325,7 +325,7 @@ class UserMgr
325 325
326 if ($bases->length == 0) return 'NO REMOTE BASES'; 326 if ($bases->length == 0) return 'NO REMOTE BASES';
327 327
328 - $paramMgr = new ParamMgr(); 328 + $paramMgr = new RemoteParamManager();
329 $paramMgr->xmlDom = new DomDocument("1.0"); 329 $paramMgr->xmlDom = new DomDocument("1.0");
330 $paramMgr->xmlDom->formatOutput = true; 330 $paramMgr->xmlDom->formatOutput = true;
331 $paramMgr->xmlDom->preserveWhiteSpace = false; 331 $paramMgr->xmlDom->preserveWhiteSpace = false;
@@ -537,22 +537,22 @@ class UserMgr @@ -537,22 +537,22 @@ class UserMgr
537 // if new info exists it will be shown to : 537 // if new info exists it will be shown to :
538 // public => to all 538 // public => to all
539 // special => to group members 539 // special => to group members
540 - if (file_exists($this->userdir.'newInfo'))  
541 - {  
542 - $amdaInfo = new AmdaNews($this->user);  
543 - // if status = 0 - it is special info to group members only  
544 - // else to all  
545 - $info = $this->getUserInfo($this->user);  
546 - $status = $amdaInfo->makeInfo($info['group']);  
547 -  
548 - if ($status) $this->isNewInfo = true;  
549 -  
550 - unlink($this->userdir.'newInfo');  
551 - } 540 +// if (file_exists($this->userdir.'newInfo'))
  541 +// {
  542 +// $amdaInfo = new AmdaNews($this->user);
  543 +// // if status = 0 - it is special info to group members only
  544 +// // else to all
  545 +// $info = $this->getUserInfo($this->user);
  546 +// $status = $amdaInfo->makeInfo($info['group']);
  547 +//
  548 +// if ($status) $this->isNewInfo = true;
  549 +//
  550 +// unlink($this->userdir.'newInfo');
  551 +// }
552 touch($this->userdir.'newLogin'); 552 touch($this->userdir.'newLogin');
553 553
554 $this->setPath(); 554 $this->setPath();
555 - $this->userMissions = $this->getAvailableMissionsByUser(); 555 + // $this->userMissions = $this->getAvailableMissionsByUser();
556 556
557 if (file_exists(USERWSDIR.'LocalParams.xml')) 557 if (file_exists(USERWSDIR.'LocalParams.xml'))
558 unlink(USERWSDIR.'LocalParams.xml'); 558 unlink(USERWSDIR.'LocalParams.xml');
@@ -571,8 +571,8 @@ class UserMgr @@ -571,8 +571,8 @@ class UserMgr
571 /* 571 /*
572 * Special groups are defined in the generic_data/SpecialSettings/Groups.xml 572 * Special groups are defined in the generic_data/SpecialSettings/Groups.xml
573 */ 573 */
574 - $specialGroup = $this->isSpecialGroup();  
575 - 574 + // $specialGroup = $this->isSpecialGroup();
  575 + $specialGroup = false;
576 // Special Info for special groups 576 // Special Info for special groups
577 if ($specialGroup) 577 if ($specialGroup)
578 { 578 {