[OFBiz] Users - how is the response identified

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[OFBiz] Users - how is the response identified

puranisank

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 



 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: how is the response identified

cjhowe
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 :
>
>
> &nbsp;
> \" &lt;request-map uri=\"finalizeOrder\"&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;security https=\"true\" auth=\"true\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;event
> type=\"java\"
> path=\"org.ofbiz.order.shoppingcart.CheckOutEvents\"
> invoke=\"finalizeOrderEntry\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"addparty\" type=\"view\"
> value=\"setAdditionalParty\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"customer\" type=\"view\"
> value=\"custsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"shipping\" type=\"view\"
> value=\"shipsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"options\" type=\"view\"
> value=\"optionsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"payment\" type=\"view\"
> value=\"billsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"term\" type=\"view\"
> value=\"orderTerm\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"sales\" type=\"request\"
> value=\"calcShipping\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"po\" type=\"view\"
> value=\"confirm\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &lt;response name=\"error\" type=\"request\"
> value=\"orderentry\"/&gt;
>
> &nbsp;&nbsp;&nbsp; &lt;/request-map&gt;\"
>
>
> Thanks and regards&nbsp;
>
> Purani&nbsp;

Reply | Threaded
Open this post in threaded view
|

Re: Users - how is the response identified

Souvik Saha Bhowmik
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 :
>
>
> &nbsp;
> \" &lt;request-map uri=\"finalizeOrder\"&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;security https=\"true\"
> auth=\"true\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;event type=\"java\"
> path=\"org.ofbiz.order.shoppingcart.CheckOutEvents\"
> invoke=\"finalizeOrderEntry\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"addparty\"
> type=\"view\" value=\"setAdditionalParty\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"customer\"
> type=\"view\" value=\"custsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"shipping\"
> type=\"view\" value=\"shipsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"options\"
> type=\"view\" value=\"optionsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"payment\"
> type=\"view\" value=\"billsetting\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"term\"
> type=\"view\" value=\"orderTerm\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"sales\"
> type=\"request\" value=\"calcShipping\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"po\"
> type=\"view\" value=\"confirm\"/&gt;
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;response name=\"error\"
> type=\"request\" value=\"orderentry\"/&gt;
>
> &nbsp;&nbsp;&nbsp; &lt;/request-map&gt;\"
>
>
> Thanks and regards&nbsp;
>
> Purani&nbsp;
>