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

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.FormsEditor
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 FormsEditor
extends org.apache.lenya.cms.usecase.DocumentUsecase

Multiple forms editor usecase.

Version:
$Id: FormsEditor.java 597277 2007-11-22 00:46:12Z andreas $

Nested Class Summary
 class FormsEditor.FormPrefixResolver
          Prefix resolver which uses the usecase parameters like "namespace.xhtml=http://www.w3.org/1999/xhtml" to resolve prefixes.
 
Field Summary
protected static java.lang.String VALIDATION_ERRORS
           
protected static java.lang.String WORKFLOW_INVOKED
           
 
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
FormsEditor()
           
 
Method Summary
 void advance()
           
protected  java.lang.String changeTagNumber(java.lang.String tagID, int step)
          Change the tag number of the selected node.
protected  void checkModifiability(org.apache.excalibur.source.Source source)
          Checks if a source is modifiable.
protected  void doCheckPreconditions()
           
protected  void doExecute()
           
protected  java.lang.String getEvent()
           
protected  org.apache.xindice.xml.NamespaceMap getNamespaceMap(java.lang.String namespaces)
           
protected  org.apache.lenya.cms.repository.Node[] getNodesToLock()
           
protected  void writeDocument(org.w3c.dom.Document document, java.io.OutputStream oStream, java.lang.String encoding)
          Writes a document to a modifiable source.
 
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, doCheckExecutionConditions, 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
 

Field Detail

VALIDATION_ERRORS

protected static final java.lang.String VALIDATION_ERRORS
See Also:
Constant Field Values

WORKFLOW_INVOKED

protected static final java.lang.String WORKFLOW_INVOKED
See Also:
Constant Field Values
Constructor Detail

FormsEditor

public FormsEditor()
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()

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
See Also:
Usecase.advance()

doExecute

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

getNamespaceMap

protected org.apache.xindice.xml.NamespaceMap getNamespaceMap(java.lang.String namespaces)

changeTagNumber

protected java.lang.String changeTagNumber(java.lang.String tagID,
                                           int step)
Change the tag number of the selected node. The variable is used in a javascript in order to jump to the appropriate node after deleting or inserting a node.

Parameters:
tagID - The tagID where the new node is inserted.
step - int value for changing the tagID.

writeDocument

protected void writeDocument(org.w3c.dom.Document document,
                             java.io.OutputStream oStream,
                             java.lang.String encoding)
                      throws java.io.IOException,
                             javax.xml.transform.TransformerConfigurationException,
                             javax.xml.transform.TransformerException,
                             org.apache.cocoon.ProcessingException
Writes a document to a modifiable source.

Parameters:
document - The document.
oStream - The source.
Throws:
java.io.IOException - if an error occurs.
javax.xml.transform.TransformerConfigurationException - if an error occurs.
javax.xml.transform.TransformerException - if an error occurs.
org.apache.cocoon.ProcessingException - if an error occurs.

checkModifiability

protected void checkModifiability(org.apache.excalibur.source.Source source)
                           throws org.apache.cocoon.ProcessingException
Checks if a source is modifiable.

Parameters:
source - The source.
Throws:
org.apache.cocoon.ProcessingException - if the source is not modifiable.

getEvent

protected java.lang.String getEvent()


Copyright $ Apache Software Foundation. All Rights Reserved.