소스 검색

updated table object Zaliczka

Piotr Labudda 9 년 전
부모
커밋
45be547967

+ 1 - 1
SE/schema/gui/company/biuro_biall_net_pl/get_object_list.php

@@ -4,6 +4,6 @@
 
 
 $objList = [];
-$objList[] = 'default_objects__x3A__Zaliczka:Zaliczka';
+$objList[] = 'default_db__x3A__ZALICZKA:Zaliczka';
 
 return $objList;

+ 1 - 1
SE/schema/gui/company/biuro_pro_netmedia_pl/get_object_list.php

@@ -4,6 +4,6 @@
 
 
 $objList = [];
-$objList[] = 'default_objects__x3A__Zaliczka:Zaliczka';
+$objList[] = 'default_db__x3A__ZALICZKA:Zaliczka';
 
 return $objList;

+ 1 - 0
SE/se-lib/Core/AclBase.php

@@ -18,6 +18,7 @@ class Core_AclBase {
   public function getName() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function getRootTableName() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function getXsdFieldType($fieldName) { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
+  public function getSimpleSchema() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   // TODO: get more xsd restrictions like minOccurs, maxOccurs, nillable and restrictions
 
   public function getID() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }// TODO: Legacy

+ 97 - 52
SE/se-lib/Core/AclHelper.php

@@ -47,53 +47,12 @@ class Core_AclHelper {// Helper class for Acl
     return self::getAclByNamespace(str_replace(':', '/', $typeName), $forceTblAclInit);
 	}
   public static function getAclByNamespace($namespace, $forceTblAclInit = false) {
-    if ('http' != substr($namespace, 0, 4)) $namespace = Api_WfsNs::getBaseWfsUri() . '/' . $namespace;//Request::getHostUri() . '/' . $namespace;
+    $ns = self::parseNamespaceUrl($namespace);
 
-    $baseNsUri = Api_WfsNs::getBaseWfsUri();
-    if ("{$baseNsUri}/" == substr($namespace, 0, strlen($baseNsUri) + 1)) {
-    	$schemaNs = substr($namespace, strlen($baseNsUri) + 1);
-    	$ns = explode('/', $schemaNs);// "http://biuro.biall-net.pl/wfs/  default_db/{$nazwa_tabeli}/{$nazwa_obj}
-    	$sourceName = array_shift($ns);// remove first element - source name
-      $objName = $ns[0];
-      if ('default_db' == $sourceName || 'p5_default_db' == $sourceName) {
-      	$sourceName = 'default_db';
-      	if (1 == count($ns)) {
-      		$acl = User::getAcl()->getObjectAcl($sourceName, $objName);
-      		if (!$acl) throw new Exception("Could not get acl for '{$schemaNs}'");
-      		$acl->init($forceTblAclInit);
-      		return $acl;
-      	} else if (2 == count($ns)) {
-
-          throw new Exception("TODO: default_db: '{$schemaNs}' ns:[ ".implode(", ", $ns)." ]", 501);
-      	} else throw new Exception("Nieznany namespace default_db: '{$schemaNs}'", 501);
-      }
-      else if ('default_objects' == $sourceName || 'SystemObjects' == $sourceName || 'p5_objects' == $sourceName) {
-      	$sourceName = 'objects';
-      	if (1 == count($ns)) {
-      		$acl = User::getAcl()->getObjectAcl($sourceName, $objName);
-      		if (!$acl) throw new Exception("Could not get acl for '{$schemaNs}'");
-      		$acl->init($forceTblAclInit);
-      		return $acl;
-      	} else throw new Exception("Nieznany namespace SystemObjects: '{$schemaNs}'", 501);
-      }
-      else if ('default_objects__x3A__' == substr($sourceName, 0, 22)) {// default_objects__x3A__Zaliczka:Zaliczka
-      	$sourceName = 'objects';
-      	if (1 == count($ns)) {
-      		$acl = User::getAcl()->getObjectAcl($sourceName, $objName);
-      		if (!$acl) throw new Exception("Could not get acl for '{$schemaNs}'");
-      		$acl->init($forceTblAclInit);
-      		return $acl;
-      	} else throw new Exception("Nieznany namespace SystemObjects: '{$schemaNs}'", 501);
-      }
-      else if ('zasob_' == substr($sourceName, 0, 6)) {
-      	$dbName = substr($sourceName, 6);
-      	throw new Exception("TODO db[{$dbName}] namespace '{$schemaNs}'", 501);
-      }
-      else throw new Exception("Nieznany namespace '{$schemaNs}'", 501);
-    }
-    else throw new HttpException("Zasoby zewnętrzenj systemu nie są jeszcze zaimplementowane", 501);
-
-		throw new HttpException("TODO L.".__LINE__." ns({$namespace})", 501);
+    $acl = User::getAcl()->getObjectAcl($ns['prefix'], $ns['name']);
+    if (!$acl) throw new Exception("Could not get acl for '{$schemaNs}'");
+    $acl->init($forceTblAclInit);
+    return $acl;
 	}
 
   public static function getMoreFunctionsCell($acl, $args) {
@@ -222,15 +181,15 @@ class Core_AclHelper {// Helper class for Acl
 
   public static function getAclList() {// @usage Core_AclHelper::getAclList();// @returns array [ $typeName , ... ]
     $aclList = array();
-    // Schema_AccessGroupStorageAcl, load by User::getAcl()->getObjectAcl('objects', $objName);
+    // Schema_AccessGroupStorageAcl, load by User::getAcl()->getObjectAcl('default_objects', $objName);
     //    $objClassName = "Schema_{$objName}StorageAcl";
     //    if (!Lib::tryLoadClass($objClassName)) throw new HttpException("Not implemented", 501);
     // $ grep -r 'class ' SE/se-lib/Schema/*Acl.php
-    // SE/se-lib/Schema/AccessGroupStorageAcl.php:class Schema_AccessGroupStorageAcl extends Core_AclBase {// Read only class
-    // SE/se-lib/Schema/AccessOwnerStorageAcl.php:class Schema_AccessOwnerStorageAcl extends Core_AclBase {
-    // SE/se-lib/Schema/FileStorageAcl.php:class Schema_FileStorageAcl extends Core_AclBase {
-    // SE/se-lib/Schema/KorespondencjaStorageAcl.php:class Schema_KorespondencjaStorageAcl extends Core_AclBase {
-    // SE/se-lib/Schema/TestPermsStorageAcl.php:class Schema_TestPermsStorageAcl extends Core_AclBase {
+    // SE/se-lib/Schema/AccessGroupStorageAcl.php:class Schema_AccessGroupStorageAcl extends Core_AclBase
+    // SE/se-lib/Schema/AccessOwnerStorageAcl.php:class Schema_AccessOwnerStorageAcl extends Core_AclBase
+    // SE/se-lib/Schema/FileStorageAcl.php:class Schema_FileStorageAcl extends Core_AclBase
+    // SE/se-lib/Schema/KorespondencjaStorageAcl.php:class Schema_KorespondencjaStorageAcl extends Core_AclBase
+    // SE/se-lib/Schema/TestPermsStorageAcl.php:class Schema_TestPermsStorageAcl extends Core_AclBase
     $aclList[] = 'default_objects:AccessGroupRead';
     $aclList[] = 'default_objects:AccessGroupWrite';
     $aclList[] = 'default_objects:AccessOwner';
@@ -254,4 +213,90 @@ class Core_AclHelper {// Helper class for Acl
     return $aclList;
   }
 
+  /**
+   * Parse namespace url into parts.
+   *
+   * @param $namespace - absolute or relative url
+   * @return array:
+   *   name: element name
+   *   url: url wihtout name
+   *   prefix: xml prefix
+   *   sourceName: used by engine - maybe to remove (used by Core_AclHelper::getAclByNamespace($namespace))
+   *
+   * @example - create xmlns attribute:
+   *    xmlns:{$ns['prefix']}="{$ns['url']}"
+   *
+   * @example - wfs typeName:
+   *    typeName = "{$ns['prefix']}:{$ns['name']}"
+   *
+   * @example 'default_db/TEST_PERMS' => Array:
+   *    [name] => TEST_PERMS
+   *    [prefix] => default_db
+   *    [url] => https://biuro.biall-net.pl/wfs/default_db
+   *    [sourceName] => default_db
+   *
+   * @example 'default_objects/AccessOwner' => Array:
+   *    [name] => AccessOwner
+   *    [prefix] => default_objects
+   *    [url] => https://biuro.biall-net.pl/wfs/default_objects
+   *    [sourceName] => default_objects
+   *
+   * @example 'default_db/ZALICZKA/Zaliczka' => Array:
+   *    [name] => Zaliczka
+   *    [prefix] => default_db__x3A__Zaliczka
+   *    [url] => https://biuro.biall-net.pl/wfs/default_db/ZALICZKA
+   *    [sourceName] => table_objects
+   *
+   */
+  public static function parseNamespaceUrl($namespace) {// returns assoc array: [ 'name', 'url', 'prefix', 'sourceName' ]
+    // TODO: the same algo like getAclByNamespace($namespace)
+    $baseNsUri = Api_WfsNs::getBaseWfsUri();
+    if ('http' != substr($namespace, 0, 4)) $namespace = "{$baseNsUri}/{$namespace}";//Request::getHostUri() . '/' . $namespace;
+
+    $nsUrl = $baseNsUri . '/' . '';
+    if ("{$baseNsUri}/" != substr($namespace, 0, strlen($baseNsUri) + 1)) throw new HttpException("Zasoby zewnętrzenj systemu nie są jeszcze zaimplementowane", 501);
+
+  	$relativeNsUrl = substr($namespace, strlen($baseNsUri) + 1);
+    // convert '__x3A__' to '/' in url
+  	$nsEx = explode('/', str_replace('__x3A__', '/', $relativeNsUrl));// "http://biuro.biall-net.pl/wfs/  default_db/{$nazwa_tabeli}/{$nazwa_obj}
+    // default_db__x3A__ZALICZKA/Zaliczka => default_db/ZALICZKA/Zaliczka
+    $sourceName = array_shift($nsEx);// remove first element - source name
+    $objName = array_pop($nsEx);// name is always last part from url
+
+    if ('default_db' == $sourceName || 'p5_default_db' == $sourceName) {
+      if (count($nsEx) > 1) throw new Exception("Nieznany namespace default_db: '{$relativeNsUrl}'", 501);
+
+    	$sourceName = 'default_db';
+      $nsPrefix = $sourceName;
+    	if (1 == count($nsEx)) {
+        $sourceName = 'table_objects';// TODO: another source name to read from simpleSchema @see Core_AclSimpleSchemaBase
+        $nsPrefix = 'default_db__x3A__' . $objName;
+      }
+      // $objName = $nsEx[1];// 'default_db/ZALICZKA:Zaliczka' => ('objects', 'Zaliczka') - possible name conflicts
+      $nsUrl = trim($baseNsUri . '/default_db/' . implode("/", $nsEx), '/');
+      return [ 'name' => $objName, 'prefix' => $nsPrefix, 'url' => $nsUrl, 'sourceName' => $sourceName ];
+    }
+    else if ('default_objects' == $sourceName || 'SystemObjects' == $sourceName) {
+      if (count($nsEx) > 1) throw new Exception("Nieznany namespace SystemObjects: '{$relativeNsUrl}'", 501);
+
+      $sourceName = 'default_objects';
+      $nsUrl = trim($baseNsUri . '/default_objects/' . implode("/", $nsEx), '/');
+      $nsPrefix = 'default_objects';
+  		return [ 'name' => $objName, 'prefix' => $nsPrefix, 'url' => $nsUrl, 'sourceName' => $sourceName ];
+    }
+    else if ('p5_objects' == $sourceName || 'objects' == $sourceName) {
+      if (count($nsEx) > 1) throw new Exception("Nieznany namespace SystemObjects: '{$relativeNsUrl}'", 501);
+
+      $sourceName = 'default_objects';
+      $nsUrl = trim($baseNsUri . '/default_objects/' . implode("/", $nsEx), '/');
+      $nsPrefix = 'default_objects';
+  		return [ 'name' => $objName, 'prefix' => $nsPrefix, 'url' => $nsUrl, 'sourceName' => $sourceName ];
+    }
+    else if ('zasob_' == substr($sourceName, 0, 6)) {
+    	$dbName = substr($sourceName, 6);// database id
+    	throw new Exception("TODO db[{$dbName}] namespace '{$relativeNsUrl}'", 501);
+    }
+    else throw new Exception("Nieznany namespace '{$relativeNsUrl}'", 501);
+  }
+
 }

+ 82 - 29
SE/se-lib/Core/AclSimpleSchemaBase.php

@@ -4,16 +4,95 @@ Lib::loadClass('Api_WfsNs');
 Lib::loadClass('Api_WfsException');
 Lib::loadClass('User');
 Lib::loadClass('Core_AclHelper');
+Lib::loadClass('Core_AclBase');
 
 class Core_AclSimpleSchemaBase extends Core_AclBase {
 
+  /** simpleSchema - php structure:
+
+    $simpleSchema = [
+      'root' => [
+        '@namespace' => 'default_db/ZALICZKA/Zaliczka',
+
+        'ID' => 'xsd:integer', // short syntax - define only simpleType
+
+        'KWOTA' => [ // long syntax - define type with another params like restrictions
+          '@type' => 'xsd:decimal'
+        ],
+
+        'worker' => 'ref:Worker' // short syntax - define only type = ref
+
+        'pozycja' => [ // long syntax - define ref with maxOccurs, TODO: use more xsd attributes
+          '@ref' => 'ZaliczkaPozycja',
+          '@maxOccurs' => 'unbounded'
+        ]
+      ],
+      'Worker' => [
+        '@namespace' => 'default_objects/AccessOwner',
+        ...
+      ],
+      'ZaliczkaPozycja' => [
+        '@namespace' => 'default_db/ZALICZKA_POZYCJA/ZaliczkaPozycja',
+        ...
+      ]
+    ]
+   */
   public $_simpleSchema = array();
-  public $_xsdTypes = null;
+  public $_xsdTypes = null;// set by parseXsdTypes()
+  public $_name = '';
+  public $_rootTableName = '';
+  public $_xmlnsMap = [];
+
+  public function __construct($simpleSchema = null) {
+    if ($simpleSchema) $this->_simpleSchema = $simpleSchema;
+
+    if (!$this->_simpleSchema) throw new Exception("Missing simpleSchema");
+    if (empty($this->_simpleSchema['root'])) throw new Exception("Wrong simpleSchema syntax");
+    if (empty($this->_simpleSchema['root']['@namespace'])) throw new Exception("Missing @namespace in simpleSchema");
+    $ns = explode('/', $this->_simpleSchema['root']['@namespace']);
+    $this->_name = end($ns);
+    if (count($ns) < 2) throw new Exception("Wrong @namespace syntax in simpleSchema");
+    $this->_rootTableName = $ns[1];
+
+    // $this->parseXsdTypes();// parse xsdTypes
+    $this->_xsdTypes = array();
+    {
+      $generatedIdZasob = 10000;// fake zasob id
+      foreach ($this->_simpleSchema['root'] as $key => $value) {
+        if ('@' == substr($key, 0, 1)) continue;// skip attributes
+        if (is_array($value)) {
+          $fieldName = $key;
+          $field = [ 'name' => $fieldName, 'perms' => '', 'idZasob' => $generatedIdZasob ];
+
+          if (!empty($value['@type'])) $field['xsdType'] = "{$value['@type']}";
+          else if (!empty($value['@ref'])) $field['xsdType'] = "ref:{$value['@ref']}";
+          else throw new Exception("StorageAcl - field type not defined '{$key}'");
+
+          if (!empty($value['@maxOccurs'])) $field['maxOccurs'] = $value['@maxOccurs'];
+          $this->_xsdTypes[$fieldName] = $field;
+        } else if (is_scalar($value)) {// short syntax: $fieldName => $xsdType
+          $fieldName = $key;
+          $field = [ 'name' => $fieldName, 'perms' => '', 'idZasob' => $generatedIdZasob ];
+          $field['xsdType'] = $value;
+          $this->_xsdTypes[$fieldName] = $field;
+        } else {
+          throw new Exception("StorageAcl - TODO: Unimplemented value type in simpleSchema: " . json_encode($value));
+        }
+        $generatedIdZasob++;
+      }
+    }
+
+    // TODO: fix 'ref:*' types - use Core_AclHelper::parseNamespaceUrl($namespace)
+
+  }
 
   public function getSimpleSchema() { return $this->_simpleSchema; }
+  public function getName() { return $this->_name; }
+  public function getRootTableName() { $this->_rootTableName; }
+  public function getXsdTypes() { return $this->_xsdTypes; }
 
-  public function getNamespace() { return 'default_objects/' . $this->getName(); }
-  public function getSourceName() { return 'default_objects'; }
+  public function getNamespace() { return 'default_db/' . $this->_rootTableName . '/' . $this->_name; }
+  public function getSourceName() { return 'default_db__x3A__' . $this->_rootTableName; }
   public function init($force = false) {}
   public function isInitialized() { return true; }
   public function getFieldListByIdZasob() { return $this->getRealFieldListByIdZasob(); }
@@ -26,32 +105,6 @@ class Core_AclSimpleSchemaBase extends Core_AclBase {
     }
     return $cols;
   }
-  public function getXsdTypes() {
-    if (null !== $this->_xsdTypes) return $this->_xsdTypes;
-    $this->_xsdTypes = array();
-    $generatedIdZasob = 10000;
-    foreach ($this->_simpleSchema as $key => $value) {
-      if ('@' == substr($key, 0, 1)) continue;// skip attributes
-      if (is_array($value)) {
-        $fieldName = $key;
-        $field = [ 'name' => $fieldName, 'perms' => 'R', 'idZasob' => $generatedIdZasob ];
-        if (!empty($value['@baseTypeName'])) $field['xsdType'] = "alias_ref:{$value['@baseTypeName']}";
-        else if (!empty($value['@ref'])) $field['xsdType'] = "alias_ref:{$value['@ref']}";
-        else throw new Exception("StorageAcl - field type not defined '{$key}'");
-        if (!empty($value['@maxOccurs'])) $field['maxOccurs'] = $value['@maxOccurs'];
-        $this->_xsdTypes[$fieldName] = $field;
-      } else if (is_scalar($value)) {
-        $fieldName = $key;
-        $field = [ 'name' => $fieldName, 'perms' => 'R', 'idZasob' => $generatedIdZasob ];
-        $field['xsdType'] = $value;
-        $this->_xsdTypes[$fieldName] = $field;
-      } else {
-        throw new Exception("StorageAcl - TODO: Unimplemented value type in simpleSchema: " . json_encode($value));
-      }
-      $generatedIdZasob++;
-    }
-    return $this->_xsdTypes;
-  }
   public function getFields() {// @returns array - $this->_fields
     $fieldsById = array();
     foreach ($this->getXsdTypes() as $fieldName => $field) {

+ 1 - 1
SE/se-lib/Route/UrlAction/UserProNetMediaZaliczka.php

@@ -38,7 +38,7 @@ class Route_UrlAction_UserProNetMediaZaliczka extends RouteBase {// TODO: UrlAct
 		UI::tag('div', ['id'=>"zaliczka-app", 'data-dbg'=>V::get('DBG', '', $_GET), 'data-sync-js-function'=>"syncZaliczkaState", 'data-fetch-data-js-function'=>"zaliczkaFetchData"]);
 		UI::emptyTag('br');
 
-		$acl = Core_AclHelper::getAclByNamespace("default_objects/zaliczka");//User::getAcl()->getObjectAcl();
+		$acl = Core_AclHelper::getAclByNamespace("default_db/ZALICZKA/Zaliczka");//User::getAcl()->getObjectAcl();
 		$schema = $this->getSchema();//$acl->getSimpleSchema();
 		$zaliczkaData = $this->fetchDataBySchema($schema, $idUser);
 

+ 53 - 27
SE/se-lib/Schema/DefaultDb/zaliczka/ZaliczkaStorageAcl.php

@@ -4,37 +4,63 @@ Lib::loadClass('Core_AclSimpleSchemaBase');// extends Core_AclBase
 Lib::loadClass('Core_AclHelper');
 Lib::loadClass('FileStorage');
 
-class Schema_ZaliczkaStorageAcl extends Core_AclSimpleSchemaBase {
+class Schema_DefaultDb_zaliczka_ZaliczkaStorageAcl extends Core_AclSimpleSchemaBase {
 
   public $_simpleSchema = [
-    '@typeName' => 'default_objects:Zaliczka',
-    '@baseTypeName' => 'default_db:ZALICZKA',
-    'id' => 'xsd:integer',
-    'created' => 'xsd:date',
-    'worker' => [
-      '@ref' => 'default_objects:AccessOwner',// local_ref:default_objects:AccessOwner
+    'root' => [
+      '@namespace' => 'default_db/ZALICZKA/Zaliczka',// Api_WfsNs::getBaseWfsUri() . '/default_db/Zaliczka'
+      'id' => 'xsd:integer',
+      'created' => 'xsd:date',
+      'worker' => 'ref:default_objects/AccessOwner',// TODO: 'alias_ref:default_objects:AccessOwner'
+      'kwota' => 'xsd:decimal',
+      'pozycja' => [ '@ref' => 'ZaliczkaPozycja', '@maxOccurs' => 'unbounded' ]
     ],
-    'kwota' => 'xsd:decimal',
-    'pozycja' => [
-      '@ref' => 'default_objects:ZaliczkaPozycja',
-      '@maxOccurs' => 'unbounded',
-      // 'id' => 'xsd:integer',
-      // 'kwota' => 'xsd:decimal',
-      // 'korespondencja' => [// 'ref:korespondencja'
-      // 	'@baseTypeName' => 'default_db:IN7_DZIENNIK_KORESP',
-      // 	'id' => 'xsd:integer',
-      // 	'title' => 'xsd:string',
-      // 	'kategoriaKosztu' => 'xsd:string'
-      // ],
-      // 'projekt' => [// 'ref:projekt'
-      // 	'@baseTypeName' => 'default_db:IN7_MK_BAZA_DYSTRYBUCJI',
-      // 	'id' => 'xsd:integer',
-      // 	'nrBudowy' => 'xsd:string'
-      // ]
+    'ZaliczkaPozycja' => [
+      '@namespace' => 'default_db/ZALICZKA_POZYCJA/ZaliczkaPozycja',// Api_WfsNs::getBaseWfsUri() . '/default_db/Zaliczka'
+      'id' => 'xsd:integer',
+      'kwota' => 'xsd:decimal',
+      'korespondencja' => [ '@ref' => 'Korespondencja' ],
+      'projekt' => [ '@ref' => 'Projekt' ]
+    ],
+    'Korespondencja' => [
+      '@namespace' => 'default_db/IN7_DZIENNIK_KORESP',
+      'id' => 'xsd:integer',
+      'title' => 'xsd:string',
+      'kategoriaKosztu' => 'xsd:string'
+    ],
+    'Projekt' => [
+      '@namespace' => 'default_db/IN7_MK_BAZA_DYSTRYBUCJI',
+      'id' => 'xsd:integer',
+      'nrBudowy' => 'xsd:string'
     ]
   ];
-
-  public function getName() { return 'Zaliczka'; }
-  public function getRootTableName() { return 'ZALICZKA'; }
+  // [
+  //   '@typeName' => 'default_db__x3A__ZALICZKA:Zaliczka',
+  //   '@baseTypeName' => 'default_db:ZALICZKA',
+  //   '@namespace' => 'default_db/ZALICZKA/Zaliczka',// Api_WfsNs::getBaseWfsUri() . '/default_db/Zaliczka'
+  //   'id' => 'xsd:integer',
+  //   'created' => 'xsd:date',
+  //   'worker' => [
+  //     '@namespace' => 'default_objects/AccessOwner',// alias_ref:default_objects:AccessOwner
+  //   ],
+  //   'kwota' => 'xsd:decimal',
+  //   'pozycja' => [
+  //     '@namespace' => 'default_db/ZALICZKA_POZYCJA/ZaliczkaPozycja',// alias_ref:default_db__x3A__ZALICZKA_POZYCJA:ZaliczkaPozycja
+  //     '@maxOccurs' => 'unbounded',
+  //     // 'id' => 'xsd:integer',
+  //     // 'kwota' => 'xsd:decimal',
+  //     // 'korespondencja' => [// 'ref:korespondencja'
+  //     // 	'@baseTypeName' => 'default_db:IN7_DZIENNIK_KORESP',
+  //     // 	'id' => 'xsd:integer',
+  //     // 	'title' => 'xsd:string',
+  //     // 	'kategoriaKosztu' => 'xsd:string'
+  //     // ],
+  //     // 'projekt' => [// 'ref:projekt'
+  //     // 	'@baseTypeName' => 'default_db:IN7_MK_BAZA_DYSTRYBUCJI',
+  //     // 	'id' => 'xsd:integer',
+  //     // 	'nrBudowy' => 'xsd:string'
+  //     // ]
+  //   ]
+  // ];
 
 }

+ 6 - 1
SE/se-lib/UserAcl.php

@@ -155,7 +155,7 @@ class UserAcl {
 		return $urls;
 	}
 
-	public function getObjectAcl($sourceName, $objName) {
+	public function getObjectAcl($sourceName, $objName) {// TODO: rename $sourceName to $prefix (xml namespace - @see Core_AclHelper)
 		if ('default_db' == $sourceName) {
 			$zasobTblInfo = ProcesHelper::getZasobTableInfoByUri("{$sourceName}/{$objName}");
 			if (!$zasobTblInfo) throw new HttpException("Object not Found '{$objName}'", 404);
@@ -170,6 +170,11 @@ class UserAcl {
 			$objClassName = "Schema_{$objName}StorageAcl";
 			if (!Lib::tryLoadClass($objClassName)) throw new HttpException("Not implemented", 501);
 			return new $objClassName();
+		} else if ('default_db__x3A__' == substr($sourceName, 0, 17) && !empty($objName)) {
+			$rootTableName = strtolower(substr($sourceName, 17));
+			$objClassName = "Schema_DefaultDb_{$rootTableName}_{$objName}StorageAcl";// TODO: load by Factory class which build from schema file
+			if (!Lib::tryLoadClass($objClassName)) throw new HttpException("Not implemented", 501);
+			return new $objClassName();
 		} else throw new HttpException("Not Implemented", 501);
 		return false;
 	}