Java Doc for AikpAction.java in  » Content-Management-System » TransferCM » com » methodhead » aikp » 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 » TransferCM » com.methodhead.aikp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.methodhead.auth.AuthAction
   com.methodhead.aikp.AikpAction

All known Subclasses:   com.methodhead.reg.UserAction,  com.methodhead.shim.HtmlFragmentAction,  com.methodhead.sitecontext.SiteContextAction,
AikpAction
abstract public class AikpAction extends AuthAction (Code)

An Struts action with which to build a web interface for com.methodhead.aikp.AutoIntKeyPersistableAutoIntKeyPersistable s. This action will perform the following operations: new, edit, save, and delete. Methods for these operations and a number of support methods can be overloaded to achieve more sophisticated behaviour.

Using this action requires at least this Struts configuration:

<form-bean name ="yourObjectForm" dynamic="true" type ="com.methodhead.aikp.AikpForm"> <form-property name="action" type="java.lang.String"/> <form-property name="id" type="java.lang.String"/> <form-property name="submit" type="java.lang.String"/> <form-property name="cancel" type="java.lang.String"/> <form-property name="delete" type="java.lang.String"/> <form-property name="list" type="java.util.List"/> <!-- - properties for your object's field... --> </form-bean> <action-mappings> <action path ="/yourObject" type ="com.methodhead.aikp.AikpAction" parameter="com.your.Policy" name ="yourObjectForm" scope ="request" input ="/yourObject.jsp" validate ="true"> <forward name="list" path="/yourObjectList.jsp"/> </action> </action-mappings>

In addition, the following message resources should be defined:

aikpaction.confirm=Delete {0}? aikpaction.deleted=Deleted {0}. aikpaction.saved=Saved {0}.

What operation is performed depends on the action parameter (and sometimes the submit parameter). A minimal form looks like:

<%@ page import="com.methodhead.aikp.AikpForm"%> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:errors/> <html:form action="/yourObject"> <html:hidden property="id"/> <html:hidden property="action"/> <!-- - inputs for your object... --> <input type="submit" name="submit" value="Submit"></input> <% if ( !form.get( "action" ).equals( "saveNew" ) ) { %> <input type="submit" name="submit" value="Delete"></input> <% } %> </html:form>

A minimal list form looks like:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <logic:iterate name="yourObjectForm" property="list" id="yourObject" type="com.your.Object"> <a href="yourObject.do-action=edit&id=--= yourObject.get( "id" ) %>"><%= yourObject.get( "yourField" ) %></a><br> </logic:iterate>


Field Summary
 Loggerlogger_
    


Method Summary
abstract protected  AutoIntKeyPersistablecreatePersistable(OperationContext op)
     Returns a new instance of the persistable to be managed by this action.
protected  ActionForwarddoCancel(OperationContext op, Object policy)
     Like doEdit(), doCancel() loads the persistable using the form's id property, populates the form, adds the aikpaction.cancelled message to the action, and returns a forward to input.
protected  ActionForwarddoCancelDelete(OperationContext op, Object policy)
     Like doEdit(), doCancelDelete() loads the persistable using the form's id property, populates the form, adds the aikpaction.cancelled message to the action, and returns a forward to input.
protected  ActionForwarddoCancelSave(OperationContext op, Object policy)
     Like doEdit(), doCancelSave() loads the persistable using the form's id property, populates the form, adds the aikpaction.cancelled message to the action, and returns a forward to input.
protected  ActionForwarddoCancelSaveNew(OperationContext op, Object policy)
    
protected  ActionForwarddoConfirm(OperationContext op, Object policy)
    

Called when an persistable is to be deleted, adds the aikpaction.confirm to the action's messages (accessible by the Struts html:messages tag) and returns a forward to confirm.

protected  ActionForwarddoDelete(OperationContext op, Object policy)
    

Loads the persistable using the form's id property, and invokes its delete() method; a the status forward is returned.

The aikpaction.deleted message is added to the action's messages (accessible by the Struts html:messages tag).

protected  ActionForwarddoEdit(OperationContext op, Object policy)
     Loads the persistable using the form's id property and uses its field values to initialize the form; a forward to input is returned.
public  ActionForwarddoExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
     Executes the action, calling the appropriate method (doNew(), doEdit(), etc.) according to the form's properties.
protected  ActionForwarddoList(OperationContext op, Object policy)
     Loads all elements from the database using AutoIntKeyPersistable.loadAll loadAll() and forwards to list.
protected  ActionForwarddoNew(OperationContext op, Object policy)
     Uses the persistable's default values to initialize the form; a forward to input is returned.
protected  ActionForwarddoSave(OperationContext op, Object policy)
     Loads the persistable using the form's id property, sets its fields, and calls its save() method.
protected  ActionForwarddoSaveNew(OperationContext op, Object policy)
     Creates the persistable, sets its fields and calls its saveNew() method.
protected  ActionForwardgetForwardForDelete(OperationContext op, Object policy)
     Returns the forward used when the persistable is deleted; by default, a the status forward is returned.
protected  ActionForwardgetForwardForSave(OperationContext op, Object policy)
     Returns the forward used when the persistable is saved; by default, a forward to input is returned.
protected  voidpopulateForm(DynaActionForm form, AutoIntKeyPersistable persistable)
     Populates the form with persistable's field values.
protected static  voidpopulateFormProperty(String name, DynaActionForm form, AutoIntKeyPersistable persistable)
     Populates the specified form property with the corresponding value from persistable using it's toString() method (unless it's a date, in which case it is formatted with DateFormat.getDateInstance( DateFormat.SHORT )).
protected  voidpopulatePersistable(AutoIntKeyPersistable persistable, DynaActionForm form)
     Populates the persistable's field values with form.
protected static  voidpopulatePersistableField(String name, AutoIntKeyPersistable persistable, DynaActionForm form)
     Populates the specified persistable property with the corresponding property from form, using com.methodhead.persistable.Persistable.setAsObjectPersistable.setAsObject() to set the value.

Field Detail
logger_
Logger logger_(Code)





Method Detail
createPersistable
abstract protected AutoIntKeyPersistable createPersistable(OperationContext op)(Code)
Returns a new instance of the persistable to be managed by this action.



doCancel
protected ActionForward doCancel(OperationContext op, Object policy)(Code)
Like doEdit(), doCancel() loads the persistable using the form's id property, populates the form, adds the aikpaction.cancelled message to the action, and returns a forward to input. AikpAction.doCancelDelete



doCancelDelete
protected ActionForward doCancelDelete(OperationContext op, Object policy)(Code)
Like doEdit(), doCancelDelete() loads the persistable using the form's id property, populates the form, adds the aikpaction.cancelled message to the action, and returns a forward to input.



doCancelSave
protected ActionForward doCancelSave(OperationContext op, Object policy)(Code)
Like doEdit(), doCancelSave() loads the persistable using the form's id property, populates the form, adds the aikpaction.cancelled message to the action, and returns a forward to input.



doCancelSaveNew
protected ActionForward doCancelSaveNew(OperationContext op, Object policy)(Code)
Simply calls doList()



doConfirm
protected ActionForward doConfirm(OperationContext op, Object policy)(Code)

Called when an persistable is to be deleted, adds the aikpaction.confirm to the action's messages (accessible by the Struts html:messages tag) and returns a forward to confirm. Note: The persistable itself is argument 0 to the message, so make sure its toString() method returns something reasonable if you include {0} in your message.




doDelete
protected ActionForward doDelete(OperationContext op, Object policy)(Code)

Loads the persistable using the form's id property, and invokes its delete() method; a the status forward is returned.

The aikpaction.deleted message is added to the action's messages (accessible by the Struts html:messages tag). Note: The persistable itself is argument 0 to the message, so make sure its toString() method returns something reasonable if you include {0} in your message.




doEdit
protected ActionForward doEdit(OperationContext op, Object policy)(Code)
Loads the persistable using the form's id property and uses its field values to initialize the form; a forward to input is returned.



doExecute
public ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)(Code)
Executes the action, calling the appropriate method (doNew(), doEdit(), etc.) according to the form's properties.



doList
protected ActionForward doList(OperationContext op, Object policy)(Code)
Loads all elements from the database using AutoIntKeyPersistable.loadAll loadAll() and forwards to list.



doNew
protected ActionForward doNew(OperationContext op, Object policy)(Code)
Uses the persistable's default values to initialize the form; a forward to input is returned.



doSave
protected ActionForward doSave(OperationContext op, Object policy)(Code)
Loads the persistable using the form's id property, sets its fields, and calls its save() method. The form is then repopulated with values from the saved persistable. The aikpaction.saved message is added to the action and a forward to input is returned.



doSaveNew
protected ActionForward doSaveNew(OperationContext op, Object policy)(Code)
Creates the persistable, sets its fields and calls its saveNew() method. The form is then repopulated with values from the saved persistable. The aikpaction.saved message is added to the action and a forward to input is returned.



getForwardForDelete
protected ActionForward getForwardForDelete(OperationContext op, Object policy)(Code)
Returns the forward used when the persistable is deleted; by default, a the status forward is returned.



getForwardForSave
protected ActionForward getForwardForSave(OperationContext op, Object policy)(Code)
Returns the forward used when the persistable is saved; by default, a forward to input is returned.



populateForm
protected void populateForm(DynaActionForm form, AutoIntKeyPersistable persistable)(Code)
Populates the form with persistable's field values. All form fields are expected to be of type String.



populateFormProperty
protected static void populateFormProperty(String name, DynaActionForm form, AutoIntKeyPersistable persistable)(Code)
Populates the specified form property with the corresponding value from persistable using it's toString() method (unless it's a date, in which case it is formatted with DateFormat.getDateInstance( DateFormat.SHORT )).



populatePersistable
protected void populatePersistable(AutoIntKeyPersistable persistable, DynaActionForm form)(Code)
Populates the persistable's field values with form. All form fields are expected to be of type String. Date fields are parsed using a DateFormat as returned by DateFormat.getDateTimeInstance().



populatePersistableField
protected static void populatePersistableField(String name, AutoIntKeyPersistable persistable, DynaActionForm form)(Code)
Populates the specified persistable property with the corresponding property from form, using com.methodhead.persistable.Persistable.setAsObjectPersistable.setAsObject() to set the value.



Methods inherited from com.methodhead.auth.AuthAction
abstract protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc)
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception(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.