Java Doc for MaintComponent2.java in  » J2EE » Jaffa » org » jaffa » components » maint » 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 » J2EE » Jaffa » org.jaffa.components.maint 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.presentation.portlet.component.Component
      org.jaffa.components.maint.MaintComponent2

MaintComponent2
abstract public class MaintComponent2 extends Component implements IMaintComponent(Code)
This is the base class for all Maintenance components created by using the object_maintenance_2_0 pattern. It has the following properties - 1- mode : Indicates if the component is in Create, Update or Delete mode. 2- refreshData : Indicates if the data needs to be refreshed. This happens when the data is modified by another user. 3- currentScreenCounter : A maintenance component may consist of more than one screen. This counter is used to identify the current screen being displayed. It will start with count=0 A Maintenance class will have to provide an implementation for the doPrevalidateCreate(), doCreate(), doPrevalidateUpdate(), doUpdate(), doDelete(), doRetrieve(), addScreens() methods.
author:
   GautamJ

Inner Class :public class Screen



Method Summary
public  voidaddCreateListener(ICreateListener listener)
     Adds a listener.
public  voidaddDeleteListener(IDeleteListener listener)
     Adds a listener.
public  voidaddDisplayOnlyField(String fieldName)
     This will mark a field as 'DisplayOnly'.
abstract protected  voidaddScreens(List screens)
     The Component should provide an implementation for this method to provide the screen information.
public  voidaddUpdateListener(IUpdateListener listener)
     Adds a listener.
public  voidcreate()
     This will invoke the doCreate() method to create a new domain object.
public  voiddelete(boolean performDirtyReadCheck)
     This will invoke the doDelete() method to delete the domain object.
public  MaintComponent2.ScreendetermineAndSetNextScreen()
     This sets the currentScreenCounter to point to the next screen.
public  MaintComponent2.ScreendetermineAndSetPreviousScreen()
     This sets the currentScreenCounter to point to the previous screen.
public  MaintComponent2.ScreendetermineCurrentScreen()
     Getter for the current Screen.
public static  URLdetermineDefaultValuesUrl(Class componentClass)
     A helper routine to return the URL for the properties file containing default values for a component. The properties file is assumed to be in the base package of the component with the name ComponentDefaultValues.properties'. This method will try to locate the file on the filesystem. This allows the application to pick up any changes to the file. However, if the file is part of a jar, then it'll be loaded by the classloader. A null will be returned if no file is found.
Parameters:
  componentClass - The component class.
public  FormKeydetermineFormKey()
     Getter for the current screen's FormKey.
public  MaintComponent2.ScreendetermineNextScreen()
     Getter for the next Screen.
public  MaintComponent2.ScreendeterminePreviousScreen()
     Getter for the previous Screen.
public  FormKeydisplay()
     Based on the mode and input parameters, this will either delete the domain object, or initialize the screen for updates, or bring up a blank screen.
throws:
  ApplicationExceptions - Indicates some functional error.
throws:
  FrameworkException - Indicates some system error.
abstract protected  voiddoCreate()
     The Component should provide an implementation for this method to create a domain object.
abstract protected  voiddoDelete(boolean performDirtyReadCheck)
     The Component should provide an implementation for this method to delete the domain object.
abstract protected  voiddoPrevalidateCreate()
     The Component should provide an implementation for this method to perform prevalidations before creating a domain object.
abstract protected  voiddoPrevalidateUpdate(boolean performDirtyReadCheck)
     The Component should provide an implementation for this method to perform prevalidations before updating a domain object.
abstract protected  voiddoRetrieve()
     The Component should provide an implementation for this method to retrieve the domain object.
abstract protected  voiddoUpdate(boolean performDirtyReadCheck)
     The Component should provide an implementation for this method to update the domain object.
protected  CollectiongetCreateListeners()
     Returns a Collection of ICreateListener objects.
public  intgetCurrentScreenCounter()
     Getter for property currentScreenCounter.
protected  CollectiongetDeleteListeners()
     Returns a Collection of IDeleteListener objects.
protected  HeaderDtogetHeaderDto()
     Returns the HeaderDto.
public  intgetMode()
     Getter for property mode.
public  MaintComponent2.Screen[]getScreens()
     Getter for the Screens.
protected  CollectiongetUpdateListeners()
     Returns a Collection of IUpdateListener objects.
protected  voidinitDropDownCodes()
     The Component should override this method to retrieve the set of codes for dropdowns in a screen, if any are required.
protected  voidinitializeData()
     This method is invoked by the display() method when the component is run in the CREATE_MODE.
protected  voidinvokeCreateListeners()
     Invokes the createDone() method of the registered ICreateListener objects in the same thread.
protected  voidinvokeCreateListeners(EventObject eventObject)
     Invokes the createDone() method of the registered ICreateListener objects in the same thread.
protected  voidinvokeDeleteListeners()
     Invokes the deleteDone() method of the registered IDeleteListener objects in the same thread.
protected  voidinvokeDeleteListeners(EventObject eventObject)
     Invokes the deleteDone() method of the registered IDeleteListener objects in the same thread.
protected  voidinvokeUpdateListeners()
     Invokes the updateDone() method of the registered IUpdateListener objects in the same thread.
protected  voidinvokeUpdateListeners(EventObject eventObject)
     Invokes the updateDone() method of the registered IUpdateListener objects in the same thread.
public  booleanisCreateMode()
     Returns true if this is create mode.
public  booleanisDeleteMode()
     Returns true if this is delete mode.
public  booleanisDisplayOnlyField(String fieldName)
     Returns a true if a field has been marked as 'DisplayOnly'.
Parameters:
  fieldName - The field to be checked.
public  booleanisRefreshData()
     Getter for property refreshData.
public  booleanisUpdateMode()
     Returns true if this is update mode.
public  voidprevalidateCreate()
     This will invoke the doPrevalidateCreate() method to perform prevalidations before creating a domain object.
public  voidprevalidateUpdate(boolean performDirtyReadCheck)
     This will invoke the doPrevalidateUpdate() method to perform prevalidations before updating a domain object.
public  voidquit()
     This clears the internal collection of listeners.
public  booleanremoveCreateListener(ICreateListener listener)
     Removes a listener.
Parameters:
  listener - the listener.
public  booleanremoveDeleteListener(IDeleteListener listener)
     Removes a listener.
Parameters:
  listener - the listener.
public  booleanremoveUpdateListener(IUpdateListener listener)
     Removes a listener.
Parameters:
  listener - the listener.
public  voidretrieve()
     This will invoke the doRetrieve() method to retrieve the domain object.
public  voidsetCurrentScreenCounter(int currentScreenCounter)
     Setter for property currentScreenCounter.
public  voidsetMode(int mode)
     Setter for property mode.
protected  voidsetRefreshData(boolean refreshData)
     Setter for property refreshData.
protected  voiduncacheWidgetModels()
     Clears the WidgetCache, removing all the WidgetModels.
public  voidupdate(boolean performDirtyReadCheck)
     This will invoke the doUpdate() method to update the domain object.



Method Detail
addCreateListener
public void addCreateListener(ICreateListener listener)(Code)
Adds a listener.
Parameters:
  listener - the listener.



addDeleteListener
public void addDeleteListener(IDeleteListener listener)(Code)
Adds a listener.
Parameters:
  listener - the listener.



addDisplayOnlyField
public void addDisplayOnlyField(String fieldName)(Code)
This will mark a field as 'DisplayOnly'.
Parameters:
  fieldName - The field to be marked as 'DisplayOnly'.



addScreens
abstract protected void addScreens(List screens)(Code)
The Component should provide an implementation for this method to provide the screen information.
Parameters:
  screens - The component should add MaintComponent2.Screen objects to this list.



addUpdateListener
public void addUpdateListener(IUpdateListener listener)(Code)
Adds a listener.
Parameters:
  listener - the listener.



create
public void create() throws ApplicationExceptions, FrameworkException(Code)
This will invoke the doCreate() method to create a new domain object. It will then invoke all the Create Listeners.
throws:
  ApplicationExceptions - Indicates some functional error.
throws:
  FrameworkException - Indicates some system error.



delete
public void delete(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException(Code)
This will invoke the doDelete() method to delete the domain object. It will then invoke all the Delete Listeners.
Parameters:
  performDirtyReadCheck - this will determine if the Dirty Read check if to be performed prior to a delete.
throws:
  ApplicationExceptions - Indicates some functional error.
throws:
  FrameworkException - Indicates some system error.



determineAndSetNextScreen
public MaintComponent2.Screen determineAndSetNextScreen()(Code)
This sets the currentScreenCounter to point to the next screen. This takes into account the mode and if the following screen is available in create or update modes. A null will be returned in case no appropriate next screen is available. the next screen.



determineAndSetPreviousScreen
public MaintComponent2.Screen determineAndSetPreviousScreen()(Code)
This sets the currentScreenCounter to point to the previous screen. This takes into account the mode and if the previous screen is available in create or update modes. A null will be returned in case no appropriate previous screen is available. the previous screen.



determineCurrentScreen
public MaintComponent2.Screen determineCurrentScreen()(Code)
Getter for the current Screen. the current screen.



determineDefaultValuesUrl
public static URL determineDefaultValuesUrl(Class componentClass)(Code)
A helper routine to return the URL for the properties file containing default values for a component. The properties file is assumed to be in the base package of the component with the name ComponentDefaultValues.properties'. This method will try to locate the file on the filesystem. This allows the application to pick up any changes to the file. However, if the file is part of a jar, then it'll be loaded by the classloader. A null will be returned if no file is found.
Parameters:
  componentClass - The component class. the URL for the properties file containing default values for a component.



determineFormKey
public FormKey determineFormKey()(Code)
Getter for the current screen's FormKey. the FormKey for the current screen.



determineNextScreen
public MaintComponent2.Screen determineNextScreen()(Code)
Getter for the next Screen. This takes into account the mode and if the following screen is available in create or update modes. A null will be returned in case no appropriate next screen is available. the next screen.



determinePreviousScreen
public MaintComponent2.Screen determinePreviousScreen()(Code)
Getter for the previous Screen. This takes into account the mode and if the previous screen is available in create or update modes. A null will be returned in case no appropriate previous screen is available. the previous screen.



display
public FormKey display() throws ApplicationExceptions, FrameworkException(Code)
Based on the mode and input parameters, this will either delete the domain object, or initialize the screen for updates, or bring up a blank screen.
throws:
  ApplicationExceptions - Indicates some functional error.
throws:
  FrameworkException - Indicates some system error. The FormKey.



doCreate
abstract protected void doCreate() throws ApplicationExceptions, FrameworkException(Code)
The Component should provide an implementation for this method to create a domain object.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



doDelete
abstract protected void doDelete(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException(Code)
The Component should provide an implementation for this method to delete the domain object.
Parameters:
  performDirtyReadCheck - this will determine if the Dirty Read check if to be performed prior to a delete.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



doPrevalidateCreate
abstract protected void doPrevalidateCreate() throws ApplicationExceptions, FrameworkException(Code)
The Component should provide an implementation for this method to perform prevalidations before creating a domain object.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



doPrevalidateUpdate
abstract protected void doPrevalidateUpdate(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException(Code)
The Component should provide an implementation for this method to perform prevalidations before updating a domain object.
Parameters:
  performDirtyReadCheck - this will determine if the Dirty Read check if to be performed prior to an update.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



doRetrieve
abstract protected void doRetrieve() throws ApplicationExceptions, FrameworkException(Code)
The Component should provide an implementation for this method to retrieve the domain object.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



doUpdate
abstract protected void doUpdate(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException(Code)
The Component should provide an implementation for this method to update the domain object.
Parameters:
  performDirtyReadCheck - this will determine if the Dirty Read check if to be performed prior to an update.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



getCreateListeners
protected Collection getCreateListeners()(Code)
Returns a Collection of ICreateListener objects. a Collection of ICreateListener objects.



getCurrentScreenCounter
public int getCurrentScreenCounter()(Code)
Getter for property currentScreenCounter. Value of property currentScreenCounter.



getDeleteListeners
protected Collection getDeleteListeners()(Code)
Returns a Collection of IDeleteListener objects. a Collection of IDeleteListener objects.



getHeaderDto
protected HeaderDto getHeaderDto()(Code)
Returns the HeaderDto. This can be used for passing the header info to the Tx, where required. the HeaderDto.



getMode
public int getMode()(Code)
Getter for property mode. Value of property mode.



getScreens
public MaintComponent2.Screen[] getScreens()(Code)
Getter for the Screens. the screens.



getUpdateListeners
protected Collection getUpdateListeners()(Code)
Returns a Collection of IUpdateListener objects. a Collection of IUpdateListener objects.



initDropDownCodes
protected void initDropDownCodes() throws ApplicationExceptions, FrameworkException(Code)
The Component should override this method to retrieve the set of codes for dropdowns in a screen, if any are required.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



initializeData
protected void initializeData() throws ApplicationExceptions, FrameworkException(Code)
This method is invoked by the display() method when the component is run in the CREATE_MODE. It sets the default values in the component by reading them from the ComponentDefaultValues.properties file. This file should be in the base package of the component.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



invokeCreateListeners
protected void invokeCreateListeners()(Code)
Invokes the createDone() method of the registered ICreateListener objects in the same thread.



invokeCreateListeners
protected void invokeCreateListeners(EventObject eventObject)(Code)
Invokes the createDone() method of the registered ICreateListener objects in the same thread.
Parameters:
  eventObject - The EventObject which will probably contain the component itself.



invokeDeleteListeners
protected void invokeDeleteListeners()(Code)
Invokes the deleteDone() method of the registered IDeleteListener objects in the same thread.



invokeDeleteListeners
protected void invokeDeleteListeners(EventObject eventObject)(Code)
Invokes the deleteDone() method of the registered IDeleteListener objects in the same thread.
Parameters:
  eventObject - The EventObject which will probably contain the component itself.



invokeUpdateListeners
protected void invokeUpdateListeners()(Code)
Invokes the updateDone() method of the registered IUpdateListener objects in the same thread.



invokeUpdateListeners
protected void invokeUpdateListeners(EventObject eventObject)(Code)
Invokes the updateDone() method of the registered IUpdateListener objects in the same thread.
Parameters:
  eventObject - The EventObject which will probably contain the component itself.



isCreateMode
public boolean isCreateMode()(Code)
Returns true if this is create mode. true if this is create mode.



isDeleteMode
public boolean isDeleteMode()(Code)
Returns true if this is delete mode. true if this is delete mode.



isDisplayOnlyField
public boolean isDisplayOnlyField(String fieldName)(Code)
Returns a true if a field has been marked as 'DisplayOnly'.
Parameters:
  fieldName - The field to be checked. a true if a field has been marked as 'DisplayOnly'



isRefreshData
public boolean isRefreshData()(Code)
Getter for property refreshData. Value of property refreshData.



isUpdateMode
public boolean isUpdateMode()(Code)
Returns true if this is update mode. true if this is update mode.



prevalidateCreate
public void prevalidateCreate() throws ApplicationExceptions, FrameworkException(Code)
This will invoke the doPrevalidateCreate() method to perform prevalidations before creating a domain object.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



prevalidateUpdate
public void prevalidateUpdate(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException(Code)
This will invoke the doPrevalidateUpdate() method to perform prevalidations before updating a domain object.
Parameters:
  performDirtyReadCheck - this will determine if the Dirty Read check if to be performed prior to an update.
throws:
  ApplicationExceptions - This will be thrown in case any invalid data has been set.
throws:
  FrameworkException - Indicates some system error.



quit
public void quit()(Code)
This clears the internal collection of listeners. It then invokes the quit() method of the base class.



removeCreateListener
public boolean removeCreateListener(ICreateListener listener)(Code)
Removes a listener.
Parameters:
  listener - the listener. true if the listener was removed.



removeDeleteListener
public boolean removeDeleteListener(IDeleteListener listener)(Code)
Removes a listener.
Parameters:
  listener - the listener. true if the listener was removed.



removeUpdateListener
public boolean removeUpdateListener(IUpdateListener listener)(Code)
Removes a listener.
Parameters:
  listener - the listener. true if the listener was removed.



retrieve
public void retrieve() throws ApplicationExceptions, FrameworkException(Code)
This will invoke the doRetrieve() method to retrieve the domain object.
throws:
  ApplicationExceptions - Indicates some functional error.
throws:
  FrameworkException - Indicates some system error.



setCurrentScreenCounter
public void setCurrentScreenCounter(int currentScreenCounter)(Code)
Setter for property currentScreenCounter.
Parameters:
  currentScreenCounter - New value of property currentScreenCounter.



setMode
public void setMode(int mode)(Code)
Setter for property mode.
Parameters:
  mode - New value of property mode.



setRefreshData
protected void setRefreshData(boolean refreshData)(Code)
Setter for property refreshData.
Parameters:
  refreshData - New value of property refreshData.



uncacheWidgetModels
protected void uncacheWidgetModels()(Code)
Clears the WidgetCache, removing all the WidgetModels. It also resets the flags.



update
public void update(boolean performDirtyReadCheck) throws ApplicationExceptions, FrameworkException(Code)
This will invoke the doUpdate() method to update the domain object. It will then invoke all the Update Listeners.
Parameters:
  performDirtyReadCheck - this will determine if the Dirty Read check if to be performed prior to an update.
throws:
  ApplicationExceptions - Indicates some functional error.
throws:
  FrameworkException - Indicates some system error.



Methods inherited from org.jaffa.presentation.portlet.component.Component
public void addChildComponent(Component component)(Code)(Java Doc)
public void addFormKeyChangeListener(FormKeyChangeListener listener)(Code)(Java Doc)
abstract public FormKey display() throws FrameworkException, ApplicationExceptions(Code)(Java Doc)
public ComponentDefinition getComponentDefinition()(Code)(Java Doc)
public String getComponentId()(Code)(Java Doc)
public FormKey getContainerFormKey()(Code)(Java Doc)
public FormKeyChangeListener[] getFormKeyChangeListeners()(Code)(Java Doc)
public FormKey getReturnToFormKey()(Code)(Java Doc)
public String getToken()(Code)(Java Doc)
public UserSession getUserSession()(Code)(Java Doc)
public boolean isActive()(Code)(Java Doc)
public void quit()(Code)(Java Doc)
public FormKey quitAndReturnToCallingScreen()(Code)(Java Doc)
public void reflectAndSetParms(HttpServletRequest request)(Code)(Java Doc)
public void removeFormKeyChangeListener(FormKeyChangeListener listener)(Code)(Java Doc)
public Collection returnChildComponents()(Code)(Java Doc)
public DateTime returnLastActivityDate()(Code)(Java Doc)
public Component run(String component)(Code)(Java Doc)
public void setContainerFormKey(FormKey containerFormKey)(Code)(Java Doc)
public void setReturnToFormKey(FormKey returnToFormKey)(Code)(Java Doc)
public void setToken(String token)(Code)(Java Doc)
public void updateLastActivityDate()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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