|
@@ -2,6 +2,10 @@
|
|
|
|
|
|
|
|
Lib::loadClass('Core_AclBase');
|
|
Lib::loadClass('Core_AclBase');
|
|
|
Lib::loadClass('SchemaException');
|
|
Lib::loadClass('SchemaException');
|
|
|
|
|
+Lib::loadClass('Typespecial');
|
|
|
|
|
+Lib::loadClass('ProcesHelper');
|
|
|
|
|
+Lib::loadClass('Schema_TableFactory');
|
|
|
|
|
+Lib::loadClass('DataSourceFactory');
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* $_SESSION['TableAcl_cache'][$tableID] = array(
|
|
* $_SESSION['TableAcl_cache'][$tableID] = array(
|
|
@@ -572,7 +576,6 @@ class TableAcl extends Core_AclBase {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Lib::loadClass('Typespecial');
|
|
|
|
|
$typeSpecial = Typespecial::getInstance($fieldID, $colName);
|
|
$typeSpecial = Typespecial::getInstance($fieldID, $colName);
|
|
|
if ($typeSpecial) {
|
|
if ($typeSpecial) {
|
|
|
throw new Exception("TODO: TypeSpecial");
|
|
throw new Exception("TODO: TypeSpecial");
|
|
@@ -615,7 +618,6 @@ class TableAcl extends Core_AclBase {
|
|
|
return $out;
|
|
return $out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Lib::loadClass('Typespecial');
|
|
|
|
|
$typeSpecial = Typespecial::getInstance($fieldID, $colName);
|
|
$typeSpecial = Typespecial::getInstance($fieldID, $colName);
|
|
|
|
|
|
|
|
$html = new stdClass();
|
|
$html = new stdClass();
|
|
@@ -903,7 +905,6 @@ class TableAcl extends Core_AclBase {
|
|
|
if (empty($tableConfig)) {
|
|
if (empty($tableConfig)) {
|
|
|
throw new Exception("Brak danych konfiguracyjnych do tabeli nr {$idTable} #TACL" . __LINE__);
|
|
throw new Exception("Brak danych konfiguracyjnych do tabeli nr {$idTable} #TACL" . __LINE__);
|
|
|
|
|
|
|
|
- Lib::loadClass('ProcesHelper');
|
|
|
|
|
$zasobObj = ProcesHelper::getZasobTableInfo($idTable);
|
|
$zasobObj = ProcesHelper::getZasobTableInfo($idTable);
|
|
|
if (!$zasobObj) {
|
|
if (!$zasobObj) {
|
|
|
return null;// TODO: throw new Exception("Zasob TABELA ID={$idTable} nie istnieje");
|
|
return null;// TODO: throw new Exception("Zasob TABELA ID={$idTable} nie istnieje");
|
|
@@ -940,7 +941,6 @@ class TableAcl extends Core_AclBase {
|
|
|
public function loadSchema() {
|
|
public function loadSchema() {
|
|
|
if ($this->_schemaLoaded) return;
|
|
if ($this->_schemaLoaded) return;
|
|
|
$srvName = $_SERVER['SERVER_NAME'];
|
|
$srvName = $_SERVER['SERVER_NAME'];
|
|
|
- Lib::loadClass('Schema_TableFactory');
|
|
|
|
|
$this->_schemaClass = Schema_TableFactory::build($this->_name, $this->_db, $srvName);
|
|
$this->_schemaClass = Schema_TableFactory::build($this->_name, $this->_db, $srvName);
|
|
|
$this->_schemaLoaded = true;
|
|
$this->_schemaLoaded = true;
|
|
|
}
|
|
}
|
|
@@ -1005,11 +1005,12 @@ class TableAcl extends Core_AclBase {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $fieldIds = array_keys($this->_fields);
|
|
|
|
|
- Lib::loadClass('Typespecial');
|
|
|
|
|
- $vColsIdList = Typespecial::initFields($fieldIds);
|
|
|
|
|
- if (!empty($vColsIdList)) {
|
|
|
|
|
- $this->_virtualFieldsIdList = $vColsIdList;
|
|
|
|
|
|
|
+ {// TODO: replace this by $this->_schemaClass (from DataSourceFactory::build(...))
|
|
|
|
|
+ $fieldIds = array_keys($this->_fields);
|
|
|
|
|
+ $vColsIdList = Typespecial::initFields($fieldIds);
|
|
|
|
|
+ if (!empty($vColsIdList)) {
|
|
|
|
|
+ $this->_virtualFieldsIdList = $vColsIdList;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1584,7 +1585,6 @@ class TableAcl extends Core_AclBase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private function _getDataSource($cols) {
|
|
private function _getDataSource($cols) {
|
|
|
- Lib::loadClass('DataSourceFactory');
|
|
|
|
|
$dsConfig = array();
|
|
$dsConfig = array();
|
|
|
$dsConfig['source_id'] = $this->getDB();
|
|
$dsConfig['source_id'] = $this->getDB();
|
|
|
$dsConfig['object_name'] = $this->getName();
|
|
$dsConfig['object_name'] = $this->getName();
|
|
@@ -1596,6 +1596,7 @@ class TableAcl extends Core_AclBase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getPrimaryKeyField() {
|
|
public function getPrimaryKeyField() {
|
|
|
|
|
+ // TODO: if ($this->_schemaClass) return $this->_schemaClass->getPrimaryKeyField();
|
|
|
$ds = $this->getDataSource();
|
|
$ds = $this->getDataSource();
|
|
|
return $ds->getPrimaryKeyField();
|
|
return $ds->getPrimaryKeyField();
|
|
|
}
|
|
}
|
|
@@ -1756,25 +1757,36 @@ class TableAcl extends Core_AclBase {
|
|
|
return $attributes;
|
|
return $attributes;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getXsdFieldType($fldName) {// @returns string - xsd type, TODO: throw Exception when field not found
|
|
|
|
|
|
|
+ public function getXsdFieldType($fieldName) {// @returns string - xsd type, TODO: throw Exception when field not found
|
|
|
|
|
+ if ($this->_schemaClass) {
|
|
|
|
|
+ $schemaType = $this->_schemaClass->getType($fieldName);
|
|
|
|
|
+ if ($schemaType) return $schemaType;
|
|
|
|
|
+ }
|
|
|
$fldType = 'xsd:string';
|
|
$fldType = 'xsd:string';
|
|
|
- if ('A_RECORD_UPDATE_DATE' == $fldName) return 'xsd:string';
|
|
|
|
|
- if ('A_RECORD_CREATE_DATE' == $fldName) return 'xsd:string';
|
|
|
|
|
- if ($this->isIntegerField($fldName)) return 'xsd:integer';
|
|
|
|
|
- else if ($this->isDecimalField($fldName)) return 'xsd:decimal';
|
|
|
|
|
- else if ($this->isDateField($fldName)) return 'xsd:date';
|
|
|
|
|
- else if ($this->isDateTimeField($fldName)) return 'xsd:dateTime';
|
|
|
|
|
- else if ($this->isGeomField($fldName)) {
|
|
|
|
|
|
|
+ if ('A_RECORD_UPDATE_DATE' == $fieldName) return 'xsd:string';
|
|
|
|
|
+ if ('A_RECORD_CREATE_DATE' == $fieldName) return 'xsd:string';
|
|
|
|
|
+ if ($this->isIntegerField($fieldName)) return 'xsd:integer';
|
|
|
|
|
+ else if ($this->isDecimalField($fieldName)) return 'xsd:decimal';
|
|
|
|
|
+ else if ($this->isDateField($fieldName)) return 'xsd:date';
|
|
|
|
|
+ else if ($this->isDateTimeField($fieldName)) return 'xsd:dateTime';
|
|
|
|
|
+ else if ($this->isGeomField($fieldName)) {
|
|
|
//$fldType = 'gml:GeometryPropertyType';
|
|
//$fldType = 'gml:GeometryPropertyType';
|
|
|
- $geomType = $this->getGeomFieldType($fldName);
|
|
|
|
|
|
|
+ $geomType = $this->getGeomFieldType($fieldName);
|
|
|
if ('polygon' == $geomType) return 'gml:PolygonPropertyType';
|
|
if ('polygon' == $geomType) return 'gml:PolygonPropertyType';
|
|
|
else if ('point' == $geomType) return 'gml:PointPropertyType';
|
|
else if ('point' == $geomType) return 'gml:PointPropertyType';
|
|
|
else if ('linestring' == $geomType) return 'gml:LineStringPropertyType';
|
|
else if ('linestring' == $geomType) return 'gml:LineStringPropertyType';
|
|
|
else return 'gml:GeometryPropertyType';
|
|
else return 'gml:GeometryPropertyType';
|
|
|
}
|
|
}
|
|
|
- else if ($this->isEnumerationField($fldName)) return 'xsd:string';
|
|
|
|
|
- else if ($this->isBinaryField($fldName)) return 'xsd:base64Binary';
|
|
|
|
|
|
|
+ else if ($this->isEnumerationField($fieldName)) return 'xsd:string';
|
|
|
|
|
+ else if ($this->isBinaryField($fieldName)) return 'xsd:base64Binary';
|
|
|
return $fldType;
|
|
return $fldType;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getXsdFieldParam($fieldName, $paramKey) {
|
|
|
|
|
+ return ($this->_schemaClass)
|
|
|
|
|
+ ? $this->_schemaClass->getFieldParam($fieldName, $paramKey)
|
|
|
|
|
+ : null
|
|
|
|
|
+ ;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|