ソースを参照

fix druki merged part from schema

a.binder 8 年 前
コミット
18676a2c03

+ 79 - 8
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -80,6 +80,8 @@
     <xsl:param name="get_wfs" required="yes"/>
     <xsl:param name="debug_xsl_out_filename" required="yes" />  
     <xsl:param name="debug" select="1"/>
+    <xsl:param name="typeNameRoot" required="yes"/><!-- to cache purpose - to allow child elements cache created to be named from this typeNameRoot -->
+    <xsl:param name="input_obj_fid_forced"/><!-- to force by build_root.xml (loop) -->
     <!--<xsl:variable name="temp_current">
         <xsl:choose>
             <xsl:when test="$temp='temp'">
@@ -129,6 +131,24 @@
         <xsl:param name="loop_path_recurs"  select="$loop_path_recurs"/> <!-- przekazany z RelatedFeatureLoop z mode="after_first_ant_assing_vars_childs"  -->
         <xsl:param name="loop_path_recurs_xpath" select="concat($loop_path_recurs_xpath,'/',@typeName,'[',$feature_pos,']')"/> <!-- todo do querowania filtrem do zbudowania sciezka obiektu xpath -->
         <xsl:param name="feature_pos_parent" select="1"/> <!-- @2017-04 bledy z nadpisywaniem dodajemy zapis do przetwarzania na $temp}/{$uuid}.build_{$loop_xpath}.{$feature_pos_parent}.{$feature_pos}.xml  -->
+        <xsl:param name="input_obj_fid">
+            <empty/>
+        </xsl:param>
+        
+        <!--<xsl:variable name="input_obj_fid">
+            <xsl:choose>
+                <xsl:when test="$input_obj_fid/@fid">
+                    <xsl:copy-of select="$input_obj_fid"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <empty>
+                        <xsl:attribute name="fid" select="$input_obj_fid_forced"/>
+                    </empty>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>-->
+        
+         <!-- powinien byc nadany z after_first_ant_assign_vars/... ale moze nie za pierwszym razem -->
         <xsl:choose>
             <xsl:when test="name()='RelatedFeature'">
                 <xsl:variable name="RelatedFeatureCount" select="last()"/>
@@ -284,7 +304,10 @@
                     <property name="feature_pos_parent" value="{$feature_pos_parent}"/>
                     <property name="parallel_pos" value="{$parallel_pos}"/>
                     <property name="get_wfs" location="{$get_wfs}"/>
-                    
+                    <property name="default_db:recurse_ant_basedir.recurse_cache" location="{$recurse_ant_basedir.recurse_cache}"/>
+                    <property name="build_recurse_ant_cache_control.xsl" value="{$build_recurse_ant_cache_control.xsl}"/>
+                    <property name="typeNameRoot" value="{$typeNameRoot}"/>
+                    <property name="input_obj_fid_forced" value="{$input_obj_fid/@fid}"/>
                     <xsl:comment>
                         #224 Important variables:
                         typeName=<xsl:value-of select="$typeName"/>;
@@ -304,6 +327,9 @@
                         $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
                         $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
                         $loop_path_recurs = <xsl:value-of select="$loop_path_recurs"/> ;
+                        $typeNameRoot = <xsl:value-of select="$typeNameRoot"/> ;
+                        $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
+                        $input_obj_fid_forced = <xsl:value-of select="$input_obj_fid_forced"/> ; was renamed to <xsl:value-of select="$input_obj_fid/@fid"/>
                     </xsl:comment>
                     <tempfile suffix=".xml" destdir="{$process_locks}" deleteonexit="yes" createfile="yes" prefix="RelatedFeature_{@xml_id}_{$featureID_name_dita}_{$feature_pos_parent}_{$feature_pos}">
                         <xsl:attribute name="property" select="concat('builds_to_ant_lock_proj',$loop_path_recurs,$loop_xpath)"/>
@@ -312,6 +338,9 @@
                     
                     <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
                     <xsl:if test="$debug &gt; 1"><echo> #302 waliduje xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>; </echo></xsl:if>
+                    
+                    
+                    
                     <target name="get_related_feature_run_child_ant_check{$loop_xpath_real}">
                         
                         <mkdir dir="{$temp}/{$loop_xpath}"/>
@@ -427,7 +456,7 @@
                         <xsl:with-param name="typeNameRealResource" select="$typeNameRealResource"/>
                         <xsl:with-param name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/>
                         <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/> <!-- @2017-04 dodanie do przetwarzania result-document href="{$temp}/{@xml_id}.{$uuid}.{$feature_pos}/build_root.xml -->
-                        
+                        <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
                     </xsl:apply-templates>
                     <!-- na koniec przetwarzania kazdego z wezlow, podmieniamy xsl biezacy wezel -->
                     
@@ -531,7 +560,7 @@
                 <xsl:variable name="loop_xpath_real" select="$loop_xpath"/>
                 <xsl:variable name="loop_xpath">
                     <xsl:choose>
-                        <xsl:when test="$loop_xpath='root'">
+                        <xsl:when test="$loop_xpath='root'"> 
                             <!--bylo <xsl:value-of select="concat($loop_xpath,'_x2f_.',@xml_id,'.',$featureID_name)"/>-->
                             <xsl:value-of select="concat($loop_xpath,'/',@xml_id,'.',$feature_pos)"/> <!-- loop path too long ,'.',$featureID_name -->
                         </xsl:when>
@@ -582,6 +611,8 @@
                         $debug_xsl_in_filename = <xsl:value-of select="$debug_xsl_in_filename"/> ;
                         $debug_xsl_out_filename = <xsl:value-of select="$debug_xsl_out_filename"/> ;
                         $parallel_pos = <xsl:value-of select="$parallel_pos"/> ;
+                        $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
+                        $input_obj_fid_forced = <xsl:value-of select="$input_obj_fid_forced"/> ;
                 </xsl:comment>
                 
                 
@@ -677,7 +708,7 @@
                     
                     
                     <!--bylo przed @2017-04 - poprawiam bo sie zapetla niepotrzebnie - tempa doklei wyzwolony ant do ${default_db:recurse_ant_basedir.temp}${loop_path_recurs}-->
-                        <xsl:element name="property">
+                    <xsl:element name="property">
                         <xsl:attribute name="name" select="'temp'"/>
                         <xsl:attribute name="value" select="concat($recurse_ant_basedir.temp,$loop_path_recurs)"/>
                     </xsl:element>
@@ -693,6 +724,11 @@
                     <property name="parallel_pos" value="{$parallel_pos}"/>
                     <property name="process_locks" value="{$process_locks}"/>
                     <property name="get_wfs" location="{$get_wfs}"/>
+                    <property name="default_db:recurse_ant_basedir.recurse_cache" location="{$recurse_ant_basedir.recurse_cache}"/>
+                    <property name="build_recurse_ant_cache_control.xsl" value="{$build_recurse_ant_cache_control.xsl}"/>
+                    <property name="typeNameRoot" value="{$typeNameRoot}"/>
+                    <property name="input_obj_fid_forced" value="{$input_obj_fid/@fid}"/>
+                    
                     <xsl:comment>
                         #555 Important variables:
                         typeName=<xsl:value-of select="$typeName"/>;
@@ -1188,7 +1224,8 @@
         <xsl:param name="loop_path_recurs_xpath" required="yes"/>
         <xsl:param name="feature_pos_parent" required="yes"/> <!-- todo fixing conflict from parent leaf  -->
         <xsl:param name="feature_pos" required="yes"/>
-        <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
+        <xsl:param name="input_obj_fid" required="yes"/>
+        <xsl:param name="typeName_dita" required="yes"/>
         <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
         <!-- wygenerujemy liste ant -->
         
@@ -1204,7 +1241,8 @@
                 $ loop_xpath_real = <xsl:value-of select="$loop_xpath_real"/> ;
                 $ przy FeatureLoop przy zapisie w (_1598 RelatedFeatureLoop  jest okazja do zrobienia bilda  /build_root.xml) $feature_pos_parent przechodzi w $feature_pos TUTAJ!
                 $ $temp = <xsl:value-of select="$temp"/> ;
-                $ position()= <xsl:value-of select="position()"/> ; $parallel_pos=<xsl:value-of select="$parallel_pos"/>;  ($)parallel_pos=${parallel_pos} ; 
+                $ position()= <xsl:value-of select="position()"/> ; $parallel_pos=<xsl:value-of select="$parallel_pos"/>;  ($)parallel_pos=${parallel_pos} ;
+                $ $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
             </echo></xsl:if>
             <xsl:if test="$debug &gt; 2"><xsl:message>#591 todo executing by exec instead of ant without inheritAll because it's looping!!! </xsl:message></xsl:if>
             
@@ -1387,7 +1425,7 @@
                     <attribute name="http://saxon.sf.net/feature/initialMode" value="exec"/>
                 </factory>
                 <param name="temp" expression="{$temp}"/>
-                <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/> <!-- TODO czy to jest potrzebne - raczej bledne - Testujemy dla unikalnosci zmiennych -->
+                <param name="loop_xpath_real" expression="{$loop_xpath_real}"/> 
                 <param name="loop_path_recurs" expression="{$loop_path_recurs}"/>
                 <param name="feature_pos" expression="{$feature_pos}"/>
                 <param name="feature_pos_parent" expression="{$feature_pos_parent}"/>
@@ -1408,6 +1446,10 @@
                 <param name="parallel_java_process_max" expression="{$parallel_java_process_max}"/>
                 <param name="process_locks" expression="{$process_locks}"/>
                 <param name="uuid" expression="{$uuid}"/>
+                <param name="xml_id" expression="{@xml_id}"/>
+                <param name="typeNameRoot" expression="{$typeNameRoot}"/>
+                <param name="recurse_ant_basedir.recurse_cache" expression="{$recurse_ant_basedir.recurse_cache}"/>
+                
                 <classpath location="/opt/local/share/java/saxon9he.jar"/>
             </xsl:element>
             <xsl:if test="$debug &gt; 2"><echo> #1153 Loop executing antfile <xsl:value-of select="concat('${builds_to_ant_file.xml',$loop_path_recurs,$loop_xpath,@xml_id,'.',$feature_pos_parent,'.',$feature_pos,$featureID_name_dita,$parallel_pos,'}')"/></echo></xsl:if>
@@ -1447,6 +1489,8 @@
         <xsl:param name="loop_path_recurs_xpath" required="yes"/>
         <xsl:param name="feature_pos_parent" required="yes"/>
         <xsl:param name="feature_pos" required="yes"/>
+        <xsl:param name="input_obj_fid" required="yes"/>
+        <xsl:param name="typeName_dita" required="yes"/><!-- debug cache only  -->
         <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
         
         <!--<xsl:param name="loop_path_recurs" required="yes"/>-->
@@ -1460,6 +1504,8 @@
             <xsl:with-param name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/>
             <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
             <xsl:with-param name="feature_pos" select="$feature_pos"/>
+            <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
+            <xsl:with-param name="typeName_dita" select="$typeName_dita"/> <!-- debug cache only  -->
             <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
             <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
         </xsl:apply-templates>
@@ -1508,6 +1554,7 @@
         <xsl:param name="input_obj_with_xpath" required="yes"/>
         <xsl:param name="typeNameRealResource" required="yes"/>
         <xsl:param name="loop_path_recurs_xpath" required="yes"/>
+        <xsl:param name="input_obj_fid" required="yes"/>
         
         <xsl:choose>
             <xsl:when test="$wfs_output"/>
@@ -1565,6 +1612,7 @@
                                  <xsl:attribute name="if" select="concat('${get_related_feature_test_if_vals.dita.',position(),$loop_xpath_real,'}')"/>
                                  <fail message="#1248 ERROR IN PROCESSING FUNCTION TO BE FIXED!! already created $wfs_output.dita {$temp}/{$wfs_output.dita} "/>
                              </xsl:element>
+                     
                             <xsl:element name="target">
                                 <xsl:attribute name="name" select="concat('get_related_feature.',position(),$loop_xpath_real)"/>
                                 <xsl:choose>
@@ -1630,6 +1678,9 @@
                                         </xsl:element>
                                     </xsl:element>-->
                                    
+                                
+                                   
+ 
                                     <xsl:choose>
                                         <xsl:when test="position()=last()">
                                             <xsl:comment>antcall target="build_recurse_ant.<xsl:value-of select="position()+1"/>.xml"</xsl:comment>
@@ -1848,6 +1899,7 @@
                 <xsl:variable name="input_obj_with_xpath">
                     <xsl:apply-templates mode="after_first_ant_assing_xpath" select="node()/*"/> <!-- zeby nie wstawial do xpath nazwy feature - IN7_DZIENNIK_KORESP/ID itp -->
                 </xsl:variable>
+                <xsl:variable name="input_obj_fid" select="*"/> <!-- dla wykrycia @fid -->
                 <!--<input_obj_with_xpath_debug>
                     <xsl:attribute name="xpath" select="$xpath"/>
                     <!-\-<xsl:attribute name="xpath_dita" select="$xpath_dita"/>-\->
@@ -1862,13 +1914,21 @@
                 <!--<input_node_debug>
                     <xsl:copy-of select="."/>
                 </input_node_debug>-->
+                <!-- DEBUG CACHE instances creation/testing moment 2017-07-06 -->
+                <!--<xsl:result-document href="{$temp}/{$loop_xpath}/fid_{$input_obj_fid/@fid}">
+                    <DEBUG_CACHE>
+                        <xsl:copy-of select="$input_obj_fid/@fid"/>
+                    </DEBUG_CACHE>
+                </xsl:result-document>-->
                 <xsl:apply-templates mode="after_first_ant_assing_vars_childs" select="$current_RelatedFeature">
                     <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
                     <xsl:with-param name="xml_id_parent" select="$xml_id"/>
                     <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
                     <xsl:with-param name="feature_pos" select="position()"/><!-- wiecej features z relacji dokladamy pozycje -->
                     <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/> <!-- @2017-04 byly nadpisywane informacje - trzeba dorzucic jeszcze $feature_pos_parent w nazwie przetwarzania -->
+                    <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
                 </xsl:apply-templates>
+                <!-- cache tasks ? -->
             </xsl:for-each>
             <xsl:if test="$debug &gt; 2"><xsl:message>
                 {+}{+}{+}{+}{+}{+}{+}{+}{+}{+} #1499 EOF foreach from #1466 from $wfs_output=<xsl:value-of select="$wfs_output"/></xsl:message></xsl:if>
@@ -1951,6 +2011,10 @@
                 <xsl:when test="1=2"/>
                 <xsl:otherwise>
                     <xsl:element name="{name()}">
+                        <xsl:if test="$input_obj_fid">
+                             <!--<xsl:attribute name="input_obj_fid_name" select="$input_obj_fid/name()"/>-->
+                             <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>
+                        </xsl:if>
                         <!--<xsl:copy-of select="namespace::node()"/>-->
                         <xsl:for-each select="@*">
                             <xsl:choose>
@@ -2007,6 +2071,7 @@
                             <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
                             <xsl:with-param name="feature_pos" select="$feature_pos"/>
                             <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
+                            <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
                         </xsl:apply-templates>
                     </xsl:element>
                 </xsl:otherwise>
@@ -2022,6 +2087,7 @@
         <xsl:param name="loop_xpath"  select="$loop_xpath"/>
         <xsl:param name="feature_pos"   required="yes"/>
         <xsl:param name="feature_pos_parent" required="yes"/>
+        <xsl:param name="input_obj_fid" required="yes"/>
         <xsl:if test="$debug &gt; 2"><xsl:message>#411 $feature_pos=<xsl:value-of select="$feature_pos"/>; mode after_first_ant_assing_vars_childs bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message></xsl:if>
         <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
         <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
@@ -2071,6 +2137,7 @@
                         <xsl:with-param name="feature_pos"   select="$feature_pos"/>
                         <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
                         <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
+                        <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
                         <!--<xsl:with-param name="wfs_output.xml" />-->
                     </xsl:apply-templates>
                 </xsl:result-document>
@@ -2080,6 +2147,7 @@
                     <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
                     <xsl:attribute name="feature_pos" select="$feature_pos"/>
                     <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
+                    <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>
                 </xsl:element>
             </xsl:when>
             <xsl:otherwise>
@@ -2104,6 +2172,7 @@
         <xsl:param name="loop_xpath"  select="$loop_xpath"/>
         <xsl:param name="feature_pos"   required="yes"/>
         <xsl:param name="feature_pos_parent" required="yes"/>
+        <xsl:param name="input_obj_fid" required="yes"/>
         <xsl:if test="$debug &gt; 2"><xsl:message>#411-817 $feature_pos=<xsl:value-of select="$feature_pos"/>; mode after_first_ant_assing_vars_childs bylo $loop_xpath=<xsl:value-of select="$loop_xpath"/>;</xsl:message></xsl:if>
         <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
         <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
@@ -2133,7 +2202,7 @@
             \/\/\/\/\/\/\/\/\/\/\/ #1598 RelatedFeatureLoop  jest okazja do zrobienia bilda $feature_pos_parent=<xsl:value-of select="$feature_pos_parent"/> $feature_pos=<xsl:value-of select="$feature_pos"/> $xml_id_parent=<xsl:value-of select="$xml_id_parent"/>; $xml_id=<xsl:value-of select="$xml_id"/>;  match=RelatedFeature mode=after_first_ant_assing_vars_childs
             \/\/\/\/\/\/\/\/\/\/\/ $debug_xsl_in_filename= <xsl:value-of select="$debug_xsl_in_filename"/>
             \/\/\/\/\/\/\/\/\/\/\/ $debug_xsl_out_filename= <xsl:value-of select="$debug_xsl_out_filename"/>
-            \/\/\/\/\/\/\/\/\/\/\/ @fid=<xsl:value-of select="*/@fid"/>; position()=<xsl:value-of select="position()"/>;
+            \/\/\/\/\/\/\/\/\/\/\/ @fid=<xsl:value-of select="*/@fid"/>; position()=<xsl:value-of select="position()"/>; $input_obj_fid/@fid = <xsl:value-of select="$input_obj_fid/@fid"/> ;
             \/\/\/\/\/\/\/\/\/\/\/ to <xsl:value-of select="concat($temp,'/',$loop_xpath,'/build_root.xml')"/></xsl:message></xsl:if>
         <xsl:variable name="test_xpath_query">
             <xsl:call-template name="test_xpath_query">
@@ -2164,6 +2233,7 @@
                                 <xsl:with-param name="feature_pos"   select="$feature_pos"/>
                                 <xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>
                                 <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
+                                <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
                                 <!--<xsl:with-param name="wfs_output.xml" />-->
                             </xsl:apply-templates>
                         </xsl:result-document>
@@ -2173,6 +2243,7 @@
                             <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
                             <xsl:attribute name="loop_path_recurs" select="$loop_path_recurs"/>
                             <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/> <!-- TODO nie wiemy czy to tu bedzie potrzebne @2017-04 byly nadpisywane informacje - trzeba dorzucic jeszcze $feature_pos_parent w nazwie przetwarzania -->
+                            <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>
                         </xsl:element>
                     </xsl:otherwise>
                 </xsl:choose>

+ 1 - 1
SE/schema/default_db_xml_cache.public/builds_to_ant.xsl

@@ -26,7 +26,7 @@
     <xsl:param name="parallel_java_process_max" required="yes"/>
     <xsl:param name="loop_xpath" /> <!-- required="yes" , added at @2017-04-14 to concat $temp in exec --> 
     <xsl:param name="feature_pos" required="yes"/>
-    <xsl:param name="feature_pos_parent" required="yes"/> <!-- do wykluczenia bledow z przejsciem przez loop jak jest wiecej elementow Proces_tree -->
+    <xsl:param name="feature_pos_parent" /> <!-- required="yes" do wykluczenia bledow z przejsciem przez loop jak jest wiecej elementow Proces_tree -->
     <xsl:param name="process_locks"/>
     <xsl:param name="uuid" required="yes"/>
     <xsl:param name="debug" select="1"/>