You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Problem

  • the file extension of log files attached at mails is .log per default
  • in some environments (such as Blackberry) this extension is unknown

Solution

  • see "How to configure email service?" to change the JobScheduler configuration if necessary.
  • Change the sytelsheet for JobScheduler e-mail service to define a different attchment name for log files from
    <?xml version='1.0' encoding='iso-8859-1' ?>
    <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version   = "1.0">
        
       ...
    
       <xsl:template match="/scheduler_event">
          ...
          <xsl:copy-of select="mail/body/* [ not( text ) ]" />
          ...
       </xsl:template>
    
    </xsl:stylesheet>
    

to

<?xml version='1.0' encoding='iso-8859-1' ?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version   = "1.0">
    
   ...

   <xsl:template match="/scheduler_event">
      ...
      <xsl:copy-of select="mail/body/* [ not(text) and not (//file) ]" />
      <xsl:for-each select="mail/body/file" >
        <xsl:variable name='filename'>
          <xsl:choose>
            <xsl:when test="contains(@path, '.log')">
              <xsl:value-of select="concat(substring-before(@path,'.log'),'.txt')" />
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@path" />
            </xsl:otherwise>
          </xsl:choose>                  
        </xsl:variable>
        <xsl:element name="{name()}">
          <xsl:copy-of select="@*" />
          <xsl:attribute name="mail_filename">
            <xsl:value-of select="$filename" />
          </xsl:attribute>
        </xsl:element>
      </xsl:for-each>
      ...
   </xsl:template>

</xsl:stylesheet>

The attribute @mail_filename is for determine the name of the attached file. If this attribute is missing, @path will be used.

  • No labels