More information


de.spieleck.pcs.view
Class View

java.lang.Object
  |
  +--de.spieleck.pcs.view.View
All Implemented Interfaces:
ConfigUser

public class View
extends java.lang.Object
implements ConfigUser

This class is reponsible for displaying an ActionResult. It transform the xml data of the ActionResult via XSL to HTML (or whatever) and writes it to an OutputStream.


Constructor Summary
View()
          Creates an instance of View
View(java.io.OutputStream os)
          Creates a new instance of view with the given settings
 
Method Summary
 void cleanUp()
          used to remove this object from the ConfigAdmins list of ConfigUsers This must be done, since otherwise no old Views would be get by GC since ConfigAdmin helds forever an reference to each View object
 java.io.OutputStream getOutputStream()
          returns the OutputStream of this View
static boolean isUseJTidy()
          Getter for property useJTidy.
 void output(ActionResult ar, java.lang.String styleSheetFile)
          displays the given ActionResult on this View
 void resetConfig()
          resets the configuration
 void setOutputStream(java.io.OutputStream os)
          sets the stream to write on
protected  void setProperties(javax.xml.transform.Transformer trans, java.util.Hashtable h)
          sets the Parameters of the given Transformer using the values stored in the given Hashtable
static void setUseJTidy(boolean useJTidy)
          Setter for property useJTidy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

View

public View(java.io.OutputStream os)
     throws java.io.IOException
Creates a new instance of view with the given settings
Parameters:
os - the OutputStream to write on
xml - the XML that should be used as base for the output
key - the key to lookup in the view.properties for getting the name of the stylesheet to use
style - the style of the output

View

public View()
     throws java.io.IOException
Creates an instance of View
Method Detail

cleanUp

public void cleanUp()
used to remove this object from the ConfigAdmins list of ConfigUsers This must be done, since otherwise no old Views would be get by GC since ConfigAdmin helds forever an reference to each View object

setOutputStream

public void setOutputStream(java.io.OutputStream os)
sets the stream to write on

getOutputStream

public java.io.OutputStream getOutputStream()
returns the OutputStream of this View

output

public void output(ActionResult ar,
                   java.lang.String styleSheetFile)
            throws ViewException
displays the given ActionResult on this View
Parameters:
ar - the ActionResult
styleSheetFile - absolute path of the stylesheet to use
Throws:
ViewException - if an exception occurs during transformation

setProperties

protected void setProperties(javax.xml.transform.Transformer trans,
                             java.util.Hashtable h)
sets the Parameters of the given Transformer using the values stored in the given Hashtable

resetConfig

public void resetConfig()
resets the configuration
Specified by:
resetConfig in interface ConfigUser

isUseJTidy

public static boolean isUseJTidy()
Getter for property useJTidy.
Returns:
Value of property useJTidy.

setUseJTidy

public static void setUseJTidy(boolean useJTidy)
Setter for property useJTidy.
Parameters:
useJTidy - New value of property useJTidy.

More information