build_object_modeling.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project basedir="../../." name="object_modeling" default="system_cache__appinfo:new_object_by_prototype"
  3. xmlns:p5om="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/object_modeling/object_modeling.xsd"
  4. xmlns:p5opr="http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/object_parent_relations/object_parent_relations.xsd"
  5. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd">
  6. <description>
  7. TO model objects capabilities
  8. </description>
  9. <include file="../build.WPS_Functions.PRODUCT.xml"/>
  10. <property name="WPS_Functions" location="${WPS_Functions.basedir}"/>
  11. <property name="build_WPS_Functions.xml" location="${WPS_Functions.build}"/> <!-- call it to get properties -->
  12. <property name="build_WPS_Functions.xml.properties" location="${WPS_Functions.properties}"/>
  13. <!-- modules WPS_Functions - to be copied to any module needed -->
  14. <!--<property name="WPS_Functions" location="${basedir}/WPS_Functions"/>
  15. <property name="build_WPS_Functions.xml" location="${WPS_Functions}/build_WPS_Functions.xml"/> <!-\- call it to get properties -\->
  16. <property name="build_WPS_Functions.xml.properties" location="${build_WPS_Functions.xml}.properties"/>
  17. -->
  18. <!-- eof modules WPS_Functions -->
  19. <property name="object_modeling_basedir" location="${basedir}/WPS_Functions/${ant.project.name}" />
  20. <property name="build_object_modeling.childproperties" location="${WPS_Functions.childproperties}/build_object_modeling.properties"/>
  21. <!--<property name="object_modeling_build" location="${object_modeling_basedir}/build_object_modeling.xml" />-->
  22. <property name="public_html" location="${basedir}" />
  23. <property name="root_build.xml" location="${public_html}/build.xml"/>
  24. <!--<property name="build_properties.xml" location="${public_html}/build_properties.xml" />-->
  25. <property name="object_modeling.xsl" location="${public_html}/default_db_xml_cache.public/object_modeling.xsl"/>
  26. <property name="build_properties" location="${public_html}/build_properties" />
  27. <property name="targetNamespace.base" value="${targetNamespace.base}"/> <!-- to be set by WPS_Functions/object_modeling_build_infrastructure/temp/build_object_modeling_build_infrastructure_child.xml -->
  28. <!-- <property name="table.local" location="${public_html}/table"/>
  29. <property name="transformed.local" location="${default_db.instance.xml}/transformed"/>
  30. <property name="procesy5_system_schema.xml" value="${transformed.local}/procesy5_system_schema.xml"/>
  31. -->
  32. <target name="write_child_props_to_config_dir" depends="read_build_properties">
  33. <echoproperties destfile="${build_object_modeling.childproperties}"/>
  34. </target>
  35. <target name="read_build_properties">
  36. <!-- <ant antfile="${root_build.xml}" target="save_build_properties"/>
  37. <loadproperties srcfile="${build_properties}"/>-->
  38. <ant antfile="${WPS_Functions.build}" target="save_build_properties"/>
  39. <loadproperties srcfile="${WPS_Functions.properties}"/>
  40. <property name="new_object_by_prototype.xml" value="${transformed.local}/system_cache__appinfo/new_object_by_prototype.xml"/>
  41. <echo>We try to refresh ${default_db.xml} or ${detect_objects_parent_relations.xsl} or ${procesy5_system_schema.xml}</echo>
  42. </target>
  43. <!-- example 2017-12-28 for infrastructure.xsd
  44. <ant antfile="/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/object_modeling/build_object_modeling.xml"
  45. target="system_cache__appinfo:new_object_by_prototype">
  46. <property name="NamespaceObjectInstanceTable"
  47. value="Rozdzielcza_Kabel_swiatl_obcy"/>
  48. <property name="prototype_object_namespace"
  49. value="https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd"/>
  50. <property name="TargetNamespaceBindingsApi"
  51. value="https://biuro.biall-net.pl/wfs"/>
  52. <property name="NamespaceDatabaseStorageDefinitionPrefix" value="default_db"/>
  53. <property name="NamespaceObjectInstanceType" value="table"/>
  54. <property name="targetNamespace.base"
  55. value="https://biuro.biall-net.pl/xmlschema_procesy5/default_db"/>
  56. <property name="new_object_namespace"
  57. value="https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Kabel_swiatl_obcy.xsd"/>
  58. <property name="object_modeling.Error.Handling" value="OVERWRITE"/>
  59. </ant>
  60. expected debug is :
  61. procesy5_system_schema.xml_if_not_exists:
  62. [echo] #50
  63. [echo] prototype_object_namespace = https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd like https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd
  64. [echo] new_object_namespace = https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Kabel_Swiatlowodowy_wsg84.xsd like https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Wykop_przedmiar_na_mikrorurki.xsd
  65. [echo] object_modeling_basedir= /Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/object_modeling
  66. [echo] procesy5_system_schema.xml= /Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/default_db.instance.xml/transformed/procesy5_system_schema.xml
  67. [echo] generating from https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd
  68. [echo] generating to https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Kabel_Swiatlowodowy_wsg84.xsd
  69. [echo] generating grom base
  70. [echo] $NamespaceObjectInstanceTable = Rozdzielcza_Kabel_Swiatlowodowy_wsg84 - required complexType name like Rozdzielcza_rurociag
  71. [echo] targetNamespace.base https://biuro.biall-net.pl/xmlschema_procesy5/default_db like https://biuro.biall-net.pl/xmlschema_procesy5/default_db or https://biuro.biall-net.pl/api/36
  72. [echo] object_modeling.Error.Handling = OVERWRITE
  73. [echo] NamespaceObjectInstanceTable = Rozdzielcza_Kabel_Swiatlowodowy_wsg84
  74. #72 system_cache__appinfo:new_object_by_prototype with param testing:
  75. [xslt] $targetNamespace.base = https://biuro.biall-net.pl/xmlschema_procesy5/default_db
  76. [xslt] $new_object_namespace = https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Kabel_Swiatlowodowy_wsg84.xsd
  77. [xslt] $prototype_object_namespace = https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd
  78. [xslt] searching for @targetNamespace = biuro.biall-net.pl/xmlschema_procesy5/default_db ($targetNamespace.base) for $NamespaceObjectInstanceTable=Rozdzielcza_Kabel_Swiatlowodowy_wsg84;
  79. [xslt]
  80. #26 count($system_cache__appinfo:new_object_by_prototype.base//*) = 54
  81. [xslt] #26 count($system_cache__appinfo:new_object_by_prototype.base.simpleType//*) = 15836
  82. [xslt] #55 when test="$prototype_object_namespace(https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd) and $new_object_namespace(https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Kabel_Swiatlowodowy_wsg84.xsd)"
  83. [xslt] #61 count($system_cache__appinfo:new_object_by_prototype_test_if_prototype/*) = 1
  84. [xslt] #65 $system_cache__appinfo:new_object_by_prototype.base is in schema - OK applying
  85. [xslt] #72 count system_cache__appinfo:new_object_by_prototype.base.simpleType= 15836
  86. (...)
  87. #15 $TargetNamespace=https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd; system_cache__appinfo:TargetNamespaceBindings_from_Namespace
  88. [xslt] #208 result $prototype_TargetNamespaceBindings_from_Namespace from param/$TargetNamespacehttps://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd; and /$NamespaceObjectInstanceTable=Rozdzielcza_Kabel_Swiatlowodowy_wsg84
  89. [xslt] /@NamespaceDatabaseStorageDefinitionPrefix=default_db;
  90. [xslt] /@NamespaceObjectInstanceType=Types;
  91. [xslt] /@NamespaceObjectInstanceTable=infrastructure;
  92. [xslt] /@NamespacePrefix=default_db__x3A__infrastructure;
  93. [xslt] #15 $TargetNamespace=https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Kabel_Swiatlowodowy_wsg84.xsd; system_cache__appinfo:TargetNamespaceBindings_from_Namespace
  94. [xslt] #139 will try saving to /Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/table/Rozdzielcza_Kabel_Swiatlowodowy_wsg84.xsd
  95. -->
  96. <target name="system_cache__appinfo:new_object_by_prototype.with_rebuild_schema" depends="read_build_properties">
  97. <ant antfile="${build_object_modeling_by_default_db_xml_schema.xml}" target="system_cache__appinfo:default_db_get_xml_schema_if_not_exists"/>
  98. <ant antfile="${build_root.xml}" target="procesy5_system_schema.xml" />
  99. <antcall target="system_cache__appinfo:new_object_by_prototype"/>
  100. </target>
  101. <target name="system_cache__appinfo:new_object_by_prototype" depends="read_build_properties" description="ANT_TARGET new object by using prototype from Types" >
  102. <input addproperty="prototype_object_namespace" /> <!-- https://biuro.biall-net.pl/wfs/default_db/Types/Infrastructure.xsd -->
  103. <input addproperty="new_object_namespace" /> <!-- https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_struktura_wewnetrzna_wsg84.xsd -->
  104. <input addproperty="object_modeling.Error.Handling" defaultvalue="IGNORE" />
  105. <input addproperty="merge_priority" defaultvalue="database"/>
  106. <input addproperty="suppres_saving" />
  107. <!--<property name="say_NamespaceObjectInstanceTable" />-->
  108. <regexp />
  109. <!--<exec executable="say" spawn="true" failifexecutionfails="false">
  110. <arg line="-v alex"/>
  111. <arg line="using object modeling "/>
  112. <!-\-<arg line="generating new object by prototype for name ${NamespaceObjectInstanceTable} "/>-\->
  113. </exec>-->
  114. <ant antfile="${system_ui_info_speech}" target="p5suis:say_to_queue">
  115. <property name="p5suis:say_text" value="using object modeling " />
  116. </ant>
  117. <ant antfile="${system_ui_info_speech}" target="p5suis:say_from_queue"/>
  118. <ant antfile="${root_build.xml}" target="procesy5_system_schema.xml_if_not_exists" />
  119. <echo> #50
  120. prototype_object_namespace = ${prototype_object_namespace} like https://biuro.biall-net.pl/wfs/default_db/Types/infrastructure.xsd
  121. new_object_namespace = ${new_object_namespace} like https://biuro.biall-net.pl/wfs/default_db/table/Rozdzielcza_Wykop_przedmiar_na_mikrorurki.xsd
  122. object_modeling_basedir= ${object_modeling_basedir}
  123. procesy5_system_schema.xml= ${procesy5_system_schema.xml}
  124. generating from ${prototype_object_namespace}
  125. generating to ${new_object_namespace}
  126. generating grom base
  127. $NamespaceObjectInstanceTable = ${NamespaceObjectInstanceTable} - required complexType name like Rozdzielcza_rurociag
  128. targetNamespace.base ${targetNamespace.base} like https://biuro.biall-net.pl/xmlschema_procesy5/default_db
  129. object_modeling.Error.Handling = ${object_modeling.Error.Handling}
  130. NamespaceObjectInstanceTable = ${NamespaceObjectInstanceTable}
  131. merge_priority = ${merge_priority}
  132. suppres_saving = ${suppres_saving}
  133. </echo>
  134. <delete file="${new_object_by_prototype.xml}"/>
  135. <xslt basedir="./" style="${object_modeling.xsl}" in="${procesy5_system_schema.xml}" destdir="./" out="${new_object_by_prototype.xml}" force="yes" >
  136. <factory name="net.sf.saxon.TransformerFactoryImpl">
  137. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  138. <attribute name="http://saxon.sf.net/feature/initialMode" value="{http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd}new_object_by_prototype"/>
  139. </factory>
  140. <param name="prototype_object_namespace" expression="${prototype_object_namespace}"/>
  141. <param name="new_object_namespace" expression="${new_object_namespace}"/>
  142. <param name="procesy5_system_schema_collection_dir" expression="${public_html}"/>
  143. <param name="external_schema_table.path" expression="${external_schema_table.path}"/>
  144. <param name="targetNamespace.base" expression="${targetNamespace.base}"/>
  145. <param name="object_modeling_build" expression="${object_modeling_build}"/>
  146. <param name="default_db.instance.xml" expression="${default_db.instance.xml}"/>
  147. <param name="object_modeling.Error.Handling" expression="${object_modeling.Error.Handling}"/>
  148. <param name="NamespaceObjectInstanceTable" expression="${NamespaceObjectInstanceTable}"/>
  149. <param name="vrtfNamespaces.xml" expression="${vrtfNamespaces.xml}"/>
  150. <param name="default_db_targetNamespace_detect_string" expression="${default_db_targetNamespace_detect_string}"/>
  151. <param name="zasob_id_db_targetNamespace_detect_string" expression="${zasob_id_db_targetNamespace_detect_string}"/>
  152. <param name="merge_priority" expression="${merge_priority}"/>
  153. <param name="suppres_saving" expression="${suppres_saving}"/>
  154. <param name="detect_resource_type.local" expression="${detect_resource_type.local}"/>
  155. <param name="{http://biuro.biall-net.pl/xmlschema_procesy5/system_cache/object_parent_relations/object_parent_relations.xsd}detect_objects_parent_relations.local" expression="${detect_objects_parent_relations.local}"/>
  156. <param name="vrtfNamespaces.xml" expression="${vrtfNamespaces.xml}"/>
  157. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  158. </xslt>
  159. <!--<loadfile property="new_object_by_prototype.xml_result" srcfile="${new_object_by_prototype.xml}"/>
  160. <echo message="${new_object_by_prototype.xml_result}"/>-->
  161. </target>
  162. </project>