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

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.site.usecases.MoveSubsite
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
Direct Known Subclasses:
Archive, Delete, Restore

public abstract class MoveSubsite
extends org.apache.lenya.cms.usecase.DocumentUsecase

Usecase to move a subsite to another area.

Version:
$Id:$

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
MoveSubsite()
           
 
Method Summary
protected  void doCheckPreconditions()
           
protected  void doExecute()
           
protected abstract  java.lang.String getEvent()
           
protected  org.apache.lenya.cms.repository.Node[] getNodesToLock()
          Lock all source documents and the site structure repository nodes because changes to the site structure would compromise the operation.
protected static java.lang.String getParentPath(java.lang.String path)
           
protected abstract  java.lang.String[] getSourceAreas()
           
protected abstract  java.lang.String getTargetArea()
           
 java.lang.String getTargetURL(boolean success)
           
protected static java.lang.String getTargetUrl(org.apache.lenya.cms.site.SiteStructure site, java.lang.String path)
           
 
Methods inherited from class org.apache.lenya.cms.usecase.DocumentUsecase
getSourceDocument, getSourceURL, getTargetDocument, setDefaultTargetURL, setTargetDocument
 
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, 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
 

Constructor Detail

MoveSubsite

public MoveSubsite()
Method Detail

getSourceAreas

protected abstract java.lang.String[] getSourceAreas()
Returns:
The possible source areas.

getTargetArea

protected abstract java.lang.String getTargetArea()
Returns:
The target area.

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

getEvent

protected abstract java.lang.String getEvent()
Returns:
The workflow event.

getNodesToLock

protected org.apache.lenya.cms.repository.Node[] getNodesToLock()
                                                         throws org.apache.lenya.cms.usecase.UsecaseException
Lock all source documents and the site structure repository nodes because changes to the site structure would compromise the operation.

Overrides:
getNodesToLock in class org.apache.lenya.cms.usecase.AbstractUsecase
Throws:
org.apache.lenya.cms.usecase.UsecaseException

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

getTargetURL

public java.lang.String getTargetURL(boolean success)
Specified by:
getTargetURL in interface org.apache.lenya.cms.usecase.Usecase
Overrides:
getTargetURL in class org.apache.lenya.cms.usecase.DocumentUsecase

getTargetUrl

protected static java.lang.String getTargetUrl(org.apache.lenya.cms.site.SiteStructure site,
                                               java.lang.String path)
                                        throws org.apache.lenya.cms.site.SiteException
Throws:
org.apache.lenya.cms.site.SiteException

getParentPath

protected static java.lang.String getParentPath(java.lang.String path)


Copyright © $ Apache Software Foundation. All Rights Reserved.