org.apache.lenya.cms.editors.forms
Class OneFormEditor

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.usecase.AbstractUsecase
          extended by org.apache.lenya.cms.usecase.DocumentUsecase
              extended by org.apache.lenya.cms.editors.forms.OneFormEditor
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.lenya.cms.usecase.Usecase

public class OneFormEditor
extends org.apache.lenya.cms.usecase.DocumentUsecase

One form editor.

Version:
$Id: OneFormEditor.java 603380 2007-12-11 22:10:28Z andreas $

Field Summary
 
Fields inherited from class org.apache.lenya.cms.usecase.DocumentUsecase
DOCUMENT, TARGET_DOCUMENT
 
Fields inherited from class org.apache.lenya.cms.usecase.AbstractUsecase
ATTRIBUTE_NAME, ATTRIBUTE_POLICY, ATTRIBUTE_USECASE, ATTRIBUTE_VALUE, context, ELEMENT_EXIT, ELEMENT_PARAMETER, ELEMENT_TRANSACTION, ELEMENT_VIEW, ERROR_OBJECTS_CHECKED_OUT, EVENT_CHECK_EXECUTION_CONDITIONS, EVENT_CHECK_POSTCONDITIONS, EVENT_CHECK_PRECONDITIONS, EVENT_EXECUTE, manager, MODEL, PARAMETER_CHECKOUT_RESTRICTED_TO_SESSION, PARAMETER_FACTORY, PARAMETER_SESSION, PARAMETER_STATE_MACHINE, PARAMETERS_INITIALIZED, SOURCE_URL, TRANSITIONS, VALUE_OPTIMISTIC, VALUE_PESSIMISTIC
 
Fields inherited from interface org.apache.lenya.cms.usecase.Usecase
ROLE
 
Constructor Summary
OneFormEditor()
           
 
Method Summary
 void advance()
           
protected  void doCheckExecutionConditions()
           
protected  void doCheckPreconditions()
           
protected  void doExecute()
           
protected  java.lang.String getEncoding()
           
protected  java.lang.String getEvent()
           
protected  org.apache.lenya.cms.repository.Node[] getNodesToLock()
           
protected  org.w3c.dom.Document getXml()
           
protected  java.lang.String getXmlString(java.lang.String encoding)
           
protected  void saveDocument(org.w3c.dom.Document content)
          Save the content to the document source.
protected  void saveXMLFile(org.w3c.dom.Document content, org.apache.lenya.cms.publication.Document document)
          Save the XML file
protected  void validate(org.w3c.dom.Document xml)
           
 
Methods inherited from class org.apache.lenya.cms.usecase.DocumentUsecase
getSourceDocument, getSourceURL, getTargetDocument, getTargetURL, setDefaultTargetURL, setTargetDocument
 
Methods inherited from class org.apache.lenya.cms.usecase.AbstractUsecase
addErrorMessage, addErrorMessage, addErrorMessages, addInfoMessage, addInfoMessage, advanceState, cancel, canCheckOut, checkEvent, checkExecutionConditions, checkoutRestrictedToSession, checkPostconditions, checkPreconditions, clearErrorMessages, clearInfoMessages, configure, contextualize, deleteParameter, doCheckPostconditions, doInitialize, dumpErrorMessages, execute, getBooleanCheckboxParameter, getContext, getDocumentFactory, getErrorMessages, getExitQueryString, getInfoMessages, getName, getParameter, getParameter, getParameterAsBoolean, getParameterAsInteger, getParameterAsString, getParameterAsString, getParameterNames, getParameters, getPart, getSession, getStateMachine, getView, hasErrors, hasInfoMessages, initialize, initializeParametersIfNotDone, initParameters, isOptimistic, lockInvolvedObjects, lockInvolvedObjects, prepareView, service, setExitParameter, setName, setParameter, setPart, setSession, setSourceURL, setTestSession, setView, startTransaction
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneFormEditor

public OneFormEditor()
Method Detail

getNodesToLock

protected org.apache.lenya.cms.repository.Node[] getNodesToLock()
                                                         throws org.apache.lenya.cms.usecase.UsecaseException
Overrides:
getNodesToLock in class org.apache.lenya.cms.usecase.AbstractUsecase
Throws:
org.apache.lenya.cms.usecase.UsecaseException
See Also:
AbstractUsecase.getNodesToLock()

doCheckPreconditions

protected void doCheckPreconditions()
                             throws java.lang.Exception
Overrides:
doCheckPreconditions in class org.apache.lenya.cms.usecase.DocumentUsecase
Throws:
java.lang.Exception
See Also:
AbstractUsecase.doCheckPreconditions()

doExecute

protected void doExecute()
                  throws java.lang.Exception
Overrides:
doExecute in class org.apache.lenya.cms.usecase.AbstractUsecase
Throws:
java.lang.Exception
See Also:
AbstractUsecase.doExecute()

getEncoding

protected java.lang.String getEncoding()

getXmlString

protected java.lang.String getXmlString(java.lang.String encoding)

advance

public void advance()
             throws org.apache.lenya.cms.usecase.UsecaseException
Specified by:
advance in interface org.apache.lenya.cms.usecase.Usecase
Overrides:
advance in class org.apache.lenya.cms.usecase.AbstractUsecase
Throws:
org.apache.lenya.cms.usecase.UsecaseException

doCheckExecutionConditions

protected void doCheckExecutionConditions()
                                   throws java.lang.Exception
Overrides:
doCheckExecutionConditions in class org.apache.lenya.cms.usecase.AbstractUsecase
Throws:
java.lang.Exception

validate

protected void validate(org.w3c.dom.Document xml)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getXml

protected org.w3c.dom.Document getXml()
                               throws javax.xml.parsers.ParserConfigurationException,
                                      java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
java.io.IOException

saveDocument

protected void saveDocument(org.w3c.dom.Document content)
                     throws java.lang.Exception
Save the content to the document source. After saving, the XML is validated. If validation errors occur, the usecase transaction is rolled back, so the changes are not persistent. If the validation succeeded, the workflow event is invoked.

Parameters:
content - The content to save.
Throws:
java.lang.Exception - if an error occurs.

saveXMLFile

protected void saveXMLFile(org.w3c.dom.Document content,
                           org.apache.lenya.cms.publication.Document document)
Save the XML file

Parameters:
content - The content
document - The source

getEvent

protected java.lang.String getEvent()


Copyright $ Apache Software Foundation. All Rights Reserved.