Commit 4d9ee90d35779cd48d177c6323041faf4b2c3c25
1 parent
b13c7432
Exists in
master
and in
8 other branches
Add getDatasetsWithTimeRestriction function in DDService (#5768)
Showing
2 changed files
with
76 additions
and
5 deletions
Show diff stats
src/DDSERVICES/SOAP/DDserverWeb.php
... | ... | @@ -8,7 +8,6 @@ |
8 | 8 | * @version $Id: DDserverWeb.php,v 1.11 2013/04/18 06:54:39 benjamin Exp $ |
9 | 9 | */ |
10 | 10 | |
11 | - | |
12 | 11 | class DDService |
13 | 12 | |
14 | 13 | { |
... | ... | @@ -57,6 +56,47 @@ |
57 | 56 | return null; |
58 | 57 | } |
59 | 58 | |
59 | +/** | |
60 | +* Returns list of datasets with TimeRestriction | |
61 | +*/ | |
62 | + function getDatasetsWithTimeRestriction() | |
63 | + { | |
64 | + $result = array( | |
65 | + ); | |
66 | + $referXML = baseDir."/DDsys.xml"; | |
67 | + $DDsys = new DOMDocument("1.0"); | |
68 | + @$DDsys->load($referXML); | |
69 | + $xp = new domxpath($DDsys); | |
70 | + $VINodes = $xp->query("//VI"); | |
71 | + if ($VINodes->length == 0) { | |
72 | + return $result; | |
73 | + } | |
74 | + | |
75 | + foreach ($VINodes as $VINode) | |
76 | + { | |
77 | + $locationNode = $VINode->getElementsByTagName("LOCATION"); | |
78 | + $nameNode = $VINode->getElementsByTagName("NAME"); | |
79 | + if (($locationNode->length > 0) && ($nameNode->length > 0)) | |
80 | + { | |
81 | + $locationNode = $locationNode->item(0); | |
82 | + $nameNode = $nameNode->item(0); | |
83 | + $location = $locationNode->nodeValue; | |
84 | + $viName = $nameNode->nodeValue; | |
85 | + if (!empty($location) && !empty($viName)) { | |
86 | + if (file_exists($location."TimeRestriction")) { | |
87 | + $restr = file($location."TimeRestriction", FILE_IGNORE_NEW_LINES); | |
88 | + $result[] = array( | |
89 | + 'vi' => $viName, | |
90 | + 'restriction' => $restr[0], | |
91 | + ); | |
92 | + } | |
93 | + } | |
94 | + } | |
95 | + } | |
96 | + | |
97 | + return $result; | |
98 | + } | |
99 | + | |
60 | 100 | /** |
61 | 101 | * Returns restricted TimeRestriction and GlobalStop in case of time restriction |
62 | 102 | */ |
... | ... | @@ -497,10 +537,9 @@ |
497 | 537 | } |
498 | 538 | } |
499 | 539 | |
540 | +require_once(dirname(__FILE__) . '/DDserverWeb_ini.php'); | |
541 | +ini_set("soap.wsdl_cache_enabled", "0"); | |
500 | 542 | |
501 | - require_once 'DDserverWeb_ini.php'; | |
502 | - | |
503 | - ini_set("soap.wsdl_cache_enabled", "0"); | |
504 | 543 | // use_soap_error_handler(false); |
505 | 544 | $server = new SoapServer("./dd.wsdl"); |
506 | 545 | $server->setClass("DDService"); | ... | ... |
src/DDSERVICES/SOAP/dd.wsdl.in
... | ... | @@ -34,7 +34,19 @@ |
34 | 34 | <attribute ref="soap11-enc:arrayType" wsdl:arrayType="string[]"/> |
35 | 35 | </restriction> |
36 | 36 | </complexContent> |
37 | - </tns:complexType> | |
37 | + </tns:complexType> | |
38 | + <tns:complexType name="ListOfDatasetTimeRestrictionData"> | |
39 | + <tns:sequence> | |
40 | + <tns:element minOccurs="0" maxOccurs="unbounded" name="DatasetTimeRestrictionData"> | |
41 | + <tns:complexType> | |
42 | + <tns:sequence> | |
43 | + <tns:element minOccurs="1" maxOccurs="1" name="vi" type="xsd:string"/> | |
44 | + <tns:element minOccurs="1" maxOccurs="1" name="restriction" type="xsd:string"/> | |
45 | + </tns:sequence> | |
46 | + </tns:complexType> | |
47 | + </tns:element> | |
48 | + </tns:sequence> | |
49 | + </tns:complexType> | |
38 | 50 | </types> |
39 | 51 | |
40 | 52 | <message name='isRemoteViAddedRequest'> |
... | ... | @@ -142,6 +154,11 @@ |
142 | 154 | <message name='getTimeRestrictionResponse'> |
143 | 155 | <part name='Result' type='tns:TimeRestrictionData'/> |
144 | 156 | </message> |
157 | +<message name='getDatasetsWithTimeRestrictionRequest'> | |
158 | +</message> | |
159 | +<message name='getDatasetsWithTimeRestrictionResponse'> | |
160 | + <part name='Result' type='tns:ListOfDatasetTimeRestrictionData'/> | |
161 | +</message> | |
145 | 162 | |
146 | 163 | <portType name='AmdaPortType'> |
147 | 164 | <operation name='isRemoteViAdded'> |
... | ... | @@ -212,6 +229,10 @@ |
212 | 229 | <input message='tns:getTimeRestrictionRequest'/> |
213 | 230 | <output message='tns:getTimeRestrictionResponse'/> |
214 | 231 | </operation> |
232 | + <operation name='getDatasetsWithTimeRestriction'> | |
233 | + <input message='tns:getDatasetsWithTimeRestrictionRequest'/> | |
234 | + <output message='tns:getDatasetsWithTimeRestrictionResponse'/> | |
235 | + </operation> | |
215 | 236 | </portType> |
216 | 237 | |
217 | 238 | <binding name='AmdaBinding' type='tns:AmdaPortType'> |
... | ... | @@ -404,6 +425,17 @@ |
404 | 425 | encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> |
405 | 426 | </output> |
406 | 427 | </operation> |
428 | + <operation name='getDatasetsWithTimeRestriction'> | |
429 | + <soap:operation soapAction='getDatasetsWithTimeRestriction'/> | |
430 | + <input> | |
431 | + <soap:body use='encoded' | |
432 | + encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> | |
433 | + </input> | |
434 | + <output> | |
435 | + <soap:body use='encoded' | |
436 | + encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> | |
437 | + </output> | |
438 | + </operation> | |
407 | 439 | </binding> |
408 | 440 | |
409 | 441 | <service name='AmdaService'> | ... | ... |