Announcement Announcement Module
Collapse
No announcement yet.
Roo + Web Flow Example? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo + Web Flow Example?

    Hi, I am using Roo (v1.2.1.RELEASE) to generate entities using the web mvc all command and would like to implement a Web Flow. I was able to generate the web flow with the default skeleton but I'm not sure where to go from there. Is custom development required or is it possible to use the views generated by Roo in the Webflow (feels like the latter but not sure how)?

    How would you extend the Roo's Pet Clinic Sample to include a Registration flow? For example, how would you implement a flow to register a new Customer with 3 pets (petA,petB,petC) and schedules an appointment for petB?

    Is it possible for the flow to use views/owners/create.jspx, views/pets/create.jspx, views/visits/create.jspx?

    (Roo v1.2.1.RELEASE uses Web Flow 2.2.1.RELEASE by default)

    Thanks
    Last edited by springwithme; Feb 28th, 2012, 02:55 PM. Reason: formatting

  • #2
    Hi there,

    Please check out my post about my own experiences with SWF and Roo. Two disclaimers:
    • I wrote it some months before joining the Roo team, and
    • It's based on old-ish versions of Roo, Spring, and SWF.
    Still, it might be enough to answer your questions.

    Comment


    • #3
      now display PET fields in View; lost SWF Naviagtion

      hi - thank you for the link. i looked at it but i'm afraid i wasn't able to work through it with the different versions. i was able to get a roo generated page to render as the 1st page of the flow; however, realized it would not be practical to use the generated page as i'm looking to build a wizard to step thru saving an entity and then building out the references. i have the 1st page of the flow rendering with the PET object using the roo taglibs but now i broke the SWF which expect a form method = POST. Here's what I did and the create pet is now showing; however, the navigation to PROCEED to step 2 no longer works. How should you define the view when using
      Roo 1.2.1 with Spring Web Flow?
      1. in ROO ran: web flow --flowName registration
      2. registration/flox.xml modification: inserted:
        <on-start>
        <evaluate expression="new com.springsource.petclinic.domain.Pet()"
        result="flowScope.pet">
        </evaluate>
        </on-start>
      3. registration/view-state-1.jspx
        HTML Code:
        <!-- Added namespace: FN AND UTIL -->
        <!-- Changed form 
        from: <form method="POST"> 
        to: <form:create modelAttribute="pet" path="/registration" id="rc_com_springsource_petclinic_domain_Pet">
        -->
        
        <?xml version="1.0" encoding="UTF-8" standalone="no"?>
        <div xmlns:c="http://java.sun.com/jsp/jstl/core"
        	xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields"
        	xmlns:form="urn:jsptagdir:/WEB-INF/tags/form"
        	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        	xmlns:util="urn:jsptagdir:/WEB-INF/tags/util"
        	xmlns:jsp="http://java.sun.com/JSP/Page"
        	xmlns:spring="http://www.springframework.org/tags" version="2.0">
        	<jsp:directive.page contentType="text/html;charset=UTF-8" />
        	<jsp:output omit-xml-declaration="yes" />
        	<spring:message var="title" code="webflow_state1_title" htmlEscape="false" />
        	<util:panel id="title" title="${title}">
        		<h1>${fn:escapeXml(title)}</h1>
        		<p>
        			<spring:message code="webflow_state1_message" />
        		</p>
        		
        		<!-- mod from form method=post -->
        		<form:create modelAttribute="pet" path="/registration" id="rc_com_springsource_petclinic_domain_Pet">
        			<!-- mod for PET -->
        			<div> <field:input field="name" id="c_com_springsource_petclinic_domain_Pet_name" min="1"/> </div>
        
        			<div class="submit">
        				<spring:message var="cancel" code="button_cancel" htmlEscape="false" />
        				<spring:message var="proceed" code="button_proceed"
        					htmlEscape="false" />
        				<input type="submit" id="cancel" name="_eventId_cancel"
        					value="${fn:escapeXml(cancel)}" /> <input type="submit"
        					id="success" name="_eventId_success"
        					value="${fn:escapeXml(proceed)}" />
        			</div>
        		<!-- mod from form  -->
        		</form:create>
        	</util:panel>
        </div>

      Comment

      Working...
      X