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

+ 69 - 0
SE/schema/WPS_Functions/default_db/CRM_PROCES_tree/build.CRM_PROCES_tree.PRODUCT.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:CRM_PROCES_tree="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/default_db/CRM_PROCES_tree/CRM_PROCES_tree.xsd"
+         xmlns:p5xsl="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/xsl_interface/xsl_interface.xsd"
+         basedir="../../."
+         default="PRODUCT"
+         name="CRM_PROCES_tree.PRODUCT">
+   <description>p5suis:say Created function CRM_PROCES_tree with prefix CRM_PROCES_tree by p5ant module</description>
+   <include as="WPS_Functions" file="../../build.WPS_Functions.PRODUCT.xml"/>
+   <condition property="CRM_PROCES_tree.PRODUCT.ifdef.parent"
+              taskname="CRM_PROCES_tree.parent.PRODUCT.ifdef">
+      <isset property="WPS_Functions.PRODUCT.name"/>
+   </condition>
+   <property name="CRM_PROCES_tree.PRODUCT.name"
+             value="${WPS_Functions.PRODUCT.name}.CRM_PROCES_tree"/>
+   <property name="CRM_PROCES_tree.PRODUCT.vendor-domain"
+             value="${WPS_Functions.PRODUCT.name}.CRM_PROCES_tree"/>
+   <property name="CRM_PROCES_tree.basedir"
+             value="${WPS_Functions.basedir}/default_db/CRM_PROCES_tree"/>
+   <property name="CRM_PROCES_tree.repository"
+      value="${WPS_Functions.repository}/default_db/CRM_PROCES_tree"/>
+   <property name="CRM_PROCES_tree.install"
+             value="${CRM_PROCES_tree.basedir}/install"/>
+   <property location="${WPS_Functions.temp}/default_db/CRM_PROCES_tree"
+             name="CRM_PROCES_tree.temp"/>
+   <!--<property location="${CRM_PROCES_tree.basedir}/CRM_PROCES_tree.xsl"
+             name="CRM_PROCES_tree.xsl"/>-->
+   <property location="${CRM_PROCES_tree.basedir}/CRM_PROCES_tree.xsd"
+             name="CRM_PROCES_tree.xsd"/>
+   
+   <property location="${CRM_PROCES_tree.basedir}/build_CRM_PROCES_tree.xml"
+      name="CRM_PROCES_tree.build.xml"/>
+   
+   
+   
+   
+   <!--<property location="${CRM_PROCES_tree.repository}/install_example.file"
+             name="CRM_PROCES_tree.install_example"/>-->
+   
+   
+  
+   <target depends="basedir"
+           description="to create basedir, includes and install"
+           name="PRODUCT"/>
+   <target description="to create local dirs" name="basedir">
+      <propertyset id="CRM_PROCES_tree.local.properties">
+         <propertyref prefix="CRM_PROCES_tree"/>
+         <mapper from="CRM_PROCES_tree.*" to="local.*" type="glob"/>
+      </propertyset>
+      <antcall inheritall="false" target="WPS_Functions.basedir.p5bws:dirs">
+         <propertyset refid="CRM_PROCES_tree.local.properties"/>
+      </antcall>
+   </target>
+   <target description="To delete all temp and repository" name="clean">
+      <antcall inheritall="false" target="WPS_Functions.basedir.p5bws:dirs.clean">
+         <propertyset refid="CRM_PROCES_tree.local.properties"/>
+      </antcall>
+   </target>
+   <target description="To delete all temp and repository" name="clean.temp">
+      <antcall inheritall="false"
+               target="WPS_Functions.basedir.p5bw.p5bws:dirs.temp.clean">
+         <propertyset refid="CRM_PROCES_tree.local.properties"/>
+      </antcall>
+   </target>
+   <target name="parent.PRODUCT.ifdef"
+           unless="CRM_PROCES_tree.WPS_Functions.PRODUCT.ifdef.parent">
+      <fail>There is not set correct parent PRODUCT from expected file="../build.WPS_Functions.PRODUCT.xml"</fail>
+   </target>
+   
+</project>

+ 38 - 11
SE/schema/WPS_Functions/default_db/recurse_ant/build_recurse_ant.xml

@@ -38,7 +38,7 @@
         -Duuid=1 -DwebRootUrl=somePathDir-->
     
     <include file="build.recurse_ant.PRODUCT.xml"/>
-    <include file="${p5build_SE.build}" as="p5build_SE"/> <!-- for paths and dirs create in some tasks -->
+    <include file="${basedir}/../build_SE.xml" as="p5build_SE"/><!-- for paths and dirs create in some tasks -->     <!-- for paths and dirs create in some tasks -->
     <include file="${send_email.build.xml}" as="send_email"/>
     
     <property name="basedir"  location="${basedir}" /> <!-- do ustalenia glownego katalogu -->
@@ -77,9 +77,9 @@
     <!-- DO NOT SET --><property name="parallel_pos" value="1"/>
     <!--<property name="temp_name" value="temp" />--> <!-- temp files-->
     <property name="temp" value="${default_db:recurse_ant_basedir.temp}${loop_path_recurs}" /> <!-- temp files-->
-    <echo>#75 before $xpath_query.xsl = ${xpath_query.xsl} , $uuid = ${uuid}</echo>
+    <!--<echo>#75 before $xpath_query.xsl = ${xpath_query.xsl} , $uuid = ${uuid}</echo>-->#75 before $xpath_query.xsl = ${xpath_query.xsl} , $uuid = ${uuid}
     <property name="xpath_query.xsl" value="${default_db:recurse_ant_basedir.temp}/${uuid}.xpath_query.xsl"/>
-    <echo>#76 after $xpath_query.xsl = ${xpath_query.xsl} , $uuid = ${uuid}</echo> 
+    <!--<echo>#76 after $xpath_query.xsl = ${xpath_query.xsl} , $uuid = ${uuid}</echo>-->#76 after $xpath_query.xsl = ${xpath_query.xsl} , $uuid = ${uuid} 
     <property name="build_recurse_ant_xpath_query.xsl" value="${default_db:recurse_ant_basedir.temp}/build_recurse_ant_xpath_query.xsl"/>
     
     <property name="process_locks" value="${default_db:recurse_ant_basedir.temp}/.locks"/>
@@ -1107,8 +1107,8 @@
     </target>
     
     
-    <target name="buildpdf_recursed_xsl_mail" 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 - with send mail">
-        <record name="buildpdf_recursed_xsl.log" action="start" />
+    <target name="buildpdf_recursed_xsl_mail" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,set_dita"  description="URL_TASK buildpdf_recursed_xsl_mail szybki druk z wysylka mailem">
+        <record name="buildpdf_recursed_xsl_mail.log" action="start" />
         <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}">
             <empty>empty</empty>
@@ -1153,11 +1153,8 @@
             <arg value="${out}"/>
         </exec>-->
         
-        <antcall target="send_email.send_email_from_xml_parsed">
-            <param name="send_email.xml_to_parse.xml" value="${out_task.dita.final}"/>
-        </antcall>
         
-        <exec executable="${dita.dir}" dir=".">
+<exec executable="${dita.dir}" dir=".">
             <arg value="-i"/>
             <arg value="${out_task.dita.final}" />
             <!-- <arg value="-t" />
@@ -1165,7 +1162,7 @@
             <arg value="-f" />
             <arg value="pdf"/>
             <arg value="-o"/>
-            <arg value="${out}"/>
+            <arg value="${user.dir}/${out}"/>
         </exec>
         <exec  executable="bash" dir="." outputproperty="out_task_file">
             <arg value="-c"/>
@@ -1173,6 +1170,7 @@
         </exec>
         
         
+<echo>        </echo>
         <echo message="OUTPUT__START"/>
         <!--<echo>
             &lt;br&gt;Wygenerowano wyjsciowy plik XML - sciagnij go &lt;a href=&quot;${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.xml&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.xml&lt;/a&gt;&lt;/br&gt; 
@@ -1183,11 +1181,40 @@
         <echo>
             &lt;br&gt;Wyslanie linka mailem : &lt;a href=&quot;mailto:?subject=Wiadomosc nr ${xpath_value}&amp;body=link do sprawy:  ${webRootUrl}/${out}/${out_task.dita.final.noext}.pdf&quot;&gt;Wyslanie linka mailem&lt;/a&gt;   &lt;/br&gt; 
         </echo>
+        <antcall target="send_email.send_email_from_xml_parsed">
+            <param name="send_email.xml_to_parse.xml" value="${out_task.dita.final}"/>
+            <param name="antFunctionUrl" value="${antFunctionUrl}"/>
+            <param name="confirmAntfile" value="${confirmAntfile}"/>
+            <param name="confirmAntfileTarget" value="${confirmAntfileTarget}"/>
+        </antcall>
+        <echo>
+            <!--<echo>
+            &lt;br&gt;# Wygenerowano wyjsciowy plik PDF - sciagnij go &lt;a href=&quot;${webRootUrl}/${out}/${uuid}.pdf&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out}/${uuid}.pdf&lt;/a&gt;&lt;/br&gt; 
+
+                    </echo>-->-->
+        <!-- menu.choosed       https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=ant&path=default_db.in7_dziennik_koresp/etykieta&template=buildpdf_recursed_xsl_mail&typeName=default_db:IN7_DZIENNIK_KORESP&primaryKey=63007&primaryKeyField=ID -->
+            <!-- dzialajace         https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=ant&path=default_db.in7_dziennik_koresp/etykieta&template=buildpdf_recursed_xsl_mail&typeName=default_db:IN7_DZIENNIK_KORESP&primaryKey=63007&primaryKeyField=ID -->
+            <!-- DantFunctionUrl =  https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=ant&path=default_db.in7_dziennik_koresp/etykieta&template=buildpdf_recursed_xsl_mail&typeName=default_db:IN7_DZIENNIK_KORESP&primaryKey=63007&primaryKeyField=ID -->
+            <!-- $outputFunctionUrl https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=output&path=default_db.in7_dziennik_koresp/etykieta&file= -->
+            <!-- pdf                https://biuro.biall-net.pl/SE/version-git/schema/ant-url_action/default_db.in7_dziennik_koresp/etykieta/    out/    2018-04-20-01_09_2128f9d7_out_task_dita_final.pdf -->
+            <!-- link               https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=ant&path=default_db.in7_dziennik_koresp/etykieta&template=buildpdf_recursed_xsl_mail&typeName=default_db:IN7_DZIENNIK_KORESP&primaryKey=63007&primaryKeyField=ID-->
+            
+            URL_TASK send_email.send_email_from_xml_parsed.confirm
+            Wysłanie mailem przez system ${webRootUrl}  
+            $url = ${url}
+            $typeName = ${typeName}
+            $xpath = ${xpath}
+            $xpath_value = ${xpath_value}
+            $api_url = ${api_url}
+            $outputFunctionUrl = ${outputFunctionUrl}
+            $antFunctionUrl = ${antFunctionUrl}
+            $confirmAntfile = ${confirmAntfile} / $confirmAntfileTarget = ${confirmAntfileTarget}
+        </echo>
         <!--<echo>
             &lt;br&gt;# Wygenerowano wyjsciowy plik PDF - sciagnij go &lt;a href=&quot;${webRootUrl}/${out}/${uuid}.pdf&quot; target=&quot;_blank&quot;&gt; &quot;${webRootUrl}/${out}/${uuid}.pdf&lt;/a&gt;&lt;/br&gt; 
         </echo>-->
         <echo message="OUTPUT__END"/>
-        <record name="buildpdf_recursed_xsl.log" action="stop" />
+        <record name="buildpdf_recursed_xsl_mail.log" action="stop" />
     </target>
     
     <target name="buildpdf_recursed_html5" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check,php_session_id_check,check_dita" if="${test_if_dita}" description="URL_TASK Pobierz Wersję HTML">

+ 13 - 6
SE/schema/WPS_Functions/send_email/build_send_email.xml

@@ -14,6 +14,9 @@
    
    <target name="send_email_from_xml_parsed" description="To send email based on dita file - parse if there are any emails aviable">
       <input addproperty="send_email.xml_to_parse.xml" message="Type url to XML with emails to parse - like .dita file"/>
+      <input addproperty="antFunctionUrl" message="like https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&amp;_task=ant&amp;path=default_db.in7_dziennik_koresp/etykieta&amp;template=buildpdf_recursed_xsl_mail&amp;typeName=default_db:IN7_DZIENNIK_KORESP&amp;primaryKey=63007&amp;primaryKeyField=ID" />
+      <input addproperty="confirmAntfile" message="path to ant file to confirm something" />
+      <input addproperty="confirmAntfileTarget" message="name of target to confirm something" />
       <!--<property name="send_email.xml_to_parse.xml" location="/opt/local/pl.procesy5/p5build_SE/temp/WPS_Functions/temp/recurse_ant/62888prezes1/62888prezes1_out_task_dita_final.dita"/>-->
       <tempfile property="send_email.send_email_from_xml_parsed.xml" destdir="${send_email.temp}" prefix="send_email.send_email_from_xml_parsed." suffix=".xml"/>
       <tempfile property="send_email.send_email_from_xml_parsed.build.xml" destdir="${send_email.temp}" prefix="send_email.send_email_from_xml_parsed.build.xml" suffix=".xml"/>
@@ -29,7 +32,7 @@
          <!--<param name="main_build_recurse_ant.dita" expression="${main_build_recurse_ant.dita}"/>-->
          <!--<param name="uuid" expression="${uuid_tested}"/>-->
          <param name="basedir" expression="${basedir}"/>
-        <!-- <param name="temp" expression="${temp}"/>
+         <!-- <param name="temp" expression="${temp}"/>
          <param name="with_RelatedFeatureLoop" expression="1"/>
          <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>-->
          
@@ -41,17 +44,21 @@
             <attribute name="http://saxon.sf.net/feature/initialMode" value="{http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/send_email/send_email.xsd}send_email.send_email_from_xml_parsed.build.xml"/>
          </factory>
          <classpath location="/opt/local/share/java/saxon9he.jar"/>
-        
+         <param name="send_email.send_email_from_xml_parsed.xml" expression="${send_email.send_email_from_xml_parsed.xml}"/>
          <param name="basedir" expression="${basedir}"/>
          <param name="send_email.INSTALL.javax.mail-1.6.1.jar" expression="${send_email.INSTALL.javax.mail-1.6.1.jar}"/>
+         <param name="antFunctionUrl" expression="${antFunctionUrl}"/>
+         <param name="confirmAntfile" expression="${confirmAntfile}"/>
+         <param name="confirmAntfileTarget" expression="${confirmAntfileTarget}"/>
+         
          
       </xslt>
       
-      <ant antfile="${send_email.send_email_from_xml_parsed.build.xml}"/>
-      
-      <!--<exec executable="open">
+      <ant antfile="${send_email.send_email_from_xml_parsed.build.xml}" target="send_email.send_email_from_xml_parsed.build.xml.to.confirm"/>
+      <!--<ant antfile="${send_email.send_email_from_xml_parsed.build.xml}" target="send_email.send_email_from_xml_parsed.build.xml.confirmed.all"/>-->
+      <exec executable="open">
          <arg file="${send_email.send_email_from_xml_parsed.build.xml}"/>
-      </exec>-->
+      </exec>
       
    </target>
    

+ 36 - 11
SE/schema/WPS_Functions/send_email/send_email.xsl

@@ -9,7 +9,10 @@
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     <xsl:param name="basedir"/>
-    
+    <xsl:param name="send_email.send_email_from_xml_parsed.xml"/>
+    <xsl:param name="antFunctionUrl" />
+    <xsl:param name="confirmAntfile" />
+    <xsl:param name="confirmAntfileTarget" />
     
     <xsl:template mode="send_email:send_email.send_email_from_xml_parsed.xml" match="*">
         <send_email:send_email_from_xml_parsed>
@@ -45,7 +48,7 @@
         <project 
             basedir="{$basedir}"
             name="send_email.send_email_from_xml_parsed.build.xml"
-            default="send_email.send_email_from_xml_parsed.build.xml"><!--#98 This is generated by xsl:template match="p5build_SE:procesy5_config" mode="p5build_SE:build_procesy5_config.default_db.properties.xml"-->
+            default="send_email.send_email_from_xml_parsed.build.xml.to.confirm"><!--#98 This is generated by xsl:template match="p5build_SE:procesy5_config" mode="p5build_SE:build_procesy5_config.default_db.properties.xml"-->
            
            <xsl:variable name="title">
                <xsl:choose>
@@ -57,19 +60,41 @@
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
-           
-            <target name="send_email.send_email_from_xml_parsed.build.xml">
+            <xsl:copy-of select="$title"/>
+            <target name="send_email.send_email_from_xml_parsed.build.xml.to.confirm">
                 <xsl:copy-of select="$title"/>
                 <xsl:for-each select="send_email:send_email.send_email_from_xml_parsed.xml.child">
-                    <echo>Sending message to <xsl:value-of select="."/></echo>
-                    <mail from="a.binder@biall-net.pl" failonerror="false"
-                        tolist="{text()}">
-                        <xsl:attribute name="subject">${send_email.send_email_from_xml_parsed.build.xml.title}</xsl:attribute>
-                        <message>Test wiadomosci</message>
-                    </mail>
-
+                    <echo message="OUTPUT__START"/>
+                    <echo>&lt;br&gt;Will send sending message to <xsl:value-of select="."/> - 
+                        Run ant $send_email.send_email_from_xml_parsed.xml = <xsl:value-of select="$send_email.send_email_from_xml_parsed.xml"/>
+                        target send_email.send_email_from_xml_parsed.build.xml.confirm.<xsl:value-of select="position()"/>
+                        &lt;a href=&quot;${antFunctionUrl}&amp;confirmAntfile=${confirmAntfile}&amp;confirmAntfileTarget=send_email.send_email_from_xml_parsed.build.xml.confirm.<xsl:value-of select="position()"/>&gt;Wyslij mail do <xsl:value-of select="."/>&lt;/a&gt;
+                        &lt;/br&gt;</echo>
+                    <echo message="OUTPUT__END"/>
                 </xsl:for-each>
             </target>
+            <target name="send_email.send_email_from_xml_parsed.build.xml.confirmed.all">
+                <xsl:attribute name="depends">
+                    <xsl:for-each select="send_email:send_email.send_email_from_xml_parsed.xml.child">
+                        <xsl:choose>
+                            <xsl:when test="position() = 1"><xsl:text>send_email.send_email_from_xml_parsed.build.xml.confirm.</xsl:text><xsl:value-of select="position()"/></xsl:when>
+                            <xsl:otherwise><xsl:text>,send_email.send_email_from_xml_parsed.build.xml.confirm.</xsl:text><xsl:value-of select="position()"/></xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:for-each>
+                </xsl:attribute>
+            </target>
+                
+                <xsl:for-each select="send_email:send_email.send_email_from_xml_parsed.xml.child">
+                    <target name="send_email.send_email_from_xml_parsed.build.xml.confirm.{position()}">
+                    <echo>Sending message to <xsl:value-of select="."/></echo>
+                        <mail from="a.binder@biall-net.pl" failonerror="false"
+                            tolist="{text()}">
+                            <xsl:attribute name="subject">${send_email.send_email_from_xml_parsed.build.xml.title}</xsl:attribute>
+                            <message>Test wiadomosci</message>
+                        </mail>
+                    </target>
+                </xsl:for-each>
+            
         </project>
     </xsl:template>
     

+ 3 - 0
SE/schema/ant-url_action/default_db.in7_dziennik_koresp/etykieta/build_recurse_ant.xml

@@ -1183,6 +1183,9 @@
         </echo>
         <antcall target="send_email.send_email_from_xml_parsed">
             <param name="send_email.xml_to_parse.xml" value="${out_task.dita.final}"/>
+            <param name="antFunctionUrl" value="${antFunctionUrl}"/>
+            <param name="confirmAntfile" value="${confirmAntfile}"/>
+            <param name="confirmAntfileTarget" value="${confirmAntfileTarget}"/>
         </antcall>
         <echo>
             <!-- $template = V::get('template', '', $_GET); -->