uk.co.lakesidetech.springxmldb.spring.web.controller
Class FileXQueryXMLDBController

java.lang.Object
  extended byorg.springframework.context.support.ApplicationObjectSupport
      extended byorg.springframework.web.context.support.WebApplicationObjectSupport
          extended byorg.springframework.web.servlet.support.WebContentGenerator
              extended byorg.springframework.web.servlet.mvc.AbstractController
                  extended byuk.co.lakesidetech.springxmldb.spring.web.controller.AbstractXMLDBController
                      extended byuk.co.lakesidetech.springxmldb.spring.web.controller.SimpleXQueryXMLDBController
                          extended byuk.co.lakesidetech.springxmldb.spring.web.controller.FileXQueryXMLDBController
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.servlet.mvc.Controller
Direct Known Subclasses:
XQueryRequestParametersXMLDBController

public class FileXQueryXMLDBController
extends SimpleXQueryXMLDBController

The FileXQueryXMLDBController runs an XQuery stored in a File resource against an XML database collection. This is useful for large XQueries. The file is loaded using Springs resource abstraction framework. On reading the file the controller caches the result and the modification time of the query, if file is subsequently modified the query is reloaded.

Author:
Stuart Eccles

Field Summary
protected  org.springframework.core.io.Resource xqueryFile
           
 
Fields inherited from class uk.co.lakesidetech.springxmldb.spring.web.controller.SimpleXQueryXMLDBController
xquery
 
Fields inherited from class uk.co.lakesidetech.springxmldb.spring.web.controller.AbstractXMLDBController
XMLQUERY_RESULTS_REQUEST_ATTRIBUTE
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
FileXQueryXMLDBController()
           
 
Method Summary
protected  java.lang.String getQuery()
           
 java.lang.String loadXQueryFromFile()
           
 void setXqueryFile(org.springframework.core.io.Resource xqueryFile)
           
 
Methods inherited from class uk.co.lakesidetech.springxmldb.spring.web.controller.SimpleXQueryXMLDBController
handleRequestInternal, setXquery
 
Methods inherited from class uk.co.lakesidetech.springxmldb.spring.web.controller.AbstractXMLDBController
formCollectionPathString, getCollection, getCollectionPrefix, getResultLimit, getView, getXmldbFacade, isAcceptCollectionFromRequest, replaceRequestParameterVariables, setAcceptCollectionFromRequest, setCollection, setCollectionPrefix, setResultLimit, setView, setXmldbFacade
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.web.servlet.mvc.Controller
handleRequest
 

Field Detail

xqueryFile

protected org.springframework.core.io.Resource xqueryFile
Constructor Detail

FileXQueryXMLDBController

public FileXQueryXMLDBController()
Method Detail

setXqueryFile

public void setXqueryFile(org.springframework.core.io.Resource xqueryFile)
Parameters:
xqueryFile - The xqueryFile to set.

getQuery

protected java.lang.String getQuery()
                             throws java.io.IOException
Overrides:
getQuery in class SimpleXQueryXMLDBController
Throws:
java.io.IOException

loadXQueryFromFile

public java.lang.String loadXQueryFromFile()
                                    throws java.io.IOException
Throws:
java.io.IOException