ivelin 2002/09/08 05:20:29 Modified: src/java/org/apache/cocoon/samples/xmlform UserBean.java WizardAction.java Log: XMLForm: Added support for itemset tag http://www.w3.org/TR/xforms/slice9.html#ui-common-elements-itemset Revision Changes Path 1.3 +20 -0 xml-cocoon2/src/java/org/apache/cocoon/samples/xmlform/UserBean.java Index: UserBean.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/samples/xmlform/UserBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- UserBean.java 2 Jun 2002 03:33:35 -0000 1.2 +++ UserBean.java 8 Sep 2002 12:20:28 -0000 1.3 @@ -2,6 +2,8 @@ import java.util.Set; import java.util.HashSet; +import java.util.Map; +import java.util.HashMap; import java.util.List; import java.util.ArrayList; @@ -32,6 +34,7 @@ private List favorites = new ArrayList(); private List roles = new ArrayList(); private String hobbies[]; + private HashMap allHobbies; private boolean hidden = false; @@ -208,6 +211,11 @@ { hobbies = newHobbies; } + + public Set getAllHobbies() + { + return allHobbies.entrySet(); + } public List getFavorite() { @@ -228,6 +236,18 @@ public void initHobbies() { hobbies = new String[] {"swim", "movies", "ski", "gym", "soccer"}; + + // initialize the reference list of all hobbies + allHobbies = new HashMap(); + allHobbies.put( "swim", "Swimming" ); + allHobbies.put( "gym", "Body Building" ); + allHobbies.put( "ski", "Skiing" ); + allHobbies.put( "run", "Running" ); + allHobbies.put( "football", "Football" ); + allHobbies.put( "read", "Reading" ); + allHobbies.put( "write", "Writing" ); + allHobbies.put( "soccer", "Soccer" ); + allHobbies.put( "blog", "Blogging" ); } 1.7 +11 -7 xml-cocoon2/src/java/org/apache/cocoon/samples/xmlform/WizardAction.java Index: WizardAction.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/samples/xmlform/WizardAction.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WizardAction.java 28 Jul 2002 14:03:52 -0000 1.6 +++ WizardAction.java 8 Sep 2002 12:20:28 -0000 1.7 @@ -150,6 +150,10 @@ /** * Invoked after form population + * + * Responsible for implementing the state machine + * of the flow control processing + * a single form page or a form wizard. * * Semanticly similar to Struts Action.perform() * @@ -164,7 +168,7 @@ UserBean jBean = (UserBean) getForm().getModel(); jBean.incrementCount(); - // set the page control flow parameter + // set the page flow control parameter // according to the validation result if ( getCommand().equals( CMD_NEXT ) && getForm().getViolations () != null ) @@ -175,7 +179,7 @@ else { // validation passed - // continue with control flow + // continue with flow control // clear validation left overs in case the user // did not press the Next button @@ -186,7 +190,7 @@ // get the form view which was submitted String formView = getFormView(); - // apply control flow rules + // apply state machine (flow control) rules if ( formView.equals ( VIEW_USERID ) ) { if ( command.equals( CMD_NEXT ) ) @@ -290,7 +294,7 @@ */ public boolean filterRequestParameter (Form form, String parameterName) { - // TBD + // in this example we do not expect "custom" parameters return false; }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]