Java Doc for AbstractUsecase.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » lenya » cms » usecase » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.lenya.cms.usecase 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.lenya.cms.usecase.AbstractUsecase

All known Subclasses:   org.apache.lenya.cms.publication.usecases.CreatePublicationFromTemplate,  org.apache.lenya.cms.usecase.DummyUsecase,  org.apache.lenya.cms.ac.usecases.AccessControlUsecase,  org.apache.lenya.cms.workflow.usecases.MultiWorkflowInvoke,  org.apache.lenya.cms.export.Import,  org.apache.lenya.cms.site.usecases.Create,  org.apache.lenya.cms.jcr.usecases.JCRImport,  org.apache.lenya.cms.usecase.DocumentUsecase,  org.apache.lenya.cms.contactform.ContactForm,  org.apache.lenya.cms.jcr.usecases.Import,  org.apache.lenya.cms.site.usecases.Paste,  org.apache.lenya.cms.site.usecases.SiteOverview,  org.apache.lenya.cms.lucene.IndexSite,  org.apache.lenya.inbox.usecases.SendMessage,  org.apache.lenya.inbox.usecases.Inbox,  org.apache.lenya.cms.workflow.usecases.MultiWorkflow,  org.apache.lenya.cms.site.usecases.EmptyTrash,
AbstractUsecase
public class AbstractUsecase extends AbstractLogEnabled implements Usecase,Configurable,Contextualizable,Serviceable,Initializable(Code)
Abstract usecase implementation.
version:
   $Id: AbstractUsecase.java 571548 2007-08-31 19:16:21Z rfrovarp $


Field Summary
final protected static  StringATTRIBUTE_NAME
    
final protected static  StringATTRIBUTE_POLICY
    
final protected static  StringATTRIBUTE_USECASE
    
final protected static  StringATTRIBUTE_VALUE
    
final protected static  StringELEMENT_EXIT
    
final protected static  StringELEMENT_PARAMETER
    
final protected static  StringELEMENT_TRANSACTION
    
final protected static  StringELEMENT_VIEW
    
final protected static  StringERROR_OBJECTS_CHECKED_OUT
    
final protected static  StringEVENT_CHECK_EXECUTION_CONDITIONS
    
final protected static  StringEVENT_CHECK_POSTCONDITIONS
    
final protected static  StringEVENT_CHECK_PRECONDITIONS
    
final protected static  StringEVENT_EXECUTE
    
final protected static  StateMachine.ModelMODEL
    
final protected static  StringPARAMETERS_INITIALIZED
    
final protected static  StringPARAMETER_CHECKOUT_RESTRICTED_TO_SESSION
    
final protected static  StringPARAMETER_FACTORY
    
final protected static  StringPARAMETER_SESSION
    
final protected static  StringPARAMETER_STATE_MACHINE
    
protected  StringSOURCE_URL
    
final protected static  StateMachine.Transition[]TRANSITIONS
    
final protected static  StringVALUE_OPTIMISTIC
    
final protected static  StringVALUE_PESSIMISTIC
    
protected  Contextcontext
    
protected  ServiceManagermanager
    


Method Summary
public  voidaddErrorMessage(String message)
     Adds an error message.
public  voidaddErrorMessage(String message, String[] _params)
     Adds an error message.
public  voidaddErrorMessages(String[] messages)
     Adds an error message.
public  voidaddInfoMessage(String message, String[] _params)
     Adds an info message.
public  voidaddInfoMessage(String message)
     Adds an info message.
public  voidadvance()
    
protected  voidadvanceState(String event)
     Advance the usecase state machine to the next state.
protected  booleancanCheckOut(Node[] objects)
    
public  voidcancel()
    
protected  voidcheckEvent(String event)
    
final public  voidcheckExecutionConditions()
    
public  voidcheckPostconditions()
    
final public  voidcheckPreconditions()
    
protected  booleancheckoutRestrictedToSession()
    
protected  voidclearErrorMessages()
     Clears the error messages.
protected  voidclearInfoMessages()
     Clears the info messages.
public  voidconfigure(Configuration config)
    
public  voidcontextualize(Context context)
    
protected  voiddeleteParameter(String name)
     Deletes a parameter.
protected  voiddoCheckExecutionConditions()
     Checks the execution conditions.
protected  voiddoCheckPostconditions()
     Checks the post conditions.
protected  voiddoCheckPreconditions()
     Checks the preconditions.
protected  voiddoExecute()
     Executes the operation.
final protected  voiddoInitialize()
     Does the actual initialization.
protected  voiddumpErrorMessages()
     Dumps the error messages to the log.
final public  voidexecute()
    
public  StringgetBooleanCheckboxParameter(String name)
     Returns one of the strings "true" or "false" depending on whether the corresponding checkbox was checked.
Parameters:
  name - The parameter name.
protected  ContextgetContext()
     Returns the context.
protected  DocumentFactorygetDocumentFactory()
    
public  ListgetErrorMessages()
     Checks if the operation can be executed and returns the error messages.
protected  StringgetExitQueryString()
     Returns the query string to access the exit usecase of this usecase.
public  ListgetInfoMessages()
     Returns the information messages to show on the confirmation screen. An array of strings.
public  StringgetName()
    
protected  Node[]getNodesToLock()
    
public  ObjectgetParameter(String name)
    
public  ObjectgetParameter(String name, Object defaultValue)
    
public  booleangetParameterAsBoolean(String name, boolean defaultValue)
     Returns a parameter as boolean.
public  intgetParameterAsInteger(String name, int defaultValue)
     Returns a parameter as integer.
public  StringgetParameterAsString(String name)
    
public  StringgetParameterAsString(String name, String defaultValue)
     Returns a parameter as string.
public  String[]getParameterNames()
    
public  MapgetParameters()
    
public  PartgetPart(String name)
    
public  SessiongetSession()
    
public  StringgetSourceURL()
    
protected  StateMachinegetStateMachine()
    
public  StringgetTargetURL(boolean success)
     If AbstractUsecase.setDefaultTargetURL(String) was not called, the source document ( AbstractUsecase.getSourceURL() ) is returned.
public  UsecaseViewgetView()
    
public  booleanhasErrors()
     Determine if the usecase has error messages.
public  booleanhasInfoMessages()
     Determine if the usecase has info messages.
protected  voidinitParameters()
     Override to initialize parameters.
final public  voidinitialize()
    
protected  voidinitializeParametersIfNotDone()
    
public  booleanisOptimistic()
    
final public  voidlockInvolvedObjects()
    

This method starts the transaction and locks all involved objects immediately.

final public  voidlockInvolvedObjects(Node[] objects)
    

Lock the objects, for example when you need to change them (for example, delete).

protected  voidprepareView()
     Override this method to prepare the view (add information messages etc.).
public  voidservice(ServiceManager manager)
    
protected  voidsetDefaultTargetURL(String url)
     Sets the default target URL which should be used if no explicit target URL is set.
protected  voidsetExitParameter(String name, String value)
     Sets a parameter to pass to the exit usecase.
public  voidsetName(String name)
    
public  voidsetParameter(String name, Object value)
    
public  voidsetPart(String name, Part value)
    
protected  voidsetSession(org.apache.lenya.cms.repository.Session session)
    
public  voidsetSourceURL(String url)
    
public  voidsetTestSession(Session session)
    
public  voidsetView(UsecaseView view)
    
protected  voidstartTransaction()
     Start a transaction by using a new, modifiable session.

Field Detail
ATTRIBUTE_NAME
final protected static String ATTRIBUTE_NAME(Code)



ATTRIBUTE_POLICY
final protected static String ATTRIBUTE_POLICY(Code)



ATTRIBUTE_USECASE
final protected static String ATTRIBUTE_USECASE(Code)



ATTRIBUTE_VALUE
final protected static String ATTRIBUTE_VALUE(Code)



ELEMENT_EXIT
final protected static String ELEMENT_EXIT(Code)



ELEMENT_PARAMETER
final protected static String ELEMENT_PARAMETER(Code)



ELEMENT_TRANSACTION
final protected static String ELEMENT_TRANSACTION(Code)



ELEMENT_VIEW
final protected static String ELEMENT_VIEW(Code)



ERROR_OBJECTS_CHECKED_OUT
final protected static String ERROR_OBJECTS_CHECKED_OUT(Code)



EVENT_CHECK_EXECUTION_CONDITIONS
final protected static String EVENT_CHECK_EXECUTION_CONDITIONS(Code)



EVENT_CHECK_POSTCONDITIONS
final protected static String EVENT_CHECK_POSTCONDITIONS(Code)



EVENT_CHECK_PRECONDITIONS
final protected static String EVENT_CHECK_PRECONDITIONS(Code)



EVENT_EXECUTE
final protected static String EVENT_EXECUTE(Code)



MODEL
final protected static StateMachine.Model MODEL(Code)



PARAMETERS_INITIALIZED
final protected static String PARAMETERS_INITIALIZED(Code)



PARAMETER_CHECKOUT_RESTRICTED_TO_SESSION
final protected static String PARAMETER_CHECKOUT_RESTRICTED_TO_SESSION(Code)



PARAMETER_FACTORY
final protected static String PARAMETER_FACTORY(Code)



PARAMETER_SESSION
final protected static String PARAMETER_SESSION(Code)



PARAMETER_STATE_MACHINE
final protected static String PARAMETER_STATE_MACHINE(Code)



SOURCE_URL
protected String SOURCE_URL(Code)



TRANSITIONS
final protected static StateMachine.Transition[] TRANSITIONS(Code)



VALUE_OPTIMISTIC
final protected static String VALUE_OPTIMISTIC(Code)



VALUE_PESSIMISTIC
final protected static String VALUE_PESSIMISTIC(Code)



context
protected Context context(Code)



manager
protected ServiceManager manager(Code)





Method Detail
addErrorMessage
public void addErrorMessage(String message)(Code)
Adds an error message.
Parameters:
  message - The message.



addErrorMessage
public void addErrorMessage(String message, String[] _params)(Code)
Adds an error message.
Parameters:
  message - The message.
Parameters:
  _params - parameters



addErrorMessages
public void addErrorMessages(String[] messages)(Code)
Adds an error message.
Parameters:
  messages - The messages.



addInfoMessage
public void addInfoMessage(String message, String[] _params)(Code)
Adds an info message.
Parameters:
  message - The message.
Parameters:
  _params - parameters



addInfoMessage
public void addInfoMessage(String message)(Code)
Adds an info message.
Parameters:
  message - The message.



advance
public void advance() throws UsecaseException(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.advance



advanceState
protected void advanceState(String event)(Code)
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.



canCheckOut
protected boolean canCheckOut(Node[] objects) throws RepositoryException(Code)



cancel
public void cancel() throws UsecaseException(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.cancel



checkEvent
protected void checkEvent(String event)(Code)



checkExecutionConditions
final public void checkExecutionConditions() throws UsecaseException(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.checkExecutionConditions



checkPostconditions
public void checkPostconditions() throws UsecaseException(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.checkPostconditions



checkPreconditions
final public void checkPreconditions() throws UsecaseException(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.checkPreconditions



checkoutRestrictedToSession
protected boolean checkoutRestrictedToSession()(Code)



clearErrorMessages
protected void clearErrorMessages()(Code)
Clears the error messages.



clearInfoMessages
protected void clearInfoMessages()(Code)
Clears the info messages.



configure
public void configure(Configuration config) throws ConfigurationException(Code)

See Also:   org.apache.avalon.framework.configuration.Configurable.configure(org.apache.avalon.framework.configuration.Configuration)



contextualize
public void contextualize(Context context) throws ContextException(Code)

See Also:   org.apache.avalon.framework.context.Contextualizable.contextualize(org.apache.avalon.framework.context.Context)



deleteParameter
protected void deleteParameter(String name)(Code)
Deletes a parameter.
Parameters:
  name - The parameter name.



doCheckExecutionConditions
protected void doCheckExecutionConditions() throws Exception(Code)
Checks the execution conditions.
throws:
  Exception - if an error occurs.



doCheckPostconditions
protected void doCheckPostconditions() throws Exception(Code)
Checks the post conditions.
throws:
  Exception - if an error occured.



doCheckPreconditions
protected void doCheckPreconditions() throws Exception(Code)
Checks the preconditions.
throws:
  Exception - if an error occurs.



doExecute
protected void doExecute() throws Exception(Code)
Executes the operation.
throws:
  Exception - when something went wrong.



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



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



execute
final public void execute() throws UsecaseException(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.execute



getBooleanCheckboxParameter
public String getBooleanCheckboxParameter(String name)(Code)
Returns one of the strings "true" or "false" depending on whether the corresponding checkbox was checked.
Parameters:
  name - The parameter name. A string.



getContext
protected Context getContext()(Code)
Returns the context. A context.



getDocumentFactory
protected DocumentFactory getDocumentFactory()(Code)



getErrorMessages
public List getErrorMessages()(Code)
Checks if the operation can be executed and returns the error messages. Error messages prevent the operation from being executed. A boolean value.



getExitQueryString
protected String getExitQueryString()(Code)
Returns the query string to access the exit usecase of this usecase. A query string of the form?lenya.usecase=...&param1=foo&param2=bar.



getInfoMessages
public List getInfoMessages()(Code)
Returns the information messages to show on the confirmation screen. An array of strings. Info messages do not prevent the operation from being executed.



getName
public String getName()(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getName



getNodesToLock
protected Node[] getNodesToLock() throws UsecaseException(Code)
The objects that could be changed during the usecase.
throws:
  UsecaseException - if an error occurs.



getParameter
public Object getParameter(String name)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getParameter(java.lang.String)



getParameter
public Object getParameter(String name, Object defaultValue)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getParameter(java.lang.Stringjava.lang.Object)



getParameterAsBoolean
public boolean getParameterAsBoolean(String name, boolean defaultValue)(Code)
Returns a parameter as boolean. If the parameter does not exist, a default value is returned.
Parameters:
  name - The parameter name.
Parameters:
  defaultValue - The default value. A boolean value..



getParameterAsInteger
public int getParameterAsInteger(String name, int defaultValue)(Code)
Returns a parameter as integer. If the parameter does not exist, a default value is returned.
Parameters:
  name - The parameter name.
Parameters:
  defaultValue - The default value. An integer.



getParameterAsString
public String getParameterAsString(String name)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getParameterAsString(java.lang.String)



getParameterAsString
public String getParameterAsString(String name, String defaultValue)(Code)
Returns a parameter as string. If the parameter does not exist, a default value is returned.
Parameters:
  name - The parameter name.
Parameters:
  defaultValue - The default value. A string.



getParameterNames
public String[] getParameterNames()(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getParameterNames



getParameters
public Map getParameters()(Code)
Return a map of all parameters the map



getPart
public Part getPart(String name)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getPart(java.lang.String)



getSession
public Session getSession()(Code)



getSourceURL
public String getSourceURL()(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getSourceURL
See Also:    We don't use getParameterAsString()
See Also:   because this will typically cause stack overflows or NPEs in connection with
See Also:   initParameters().



getStateMachine
protected StateMachine getStateMachine()(Code)



getTargetURL
public String getTargetURL(boolean success)(Code)
If AbstractUsecase.setDefaultTargetURL(String) was not called, the source document ( AbstractUsecase.getSourceURL() ) is returned.
See Also:   org.apache.lenya.cms.usecase.Usecase.getTargetURL(boolean)



getView
public UsecaseView getView()(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.getView



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



hasInfoMessages
public boolean hasInfoMessages()(Code)
Determine if the usecase has info messages. Provides a way of checking for info messages without actually retrieving them. true if the usecase resulted in info messages being generated.



initParameters
protected void initParameters()(Code)
Override to initialize parameters.



initialize
final public void initialize() throws Exception(Code)

See Also:   org.apache.avalon.framework.activity.Initializable.initialize



initializeParametersIfNotDone
protected void initializeParametersIfNotDone()(Code)



isOptimistic
public boolean isOptimistic()(Code)
true if the transaction policy is optimistic offline lock,false if it is pessimistic offline lock.



lockInvolvedObjects
final public void lockInvolvedObjects() throws UsecaseException(Code)

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.


See Also:   org.apache.lenya.cms.usecase.Usecase.lockInvolvedObjects



lockInvolvedObjects
final public void lockInvolvedObjects(Node[] objects) throws UsecaseException(Code)

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:   AbstractUsecase.lockInvolvedObjects()
See Also:   AbstractUsecase.getNodesToLock()



prepareView
protected void prepareView() throws Exception(Code)
Override this method to prepare the view (add information messages etc.).
throws:
  Exception - If an error occurs.



service
public void service(ServiceManager manager) throws ServiceException(Code)



setDefaultTargetURL
protected void setDefaultTargetURL(String url)(Code)
Sets the default target URL which should be used if no explicit target URL is set.
Parameters:
  url - A URL string.



setExitParameter
protected void setExitParameter(String name, String value)(Code)
Sets a parameter to pass to the exit usecase.
Parameters:
  name - The parameter name.
Parameters:
  value - The parameter value.



setName
public void setName(String name)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.setName(java.lang.String)



setParameter
public void setParameter(String name, Object value)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.setParameter(java.lang.Stringjava.lang.Object)



setPart
public void setPart(String name, Part value)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.setPart(java.lang.Stringorg.apache.cocoon.servlet.multipart.Part)



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



setSourceURL
public void setSourceURL(String url)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.setSourceURL(java.lang.String)



setTestSession
public void setTestSession(Session session)(Code)



setView
public void setView(UsecaseView view)(Code)

See Also:   org.apache.lenya.cms.usecase.Usecase.setView(org.apache.lenya.cms.usecase.UsecaseView)



startTransaction
protected void startTransaction() throws RepositoryException(Code)
Start a transaction by using a new, modifiable session.
throws:
  RepositoryException - if an error occurs.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.