Commit 0dc31ba8dacd9f7b471568a1ab4dba316727f7ac
1 parent
74b77f58
Exists in
master
and in
110 other branches
remoteParamManager instaed of ParamManager
Showing
3 changed files
with
59 additions
and
40 deletions
Show diff stats
php/RemoteDataCenter/RemoteParamManager.php
... | ... | @@ -12,7 +12,7 @@ class RemoteParamManager |
12 | 12 | protected $center; |
13 | 13 | |
14 | 14 | public $xmlDom, $xmlName; |
15 | - public $paramId, $remoteViId, $localInfo, $paramDom, $paramXML; | |
15 | + public $baseId, $paramId, $remoteViId, $localInfo, $paramDom, $paramXML; | |
16 | 16 | |
17 | 17 | function __construct() |
18 | 18 | { |
... | ... | @@ -30,6 +30,12 @@ class RemoteParamManager |
30 | 30 | if (!file_exists(USERWSDIR."RemoteParams.xml")) |
31 | 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 | 39 | $this->xmlName = USERWSDIR."RemoteParams.xml"; |
34 | 40 | $this->xmlDom = new DomDocument("1.0"); |
35 | 41 | $this->xmlDom->load($this->xmlName); |
... | ... | @@ -81,7 +87,7 @@ class RemoteParamManager |
81 | 87 | $paramNode->appendChild($xml->createElement("process")); |
82 | 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 | 93 | // TODO not used - too complicated |
... | ... | @@ -291,5 +297,13 @@ class RemoteParamManager |
291 | 297 | |
292 | 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 | 310 | \ No newline at end of file | ... | ... |
php/classes/AmdaAction.php
... | ... | @@ -575,27 +575,34 @@ class AmdaAction |
575 | 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 | 583 | public function saveTree($obj) |
579 | 584 | { |
580 | - $paramMgr = new ParamMgr(); | |
585 | + $paramMgr = new RemoteParamManager(); | |
581 | 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 | 592 | public function deleteFromTree($obj) |
591 | 593 | { |
592 | - $paramMgr = new ParamMgr(); | |
594 | + $paramMgr = new RemoteParamManager(); | |
593 | 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 | 606 | public function getUploadedObject($name, $format, $nodeType) |
600 | 607 | { |
601 | 608 | switch ($nodeType) |
... | ... | @@ -612,14 +619,12 @@ class AmdaAction |
612 | 619 | default: |
613 | 620 | return array("error" => $nodeType." NOT_IMPLEMENTED_YET"); |
614 | 621 | } |
615 | - | |
616 | 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 | 628 | public function getAsciiFile($obj) |
624 | 629 | { |
625 | 630 | $objectMgr = new FilesMgr(); |
... | ... | @@ -632,9 +637,9 @@ class AmdaAction |
632 | 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 | 643 | public function getTmpObject($folderId, $name, $nodeType) |
639 | 644 | { |
640 | 645 | switch ($nodeType) | ... | ... |
php/classes/UserMgr.php
... | ... | @@ -77,7 +77,7 @@ class UserMgr |
77 | 77 | $this->user = $_GET['sessionID']; |
78 | 78 | else if (isset($sessionID)) |
79 | 79 | $this->user = $sessionID; |
80 | - $this->amdaClient = new AmdaClient(); | |
80 | + // $this->amdaClient = new AmdaClient(); | |
81 | 81 | } |
82 | 82 | |
83 | 83 | //TODO if needed?? set session ID |
... | ... | @@ -260,7 +260,7 @@ class UserMgr |
260 | 260 | { |
261 | 261 | $remoteBases = new DomDocument("1.0"); |
262 | 262 | $availableMis = $this->userMissions['external']; |
263 | - | |
263 | +unlink(USERWSDIR.'RemoteParams.xml'); | |
264 | 264 | if (file_exists(USERWSDIR.'RemoteParams.xml')) |
265 | 265 | { |
266 | 266 | // replace IMPEX nodes |
... | ... | @@ -325,7 +325,7 @@ class UserMgr |
325 | 325 | |
326 | 326 | if ($bases->length == 0) return 'NO REMOTE BASES'; |
327 | 327 | |
328 | - $paramMgr = new ParamMgr(); | |
328 | + $paramMgr = new RemoteParamManager(); | |
329 | 329 | $paramMgr->xmlDom = new DomDocument("1.0"); |
330 | 330 | $paramMgr->xmlDom->formatOutput = true; |
331 | 331 | $paramMgr->xmlDom->preserveWhiteSpace = false; |
... | ... | @@ -537,22 +537,22 @@ class UserMgr |
537 | 537 | // if new info exists it will be shown to : |
538 | 538 | // public => to all |
539 | 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 | 552 | touch($this->userdir.'newLogin'); |
553 | 553 | |
554 | 554 | $this->setPath(); |
555 | - $this->userMissions = $this->getAvailableMissionsByUser(); | |
555 | + // $this->userMissions = $this->getAvailableMissionsByUser(); | |
556 | 556 | |
557 | 557 | if (file_exists(USERWSDIR.'LocalParams.xml')) |
558 | 558 | unlink(USERWSDIR.'LocalParams.xml'); |
... | ... | @@ -571,8 +571,8 @@ class UserMgr |
571 | 571 | /* |
572 | 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 | 576 | // Special Info for special groups |
577 | 577 | if ($specialGroup) |
578 | 578 | { | ... | ... |