org.mmbase.config
Class AbstractReport

java.lang.Object
  |
  +--org.mmbase.config.AbstractReport
All Implemented Interfaces:
ReportInterface
Direct Known Subclasses:
BuilderReport, DatabaseReport, JavaReport, JVMOptionsReport, LanguagesReport

public abstract class AbstractReport
extends java.lang.Object
implements ReportInterface

Author:
Case Roole, cjr@dds.nl $Id: AbstractReport.java,v 1.5.6.1 2002/12/03 21:53:53 michiel Exp $ $Log: AbstractReport.java,v $ Revision 1.5.6.1 2002/12/03 21:53:53 michiel the usual oops Revision 1.5 2001/07/16 10:08:07 jaco jaco: Moved all configuration stuff to MMBaseContext. If needed params not found or incorrect a ServletException with a description isthrown. It's now again possible to not redirect System.out and System.err to a file. Parameters are searched in the webapp (using context-param parameters) when started using a servlet. If htmlroot is not specified MMBaseContext will try to set it to the webapp root directory. Revision 1.4 2001/07/09 12:30:02 jaco jaco: Changed old method for retrieving mmbase.config and mmbase.htmlroot with new method. Revision 1.3 2001/04/10 11:02:07 michiel michiel: new logging system Revision 1.2 2000/10/07 17:06:07 case cjr: Added checking of mmbase JVM options and some minor bugfixes

Field Summary
protected  java.lang.String configpath
           
protected  java.lang.String encoding
           
protected  java.lang.String mode
           
protected  java.util.Hashtable specialChars
           
 
Constructor Summary
AbstractReport()
           
 
Method Summary
protected  java.util.Hashtable getPropertiesFromXML(java.lang.String path)
          Read an XML file in which key/value pairs are represented as tag and content
protected  java.lang.String htmlEntities(java.lang.String s)
           
 void init(java.lang.String mode, java.lang.String encoding)
           
protected  java.util.Vector listDirectory(java.lang.String path)
          Retrieve all xml files in a directory
 java.lang.String report()
           
protected  java.lang.String stringReplace(java.lang.String s, java.lang.String sub, java.lang.String rep)
          Replace a substring
protected  java.lang.String xmlErrorMessage(java.lang.String path, org.mmbase.config.XMLParseResult pr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.config.ReportInterface
label
 

Field Detail

mode

protected java.lang.String mode

encoding

protected java.lang.String encoding

specialChars

protected java.util.Hashtable specialChars

configpath

protected java.lang.String configpath
Constructor Detail

AbstractReport

public AbstractReport()
Method Detail

init

public void init(java.lang.String mode,
                 java.lang.String encoding)
Specified by:
init in interface ReportInterface

report

public java.lang.String report()
Specified by:
report in interface ReportInterface

stringReplace

protected java.lang.String stringReplace(java.lang.String s,
                                         java.lang.String sub,
                                         java.lang.String rep)
Replace a substring
Parameters:
s - String which is to be modified
sub - Substring to be replaced (once!)
rep - Replacement string
Returns:
s with substring sub replaced with rep

listDirectory

protected java.util.Vector listDirectory(java.lang.String path)
                                  throws java.io.IOException
Retrieve all xml files in a directory
Parameters:
path - Directory path
Returns:
String array containing the names of the xml files in the directory, without the extension

getPropertiesFromXML

protected java.util.Hashtable getPropertiesFromXML(java.lang.String path)
Read an XML file in which key/value pairs are represented as tag and content
Parameters:
path - Full path to XML file
Returns:
Hashtable with the key/value pairs or an empty Hashtable if something went wrong.

htmlEntities

protected java.lang.String htmlEntities(java.lang.String s)
Returns:
String with '<' and '>' converted to respectively < and >

xmlErrorMessage

protected java.lang.String xmlErrorMessage(java.lang.String path,
                                           org.mmbase.config.XMLParseResult pr)


MMBase build 1.6.5.20030923