p5dg.p5ant.include.structure.ant.build.target.sql.xsl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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:p5dg="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/documentation_generator/documentation_generator.xsd"
  5. xmlns:p5up5b="http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/upgrade_procesy5_bocian.xsd"
  6. xmlns:p5ant="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache.public/ant/ant.xsd"
  7. exclude-result-prefixes="xs"
  8. version="2.0">
  9. <xsl:output indent="yes"/>
  10. <xsl:strip-space elements="*"/>
  11. <xsl:template match="target[@p5up5b:task_type='sql']" mode="p5dg:p5ant.include.structure.ant.build.target">
  12. <p5dg:p5ant.include.structure.ant.build.target>
  13. <xsl:attribute name="p5dg:basedir" select="p5up5b:getproperty(root(),@p5up5b:prefix,'SYSTEM.repository')"/>
  14. <xsl:attribute name="p5dg:name" select="@p5up5b:task_name"/>
  15. <xsl:attribute name="p5ant:uuid" select="generate-id()"/>
  16. <!-- <xsl:attribute name="p5build_SE.procesy5_config.default_db.server.host" select="p5up5b:getproperty(root(),@p5up5b:prefix,'procesy5_config.default_db.server.host')"/>
  17. <xsl:attribute name="p5build_SE.procesy5_config.default_db.server.pass" select="p5up5b:getproperty(root(),@p5up5b:prefix,'procesy5_config.default_db.server.pass')"/>
  18. <xsl:attribute name="p5build_SE.procesy5_config.default_db.server.port" select="p5up5b:getproperty(root(),@p5up5b:prefix,'procesy5_config.default_db.server.port')"/>
  19. <xsl:attribute name="p5build_SE.procesy5_config.default_db.server.user" select="p5up5b:getproperty(root(),@p5up5b:prefix,'procesy5_config.default_db.server.user')"/>
  20. -->
  21. <!--<xsl:copy-of select="@*"/>-->
  22. <target name="{@p5up5b:task_name}">
  23. <xsl:variable name="exec">
  24. <exec dir="{p5up5b:getproperty(root(),@p5up5b:prefix,'SYSTEM.repository')}"
  25. output="{current-group()[@p5up5b:task_name.param='output']/@value}"
  26. >
  27. <xsl:attribute name="executable">${mysql}</xsl:attribute>
  28. <arg>
  29. <xsl:attribute name="line">
  30. <xsl:text>${mysql} -u </xsl:text><xsl:value-of select="p5up5b:getproperty(root(),@p5up5b:prefix,'procesy5_config.default_db.server.user')"/>
  31. <xsl:text> -p </xsl:text><xsl:value-of select="p5up5b:getproperty(root(),@p5up5b:prefix,'procesy5_config.default_db.server.pass')"/>
  32. <xsl:text> "</xsl:text><xsl:value-of select="@value"/><xsl:text>"</xsl:text>
  33. </xsl:attribute>
  34. </arg>
  35. </exec>
  36. </xsl:variable>
  37. <xsl:apply-templates mode="p5up5b:sort" select="$exec"/>
  38. </target>
  39. </p5dg:p5ant.include.structure.ant.build.target>
  40. </xsl:template>
  41. <!-- <xsl:template match="target[@p5up5b:task_name.param='username' and @p5up5b:task_name.param.attr='' ]" mode="p5dg:p5ant.include.structure.ant.build.target.sql.exec">
  42. <arg value=" -u{@value} " p5up5b:sort="1"/>
  43. </xsl:template>
  44. <xsl:template match="target[@p5up5b:task_name.param='username' and @p5up5b:task_name.param.attr='pass' ]" mode="p5dg:p5ant.include.structure.ant.build.target.sql.exec">
  45. <arg value=" -p{@value} " p5up5b:sort="2"/>
  46. </xsl:template>
  47. <xsl:template match="target[@p5up5b:task_name.param='database']" mode="p5dg:p5ant.include.structure.ant.build.target.sql.exec">
  48. <arg value=" {@value} " p5up5b:sort="3"/>
  49. </xsl:template>
  50. <xsl:template match="target[@p5up5b:task_name.param='tables']" mode="p5dg:p5ant.include.structure.ant.build.target.sql.exec">
  51. <arg value=" {@value} " p5up5b:sort="4"/>
  52. </xsl:template>-->
  53. <!--<xsl:template match="target[@p5up5b:task_name.param='output']" mode="p5dg:p5ant.include.structure.ant.build.target.sql.exec">
  54. <arg value="&gt; {@value}" p5up5b:sort="5"/>
  55. </xsl:template>-->
  56. <xsl:template match="*" mode="p5dg:p5ant.include.structure.ant.build.target.sql.exec">
  57. <xsl:comment>#56 bypassed </xsl:comment>
  58. </xsl:template>
  59. </xsl:stylesheet>