net.sourceforge.cruisecontrol.publishers
Class XSLTLogPublisher

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.publishers.XSLTLogPublisher
All Implemented Interfaces:
Publisher, java.io.Serializable

public class XSLTLogPublisher
extends java.lang.Object
implements Publisher

Publisher Plugin which performs an xslt transform of the jdom Element representation of the build log to an output file of choice.

Author:
David Cole
See Also:
Serialized Form

Constructor Summary
XSLTLogPublisher()
           
 
Method Summary
 void publish(org.jdom.Element cruisecontrolLog)
          Perform the log transform and publish the results.
 void setDirectory(java.lang.String directory)
          Directory where the transformed log will is to be written
 void setOutFileName(java.lang.String name)
          Name of the output file where the transformed log contents is to be written.
 void setPublishOnFail(boolean pof)
          If true then publish the log contents even if the build failed.
 void setXsltFile(java.lang.String fileName)
          Full path to the xslt file used in the transform
 void validate()
          Called after the configuration is read to make sure that all the mandatory parameters were specified..
protected  void writeFile(org.jdom.Element cruisecontrolLog, java.lang.String path)
          Performs the transform of the cruisecontrolLog, writing the results to the locations specified by the path parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLTLogPublisher

public XSLTLogPublisher()
Method Detail

setXsltFile

public void setXsltFile(java.lang.String fileName)
Full path to the xslt file used in the transform

Parameters:
fileName - (required)

setOutFileName

public void setOutFileName(java.lang.String name)
Name of the output file where the transformed log contents is to be written.
If omitted, a default will be provided matching the build label name

Parameters:
name -

setDirectory

public void setDirectory(java.lang.String directory)
Directory where the transformed log will is to be written

Parameters:
directory -

setPublishOnFail

public void setPublishOnFail(boolean pof)
If true then publish the log contents even if the build failed. If false then only publish the log if the build was successful
Defaults to true

Parameters:
pof -

validate

public void validate()
              throws CruiseControlException
Called after the configuration is read to make sure that all the mandatory parameters were specified..

Specified by:
validate in interface Publisher
Throws:
CruiseControlException - if there was a configuration error.

publish

public void publish(org.jdom.Element cruisecontrolLog)
             throws CruiseControlException
Perform the log transform and publish the results.

Specified by:
publish in interface Publisher
Parameters:
cruisecontrolLog - JDOM Element representation of the main cruisecontrol build log
Throws:
CruiseControlException

writeFile

protected void writeFile(org.jdom.Element cruisecontrolLog,
                         java.lang.String path)
                  throws CruiseControlException
Performs the transform of the cruisecontrolLog, writing the results to the locations specified by the path parameter

Parameters:
cruisecontrolLog -
path -
Throws:
CruiseControlException