de.dfki.lt.hog
Class MoCoMan

java.lang.Object
  extended by de.dfki.lt.hog.MoCoMan

public class MoCoMan
extends java.lang.Object

The Module Communication Manager for the DeepThought project. It manages sessions opened with several applications along with documents analysed during such a session. For communication with remote modules XML-RPC is used and a config file mocoman.cfg specifies the port of its server.

MoCoMan is implemented as a Singleton class which means that not a constructor but the method getInstance has to be called in order to get an instance of MoCoMan.


Constructor Summary
protected MoCoMan()
          Creates an instance of MoCoMan.
 
Method Summary
 java.lang.String analyse(java.lang.String sessionId, java.lang.String annCollId, java.lang.String annId, java.lang.Integer startSpan, java.lang.Integer endSpan, java.lang.Integer depth)
          Analyses a document given as XML string via XML-RPC.
 java.lang.String analyse(java.lang.String sessionId, java.lang.String annCollId, java.lang.String annId, int startSpan, int endSpan, int depth)
          Analyses a document given as XML string.
 byte[] analyseBinary(java.lang.String sessionId, java.lang.String annCollId, java.lang.String annId, java.lang.Integer startSpan, java.lang.Integer endSpan, java.lang.Integer depth)
          Analyses a document given as XML string via XML-RPC.
 byte[] analyseBinary(java.lang.String sessionId, java.lang.String annCollId, java.lang.String annId, java.lang.Integer startSpan, java.lang.Integer endSpan, java.lang.Integer depth, java.lang.String encoding)
          Analyses a document given as XML string via XML-RPC.
 byte[] analyseBinary(java.lang.String sessionId, java.lang.String annCollId, java.lang.String annId, int startSpan, int endSpan, int depth)
          Analyses a document given as XML string via XML-RPC.
 org.w3c.dom.Node analyseDOMTree(java.lang.String sid, java.lang.String aid, int startSpan, int endSpan, int depth)
          Analyses a document given as DOM tree.
 void clearAnnotationCollection(java.lang.String sessionId, java.lang.String annCollId)
           
 boolean closeSession(java.lang.String sessionId)
          Closes a session with MoCoMan.
 java.lang.String createAnnotation(java.lang.String sessionId, java.lang.String annCollId, java.lang.String ann, java.lang.String language, java.lang.String anId)
          Creates a new annotation for a given session and annotation collection each of them specified by their ID.
 java.lang.String createAnnotationCollection(java.lang.String sessionId)
          Creates an annotation collection for a session specified by a given session ID.
 java.lang.String createInitialAnnotation(java.lang.String sessionId, java.lang.String annCollId, byte[] rawtext, java.lang.String language, java.lang.String component)
          Creates two initial annotations in a given session/collection:
1.
 java.lang.String createInitialAnnotation(java.lang.String sessionId, java.lang.String annCollId, byte[] rawtext, java.lang.String language, java.lang.String component, java.lang.String encoding)
          Creates two initial annotations in a given session/collection:
1.
 java.lang.String createInitialAnnotation(java.lang.String sessionId, java.lang.String annCollId, java.lang.String rawtext, java.lang.String language, java.lang.String component)
          Creates two initial annotations in a given session/collection:
1.
 java.lang.String createInitialAnnotation(java.lang.String sessionId, java.lang.String annCollId, java.lang.String rawtext, java.lang.String language, java.lang.String component, java.lang.String encoding)
          Creates two initial annotations in a given session/collection:
1.
 java.lang.String createSession(java.lang.String configFileName)
          Creates a Session configured through a config file from which Properties are derived.
 java.lang.String createSession(java.lang.String configFileName, java.lang.String sessionId)
          Creates a Session configured through a config file from which Properties are derived.
 java.lang.String getAllLogMessages()
           
 java.lang.String getAnnotation(java.lang.String sessId, java.lang.String annCollId, java.lang.String annId)
          Retrieves an annotation belonging to a given session and annotation collection specified by an annotation ID.
 java.lang.String getAnnotation7bit(java.lang.String sessId, java.lang.String annCollId, java.lang.String annId)
          Retrieves an annotation converting it to 7-bit encoded unicode before returning.
 byte[] getAnnotationBinary(java.lang.String sessId, java.lang.String annCollId, java.lang.String annId)
          Retrieves an annotation belonging to a given session and annotation collection specified by an annotation ID.
 byte[] getAnnotationBinary(java.lang.String sessId, java.lang.String annCollId, java.lang.String annId, java.lang.String encoding)
          Retrieves an annotation belonging to a given session and annotation collection specified by an annotation ID.
 java.lang.String getAnnotationIds(java.lang.String sessionId, java.lang.String collectionId)
          Returns all annotation IDs in a given session.collection as a comma-sep.
protected  java.util.Properties getConfig()
          Returns configuration for this MoCoMan as Properties object.
 XMLDBAnnotationDatabase getDatabase()
          Returns the XML:DB annotation database in which all documents and annotations are stored.
 java.lang.String getDatabaseLocation()
          Returns an URL where the XML:DB annotation database is located.
 java.lang.String getFormatedUptime()
          Returns the amount of time elapsed since the creation of this instance as a readable String.
static MoCoMan getInstance()
          Creates an instance of MoCoMan if none exists.
 java.lang.String getLast100LogMessages()
           
 java.lang.String getLast20LogMessages()
           
 java.lang.String getLast500LogMessages()
           
 java.lang.String getLast5LogMessages()
           
 java.lang.String getLastLogMessage()
           
 java.lang.String getLastLogMessage(int n)
          Returns the last n messages as read from the log4j html log file.
 java.lang.String getLogString()
          compute configured log4j HTML appender and return its file content as String
 java.lang.String getNumLogMesgs()
          Returns the number of messages currently in the html log file.
 int getSentenceCount()
          Return the number of processed (and counted) sentences.
 MoCoManServer getServer()
          Returns the instance of the XML-RPC server frontend using this instance as the backend.
static java.util.Hashtable getSessions()
          Returns all Session objects stored in a Hashtable.
 java.lang.String getStatus()
          Generates and returns a summary String of the current status of this instance.
 java.lang.String getStatusXml()
           
 long getUniqueID()
           
 long getUptime()
          Returns the amount of time elapsed since the creation of this instance in millisecond.
 java.lang.String getXmlAnnotationIds(java.lang.String sessionId, java.lang.String collectionId)
          Returns those annotation IDs in a given session.collection where the annotation is present in XML format.
 java.lang.String hasSession(java.lang.String sessionId)
           
 void increaseSentenceCount()
          Increases the sentence counter of this instance by 1.
static java.lang.String pseudoString2String(java.lang.String source, java.lang.String eightbitencoding)
          Utility method that turns an incorrectly encoded (converted) String into a correctly encoded Java Unicode String according to the specified encoding.
 int queryProcessed(java.lang.String sid, java.lang.String did, int startSpan, int endSpan, int depth)
           
static java.lang.String sayHello()
          Return a greeting (String).
 void setServer(MoCoManServer server)
          Links the given XML-RPC server to this instance.
 boolean shutdown()
          Shuts down MoCoMan.
static java.lang.String String2pseudoString(java.lang.String source, java.lang.String eightbitencoding)
          Utility method that turns a Java Unicode String into a pseudo 8 bit encoded String according to the specified encoding.
 void writeEncodedFile(java.lang.String sFilename, java.lang.String sContent, java.lang.String encoding)
           
 java.lang.String xml2htmlTransformer(java.lang.String sid, java.lang.String acid, java.lang.String aid, java.lang.String stylesheetName, java.lang.String insertText)
          Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1
 java.lang.String xml2htmlTransformer7bit(java.lang.String sid, java.lang.String acid, java.lang.String aid, java.lang.String stylesheetName, java.lang.String insertText)
          Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1
 byte[] xmlTransformerBinary(java.lang.String sid, java.lang.String acid, java.lang.String aid, java.lang.String stylesheetName, java.lang.String insertText)
          Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1
 byte[] xmlTransformerBinary(java.lang.String sid, java.lang.String acid, java.lang.String aid, java.lang.String stylesheetName, java.lang.String insertText, java.lang.String encoding)
          Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoCoMan

protected MoCoMan()
Creates an instance of MoCoMan. Reads the config file, derives a Properties object from it, sets up a logger, an XML-RPC server and the XML:DB annotation database. gregul: changed from private to protected for tomcat version of hog

Method Detail

getInstance

public static MoCoMan getInstance()
Creates an instance of MoCoMan if none exists. This controls access to the instance of MoCoMan.

Returns:
the only instance of MoCoMan

getConfig

protected java.util.Properties getConfig()
Returns configuration for this MoCoMan as Properties object.

Returns:
configuration

getSessions

public static java.util.Hashtable getSessions()
Returns all Session objects stored in a Hashtable.

Returns:
all sessions

hasSession

public java.lang.String hasSession(java.lang.String sessionId)

getDatabase

public XMLDBAnnotationDatabase getDatabase()
Returns the XML:DB annotation database in which all documents and annotations are stored.

Returns:
annotation database

getDatabaseLocation

public java.lang.String getDatabaseLocation()
Returns an URL where the XML:DB annotation database is located.

Returns:
database URL

createSession

public java.lang.String createSession(java.lang.String configFileName)
Creates a Session configured through a config file from which Properties are derived. A topologically sorted dependency graph is created and stored as an array.

Parameters:
configFileName - a configuration file name
Returns:
an ID for this Session

createSession

public java.lang.String createSession(java.lang.String configFileName,
                                      java.lang.String sessionId)
Creates a Session configured through a config file from which Properties are derived. A topologically sorted dependency graph is created and stored as an array.

Parameters:
configFileName - a configuration file name
namePrefix - a prefix to the sessionId
Returns:
an ID for this Session

closeSession

public boolean closeSession(java.lang.String sessionId)
Closes a session with MoCoMan. Invokes the close() method of the Session object to be closed. Removes this Session from the sessions Hashtable

Parameters:
sessionId - the Session to be closed

createAnnotationCollection

public java.lang.String createAnnotationCollection(java.lang.String sessionId)
Creates an annotation collection for a session specified by a given session ID. If database usage is true also a annotation collection is created in the XML:DB annotation database.

Parameters:
sessionId - a session ID to specify a session for which a collection shall be created
Returns:
an identification for the created annotation collection

createAnnotation

public java.lang.String createAnnotation(java.lang.String sessionId,
                                         java.lang.String annCollId,
                                         java.lang.String ann,
                                         java.lang.String language,
                                         java.lang.String anId)
Creates a new annotation for a given session and annotation collection each of them specified by their ID. If database usage is true the in the XML:DB annotation database is also created an annotation. The given annotation text is stored in an Annotation object along with its language and ID which is usually the processing component or rawtext.

Parameters:
sessionId - session ID referring to the session for which an annotation shall be created
annCollId - annotation collection ID referring to the session for which an annotation shall be created
ann - annotation text
language - annotation language
anId - annotation ID
Returns:
an ID for this annotation

createInitialAnnotation

public java.lang.String createInitialAnnotation(java.lang.String sessionId,
                                                java.lang.String annCollId,
                                                java.lang.String rawtext,
                                                java.lang.String language,
                                                java.lang.String component)
Creates two initial annotations in a given session/collection:
1. The raw text. ID: rawtext
2. The xmlfied text including metadata. ID: xmltext
Use this method for initially putting text into a new session.

Parameters:
sessionId - session ID referring to the session for which an annotation shall be created
annCollId - annotation collection ID referring to the session for which an annotation shall be created
rawtext - the raw input text
language - annatiotion language
component - the invoking component ID
Returns:
the string "xmltext" if the operations were successful

createInitialAnnotation

public java.lang.String createInitialAnnotation(java.lang.String sessionId,
                                                java.lang.String annCollId,
                                                byte[] rawtext,
                                                java.lang.String language,
                                                java.lang.String component)
Creates two initial annotations in a given session/collection:
1. The raw text. ID: rawtext
2. The xmlfied text including metadata. ID: xmltext
Use this method for initially putting text into a new session.

Parameters:
sessionId - session ID referring to the session for which an annotation shall be created
annCollId - annotation collection ID referring to the session for which an annotation shall be created
rawtext - the raw input text (as UTF-8 byte array for XML-RPC)
language - annatiotion language
component - the invoking component ID
Returns:
the string "xmltext" if the operations were successful

createInitialAnnotation

public java.lang.String createInitialAnnotation(java.lang.String sessionId,
                                                java.lang.String annCollId,
                                                byte[] rawtext,
                                                java.lang.String language,
                                                java.lang.String component,
                                                java.lang.String encoding)
Creates two initial annotations in a given session/collection:
1. The raw text. ID: rawtext
2. The xmlfied text including metadata. ID: xmltext
Use this method for initially putting text into a new session.

Parameters:
sessionId - session ID referring to the session for which an annotation shall be created
annCollId - annotation collection ID referring to the session for which an annotation shall be created
rawtext - the raw input text (byte array for XML-RPC)
language - annatiotion language
component - the invoking component ID
encoding - encoding of the String in byte array rawtext
Returns:
the string "xmltext" if the operations were successful

clearAnnotationCollection

public void clearAnnotationCollection(java.lang.String sessionId,
                                      java.lang.String annCollId)

createInitialAnnotation

public java.lang.String createInitialAnnotation(java.lang.String sessionId,
                                                java.lang.String annCollId,
                                                java.lang.String rawtext,
                                                java.lang.String language,
                                                java.lang.String component,
                                                java.lang.String encoding)
Creates two initial annotations in a given session/collection:
1. The raw text. ID: rawtext
2. The xmlfied text including metadata. ID: xmltext
Use this method for initially putting text into a new session.

Parameters:
sessionId - session ID referring to the session for which an annotation shall be created
annCollId - annotation collection ID referring to the session for which an annotation shall be created
rawtext - the raw input text
language - annatiotion language
component - the invoking component ID
encoding - name of the 8 bit encoding rawtext is encoded in
Returns:
the string "xmltext" if the operations were successful

pseudoString2String

public static java.lang.String pseudoString2String(java.lang.String source,
                                                   java.lang.String eightbitencoding)
                                            throws java.io.UnsupportedEncodingException
Utility method that turns an incorrectly encoded (converted) String into a correctly encoded Java Unicode String according to the specified encoding. This only works correctly for eight bit encodings! This is used as server-side input frontend for Strings from the Apache XML-RPC implementation.

Parameters:
source - source string with incorrect encoding
eightbitencoding - name of encoding the source originally had
Returns:
the correctly encoded string according to the specified encoding
Throws:
java.io.UnsupportedEncodingException

String2pseudoString

public static java.lang.String String2pseudoString(java.lang.String source,
                                                   java.lang.String eightbitencoding)
                                            throws java.io.UnsupportedEncodingException
Utility method that turns a Java Unicode String into a pseudo 8 bit encoded String according to the specified encoding. This only works for eight bit encodings! This is used as server-side output frontend for Strings going to the Apache XML-RPC implementation.

Parameters:
source - source string with normal Java Unicode encoding
eightbitencoding - name of encoding the target should have
Returns:
the incorrectly encoded string according to the specified encoding
Throws:
java.io.UnsupportedEncodingException

analyse

public java.lang.String analyse(java.lang.String sessionId,
                                java.lang.String annCollId,
                                java.lang.String annId,
                                java.lang.Integer startSpan,
                                java.lang.Integer endSpan,
                                java.lang.Integer depth)
Analyses a document given as XML string via XML-RPC. This method is necessary since the parameters are transmitted as a Vector object which cannot store simple int values. Just calls analyse(String sessionId, String annCollId, String annId, int startSpan, int endSpan, int depth) for analysis.

Parameters:
sessionId - session ID of annotation
annCollId - annotation collection ID
startSpan -
endSpan -
depth -
Returns:
result of analysis as XML string

analyseBinary

public byte[] analyseBinary(java.lang.String sessionId,
                            java.lang.String annCollId,
                            java.lang.String annId,
                            java.lang.Integer startSpan,
                            java.lang.Integer endSpan,
                            java.lang.Integer depth)
Analyses a document given as XML string via XML-RPC. This method is necessary since the parameters are transmitted as a Vector object which cannot store simple int values. Just calls analyse(String sessionId, String annCollId, String annId, int startSpan, int endSpan, int depth) for analysis.

Parameters:
sessionId - session ID of annotation
annCollId - annotation collection ID
startSpan -
endSpan -
depth -
Returns:
result of analysis as UTF-8-encoded byte array

analyseBinary

public byte[] analyseBinary(java.lang.String sessionId,
                            java.lang.String annCollId,
                            java.lang.String annId,
                            int startSpan,
                            int endSpan,
                            int depth)
Analyses a document given as XML string via XML-RPC. This method is necessary since the parameters are transmitted as a Vector object which cannot store simple int values. Just calls analyse(String sessionId, String annCollId, String annId, int startSpan, int endSpan, int depth) for analysis.

Parameters:
sessionId - session ID of annotation
annCollId - annotation collection ID
startSpan -
endSpan -
depth -
Returns:
result of analysis as UTF-8-encoded byte array

analyseBinary

public byte[] analyseBinary(java.lang.String sessionId,
                            java.lang.String annCollId,
                            java.lang.String annId,
                            java.lang.Integer startSpan,
                            java.lang.Integer endSpan,
                            java.lang.Integer depth,
                            java.lang.String encoding)
Analyses a document given as XML string via XML-RPC. This method is necessary since the parameters are transmitted as a Vector object which cannot store simple int values. Just calls analyse(String sessionId, String annCollId, String annId, int startSpan, int endSpan, int depth) for analysis.

Parameters:
sessionId - session ID of annotation
annCollId - annotation collection ID
startSpan -
endSpan -
depth -
encoding - encoding of the returned byte array string
Returns:
result of analysis as byte array with given encoding

analyse

public java.lang.String analyse(java.lang.String sessionId,
                                java.lang.String annCollId,
                                java.lang.String annId,
                                int startSpan,
                                int endSpan,
                                int depth)
Analyses a document given as XML string. This document is specified via its session and annotation ID. The parameters for a span are ignored at the moment.

Parameters:
sessionId - session ID of annotation
annCollId - annotation collection ID
startSpan -
endSpan -
depth -
Returns:
result (deepest successful analysis) as XML string

analyseDOMTree

public org.w3c.dom.Node analyseDOMTree(java.lang.String sid,
                                       java.lang.String aid,
                                       int startSpan,
                                       int endSpan,
                                       int depth)
Analyses a document given as DOM tree. This document is specified via its session and annotation ID. The parameters for a span are ignored at the moment.

Parameters:
sid - session ID of annotation
aid - annotation ID
startSpan -
endSpan -
depth -
Returns:
result of analysis as DOM tree

getAnnotation

public java.lang.String getAnnotation(java.lang.String sessId,
                                      java.lang.String annCollId,
                                      java.lang.String annId)
Retrieves an annotation belonging to a given session and annotation collection specified by an annotation ID. This ID is usually the module name which created this annotation or rawtext.

Parameters:
sessId - session ID referring to the session for which an annotation was created
annCollId - annotation collection ID referring to the annotation collection for which an annotation was created
annId - the ID of the annotation
Returns:
annotation

getAnnotationBinary

public byte[] getAnnotationBinary(java.lang.String sessId,
                                  java.lang.String annCollId,
                                  java.lang.String annId)
Retrieves an annotation belonging to a given session and annotation collection specified by an annotation ID. This ID is usually the module name which created this annotation or rawtext.

Parameters:
sessId - session ID referring to the session for which an annotation was created
annCollId - annotation collection ID referring to the annotation collection for which an annotation was created
annId - the ID of the annotation
Returns:
annotation as UTF-8-encoded byte array

getAnnotationBinary

public byte[] getAnnotationBinary(java.lang.String sessId,
                                  java.lang.String annCollId,
                                  java.lang.String annId,
                                  java.lang.String encoding)
Retrieves an annotation belonging to a given session and annotation collection specified by an annotation ID. This ID is usually the module name which created this annotation or rawtext.

Parameters:
sessId - session ID referring to the session for which an annotation was created
annCollId - annotation collection ID referring to the annotation collection for which an annotation was created
annId - the ID of the annotation
encoding - encoding for byte array to return
Returns:
annotation as byte array encoded with encoding

getAnnotation7bit

public java.lang.String getAnnotation7bit(java.lang.String sessId,
                                          java.lang.String annCollId,
                                          java.lang.String annId)
Retrieves an annotation converting it to 7-bit encoded unicode before returning. Useful for XMLRPC-usage.


queryProcessed

public int queryProcessed(java.lang.String sid,
                          java.lang.String did,
                          int startSpan,
                          int endSpan,
                          int depth)

getServer

public MoCoManServer getServer()
Returns the instance of the XML-RPC server frontend using this instance as the backend.

Returns:
An XML-RPC server using this instance.

setServer

public void setServer(MoCoManServer server)
Links the given XML-RPC server to this instance.

Parameters:
server - An XML-RPC server using this instance.

shutdown

public boolean shutdown()
Shuts down MoCoMan. This includes closing the XML:DB annotation database, shutting down the XML-RPC server, clearing the query queue and all hashtable for session and handlers. A boolean value is returned in order to make this method available to XML-RPC clients - void would return null which is not supported by XML-RPC.

Returns:
true if the shutdown process was successful.

sayHello

public static java.lang.String sayHello()
Return a greeting (String). Use this method to conveniently test a XML-RPC connection.

Returns:
A greeting (String).

getUptime

public long getUptime()
Returns the amount of time elapsed since the creation of this instance in millisecond.

Returns:
The number of milliseconds this intance has been existing.

increaseSentenceCount

public void increaseSentenceCount()
Increases the sentence counter of this instance by 1.


getSentenceCount

public int getSentenceCount()
Return the number of processed (and counted) sentences.

Returns:
int The number of processed (and counted) sentences.

getFormatedUptime

public java.lang.String getFormatedUptime()
Returns the amount of time elapsed since the creation of this instance as a readable String.

Returns:
The uptime as a String.

getStatus

public java.lang.String getStatus()
Generates and returns a summary String of the current status of this instance. Example:
 Uptime: 4 minutes 44 seconds 816 milliseconds
 logger.host: localhost
 logger.path: log
 xmldb.usage: false
 xmldb.location: xmldb:xindice://clavinova:8080/db
 logger.port: 4445
 logger.level: DEBUG
 logger.file: hoglog.html
 logger.format: html
 xmlrpc.server.port: 8411
 |--session3
 |--session2
 |  |--collection2
 |  |  |--rawtext
 |  |  |--xmltext
 |  |--collection1
 |--session1
 |  |--collection2
 |  |--collection1
 |  |  |--rawtext
 |  |  |--xmltext
 

Returns:
A String displaying a summary of the current status of this instance.

getStatusXml

public java.lang.String getStatusXml()

getAnnotationIds

public java.lang.String getAnnotationIds(java.lang.String sessionId,
                                         java.lang.String collectionId)
Returns all annotation IDs in a given session.collection as a comma-sep. list sorted by module depth, represented by a String. Main purpose: XMLRPC.


getXmlAnnotationIds

public java.lang.String getXmlAnnotationIds(java.lang.String sessionId,
                                            java.lang.String collectionId)
Returns those annotation IDs in a given session.collection where the annotation is present in XML format. The returned list is sorted by module depth, represented by a String. Main purpose: XMLRPC.


xml2htmlTransformer7bit

public java.lang.String xml2htmlTransformer7bit(java.lang.String sid,
                                                java.lang.String acid,
                                                java.lang.String aid,
                                                java.lang.String stylesheetName,
                                                java.lang.String insertText)
Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1

Parameters:
sid - session ID
acid - annotation collection ID
aid - annotation ID
styleSheetName - name of the stylesheet to apply on the server
insertText - =="yes" means do insert the <text> element

xmlTransformerBinary

public byte[] xmlTransformerBinary(java.lang.String sid,
                                   java.lang.String acid,
                                   java.lang.String aid,
                                   java.lang.String stylesheetName,
                                   java.lang.String insertText)
Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1

Parameters:
sid - session ID
acid - annotation collection ID
aid - annotation ID
styleSheetName - name of the stylesheet to apply on the server
insertText - =="yes" means do insert the <text> element

xmlTransformerBinary

public byte[] xmlTransformerBinary(java.lang.String sid,
                                   java.lang.String acid,
                                   java.lang.String aid,
                                   java.lang.String stylesheetName,
                                   java.lang.String insertText,
                                   java.lang.String encoding)
Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1

Parameters:
sid - session ID
acid - annotation collection ID
aid - annotation ID
styleSheetName - name of the stylesheet to apply on the server
insertText - =="yes" means do insert the <text> element
encoding - encoding of the returned byte array string

xml2htmlTransformer

public java.lang.String xml2htmlTransformer(java.lang.String sid,
                                            java.lang.String acid,
                                            java.lang.String aid,
                                            java.lang.String stylesheetName,
                                            java.lang.String insertText)
Transform an annotation to HTML with special handling for RMRS, where a <text> element is inserted iff insertText==1

Parameters:
sid - session ID
acid - annotation collection ID
aid - annotation ID
styleSheetName - name of the stylesheet to apply on the server
insertText - =="yes" means do insert the <text> element

getLogString

public java.lang.String getLogString()
compute configured log4j HTML appender and return its file content as String

Returns:
HTML log file content as String

getNumLogMesgs

public java.lang.String getNumLogMesgs()
Returns the number of messages currently in the html log file.


getLastLogMessage

public java.lang.String getLastLogMessage(int n)
Returns the last n messages as read from the log4j html log file. The returned messages are embedded in an html-table.


getAllLogMessages

public java.lang.String getAllLogMessages()

getLastLogMessage

public java.lang.String getLastLogMessage()

getLast5LogMessages

public java.lang.String getLast5LogMessages()

getLast20LogMessages

public java.lang.String getLast20LogMessages()

getLast100LogMessages

public java.lang.String getLast100LogMessages()

getLast500LogMessages

public java.lang.String getLast500LogMessages()

getUniqueID

public long getUniqueID()

writeEncodedFile

public void writeEncodedFile(java.lang.String sFilename,
                             java.lang.String sContent,
                             java.lang.String encoding)