images.xsl 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. exclude-result-prefixes="xs"
  7. version="2.0">
  8. <!-- parsed by default_db_xml_cache.public/system_cache__appinfo/postprocess.xsl
  9. by: executed by WPS_Functions/default_db/CRM_PROCES_tree/build_CRM_PROCES_tree.xml target name="default_db:PROCES_INIT:tree:dita"
  10. and public_html/default_db_xml_cache.public/default_db/tree_to_dita.xsl
  11. -->
  12. <!-- Do parsowania <images>
  13. <image x="1" y="1">
  14. <xmin>6525000.91100983333333333345</xmin>
  15. <ymin>6012859.46859783333333333345</ymin>
  16. <xmax>6525085.57767650000000000000</xmax>
  17. <ymax>6012944.13526450000000000000</ymax>
  18. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-1-1.png</file>
  19. </image>
  20. <image x="2" y="1">
  21. <xmin>6525080.57767650000000000000</xmin>
  22. <ymin>6012859.46859783333333333345</ymin>
  23. <xmax>6525165.24434316666666666655</xmax>
  24. <ymax>6012944.13526450000000000000</ymax>
  25. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-1-2.png</file>
  26. </image>
  27. <image x="1" y="2">
  28. <xmin>6525000.91100983333333333345</xmin>
  29. <ymin>6012939.13526450000000000000</ymin>
  30. <xmax>6525085.57767650000000000000</xmax>
  31. <ymax>6013023.80193116666666666655</ymax>
  32. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-2-1.png</file>
  33. </image>
  34. <image x="2" y="2">
  35. <xmin>6525080.57767650000000000000</xmin>
  36. <ymin>6012939.13526450000000000000</ymin>
  37. <xmax>6525165.24434316666666666655</xmax>
  38. <ymax>6013023.80193116666666666655</ymax>
  39. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-2-2.png</file>
  40. </image>
  41. </images>
  42. -->
  43. <xsl:output indent="yes"/>
  44. <xsl:strip-space elements="*"/>
  45. <xsl:template match="*" mode="system_cache__dita:postprocess_image_convert">
  46. <xsl:param name="ext" select="substring-after(TYPE,'/')"/>
  47. <xsl:param name="fileindex" select="ID"/>
  48. <base64_to_image srcfile="{$temp}/{$uuid}/{ID}_image.base64.{$ext}" dstfile="{$temp}/{$uuid}/{ID}_image.{$ext}" />
  49. </xsl:template>
  50. <xsl:template match="*" mode="system_cache__dita:process_image">
  51. <xsl:param name="width" required="yes"/>
  52. <xsl:param name="ext" select="substring-after(TYPE,'/')"/>
  53. <xsl:param name="fileindex" select="ID"/>
  54. <xsl:choose>
  55. <xsl:when test="number($width) &gt; 600">
  56. <image href="{$fileindex}_image.{$ext}" width="500"></image>
  57. </xsl:when>
  58. <xsl:otherwise>
  59. <image href="{$fileindex}_image.{$ext}" width="{$width}"></image>
  60. </xsl:otherwise>
  61. </xsl:choose>
  62. </xsl:template>
  63. <xsl:template match="*" mode="system_cache__dita:postprocess_image">
  64. <xsl:param name="ext" select="substring-after(TYPE,'/')"/>
  65. <xsl:param name="fileindex" select="ID"/>
  66. <xsl:result-document href="{$temp}/{$uuid}/{ID}_image.base64.{$ext}" omit-xml-declaration="yes">
  67. <xsl:value-of select="IMAGE/text()"/>
  68. </xsl:result-document>
  69. <xsl:apply-templates mode="system_cache__dita:postprocess_image_convert" select=".">
  70. <xsl:with-param name="ext" select="$ext"/>
  71. <xsl:with-param name="fileindex" select="$fileindex"/>
  72. </xsl:apply-templates>
  73. </xsl:template>
  74. <!-- IMAGES - gml!!! -->
  75. <xsl:template mode="system_cache__dita:preprocess_images" match="*">
  76. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  77. <xsl:comment>#90 system_cache__dita:preprocess_images</xsl:comment>
  78. <xsl:apply-templates mode="system_cache__dita:preprocess_images__write" select=".">
  79. <xsl:with-param name="fileindex" select="$fileindex"/>
  80. </xsl:apply-templates>
  81. <xsl:result-document href="{$ditadir}/{$fileindex}.gml">
  82. <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"
  83. xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
  84. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  85. xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:default_objects="https://biuro.biall-net.pl/wfs/ault_objects">
  86. <xsl:attribute name="local-name" select="local-name()"/>
  87. <gml:featureMember>
  88. <xsl:copy-of select="." copy-namespaces="no"/>
  89. </gml:featureMember>
  90. </wfs:FeatureCollection>
  91. <!--<xsl:apply-templates mode="preprocess_gml_geometry_image" select="."/>-->
  92. </xsl:result-document>
  93. <!-- podsumwoania po stanach -->
  94. </xsl:template>
  95. <xsl:template mode="system_cache__dita:preprocess_images__write" match="*">
  96. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  97. <gml_to_image srcfile="{$ditadir}/{$fileindex}.gml" dstfile="{$ditadir}/{$fileindex}.png.xml" fileindex="{$fileindex}" ditadir="{$ditadir}"/>
  98. </xsl:template>
  99. <xsl:template mode="system_cache__dita:images__read" match="*">
  100. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  101. <!-- to read and parse system_cache__appinfo:images -->
  102. <!--<xsl:variable name="fileindex" select="concat(ID,'_',local-name())"/>-->
  103. <xsl:choose>
  104. <xsl:when test="doc-available(concat($ditadir,'/',$fileindex,'.png.xml'))">
  105. <xsl:apply-templates mode="system_cache__appinfo:images" select="doc(concat($ditadir,'/',$fileindex,'.png.xml'))">
  106. <xsl:with-param name="fileindex" select="$fileindex"/>
  107. </xsl:apply-templates>
  108. </xsl:when>
  109. <xsl:otherwise>
  110. <xsl:comment>#83 doc not aviable <xsl:value-of select="concat($ditadir,'/',$fileindex,'.png.xml')"/></xsl:comment>
  111. <xsl:message>#83 doc not aviable <xsl:value-of select="concat($ditadir,'/',$fileindex,'.png.xml')"/></xsl:message>
  112. </xsl:otherwise>
  113. </xsl:choose>
  114. </xsl:template>
  115. <!-- EOF IMAGES - gml!!! -->
  116. <xsl:template mode="system_cache__appinfo:images" match="images">
  117. <xsl:param name="fileindex" required="yes"/> <!-- ex. 3161_IN7_MK_BAZA_DYSTRYBUCJI - is related dir in dita dir with images -->
  118. <xsl:apply-templates mode="system_cache__appinfo:images">
  119. <xsl:with-param name="fileindex" select="$fileindex"/>
  120. </xsl:apply-templates>
  121. </xsl:template>
  122. <xsl:template mode="system_cache__appinfo:images" match="image[@x and @y]">
  123. <xsl:param name="fileindex" required="yes"/>
  124. <image href="{$fileindex}/{$fileindex}_image-{@x}-{@y}.png" width="300"/>
  125. </xsl:template>
  126. <xsl:template mode="system_cache__appinfo:images" match="*">
  127. <xsl:message terminate="yes">#56 not expected data - needed @x and @y to be in xml image element: correct is:
  128. <image x="1" y="1">
  129. <xmin>6525000.91100983333333333345</xmin>
  130. <ymin>6012859.46859783333333333345</ymin>
  131. <xmax>6525085.57767650000000000000</xmax>
  132. <ymax>6012944.13526450000000000000</ymax>
  133. <file>/Users/a.binder/Documents/xmlschema_procesy5/src-xmlschema/public_html/WPS_Functions/mapserver_gml_to_png/map/image-1-1.png</file>
  134. </image>
  135. </xsl:message>
  136. </xsl:template>
  137. <xsl:template mode="system_cache__appinfo:images__write" match="*">
  138. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  139. <gml_to_image srcfile="{$ditadir}/{$fileindex}.gml" dstfile="{$ditadir}/{$fileindex}.png.xml" fileindex="{$fileindex}" ditadir="{$ditadir}"/>
  140. </xsl:template>
  141. <xsl:template mode="system_cache__appinfo:images__read" match="*">
  142. <xsl:param name="fileindex" select="concat(ID,'_',local-name())"/>
  143. <!-- to read and parse system_cache__appinfo:images -->
  144. <!--<xsl:variable name="fileindex" select="concat(ID,'_',local-name())"/>-->
  145. <xsl:choose>
  146. <xsl:when test="doc-available(concat($ditadir,'/',$fileindex,'.png.xml'))">
  147. <xsl:apply-templates mode="system_cache__appinfo:images" select="doc(concat($ditadir,'/',$fileindex,'.png.xml'))">
  148. <xsl:with-param name="fileindex" select="$fileindex"/>
  149. </xsl:apply-templates>
  150. </xsl:when>
  151. <xsl:otherwise>
  152. <xsl:comment>#83 doc not aviable <xsl:value-of select="concat($ditadir,'/',$fileindex,'.png.xml')"/></xsl:comment>
  153. <xsl:message>#83 doc not aviable <xsl:value-of select="concat($ditadir,'/',$fileindex,'.png.xml')"/></xsl:message>
  154. </xsl:otherwise>
  155. </xsl:choose>
  156. </xsl:template>
  157. </xsl:stylesheet>