org.exist.http
Class Descriptor

java.lang.Object
  extended byorg.exist.http.Descriptor
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class Descriptor
extends java.lang.Object
implements org.xml.sax.ErrorHandler

Webapplication Descriptor Class representation of an XQuery Web Application Descriptor file with some helper functions for performing Descriptor related actions

Version:
1.6
Author:
Adam Retter

Constructor Summary
Descriptor(java.lang.String file)
          Descriptor Constructor
Descriptor(java.lang.String file, java.lang.String dbHome)
          Descriptor Constructor
 
Method Summary
 boolean allowSourceXQuery(java.lang.String path)
          Determines whether it is permissible to show the source of an XQuery.
protected  void doLogRequestInReplayLog(HttpServletRequest request)
          Log's Http Requests in a log file suitable for replaying to eXist later Takes a HttpServletRequest as an argument for logging.
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
 java.lang.String mapPath(java.lang.String path)
          Map's one XQuery or Collection path to another Takes a path such as that from RESTServer.doGet() as an argument, if it finds a matching map path then it returns the map view else it returns the passed in path
 void warning(org.xml.sax.SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Descriptor

public Descriptor(java.lang.String file)
Descriptor Constructor

Parameters:
file - The descriptor file to read, defaults to descriptor.xml in the home folder

Descriptor

public Descriptor(java.lang.String file,
                  java.lang.String dbHome)
Descriptor Constructor

Parameters:
file - The descriptor file to read, defaults to descriptor.xml in the dbHome folder
dbHome - The home folder to find the descriptor file in, defaults to $EXIST_HOME
Method Detail

allowSourceXQuery

public boolean allowSourceXQuery(java.lang.String path)
Determines whether it is permissible to show the source of an XQuery. Takes a path such as that from RESTServer.doGet() as an argument, if it finds a matching allowsourcexquery path in the descriptor then it returns true else it returns false

Parameters:
path - The path of the XQuery (e.g. /db/MyCollection/query.xql)
Returns:
The boolean value true or false indicating whether it is permissible to show the source

mapPath

public java.lang.String mapPath(java.lang.String path)
Map's one XQuery or Collection path to another Takes a path such as that from RESTServer.doGet() as an argument, if it finds a matching map path then it returns the map view else it returns the passed in path

Parameters:
path - The path of the XQuery or Collection (e.g. /db/MyCollection/query.xql or /db/MyCollection) to map from
Returns:
The path of the XQuery or Collection (e.g. /db/MyCollection/query.xql or /db/MyCollection) to map to

doLogRequestInReplayLog

protected void doLogRequestInReplayLog(HttpServletRequest request)
Log's Http Requests in a log file suitable for replaying to eXist later Takes a HttpServletRequest as an argument for logging.

Parameters:
request - The HttpServletRequest to log. For POST requests form data will only be logged if a HttpServletRequestWrapper is used instead of HttpServletRequest!

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

warning

public void warning(org.xml.sax.SAXParseException exception)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)


<oXygen/> XML Editor provides support for editing and debugging XQuery expressions against the eXist XML Database.