a.binder 8 лет назад
Родитель
Сommit
b6208ccb5f

+ 1 - 1
SE/schema/WPS_Functions/mapserver_gml_to_png/build_mapserver_gml_to_png.xml

@@ -77,7 +77,7 @@
             <env key="PATH" path="$PATH:${PATH_ADD}"/>
         </exec>
         
-        <move file="${images.xml}" tofile="${dstfile}"/>
+        <move file="${images.xml}" tofile="${dstfile}" failonerror="false"/>
         <mkdir dir="${ditadir}/${fileindex}"/>
         <move todir="${ditadir}/${fileindex}" >
             <fileset dir="${mapserver_gml_to_png_basedir}/map">

+ 71 - 3
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/pismo/build_recurse_ant.xml

@@ -424,7 +424,23 @@
    
     <target name="xml_recursed_from_tr_map_with_RelatedFeatureLoop_tree_to_dita_wfs_recursed" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,set_dita" description="URL_TASK Wygeneruj druk z obiektu uzywajac styli systemowych za pomoca funkcji xsl_recursed">
         
-        <echo>#427 simpleSchema.xml =</echo>
+        <exec  executable="bash" dir="." outputproperty="out_task_file">
+            <arg value="-c"/>
+            <arg value="echo ${out_task.dita.final} |sed 's/^.*\///'"/>
+        </exec>
+        
+        <echo>#427 $out_task.dita.final = ${out_task.dita.final} , $out = ${out} , $out_task_file =  ${out_task_file}
+            $out_task.dita.final.noext = ${out_task.dita.final.noext}
+            $out_task.dita.final_with_RelatedFeatureLoop = ${out_task.dita.final_with_RelatedFeatureLoop}
+        </echo>
+        <!-- 
+                 [echo] #427 $out_task.dita.final = /Users/a.binder/Documents/se/SE/schema/ant-url_action/default_db.in7_dziennik_koresp/pismo/temp/Proj6782__/Proj6782___out_task_dita_final.dita , 
+                 $out = out ,
+                 $out_task_file =  Proj6782___out_task_dita_final.dita
+
+            
+            /Users/a.binder/Documents/se/SE/schema/ant-url_action/default_db.in7_dziennik_koresp/CRM_PROCES_tree/build_CRM_PROCES_tree.xml:294: input file
+            /Users/a.binder/Documents/se/SE/schema/ant-url_action/default_db.in7_dziennik_koresp/pismo/out/Proj6782__.out_task.dita.final_with_RelatedFeatureLoop.xml does not exist -->
         
         <echoxml file="${empty.xml}">
             <empty>empty</empty>
@@ -449,11 +465,16 @@
             <param name="php_session_id_ok.string" expression="${php_session_id}"/>
             <!--<param name="basedir" expression="${basedir}"/>-->
             <param name="temp" expression="${temp}"/>
+            <param name="debug" expression="0"/>
             <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
             <!--<param name="simpleSchema.xml" expression="${basedir}/${main_build_recurse_ant.dita}"/>-->
-            <param name="noRelatedFeatureRoot" expression="1"/>
+            <!--<param name="noRelatedFeatureRoot" expression="1"/>-->
         </xslt>
         
+        
+        <!--<move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>-->
+        <copy file="${out_task.dita.final}" tofile="${out_task.dita.final_with_RelatedFeatureLoop}.xml"/>
+        
         <ant antfile="${build_CRM_PROCES_tree}" target="default_db:PROCES_INIT:tree:dita" inheritall="false">
             <property name="uuid" value="${uuid}"/>
             <property name="default_db:recurse_ant_basedir.out" value="${default_db:recurse_ant_basedir}/out"/>
@@ -559,7 +580,8 @@
     
    
     <target name="main_build_recurse_ant.dita_with_id"  if="${test_if_dita}">
-        <echo>#490 debug external_schema_table.path ${external_schema_table.path} - is it correct?</echo>    
+        <echo>#490 debug external_schema_table.path ${external_schema_table.path} - is it correct?
+            $xpath_query.xsl = ${xpath_query.xsl}</echo>    
         <xslt basedir="${default_db:recurse_ant_basedir}" style="${main_build_recurse_ant.dita_with_id.xsl}" in="${main_build_recurse_ant.dita}"  destdir="./" out="${main_build_recurse_ant.dita_with_id}" >
             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
@@ -929,6 +951,52 @@
         <echo message="OUTPUT__END"/>
     </target>   
     
+    
+    <target name="builxml_recursed" description="To build just XML from map - usable for custom scripting" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check,php_session_id_check,mkdir_process_locks,build_recurse_ant_xsl_xpath_filter.xsl,check_dita" if="${test_if_dita}">
+        <input addproperty="main_build_recurse_ant.dita" message="Type xml map of object to traverse (RelatedFeature xpath=ID  typeName=p5_default_db:CRM_LISTA_ZASOBOW) "/>
+        <input addproperty="typeName"/>
+        <input addproperty="uuid"/>
+        <input addproperty="xpath"/>
+        <input addproperty="xpath_value"/>
+        <input addproperty="passwordBase64Basic"/>
+        <input addproperty="out_task.dita.final"/>
+        
+        
+        
+        <!-- -Dmain_build_recurse_ant.dita=/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/default_db/recurse_ant/CRM_LISTA_ZASOBOW_test.schema.xml -->
+        <!--<exec executable="${dita.dir}" dir=".">
+            <arg value="-i"/>
+            <arg value="${out_task.dita.final}" />
+            <!-\- <arg value="-t" />
+            <arg value="temp" />-\->
+            <arg value="-f" />
+            <arg value="pdf"/>
+            <arg value="-o"/>
+            <arg value="${out}"/>
+        </exec>-->
+        <!--<exec  executable="bash" dir="." outputproperty="out_task_file">
+            <arg value="-c"/>
+            <arg value="echo ${out_task.dita.final} |sed 's/^.*\///'"/>
+        </exec>-->
+        <echo message="OUTPUT__START"/>        
+        <!--<echo> url = ${url} 
+        </echo>-->
+        <!--<echo> passwordBase64Basic = ${passwordBase64Basic_tested} 
+        </echo>-->
+        <!--<echo> $webRootUrl = ${webRootUrl} 
+        </echo>-->
+        <!--<echo> $wfs_output = ${wfs_output} 
+        </echo>-->
+        <echo>
+            out_task.dita.final = ${out_task.dita.final}
+        </echo>
+        <!--<echo>
+            &lt;br&gt;Wygenerowano druk pdf - sciagnij go &lt;a href=&quot;${webRootUrl}/${out}/${out_task.dita.final.noext}.pdf&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out}/${out_task.dita.final.noext}.pdf&lt;/a&gt;&lt;/br&gt; 
+        </echo>-->
+        
+        <echo message="OUTPUT__END"/>
+    </target>
+    
     <target name="buildpdf_recursed_xsl" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,set_dita"  description="retrieve and build object from api using just XSL calls - needed username and password">
         <echo>#836 will try to in $main_build_recurse_ant.dita_with_id ${main_build_recurse_ant.dita_with_id} , $empty.xml = ${empty.xml}</echo>
         <echoxml file="${empty.xml}">

+ 58 - 14
SE/schema/default_db_xml_cache.public/get_wfs_recurse_xsl.xsl

@@ -113,7 +113,7 @@
                 <xsl:otherwise><xsl:value-of select="concat($simpleSchema_dir,'/',$targetNamespace_DEFAULTS_prefix,'/',$featureID_name_dita,'.xml')"/></xsl:otherwise>
             </xsl:choose>
         </xsl:variable>
-        <xsl:message>#57 get_wfs_recurse_xsl:GetsimpleSchema: from $typeNameRealResource=<xsl:value-of select="$typeNameRealResource"/>; <xsl:value-of select="$simpleSchemaFile"/>  for featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>;</xsl:message>
+        <xsl:message>#57 get_wfs_recurse_xsl:GetsimpleSchema:  from $typeNameRealResource=<xsl:value-of select="$typeNameRealResource"/>; <xsl:value-of select="$simpleSchemaFile"/>  for featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/>;</xsl:message>
         
         
         <xsl:if test="not( substring-before(system_cache__appinfo:translate_object_escaped_prefix_from_string(substring-before($typeNameRealResource,':')),':'))">
@@ -613,6 +613,7 @@
                             <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
                             <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
                             <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
+                            <xsl:with-param name="resolveDepth.current" select="1"/>
                         </xsl:apply-templates>
                     </xsl:when>
                     <xsl:otherwise>
@@ -622,6 +623,7 @@
                                 <xsl:with-param name="get_wfs_recurse_xsl:context.nodes" select="$get_wfs_recurse_xsl:context.nodes"/>
                                 <xsl:with-param name="get_wfs_recurse_xsl:context.PRIMARYKEY" select="$get_wfs_recurse_xsl:context.PRIMARYKEY"/>
                                 <xsl:with-param name="debug.last_wfs_request" select="$request_string"/>
+                                <xsl:with-param name="resolveDepth.current" select="1"/>
                             </xsl:apply-templates>
                         </RelatedFeatureRoot>
                     </xsl:otherwise>
@@ -1223,6 +1225,7 @@
         <!--<xsl:param name="get_wfs_recurse_xsl:wfs_response" required="yes"/>-->
         <xsl:param name="get_wfs_recurse_xsl:typeNameRealResource" select="@typeNameRealResource"/>
         <xsl:param name="input_obj_with_xpath" required="yes"/>
+        <xsl:param name="resolveDepth.current" required="yes"/>
         <!--<xsl:param name="xpath"  select="$xpath"/>-->
         <!--<xsl:param name="xpath_value"  select="$xpath_value"/>-->
         <!--<xsl:variable name="input_obj_with_xpath">
@@ -1283,7 +1286,9 @@
             </wfs_response>
         </xsl:if>
         <xsl:apply-templates mode="after_first_ant_assing_vars" select="." >
+            
             <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
+            <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
         </xsl:apply-templates>
         
     </xsl:template>
@@ -1295,6 +1300,7 @@
         <xsl:param name="input_obj_with_xpath" required="yes"/>
         <xsl:param name="xpath"  select="$xpath"/>
         <xsl:param name="xpath_value"  select="$xpath_value"/>
+        <xsl:param name="resolveDepth.current" required="yes"/>
         <!--<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>-->
@@ -1359,8 +1365,11 @@
         </xsl:if>
         <xsl:apply-templates mode="after_first_ant_assing_vars" select="." >
             <xsl:with-param name="get_wfs_recurse_xsl:wfs_response" select="$get_wfs_recurse_xsl:wfs_response"/>
+            <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
         </xsl:apply-templates>
     </xsl:template>
+    
+    
     <xsl:template mode="get_wfs_recurse_xsl:wfs_response_simpleType" match="*">
         <xsl:copy-of select="."/>
     </xsl:template>
@@ -1399,6 +1408,7 @@
       <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
           <xsl:param name="loop_xpath" />
           <xsl:param name="get_wfs_recurse_xsl:wfs_response"  required="yes"/>
+          <xsl:param name="resolveDepth.current" required="yes"/>
         <!--<RelatedFeatureRoot>-->
             
         <!-- first assign xpath to features from  -->
@@ -1425,6 +1435,7 @@
                     <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:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
                 </xsl:apply-templates>
                 <!-- cache tasks ? -->
             </xsl:for-each>
@@ -1463,19 +1474,41 @@
                 </xsl:variable>
                 <!--<xsl:variable name="curr_xpath_tmpl" select="'asdf'"/>-->
                 <!--<xsl:element name="{name()}" >-->
-                <xsl:copy>
-                    <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
-                    <xsl:for-each select="@*">
-                        <xsl:choose>
-                            <xsl:when test="name()='fid'"/>
-                            <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
-                        </xsl:choose>
-                    </xsl:for-each>
-                    <xsl:value-of select="text()"/>
-                    <xsl:apply-templates mode="after_first_ant_assing_xpath">
-                        <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
-                    </xsl:apply-templates>
-                </xsl:copy>
+                
+                <xsl:choose>
+                    <xsl:when test="contains(name(),'gml')">
+                        <xsl:element name="{local-name()}">
+                            <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
+                            <xsl:for-each select="@*">
+                                <xsl:choose>
+                                    <xsl:when test="name()='fid'"/>
+                                    <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
+                                </xsl:choose>
+                            </xsl:for-each>
+                            <xsl:value-of select="text()"/>
+                            <xsl:apply-templates mode="after_first_ant_assing_xpath">
+                                <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
+                            </xsl:apply-templates>
+                        </xsl:element>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:copy>
+                            <xsl:attribute name="xpath" select="$curr_xpath_tmpl"/>
+                            <xsl:for-each select="@*">
+                                <xsl:choose>
+                                    <xsl:when test="name()='fid'"/>
+                                    <xsl:otherwise><xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute></xsl:otherwise>
+                                </xsl:choose>
+                            </xsl:for-each>
+                            <xsl:value-of select="text()"/>
+                            <xsl:apply-templates mode="after_first_ant_assing_xpath">
+                                <xsl:with-param name="curr_xpath" select="$curr_xpath_tmpl"/>
+                            </xsl:apply-templates>
+                        </xsl:copy>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+                
                 <!--</xsl:element>-->
             </xsl:otherwise>
         </xsl:choose>
@@ -1497,12 +1530,14 @@
         <xsl:param name="feature_pos"  required="yes"/>
         <xsl:param name="feature_pos_parent"  required="yes"/>
         <xsl:param name="input_obj_fid" required="no"/>
+        <xsl:param name="resolveDepth.current" required="yes"/>
         <xsl:for-each select=".">
             <xsl:choose>
               
                 <xsl:when test="1=2"/>
                 <xsl:otherwise>
                     <xsl:element name="{local-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"/>
@@ -1604,6 +1639,7 @@
                             <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:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
                         </xsl:apply-templates>
                     </xsl:element>
                 </xsl:otherwise>
@@ -1622,6 +1658,7 @@
         <xsl:param name="feature_pos_parent" required="yes"/>
         <xsl:param name="input_obj_fid" required="yes"/>
         <xsl:param name="xpath_query"/> <!-- + added test -->
+        <xsl:param name="resolveDepth.current" 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,':')"/>
@@ -1659,6 +1696,7 @@
                     <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>-->
                     <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeature" select=".">
                         <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
+                        <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current"/>
                     </xsl:apply-templates>
                 <!--</xsl:element>-->
             </xsl:when>
@@ -1686,6 +1724,7 @@
         <xsl:param name="feature_pos_parent" required="yes"/>
         <xsl:param name="input_obj_fid" required="yes"/>
         <xsl:param name="xpath_query"/> <!-- + added test -->
+        <xsl:param name="resolveDepth.current" 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,':')"/>
@@ -1710,6 +1749,9 @@
             </xsl:call-template>
         </xsl:variable>
         <xsl:choose>
+            <xsl:when test="$resolveDepth.current &gt; $resolveDepth">
+                <xsl:message>#1722 exceeded $resolveDepth.current &gt; $resolveDepth = <xsl:value-of select="$resolveDepth.current"/></xsl:message>
+            </xsl:when>
             <xsl:when test="$test_xpath_query='1'">
                 <xsl:if test="$debug &gt; 2"><xsl:message>[][][][][]\/\/\/\/\/\/\/\/\/\/\/ #1540  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  </xsl:message></xsl:if>
                 <xsl:comment>#527 there we exec child dig</xsl:comment>
@@ -1721,10 +1763,12 @@
                     <xsl:attribute name="feature_pos_parent" select="$feature_pos_parent"/>
                     <xsl:attribute name="fid" select="$input_obj_fid/@fid"/>-->
                     <xsl:comment>#710 opening new Loop recurse instance for <xsl:value-of select="@typeName"/></xsl:comment>
+                    <xsl:message>#710 resolveDepth.current = <xsl:value-of select="$resolveDepth.current"/>; opening new Loop recurse instance for <xsl:value-of select="@typeName"/></xsl:message>
                     <xsl:apply-templates mode="get_wfs_recurse_xsl:wfs_response_RelatedFeatureLoop" select="get_wfs_recurse_xsl:GetsimpleSchema(@typeName)">
                         <xsl:with-param name="input_obj_with_xpath" select="$input_obj_with_xpath"/>
                         <xsl:with-param name="xpath" select="@xpath"/>
                         <xsl:with-param name="xpath_value" select="@xpath_value"/>
+                        <xsl:with-param name="resolveDepth.current" select="$resolveDepth.current + 1"/>
                     </xsl:apply-templates>
                 <!--</xsl:element>-->
             </xsl:when>