org.apache.lenya.cms.usecase
Class AbstractUsecase

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.usecase.AbstractUsecase
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, Usecase
Direct Known Subclasses:
DocumentUsecase, DummyUsecase

public class AbstractUsecase
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements Usecase, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable

Abstract usecase implementation.

Version:
$Id: AbstractUsecase.java 571548 2007-08-31 19:16:21Z rfrovarp $

Field Summary
protected static java.lang.String ATTRIBUTE_NAME
           
protected static java.lang.String ATTRIBUTE_POLICY
           
protected static java.lang.String ATTRIBUTE_USECASE
           
protected static java.lang.String ATTRIBUTE_VALUE
           
protected  org.apache.avalon.framework.context.Context context
           
protected static java.lang.String ELEMENT_EXIT
           
protected static java.lang.String ELEMENT_PARAMETER
           
protected static java.lang.String ELEMENT_TRANSACTION
           
protected static java.lang.String ELEMENT_VIEW
           
protected static java.lang.String ERROR_OBJECTS_CHECKED_OUT
           
protected static java.lang.String EVENT_CHECK_EXECUTION_CONDITIONS
           
protected static java.lang.String EVENT_CHECK_POSTCONDITIONS
           
protected static java.lang.String EVENT_CHECK_PRECONDITIONS
           
protected static java.lang.String EVENT_EXECUTE
           
protected  org.apache.avalon.framework.service.ServiceManager manager
           
protected static StateMachine.Model MODEL
           
protected static java.lang.String PARAMETER_CHECKOUT_RESTRICTED_TO_SESSION
           
protected static java.lang.String PARAMETER_FACTORY
           
protected static java.lang.String PARAMETER_SESSION
           
protected static java.lang.String PARAMETER_STATE_MACHINE
           
protected static java.lang.String PARAMETERS_INITIALIZED
           
protected  java.lang.String SOURCE_URL
           
protected static StateMachine.Transition[] TRANSITIONS
           
protected static java.lang.String VALUE_OPTIMISTIC
           
protected static java.lang.String VALUE_PESSIMISTIC
           
 
Fields inherited from interface org.apache.lenya.cms.usecase.Usecase
ROLE
 
Constructor Summary
AbstractUsecase()
           
 
Method Summary
 void addErrorMessage(java.lang.String message)
          Adds an error message.
 void addErrorMessage(java.lang.String message, java.lang.String[] _params)
          Adds an error message.
 void addErrorMessages(java.lang.String[] messages)
          Adds an error message.
 void addInfoMessage(java.lang.String message)
          Adds an info message.
 void addInfoMessage(java.lang.String message, java.lang.String[] _params)
          Adds an info message.
 void advance()
          Advances the usecase to the next step.
protected  void advanceState(java.lang.String event)
          Advance the usecase state machine to the next state.
 void cancel()
          Cancels the usecase.
protected  boolean canCheckOut(org.apache.lenya.cms.repository.Node[] objects)
           
protected  void checkEvent(java.lang.String event)
           
 void checkExecutionConditions()
          Checks the conditions right before the operation is executed.
protected  boolean checkoutRestrictedToSession()
           
 void checkPostconditions()
          Checks the conditions after the usecase was executed.
 void checkPreconditions()
          Checks the conditions before a form is displayed.
protected  void clearErrorMessages()
          Clears the error messages.
protected  void clearInfoMessages()
          Clears the info messages.
 void configure(org.apache.avalon.framework.configuration.Configuration config)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
           
protected  void deleteParameter(java.lang.String name)
          Deletes a parameter.
protected  void doCheckExecutionConditions()
          Checks the execution conditions.
protected  void doCheckPostconditions()
          Checks the post conditions.
protected  void doCheckPreconditions()
          Checks the preconditions.
protected  void doExecute()
          Executes the operation.
protected  void doInitialize()
          Does the actual initialization.
protected  void dumpErrorMessages()
          Dumps the error messages to the log.
 void execute()
          Executes the usecase.
 java.lang.String getBooleanCheckboxParameter(java.lang.String name)
          Returns one of the strings "true" or "false" depending on whether the corresponding checkbox was checked.
protected  org.apache.avalon.framework.context.Context getContext()
          Returns the context.
protected  org.apache.lenya.cms.publication.DocumentFactory getDocumentFactory()
           
 java.util.List getErrorMessages()
          Checks if the operation can be executed and returns the error messages.
protected  java.lang.String getExitQueryString()
          Returns the query string to access the exit usecase of this usecase.
 java.util.List getInfoMessages()
          Returns the information messages to show on the confirmation screen.
 java.lang.String getName()
           
protected  org.apache.lenya.cms.repository.Node[] getNodesToLock()
           
 java.lang.Object getParameter(java.lang.String name)
          Returns the current value of a parameter.
 java.lang.Object getParameter(java.lang.String name, java.lang.Object defaultValue)
          Returns the current value of a parameter.
 boolean getParameterAsBoolean(java.lang.String name, boolean defaultValue)
          Returns a parameter as boolean.
 int getParameterAsInteger(java.lang.String name, int defaultValue)
          Returns a parameter as integer.
 java.lang.String getParameterAsString(java.lang.String name)
          Returns the current value of a parameter as a string.
 java.lang.String getParameterAsString(java.lang.String name, java.lang.String defaultValue)
          Returns a parameter as string.
 java.lang.String[] getParameterNames()
           
 java.util.Map getParameters()
          Return a map of all parameters
 org.apache.cocoon.servlet.multipart.Part getPart(java.lang.String name)
          Returns the current value of a part parameter as a string.
 org.apache.lenya.cms.repository.Session getSession()
           
 java.lang.String getSourceURL()
           
protected  StateMachine getStateMachine()
           
 java.lang.String getTargetURL(boolean success)
          If setDefaultTargetURL(String)was not called, the source document ( getSourceURL()) is returned.
 UsecaseView getView()
           
 boolean hasErrors()
          Determine if the usecase has error messages.
 boolean hasInfoMessages()
          Determine if the usecase has info messages.
 void initialize()
           
protected  void initializeParametersIfNotDone()
           
protected  void initParameters()
          Override to initialize parameters.
 boolean isOptimistic()
           
 void lockInvolvedObjects()
           This method starts the transaction and locks all involved objects immediately.
 void lockInvolvedObjects(org.apache.lenya.cms.repository.Node[] objects)
           Lock the objects, for example when you need to change them (for example, delete).
protected  void prepareView()
          Override this method to prepare the view (add information messages etc.).
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
protected  void setDefaultTargetURL(java.lang.String url)
          Sets the default target URL which should be used if no explicit target URL is set.
protected  void setExitParameter(java.lang.String name, java.lang.String value)
          Sets a parameter to pass to the exit usecase.
 void setName(java.lang.String name)
           
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets a parameter from the form.
 void setPart(java.lang.String name, org.apache.cocoon.servlet.multipart.Part value)
          Sets a parameter from the form.
protected  void setSession(org.apache.lenya.cms.repository.Session session)
           
 void setSourceURL(java.lang.String url)
           
 void setTestSession(org.apache.lenya.cms.repository.Session session)
          If you invoke this method, the usecase won't use its own isolated session, but the passed test session.
 void setView(UsecaseView view)
           
protected  void startTransaction()
          Start a transaction by using a new, modifiable session.
 
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

EVENT_CHECK_POSTCONDITIONS

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

EVENT_EXECUTE

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

EVENT_CHECK_PRECONDITIONS

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

EVENT_CHECK_EXECUTION_CONDITIONS

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

ERROR_OBJECTS_CHECKED_OUT

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

TRANSITIONS

protected static final StateMachine.Transition[] TRANSITIONS

MODEL

protected static final StateMachine.Model MODEL

PARAMETER_STATE_MACHINE

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

PARAMETER_SESSION

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

PARAMETER_FACTORY

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

PARAMETER_CHECKOUT_RESTRICTED_TO_SESSION

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

PARAMETERS_INITIALIZED

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

SOURCE_URL

protected java.lang.String SOURCE_URL

ELEMENT_PARAMETER

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

ATTRIBUTE_NAME

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

ATTRIBUTE_VALUE

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

ELEMENT_VIEW

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

ELEMENT_TRANSACTION

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

ATTRIBUTE_POLICY

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

VALUE_OPTIMISTIC

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

VALUE_PESSIMISTIC

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

ELEMENT_EXIT

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

ATTRIBUTE_USECASE

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

context

protected org.apache.avalon.framework.context.Context context

manager

protected org.apache.avalon.framework.service.ServiceManager manager
Constructor Detail

AbstractUsecase

public AbstractUsecase()
Method Detail

initParameters

protected void initParameters()
Override to initialize parameters.


advanceState

protected void advanceState(java.lang.String event)
Advance the usecase state machine to the next state. This method has to be called at the end of the corresponding method to ensure that the subsequent methods can only be invoked if nothing went wrong.

Parameters:
event - The vent to invoke.

getStateMachine

protected StateMachine getStateMachine()

checkEvent

protected void checkEvent(java.lang.String event)

getSourceURL

public java.lang.String getSourceURL()
Specified by:
getSourceURL in interface Usecase
Returns:
The web application URL the usecase was invoked on.
See Also:
We don't use getParameterAsString() because this will typically cause stack overflows or NPEs in connection with initParameters().

getContext

protected org.apache.avalon.framework.context.Context getContext()
Returns the context.

Returns:
A context.

hasErrors

public boolean hasErrors()
Determine if the usecase has error messages. Provides a way of checking for errors without actually retrieving them.

Specified by:
hasErrors in interface Usecase
Returns:
true if the usecase resulted in error messages.

hasInfoMessages

public boolean hasInfoMessages()
Determine if the usecase has info messages. Provides a way of checking for info messages without actually retrieving them.

Specified by:
hasInfoMessages in interface Usecase
Returns:
true if the usecase resulted in info messages being generated.

getErrorMessages

public java.util.List getErrorMessages()
Checks if the operation can be executed and returns the error messages. Error messages prevent the operation from being executed.

Specified by:
getErrorMessages in interface Usecase
Returns:
A boolean value.

getInfoMessages

public java.util.List getInfoMessages()
Returns the information messages to show on the confirmation screen.

Specified by:
getInfoMessages in interface Usecase
Returns:
An array of strings. Info messages do not prevent the operation from being executed.

addErrorMessage

public void addErrorMessage(java.lang.String message)
Adds an error message.

Parameters:
message - The message.

addErrorMessage

public void addErrorMessage(java.lang.String message,
                            java.lang.String[] _params)
Adds an error message.

Parameters:
message - The message.
_params - parameters

addErrorMessages

public void addErrorMessages(java.lang.String[] messages)
Adds an error message.

Parameters:
messages - The messages.

addInfoMessage

public void addInfoMessage(java.lang.String message,
                           java.lang.String[] _params)
Adds an info message.

Parameters:
message - The message.
_params - parameters

addInfoMessage

public void addInfoMessage(java.lang.String message)
Adds an info message.

Parameters:
message - The message.

checkExecutionConditions

public final void checkExecutionConditions()
                                    throws UsecaseException
Description copied from interface: Usecase
Checks the conditions right before the operation is executed.

Specified by:
checkExecutionConditions in interface Usecase
Throws:
UsecaseException - if an error occurs that causes an unstable system.
See Also:
Usecase.checkExecutionConditions()

doCheckExecutionConditions

protected void doCheckExecutionConditions()
                                   throws java.lang.Exception
Checks the execution conditions.

Throws:
java.lang.Exception - if an error occurs.

checkPreconditions

public final void checkPreconditions()
                              throws UsecaseException
Description copied from interface: Usecase
Checks the conditions before a form is displayed.

Specified by:
checkPreconditions in interface Usecase
Throws:
UsecaseException - if an error occurs that causes an unstable system.
See Also:
Usecase.checkPreconditions()

doCheckPreconditions

protected void doCheckPreconditions()
                             throws java.lang.Exception
Checks the preconditions.

Throws:
java.lang.Exception - if an error occurs.

clearErrorMessages

protected void clearErrorMessages()
Clears the error messages.


clearInfoMessages

protected void clearInfoMessages()
Clears the info messages.


execute

public final void execute()
                   throws UsecaseException
Description copied from interface: Usecase
Executes the usecase. During this method error and info messages are filled in. If getErrorMessages() returns an empty array, the operation succeeded. Otherwise, the operation failed.

Specified by:
execute in interface Usecase
Throws:
UsecaseException - if an error occured that causes an unstable system.
See Also:
Usecase.execute()

dumpErrorMessages

protected void dumpErrorMessages()
Dumps the error messages to the log.


checkPostconditions

public void checkPostconditions()
                         throws UsecaseException
Description copied from interface: Usecase
Checks the conditions after the usecase was executed.

Specified by:
checkPostconditions in interface Usecase
Throws:
UsecaseException - if an error occurs that causes an unstable system.
See Also:
Usecase.checkPostconditions()

doCheckPostconditions

protected void doCheckPostconditions()
                              throws java.lang.Exception
Checks the post conditions.

Throws:
java.lang.Exception - if an error occured.

doExecute

protected void doExecute()
                  throws java.lang.Exception
Executes the operation.

Throws:
java.lang.Exception - when something went wrong.

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Description copied from interface: Usecase
Sets a parameter from the form.

Specified by:
setParameter in interface Usecase
Parameters:
name - The parameter name.
value - The parameter value.
See Also:
Usecase.setParameter(java.lang.String, java.lang.Object)

getParameter

public java.lang.Object getParameter(java.lang.String name)
Description copied from interface: Usecase
Returns the current value of a parameter.

Specified by:
getParameter in interface Usecase
Parameters:
name - The parameter name.
Returns:
An object.
See Also:
Usecase.getParameter(java.lang.String)

getParameter

public java.lang.Object getParameter(java.lang.String name,
                                     java.lang.Object defaultValue)
Description copied from interface: Usecase
Returns the current value of a parameter.

Specified by:
getParameter in interface Usecase
Parameters:
name - The parameter name.
defaultValue - The default value to return if the parameter is not set.
Returns:
An object.
See Also:
Usecase.getParameter(java.lang.String, java.lang.Object)

getParameterAsString

public java.lang.String getParameterAsString(java.lang.String name)
Description copied from interface: Usecase
Returns the current value of a parameter as a string.

Specified by:
getParameterAsString in interface Usecase
Parameters:
name - The parameter name.
Returns:
A string or null if the parameter was not set.
See Also:
Usecase.getParameterAsString(java.lang.String)

getParameterAsString

public java.lang.String getParameterAsString(java.lang.String name,
                                             java.lang.String defaultValue)
Returns a parameter as string. If the parameter does not exist, a default value is returned.

Parameters:
name - The parameter name.
defaultValue - The default value.
Returns:
A string.

getParameterAsInteger

public int getParameterAsInteger(java.lang.String name,
                                 int defaultValue)
Returns a parameter as integer. If the parameter does not exist, a default value is returned.

Parameters:
name - The parameter name.
defaultValue - The default value.
Returns:
An integer.

getParameterAsBoolean

public boolean getParameterAsBoolean(java.lang.String name,
                                     boolean defaultValue)
Returns a parameter as boolean. If the parameter does not exist, a default value is returned.

Parameters:
name - The parameter name.
defaultValue - The default value.
Returns:
A boolean value..

getParameters

public java.util.Map getParameters()
Return a map of all parameters

Returns:
the map

getBooleanCheckboxParameter

public java.lang.String getBooleanCheckboxParameter(java.lang.String name)
Returns one of the strings "true" or "false" depending on whether the corresponding checkbox was checked.

Parameters:
name - The parameter name.
Returns:
A string.

setDefaultTargetURL

protected void setDefaultTargetURL(java.lang.String url)
Sets the default target URL which should be used if no explicit target URL is set.

Parameters:
url - A URL string.

getTargetURL

public java.lang.String getTargetURL(boolean success)
If setDefaultTargetURL(String)was not called, the source document ( getSourceURL()) is returned.

Specified by:
getTargetURL in interface Usecase
Parameters:
success - If the usecase was completed successfully.
Returns:
A web application URL.
See Also:
Usecase.getTargetURL(boolean)

setPart

public void setPart(java.lang.String name,
                    org.apache.cocoon.servlet.multipart.Part value)
Description copied from interface: Usecase
Sets a parameter from the form. This method is called for parts in multipart requests.

Specified by:
setPart in interface Usecase
Parameters:
name - The parameter name.
value - The parameter value.
See Also:
Usecase.setPart(java.lang.String, org.apache.cocoon.servlet.multipart.Part)

getPart

public org.apache.cocoon.servlet.multipart.Part getPart(java.lang.String name)
Description copied from interface: Usecase
Returns the current value of a part parameter as a string.

Specified by:
getPart in interface Usecase
Parameters:
name - The part parameter name.
Returns:
A part or null if the part was not set.
See Also:
Usecase.getPart(java.lang.String)

getDocumentFactory

protected org.apache.lenya.cms.publication.DocumentFactory getDocumentFactory()

initialize

public final void initialize()
                      throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception
See Also:
Initializable.initialize()

doInitialize

protected final void doInitialize()
Does the actual initialization. Template method.


advance

public void advance()
             throws UsecaseException
Description copied from interface: Usecase
Advances the usecase to the next step. This method is called when all parameters are set.

Specified by:
advance in interface Usecase
Throws:
UsecaseException - if an error occurs.
See Also:
Usecase.advance()

deleteParameter

protected void deleteParameter(java.lang.String name)
Deletes a parameter.

Parameters:
name - The parameter name.

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Usecase
Parameters:
name - The name of this usecase.
See Also:
Usecase.setName(java.lang.String)

getName

public java.lang.String getName()
Specified by:
getName in interface Usecase
Returns:
The name of this usecase.
See Also:
Usecase.getName()

getParameterNames

public java.lang.String[] getParameterNames()
Specified by:
getParameterNames in interface Usecase
Returns:
The parameter names.
See Also:
Usecase.getParameterNames()

initializeParametersIfNotDone

protected void initializeParametersIfNotDone()

setSourceURL

public void setSourceURL(java.lang.String url)
Specified by:
setSourceURL in interface Usecase
Parameters:
url - The URL the usecase is invoked on.
See Also:
Usecase.setSourceURL(java.lang.String)

getView

public UsecaseView getView()
Specified by:
getView in interface Usecase
Returns:
The view of the usecase.
See Also:
Usecase.getView()

prepareView

protected void prepareView()
                    throws java.lang.Exception
Override this method to prepare the view (add information messages etc.).

Throws:
java.lang.Exception - If an error occurs.

isOptimistic

public boolean isOptimistic()
Specified by:
isOptimistic in interface Usecase
Returns:
true if the transaction policy is optimistic offline lock, false if it is pessimistic offline lock.

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

setView

public void setView(UsecaseView view)
Specified by:
setView in interface Usecase
Parameters:
view - The view of the usecase.
See Also:
Usecase.setView(org.apache.lenya.cms.usecase.UsecaseView)

getNodesToLock

protected org.apache.lenya.cms.repository.Node[] getNodesToLock()
                                                         throws UsecaseException
Returns:
The objects that could be changed during the usecase.
Throws:
UsecaseException - if an error occurs.

lockInvolvedObjects

public final void lockInvolvedObjects()
                               throws UsecaseException

This method starts the transaction and locks all involved objects immediately. This way, all changes to the objects in the session occur after the locking, avoiding overriding changes of other sessions.

This method is locked via the class lock to avoid inter-usecase synchronization issues.

Specified by:
lockInvolvedObjects in interface Usecase
Throws:
UsecaseException - if an error occurs.
See Also:
Usecase.lockInvolvedObjects()

startTransaction

protected void startTransaction()
                         throws org.apache.lenya.cms.repository.RepositoryException
Start a transaction by using a new, modifiable session.

Throws:
org.apache.lenya.cms.repository.RepositoryException - if an error occurs.

lockInvolvedObjects

public final void lockInvolvedObjects(org.apache.lenya.cms.repository.Node[] objects)
                               throws UsecaseException

Lock the objects, for example when you need to change them (for example, delete). If you know when entering the usecase what these objects are, you do not need to call this, the framework will take of it if you implement getObjectsToLock(). If you do not know in advance what the objects are, you can call this method explicitly when appropriate.

Parameters:
objects - the transactionable objects to lock
Throws:
UsecaseException - if an error occurs.
See Also:
lockInvolvedObjects(), getNodesToLock()

canCheckOut

protected boolean canCheckOut(org.apache.lenya.cms.repository.Node[] objects)
                       throws org.apache.lenya.cms.repository.RepositoryException
Throws:
org.apache.lenya.cms.repository.RepositoryException

cancel

public void cancel()
            throws UsecaseException
Description copied from interface: Usecase
Cancels the usecase.

Specified by:
cancel in interface Usecase
Throws:
UsecaseException - if an error occurs.
See Also:
Usecase.cancel()

setExitParameter

protected void setExitParameter(java.lang.String name,
                                java.lang.String value)
Sets a parameter to pass to the exit usecase.

Parameters:
name - The parameter name.
value - The parameter value.

getExitQueryString

protected java.lang.String getExitQueryString()
Returns the query string to access the exit usecase of this usecase.

Returns:
A query string of the form ?lenya.usecase=...&param1=foo&param2=bar.

getSession

public org.apache.lenya.cms.repository.Session getSession()
Specified by:
getSession in interface Usecase
Returns:
The repository session.

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException

setSession

protected void setSession(org.apache.lenya.cms.repository.Session session)

setTestSession

public void setTestSession(org.apache.lenya.cms.repository.Session session)
Description copied from interface: Usecase
If you invoke this method, the usecase won't use its own isolated session, but the passed test session. The session will not be committed when the usecase is invoked, so you can check it for modifications without modifying the repository.

Specified by:
setTestSession in interface Usecase
Parameters:
session - The test session.

checkoutRestrictedToSession

protected boolean checkoutRestrictedToSession()


Copyright $ Apache Software Foundation. All Rights Reserved.