Hi all,

Attached is a patch that contains a first cut at Page Flow support
within Struts Ti (sandbox).  It's basically Beehive Page Flow, minus
Struts 1.x, minus Servlet, plus XWork, plus some refactoring.  And minus
a bunch of functionality that I had to disable in the process.

There are three things here:
    1) The patch itself.  There are notes below about this.

    2) A sample app ("ti-example").  It's not integrated into the tree
at this point, but building/running should be easy:
       - 'maven war' in {ti root}/example, to get the right jars
for WEB-INF/lib.
- Copy {ti-root}/example/target/struts-ti-example/WEB-INF/lib/*.jar into
ti-example/WEB-INF/lib.
       - Deploy ti-example, and (if you're using Tomcat), hit
http://localhost:8080/ti-example/pageflow .

    3) Another sample app -- ported from Beehive -- to demonstrate JSF
integration in Struts Ti.  JSF is optional, but it's treated as a
first-class view tier.  JSF pages handle intra-page events, but raise
Page Flow actions for navigation.  The blurb at
http://beehive.apache.org/releases/v1.0m1/pageflow/jsf.html basically
applies here.  To build/run this, follow the steps for (2), and put
myfaces.jar (http://www.myfaces.org/) into WEB-INF/lib.  Then hit
http://localhost:8080/ti-jsf/ .

Note: I can't attach zip files here, so I've put the files at:
    1) http://www.cppdoc.com/ti-temp/struts-ti-pageflow-patch.zip
    2) http://www.cppdoc.com/ti-temp/ti-example.zip
    3) http://www.cppdoc.com/ti-temp/ti-jsf.zip

If you have trouble connecting, let me know and I'll send them to you.


---
Everything below this line is mainly interesting if you're
working/peeking on the Ti source code.

    - First, style.  I've given checkstyle a lot to complain about.  I
can work on fixing this (possibly with some discussion about a few of
the parameters) after this goes in -- I didn't want to wait any longer.
Apologies for the magnitude of angst I've caused.  :)

    - All of the Page Flow code uses PageFlowActionContext, which is an
ActionContext that puts everything context-related in one place.  It
doesn't use ControllerContext.  Of course, in the end there will be one
thing, but I didn't want to blow up ControllerContext at this point
before having a discussion about how to rationalize all the contexts
(ActionContext, WebContext, Ti Context).

    - I created a Chain for the View (kicked off by Servlet Filters).
This required splitting out some config code from StrutsTiServlet.

    - Controller action methods and exception handlers currently return
either Forward (a convenience for adding view-setup objects to the
request) or String (simple result lookup).  We can eliminate one or the
other if we decide that's ok.

    - Although most Servlet dependencies have been removed from Page
Flow code, there's still a lot of *path* dependence.  The former should
disappear entirely; the latter is something we'll need to discuss.
There's a Chain step -- PopulatePageFlowContext -- that sets up a bunch
of Servlet-like attributes on the context, and this may go away eventually.

    - *** There is currently no generation of XWork config files from
Page Flow classes/annotations.  All of the sample app config files
(/WEB-INF/src/_pageflow-config/**) are hand-coded.  Generation is a
well-known quantity, and I definitely expect the config file format to
change (especially after the XWork folks tell me how I've misused their
framework ;) ). ***

    - Logging.  There's a Logger wrapper used throughout Page Flow.
This will most likely just go away ASAP.

    - Controller classes still currently need to extend
PageFlowController.  This is a holdover from Beehive, but we'll change
it so that they can be POJOs.

    - Page Flow doesn't use XWork's ability to create a form bean.  The
Page Flow version of this (ChooseFormBean) is currently totally distinct
from everything that happens in CreateFormChain.  It's a very different
process -- the form bean type is retrieved from config, not through
reflection; the scopes are currently "request" or "page flow" (the
latter get/set from member data in the page flow); etc., etc.  I just
didn't want to mess up what's there, but obviously we'll need to
consolidate.

    - Page Flow has integration with Commons Validator (through
annotations), but this is not hooked up yet.  I know there's already
been work done in this area.

    - Shared Flow support isn't enabled yet, although it's close.

    - Page Flow isn't currently using the ActionMapper for creating
action URIs.

    - The JSF sample still has "beehive" in its package names.

     - There are three temporary XMLBeans-generated jars that are
required for building the code.  I don't currently have access to my
people.apache.org account, so I put them out on cppdoc.com -- see
/project.properties.  They can be moved anywhere else (~mrdon?).
Eventually these will go away.  If you have trouble connecting, let me
know and I'll send the jars.


Enjoy, and let me know what you think.

Thanks,
Rich


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to