|
|
@@ -1227,6 +1227,52 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
return $reqXml->schemaValidateSource($validateConvertedTransactionXsdString);
|
|
|
}
|
|
|
|
|
|
+ public function _describeInstanceAttributeTable($nsPrefix, $name) {
|
|
|
+ $acl = $this->getAclFromTypeName("{$nsPrefix}:{$name}");
|
|
|
+
|
|
|
+ $xmlWriter = new Core_XMLWriter();
|
|
|
+ if (!$xmlWriter) throw new HttpException("Error no XMLWriter", 404);
|
|
|
+ $xmlWriter->openUri('php://output');
|
|
|
+ $xmlWriter->setIndent(true);
|
|
|
+ $xmlWriter->startDocument('1.0','UTF-8');
|
|
|
+ $xmlWriter->startElement('xsd:schema');
|
|
|
+ $xmlWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
|
|
+ $xmlWriter->writeAttribute('xmlns:gml', 'http://www.opengis.net/gml');
|
|
|
+ foreach (Api_WfsNs::getNsList() as $uri => $prefix) {
|
|
|
+ $xmlWriter->writeAttribute("xmlns:{$prefix}", $uri);
|
|
|
+ }
|
|
|
+ $xmlWriter->writeAttribute('elementFormDefault', 'qualified');
|
|
|
+
|
|
|
+ $xsdInstanceType = $acl->getName() . "_instanceType";
|
|
|
+ $xsdPrimaryKey = "xsd:string";// TODO: get from $acl
|
|
|
+ $xmlWriter->h('xsd:element', ['name'=>"instance"], [
|
|
|
+ [ 'xsd:complexType', [
|
|
|
+ [ 'xsd:sequence', [
|
|
|
+ [ 'xsd:element', ['name'=>"primaryKey", 'type'=>$xsdPrimaryKey], null ],
|
|
|
+ [ 'xsd:element', ['name'=>"instance", 'type'=>$xsdInstanceType], null ],
|
|
|
+ [ 'xsd:element', ['name'=>"type", 'type'=>"xsd:string"], null ],// TODO: instance, derived
|
|
|
+ [ 'xsd:element', ['name'=>"create_author", 'type'=>"xsd:string"], null ],
|
|
|
+ [ 'xsd:element', ['name'=>"create_date", 'type'=>"xsd:dateTime"], null ],
|
|
|
+ [ 'xsd:element', ['name'=>"update_author", 'type'=>"xsd:string"], null ],
|
|
|
+ [ 'xsd:element', ['name'=>"updage_date", 'type'=>"xsd:dateTime"], null ],
|
|
|
+ ] ]
|
|
|
+ ] ]
|
|
|
+ ]);
|
|
|
+ $instanceList = [];
|
|
|
+ $instanceList[] = [ 'xsd:enumeration', ['value'=>$acl->getName()], null ];
|
|
|
+ if (method_exists($acl, 'getInstanceList')) {
|
|
|
+ foreach ($acl->getInstanceList() as $instanceName) {
|
|
|
+ $instanceList[] = [ 'xsd:enumeration', ['value'=>$instanceName], null ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $xmlWriter->h('xsd:simpleType', ['name'=>$xsdInstanceType], [
|
|
|
+ [ 'xsd:restriction', ['base'=>"xsd:string"], $instanceList],
|
|
|
+ ]);
|
|
|
+ $xmlWriter->endElement();// xsd:schema
|
|
|
+ $xmlWriter->endDocument();
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+
|
|
|
public function _getDescribeFeatureType($nsPrefix, $type, $simple = true) {
|
|
|
return $this->_getDescribeFeatureTypes(array(array($nsPrefix, $type)), $simple);
|
|
|
}
|