|
|
@@ -1319,13 +1319,12 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
] ]
|
|
|
] ]
|
|
|
]);
|
|
|
- $instanceList = [];
|
|
|
- $instanceList[] = [ 'xsd:enumeration', ['value'=>$acl->getName()], null ];
|
|
|
- if (method_exists($acl, 'getInstanceList')) {
|
|
|
- foreach ($acl->getInstanceList() as $instanceName) {
|
|
|
- $instanceList[] = [ 'xsd:enumeration', ['value'=>$instanceName], null ];
|
|
|
- }
|
|
|
- }
|
|
|
+ $instanceList = (method_exists($acl, 'getInstanceList'))
|
|
|
+ ? array_map(function ($instanceName) {
|
|
|
+ return [ 'xsd:enumeration', ['value'=>$instanceName], null ];
|
|
|
+ }, $acl->getInstanceList())
|
|
|
+ : [ 'xsd:enumeration', ['value'=>$acl->getName()], null ]
|
|
|
+ ;
|
|
|
$xmlWriter->h('xsd:simpleType', ['name'=>$xsdInstanceType], [
|
|
|
[ 'xsd:restriction', ['base'=>"xsd:string"], $instanceList],
|
|
|
]);
|
|
|
@@ -1393,6 +1392,7 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
public function _getDescribeFeatureTypes($typeNames, $simple = true) {
|
|
|
if (empty($typeNames)) throw new HttpException("Feature Type Names not defined", 400);
|
|
|
$this->DBG("types:" . json_encode($typeNames), __LINE__, __FUNCTION__, __CLASS__);
|
|
|
+ DBG::log($typeNames, 'array', "DescribeFeatureType \$typeNames");
|
|
|
// TODO: fix namespace BUG for multiple types:
|
|
|
// - fetch namespace for first type
|
|
|
// - if another object has another namespace then -> import tag
|
|
|
@@ -1446,6 +1446,7 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
$xmlWriter->writeComment("TODO: typeName '{$typeName}' by import namespace '{$aclNamespaceUri}'");// TODO: <xsd:import>; continue;
|
|
|
}
|
|
|
|
|
|
+ DBG::log($acl->hasSimpleSchema(), 'array', "\$acl({$typeName})->hasSimpleSchema()");
|
|
|
if ($acl->hasSimpleSchema()) {
|
|
|
$simpleSchema = $acl->getSimpleSchema();
|
|
|
$xmlWriter->writeComment("TODO: typeName '{$typeName}' hasSimpleSchema L." . __LINE__);
|
|
|
@@ -1601,19 +1602,18 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
$xmlWriter->endElement(); // xsd:element
|
|
|
}
|
|
|
$xmlWriter->endElement(); // xsd:sequence
|
|
|
- $xmlWriter->h('xsd:attribute', ['name' => "instance", 'type' => $acl->getSourceName() . ":instanceType"], null);
|
|
|
+ if (!$simple) $xmlWriter->h('xsd:attribute', ['name' => "instance", 'type' => $acl->getSourceName() . ":instanceType"], null);
|
|
|
$xmlWriter->endElement(); // xsd:extension
|
|
|
$xmlWriter->endElement(); // xsd:complexContent
|
|
|
$xmlWriter->endElement(); // xsd:complexType
|
|
|
|
|
|
if (!$simple) {
|
|
|
- $xsdInstanceList = [];
|
|
|
- $xsdInstanceList[] = ['xsd:enumeration', ['value'=>$acl->getName()], null];
|
|
|
- if (method_exists($acl, 'getInstanceList')) {
|
|
|
- foreach ($acl->getInstanceList() as $instanceName) {
|
|
|
- $xsdInstanceList[] = ['xsd:enumeration', ['value'=>$instanceName], null];
|
|
|
- }
|
|
|
- }
|
|
|
+ $xsdInstanceList = (method_exists($acl, 'getInstanceList'))
|
|
|
+ ? array_map(function ($instanceName) {
|
|
|
+ return [ 'xsd:enumeration', ['value'=>$instanceName], null ];
|
|
|
+ }, $acl->getInstanceList())
|
|
|
+ : [ 'xsd:enumeration', ['value'=>$acl->getName()], null ]
|
|
|
+ ;
|
|
|
$xmlWriter->h('xsd:simpleType', ['name' => 'instanceType'], [
|
|
|
[ 'xsd:restriction', ['base' => 'xsd:string'], $xsdInstanceList ]
|
|
|
]);
|