org.mycore.frontend.wcms
Class MCRWCMSActionServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mycore.frontend.servlets.MCRServlet
              extended by org.mycore.frontend.wcms.MCRWCMSServlet
                  extended by org.mycore.frontend.wcms.MCRWCMSActionServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class MCRWCMSActionServlet
extends MCRWCMSServlet

Version:
Author:
m5brmi-sh, Thomas Scheffler (yagee)
See Also:
Serialized Form

Nested Class Summary
static class MCRWCMSActionServlet.ResolveDTD
           
 
Field Summary
(package private)  Element actElem
           
(package private)  String[] documentList
           
(package private)  char fs
           
(package private)  File hrefFile
           
(package private)  String[] imageList
           
(package private) static Logger logger
           
(package private)  File[] masterTemplates
           
(package private)  MCRSession mcrSession
           
 
Fields inherited from class org.mycore.frontend.wcms.MCRWCMSServlet
OUTPUT_ENCODING, VALIDATOR
 
Fields inherited from class org.mycore.frontend.servlets.MCRServlet
BASE_URL_ATTRIBUTE, trustedProxies
 
Constructor Summary
MCRWCMSActionServlet()
           
 
Method Summary
 void addLastModifiedToContent(File hrefFile)
           
 String addRootElement(String xml)
           
 void codeValidation(String validator)
           
 int countChildren(Element actElem)
           
 void doItAll(HttpServletRequest request, File hrefFile, String action, String mode, String addAtPosition)
           
 Element findActElem(Element element, String attr, String value)
           
 Element findActElem(Element element, String attr, String value, Namespace ns)
           
 void generateOutput(String error, String label, String fileName)
           
 boolean getback()
           
 String getBackAddress()
           
 String getDate()
           
 File getFile(String fileName)
           
 String getParentAttribute(File inputFile, String attribute, String avalue, String parentAttribute, String altParentAttribute)
           
 HttpServletRequest getReq()
           
 HttpServletResponse getResp()
           
 String getServletInfo()
          Returns a short description of the servlet.
 org.w3c.tidy.Tidy getTidyConfig(org.w3c.tidy.Tidy tidy, String outputFormat)
           
 String getTime()
           
 Document getXMLAsJDOM(Object xmlSource)
           
 void initParam(HttpServletRequest request)
           
 void makeAction(String action)
           
 String makeBackup(File inputFile)
           
 void modifyNavi(File inputFile)
           
protected  void processRequest(HttpServletRequest request, HttpServletResponse response)
          Processes requests for both HTTP GET and POST methods.
 void setback()
           
 void setBackAddress()
           
 void setFile(String fileName)
           
 void setReq(HttpServletRequest req)
           
 void setResp(HttpServletResponse resp)
           
 void test()
           
 void updateFooterFile()
           
 void validate(Element element)
           
 Document validateSource(Object xmlSource)
           
 boolean validInput(HttpServletRequest request)
           
 boolean validXHTML(File htmlFile)
           
 void writeJDOMDocumentToFile(Document jdomDoc, File xmlFile)
           
 void writeToLogFile(String action, String contentFileBackup)
           
 
Methods inherited from class org.mycore.frontend.wcms.MCRWCMSServlet
accessGeneral, doGetPost, getMultimediaConfig, getTemplates, XMLFile2JDOM
 
Methods inherited from class org.mycore.frontend.servlets.MCRServlet
buildRedirectURL, doGet, doGet, doPost, doPost, generateActiveLinkErrorpage, generateErrorPage, getBaseURL, getLastModified, getLayoutService, getProperty, getRemoteAddr, getServletBaseURL, getSession, handleException, init, initTrustedProxies, render, reportException, think
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fs

char fs

imageList

String[] imageList

documentList

String[] documentList

hrefFile

File hrefFile

actElem

Element actElem

masterTemplates

File[] masterTemplates

logger

static Logger logger

mcrSession

MCRSession mcrSession
Constructor Detail

MCRWCMSActionServlet

public MCRWCMSActionServlet()
Method Detail

processRequest

protected void processRequest(HttpServletRequest request,
                              HttpServletResponse response)
Processes requests for both HTTP GET and POST methods.

Specified by:
processRequest in class MCRWCMSServlet
Parameters:
request - servlet request
response - servlet response

generateOutput

public void generateOutput(String error,
                           String label,
                           String fileName)

updateFooterFile

public void updateFooterFile()

addLastModifiedToContent

public void addLastModifiedToContent(File hrefFile)

writeToLogFile

public void writeToLogFile(String action,
                           String contentFileBackup)

getDate

public String getDate()

getTime

public String getTime()

validate

public void validate(Element element)

findActElem

public Element findActElem(Element element,
                           String attr,
                           String value)

findActElem

public Element findActElem(Element element,
                           String attr,
                           String value,
                           Namespace ns)

countChildren

public int countChildren(Element actElem)

makeBackup

public String makeBackup(File inputFile)

modifyNavi

public void modifyNavi(File inputFile)

validXHTML

public boolean validXHTML(File htmlFile)

getParentAttribute

public String getParentAttribute(File inputFile,
                                 String attribute,
                                 String avalue,
                                 String parentAttribute,
                                 String altParentAttribute)

makeAction

public void makeAction(String action)

validInput

public boolean validInput(HttpServletRequest request)

doItAll

public void doItAll(HttpServletRequest request,
                    File hrefFile,
                    String action,
                    String mode,
                    String addAtPosition)

codeValidation

public void codeValidation(String validator)

getServletInfo

public String getServletInfo()
Returns a short description of the servlet.

Specified by:
getServletInfo in interface Servlet
Overrides:
getServletInfo in class GenericServlet

setReq

public void setReq(HttpServletRequest req)
Parameters:
req -

getReq

public HttpServletRequest getReq()

setResp

public void setResp(HttpServletResponse resp)

getResp

public HttpServletResponse getResp()

getFile

public File getFile(String fileName)
             throws IOException,
                    FileNotFoundException
Throws:
IOException
FileNotFoundException

setFile

public void setFile(String fileName)
             throws IOException
Parameters:
fileName -
Throws:
IOException

getXMLAsJDOM

public Document getXMLAsJDOM(Object xmlSource)
Parameters:
xmlSource - - any source that contains xml-valid content
Returns:
JDOM Document

addRootElement

public String addRootElement(String xml)

validateSource

public Document validateSource(Object xmlSource)

getTidyConfig

public org.w3c.tidy.Tidy getTidyConfig(org.w3c.tidy.Tidy tidy,
                                       String outputFormat)

initParam

public void initParam(HttpServletRequest request)
Parameters:
request -

writeJDOMDocumentToFile

public void writeJDOMDocumentToFile(Document jdomDoc,
                                    File xmlFile)
                             throws IOException,
                                    FileNotFoundException
Parameters:
jdomDoc - - JDOM Document
xmlFile - - File the Document is written to.
Throws:
IOException
FileNotFoundException

test

public void test()
          throws IOException,
                 FileNotFoundException
Throws:
IOException
FileNotFoundException

getback

public boolean getback()

setback

public void setback()

getBackAddress

public String getBackAddress()

setBackAddress

public void setBackAddress()