PerforceBackupProcedureRSS.xsl #1

  • //
  • guest/
  • philip_kania/
  • AdminScripts/
  • PerforceBackupProcedureRSS.xsl
  • View
  • Commits
  • Open Download .zip Download (3 KB)
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright (c) 2009 Exemplics LLC -->

<!-- Permission is hereby granted, free of charge, to any person obtaining a copy -->
<!-- of this software and associated documentation files (the "Software"), to deal -->
<!-- in the Software without restriction, including without limitation the rights -->
<!-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -->
<!-- copies of the Software, and to permit persons to whom the Software is -->
<!-- furnished to do so, subject to the following conditions: -->

<!-- The above copyright notice and this permission notice shall be included in -->
<!-- all copies or substantial portions of the Software. -->

<!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -->
<!-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -->
<!-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -->
<!-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -->
<!-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -->
<!-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -->
<!-- THE SOFTWARE. -->

<!-- Version 2009.3 -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- omit-xml-declaration because we are outputing a rss fragment
     (a single rss item)
-->
<xsl:output method="xml" indent="yes" encoding="UTF-8"
  omit-xml-declaration="yes" />

<!-- uri must be passed as an argument -->
<xsl:param name="uri" />

<xsl:template match="/">
  <item>
    <title>
      <xsl:value-of select="./BackupProcedure/@ServerShortName" />
      <xsl:text> checkpoint </xsl:text>
      <xsl:value-of select="./BackupProcedure/@CheckpointNumber" />
      <xsl:text> </xsl:text>
      <xsl:value-of select="./BackupProcedure/@BackupType" />
      <xsl:text> backup</xsl:text>
    </title>
    <link><xsl:value-of select="$uri" /></link>
    <description>
      <xsl:variable name="numErrors">
        <xsl:value-of select="count(./BackupProcedure/Steps/Step/Summary[@ResultCode != 0])" />
      </xsl:variable>
      <xsl:variable name="numSteps">
        <xsl:value-of select="count(./BackupProcedure/Steps/Step)" />
      </xsl:variable>
      <xsl:value-of select="$numErrors" />
      <xsl:text> error</xsl:text>
      <xsl:if test="$numErrors != 1">
        <xsl:text>s</xsl:text>
      </xsl:if>
      <xsl:text> in </xsl:text>
      <xsl:value-of select="$numSteps" />
      <xsl:text> step</xsl:text>
      <xsl:if test="$numSteps != 1">
        <xsl:text>s</xsl:text>
      </xsl:if>
      <xsl:text> - started </xsl:text>
      <xsl:value-of select="./BackupProcedure/Summary/@StartTime" />
      <xsl:text> - finished </xsl:text>
      <xsl:value-of select="./BackupProcedure/Summary/@EndTime" />
    </description>
    <pubDate><xsl:value-of select="./BackupProcedure/Summary/@EndTime" /></pubDate>
    <guid><xsl:value-of select="$uri" /></guid>
  </item>
</xsl:template>

</xsl:stylesheet>
# Change User Description Committed
#1 7202 Philip Kania Added scripts to generate RSS feeds.
Updated template configuration scripts to run RSS scripts.