a.binder 9 tahun lalu
induk
melakukan
6a534aaa3f

+ 31 - 4
SE/schema/default_db_xml_cache.public/object_modeling.xsl

@@ -21,7 +21,18 @@
     <xsl:template match="system_cache__appinfo:get_all_xsd_list" mode="system_cache__appinfo:new_object_by_prototype">
         <xsl:choose>
             <xsl:when test="$prototype_object_namespace and $new_object_namespace">
-                <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype"/>                
+                <xsl:variable name="system_cache__appinfo:new_object_by_prototype_test_if_prototype">
+                    <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype"/>
+                </xsl:variable>
+                <xsl:choose>
+                    <xsl:when test="$system_cache__appinfo:new_object_by_prototype_test_if_prototype/*">
+                        <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:message terminate="yes">#32 prototype <xsl:value-of select="$prototype_object_namespace"/> not exists in schema !  if it realy exiss consider rebuild procesy5_system_schema.xml !</xsl:message>
+                    </xsl:otherwise>
+                </xsl:choose>
+                                
             </xsl:when>
             <xsl:otherwise><xsl:message terminate="yes">#25 not set required $prototype_object_namespace and $new_object_namespace params!</xsl:message></xsl:otherwise>
         </xsl:choose>
@@ -31,6 +42,19 @@
         <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype"/>
     </xsl:template>
     
+    
+    <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="system_cache__appinfo:get_all_xsd">
+        <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype"/>
+    </xsl:template>
+    <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="schema[@targetNamespace=$prototype_object_namespace]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+        <system_cache__appinfo:new_object_by_prototype_test_if_prototype>exists_flag</system_cache__appinfo:new_object_by_prototype_test_if_prototype>
+    </xsl:template>
+    
+    <xsl:template mode="system_cache__appinfo:new_object_by_prototype_test_if_prototype" match="*|text()|comment()"/>
+        
+    
+    
+    
     <xsl:template mode="system_cache__appinfo:new_object_by_prototype" match="schema[@targetNamespace=$prototype_object_namespace]" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:variable name="prototype_TargetNamespaceBindings_from_Namespace">
             <xsl:call-template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
@@ -97,7 +121,7 @@
     
     
     
-    <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="element|complexType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
+    <xsl:template mode="system_cache__appinfo:new_object_by_prototype_schema_root" match="element|complexType|simpleType" xpath-default-namespace="http://www.w3.org/2001/XMLSchema">
         <xsl:param name="prototype_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="prototype_NamespacePrefix" required="yes"/>
@@ -107,7 +131,7 @@
                 <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
                 <xsl:with-param name="prototype_NamespacePrefix" select="$prototype_NamespacePrefix"/>
             </xsl:apply-templates>
-            <xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,8),'_', substring(replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable),0,5),'_',generate-id())"/>
+            <!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,8),'_', substring(replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,$new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable),0,5),'_',generate-id())"/>-->
             <!--<xsl:attribute name="name" select=" replace(@name,$prototype_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,'InfrastructureAAAA')"/>-->
             <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
                 <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
@@ -122,7 +146,7 @@
         <xsl:param name="new_TargetNamespaceBindings_from_Namespace" required="yes"/>
         <xsl:param name="prototype_NamespacePrefix" required="yes"/>
         <xsl:element name="{name()}">
-            <xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id())"/>
+            <!--<xsl:attribute name="id" select="concat(substring($new_TargetNamespaceBindings_from_Namespace//@NamespaceObjectInstanceTable,0,15),'_',generate-id())"/>-->
         <xsl:apply-templates mode="system_cache__appinfo:new_object_by_prototype_schema_child">
             <xsl:with-param name="prototype_TargetNamespaceBindings_from_Namespace" select="$prototype_TargetNamespaceBindings_from_Namespace"/>
             <xsl:with-param name="new_TargetNamespaceBindings_from_Namespace" select="$new_TargetNamespaceBindings_from_Namespace"/>
@@ -228,4 +252,7 @@
     
     
     
+    
+    
+    
 </xsl:stylesheet>

+ 11 - 0
SE/schema/default_db_xml_cache.public/system_cache__appinfo/TargetNamespaceBindings.xsl

@@ -12,6 +12,7 @@
     
     <xsl:template name="system_cache__appinfo:TargetNamespaceBindings_from_Namespace">
         <xsl:param name="TargetNamespace" required="yes"/> <!-- like   https://biuro.biall-net.pl/wfs/default_db/table/CRM_PROCES.xsd -->
+        <xsl:message>#15 $TargetNamespace=<xsl:value-of select="$TargetNamespace"/>; system_cache__appinfo:TargetNamespaceBindings_from_Namespace</xsl:message>
         <system_cache__appinfo:TargetNamespaceBindings_from_Namespace>
             <xsl:variable name="TargetNamespaceTokens" select="tokenize($TargetNamespace,'/')"/>
             <xsl:attribute name="NamespaceDatabaseStorageDefinitionPrefix" select="$TargetNamespaceTokens[ count($TargetNamespaceTokens)-2]"/>
@@ -28,6 +29,16 @@
     </xsl:template>
     
     
+    <xsl:template name="system_cache__appinfo:TargetNamespace_from_Bindings">
+        <xsl:param name="TargetNamespaceBindingsApi" required="yes"/> <!-- example https://biuro.biall-net.pl/wfs  -->
+        <xsl:param name="NamespaceDatabaseStorageDefinitionPrefix" required="yes"/> <!-- example default_db -->
+        <xsl:param name="NamespaceObjectInstanceType"  select="'table'"/> <!-- example table -->
+        <xsl:param name="NamespaceObjectInstanceTable" required="yes"/> <!-- example CRM_PROCES -->
+        <system_cache__appinfo:TargetNamespace_from_Bindings>
+            <xsl:attribute name="TargetNamespace" select="concat($TargetNamespaceBindingsApi,'/',$NamespaceDatabaseStorageDefinitionPrefix,'/', $NamespaceObjectInstanceType,'/',$NamespaceObjectInstanceTable,'.xsd' )"/>
+            <xsl:attribute name="Prefix" select="system_cache__appinfo:escape_object_prefix_to_string(concat($NamespaceDatabaseStorageDefinitionPrefix,':',$NamespaceObjectInstanceTable)  )"/>
+        </system_cache__appinfo:TargetNamespace_from_Bindings>
+    </xsl:template>
     
     <xsl:template name="system_cache__appinfo:TargetNamespaceBindings_to_Namespace">
         <xsl:param name="TargetNamespace" required="yes"/> <!-- like https://biuro.biall-net.pl/wfs -->