|
@@ -401,6 +401,7 @@ class Api_WfsServerBase {
|
|
|
$tblName = $tblAcl->getName();
|
|
$tblName = $tblAcl->getName();
|
|
|
$usrObjList[] = array($dataSourceName, $tblName);
|
|
$usrObjList[] = array($dataSourceName, $tblName);
|
|
|
}
|
|
}
|
|
|
|
|
+ $usrObjList[] = array('objects', 'File');
|
|
|
return $usrObjList;
|
|
return $usrObjList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -740,7 +741,7 @@ if($DBG){echo 'L.' . __LINE__ . ' $convertedTransaction:';print_r($convertedTran
|
|
|
// {"tag":"PARENT_ID","type":"complete","level":3,"value":"0"},
|
|
// {"tag":"PARENT_ID","type":"complete","level":3,"value":"0"},
|
|
|
// {"tag":"Update","type":"close","level":2},
|
|
// {"tag":"Update","type":"close","level":2},
|
|
|
// {"tag":"Transaction","type":"close","level":1}]
|
|
// {"tag":"Transaction","type":"close","level":1}]
|
|
|
- if($DBG){echo "\nTODO: tags L." . __LINE__ . ":\n"; print_r($tags);echo "\n";}
|
|
|
|
|
|
|
+ if($DBG){echo "\ntags L." . __LINE__ . ":\n"; print_r($tags);echo "\n";}
|
|
|
$actionTag = null;
|
|
$actionTag = null;
|
|
|
$prevTagName = '';
|
|
$prevTagName = '';
|
|
|
$theGeomField = 'the_geom';// TODO: get the geom field name from acl
|
|
$theGeomField = 'the_geom';// TODO: get the geom field name from acl
|
|
@@ -755,11 +756,19 @@ if($DBG){echo 'L.' . __LINE__ . ' $convertedTransaction:';print_r($convertedTran
|
|
|
if ('open' == $tag['type'] // Insert, Update
|
|
if ('open' == $tag['type'] // Insert, Update
|
|
|
|| 'complete' == $tag['type'] // Delete
|
|
|| 'complete' == $tag['type'] // Delete
|
|
|
) {
|
|
) {
|
|
|
|
|
+ if($DBG){echo "\ntags loop 1 - tag: L." . __LINE__ . ":\n"; print_r($tag);echo "\n";}
|
|
|
$actionTag = array();
|
|
$actionTag = array();
|
|
|
$actionTag['tag'] = substr($tag['tag'], 0, 6);
|
|
$actionTag['tag'] = substr($tag['tag'], 0, 6);
|
|
|
$actionTag['typeName'] = $tag['attributes']['typeName'];
|
|
$actionTag['typeName'] = $tag['attributes']['typeName'];
|
|
|
if ('Insert' == substr($tag['tag'], 0, 6)) {
|
|
if ('Insert' == substr($tag['tag'], 0, 6)) {
|
|
|
- $actionTag['typeName'] = "p5_default_db:{$actionTag['typeName']}";
|
|
|
|
|
|
|
+ $typeNsPrefix = 'p5_default_db';
|
|
|
|
|
+ if (!empty($tag['attributes']['typeNsUri'])) {
|
|
|
|
|
+ $baseNsUri = $this->getBaseNamespaceUri();
|
|
|
|
|
+ if ("{$baseNsUri}/objects" == $tag['attributes']['typeNsUri']) {
|
|
|
|
|
+ $typeNsPrefix = 'p5_objects';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $actionTag['typeName'] = "{$typeNsPrefix}:{$tag['attributes']['typeName']}";
|
|
|
}
|
|
}
|
|
|
$featureEx = explode('.', $tag['attributes']['featureId'], 2);
|
|
$featureEx = explode('.', $tag['attributes']['featureId'], 2);
|
|
|
$actionTag['featureId'] = $featureEx[1];
|
|
$actionTag['featureId'] = $featureEx[1];
|
|
@@ -782,6 +791,7 @@ if($DBG){echo 'L.' . __LINE__ . ' $convertedTransaction:';print_r($convertedTran
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
default: {// fields
|
|
default: {// fields
|
|
|
|
|
+ if($DBG){echo "\ntags loop 2 - tag: L." . __LINE__ . ":\n"; print_r($tag);echo "\n";}
|
|
|
if (3 != $tag['level'] && 'close' == $tag['type']) {
|
|
if (3 != $tag['level'] && 'close' == $tag['type']) {
|
|
|
$actionTag = null;
|
|
$actionTag = null;
|
|
|
}
|
|
}
|
|
@@ -814,7 +824,7 @@ if($DBG){echo 'L.' . __LINE__ . ' $convertedTransaction:';print_r($convertedTran
|
|
|
$changesList = array();
|
|
$changesList = array();
|
|
|
if (!empty($itemPatchs)) {
|
|
if (!empty($itemPatchs)) {
|
|
|
foreach ($itemPatchs as $itemPatchInfo) {
|
|
foreach ($itemPatchs as $itemPatchInfo) {
|
|
|
- if($DBG){echo "L." . __LINE__ . " itemPatchInfo['itemPatch']:\n";print_r($itemPatchInfo['itemPatch']);}
|
|
|
|
|
|
|
+ if($DBG){echo "L." . __LINE__ . " itemPatchInfo: {typeName:'{$itemPatchInfo['typeName']}'}:\n";print_r($itemPatchInfo);}
|
|
|
$acl = $this->getAclFromTypeName($itemPatchInfo['typeName']);
|
|
$acl = $this->getAclFromTypeName($itemPatchInfo['typeName']);
|
|
|
if ('Delete' == $itemPatchInfo['tag']) {
|
|
if ('Delete' == $itemPatchInfo['tag']) {
|
|
|
$itemPatch = array();
|
|
$itemPatch = array();
|
|
@@ -933,6 +943,7 @@ if($DBG){echo 'L.' . __LINE__ . ' sourceNsList:';print_r($sourceNsList);echo "\n
|
|
|
// <Update>
|
|
// <Update>
|
|
|
$theGeomField = 'the_geom';// TODO: get from fields list
|
|
$theGeomField = 'the_geom';// TODO: get from fields list
|
|
|
$typeName = "p5_{$sourceNs[0]}:{$sourceNs[1]}";
|
|
$typeName = "p5_{$sourceNs[0]}:{$sourceNs[1]}";
|
|
|
|
|
+ if($DBG){echo 'L.' . __LINE__ . ' typeName:';print_r($typeName);echo "\n";}
|
|
|
$updateElementName = "UpdateNs{$nsInd}";
|
|
$updateElementName = "UpdateNs{$nsInd}";
|
|
|
$geomCoordsUpdateXpath = "//wfs:Value/*/gml:outerBoundaryIs/gml:LinearRing/gml:coordinates";
|
|
$geomCoordsUpdateXpath = "//wfs:Value/*/gml:outerBoundaryIs/gml:LinearRing/gml:coordinates";
|
|
|
$geomCoordsInsertXpath = "//*/gml:outerBoundaryIs/gml:LinearRing/gml:coordinates";
|
|
$geomCoordsInsertXpath = "//*/gml:outerBoundaryIs/gml:LinearRing/gml:coordinates";
|
|
@@ -978,6 +989,7 @@ EOF;
|
|
|
<xsl:when test="local-name() = '{$typeName}'">
|
|
<xsl:when test="local-name() = '{$typeName}'">
|
|
|
<xsl:element name="{$insertElementName}">
|
|
<xsl:element name="{$insertElementName}">
|
|
|
<xsl:attribute name="typeName"><xsl:value-of select="local-name()" /></xsl:attribute>
|
|
<xsl:attribute name="typeName"><xsl:value-of select="local-name()" /></xsl:attribute>
|
|
|
|
|
+ <xsl:attribute name="typeNsUri"><xsl:value-of select="namespace-uri()" /></xsl:attribute>
|
|
|
<xsl:for-each select="*">
|
|
<xsl:for-each select="*">
|
|
|
<xsl:element name="{local-name()}">
|
|
<xsl:element name="{local-name()}">
|
|
|
<xsl:choose>
|
|
<xsl:choose>
|
|
@@ -1161,6 +1173,7 @@ if($DBG){echo 'L.' . __LINE__ . ' sourceNsList:';print_r($sourceNsList);echo "\n
|
|
|
$transactionTypesList[] = 'Insert';
|
|
$transactionTypesList[] = 'Insert';
|
|
|
foreach ($transactionTypesList as $transactionType) {
|
|
foreach ($transactionTypesList as $transactionType) {
|
|
|
$typeName = "p5_{$sourceNs[0]}:{$sourceNs[1]}";
|
|
$typeName = "p5_{$sourceNs[0]}:{$sourceNs[1]}";
|
|
|
|
|
+ if($DBG){echo 'L.' . __LINE__ . ' TODO: get acl typeName:';print_r($typeName);echo "\n";}
|
|
|
$acl = $this->getAclFromTypeName($typeName);
|
|
$acl = $this->getAclFromTypeName($typeName);
|
|
|
$updateElementName = "{$transactionType}Ns{$nsInd}";
|
|
$updateElementName = "{$transactionType}Ns{$nsInd}";
|
|
|
$updateElementType = "{$transactionType}Ns{$nsInd}ElementType";
|
|
$updateElementType = "{$transactionType}Ns{$nsInd}ElementType";
|
|
@@ -1227,6 +1240,9 @@ if($DBG){echo 'L.' . __LINE__ . ' sourceNsList:';print_r($sourceNsList);echo "\n
|
|
|
$elNode->appendChild($simpleTypeNode);
|
|
$elNode->appendChild($simpleTypeNode);
|
|
|
// continue;// TODO: ? below added nillable = true, minOccurs = 0, type = $fldType
|
|
// continue;// TODO: ? below added nillable = true, minOccurs = 0, type = $fldType
|
|
|
}
|
|
}
|
|
|
|
|
+ else if ($acl->isBinaryField($fldName)) {
|
|
|
|
|
+ $fldType = 'xsd:base64Binary';
|
|
|
|
|
+ }
|
|
|
else {
|
|
else {
|
|
|
$fldType = 'xsd:string';
|
|
$fldType = 'xsd:string';
|
|
|
}
|
|
}
|
|
@@ -1291,6 +1307,13 @@ if($DBG){echo 'L.' . __LINE__ . ' sourceNsList:';print_r($sourceNsList);echo "\n
|
|
|
$attrNode->setAttribute('type', 'xsd:token');
|
|
$attrNode->setAttribute('type', 'xsd:token');
|
|
|
$attrNode->setAttribute('use', 'required');
|
|
$attrNode->setAttribute('use', 'required');
|
|
|
|
|
|
|
|
|
|
+ if ($transactionType == 'Insert') {
|
|
|
|
|
+ $attrNode = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:attribute');
|
|
|
|
|
+ $updateTypeNode->appendChild($attrNode);
|
|
|
|
|
+ $attrNode->setAttribute('name', 'typeNsUri');
|
|
|
|
|
+ $attrNode->setAttribute('type', 'xsd:anyURI');
|
|
|
|
|
+ $attrNode->setAttribute('use', 'required');
|
|
|
|
|
+ }
|
|
|
if ($transactionType == 'Update') {
|
|
if ($transactionType == 'Update') {
|
|
|
$attrNode = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:attribute');
|
|
$attrNode = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:attribute');
|
|
|
$updateTypeNode->appendChild($attrNode);
|
|
$updateTypeNode->appendChild($attrNode);
|