a.binder 9 lat temu
rodzic
commit
054f2968f8

+ 105 - 0
SE/schema/ant-url_action/default_db.crm_proces/CRM_PROCES_tree/CRM_PROCES.dita

@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- do CRM_PROCES_tree  -->
+<RelatedFeature xpath="ID"  typeName="p5_default_db:CRM_PROCES"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xsi:noNamespaceSchemaLocation="../../../default_db_xml_cache.public/topicProcesy5.xsd">
+  <!-- oznacza to refa z w $var=ID_BILLING_OWNER jest FeatureID=BILLING_OWNER.$var do sciagniecia z p5_default_db:BILLING_OWNER -->
+  <!--https://biuro.biall-net.pl/SE/version-git/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/out/null400667363.pdf-->
+<topic id="CRM_PROCES_tree" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+  <title><ph>Proces nr </ph><ph xpath="PARENT_ID"/><ph>-</ph><ph xpath="ID"/>
+    <ph>z dnia</ph>
+    <ph xpath="A_RECORD_CREATE_DATE"/> <ph>/</ph> <ph xpath="A_RECORD_UPDATE_DATE"/></title>
+  <body>
+    <p> Opis <ph xpath="DESC"></ph></p>
+    <p> Opis pelny <ph xpath="OPIS"></ph></p>
+    <p><b>Powiazane Zasoby</b></p>
+            <RelatedFeature xpath="ID_PROCES" xpath_value="../A_RECORD_CREATE_DATE" typeName="p5_default_db:CRM_WSKAZNIK">  
+              <p>
+                <codeblock><ph xpath="OPIS_ZASOB" />
+                  <ph xpath="TYP"/>
+                  <ph xpath="ID_PRZYPADEK"/>
+                </codeblock>
+                  <RelatedFeature xpath="ID" xpath_value="../ID_ZASOB" typeName="p5_default_db:CRM_LISTA_ZASOBOW">  
+                    <codeblock>
+                      <ph xpath="ID" />
+                      <ph xpath="TYPE"/>
+                     <ph xpath="DESC"/>
+                    </codeblock>
+                  </RelatedFeature>
+              </p>
+            </RelatedFeature>
+  </body>
+  
+  <topic id="CRM_PROCES_sibling_low" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+    <title>nizej powinien pojawic sie sibling child</title>
+    <body>
+      <p>----</p>
+    </body>
+  </topic>
+  
+  <RelatedFeature xpath="PARENT_ID" xpath_value="../ID"  typeName="p5_default_db:CRM_PROCES"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:noNamespaceSchemaLocation="../../../default_db_xml_cache.public/topicProcesy5.xsd">
+    <topic id="CRM_PROCES_tree2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+      <title><ph>Proces podrzedny nr </ph><ph xpath="PARENT_ID"/><ph>-</ph><ph xpath="ID"/>
+        <ph>z dnia</ph>
+        <ph xpath="A_RECORD_CREATE_DATE"/> <ph>/</ph> <ph xpath="A_RECORD_UPDATE_DATE"/></title>
+      <body>
+        <p> Opis <ph xpath="DESC"></ph></p>
+        <p> Opis pelny <ph xpath="OPIS"></ph></p>
+        <p><b>Powiazane Zasoby</b></p>
+        <RelatedFeature xpath="ID_PROCES" xpath_value="../ID" typeName="p5_default_db:CRM_WSKAZNIK">  
+          <p>
+            <codeblock><ph xpath="OPIS_ZASOB" />
+              <ph xpath="TYP"/>
+              <ph xpath="ID_PRZYPADEK"/>
+            </codeblock>
+            <RelatedFeature xpath="ID" xpath_value="../ID_ZASOB" typeName="p5_default_db:CRM_LISTA_ZASOBOW">  
+              <codeblock>
+                <ph xpath="ID" />
+                <ph xpath="TYPE"/>
+                <ph xpath="DESC"/>
+              </codeblock>
+            </RelatedFeature>
+          </p>
+        </RelatedFeature>
+      </body>
+    </topic>
+    <RelatedFeature xpath="PARENT_ID" xpath_value="../ID"  typeName="p5_default_db:CRM_PROCES"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+      xsi:noNamespaceSchemaLocation="../../../default_db_xml_cache.public/topicProcesy5.xsd">
+      <topic id="CRM_PROCES_tree3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
+        <title><ph>CRM_PROCES_tree3 Proces podrzedny nr </ph><ph xpath="PARENT_ID"/><ph>-</ph><ph xpath="ID"/>
+          <ph>z dnia</ph>
+          <ph xpath="A_RECORD_CREATE_DATE"/> <ph>/</ph> <ph xpath="A_RECORD_UPDATE_DATE"/></title>
+        <body>
+          <p> Opis <ph xpath="DESC"></ph></p>
+          <p> Opis pelny <ph xpath="OPIS"></ph></p>
+          <p><b>Powiazane Zasoby</b></p>
+          <RelatedFeature xpath="ID_PROCES" xpath_value="../ID" typeName="p5_default_db:CRM_WSKAZNIK">  
+            <p>
+              <codeblock><ph xpath="OPIS_ZASOB" />
+                <ph xpath="TYP"/>
+                <ph xpath="ID_PRZYPADEK"/>
+              </codeblock>
+              <RelatedFeature xpath="ID" xpath_value="../ID_ZASOB" typeName="p5_default_db:CRM_LISTA_ZASOBOW">  
+                <codeblock>
+                  <ph xpath="ID" />
+                  <ph xpath="TYPE"/>
+                  <ph xpath="DESC"/>
+                </codeblock>
+              </RelatedFeature>
+            </p>
+          </RelatedFeature>
+        </body>
+      </topic>
+    </RelatedFeature>
+  </RelatedFeature>
+</topic>
+  
+</RelatedFeature>

+ 279 - 0
SE/schema/ant-url_action/default_db.crm_proces/CRM_PROCES_tree/build.xml

@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project basedir="." name="PRINT_TEMPLATE" default="buildpdf_recursed"  >
+
+    <!-- template do kopiowania test-druk @2017-03-02 bindera 
+    Copyright BIALL-NET sp. z o.o. wszelkie prawa zastrzezone
+    -->    
+
+    <!-- CRM_PROCES_tree -->
+    
+    <!-- Przykładowe wyzwolenie z bash :
+    cat input.xml | /Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/ant -buildfile ild__IN7_DZIENNIK_KORESP.xml
+    na output mamy pdf'a
+    -->
+
+
+  
+    
+    <!---DpasswordBase64Basic="xxxx=="
+        -DtypeName="p5_default_db:IN7_DZIENNIK_KORESP" 
+        -Dxpath=ID -Dxpath_value=1000 
+        -Duuid=1 -DwebRootUrl=somePathDir-->
+    <property name="temp" value="temp"/> <!-- temp files-->
+    <property name="out" value="out"/> <!-- output ready files like pdf -->
+    
+    <property name="uuid" value="${uuid}"/> <!--TODO-->
+    <property name="passwordBase64Basic" value="${passwordBase64Basic}"/>
+    <property name="url" value="${url}"/>
+    <property name="webRootUrl" value="${$webRootUrl}"/>
+
+
+    <property name="api_url" value="https://biuro.biall-net.pl/SE/version-git/wfs-data.php"/>
+    <property name="namespace_prefix" value="p5_default_db"/> <!-- ex: p5_default_db to complete after p5_default_db:IN7_DZIENNIK_KORESP -->
+    <property name="typeName" value="${typeName}"/> <!-- to be set initially ex: p5_default_db:IN7_DZIENNIK_KORESP - be careful not to give it in apostrophs like 'p5_default_db:IN7_DZIENNIK_KORESP' - it wont work! -->
+    <property name="xpath" value="${xpath}"/> <!-- to be set initially like as key to search ID  -->
+    <property name="xpath_value" value="${xpath_value}"/> <!-- to be set initially like 1000 (to search ID=1000, if ID we get by featureID  -->
+    
+    <!-- variables to first transform of doc for then get related features -->
+    <property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/> <!-- katalog z xsl z projektu src-xmlschema.git -->
+    <property name="build_recurse_ant.xsl" value="${default_db_xml_cache.public}/build_recurse_ant.xsl"/>
+    <property name="build_recurse_ant_merge_dita_from_temp.xsl" value="${default_db_xml_cache.public}/build_recurse_ant_merge_dita_from_temp.xsl"/>
+    <property name="builds_to_ant.xsl" value="${default_db_xml_cache.public}/builds_to_ant.xsl"/>
+    
+    
+    <!--<tempfile property="uuid" deleteonexit="yes"/>-->
+    <tempfile property="out_task.dita" deleteonexit="no"  destdir="temp"/>
+    <tempfile property="out_task.dita.final" deleteonexit="no"  destdir="temp"/>
+    <!--<tempfile property="wfs_output" deleteonexit="no"  destdir="temp"  suffix=".xml" />-->
+    
+    
+    <target name="install_folders">
+        <mkdir dir="${temp}"/>
+        <mkdir dir="${out}"/>
+        <chmod  dir="${temp}" perm="ugo+rwx"/>
+        <chmod  dir="${out}" perm="ugo+rwx"/>
+    </target>
+
+
+    <target name="set_dita" >
+        
+        <!--<property name="main_build_recurse_ant.dita" value="main_build_recurse_ant.dita"/>-->
+        
+        <exec  executable="bash" dir="." outputproperty="main_build_recurse_ant.dita_sed">
+            <arg value="-c"/>
+            <arg value="echo ${typeName} |sed 's/.*://'"/>
+        </exec>
+        <regexp pattern=""/>
+        
+        <property name="main_build_recurse_ant.dita" value="${main_build_recurse_ant.dita_sed}.dita"/>
+        <echo> Ustawiam $main_build_recurse_ant.dita na ${main_build_recurse_ant.dita} ;  </echo>
+        
+        <property name="main_build_recurse_ant.dita_with_id" value="${temp}/${main_build_recurse_ant.dita}.with_id.xml"/>
+        <property name="main_build_recurse_ant.dita_with_id.xsl" value="${default_db_xml_cache.public}/main_build_recurse_ant.dita_with_id.xsl"/>
+        <condition property="test_if_dita" taskname="check_dita" >
+            <available file="${main_build_recurse_ant.dita}"/>  
+        </condition>
+    </target>
+    
+    
+    
+    <target name="check_dita" depends="set_dita" if="${test_if_dita}">
+        <echo> testujemy czy jest dita</echo>
+        <antcall target="build_recurse_ant_merge_dita_from_temp.xsl"/>
+    </target>
+    
+    <target name="info_brak_dita" unless="${test_if_dita}">
+        <echo message="OUTPUT__START"/>   
+        <echo>&lt;br&gt;Brakuje druku dla powiązanego obiektu ${main_build_recurse_ant.dita} &lt;/br&gt;</echo>         
+        <echo message="OUTPUT__END"/>
+    </target>
+   
+    <target name="main_build_recurse_ant.dita_with_id"  if="${test_if_dita}">
+        <xslt 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"/>
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+        </xslt>
+    </target>
+   
+   
+    <target name="clean_temp_dir" description="URL_TASK Target clean_temp_dir">
+        <delete>
+            <fileset dir="${temp}"/>
+        </delete>        
+        <echo message="OUTPUT__START"/>   
+        <echo>&lt;br&gt;Skasowano pliki tymczasowe&lt;/br&gt;</echo>         
+        <echo message="OUTPUT__END"/>
+    </target>
+
+    <!-- wygenerowanie ant builda do sciagniecia niezbednego elementu na podstawie template main.dita i tam zagniezdzonego RelatedFeature-->
+    <target name="build_recurse_ant.xml" depends="main_build_recurse_ant.dita_with_id">
+        <!-- build do wytworzenia pierwszego przetworzenia zagniezdzen -->
+        
+        <record name="${temp}/ant.log" loglevel="verbose" append="true"/>
+        <property name="loop_xpath"  value="root"/>
+        <property name="build_recurse_ant.xml" value="${temp}/${uuid}.build_${loop_xpath}.xml"/>
+        <echo>#113 ant build_recurse_ant.xml=${build_recurse_ant.xml}; </echo>
+        <!--<delete file="${build_recurse_ant.xml}"/>-->
+        <xslt basedir="./" style="${build_recurse_ant.xsl}" 
+              in="${main_build_recurse_ant.dita_with_id}"  destdir="./" 
+              out="${build_recurse_ant.xml}"  >
+            <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            
+            <param name="build_recurse_ant.xsl" expression="${build_recurse_ant.xsl}"/>
+            <param name="passwordBase64Basic" expression="${passwordBase64Basic}"/>
+            <param name="url" expression="${url}" />
+            <param name="webRootUrl" expression="${webRootUrl}" /> 
+            <param name="main_build_recurse_ant.dita" expression="${main_build_recurse_ant.dita_with_id}"/>
+            <param name="uuid" expression="${uuid}"/>
+            
+            <!--<param name="out_task.dita" expression="${out_task.dita}"/>-->
+            <!--<param name="wfs_output" expression=""/>-->
+            
+            <param name="api_url" expression="${api_url}"/>
+            <!--<param name="namespace_prefix" expression="${namespace_prefix}"/>--> 
+            <param name="typeName" expression="${typeName}"/> 
+            <param name="xpath" expression="${xpath}"/> <!-- to be set initially like as key to search ID  -->
+            <param name="xpath_value" expression="${xpath_value}"/> <!-- to be set initially like 1000 (to search ID=1000, if ID we get by featureID  -->
+            <param name="loop_xpath" expression="root"/><!-- xpath sciezki przetwarzania xmla -->
+            <param name="loop_xpath_save" expression="${loop_xpath}"/>
+            <param name="current_leaf.dita" expression="${main_build_recurse_ant.dita_with_id}"/>
+            <param name="basedir" expression="${basedir}"/>
+            <param name="build_recurse_ant.xsl" expression="${build_recurse_ant.xsl}"/>
+            <param name="temp" expression="${temp}"/>
+            <param name="builds_to_ant.xsl" expression="${builds_to_ant.xsl}"/>
+        </xslt>
+        <!--<import file="${build_recurse_ant.xml}"/>-->
+        <ant  antfile="${build_recurse_ant.xml}" dir="."/>
+        <!-- pozbierac wszystkie do kupy xmle  -->
+    </target>
+    
+    <target name="build_recurse_ant_merge_dita_from_temp.xsl" depends="build_recurse_ant.xml" description="z plikow temp/$uuid.* buduje $out_task.dita.final ">
+        <xslt basedir="./" style="${build_recurse_ant_merge_dita_from_temp.xsl}" in="${main_build_recurse_ant.dita_with_id}"  destdir="./" out="${out_task.dita.final}" >
+            <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <!--<param name="webRootUrl" expression="${webRootUrl}" />--> 
+            <!--<param name="main_build_recurse_ant.dita" expression="${main_build_recurse_ant.dita}"/>-->
+            <param name="uuid" expression="${uuid}"/>
+            <param name="basedir" expression="${basedir}"/>
+            <param name="temp" expression="${temp}"/>
+        </xslt>
+        <echo> zapisalem plik gotowy do utworzenia dita do ${out_task.dita}. </echo>
+    </target>
+
+
+    <!--<target name="get_related_feature">
+        <exec executable="curl"  output="${wfs_output}" errorproperty="wfs_error" resultproperty="wfs_result">
+            <arg line="-H 'Authorization: Basic ${passwordBase64Basic}' ${url}"/>
+        </exec>
+        <echo message="curl -H 'Authorization: Basic ${passwordBase64Basic}' '${url}'"/>
+        
+        <echo message="ERROR__START"/>
+        <echo message="${wfs_error}"/>
+        <echo> gues path of pdf is </echo>
+        <exec  executable="bash" dir="." outputproperty="url_of_current_script">
+             <arg value="-c"/>
+             <arg value="echo &quot;${url}&quot; |sed 's/[a-zA-Z0-9]*.php.*//'"/>
+        </exec>
+        <echo message="ERROR__END"/>
+        
+    </target>-->
+
+
+    <target name="buildpdf_recursed" depends="check_dita,info_brak_dita" if="${test_if_dita}">
+       
+        <property name="dita.dir" location="/Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/dita"/>
+        <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} 
+        </echo>-->
+        <!--<echo> $webRootUrl = ${webRootUrl} 
+        </echo>-->
+        <!--<echo> $wfs_output = ${wfs_output} 
+        </echo>-->
+        <echo>
+            &lt;br&gt;Wygenerowano druk pdf - sciagnij go &lt;a href=&quot;${webRootUrl}/out/${out_task_file}.pdf&quot;&gt; &quot;${webRootUrl}/out/${out_task_file}.pdf&lt;/a&gt;&lt;/br&gt; 
+        </echo>
+        <echo>
+            &lt;br&gt;Dodaj do korespondencji (W przygotowaniu)&lt;/br&gt; 
+        </echo>
+        <echo>
+            &lt;br&gt;Wyślij do adresatów emailem (W przygotowaniu)&lt;/br&gt; 
+        </echo>
+        <echo>
+            &lt;br&gt;Umieść swój podpis graficzny (W przygotowaniu)&lt;/br&gt; 
+        </echo>
+        <echo message="OUTPUT__END"/>
+    </target>
+
+
+    <!--<target name="buildpdf" depends="get_related_feature">
+        <xslt basedir="./" style="IN7_DZIENNIK_KORESP.xsl" in="${wfs_output}"  destdir="./" out="${out_task.dita.final}" >
+            <factory name="net.sf.saxon.TransformerFactoryImpl">    
+                <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
+                <!-\-<attribute name="http://saxon.sf.net/feature/initialMode" value="PROCES_INCLUDE"/>-\->
+                <!-\-<attribute name="http://saxon.sf.net/feature/initialTemplate" value="Types__x3A__xlsx__x3A__main"/>-\->
+            </factory>
+            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="dita_task_template_file_param" expression="main.dita"/>
+        </xslt> 
+        <property name="dita.dir" location="/Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/dita"/>
+        <exec executable="${dita.dir}" dir=".">
+            <arg value="-i"/>
+            <arg value="${out_task.dita}" />
+            <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} |sed 's/^.*\///'"/>
+        </exec>
+        <echo message="OUTPUT__START"/>        
+        <!-\-<echo> url = ${url} 
+        </echo>-\->
+        <!-\-<echo> passwordBase64Basic = ${passwordBase64Basic} 
+        </echo>-\->
+        <!-\-<echo> $webRootUrl = ${webRootUrl} 
+        </echo>-\->
+        <!-\-<echo> $wfs_output = ${wfs_output} 
+        </echo>-\->
+        <echo>
+            &lt;br&gt;Wygenerowano druk pdf - sciagnij go &lt;a href=&quot;${webRootUrl}/out/${out_task_file}.pdf&quot;&gt; &quot;${webRootUrl}/out/${out_task_file}.pdf&lt;/a&gt;&lt;/br&gt; 
+        </echo>
+        <echo>
+            &lt;br&gt;Dodaj do korespondencji (W przygotowaniu)&lt;/br&gt; 
+        </echo>
+        <echo>
+            &lt;br&gt;Wyślij do adresatów emailem (W przygotowaniu)&lt;/br&gt; 
+        </echo>
+        <echo>
+            &lt;br&gt;Umieść swój podpis graficzny (W przygotowaniu)&lt;/br&gt; 
+        </echo>
+        <echo message="OUTPUT__END"/>
+    </target>-->
+    
+    
+</project>

+ 45 - 16
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/IN7_MK_BAZA_DYSTRYBUCJI.dita

@@ -4,6 +4,8 @@
   xsi:noNamespaceSchemaLocation="../../../default_db_xml_cache.public/topicProcesy5.xsd">
   <!-- oznacza to refa z w $var=ID_BILLING_OWNER jest FeatureID=BILLING_OWNER.$var do sciagniecia z p5_default_db:BILLING_OWNER -->
   <!--https://biuro.biall-net.pl/SE/version-git/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/out/null400667363.pdf-->
+  
+  <!-- @2017-03-02 bindar: development test blad zagniezdzania -->
 <topic id="untitled4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
   <title><ph>Dane sprawy dla </ph><ph xpath="P_ID"/><ph>-</ph><ph xpath="ID"/>
@@ -38,29 +40,56 @@
             </row>
             <RelatedFeature xpath="P_ID" xpath_value="../ID" typeName="p5_default_db:IN7_MK_BAZA_DYSTRYBUCJI">  <!-- test sciagniecia powiazanych pism do sprawy -->
               <row>
-                <entry>---</entry>
+                <entry>---podsprawy</entry>
                 <entry xpath="ID" />
                 <entry xpath="M_DIST_DESC"/>
                 <entry xpath="M_DISTRIBUTOR"/>
                 <entry xpath="L_APPOITMENT_INFO"/>
               </row>
+                    <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
+                      <row>
+                        <entry>------zadania</entry>
+                        <entry xpath="ID" />
+                        <entry xpath="M_DIST_DESC"/>
+                        <entry xpath="M_DISTRIBUTOR"/>
+                        <entry xpath="L_APPOITMENT_INFO"/>
+                      </row>
+                    </RelatedFeature>
+                    <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID_PROJECT" typeName="p5_default_db:IN7_DZIENNIK_KORESP"><!-- test sciagniecia powiazanych pism do sprawy -->
+                      <row>
+                        <entry>------pisma</entry>
+                        <entry xpath="ID" />
+                        <entry/>
+                        <entry xpath="K_DATA_OTRZYMANEJ_KORESP"/>
+                        <entry xpath="K_ZAWARTOS"/>
+                      </row>
+                    </RelatedFeature> 
               <RelatedFeature xpath="P_ID" xpath_value="../ID" typeName="p5_default_db:IN7_MK_BAZA_DYSTRYBUCJI">  <!-- test sciagniecia powiazanych pism do sprawy -->
                 <row>
-                  <entry>------</entry>
+                  <entry>---sprawy</entry>
                   <entry xpath="ID" />
                   <entry xpath="M_DIST_DESC"/>
                   <entry xpath="M_DISTRIBUTOR"/>
                   <entry xpath="L_APPOITMENT_INFO"/>
                 </row>
-                <RelatedFeature xpath="P_ID" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
-                  <row>
-                    <entry>---------</entry>
-                    <entry xpath="ID" />
-                    <entry xpath="M_DIST_DESC"/>
-                    <entry xpath="M_DISTRIBUTOR"/>
-                    <entry xpath="L_APPOITMENT_INFO"/>
-                  </row>
-                </RelatedFeature>
+                      <RelatedFeature xpath="ID_PROJECT" xpath_value="../ID_PROJECT" typeName="p5_default_db:IN7_DZIENNIK_KORESP"><!-- test sciagniecia powiazanych pism do sprawy -->
+                        <row>
+                          <entry>------pisma</entry>
+                          <entry xpath="ID" />
+                          <entry/>
+                          <entry xpath="K_DATA_OTRZYMANEJ_KORESP"/>
+                          <entry xpath="K_ZAWARTOS"/>
+                        </row>
+                      </RelatedFeature>
+                      <RelatedFeature xpath="P_ID" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
+                        <row>
+                          <entry>-----zadania</entry>
+                          <entry xpath="ID" />
+                          <entry xpath="A_STATUS"/>
+                          <entry xpath="A_PROBLEM_DESC"/>
+                          <entry xpath="L_APPOITMENT_USER"/>
+                        </row>
+                      </RelatedFeature>
               </RelatedFeature>
             </RelatedFeature>
           </tbody>
@@ -98,24 +127,24 @@
                 <entry xpath="A_PROBLEM_DESC"/>
                 <entry xpath="L_APPOITMENT_USER"/>
               </row>
-              <RelatedFeature xpath="PARENT_ID" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
+              <!--<RelatedFeature xpath="PARENT_ID" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-\- test sciagniecia powiazanych pism do sprawy -\->
                 <row>
-                  <entry>------</entry>
+                  <entry>-\-\-\-\-\-</entry>
                   <entry xpath="ID" >Parent</entry>
                   <entry xpath="A_STATUS"/>
                   <entry xpath="A_PROBLEM_DESC"/>
                   <entry xpath="L_APPOITMENT_USER"/>
                 </row>
-                <RelatedFeature xpath="PARENT_ID" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-- test sciagniecia powiazanych pism do sprawy -->
+                <RelatedFeature xpath="PARENT_ID" xpath_value="../ID" typeName="p5_default_db:PROBLEMS">  <!-\- test sciagniecia powiazanych pism do sprawy -\->
                   <row>
-                    <entry>---------</entry>
+                    <entry>-\-\-\-\-\-\-\-\-</entry>
                     <entry xpath="ID" >Parent</entry>
                     <entry xpath="A_STATUS"/>
                     <entry xpath="A_PROBLEM_DESC"/>
                     <entry xpath="L_APPOITMENT_USER"/>
                   </row>
                 </RelatedFeature>
-              </RelatedFeature>
+              </RelatedFeature>-->
             </RelatedFeature>
           </tbody>
         </tgroup>

+ 5 - 0
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-druk/build.xml

@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project basedir="." name="PRINT_TEMPLATE" default="buildpdf_recursed"  >
     
+    <!-- template do kopiowania test-druk @2017-03-02 bindera 
+    Copyright BIALL-NET sp. z o.o. wszelkie prawa zastrzezone
+    
+    -->
     
     
     <!-- Przykładowe wyzwolenie z bash :
@@ -123,6 +127,7 @@
         <record name="${temp}/ant.log" loglevel="verbose" append="true"/>
         <property name="loop_xpath"  value="root"/>
         <property name="build_recurse_ant.xml" value="${temp}/${uuid}.build_${loop_xpath}.xml"/>
+        <echo>#113 ant build_recurse_ant.xml=${build_recurse_ant.xml}; </echo>
         <!--<delete file="${build_recurse_ant.xml}"/>-->
         <xslt basedir="./" style="${build_recurse_ant.xsl}" in="${main_build_recurse_ant.dita_with_id}"  destdir="./" out="${build_recurse_ant.xml}"  >
             <factory name="net.sf.saxon.TransformerFactoryImpl">    

+ 88 - 62
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -53,7 +53,29 @@
     <!-- second step fist loop - with data -->
     <!--<xsl:param name="wfs_output.xml"/>--> <!-- to be set in second step by ant build generated by this style to fill by its data childs -->
     
-    <xsl:template match="*">
+    
+    <!-- opis dzialania template dla przetwarzania wezlow na podstawie schematu i budowania zagniezdzonego pliku xml z
+        instancjami na podstawie tego samego schematu 
+        
+        wyzwolenie inicjalizujace z build.xml buduje  "wyzwolenie glowne" gdzie na output daje wynikowy build.
+        
+        system wyzwala dwa etapy 
+            wyzwolenie glowne - do okreslenia zaleznosci wezla i zbudowania zapytania o dane
+            wyzwolenie after_first_ant_assing_vars - do podstawienia danych z wyzwolenia poprzedniego oraz przygotowania build "dla kolejnego X" do wyzwolenia glownego 
+            
+        
+        wyzwolenie glowne - szuka pierwszego RelatedFeature, ktore zawsze domyslnie jest na poczatku template, potem w nim grzebie - jak znajdzie - wchodzi w dol 
+         w ramach tego wyzwolenia przygotowuje task dla biezecego przygotowania ant_build - mode ant_target
+         w ramach tego wyzwolenia juz musi przeanalizowac jakie sa dalsze zadania do wyzwolenia "dla kolejnego X' ant_build - 
+            mode place_subant (jest okazja do zrobienia builda) do poprawy zagniezdzenia - co robi na podstawie szukania plikow w kontekscie wyzwolenia  after_first_ant_assing_vars 
+        
+         wyzwolenie after_first_ant_assing_vars - to wyzwile
+                 to wyzwolenie podstawia dane do dita.vals.xml w celu zlozenia pliku wyjsciowego
+                 to wyzwolenie powinno juz zrobic ant_buildy "dla kolejnego X'
+                 to wyzwolenie korzysta z apply-templates wyzwolenia glownego, w celu przygotowania ant_build 
+
+        -->
+    <xsl:template match="*"> 
         <xsl:param name="typeName"  select="$typeName" />
         <xsl:param name="xpath" select="$xpath" />
         <xsl:param name="xpath_value" select="$xpath_value" />
@@ -231,7 +253,10 @@
         </xsl:choose>
     </xsl:template>
     
-    
+    <!-- trzeba przetwarzac child_nodes do pierwszego napotkania RelatedFeature -->
+    <xsl:template mode="child_nodes" match="*">
+        <xsl:copy-of select="."/>
+    </xsl:template>
     
     <xsl:template mode="place_subant" match="RelatedFeature">
         <xsl:param name="uuid" required="yes"/>
@@ -240,37 +265,37 @@
         <!-- wygenerujemy liste ant -->
         
         <echo> #235 ant szukam fileset id=builds_to_ant w <xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'_x2f_.',@xml_id,'.',substring-after(@typeName,':'),'.*.xml')"/> </echo>
-        <fileset id="builds_to_ant{$loop_xpath_real}" dir="temp" includes="{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.*.xml" />
+        <fileset id="builds_to_ant{$loop_xpath_real}{@xml_id}" dir="temp" includes="{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.*.xml" />
         
-        <property name="builds_to_ant{$loop_xpath_real}" refid="builds_to_ant{$loop_xpath_real}"/>
+        <property name="builds_to_ant{$loop_xpath_real}{@xml_id}" refid="builds_to_ant{$loop_xpath_real}{@xml_id}"/>
         <!--<tempfile property="builds_to_ant.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.builds_to_ant-"/>-->
         <xsl:element name="tempfile">
-            <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_xpath_real)"/>
+            <xsl:attribute name="property" select="concat('builds_to_ant.xml',$loop_xpath_real,@xml_id)"/>
             <xsl:attribute name="deleteonexit" select="'no'"/>
             <xsl:attribute name="destdir" select="'temp'"/>
             <xsl:attribute name="suffix" select="'.xml'"/>
-            <xsl:attribute name="prefix" select="'${uuid}.builds_to_ant-'"/>
+            <xsl:attribute name="prefix" select="concat('${uuid}.builds_to_ant-',@xml_id,'-')"/>
         </xsl:element>
         <!--<tempfile property="builds_to_ant_file.xml" deleteonexit="no" destdir="temp" suffix=".xml" prefix="${uuid}.build_to_ant_file-"/>-->
         <xsl:element name="tempfile">
-            <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_xpath_real)"/>
+            <xsl:attribute name="property" select="concat('builds_to_ant_file.xml',$loop_xpath_real,@xml_id)"/>
             <xsl:attribute name="deleteonexit" select="'no'"/>
             <xsl:attribute name="destdir" select="'temp'"/>
             <xsl:attribute name="suffix" select="'.xml'"/>
-            <xsl:attribute name="prefix" select="'${uuid}.build_to_ant_file-'"/>
+            <xsl:attribute name="prefix" select="concat('${uuid}.build_to_ant_file-',@xml_id,'-')"/>
         </xsl:element>
         <echo>#235 ant do: builds_to_ant.xml=${builds_to_ant_file.xml} mode="place_subant" match="RelatedFeature" </echo>
         <!--<echoxml file="'${builds_to_ant.xml}'"><builds_to_ant>${builds_to_ant}</builds_to_ant></echoxml>-->
         <xsl:element name="echoxml">
-            <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_xpath_real,'}')"/>
-            <builds_to_ant>${builds_to_ant<xsl:value-of select="$loop_xpath_real"/>}</builds_to_ant>
+            <xsl:attribute name="file" select="concat('${builds_to_ant.xml',$loop_xpath_real,@xml_id,'}')"/>
+            <builds_to_ant>${builds_to_ant<xsl:value-of select="concat($loop_xpath_real,@xml_id)"/>}</builds_to_ant>
         </xsl:element>
         <xsl:element name="xslt">
             <xsl:attribute name="basedir" select="'./'"/>
             <xsl:attribute name="style" select="$builds_to_ant.xsl"/>
-            <xsl:attribute name="in" select="concat('${builds_to_ant.xml',$loop_xpath_real,'}')"/>
+            <xsl:attribute name="in" select="concat('${builds_to_ant.xml',$loop_xpath_real,@xml_id,'}')"/>
             <xsl:attribute name="destdir" select="'./'"/>
-            <xsl:attribute name="out" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,'}')"/>
+            <xsl:attribute name="out" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
             <factory name="net.sf.saxon.TransformerFactoryImpl">
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
                 <!--<attribute name="http://saxon.sf.net/feature/initialMode"
@@ -278,7 +303,7 @@
             </factory>
             
             <param name="temp" expression="{$temp}"/>
-            <param name="loop_xpath_real" expression="{$loop_xpath_real}"/>
+            <param name="loop_xpath_real" expression="{$loop_xpath_real}{@xml_id}"/>
             <!--<xsl:element name="param">
                 <xsl:attribute name="name" select="'default_antfile'"/>
                 <xsl:attribute name="expression" select="concat($temp,'/',$builds_to_ant_file.xml"/>
@@ -290,7 +315,7 @@
         <!--<ant antfile="{$temp}/{$uuid}.build_{$loop_xpath}_x2f_.{@xml_id}.{ substring-after(@typeName,':') }.1.xml" dir="."/>-->
         
         <xsl:element name="ant">
-            <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,'}')"/>
+            <xsl:attribute name="antfile" select="concat('${builds_to_ant_file.xml',$loop_xpath_real,@xml_id,'}')"/>
         </xsl:element>
         <!--<ant antfile="{$temp}/${builds_to_ant_file.xml}" dir="."/>-->
         
@@ -307,9 +332,7 @@
     </xsl:template>
     <xsl:template mode="place_subant" match="text()|comment()"/>
     
-    <xsl:template mode="child_nodes" match="*">
-        <xsl:copy-of select="."/>
-    </xsl:template>
+    
 
     
     <xsl:template match="RelatedFeature"  mode="ant_target" >  
@@ -474,7 +497,7 @@
     <xsl:template match="RelatedFeature" mode="after_first_ant_assing_vars">
         <xsl:param name="loop_xpath" select="$loop_xpath"/>
         <RelatedFeatureRoot>
-            <xsl:message>#228  try to open $wfs_output=doc(<xsl:value-of select="$wfs_output"/>); @xml_id=<xsl:value-of select="@xml_id"/>; templ match RelatedFeature mode after_first_ant_assing_vars dla @typeName=<xsl:value-of select="@typeName"/>;</xsl:message>
+            <xsl:message>#228  @xml_id=<xsl:value-of select="@xml_id"/>; templ match RelatedFeature mode after_first_ant_assing_vars dla @typeName=<xsl:value-of select="@typeName"/>; try to open $wfs_output=doc(<xsl:value-of select="$wfs_output"/>); </xsl:message>
         <!-- first assign xpath to features from  -->
         <xsl:variable name="wfs_output_nodes" select="doc($wfs_output)"/>
         <xsl:variable name="current_RelatedFeature" select="*"/>
@@ -555,50 +578,7 @@
     
     <xsl:template match="text()" mode="after_first_ant_assing_xpath"/>
     
-    <xsl:template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
-        <xsl:param name="input_obj_with_xpath" required="yes"/>
-        <xsl:param name="xml_id_parent" required="yes"/>
-        <xsl:param name="loop_xpath"  select="$loop_xpath"/>
-        <xsl:param name="feature_pos"   required="yes"/>
-        <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>
-        <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
-        <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
-        <xsl:variable name="xml_id" select="@xml_id"/>
-        <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
-        <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
-        <!--<debug_358_RelatedFeature>
-            <xsl:copy-of select="$input_obj_with_xpath"/>
-        </debug_358_RelatedFeature>-->
-        <!--<xsl:variable name="feature_pos">
-            <xsl:choose>
-                <xsl:when test="$feature_pos=1"/>
-                <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
-            </xsl:choose>
-        </xsl:variable>-->
-        <xsl:message>#389  jest okazja do zrobienia bilda $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"/>;  result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs  </xsl:message>
-            
-        <xsl:result-document href="{$uuid}.build_{$loop_xpath}.{$feature_pos}.xml">
-            <xsl:apply-templates select=".">
-                <xsl:with-param name="typeName" select="@typeName"/>
-                <xsl:with-param name="xpath" select="@xpath"/>
-                <xsl:with-param name="xpath_value" select="@xpath_value"/>
-                <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
-                <xsl:with-param name="input_obj_with_xpath"  select="$input_obj_with_xpath"/>
-                <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
-                <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
-                <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
-                <xsl:with-param name="feature_pos"   select="$feature_pos"/>
-                <!--<xsl:with-param name="wfs_output.xml" />-->
-            </xsl:apply-templates>
-        </xsl:result-document>
-        <xsl:element name="RelatedFeature">
-            <xsl:copy-of select="@*"/>
-            <xsl:attribute name="featureID_name" select="$featureID_name"/>
-            <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
-        </xsl:element>
-        
-    </xsl:template>
-    
+    <!-- przetwarzanie kolejne w celu podstawienia wartosci i wystawienia build dla kolejnych wezlow - problem z obsluga rownorzednie zagniezdzonych wezlow poprzez inne wezly -->
     <xsl:template  match="*" mode="after_first_ant_assing_vars_childs">
         <xsl:param name="xml_id_parent" required="yes"/>
         <xsl:param name="loop_xpath"   required="yes"/>
@@ -663,6 +643,52 @@
             </xsl:choose>
         </xsl:for-each>
     </xsl:template>
+    
+    <xsl:template  match="RelatedFeature" mode="after_first_ant_assing_vars_childs">
+        <xsl:param name="input_obj_with_xpath" required="yes"/>
+        <xsl:param name="xml_id_parent" required="yes"/>
+        <xsl:param name="loop_xpath"  select="$loop_xpath"/>
+        <xsl:param name="feature_pos"   required="yes"/>
+        <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>
+        <!-- jest okazja do zrobienia bilda aby sciagnal rzeczy nizej -->
+        <xsl:variable name="featureID_name" select="substring-after(@typeName,':')"/>
+        <xsl:variable name="xml_id" select="@xml_id"/>
+        <xsl:variable name="loop_xpath" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>
+        <!--<xsl:variable name="loop_xpath_save" select="concat($loop_xpath,'_x2f_.',$xml_id,'.',$featureID_name)"/>--> <!-- tutaj zapisal sie build z wezla z parent -->
+        <!--<debug_358_RelatedFeature>
+            <xsl:copy-of select="$input_obj_with_xpath"/>
+        </debug_358_RelatedFeature>-->
+        <!--<xsl:variable name="feature_pos">
+            <xsl:choose>
+                <xsl:when test="$feature_pos=1"/>
+                <xsl:otherwise><xsl:value-of select="$feature_pos"/></xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>-->
+        <xsl:message>#389  jest okazja do zrobienia bilda $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"/>;  result-document=<xsl:value-of select="concat($uuid,'.build_',$loop_xpath,'.xml')"/> match=RelatedFeature mode=after_first_ant_assing_vars_childs  </xsl:message>
+            
+        <xsl:result-document href="{$uuid}.build_{$loop_xpath}.{$feature_pos}.xml">
+            <xsl:apply-templates select=".">
+                <xsl:with-param name="typeName" select="@typeName"/>
+                <xsl:with-param name="xpath" select="@xpath"/>
+                <xsl:with-param name="xpath_value" select="@xpath_value"/>
+                <!--<xsl:with-param name="loop_xpath_save" select="$loop_xpath"/>-->
+                <xsl:with-param name="input_obj_with_xpath"  select="$input_obj_with_xpath"/>
+                <xsl:with-param name="loop_xpath" select="$loop_xpath"/>
+                <xsl:with-param name="wfs_output" select="concat($uuid,'.',$loop_xpath)" />
+                <xsl:with-param name="xml_id_parent" select="$xml_id_parent"/>
+                <xsl:with-param name="feature_pos"   select="$feature_pos"/>
+                <!--<xsl:with-param name="wfs_output.xml" />-->
+            </xsl:apply-templates>
+        </xsl:result-document>
+        <xsl:element name="RelatedFeature">
+            <xsl:copy-of select="@*"/>
+            <xsl:attribute name="featureID_name" select="$featureID_name"/>
+            <xsl:attribute name="loop_xpath" select="$loop_xpath"/>
+        </xsl:element>
+        
+    </xsl:template>
+    
+    
     <xsl:template match="text()" mode="after_first_ant_assing_vars_childs"/>
     <xsl:template match="comment()" mode="after_first_ant_assing_vars_childs"/>
     <!-- pozbieranie do kupy wszystkich xmli i zlozenie dity -->