com.facetmap.servlet
Class FacetMapServlet

java.lang.Object
  extended byHttpServlet
      extended bycom.facetmap.servlet.FacetMapServlet
Direct Known Subclasses:
SimpleFacetmapServlet

public abstract class FacetMapServlet
extends HttpServlet

You will probably have to extend this class to customize FacetMap to your own site. By default, FacetMapServlet creates a Map object that uses a SimpleResourceSpace for its resources. To populate the Map data, it creates a parser that expects to parse SimpleResource objects. If you are going to use a different type of Resource, you will have to change this behavior by overriding both the createNewMap() and populateMap() routines.

If you want to change the parser, but not the Resource type -- for example, you're parsing a binary data file -- then you just need to override the populateMap() method. This also applies if your input mechanism is not a parser at all but something else entirely.

By default, the Map is an instance of FilesystemMap. Override createNewMap() if you have a different FacetMap engine you'd like to use.

See Also:
Serialized Form

Field Summary
protected  java.lang.Exception configException
           
protected  java.util.Properties configProps
          Contains properties set in the properties file.
protected  boolean configured
           
protected  ServletContext context
           
protected  java.io.File docsDir
           
protected  java.net.URL docsUrl
           
static java.lang.String FACETMAP_ATTR
           
protected  SimpleResourceSpace simpleResourceSpace
           
protected  TransformerPersister viewPersister
           
protected  java.io.File workDir
           
 
Constructor Summary
FacetMapServlet()
           
 
Method Summary
static Map build(java.io.BufferedReader r, Parser parser, boolean update)
          Deprecated. see above
 Map build(Parser parser, boolean mapIsXml)
          Deprecated. only used in FilesystemMapServlet, I believe, which is slated for destruction also.
 void configure()
           
 com.facetmap.simple.logging.LogService createLogService(ServletContext context)
           
abstract  Map createNewMap(ServletContext context)
          Creates (by default) a parser that will parse a map containing SimpleResource-style resources.
 void doInit(ServletContext c)
           
 boolean getBooleanParameter(java.lang.String paramName)
           
 java.lang.Exception getConfigurationException()
           
 int getIntParameter(java.lang.String paramName)
           
 java.lang.String getParameter(java.lang.String paramName)
           
 java.util.Enumeration getParameterNames()
           
 java.net.URL getUrlForDocs(java.lang.String path)
           
 TransformerPersister getViewPersister()
           
 void init()
          Wraps the initialization process so that the servlet container can call it on startup.
 boolean isConfigured()
           
static void preprocess(Map map)
          Does any calculation that needs to be done before the map can be browsed.
 void readProps()
          Populate configProps from file.
 void setParameter(java.lang.String paramName, java.lang.String value)
           
 void writeProps(java.lang.String info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACETMAP_ATTR

public static final java.lang.String FACETMAP_ATTR
See Also:
Constant Field Values

context

protected ServletContext context

configProps

protected java.util.Properties configProps
Contains properties set in the properties file.


simpleResourceSpace

protected SimpleResourceSpace simpleResourceSpace

workDir

protected java.io.File workDir

docsDir

protected java.io.File docsDir

docsUrl

protected java.net.URL docsUrl

viewPersister

protected TransformerPersister viewPersister

configured

protected boolean configured

configException

protected java.lang.Exception configException
Constructor Detail

FacetMapServlet

public FacetMapServlet()
Method Detail

isConfigured

public boolean isConfigured()

getConfigurationException

public java.lang.Exception getConfigurationException()

createNewMap

public abstract Map createNewMap(ServletContext context)
                          throws InternalException,
                                 DataException,
                                 java.io.IOException
Creates (by default) a parser that will parse a map containing SimpleResource-style resources. The parser reads XML or plaintext, depending on the value of the mapIsPlaintext parameter.

Throws:
InternalException
DataException
java.io.IOException

createLogService

public com.facetmap.simple.logging.LogService createLogService(ServletContext context)
                                                        throws java.io.IOException
Throws:
java.io.IOException

getViewPersister

public TransformerPersister getViewPersister()

init

public void init()
          throws ServletException
Wraps the initialization process so that the servlet container can call it on startup.

Throws:
ServletException

doInit

public void doInit(ServletContext c)
            throws java.io.IOException,
                   DataException,
                   InternalException
Throws:
java.io.IOException
DataException
InternalException

configure

public void configure()
               throws java.io.IOException,
                      DataException,
                      InternalException
Throws:
java.io.IOException
DataException
InternalException

getParameterNames

public java.util.Enumeration getParameterNames()

getParameter

public java.lang.String getParameter(java.lang.String paramName)

setParameter

public void setParameter(java.lang.String paramName,
                         java.lang.String value)

getBooleanParameter

public boolean getBooleanParameter(java.lang.String paramName)

getIntParameter

public int getIntParameter(java.lang.String paramName)
                    throws DataException
Throws:
DataException

readProps

public void readProps()
               throws java.io.IOException
Populate configProps from file.

Throws:
java.io.IOException

writeProps

public void writeProps(java.lang.String info)
                throws java.io.IOException
Throws:
java.io.IOException

build

public Map build(Parser parser,
                 boolean mapIsXml)
          throws InternalException,
                 DataException,
                 java.io.IOException
Deprecated. only used in FilesystemMapServlet, I believe, which is slated for destruction also.

Throws:
InternalException
DataException
java.io.IOException

build

public static Map build(java.io.BufferedReader r,
                        Parser parser,
                        boolean update)
                 throws InternalException,
                        DataException,
                        java.io.IOException
Deprecated. see above

Throws:
InternalException
DataException
java.io.IOException

preprocess

public static void preprocess(Map map)
                       throws InternalException,
                              DataException,
                              java.io.IOException
Does any calculation that needs to be done before the map can be browsed. This is the place to load interim data into database, or any other task that makes it easier to serve a Selection at runtime.

Throws:
InternalException
DataException
java.io.IOException

getUrlForDocs

public java.net.URL getUrlForDocs(java.lang.String path)
                           throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException