|
|
@@ -48,10 +48,8 @@
|
|
|
<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"/>
|
|
|
+ <!--<property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>--> <!-- katalog z xsl z projektu src-xmlschema.git -->
|
|
|
+
|
|
|
|
|
|
|
|
|
<!--<tempfile property="uuid" deleteonexit="yes"/>-->
|
|
|
@@ -59,6 +57,126 @@
|
|
|
<tempfile property="out_task.dita.final" deleteonexit="no" destdir="temp"/>
|
|
|
<!--<tempfile property="wfs_output" deleteonexit="no" destdir="temp" suffix=".xml" />-->
|
|
|
|
|
|
+ <!-- uuid -->
|
|
|
+ <target name="uuid_cond">
|
|
|
+ <condition property="uuid_set" taskname="uuid_check">
|
|
|
+ <or>
|
|
|
+ <equals arg1="${uuid}" arg2=""/>
|
|
|
+ <equals arg1="${uuid}" arg2="$${uuid}"/>
|
|
|
+ </or>
|
|
|
+ </condition>
|
|
|
+ </target>
|
|
|
+ <target name="uuid_check" depends="uuid_cond,uuid_ok,uuid_fail"/>
|
|
|
+ <target name="uuid_ok" unless="${uuid_set}" >
|
|
|
+ <property name="uuid_tested" value="${uuid}"/>
|
|
|
+ </target>
|
|
|
+ <target name="uuid_fail" if="${uuid_set}" >
|
|
|
+ <echo>uuid_fail setting to timestamp</echo>
|
|
|
+ <exec executable="date" outputproperty="uuid_tested" >
|
|
|
+ <arg line="-u +"%Y-%m-%dT%H%M%SZ""/>
|
|
|
+ </exec>
|
|
|
+ </target>
|
|
|
+ <!-- typeName -->
|
|
|
+ <target name="typeName_cond">
|
|
|
+ <condition property="typeName_set" taskname="typeName_check">
|
|
|
+ <or>
|
|
|
+ <equals arg1="${typeName}" arg2=""/>
|
|
|
+ <equals arg1="${typeName}" arg2="$${typeName}"/>
|
|
|
+ </or>
|
|
|
+ </condition>
|
|
|
+ </target>
|
|
|
+ <target name="typeName_check" depends="typeName_cond,typeName_ok,typeName_fail"/>
|
|
|
+ <target name="typeName_ok" unless="${typeName_set}" >
|
|
|
+ <property name="typeName_tested" value="${typeName}"/>
|
|
|
+ </target>
|
|
|
+ <target name="typeName_fail" if="${typeName_set}" >
|
|
|
+ <echo>typeName setting manually</echo>
|
|
|
+ <input addproperty="typeName_input" message="podaj typeName - nazwa obiektu np: nazwe obiektu np CRM_PROCES "/>
|
|
|
+ <property name="typeName_tested" value="p5_default_db:${typeName_input}"/>
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <!-- xpath -->
|
|
|
+ <target name="xpath_cond">
|
|
|
+ <condition property="xpath_set" taskname="xpath_check">
|
|
|
+ <or>
|
|
|
+ <equals arg1="${xpath}" arg2=""/>
|
|
|
+ <equals arg1="${xpath}" arg2="$${xpath}"/>
|
|
|
+ </or>
|
|
|
+ </condition>
|
|
|
+ </target>
|
|
|
+ <target name="xpath_check" depends="xpath_cond,xpath_ok,xpath_fail"/>
|
|
|
+ <target name="xpath_ok" unless="${xpath_set}" >
|
|
|
+ <property name="xpath_tested" value="${xpath}"/>
|
|
|
+ </target>
|
|
|
+ <target name="xpath_fail" if="${xpath_set}" >
|
|
|
+ <echo>xpath setting </echo>
|
|
|
+ <input addproperty="xpath_tested" message="Podaj xpath - po czym szukac glonwego zaglebienia - np ID "/>
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <!-- xpath_value -->
|
|
|
+ <target name="xpath_value_cond">
|
|
|
+ <condition property="xpath_value_set" taskname="xpath_value_check">
|
|
|
+ <or>
|
|
|
+ <equals arg1="${xpath_value}" arg2=""/>
|
|
|
+ <equals arg1="${xpath_value}" arg2="$${xpath_value}"/>
|
|
|
+ </or>
|
|
|
+ </condition>
|
|
|
+ </target>
|
|
|
+ <target name="xpath_value_check" depends="xpath_value_cond,xpath_value_ok,xpath_value_fail"/>
|
|
|
+ <target name="xpath_value_ok" unless="${xpath_value_set}" >
|
|
|
+ <property name="xpath_value_tested" value="${xpath_value}"/>
|
|
|
+ </target>
|
|
|
+ <target name="xpath_value_fail" if="${xpath_value_set}" >
|
|
|
+ <echo>xpath_value setting </echo>
|
|
|
+ <input addproperty="xpath_value_tested" message="Podaj xpath_value - podaj wartosc do wyszukiwania - np 1234"/>
|
|
|
+ </target>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- passwordBase64Basic -->
|
|
|
+ <target name="passwordBase64Basic_cond">
|
|
|
+ <condition property="passwordBase64Basic_set" taskname="passwordBase64Basic_check">
|
|
|
+ <or>
|
|
|
+ <equals arg1="${passwordBase64Basic}" arg2=""/>
|
|
|
+ <equals arg1="${passwordBase64Basic}" arg2="$${passwordBase64Basic}"/>
|
|
|
+ </or>
|
|
|
+ </condition>
|
|
|
+ </target>
|
|
|
+ <target name="passwordBase64Basic_check" depends="passwordBase64Basic_cond,passwordBase64Basic_ok,passwordBase64Basic_fail"/>
|
|
|
+ <target name="passwordBase64Basic_ok" unless="${passwordBase64Basic_set}" >
|
|
|
+ <property name="passwordBase64Basic_tested" value="${passwordBase64Basic}"/>
|
|
|
+ </target>
|
|
|
+ <target name="passwordBase64Basic_fail" if="${passwordBase64Basic_set}" >
|
|
|
+ <echo>passwordBase64Basic setting </echo>
|
|
|
+ <input addproperty="Username" message="podaj nazwe uzytkownika do autoryzacji w API ${api_url} ; np. a.binder"/>
|
|
|
+ <input addproperty="Password" message="podaj hasło dla uzytkownika ${Username} "/>
|
|
|
+ <exec outputproperty="passwordBase64Basic_tested" executable="base64" inputstring="${Username}:${Password}">
|
|
|
+ <!--<arg line="/bin/echo "${Username}:${Password}" | base64 - "/>-->
|
|
|
+ <!--<arg line="|"/>
|
|
|
+ <arg line="base64 -"/>-->
|
|
|
+ </exec>
|
|
|
+ <echo> Ustalono $passwordBase64Basic na ${passwordBase64Basic_tested} </echo>
|
|
|
+
|
|
|
+
|
|
|
+ </target>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <target name="konsola" description="wyzwolenie interaktywne z konsoli" depends="uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check">
|
|
|
+ <!--<property name="uuid" value="$"/>-->
|
|
|
+ <!--<exec command="date" outputproperty="uuidd" >
|
|
|
+ <arg line="-u +"%Y-%m-%dT%H%M%SZ""/>
|
|
|
+ </exec>-->
|
|
|
+ <!--<echo> Ustalilem uuid na ${uuidd}</echo>-->
|
|
|
+ <!--<echo>Podaj nazwe druku</echo>-->
|
|
|
+ <input addproperty="typeName" message="Podaj typeName - nazwe obiektu np p5_default_db:CRM_PROCES"/>
|
|
|
+ <input addproperty="xpath" message="Podaj xpath - po czym szukac glonwego zaglebienia - np ID"/>
|
|
|
+ <input addproperty="xpath_value" message="Podaj xpath_value - podaj wartosc do wyszukiwania - np 1234"/>
|
|
|
+ <input addproperty="passwordBase64Basic" message="Podaj passwordBase64Basic - Username i Password w typie base64 "/>
|
|
|
+ <echo> $typeName=${typeName_tested}; $xpath=${xpath_tested}; $xpath_value=${xpath_value} $passwordBase64Basic=${passwordBase64Basic_tested}</echo>
|
|
|
+
|
|
|
+ <antcall target="buildpdf_recursed"/>
|
|
|
+ </target>
|
|
|
+
|
|
|
|
|
|
<target name="install_folders">
|
|
|
<mkdir dir="${temp}"/>
|
|
|
@@ -68,16 +186,12 @@
|
|
|
</target>
|
|
|
|
|
|
|
|
|
- <target name="set_dita" >
|
|
|
-
|
|
|
+ <target name="set_dita" depends="check_set_default_db_xml_cache.public_local,check_default_db_xml_cache.public_default" >
|
|
|
<!--<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/.*://'"/>
|
|
|
+ <arg value="echo ${typeName_tested} |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>
|
|
|
|
|
|
@@ -88,13 +202,43 @@
|
|
|
</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="set_default_db_xml_cache.public_local">
|
|
|
+ <condition property="set_default_db_xml_cache.public_local">
|
|
|
+ <available file="default_db_xml_cache.public/build_recurse_ant_merge_dita_from_temp.xsl"/>
|
|
|
+ </condition>
|
|
|
+ <echo>Ustawiam sciezke default_db_xml_cache.public w glownym katalogu ./default_db_xml_cache.public</echo>
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <target name="set_default_db_xml_cache.public_default">
|
|
|
+ <echo>Ustawiam sciezke default_db_xml_cache.public zagniezdzona domyslnie ../../../default_db_xml_cache.public </echo>
|
|
|
+ <!--<condition property="set_default_db_xml_cache.public_default">
|
|
|
+ <available></available>
|
|
|
+ </condition>
|
|
|
+ -->
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <target name="check_set_default_db_xml_cache.public_local" depends="set_default_db_xml_cache.public_local" if="${set_default_db_xml_cache.public_local}">
|
|
|
+ <echo> testujemy czy jest dita</echo>
|
|
|
+ <property name="default_db_xml_cache.public" value="default_db_xml_cache.public"/>
|
|
|
+ <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"/>
|
|
|
+ </target>
|
|
|
+
|
|
|
+ <target name="check_default_db_xml_cache.public_default" depends="set_default_db_xml_cache.public_local" unless="${set_default_db_xml_cache.public_local}">
|
|
|
+ <echo> Ustawiamy ../../../default_db_xml_cache.public</echo>
|
|
|
+ <property name="default_db_xml_cache.public" value="../../../default_db_xml_cache.public"/>
|
|
|
+ <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"/>
|
|
|
+
|
|
|
+ </target>
|
|
|
+
|
|
|
<target name="info_brak_dita" unless="${test_if_dita}">
|
|
|
<echo message="OUTPUT__START"/>
|
|
|
<echo><br>Brakuje druku dla powiązanego obiektu ${main_build_recurse_ant.dita} </br></echo>
|
|
|
@@ -123,10 +267,9 @@
|
|
|
<!-- 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"/>
|
|
|
+ <property name="build_recurse_ant.xml" value="${temp}/${uuid_tested}.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}" >
|
|
|
@@ -136,20 +279,20 @@
|
|
|
<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="passwordBase64Basic" expression="${passwordBase64Basic_tested}"/>
|
|
|
<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="uuid" expression="${uuid_tested}"/>
|
|
|
|
|
|
<!--<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="typeName" expression="${typeName_tested}"/>
|
|
|
+ <param name="xpath" expression="${xpath_tested}"/> <!-- to be set initially like as key to search ID -->
|
|
|
+ <param name="xpath_value" expression="${xpath_value_tested}"/> <!-- 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}"/>
|
|
|
@@ -171,7 +314,7 @@
|
|
|
<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="uuid" expression="${uuid_tested}"/>
|
|
|
<param name="basedir" expression="${basedir}"/>
|
|
|
<param name="temp" expression="${temp}"/>
|
|
|
</xslt>
|
|
|
@@ -179,26 +322,9 @@
|
|
|
</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 "${url}" |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}">
|
|
|
-
|
|
|
+ <target name="buildpdf_recursed" depends="check_dita,info_brak_dita,uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check" 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"/>
|
|
|
@@ -217,7 +343,7 @@
|
|
|
<echo message="OUTPUT__START"/>
|
|
|
<!--<echo> url = ${url}
|
|
|
</echo>-->
|
|
|
- <!--<echo> passwordBase64Basic = ${passwordBase64Basic}
|
|
|
+ <!--<echo> passwordBase64Basic = ${passwordBase64Basic_tested}
|
|
|
</echo>-->
|
|
|
<!--<echo> $webRootUrl = ${webRootUrl}
|
|
|
</echo>-->
|
|
|
@@ -239,52 +365,7 @@
|
|
|
</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>
|
|
|
- <br>Wygenerowano druk pdf - sciagnij go <a href="${webRootUrl}/out/${out_task_file}.pdf"> "${webRootUrl}/out/${out_task_file}.pdf</a></br>
|
|
|
- </echo>
|
|
|
- <echo>
|
|
|
- <br>Dodaj do korespondencji (W przygotowaniu)</br>
|
|
|
- </echo>
|
|
|
- <echo>
|
|
|
- <br>Wyślij do adresatów emailem (W przygotowaniu)</br>
|
|
|
- </echo>
|
|
|
- <echo>
|
|
|
- <br>Umieść swój podpis graficzny (W przygotowaniu)</br>
|
|
|
- </echo>
|
|
|
- <echo message="OUTPUT__END"/>
|
|
|
- </target>-->
|
|
|
+
|
|
|
|
|
|
|
|
|
</project>
|