postprocess.xsl 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  5. xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
  6. xmlns:p5suis="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/system_ui_info_speech/system_ui_info_speech.xsd"
  7. exclude-result-prefixes="xs"
  8. version="2.0">
  9. <xsl:output indent="yes"/>
  10. <xsl:strip-space elements="*"/>
  11. <!-- used by WPS_Functions/default_db/CRM_PROCES_tree/build_CRM_PROCES_tree.xml target name="default_db:PROCES_INIT:tree:dita"
  12. and public_html/default_db_xml_cache.public/default_db/tree_to_dita.xsl
  13. -->
  14. <xsl:param name="temp" required="yes"/>
  15. <xsl:param name="uuid" required="yes"/>
  16. <xsl:param name="postprocess_modules.xml" required="yes"/>
  17. <xsl:param name="basedir" required="yes"/>
  18. <xsl:param name="threadcount" select="'10'"/>
  19. <xsl:param name="p5suis:say_queue_dir" required="yes"/>
  20. <xsl:template mode="system_cache__appinfo:preprocess" match="preprocess_dita">
  21. <project basedir="{$temp}" name="project_for_{local-name()}" default="default">
  22. <property name="uuid" value="{$uuid}"/>
  23. <property name="temp" value="{$temp}"/>
  24. <target name="default">
  25. <parallel threadcount="{$threadcount}">
  26. <xsl:apply-templates mode="system_cache__appinfo:preprocess"/>
  27. </parallel>
  28. </target>
  29. </project>
  30. </xsl:template>
  31. <xsl:template mode="system_cache__appinfo:postprocess" match="postprocess_dita">
  32. <project basedir="{$temp}" name="project_for_{local-name()}" default="default">
  33. <property name="uuid" value="{$uuid}"/>
  34. <property name="temp" value="{$temp}"/>
  35. <target name="default">
  36. <parallel threadcount="{$threadcount}">
  37. <xsl:apply-templates mode="system_cache__appinfo:postprocess"/>
  38. </parallel>
  39. </target>
  40. </project>
  41. </xsl:template>
  42. <xsl:template mode="system_cache__appinfo:postprocess" match="base64_to_image">
  43. <xsl:choose>
  44. <xsl:when test="@srcfile and @dstfile">
  45. <exec executable="base64">
  46. <arg line="-i {@srcfile}"/>
  47. <arg line="-o {@dstfile}"/>
  48. <arg line="-D"/>
  49. </exec>
  50. </xsl:when>
  51. <xsl:otherwise>
  52. <xsl:message terminate="yes">#29 Not set @srcfile or @dstfile</xsl:message>
  53. </xsl:otherwise>
  54. </xsl:choose>
  55. </xsl:template>
  56. <xsl:template mode="system_cache__appinfo:preprocess" match="gml_to_image|graph_to_image|*">
  57. <xsl:choose>
  58. <xsl:when test="@srcfile and @dstfile and @fileindex">
  59. <echo> convert gml 2 png or graph_to_image for <xsl:value-of select="@srcfile"/> to <xsl:value-of select="@dstfile"/> , @fileindex=<xsl:value-of select="@fileindex"/>; - tymczasowy sposob mapowania do konfigu</echo>
  60. <xsl:variable name="current_node" select="."/>
  61. <xsl:variable name="postprocess_modules" select="doc($postprocess_modules.xml)"/>
  62. <xsl:for-each select="$postprocess_modules/postprocess_modules/node()[name()= current()/name()]">
  63. <xsl:for-each select="*">
  64. <sequential>
  65. <xsl:element name="{name()}">
  66. <xsl:copy-of select="@*"/>
  67. <property name="basedir" value="{$basedir}"/>
  68. <property name="uuid" value="{$uuid}"/>
  69. <xsl:for-each select="property">
  70. <xsl:element name="{name()}">
  71. <xsl:attribute name="name" select="@name"/>
  72. <xsl:attribute name="value" select="$current_node/@*[name()= current()/@name]"/>
  73. <!--<xsl:copy-of select="@*"/>-->
  74. </xsl:element>
  75. </xsl:for-each>
  76. </xsl:element>
  77. </sequential>
  78. </xsl:for-each>
  79. </xsl:for-each>
  80. </xsl:when>
  81. <xsl:otherwise>
  82. <xsl:message terminate="yes">#29 Not set @srcfile or @dstfile</xsl:message>
  83. </xsl:otherwise>
  84. </xsl:choose>
  85. </xsl:template>
  86. </xsl:stylesheet>