|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ibisph.mvc.controller.PublishXML
public class PublishXML
Base Publish XML Controller which can be directly used or extended. This controller has the base XML path as a property and the core class that gets the streamed XML from the admin system and puts into an XML Document. Controllers extending this controller need to focus on saving the document to the appropriate path and filename and returning.
| Field Summary | |
|---|---|
protected java.lang.String |
destinationXMLPath
|
protected Document |
documentDAO
|
protected FileBackupFactory |
fileBackupFactory
|
protected java.lang.String |
successReturnValue
|
| Constructor Summary | |
|---|---|
PublishXML()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
getBaseFilename(javax.servlet.http.HttpServletRequest request)
Helper method used to get the base filename (partial path and filename). |
java.lang.String |
getDestinationXMLPath()
Sets the base path of where to save the XML content to. |
Document |
getDocumentDAO()
DAO object that is used to save the XML content with. |
protected org.dom4j.Document |
getXMLDocument(javax.servlet.http.HttpServletRequest request)
Helper method used to get the XML content sent from the requester. |
org.springframework.web.servlet.ModelAndView |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Controller method called by the Spring MVC framework to handle the publishing. |
protected java.lang.String |
postSaveXMLProcessing(java.lang.String baseFilename,
org.dom4j.Document document)
Handle any special post publish processing like deleting associated artifacts. |
protected void |
sendError(javax.servlet.http.HttpServletResponse response,
java.lang.Exception e,
java.lang.String actionsReturnMessage)
Helper to localize error sent to requester. |
protected void |
sendSuccess(javax.servlet.http.HttpServletResponse response,
java.lang.String actionsReturnMessage)
Helper to localize success message sent to requester. |
void |
setDestinationXMLPath(java.lang.String xmlPath)
Sets the base path of where to save the XML content to. |
void |
setDocumentDAO(Document documentDAO)
Sets the DAO object that will be used to save the XML content with. |
void |
setFileBackupFactory(FileBackupFactory fileBackupFactory)
Optional file backup factory that provides a file backup used to backup the current XML file. |
void |
setSuccessReturnValue(java.lang.String successReturnValue)
Sets the string value that is returned to the requester. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String destinationXMLPath
protected Document documentDAO
protected FileBackupFactory fileBackupFactory
protected java.lang.String successReturnValue
| Constructor Detail |
|---|
public PublishXML()
| Method Detail |
|---|
public void setDestinationXMLPath(java.lang.String xmlPath)
xmlPath - Complete file path with or without trailing slash.public void setDocumentDAO(Document documentDAO)
documentDAO - Standard Document DAO used to save the XML document
to disk.public void setFileBackupFactory(FileBackupFactory fileBackupFactory)
fileBackupFactory - Provides a pluggable file backup used to backup
the current XML file before the new content is published.public void setSuccessReturnValue(java.lang.String successReturnValue)
successReturnValue - Value that is returned to the requester if the
XML is valid and if the XML document was successfully saved to
the specified filename/path.public java.lang.String getDestinationXMLPath()
public Document getDocumentDAO()
public org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
getXMLDocument method, builds the appropriate XML
filename to save to, calls the optional file backup, and if successfully
able to parse and save returns the success string. Otherwise the backup
file is restored and a null is returned to the user.
handleRequest in interface org.springframework.web.servlet.mvc.Controllerrequest - HTTP Servlet Request passed from the servlet.response - HTTP Servlet Response passed from the servlet.
java.lang.Exception
protected java.lang.String getBaseFilename(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
request - Access to the standard HTTP request used to retrieve the path info.
java.lang.Exception
protected org.dom4j.Document getXMLDocument(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
request - Access to the standard HTTP request used to retrieve the path info.
null if not successful.
java.lang.Exception
protected java.lang.String postSaveXMLProcessing(java.lang.String baseFilename,
org.dom4j.Document document)
throws java.lang.Exception
baseFilename - Filename of the file just published without any path
info.document - XML document just published.
java.lang.Exception - General exception for any sub classed implementors.
protected void sendError(javax.servlet.http.HttpServletResponse response,
java.lang.Exception e,
java.lang.String actionsReturnMessage)
throws java.lang.Exception
response - Response object used for the request.e - Optional exception associated with the error.actionsReturnMessage - Optional error message to send back to
requester.
java.lang.Exception
protected void sendSuccess(javax.servlet.http.HttpServletResponse response,
java.lang.String actionsReturnMessage)
throws java.lang.Exception
response - Response object used for the request.actionsReturnMessage - Optional message to send back to requester.
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||