PDA

View Full Version : Preparing for PR5



Keith Donald
Jul 21st, 2005, 12:56 PM
Erwin and I plan to cut PR5 tommorrow to stabilize before RC1 due to the issues reported in PR4.

Please give the latest CVS snapshots a good run through and report any issues to us. Please someone help test JDK 1.3. :-)

We've closed out as many JIRA issues as possible for now.

Keith

Thomas Dudziak
Jul 21st, 2005, 04:07 PM
When compiling from CVS ('ant clean dist'), I get two compile problems, both related to spring-binding:


compile.source:
[echo] compiling main sources
[javac] Compiling 106 source files to F:\workspace\spring-projects\spring-webflow\target\classes
[javac] F:\workspace\spring-projects\spring-webflow\src\java\org\springframework\webflow\suppo rt\convert\TextToViewDescriptorCreator.java:26: cannot find symbol
[javac] symbol : class CompositeStringExpression
[javac] location: package org.springframework.binding.expression.support
[javac] import org.springframework.binding.expression.support.Com positeStringExpression;
[javac] ^
[javac] F:\workspace\spring-projects\spring-webflow\src\java\org\springframework\webflow\suppo rt\convert\TextToViewDescriptorCreator.java:123: cannot find symbol
[javac] symbol : class CompositeStringExpression
[javac] location: class org.springframework.webflow.support.convert.TextTo ViewDescriptorCreator
[javac] return new RedirectViewDescriptorCreator((Expression)fromStri ngTo(CompositeStringExpression.class).execute(enco dedView));
[javac]
^
[javac] 2 errors

The problem seems to be that the spring-webflow build process uses the older spring-binding jar from the repository directory (which does not include the CompositeStringExpression class), rather than building it fresh.

Tom

Keith Donald
Jul 21st, 2005, 04:44 PM
You need to 'publish' the latest spring-binding build to the integration repository, at least until we update the webflow ivy.xml to depend on a version in the release repository.

To do this:
spring-binding\ant publish

Then go back to webflow and do a ant publish there and it should pull in the most recent integration build. You can check the ivy.xml in spring-webflow\target\dist\ivys... to see exactly which versions of each dependency were compiled against.

Keith

Thomas Dudziak
Jul 21st, 2005, 04:52 PM
Thanks, that did the trick. Will test now:-)

JimN
Jul 21st, 2005, 09:30 PM
I had a little trouble building, even as described. [In building "ant publish" within spring-binding, I got some error which I can no longer remember -- sorry. Thereafter even after doing "ant clean", when I do "ant publish" I get an error saying "Could not find file /../artifacts/lib/spring-binding-src.jar" (the path is correct but the file isn't there; there's a zip though). I eventually worked around this by copying spring-binding.jar to spring-webflow/lib/global and commenting out the dependency in ivy.xml.]

PR5 seems to work fine for me. Thanks for adding getFormErrors() back; could you please change the return type to Errors?

Thanks,
Jim

Thomas Dudziak
Jul 22nd, 2005, 02:43 AM
There are some things that I was struggling with (or still am). Unless I missed them in the smaples, perhaps you'd consider showing in the samples how to do them ?

- how to use request parameters in an action (not bound to the form), eg. when passing parameters via a link to the start of a flow or between actions

- how to initialize a form programatically (eg. in the SearchPhoneBookAction)

- how to use different form objects in the same flow, possibly in different scopes; eg. the typical "edit items" flow where the items are stored in a flowscope-form, and adding a new one or editing an existing one uses a requestcope-form

regards,
Tom

Keith Donald
Jul 22nd, 2005, 09:32 AM
- how to use request parameters in an action (not bound to the form), eg. when passing parameters via a link to the start of a flow or between actions




context.getSourceEvent().getParameter("foo");




- how to initialize a form programatically (eg. in the SearchPhoneBookAction)


Note sure what you mean here. Form setup is performed by setupForm of the FormAction--you shouldn't have to code standard form setup logic. Now, if you need to retrieve other data (to populate drop downs for example) on setup, you can do this:



<action-state id="setupForm">
<action bean="formAction" method="setupForm"/>
<action name="setupDropDowns" bean="formAction" method="setupDropDowns"/>
<transition on="setupDropDowns.success" to="displayForm"/>
</action-state>


... that obviously requires you to have a "setupDropDowns" action method defined in your 'formAction' subclass:



public Event setupDropDowns&#40;RequestContext context&#41; &#123;
context.getRequestScope&#40;&#41;.setAttribute&#40;"dropDownAData", dao.getDropDownAData&#40;&#41;&#41;;
return success&#40;&#41;;
&#125;


See the ActionState and FormAction JavaDocs for more info.



- how to use different form objects in the same flow, possibly in different scopes; eg. the typical "edit items" flow where the items are stored in a flowscope-form, and adding a new one or editing an existing one uses a requestcope-form


Use a different form action with a formObject with a different name. Refer to that form action from your flow definition just like would any other action.

We may consider adding a capability to FormAction to be parameterized by the states in which it is invoked in at some point so you could have one FormAction per app to handle all forms.

Keith[/quote]

Thomas Dudziak
Jul 22nd, 2005, 09:43 AM
Sorry, I should have made myself clearer. I just thought it would be useful if these (IMO rather basic things) are shown in the samples, so that other new users have an easier time getting started with webflow.

Regarding the setupForm stuff, it was not clear to me whether to redefine setupForm or create chain of execution.

Same for using different form objects, its not easily apparent that you can actually do this (none of the samples does this). And btw, I'm still struggling with this one, I seem to be getting the wrong form. But this may well be my mistake :-)

regards,
Tom

Keith Donald
Jul 22nd, 2005, 02:14 PM
I understand and agree.

Thomas - the problem with multiple form objects and struts is indeed a issue. I've got a test that reproduces it and will have a fix in shortly.

Keith

tortuga
Jul 25th, 2005, 02:46 PM
JimN Posted: Thu Jul 21, 2005 7:30 pm Post subject:
I had a little trouble building, even as described. [In building "ant publish" within spring-binding, I got some error which I can no longer remember -- sorry. Thereafter even after doing "ant clean", when I do "ant publish" I get an error saying "Could not find file /../artifacts/lib/spring-binding-src.jar" (the path is correct but the file isn't there; there's a zip though). I eventually worked around this by copying spring-binding.jar to spring-webflow/lib/global and commenting out the dependency in ivy.xml.]

Make sure you have Ivy > 1.1, as instructed in the building section for Web Flow (http://opensource.atlassian.com/confluence/spring/display/WEBFLOW/Home). The only release of Ivy > 1.1 currently is 20050712085510 available at http://jayasoft.org/latest/ivy/. This should fix your build problems.

Tom Hicks
Jul 25th, 2005, 08:30 PM
As you are cutting PR5 it would be nice to have the Javadoc for the API
again; it seems to have been omitted from PR4 (and I can't find
anywhere to download it on the website). Thanks.

JimN
Jul 25th, 2005, 08:34 PM
I found pr4 javadoc here: http://static.springframework.org/spring-webflow/docs/pr4/api/

klr8
Jul 26th, 2005, 02:56 AM
The JavaDoc was missing from the distribution archive. That was a 'bug' in the new build scripts, which we'll fix with PR5.

Erwin

JimN
Jul 27th, 2005, 04:26 PM
PR5 seems to work fine for me. Thanks for adding getFormErrors() back; could you please change the return type to Errors?


I notice getFormErrors() is declared to throw an Exception when it actually doesn't. Could this declaration be removed?

Keith Donald
Jul 28th, 2005, 12:29 AM
Well, it doesn't but it calls getFormObject which calls loadFormObject (potentially) which throws Exception. So as is it's neccessary...

Now is this the best thing is the question.

I'm up for suggestions. On one hand I like it that it'll try and load the form object and export a empty form errors if neccessary. On the other hand I don't like having the Exception.

Keith

Colin Yates
Jul 28th, 2005, 04:46 AM
I wouldn't expect loadForm to throw a checked exception.

I don't see how you can recover from exceptions thrown when loading a form. Sure runtime exceptions, but checked exceptions are implying that the exception can be thrown in an acceptable usecase. I don't get that.