How is the response identified by the request handler when one request-map contains several view responses?
" <request-map uri="finalizeOrder"> <security https="true" auth="true"/> <event type="java" path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="finalizeOrderEntry"/> <response name="addparty" type="view" value="setAdditionalParty"/> <response name="customer" type="view" value="custsetting"/> <response name="shipping" type="view" value="shipsetting"/> <response name="options" type="view" value="optionsetting"/> <response name="payment" type="view" value="billsetting"/> <response name="term" type="view" value="orderTerm"/> <response name="sales" type="request" value="calcShipping"/> <response name="po" type="view" value="confirm"/> <response name="error" type="request" value="orderentry"/> </request-map>"
Purani _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
A java method returns what ever type of data is
declared in the method declaration (public static String - for instance). When it's a type String the method by default returns "success" upon completion. However, you can have it return whatever string you wish by having at any breakpoint return "yourStringHere". In the java method CheckoutEvents.finalizeOrderEntry that is being called by the request "finalizeOrder", there are several breakpoints that if reached will return the string specified. In CheckoutEvents.java, the following are returned at different breakpoints line 655: "customer" line 765: "error" line 779: "error" line 796: "error" line 835: "customer" line 839: "shipping" line 843: "options" line 847: "term" line 850: "payment" line 854: "addparty" line 858: "paysplit" line 864: variable checkoutGoTo line 868: "sales" line 870: "po" which ever one gets hit first is what will be returned to the request. If one of those matches a response name it will do what that response says (run another request, go to a view, etc) --- [hidden email] wrote: > How is the response identified by the request > handler when one request-map contains several view > responses?Example : > > > > \" <request-map uri=\"finalizeOrder\"> > > > <security https=\"true\" auth=\"true\"/> > > <event > type=\"java\" > path=\"org.ofbiz.order.shoppingcart.CheckOutEvents\" > invoke=\"finalizeOrderEntry\"/> > > > <response name=\"addparty\" type=\"view\" > value=\"setAdditionalParty\"/> > > > <response name=\"customer\" type=\"view\" > value=\"custsetting\"/> > > > <response name=\"shipping\" type=\"view\" > value=\"shipsetting\"/> > > > <response name=\"options\" type=\"view\" > value=\"optionsetting\"/> > > > <response name=\"payment\" type=\"view\" > value=\"billsetting\"/> > > > <response name=\"term\" type=\"view\" > value=\"orderTerm\"/> > > > <response name=\"sales\" type=\"request\" > value=\"calcShipping\"/> > > > <response name=\"po\" type=\"view\" > value=\"confirm\"/> > > > <response name=\"error\" type=\"request\" > value=\"orderentry\"/> > > </request-map>\" > > > Thanks and regards > > Purani |
In reply to this post by puranisank
I am not sure whether this is informative or not. As far as I have
seen , in case of events the return string is read by controller as response. In case of service the value of key "responseMessage" in the return Map is read as the response by the controller. So you need to manipulate your code to give desired response. Souvik On 30 Jun 2006 03:04:35 -0000, [hidden email] <[hidden email]> wrote: > How is the response identified by the request handler when one request-map > contains several view responses?Example : > > > > \" <request-map uri=\"finalizeOrder\"> > > <security https=\"true\" > auth=\"true\"/> > > <event type=\"java\" > path=\"org.ofbiz.order.shoppingcart.CheckOutEvents\" > invoke=\"finalizeOrderEntry\"/> > > <response name=\"addparty\" > type=\"view\" value=\"setAdditionalParty\"/> > > <response name=\"customer\" > type=\"view\" value=\"custsetting\"/> > > <response name=\"shipping\" > type=\"view\" value=\"shipsetting\"/> > > <response name=\"options\" > type=\"view\" value=\"optionsetting\"/> > > <response name=\"payment\" > type=\"view\" value=\"billsetting\"/> > > <response name=\"term\" > type=\"view\" value=\"orderTerm\"/> > > <response name=\"sales\" > type=\"request\" value=\"calcShipping\"/> > > <response name=\"po\" > type=\"view\" value=\"confirm\"/> > > <response name=\"error\" > type=\"request\" value=\"orderentry\"/> > > </request-map>\" > > > Thanks and regards > > Purani > |
Free forum by Nabble | Edit this page |