org.xoe.servlet
Class XoeServlet

org.xoe.servlet.XoeServlet
All Implemented Interfaces:
Constants, IApplication, IService, IViewable
Direct Known Subclasses:
Main

public abstract class XoeServlet
implements IApplication


Field Summary
protected static SimpleServiceQuery clipboardServiceQuery
           
protected  org.xoe.core.dom.Callback defaultCallback
          Default callback
protected static SimpleServiceQuery historyServiceQuery
           
protected  boolean propagateHistory
          Propagate "history back" events to the enclosing document.
protected static String USER_CONFIG_FILENAME
           
protected  org.xoe.core.dom.XDocument userConfig
          xml document containing user settings
 
Fields inherited from interface org.xoe.services.IApplication
FEATURE_CONFIG, FUNCTIONALITY, INTERFACE
 
Fields inherited from interface org.xoe.core.Constants
ACTION_ATTR, ADD, ADD_APP, AMPERSAND_KEY, AMPERSAND_SYMBOL, AMPERSAND_SYMBOL_STRING, APOSTROPHE_KEY, APOSTROPHE_SYMBOL, ASCENDING_SORT, BACK, BANNER_ATTR, BEEP, BEEP_PROPERTY, CONTEXT_ATTR, COPYRIGHT_KEY, COPYRIGHT_SYMBOL, COUNTRY_PROPERTY, DATA_DOC, DEFAULT_BOOTSTRAP, DEFAULT_NAMESPACE, DEFAULT_THEME, DEFAULT_THEMES_DIR, DEFAULT_VIEW, DELETE, DESCENDING_SORT, DISPLAY, DISPLAY_VIEW, DOCTYPE_NAME_NS_XHTML, DOUBLE_QUOTE_KEY, DOUBLE_QUOTE_SYMBOL, EDIT, EDIT_ITEM_VIEW, EXTENSION_ALL, EXTENSION_DTD, EXTENSION_HTML, EXTENSION_LNK, EXTENSION_WML, EXTENSION_XHTML, EXTENSION_XML, EXTENSION_XOE, EXTENSION_XOE_CONFIG, EXTENSION_ZIP, FEATURE_DOCTYPE_NAME_NS, FEATURE_EXTENSION, FEATURE_MIMETYPE, FILE_PROTOCOL, FORWARD, FUNCTION_CONTENT_HANDLER, GREATER_THAN_KEY, GREATER_THAN_SYMBOL, HIDE_IF_ATTR, HOMEDIR_PROPERTY, HREF_ATTR, INSERT_BEFORE_ATTR, LANGUAGE_PROPERTY, LAUNCH, LESSER_THAN_KEY, LESSER_THAN_SYMBOL, LOADTHEME, LOGGING_PROPERTY, MID_DOT_KEY, MID_DOT_SYMBOL, MIMETYPE_ALL, MIMETYPE_APPLICATION_XOE, MIMETYPE_APPLICATION_ZIP, MIMETYPE_STASHDIR, MIMETYPE_TEXT_HTML, MIMETYPE_TEXT_PLAIN, MIMETYPE_TEXT_VND_TVT_LNK, MIMETYPE_TEXT_WML, MIMETYPE_TEXT_XML, MIMETYPE_TEXT_XML_DTD, MIMETYPE_UNKNOWN, NAME_ATTR, NAMESPACE_SEPARATOR, NEW, NEW_ITEM_VIEW, NO_PATH, NON_BREAKING_SPACE_KEY, NON_BREAKING_SPACE_SYMBOL, NUM_LAST_APPS, ONCHANGE_ATTR, ONCLICK_ATTR, ONKEYPRESS_ATTR, ONLOAD_ATTR, ONMOUSEDOWN_ATTR, ONMOUSEOUT_ATTR, ONMOUSEOVER_ATTR, ONMOUSEUP_ATTR, PACKAGE_ARCHIVE_ROOT, PARENT_FRAME, PKG_ARCHIVE_ATTR, PKG_URI_ATTR, PKG_WORKSPACE_ATTR, PREVIOUS_DIR, PROPERTY_PREFIX, QUERY_DELIMITER, REFRESH, RESET, SAVE, SCREEN_COLORS_PROPERTY, SCREEN_HEIGHT_PROPERTY, SCREEN_TYPE_PROPERTY, SCREEN_WIDTH_PROPERTY, SCRIPT_PROPERTY, SCRIPT_SUPPORT, SELECT, SORT_BANNER_ATTR, SORT_ORDER_ATTR, SRC_ATTR, STASH_DIR_PROPERTY, STASH_FILE_SEPARATOR, STASH_PROTOCOL, STOP, STYLE_ATTR, TEMP_DIR, THEME_PROPERTY, THEMES_DIR_PROPERTY, TOP, TRIGGER_ATTR, UNICODE_DECIMAL_SYMBOL, UNICODE_HEX_SYMBOL, UNKNOWN_ICON, UNSET_NODE_TYPE, URL_CONTEXT_ATTR, USER_NAME, USERDIR_PROPERTY, VALUE_ATTR, WML_NAMESPACE, XHTML_NAMESPACE, XML, XML_PREFIX_NAMESPACE, XMLNS, XMLNS_NAMESPACE, XOE_CONFIG_DOCTYPE_NAME_NS, XOE_LOCALIZE, XPATH_ATTR
 
Constructor Summary
XoeServlet()
           
XoeServlet(javax.servlet.GenericServlet servlet)
          Wrap a Xoe Servlet round a standard Java servlet.
XoeServlet(XoeServlet from)
           
 
Method Summary
protected  void createCallbacks()
           
protected  void createCallbacks(org.xoe.core.dom.XDocument doc)
          Set the callbacks on the document so we get any interesting events.
 boolean doesPropagateHistory()
           
protected  void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          the default behaviour of XoeServlet is to render the file default.xhtml
protected  String getArchiveURI()
           
 String getBackURLString()
           
protected  String getDataDir()
           
protected  org.w3c.dom.Document getDisplayedDocument()
          Get the document currently on the screen.
protected  org.xoe.display.dom.DocumentViewer getDocumentViewer()
          Get the document viewer
 String[] getFeatures(String func)
          This function may return null.
protected  org.xoe.core.dom.XDocument getFileFromPackageWorkspace(String filename)
           
 String[] getFunctionalities()
          Functionalities are Strings that can be used to differentiate between different kinds of IServices.
 String[] getInformation()
          Returns extra meta-information about the service as an array of Strings.
 String[] getInterfaces(String func)
          Returns the String names of all the Java interfaces that the IService implements for the given functionality.
 String getPackageName()
           
 String getPackageURI()
           
 org.xoe.core.dom.XDocument getRelativeDocument(String name)
           
 String getRelativeSrc(String name)
           
protected  String[] getServletFeatures(String func)
           
protected  String[] getServletFunctionalities()
           
protected  String[] getServletInterfaces(String func)
           
protected  org.w3c.dom.Document getTitleDocument()
          Get the title document
static String getURLParameter(String url, String pname)
           
protected  org.xoe.core.dom.XDocument getUserConfig()
           
 org.xoe.core.dom.XDocument getViewableDocument()
          Get the initial view on this component.
protected  String getWorkspaceURI()
           
protected  boolean handleClipboard(String cmd)
           
protected  boolean handleHistory(String cmd)
           
 void init(org.w3c.dom.Document configDoc)
          Services can be configued with a DOM Document.
 void init(javax.servlet.ServletConfig config)
           
 void populateFields(Hashtable params)
           
static void populateFields(org.xoe.core.dom.XDocument doc, Hashtable params)
          Populate the fields of the returned document with the name/value pairs of the parameters passed with the request.
 void redirect(XoeServlet from)
           
protected  void setDisplayedDocument(org.w3c.dom.Document doc)
          Put the document onto the screen.
 void setPropagateHistory(boolean propagateHistory)
           
protected  void setTitleDocument(org.w3c.dom.Document doc)
          Set the title document
 void trackHistory()
           
 

Field Detail

clipboardServiceQuery

protected static final SimpleServiceQuery clipboardServiceQuery

historyServiceQuery

protected static final SimpleServiceQuery historyServiceQuery

USER_CONFIG_FILENAME

protected static final String USER_CONFIG_FILENAME

userConfig

protected org.xoe.core.dom.XDocument userConfig
xml document containing user settings

propagateHistory

protected boolean propagateHistory
Propagate "history back" events to the enclosing document. Should be set by the calling servlet.

defaultCallback

protected org.xoe.core.dom.Callback defaultCallback
Default callback
Constructor Detail

XoeServlet

public XoeServlet()

XoeServlet

public XoeServlet(javax.servlet.GenericServlet servlet)
Wrap a Xoe Servlet round a standard Java servlet. I am a servlet myself so wrap myself in myself. This allows Xoe apps to extends XoeServlet.

XoeServlet

public XoeServlet(XoeServlet from)
Method Detail

init

public void init(org.w3c.dom.Document configDoc)
          throws Exception
Description copied from interface: IService
Services can be configued with a DOM Document. configDoc may be null.
Specified by:
init in interface IService

getFunctionalities

public final String[] getFunctionalities()
Description copied from interface: IService
Functionalities are Strings that can be used to differentiate between different kinds of IServices. This function must return all the Functionalities implemented by the IService. This function may return null.
Specified by:
getFunctionalities in interface IService

getInterfaces

public final String[] getInterfaces(String func)
Description copied from interface: IService
Returns the String names of all the Java interfaces that the IService implements for the given functionality. This function may return null.
Specified by:
getInterfaces in interface IService

getFeatures

public final String[] getFeatures(String func)
Description copied from interface: IService
This function may return null.
Specified by:
getFeatures in interface IService

getInformation

public String[] getInformation()
Description copied from interface: IService
Returns extra meta-information about the service as an array of Strings. This function may return null.
Specified by:
getInformation in interface IService

getViewableDocument

public org.xoe.core.dom.XDocument getViewableDocument()
Get the initial view on this component.
Specified by:
getViewableDocument in interface IViewable

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res)
              throws javax.servlet.ServletException,
                     IOException
the default behaviour of XoeServlet is to render the file default.xhtml

redirect

public void redirect(XoeServlet from)

getDataDir

protected String getDataDir()

getFileFromPackageWorkspace

protected org.xoe.core.dom.XDocument getFileFromPackageWorkspace(String filename)
                                                          throws IOException

getUserConfig

protected org.xoe.core.dom.XDocument getUserConfig()
                                            throws javax.servlet.ServletException,
                                                   IOException

getWorkspaceURI

protected String getWorkspaceURI()

getArchiveURI

protected String getArchiveURI()

getPackageName

public String getPackageName()

getPackageURI

public String getPackageURI()

setDisplayedDocument

protected void setDisplayedDocument(org.w3c.dom.Document doc)
Put the document onto the screen.

createCallbacks

protected void createCallbacks(org.xoe.core.dom.XDocument doc)
Set the callbacks on the document so we get any interesting events.

createCallbacks

protected void createCallbacks()

populateFields

public static void populateFields(org.xoe.core.dom.XDocument doc,
                                  Hashtable params)
Populate the fields of the returned document with the name/value pairs of the parameters passed with the request.

populateFields

public void populateFields(Hashtable params)

getDocumentViewer

protected org.xoe.display.dom.DocumentViewer getDocumentViewer()
Get the document viewer

getDisplayedDocument

protected org.w3c.dom.Document getDisplayedDocument()
Get the document currently on the screen.

setTitleDocument

protected void setTitleDocument(org.w3c.dom.Document doc)
Set the title document

getTitleDocument

protected org.w3c.dom.Document getTitleDocument()
Get the title document

getRelativeSrc

public String getRelativeSrc(String name)

getRelativeDocument

public org.xoe.core.dom.XDocument getRelativeDocument(String name)

handleClipboard

protected boolean handleClipboard(String cmd)

handleHistory

protected boolean handleHistory(String cmd)

getBackURLString

public String getBackURLString()

trackHistory

public void trackHistory()

setPropagateHistory

public void setPropagateHistory(boolean propagateHistory)

doesPropagateHistory

public boolean doesPropagateHistory()

getServletFunctionalities

protected String[] getServletFunctionalities()

getServletInterfaces

protected String[] getServletInterfaces(String func)

getServletFeatures

protected String[] getServletFeatures(String func)

getURLParameter

public static String getURLParameter(String url,
                                     String pname)