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

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.CreateLanguage
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 CreateLanguage
extends Create

Usecase to create a new language version of a resource.

Version:
$Id: CreateLanguage.java 509215 2007-02-19 14:45:55Z andreas $

Field Summary
 
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
CreateLanguage()
           
 
Method Summary
protected  boolean createVersion()
           
protected  void doCheckPreconditions()
           
protected  java.lang.String getDocumentTypeName()
           
protected  org.apache.lenya.cms.publication.Document getInitialDocument()
          New language version of a document: use that document's content
protected  java.lang.String getNewDocumentName()
          For new language version of a document, name is the same as that document's
protected  java.lang.String getNewDocumentPath()
          For new language version of a document, the path is the same as that document's
protected  java.util.List getNonExistingLanguages()
           
protected  java.lang.String getSourceExtension()
           
protected  boolean getVisibleInNav()
           
protected  void initParameters()
           
 
Methods inherited from class org.apache.lenya.cms.site.usecases.Create
doCheckExecutionConditions, doExecute, getArea, getDublinCoreParameter, getNewDocument, getNodesToLock, getPublication, getSourceDocument, initSampleParameters, isPathValid, 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
 

Constructor Detail

CreateLanguage

public CreateLanguage()
Method Detail

doCheckPreconditions

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

getNonExistingLanguages

protected java.util.List getNonExistingLanguages()
                                          throws org.apache.lenya.cms.publication.DocumentBuildException,
                                                 org.apache.lenya.cms.publication.DocumentException
Returns:
All languages supported by the publication for which this document does not yet have a version
Throws:
org.apache.lenya.cms.publication.DocumentBuildException - if an error occurs.
org.apache.lenya.cms.publication.DocumentException - if an error occurs.

initParameters

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

getNewDocumentName

protected java.lang.String getNewDocumentName()
For new language version of a document, name is the same as that document's

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

getNewDocumentPath

protected java.lang.String getNewDocumentPath()
For new language version of a document, the path is the same as that document's

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

getInitialDocument

protected org.apache.lenya.cms.publication.Document getInitialDocument()
New language version of a document: use that document's content

Overrides:
getInitialDocument in class Create
Returns:
A document.
See Also:
Create.getInitialDocument()

getDocumentTypeName

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

getVisibleInNav

protected boolean getVisibleInNav()
Overrides:
getVisibleInNav in class Create
Returns:
the visibleInNav Attribute of the document being created in the usecase

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.