Commit 17a56975b521c27149bf70db991f18c8c6acf288

Authored by Benjamin Renard
1 parent 3c1a161e
Exists in master and in 1 other branch WIP

Get Modification dates

src/DDSERVICES/SOAP/DDserverWeb.php
... ... @@ -101,6 +101,49 @@
101 101 return $result;
102 102 }
103 103  
  104 +
  105 +/**
  106 +* Returns list of datasets with TimeRestriction
  107 +*/
  108 +function getDatasetsModificationDates()
  109 +{
  110 + $result = array(
  111 + );
  112 + $referXML = baseDir."/DDsys.xml";
  113 + $DDsys = new DOMDocument("1.0");
  114 + @$DDsys->load($referXML);
  115 + $xp = new domxpath($DDsys);
  116 + $VINodes = $xp->query("//VI");
  117 + if ($VINodes->length == 0) {
  118 + return $result;
  119 + }
  120 +
  121 + foreach ($VINodes as $VINode)
  122 + {
  123 + $locationNode = $VINode->getElementsByTagName("LOCATION");
  124 + $nameNode = $VINode->getElementsByTagName("NAME");
  125 + $timesNode = $VINode->getElementsByTagName("TIMES");
  126 + if (($locationNode->length > 0) && ($nameNode->length > 0) && ($timesNode->length > 0))
  127 + {
  128 + $locationNode = $locationNode->item(0);
  129 + $nameNode = $nameNode->item(0);
  130 + $location = $locationNode->nodeValue;
  131 + $viName = $nameNode->nodeValue;
  132 + $timesNode = $timesNode->item(0);
  133 + $timesFile = $location.$timesNode->nodeValue;
  134 + if (!empty($location) && !empty($viName)) {
  135 + $result[] = array(
  136 + 'vi' => $viName,
  137 + 'releaseDate' => "2008-01-01T00:00:00.000Z",
  138 + 'modificationDate' => "2018-01-01T00:00:00.000Z",
  139 + );
  140 + }
  141 + }
  142 + }
  143 +
  144 + return $result;
  145 +}
  146 +
104 147 /**
105 148 * Returns restricted TimeRestriction and GlobalStop in case of time restriction
106 149 */
... ...
src/DDSERVICES/SOAP/dd.wsdl.in
... ... @@ -47,6 +47,19 @@
47 47 </tns:element>
48 48 </tns:sequence>
49 49 </tns:complexType>
  50 + <tns:complexType name="ListOfDatasetModificationDate">
  51 + <tns:sequence>
  52 + <tns:element minOccurs="0" maxOccurs="unbounded" name="DatasetModificationDate">
  53 + <tns:complexType>
  54 + <tns:sequence>
  55 + <tns:element minOccurs="1" maxOccurs="1" name="vi" type="xsd:string"/>
  56 + <tns:element minOccurs="1" maxOccurs="1" name="releaseDate" type="xsd:string"/>
  57 + <tns:element minOccurs="1" maxOccurs="1" name="modificationDate" type="xsd:string"/>
  58 + </tns:sequence>
  59 + </tns:complexType>
  60 + </tns:element>
  61 + </tns:sequence>
  62 + </tns:complexType>
50 63 </types>
51 64  
52 65 <message name='isRemoteViAddedRequest'>
... ... @@ -174,6 +187,11 @@
174 187 <message name='getDatasetsWithTimeRestrictionResponse'>
175 188 <part name='Result' type='tns:ListOfDatasetTimeRestrictionData'/>
176 189 </message>
  190 +<message name='getDatasetsModficationDatesRequest'>
  191 +</message>
  192 +<message name='getDatasetsModficationDatesResponse'>
  193 + <part name='Result' type='tns:ListOfDatasetModificationDate'/>
  194 +</message>
177 195  
178 196 <portType name='AmdaPortType'>
179 197 <operation name='isRemoteViAdded'>
... ... @@ -256,6 +274,12 @@
256 274 <input message='tns:getDatasetsWithTimeRestrictionRequest'/>
257 275 <output message='tns:getDatasetsWithTimeRestrictionResponse'/>
258 276 </operation>
  277 + <operation name='getDatasetsModficationDates'>
  278 + <input message='tns:getDatasetsModficationDatesRequest'/>
  279 + <output message='tns:getDatasetsModficationDatesResponse'/>
  280 + </operation>
  281 +
  282 +
259 283 </portType>
260 284  
261 285 <binding name='AmdaBinding' type='tns:AmdaPortType'>
... ... @@ -481,6 +505,17 @@
481 505 encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
482 506 </output>
483 507 </operation>
  508 + <operation name='getDatasetsModificationDates'>
  509 + <soap:operation soapAction='getDatasetsModificationDates'/>
  510 + <input>
  511 + <soap:body use='encoded'
  512 + encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
  513 + </input>
  514 + <output>
  515 + <soap:body use='encoded'
  516 + encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
  517 + </output>
  518 + </operation>
484 519 </binding>
485 520  
486 521 <service name='AmdaService'>
... ...