jvanzyl 01/05/14 11:56:18
Modified: xdocs/howto torque-howto.xml
xdocs/stylesheets project.xml
Added: xdocs/howto action-event-howto.xml
Log:
- moving action event xdoc into the howto directory.
Revision Changes Path
1.2 +11 -11 jakarta-turbine/xdocs/howto/torque-howto.xml
Index: torque-howto.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine/xdocs/howto/torque-howto.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- torque-howto.xml 2001/05/13 04:21:31 1.1
+++ torque-howto.xml 2001/05/14 18:56:01 1.2
@@ -14,7 +14,7 @@
Turbine</a> that generates all the database resources required by your web
application. Torque uses a single XML database schema to generate the SQL for
your target database, Turbine's Peer-based object relation model representing
-your XML database schema, and a HTML document describing the database. The
+your XML database schema, and an HTML document describing the database. The
HTML document is obviously not required by Turbine, but helps in describing
your web app to other developers.
</p>
@@ -38,17 +38,17 @@
<source><![CDATA[
torque/
- config/ <--- Torque configuration properties.
- lib/ <-- Jar files required by Torque (stand-alone version)
- dtd/ <--- DTD for Torque XML database descriptors.
- schema/ <--- Project specific XML database descriptor.
- templates/ <--- Velocity templates used for source generation.
- xsl/ <--- XSLT stylesheets use for HTML generation.
- output/ <--- Target location for output (stand-alone version).
+ lib/ <-- Jar files required by Torque (stand-alone version)
+ dtd/ <--- DTD for Torque XML database descriptors.
+ schema/ <--- Project specific XML database descriptor.
+ templates/ <--- Velocity templates used for source generation.
+ xsl/ <--- XSLT stylesheets use for HTML generation.
+ output/ <--- Target location for output (stand-alone version).
- torque.xml <--- Ant build file that controls Torque.
- torque.sh <--- Unix script to start up Ant.
- torque.bat <--- DOS bat file to start up Ant.
+ build.xml <--- Ant build file that controls Torque.
+ build.sh <--- Unix script to start up Ant.
+ build.bat <--- DOS bat file to start up Ant.
+ build.properties <--- Properties file that controls Torque behaviour.
]]></source>
1.1 jakarta-turbine/xdocs/howto/action-event-howto.xml
Index: action-event-howto.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Action Events Howto</title>
<author email="[EMAIL PROTECTED]">Jon S. Stevens</author>
</properties>
<body>
<section name="Action Events">
<p>
Turbine has a very useful feature that makes handling form submission
much more painless for the developer. In order to understand this, you
need to be familiar with the way that Turbine handles Actions. What happens
is that when a URI has the action= variable defined, a class is executed
before all of your other Screen classes by your Page class. So, consider
the following URI (I'm using the <a href="velocity-site-howto.html">
VelocitySite Howto
</a> example):
</p>
<p>
http://www.server.com/servlet/Turbine/template/AddUser/action/NewUser
What happens is that Turbine will first execute the Java class file Action
named NewUser. Then, any class that extends the ActionEvent class instead
of the Action class will be able to take advantage of what happens next...
</p>
<source test=""><![CDATA[
public class NewUser extends VelocityAction
{
public void doAdd (RunData data, Context context) throws Exception
{
// put code here to add the user to the system
context.put ("username", username );
data.setMessage("User Added!");
}
public void doPerform(RunData data, Context context) throws Exception
{
data.setMessage("Button not found!");
}
}
]]></source>
<p>
Then, write your HTML tags specially like this:
</p>
<source test=""><![CDATA[
<input type="submit" name="eventSubmit_doAdd" value="Add User">
]]></source>
<p>
When your Action is executed, an "event" is sent to it by attempting
to execute a "doAdd()" method in your Action. The cool thing about this
is that each of your "actions" that are performed within your Action class
now are componentized into a single method that can be javadoc'ed individually.
</p>
<p>
This new functionality does not mean that you should write all of your
actions in one single class, what it means is that if you have a screen
with many buttons on it that are very specific to that screen, it might
be a good idea to place all those methods into a single class. This allows
you to do it easily and also prevents you from having to do a "if then
elseif" tree to figure out which button was clicked.
</p>
<p>
For a catchall, the doPerform() method will be executed if no other
method or button could be found.
</p>
<p>
Because ParameterParser makes all the key values lowercase, we have
to do some work to format the string into a method name. For example, a
button name eventSubmit_doDelete gets converted into eventsubmit_dodelete.
Thus, we need to form some sort of naming convention so that dodelete can
be turned into doDelete.
</p>
<p>
Thus, the convention is this:
<ul>
<li>
The variable name MUST have the prefix "eventSubmit_".</li>
<li>
The variable name after the prefix MUST begin with the letters "do".</li>
<li>
The first letter after the "do" will be capitalized and the rest will be
lowercase</li>
</ul>
</p>
<p>
If you follow these conventions, then you should be ok with your method
naming in your Action class.
</p>
</section>
</body>
</document>
1.29 +9 -9 jakarta-turbine/xdocs/stylesheets/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine/xdocs/stylesheets/project.xml,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- project.xml 2001/05/13 22:25:34 1.28
+++ project.xml 2001/05/14 18:56:12 1.29
@@ -26,7 +26,6 @@
<menu name="Documentation">
<item name="Turbine Documentation"
href="/turbine-documentation-project.html"/>
- <item name="Action Events" href="/action-event.html"/>
<item name="Core Schema" href="/turbine-schema.html"/>
<item name="DB Adapters" href="/db-adapters.html"/>
<item name="J2EE Integration" href="/j2ee-integration.html"/>
@@ -37,20 +36,21 @@
</menu>
<menu name="Howto Guides">
- <item name="Peers Howto" href="/howto/peers-howto.html"/>
+ <item name="Action Events Howto" href="/howto/action-event-howto.html"/>
<item name="Criteria Howto" href="/howto/criteria-howto.html"/>
- <item name="Torque Howto" href="/howto/torque-howto.html"/>
- <item name="Postgres Howto" href="/howto/postgres-howto.html"/>
+ <item name="JBoss Howto" href="/howto/jboss-howto.html"/>
+ <item name="JSP Howto" href="/howto/jsp-howto.html"/>
<item name="Oracle 8i Howto" href="/howto/oracle-howto.html"/>
- <item name="Sybase Howto" href="/howto/sybase-howto.html"/>
+ <item name="Peers Howto" href="/howto/peers-howto.html"/>
+ <item name="Postgres Howto" href="/howto/postgres-howto.html"/>
<item name="Python Howto" href="/howto/python-howto.html"/>
- <item name="JSP Howto" href="/howto/jsp-howto.html"/>
+ <item name="Security Howto" href="/howto/security-howto.html"/>
+ <item name="Sybase Howto" href="/howto/sybase-howto.html"/>
+ <item name="TDK Howto" href="/howto/tdk-howto.html"/>
+ <item name="Torque Howto" href="/howto/torque-howto.html"/>
<item name="Velocity Site Howto" href="/howto/velocity-site-howto.html"/>
<item name="Velocity Context Howto" href="/howto/context-howto.html"/>
<item name="Webmacro Site Howto" href="/howto/webmacro-site-howto.html"/>
- <item name="Security Howto" href="/howto/security-howto.html"/>
- <item name="JBoss Howto" href="/howto/jboss-howto.html"/>
- <item name="TDK Howto" href="/howto/tdk-howto.html"/>
</menu>
<menu name="Development">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]