| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project basedir="." name="recurse_ant" default="buildpdf_recursed" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" >
- <description>
- Recurse ANT to retrieve structurized xml objects based on Related SimpleSchema maps
- </description>
- <!-- template do kopiowania test-druk @2017-03-02 bindera
- Copyright BIALL-NET sp. z o.o. wszelkie prawa zastrzezone
-
- -->
-
-
- <!-- 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
- -->
- <!-- https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=ant&path=default_db.in7_dziennik_koresp/test-druk&namespace=p5_default_db:IN7_DZIENNIK_KORESP&featureID=59682 -->
- <!-- default procesy5 sample template is file:/SE/schema/ant-url_action/default_db.in7_dziennik_koresp/test-get-wfs-xml/build.xml-->
- <!-- sample URL which call this exact variables in this ANT build -->
- <!-- przykladowy URL ktory przekazuje parametry do tego ANT -->
- <!--https://biuro.biall-net.pl/SE/version-git/index.php?_route=UrlAction_Ant&_task=ant&
- path=${default_db.in7_dziennik_koresp/test-get-wfs-xml} - this is the place to keep ant build (directory name with build.xml)
- &namespace=p5_default_db:Rozdzielcza_test_bzyk_PE&featureID=123 - this is setting the
- <property name="url" value="${url}"/> - to point what is record/table to download
- <property name="uuid" value="${uuid}"/> it is automatically also set to enable uinque transaction and to allow to save data with user
- <property name="passwordBase64Basic" value="${passwordBase64Basic}"/> - this is also set - to enable communicate with API -
- <property name="DwebRootUrl" value="${$webRootUrl}"/> - this is the place where script is localized to easyli to target user GUI by href to generated output
- />
- -->
-
- <!---DpasswordBase64Basic="xxxx=="
- -DtypeName="p5_default_db:IN7_DZIENNIK_KORESP"
- -Dxpath=ID -Dxpath_value=1000
- -Duuid=1 -DwebRootUrl=somePathDir-->
- <property name="basedir" value="${basedir}" /> <!-- do ustalenia glownego katalogu -->
- <property name="default_db:recurse_ant_basedir" location="."/>
- <property name="default_db:recurse_ant_basedir.temp" location="${default_db:recurse_ant_basedir}/temp"/>
- <property name="default_db:recurse_ant" location="${default_db:recurse_ant}"/>
-
- <property name="out" value="out"/> <!-- output ready files like pdf -->
- <property name="p5_tr_map_dir" location="${basedir}/../../../default_db.instance.xml/p5_tr_map" />
- <property name="simpleSchema_dir" location="${basedir}/../../../default_db.instance.xml/simpleSchema" />
- <property name="detect_resource_type_dir" location="${basedir}/../../../default_db.instance.xml/detect_resource_type" />
- <property name="build_complexType_dir" location="${basedir}/../../../default_db.instance.xml/build_complexType" />
-
- <property name="uuid" value="${uuid}"/> <!--TODO-->
- <property name="passwordBase64Basic" value="${passwordBase64Basic}"/>
- <property name="php_session_id" value="${php_session_id}"/> <!-- optional cookie if sent work with it if not - get it -->
- <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="namespace_prefix_p5_tr_map" value="default_db"/> <!-- do przetowrzenia w nazwie pliku docelowej element-default_db__x3A__CRM_PROCES__x3A__CRM_PROCES oraz dla detect_resource_type_dir -->
- <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 -->
- <property name="xpath_query" value="${xpath_query}" /> <!-- limit input by example: xpath_query="[position()<3] limit RelatedFeatures; [not(local-name()='PROCES_INIT')] - to limit tree level -->
-
-
- <property name="ignore_maxOccurs_0" value="1"/> <!-- When element has maxOccurs=0 do not try to retrieve him to limit tree -->
-
- <property name="loop_path_recurs" value=""/> <!-- w przypadku podania, system powinien w tym katalogu zapisywac wynik xml dzialania, azeby odbudowac rekursywne drzewo - zapisujemy po system_cache__appinfo:id np bedzie ${temp}/${uuid}_CRM_PROCES___d14e4479-1_PROCES_BEN/ -->
- <!--<property name="temp_name" value="temp" />--> <!-- temp files-->
- <property name="temp" value="${default_db:recurse_ant_basedir.temp}${loop_path_recurs}" /> <!-- temp files-->
- <property name="xpath_query.xsl" value="${default_db:recurse_ant_basedir.temp}/${uuid}.xpath_query.xsl"/>
- <property name="empty.xml" value="${temp}/${uuid}.empty.xml"/>
- <!-- 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 -->
-
- <!--<tempfile property="uuid" deleteonexit="yes"/>-->
- <property name="out_task.dita" value="${temp}/${uuid}.out_task_dita" />
- <property name="out_task.dita.final" value="${temp}/${uuid}_out_task_dita_final.dita" />
- <property name="out_task.dita.final.noext" value="${uuid}_out_task_dita_final" />
- <property name="out_task.dita.final.html" value="${uuid}_out_task_dita_final.html" /> <!-- dita -f html5 wywala kropki -->
- <property name="out_task.dita.final_with_RelatedFeatureLoop_no_path" value="${uuid}.out_task.dita.final_with_RelatedFeatureLoop" />
- <property name="out_task.dita.final_with_RelatedFeatureLoop" value="${default_db:recurse_ant_basedir}/out/${uuid}.out_task.dita.final_with_RelatedFeatureLoop" />
-
- <!-- do zrobienia -->
- <!--<tempfile property="wfs_output" deleteonexit="no" destdir="temp" suffix=".xml" />-->
-
-
- <!--<echo> $basedir=${basedir};
- $temp=${temp};
- $loop_path_recurs=${loop_path_recurs};
- </echo>-->
- <!-- 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}"/>
- <mkdir dir="${out}"/>
- <chmod dir="${temp}" perm="ugo+rwx"/>
- <chmod dir="${out}" perm="ugo+rwx"/>
- </target>
- <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_tested} |sed 's/.*://'"/>
- </exec>
- <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,dita_fail,dita_ok">
- <echo> testujemy czy jest dita</echo>
- </target>
-
- <target name="dita_fail" unless="${test_if_dita}">
- <echo message="OUTPUT__START"/>
- <echo><br>Brakuje druku dla powiązanego obiektu ${main_build_recurse_ant.dita} </br></echo>
- <echo message="OUTPUT__END"/>
- </target>
-
- <target name="dita_ok" if="${test_if_dita}">
- <!-- polaczenie pdfa -->
- <antcall target="build_recurse_ant_merge_dita_from_temp.xsl"/>
- </target>
-
-
- <!-- #### tr_map #### -->
-
- <target name="set_tr_map" 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.tr_map_sed">
- <arg value="-c"/>
- <arg value="echo ${typeName_tested} |sed 's/.*://'"/><!-- tu wchodzi -DtypeName=p5_default_db:CRM_PROCES -->
- </exec>
- <!-- element-default_db__x3A__CRM_PROCES__x3A__CRM_PROCES -->
- <property name="main_build_recurse_ant.dita" value="${simpleSchema_dir}/${namespace_prefix_p5_tr_map}/${main_build_recurse_ant.tr_map_sed}.xml" />
- <echo> Ustawiam $main_build_recurse_ant.dita na ${main_build_recurse_ant.dita} ; </echo>
-
- <property name="main_build_recurse_ant.dita_with_id" value="${simpleSchema_dir}/${namespace_prefix_p5_tr_map}/${main_build_recurse_ant.tr_map_sed}.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_tr_map" taskname="check_tr_map" >
- <available file="${main_build_recurse_ant.dita}"/>
- </condition>
- </target>
-
- <target name="check_tr_map" depends="set_tr_map,tr_map_fail,tr_map_ok">
- <echo> testujemy czy jest tr_map</echo>
- </target>
-
- <target name="tr_map_fail" unless="${test_if_tr_map}">
- <echo message="OUTPUT__START"/>
- <echo><br>Brakuje druku dla powiązanego obiektu ${main_build_recurse_ant.dita} </br></echo>
- <echo message="OUTPUT__END"/>
- </target>
-
- <target name="tr_map_ok" if="${test_if_tr_map}">
- <!-- polaczenie pdfa -->
- <echo>#251 wyzwalam build_recurse_ant_merge_dita_from_temp.xsl</echo>
- <antcall target="build_recurse_ant_merge_dita_from_temp.xsl_tr_map"/>
- </target>
-
- <target name="xml_recursed_from_tr_map" depends="uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check,check_tr_map" description="Buduje wyjsciowego XMLa na podstawie mapy transportowej dla zastosowan w API DEVEL">
- <!--<echo message="OUTPUT__START"/>-->
-
- <!-- TODO proba wlaczenia rekursywnosci zapisanie wezla do sciezki w folderze-->
- <!--<copy file="${out_task.dita.final}" tofile="${temp}/${loop_path_recurs}/${uuid_tested}.loop_path.xml" />-->
-
- <!--<loadfile property="out_task.dita.final_no_RelatedFeatureRoot" srcfile="${out_task.dita.final}"/>-->
- <move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>
- <!--<echoxml file="${out_task.dita.final}.xml">
- <RelatedFeatureRoot>${out_task.dita.final_no_RelatedFeatureRoot}</RelatedFeatureRoot>
- </echoxml>-->
-
- <!--<echo>
- <br>Wygenerowano wyjsciowy plik XML - sciagnij go <a href="${webRootUrl}/${out_task.dita.final}.xml" target="_blank"> "${webRootUrl}/${out_task.dita.final}.xml</a></br>
- </echo>-->
- <!--<echo message="OUTPUT__END"/>-->
- </target>
-
- <target name="xml_recursed_from_tr_map_with_RelatedFeatureLoop" depends="xml_recursed_from_tr_map" description="URL_TASK Pobierz XML obiektu">
-
- <!-- TODO proba wlaczenia rekursywnosci zapisanie wezla do sciezki w folderze-->
- <!--<copy file="${out_task.dita.final}" tofile="${temp}/${loop_path_recurs}/${uuid_tested}.loop_path.xml" />-->
-
- <!--<loadfile property="out_task.dita.final_no_RelatedFeatureRoot" srcfile="${out_task.dita.final}"/>-->
- <!--<move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>-->
- <!--<echoxml file="${out_task.dita.final}.xml">
- <RelatedFeatureRoot>${out_task.dita.final_no_RelatedFeatureRoot}</RelatedFeatureRoot>
- </echoxml>-->
- <delete file="${out_task.dita.final_with_RelatedFeatureLoop}.xml"/>
- <xslt basedir="${default_db:recurse_ant_basedir}" style="${build_recurse_ant_merge_dita_from_temp.xsl}" in="${main_build_recurse_ant.dita_with_id}" destdir="./" out="${out_task.dita.final_with_RelatedFeatureLoop}.xml" >
- <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="RelatedFeatureRoot"/>
- </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_tested}"/>
- <!--<param name="basedir" expression="${basedir}"/>-->
- <param name="temp" expression="${temp}"/>
- <param name="with_RelatedFeatureLoop" expression="1"/>
- <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
- </xslt>
- <echo message="OUTPUT__START"/>
- <echo>
- <br>Wygenerowano wyjsciowy plik XML - sciagnij go <a href="${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.xml" target="_blank"> "${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.xml</a></br>
- </echo>
- <echo message="OUTPUT__END"/>
- </target>
-
- <!-- #### eof tr_map #### -->
-
-
- <!-- ### php_session_id ### -->
-
- <target name="php_session_id_cond">
- <condition property="php_session_id_fail" taskname="php_session_id_check">
- <or>
- <equals arg1="${php_session_id}" arg2=""/>
- <equals arg1="${php_session_id}" arg2="$${php_session_id}"/>
- </or>
- </condition>
- </target>
- <target name="php_session_id_check" depends="php_session_id_cond,php_session_id_ok,php_session_id_fail"/>
- <target name="php_session_id_ok" unless="${php_session_id_fail}" description="use php_session_id from parameter ">
- <property name="php_session_id_tested" value="--cookie 'PHPSESSID=${php_session_id}'"/>
- </target>
- <target name="php_session_id_fail" if="${php_session_id_fail}" description="retrieve php_session_id from API to use it after for fasten api requests" depends="install_folders">
- <property name="cookie_file" value="${default_db:recurse_ant_basedir.temp}/${uuid_tested}.cookie"/>
- <exec executable="curl"> <!-- errorproperty="wfs_error" resultproperty="wfs_result" -->
- <arg line=" -c ${cookie_file} -H 'Authorization: Basic ${passwordBase64Basic_tested}' "${api_url}""/> <!-- /default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities" -->
- </exec>
- <property name="php_session_id_tested" value=" -b ${cookie_file}"/>
- <echo> #289 we set php_session_id_tested=(${php_session_id_tested})
- $cookie_file = ${cookie_file} </echo>
- </target>
-
- <!-- ### eof php_session_id ### -->
-
- <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"/>
- <property name="xpath_query_check_create_xsl.xsl" value="${default_db_xml_cache.public}/xpath_query_check_create_xsl.xsl"/>
- <property name="recurse_ant_to_html.xsl" value="${default_db_xml_cache.public}/recurse_ant_to_html.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 ${basedir}/../../../default_db_xml_cache.public</echo>
- <property name="default_db_xml_cache.public" value="${basedir}/../../../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"/>
- <property name="xpath_query_check_create_xsl.xsl" value="${default_db_xml_cache.public}/xpath_query_check_create_xsl.xsl"/>
- <property name="recurse_ant_to_html.xsl" value="${default_db_xml_cache.public}/recurse_ant_to_html.xsl"/>
- </target>
-
-
-
- <target name="main_build_recurse_ant.dita_with_id" if="${test_if_dita}">
- <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"/>
- </factory>
- <param name="namespace_prefix" expression="${namespace_prefix}"/>
- <param name="detect_resource_type_dir" expression="${detect_resource_type_dir}"/>
- <param name="build_complexType_dir" expression="${build_complexType_dir}"/>
- <param name="typeName" expression="${typeName_tested}"/> <!-- do przekazania glownego elementu do wykrycia glownie buildComplexType dla filtrow, w kolejnych zaglebieniach jada po @ref -->
- <classpath location="/opt/local/share/java/saxon9he.jar"/>
- </xslt>
- </target>
-
- <target name="main_build_recurse_ant.tr_map_with_id" if="${test_if_tr_map}">
- <!-- nie trzeba - korzystamy z SimpleSchema natywnymi przeksztalceniami -->
- <!--<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>
- <param name="namespace_prefix" expression="${namespace_prefix}"/>
- <param name="detect_resource_type_dir" expression="${detect_resource_type_dir}"/>
- <param name="build_complexType_dir" expression="${build_complexType_dir}"/>
- <param name="typeName" expression="${typeName_tested}"/> <!-\- do przekazania glownego elementu do wykrycia glownie buildComplexType dla filtrow, w kolejnych zaglebieniach jada po @ref -\->
- <classpath location="/opt/local/share/java/saxon9he.jar"/>
- </xslt>-->
- </target>
-
-
- <target name="clean_temp_dir" description="URL_TASK Wyczyść cache modułu ">
- <delete includeemptydirs="yes">
- <fileset dir="${temp}"/>
- </delete>
- <echo message="OUTPUT__START"/>
- <echo><br>Skasowano pliki tymczasowe</br></echo>
- <echo message="OUTPUT__END"/>
- <antcall target="install_folders"/>
- </target>
-
-
- <target name="xpath_query.xsl_check" description="to generate xpath_query.xsl if it is set">
- <condition taskname="xpath_query.xsl" property="xpath_query_set">
- <or>
- <equals arg1="${xpath_query}" arg2=""/>
- <equals arg1="${xpath_query}" arg2="$${xpath_query}"/>
- </or>
- </condition>
- </target>
-
- <target name="xpath_query.xsl" depends="xpath_query.xsl_check" unless="${xpath_query_set}" description="to generate xpath_query.xsl if it is set">
- <echoxml file="${empty.xml}">
- <empty>empty</empty>
- </echoxml>
- <xslt basedir="${default_db:recurse_ant_basedir}" style="${xpath_query_check_create_xsl.xsl}" in="${empty.xml}" destdir="./" out="${xpath_query.xsl}" >
- <factory name="net.sf.saxon.TransformerFactoryImpl">
- <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
- <attribute name="http://saxon.sf.net/feature/initialTemplate" value="xpath_query_check_create_xsl"/>
- </factory>
- <classpath location="/opt/local/share/java/saxon9he.jar"/>
- <param name="xpath_query" expression="${xpath_query}"/>
- </xslt>
- </target>
-
- <target name="xpath_query.xsl_fail" depends="xpath_query.xsl_check" if="${xpath_query_set}" description="to generate xpath_query.xsl if it is set">
- <echoxml file="${empty.xml}">
- <empty>empty</empty>
- </echoxml>
- <xslt basedir="${default_db:recurse_ant_basedir}" style="${xpath_query_check_create_xsl.xsl}" in="${empty.xml}" destdir="./" out="${xpath_query.xsl}" >
- <factory name="net.sf.saxon.TransformerFactoryImpl">
- <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
- <attribute name="http://saxon.sf.net/feature/initialTemplate" value="xpath_query_check_create_xsl"/>
- </factory>
- <classpath location="/opt/local/share/java/saxon9he.jar"/>
- <param name="xpath_query" expression="[1=1]"/>
- </xslt>
- </target>
-
- <!-- wygenerowanie ant builda do sciagniecia niezbednego elementu na podstawie template main.dita i tam zagniezdzonego RelatedFeature-->
- <target name="build_recurse_ant.xml" depends="php_session_id_check,xpath_query.xsl,xpath_query.xsl_fail,main_build_recurse_ant.dita_with_id,main_build_recurse_ant.tr_map_with_id">
- <!-- build do wytworzenia pierwszego przetworzenia zagniezdzen -->
- <property name="loop_xpath" value="root" />
- <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>
- <record name="ant.log" loglevel="verbose" append="true" />
- <!--<delete file="${build_recurse_ant.xml}"/>-->
- <xslt basedir="${default_db:recurse_ant_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_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_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_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}"/>
- <param name="basedir" expression="${basedir}"/>
- <param name="recurse_ant_basedir" expression="${default_db:recurse_ant_basedir}"/>
- <param name="recurse_ant_basedir.temp" expression="${default_db:recurse_ant_basedir.temp}"/>
- <param name="recurse_ant" expression="${default_db:recurse_ant}"/>
- <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}"/>
- <param name="cookie_curl_option" expression="${php_session_id_tested}"/>
- <param name="loop_path_recurs" expression="${loop_path_recurs}"/>
- <param name="ignore_maxOccurs_0" expression="${ignore_maxOccurs_0}"/>
- <param name="xpath_query" expression="${xpath_query}"/>
- <param name="xpath_query.xsl" expression="${xpath_query.xsl}"/>
- <param name="empty.xml" expression="${empty.xml}"/>
- <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
- <param name="default_db_xml_cache.public" expression="${default_db_xml_cache.public}"/>
- </xslt>
- <!--<import file="${build_recurse_ant.xml}"/>-->
- <record action="stop" name="ant.log"/>
- <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="${default_db:recurse_ant_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_tested}"/>
- <!--<param name="basedir" expression="${basedir}"/>-->
- <param name="temp" expression="${temp}"/>
- <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
- </xslt>
- <echo> zapisalem plik gotowy do utworzenia dita do ${out_task.dita.final}. </echo>
- </target>
- <target name="build_recurse_ant_merge_dita_from_temp.xsl_tr_map" depends="build_recurse_ant.xml" description="z plikow temp/$uuid.* buduje $out_task.dita.final ">
- <xslt basedir="${default_db:recurse_ant_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"/>
- <attribute name="http://saxon.sf.net/feature/initialMode" value="RelatedFeatureRoot"/>
- </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_tested}"/>
- <!--<param name="basedir" expression="${basedir}"/>-->
- <param name="temp" expression="${temp}"/>
- <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
- </xslt>
- <echo> zapisalem plik gotowy do utworzenia dita do ${out_task.dita.final}. </echo>
- </target>
-
- <target name="xml_recursed_from_tr_map_with_RelatedFeatureLoop_html" depends="xml_recursed_from_tr_map" description="URL_TASK Pobierz HTML obiektu">
-
- <!-- TODO proba wlaczenia rekursywnosci zapisanie wezla do sciezki w folderze-->
- <!--<copy file="${out_task.dita.final}" tofile="${temp}/${loop_path_recurs}/${uuid_tested}.loop_path.xml" />-->
-
- <!--<loadfile property="out_task.dita.final_no_RelatedFeatureRoot" srcfile="${out_task.dita.final}"/>-->
- <!--<move file="${out_task.dita.final}" tofile="${out_task.dita.final}.xml"/>-->
- <!--<echoxml file="${out_task.dita.final}.xml">
- <RelatedFeatureRoot>${out_task.dita.final_no_RelatedFeatureRoot}</RelatedFeatureRoot>
- </echoxml>-->
-
- <xslt basedir="${default_db:recurse_ant_basedir}" style="${build_recurse_ant_merge_dita_from_temp.xsl}" in="${main_build_recurse_ant.dita_with_id}" destdir="./" out="${out_task.dita.final_with_RelatedFeatureLoop}.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="webRootUrl" expression="${webRootUrl}" />-->
- <!--<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="with_RelatedFeatureLoop" expression="true"/>
- <param name="simpleSchema_dir" expression="${simpleSchema_dir}"/>
- </xslt>
-
- <xslt basedir="${default_db:recurse_ant_basedir}" style="${recurse_ant_to_html.xsl}" in="${out_task.dita.final_with_RelatedFeatureLoop}.xml" destdir="./" out="${out_task.dita.final_with_RelatedFeatureLoop}.html" >
- <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_tested}"/>-->
- <!--<param name="basedir" expression="${basedir}"/>-->
- <!--<param name="temp" expression="${temp}"/>-->
- <!--<param name="with_RelatedFeatureLoop" expression="true"/>-->
- </xslt>
-
-
- <echo message="OUTPUT__START"/>
- <echo>
- <br>Wygenerowano wyjsciowy plik XML - sciagnij go <a href="${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.html" target="_blank"> "${webRootUrl}/${out_task.dita.final_with_RelatedFeatureLoop_no_path}.html</a></br>
- </echo>
- <echo message="OUTPUT__END"/>
- </target>
-
-
- <!--<target name="build_recurse_ant_merge_dita_from_temp.xsl_with_RelatedFeatureLoop" depends="build_recurse_ant_merge_dita_from_temp.xsl" 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_with_RelatedFeatureLoop}" >
- <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_tested}"/>
- <!-\-<param name="basedir" expression="${basedir}"/>-\->
- <param name="temp" expression="${temp}"/>
- <param name="with_RelatedFeatureLoop" expression="true"/>
- </xslt>
- <echo> zapisalem plik z zagniezdzeniami out_task.dita.final_with_RelatedFeatureLoop gotowy do utworzenia dita do ${out_task.dita.final_with_RelatedFeatureLoop}. </echo>
- </target>-->
- <target name="buildpdf_recursed" depends="install_folders,uuid_check,typeName_check,xpath_check,xpath_value_check,passwordBase64Basic_check,php_session_id_check,check_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_tested}
- </echo>-->
- <!--<echo> $webRootUrl = ${webRootUrl}
- </echo>-->
- <!--<echo> $wfs_output = ${wfs_output}
- </echo>-->
- <echo>
- <br>Wygenerowano druk pdf - sciagnij go <a href="${webRootUrl}/${out}/${out_task.dita.final.noext}.pdf" target="_blank"> "${webRootUrl}/${out}/${out_task.dita.final.noext}.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>
-
-
- <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">
- <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="html5"/>
- <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.html} |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>-->
- <!--<loadfile property="out_task_file.loadfile" srcfile="out/${out_task_file}"></loadfile>-->
- <echo>
- <br>Wygenerowano druk html - sciagnij go <a href="${webRootUrl}/out/${out_task.dita.final.html}" target="_blank"> "${webRootUrl}/out/${out_task.dita.final.html}</a></br>
- <br> $webRootUrl to ${webRootUrl}
- <br> $out_task.dita.final to ${out_task.dita.final}
- <br> $out_task_file to ${out_task_file}
- </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>
-
- <target name="buildpdf_recursed_tocjs" 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 Dynamiczną Wersję HTML">
- <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="tocjs"/>
- <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.html} |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>-->
- <!--<loadfile property="out_task_file.loadfile" srcfile="out/${out_task_file}"></loadfile>-->
- <echo>
- <br>Wygenerowano druk html - sciagnij go <a href="${webRootUrl}/out/${out_task.dita.final.html}" target="_blank"> "${webRootUrl}/out/${out_task.dita.final.html}</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>
|