org.apache.lenya.cms.usecase.impl
Class UsecaseProxy

java.lang.Object
  extended by org.apache.lenya.cms.usecase.impl.UsecaseProxy

public class UsecaseProxy
extends java.lang.Object

Proxy which holds the parameters of a usecase. It is used to restore the usecase after the flowscript is re-entered and to pass the usecase parameters to a JX template.

Version:
$Id: UsecaseProxy.java 546890 2007-06-13 14:39:04Z andreas $

Constructor Summary
UsecaseProxy(Usecase usecase)
          Ctor.
 
Method Summary
 java.lang.String getBooleanCheckboxParameter(java.lang.String name)
          Returns one of the strings "true" or "false" depending on whether the corresponding checkbox was checked.
 java.util.List getErrorMessages()
          Returns the error messages from the previous operation.
 java.util.List getInfoMessages()
          Returns the info messages from the previous operation.
 java.lang.String getName()
           
 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.
 java.lang.String getParameterAsString(java.lang.String name)
          Returns the current value of a parameter as a string.
 java.lang.String[] getParameterNames()
           
 org.apache.lenya.cms.repository.Session getSession()
           
 java.lang.String getSourceURL()
           
 UsecaseView getView()
           
 boolean hasErrors()
          Determine if the usecase has error messages.
 boolean hasInfoMessages()
          Determine if the usecase has info messages.
 void setup(Usecase usecase)
          Initializes a usecase from this proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsecaseProxy

public UsecaseProxy(Usecase usecase)
Ctor.

Parameters:
usecase - The usecase to extract the parameters from.
Method Detail

setup

public void setup(Usecase usecase)
Initializes a usecase from this proxy.

Parameters:
usecase - The usecase.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Returns the current value of a parameter.

Parameters:
name - The parameter name.
Returns:
An object.

getParameter

public java.lang.Object getParameter(java.lang.String name,
                                     java.lang.Object defaultValue)
Returns the current value of a parameter.

Parameters:
name - The parameter name.
defaultValue - The default value to use when the parameter is not set.
Returns:
An object.

getParameterAsString

public java.lang.String getParameterAsString(java.lang.String name)
Returns the current value of a parameter as a string.

Parameters:
name - The parameter name.
Returns:
A string or null if the parameter was not set.

getParameterNames

public java.lang.String[] getParameterNames()
Returns:
The parameter names.

getErrorMessages

public java.util.List getErrorMessages()
Returns the error messages from the previous operation. Error messages prevent the operation from being executed.

Returns:
A list of strings.

getInfoMessages

public java.util.List getInfoMessages()
Returns the info messages from the previous operation. Info messages do not prevent the operation from being executed.

Returns:
A list of strings.

hasErrors

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

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.

Returns:
true if the usecase resulted in info messages being generated.

getName

public java.lang.String getName()
Returns:
The name of this usecase.

getView

public UsecaseView getView()
Returns:
The view of the usecase.

getSession

public org.apache.lenya.cms.repository.Session getSession()
Returns:
The session of the usecase.

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.

getSourceURL

public java.lang.String getSourceURL()
Returns:
The source URL of the usecase.


Copyright © $ Apache Software Foundation. All Rights Reserved.