Procházet zdrojové kódy

build ant fixings to enable audit.xml to be parsed - to be continued - plan exec CRM_PROCESS_tree with typing exact path, and move there raport from its temp file - not using api
requred detect files paths config, use $FID and $UiD

a.binder před 8 roky
rodič
revize
81c8f9e5b1
2 změnil soubory, kde provedl 106 přidání a 44 odebrání
  1. 2 1
      SE/build_SE.xml
  2. 104 43
      SE/schema/build.xml

+ 2 - 1
SE/build_SE.xml

@@ -30,12 +30,13 @@
     <property name="procesy5_config.folders.xsl" location="${build_SE_basedir}/procesy5_config.folders.xsl"/>
     <property name="procesy5_config.default_db.xsl" location="${build_SE_basedir}/procesy5_config.default_db.xsl"/>
     <!-- components -->
+    <property name="procesy5_config.default_db.properties.xml" location="${build_SE_basedir}/.procesy5_config.default_db.properties.xml"/>
     <property name="dita-ot-toolkit" location="${basedir}/../stuff/dita-ot-2.3.3"/>
     <property name="procesy5_config" location="${basedir}/../config"/>
         <!--<property name="procesy5_config.folders" location="${procesy5_config}/.cnf-\-folders.ini.php"/>-->
         <property name="procesy5_config.folders.server" location="${procesy5_config}/.cnf--folders-${SERVER_ADDRESS}.ini.php"/>
         <property name="procesy5_config.default_db.server" location="${procesy5_config}/.cnf--default_db-${SERVER_ADDRESS}.ini.php"/>
-    <property name="procesy5_config.folders.properties.xml" location="${build_SE_basedir}/procesy5_config.folders.properties.xml"/>
+    <property name="procesy5_config.folders.properties.xml" location="${build_SE_basedir}/.procesy5_config.folders.properties.xml"/>
   
     <!-- TODO in build_resource_ant.xml <property name="dita.dir" location="/Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/dita"/>-->
     

+ 104 - 43
SE/schema/build.xml

@@ -5,17 +5,14 @@
     
     
     <!-- licence values -->
-    <property name="TargetNamespaceBindings" value="https://biuro.biall-net.pl"/> <!-- default https://biuro.biall-net.pl for API working in this domain -->
-    <property name="TargetNamespaceBindingsApi" value="${TargetNamespaceBindings}/wfs"/>
-    <property name="TargetNamespaceBindingsApiUrl" value="${TargetNamespaceBindingsApi}/wfs-data.php"/>
-    <property name="targetNamespace_DEFAULTS_prefix" value="default_db"/>
-    <property name="targetNamespace_DEFAULTS_prefix_objects" value="default_objects"/>
-    <property name="targetNamespace_DEFAULTS" value="${TargetNamespaceBindings}/xmlschema_procesy5/${targetNamespace_DEFAULTS_prefix}"/> <!-- namespace do lokalnego bindowania do default_db http://biuro.biall-net.pl/xmlschema_procesy5/default_db -->
-    <property name="config_dir" value="${basedir}/config"/>
-    <property name="NamespaceBinding.xml" value="${config_dir}/NamespaceBinding.xml"/> <!-- file with binding informations -->
-    
-    
-    <property name="public_html" location="${basedir}"/> <!-- do wstawienia schematos -->
+    <property name="XMLSchema_prefix" value="xs"/> <!-- default https://biuro.biall-net.pl for API working in this domain -->
+    <property name="public_html" location="${basedir}"/>
+    <property name="build_SE.xml" location="${basedir}/../build_SE.xml"/>
+    <property name="build_SE_basedir" location="${basedir}/build_SE_basedir"/>
+    <property name="build_SE_basedir.temp" location="${build_SE_basedir}/temp"/>
+    <property name="build_SE.properties" location="${build_SE_basedir}/_build_SE.properties"/> <!-- namespace do lokalnego bindowania do default_db http://biuro.biall-net.pl/xmlschema_procesy5/default_db -->
+    <property name="build_SE.properties.xml" location="${build_SE.properties}.xml"/>
+     <!-- do wstawienia schematos -->
     
    
     
@@ -31,7 +28,10 @@
     
     <property name="remote" location="${Shared_Git_Root}/se/SE/schema"/>
     
-    <property name="table.local" location="${public_html}/table"/>
+    <property name="remote.ant-object" location="${remote}/ant-object"/> <!-- than is default_db.CRM_PROCES/PROCES_INIT/PROCES_INIT.xsd and build.xml (empty) -->
+        <property name="remote.ant-url_action" location="${remote}/ant-url_action"/>
+        <property name="remote.default_db.in7_dziennik_koresp" location="${remote.ant-url_action}/default_db.in7_dziennik_koresp"/>
+        <property name="remote.default_db.bi_audit_energa_rum_kontrahenci_powiazania" location="${remote.ant-url_action}/default_db.bi_audit_energa_rum_kontrahenci_powiazania"/><property name="table.local" location="${public_html}/table"/>
     <property name="table.remote" location="${remote}/table"/>
     
     
@@ -41,12 +41,19 @@
     
     <property name="transformed.local" location="${default_db.instance.xml}/transformed"/> <!-- dir for some raport outputs -->
         <property name="procesy5_system_schema.xml" value="${transformed.local}/procesy5_system_schema.xml"/>
+        <property name="procesy5_system_schema_file" value="${procesy5_system_schema.xml}"/> <!-- alias property used in buildComplexType - to be removed in cleaning/organizing -->
+        <property name="external_schema" value="/public_html/external_schema"/><!-- ignore schemas to be imported/transformed locally -->
+        <property name="external_schema_id_namespace_prefix" value="/public_html/external_schema_id_namespace_prefix"/><!-- ingored but to parse schemas to be imported/transformed locally -->
+        
+        <property name="external_schema_table.path" value="${public_html}/external_schema_table"/>
         <property name="vrtfNamespaces.xml" value="${transformed.local}/vrtfNamespaces.xml"/>
         <property name="element_complexType.xml" value="${transformed.local}/element_complexType.xml"/><!-- for build flat schema and tr_map -->
         
         
         
     
+    <property name="build_element_complexType.xml" value="${transformed.local}/build_element_complexType.xml"/> <!-- for build parallel by ant universal xsl -->
+    <property name="build_tr_map.xml" value="${transformed.local}/build_tr_map.xml"/>
     <property name="build_complexType.local" location="${default_db.instance.xml}/build_complexType"/>
     <property name="build_complexType.remote" location="${remote}/default_db.instance.xml/build_complexType"/>
     
@@ -61,11 +68,12 @@
     <property name="simpleSchema.remote" location="${remote}/default_db.instance.xml/simpleSchema"/>
     
     <!-- module cache -->
-    <property name="build_properties" location="${public_html}/build_properties" />
+    <property name="build_properties" location="${public_html}/.build_properties" />
     
     
     
     
+    <property name="build_properties.xml" location="${public_html}/.build_properties.xml" />
     <property name="new-schema-with-ID-to-move-and-rename-to-xsd"  location="${transformed.local}/new-schema-with-ID-to-move-and-rename-to-xsd"/>
     <property name="empty.xml"  value="empty.xml"/>
     <!-- templates -->  
@@ -130,7 +138,10 @@
     
     <target name="save_build_properties" >
         <ant antfile="${build_WPS_Functions.xml}" inheritall="yes"/>
+        <ant antfile="${build_SE.xml}"  target="save_build_properties"/>
+        <loadproperties srcfile="${build_SE.properties}"/>
         <echoproperties destfile="${build_properties}" />
+        <echoproperties destfile="${build_properties.xml}"  format="xml"/>
     </target>
     
     <!--<target name="read_build_properties_check">
@@ -143,6 +154,8 @@
     
     <target name="read_build_properties">
         <loadproperties srcfile="${build_properties}"/>
+        <ant antfile="${build_SE.xml}"  target="save_build_properties"/>
+        <loadproperties srcfile="${build_SE.properties}"/>
     </target>
     
     
@@ -159,12 +172,16 @@
     </target>
     
     
-    <target name="procesy5_system_schema.xml" description="Generate procesy5_system_schema.xml and vrtfNamespaces.xml which can be not correct">
+    <target name="empty.xml" description="Builds empty.xml">
+        <echoxml file="${empty.xml}"><empty>empty</empty></echoxml>
+    </target>
+    
+    <target name="procesy5_system_schema.xml" depends="empty.xml" description="Generate procesy5_system_schema.xml and vrtfNamespaces.xml which can be not correct">
         <mkdir dir="${default_db.instance.xml}"/>
         <mkdir dir="${transformed.local}"/>
         <delete file="${procesy5_system_schema.xml}" failonerror="false"/>
         <echo> run ${get_all_xsd.xsl} with param procesy5_system_schema_collection_dir=${public_html}; </echo>
-        <echoxml file="${empty.xml}"><empty>empty</empty></echoxml>
+        
         <xslt basedir="./" style="${get_all_xsd.xsl}"  in="${empty.xml}"  destdir="./" out="${procesy5_system_schema.xml}" >
             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
@@ -172,6 +189,8 @@
             </factory>
             <param name="procesy5_system_schema_collection_dir" expression="${public_html}"/>
             <param name="cache" expression="refresh"/>
+            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
+            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
 
@@ -183,6 +202,8 @@
             </factory>
             <param name="procesy5_system_schema_collection_dir" expression="${public_html}"/>
             <param name="cache" expression="refresh"/>
+            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
+            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/>
             <classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
     </target>
@@ -201,10 +222,17 @@
             </factory>
             <param name="procesy5_system_schema_collection_dir" expression="${public_html}"/>
             <param name="cache" expression="refresh"/>
-            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="external_schema" expression="${external_schema}"/>
+            <param name="external_schema_id_namespace_prefix" expression="${external_schema_id_namespace_prefix}"/>
+            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
+            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/><classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
         
-        <delete file="${vrtfNamespaces.xml}"/>        
+        <antcall target="vrtfNamespaces.xml"/>
+    </target>
+    
+    
+    <target name="vrtfNamespaces.xml" description="Procedure to create vrtfNamespaces.xml - used in some tasks especially in generate schema with id"><delete file="${vrtfNamespaces.xml}"/>        
         <xslt basedir="./" style="${get_all_xsd.xsl}"  in="${procesy5_system_schema.xml}"  destdir="./" out="${vrtfNamespaces.xml}" >
             <factory name="net.sf.saxon.TransformerFactoryImpl">    
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
@@ -212,7 +240,8 @@
             </factory>
             <param name="procesy5_system_schema_collection_dir" expression="${public_html}"/>
             <param name="cache" expression="refresh"/>
-            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
+            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/><classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
     </target>
     
@@ -256,42 +285,61 @@
                 <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
                 <attribute name="http://saxon.sf.net/feature/initialMode" value="{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}element_complexType"/>
             </factory>
-            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
+            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/><classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
     </target>
     
-    <target name="build_complexType" depends="element_complexType.xml"  description="we generate all complexType for all known elements and complexType in schema">
-        <delete dir="${build_complexType.local}"/>
-        <xslt basedir="./" style="${build_complexType.xsl}"  in="${element_complexType.xml}"  destdir="./" out="${build_complexType_raport.xml}" >
+    <target name="build_element_complexType.xml" depends="element_complexType.xml,save_build_properties,empty.xml" description="generate build_element_complexType.xml for parallel launch">
+        <delete file="${build_element_complexType.xml}"/>
+        <xslt basedir="./" style="${build_ant_universal_by_xsl_match.xsl}"  in="${element_complexType.xml}"  destdir="./" out="${build_element_complexType.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="{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}element_complexType"/>
+                <attribute name="http://saxon.sf.net/feature/initialMode" value="build_element_complexType.xml"/>
             </factory>
-            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
-            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/>
-            <param name="vrtfNamespaces_file" expression="${vrtfNamespaces.xml}"/>
-            <param name="procesy5_system_schema_file" expression="${procesy5_system_schema.xml}"/>
-            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="match_element" expression=""/>
+            <param name="antfile_prefix" expression="build_element_complexType.xml"/>
+            <param name="temp" expression="/tmp"/>
+            <param name="basedir" expression="${basedir}"/>
+            <param name="antfile" expression=""/>
+            <!--<param name="target" expression="xml_recursed_from_tr_map_with_RelatedFeatureLoop"/>-->
+            <param name="match_child_element" expression=""/>
+            <param name="match_child_element_property_name" expression=""/>
+            <param name="properties.xml" expression="${build_properties.xml}"/>
+            <!--<param name="properties_override.xml" expression="${properties_override.xml}"/>-->
+            <param name="parallel" expression="1"/>
+            <param name="threadCount" expression="10"/>
+            <param name="ant-launcher.jar" expression="${ant-launcher.jar}"/><classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
-    </target>
+    <delete dir="${build_complexType.local}"/>
+        <ant antfile="${build_element_complexType.xml}"/></target>
     
-    <target name="build_tr_map" depends="build_complexType" description="we generate all tr_map for all known elements and complexType in schema">
-        <delete dir="${p5_tr_map.local}"/>
-        <xslt basedir="./" style="${p5_tr_map.xsl}"  in="${element_complexType.xml}"  destdir="./" out="${build_tr_map_raport.xml}" >
+    <target name="build_tr_map.xml" depends="build_element_complexType.xml" description="we generate all tr_map for all known elements and complexType in schema in parallel">
+        <delete file="${build_tr_map.xml}"/>
+        <xslt basedir="./" style="${build_ant_universal_by_xsl_match.xsl}"  in="${element_complexType.xml}"  destdir="./" out="${build_tr_map.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="{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/procesy5_translate_map.xsd}element_complexType_tr_map"/>
+                <attribute name="http://saxon.sf.net/feature/initialMode" value="build_tr_map.xml"/>
             </factory>
-            <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
-            <param name="default_db.instance.xml.symlink" expression="${default_db.instance.xml.symlink}"/>
-            <param name="vrtfNamespaces_file" expression="${vrtfNamespaces.xml}"/>
-            <param name="procesy5_system_schema_file" expression="${procesy5_system_schema.xml}"/>
-            <classpath location="/opt/local/share/java/saxon9he.jar"/>
+            <param name="match_element" expression=""/>
+            <param name="antfile_prefix" expression="build_element_complexType.xml"/>
+            <param name="temp" expression="/tmp"/>
+            <param name="basedir" expression="${basedir}"/>
+            <param name="antfile" expression=""/>
+            <!--<param name="target" expression="xml_recursed_from_tr_map_with_RelatedFeatureLoop"/>-->
+            <param name="match_child_element" expression=""/>
+            <param name="match_child_element_property_name" expression=""/>
+            <param name="properties.xml" expression="${build_properties.xml}"/>
+            <!--<param name="properties_override.xml" expression="${properties_override.xml}"/>-->
+            <param name="parallel" expression="1"/>
+            <param name="threadCount" expression="5"/>
+            <param name="ant-launcher.jar" expression="${ant-launcher.jar}"/><classpath location="/opt/local/share/java/saxon9he.jar"/>
         </xslt>
-    </target>
+    <delete dir="${p5_tr_map.local}"/>
+        <ant antfile="${build_tr_map.xml}"/></target>
     
     <!-- depends="build_tr_map" -->
-    <target name="build_detect_resource_type" depends="build_tr_map"   description="we generate detect_resource_type for use it for generate detect_objects_parent_relations">
+    <target name="build_detect_resource_type" depends="build_tr_map.xml"   description="we generate detect_resource_type for use it for generate detect_objects_parent_relations">
         <echoxml file="${empty.xml}"><empty>empty</empty></echoxml>
         <delete file="${detect_resource_type.xml}"/>
         <xslt basedir="./" style="${detect_resource_type.xsl}"  in="${empty.xml}"  destdir="./" out="${detect_resource_type.xml}" >
@@ -398,7 +446,8 @@
             <fileset dir="${new-schema-with-ID-to-move-and-rename-to-xsd}"/>
         </copy>
         <delete dir="${new-schema-with-ID-to-move-and-rename-to-xsd}"/>
-    </target>
+    <antcall target="procesy5_system_schema.xml"/> <!-- saved files are not in current schema - need to regenerate -->
+        <antcall target="vrtfNamespaces.xml"/></target>
     
     
     <!--<target name="detect_objects_parent_relations_clean_complete" if="${new-schema-with-ID-to-move-and-rename-to-xsd_complete_exists}" description="drugi raz czyscimy na czysto - z @id">
@@ -429,7 +478,7 @@
         <!-\-<antcall target="build_simpleSchema_for_recurse_ant"/> <!-\\- to wystarczy - wyzwala sie kolejno po dependency -\\->-\->
     </target>-->
     
-    <target name="sync_p5_tr_map_with_se" depends="new-schema-with-ID-to-move-and-rename-to-xsd,build_simpleSchema_for_recurse_ant" description="syncrhonizacja wygenerowanych map z default_db.instance/p5_tr_map do SE/schema/public_instance/p5_tr_map">
+    <target name="sync_p5_tr_map_with_se" depends=" save_build_properties,read_build_properties,new-schema-with-ID-to-move-and-rename-to-xsd,build_simpleSchema_for_recurse_ant,p5_make_symlink_to_work_in_default_db.in7_dziennik_koresp" description="syncrhonizacja wygenerowanych map z default_db.instance/p5_tr_map do SE/schema/public_instance/p5_tr_map">
         <delete dir="${p5_tr_map.remote}" failonerror="no"/>
         <!--<copydir src="${p5_tr_map.local}" dest="${p5_tr_map.remote}" />-->
         <mkdir dir="${p5_tr_map.remote}"/>
@@ -456,4 +505,16 @@
     </target>
     
     
-</project>
+    <target  name="p5_make_symlink_to_work_in_default_db.in7_dziennik_koresp" description="temporary to allow work with paths cheating and create on SE/schema/default_db.in7_dziennik_koresp symlink to ../WPS_Functions/get_wfs/ etc...">
+        <echo> ln -s ${remote.default_db.in7_dziennik_koresp}/CRM_PROCES_tree/CRM_PROCES_tree ../../WPS_Functions/default_db/CRM_PROCES_tree</echo>
+        <!--<exec executable="ln" dir="${default_db.instance.xml.symlink}/CRM_PROCES_tree" >
+            <arg  line="-s ../WPS_Functions/default_db/CRM_PROCES_tree"/>
+        </exec>-->
+        <symlink  link="${remote.default_db.in7_dziennik_koresp}/CRM_PROCES_tree" resource="../../WPS_Functions/default_db/CRM_PROCES_tree" overwrite="true"/>
+    </target>
+    
+    <target  name="p5_make_symlink_to_work_in_default_db.bi_audit_energa_rum_kontrahenci_powiazania" description="temporary to allow work with paths cheating and create on SE/schema/default_db.bi_audit_energa_rum_kontrahenci_powiazania symlink to ../WPS_Functions/get_wfs/ etc...">
+        <echo> ln -s ${remote.default_db.bi_audit_energa_rum_kontrahenci_powiazania}/CRM_PROCES_tree/CRM_PROCES_tree ../../WPS_Functions/default_db/CRM_PROCES_tree</echo>
+        <mkdir dir="${remote.default_db.bi_audit_energa_rum_kontrahenci_powiazania}"/>
+        <symlink link="${remote.default_db.in7_dziennik_koresp}/CRM_PROCES_tree" resource="../../WPS_Functions/default_db/CRM_PROCES_tree" overwrite="true"/>
+    </target></project>