org.apache.lenya.cms.site.usecases
Class CreateDocument

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.site.usecases.Create
              extended by org.apache.lenya.cms.site.usecases.CreateDocument
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 CreateDocument
extends Create

Usecase to create a document.

Version:
$Id: CreateDocument.java 568678 2007-08-22 16:12:12Z andreas $

Field Summary
protected static java.lang.String DOCUMENT_TYPE
           
protected static java.lang.String PARENT_PATH
           
protected static java.lang.String PATH_PROVIDED
           
protected static java.lang.String RELATION
           
protected static java.lang.String RELATION_AFTER
           
protected static java.lang.String RELATION_BEFORE
           
protected static java.lang.String RELATION_CHILD
           
protected static java.lang.String RELATIONS
           
 
Fields inherited from class org.apache.lenya.cms.site.usecases.Create
DUBLIN_CORE_PREFIX, LANGUAGE, LANGUAGES, NODE_NAME, PATH, RESOURCE_TYPES, SAMPLE, SAMPLES, VISIBLEINNAV
 
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
CreateDocument()
           
 
Method Summary
protected  boolean createVersion()
           
protected  void doCheckExecutionConditions()
           
protected  java.lang.String getDocumentTypeName()
           
protected  java.lang.String getNewDocumentName()
           
protected  java.lang.String getNewDocumentPath()
           
protected  java.lang.String getNodeName()
           
protected  java.lang.String getRelation()
           
protected  java.lang.String getSourceExtension()
           
protected  java.lang.String[] getSupportedRelations()
          Override this method to support other relations.
protected  void initParameters()
           
protected  boolean isPathValid()
          This method is used by Create.doCheckExecutionConditions() to check if the path entered by the user is valid.
 
Methods inherited from class org.apache.lenya.cms.site.usecases.Create
doCheckPreconditions, doExecute, getArea, getDublinCoreParameter, getInitialDocument, getNewDocument, getNodesToLock, getPublication, getSourceDocument, getVisibleInNav, initSampleParameters, setDublinCoreParameter, setMetaData
 
Methods inherited from class org.apache.lenya.cms.usecase.AbstractUsecase
addErrorMessage, addErrorMessage, addErrorMessages, addInfoMessage, addInfoMessage, advance, 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, getSourceURL, getStateMachine, getTargetURL, getView, hasErrors, hasInfoMessages, initialize, initializeParametersIfNotDone, isOptimistic, lockInvolvedObjects, lockInvolvedObjects, prepareView, service, setDefaultTargetURL, 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

PARENT_PATH

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

DOCUMENT_TYPE

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

RELATION

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

RELATIONS

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

RELATION_CHILD

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

RELATION_BEFORE

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

RELATION_AFTER

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

PATH_PROVIDED

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

CreateDocument

public CreateDocument()
Method Detail

initParameters

protected void initParameters()
Overrides:
initParameters in class Create
See Also:
AbstractUsecase.initParameters()

getSupportedRelations

protected java.lang.String[] getSupportedRelations()
Override this method to support other relations.

Returns:
The supported relations.

doCheckExecutionConditions

protected void doCheckExecutionConditions()
                                   throws java.lang.Exception
Overrides:
doCheckExecutionConditions in class Create
Throws:
java.lang.Exception
See Also:
AbstractUsecase.doCheckExecutionConditions()

getNodeName

protected java.lang.String getNodeName()

isPathValid

protected boolean isPathValid()
Description copied from class: Create
This method is used by Create.doCheckExecutionConditions() to check if the path entered by the user is valid. If not, checking the existence of the new document in the site structure is omitted because this operation could cause errors.

Overrides:
isPathValid in class Create
Returns:
A boolean value.

getNewDocumentName

protected java.lang.String getNewDocumentName()
Specified by:
getNewDocumentName in class Create
Returns:
the name of the document being created in the usecase
See Also:
Create.getNewDocumentName()

getRelation

protected java.lang.String getRelation()
Returns:
The relation between the source document and the created document.

getNewDocumentPath

protected java.lang.String getNewDocumentPath()
Specified by:
getNewDocumentPath in class Create
Returns:
the id of the new document being created in the usecase
See Also:
Create.getNewDocumentPath()

getDocumentTypeName

protected java.lang.String getDocumentTypeName()
Specified by:
getDocumentTypeName in class Create
Returns:
The type of the created document.
See Also:
Create.getDocumentTypeName()

getSourceExtension

protected java.lang.String getSourceExtension()
Specified by:
getSourceExtension in class Create
Returns:
the extension to use for the document source.

createVersion

protected boolean createVersion()
Specified by:
createVersion in class Create


Copyright $ Apache Software Foundation. All Rights Reserved.