You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by de...@tcs.com on 2012/05/09 05:39:41 UTC
Re: Send Request and Response to an existing event
Hi,
Enlisted are some options below. Perhaps, I am not able to get the
bigscene, but here is my take. (Could you elaborate the scenario?)
Upon triggering the call, I hit the controller and there I can cascade the
request based on the response.
Request cascaded over from one event to another. (Events may be
simple/minilang or java or ajax)
Within controller.xml - Single pass
<request-map uri="createcustomer">
<security https="true" auth="true" />
<event type="simple"
path=
"component://ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml"
invoke="createCustomer" />
<response name="success" type="view" value="main" />
<response name="error" type="view" value="newcustomer" />
</request-map>
Within controller.xml - Multiple pass
The response statements can be cascaded to another request map.
<request-map uri="processCustomerSettings">
<security https="true" auth="false"/>
<event type="simple" path="component://..../XYZ.xml" invoke=
"processCustomerSettings"/>
<response name="success" type="request" value=
"createUpdateShippingAddressCheckout"/>
<response name="error" type="view" value="OnePageCheckout"/>
</request-map>
<request-map uri="createUpdateShippingAddressCheckout">
<security https="true" auth="false" />
<event type="simple"
path="component://..../CustomerEvents.xml"
invoke="createUpdateCustomerAndShippingAddress" />
<response name="success" type="request" value=
"setShippingOption" />
<response name="error" type="view" value="OnePageCheckout"
/>
</request-map>
Passing request method from within simple method to another.
<call-bsh><![CDATA[
java.util.ArrayList userMessagePices = new
java.util.ArrayList();
String userFname = (String)
personContext.get("firstName");
.....
XYZ.SmsServicesRegistration.smsServices(request, response,
userMessagePices, phoneNo.toString());
]]></call-bsh>
</simple-method>
Thanks,
Dev
From:
Bhargav.Trivedi@objectedge.com
To:
dev@ofbiz.apache.org, user@ofbiz.apache.org
Date:
05/09/2012 04:06 AM
Subject:
Send Request and Response to an existing event
Hi,
I want to pass the request and response to a simple method (
createCustomer) of an existing event (CustomerEvent.xml).
I am calling this event as a part of a service which is defined in my
services.xml file by using the "dispatcher.runsync " .
Could someone please let me know if this is doable and if so then how?
Bhargav
Software Engineer
Object Edge Inc.
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
Re: Send Request and Response to an existing event
Posted by Atul Vani <at...@hotwaxmedia.com>.
You can add request and response abjects as IN parameters to the
service. Though you should rethink to avoid such thing.
Thanks& Regards
Atul Vani
Enterprise Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/
We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.
On 05/09/2012 09:09 AM, deb.panda@tcs.com wrote:
> Hi,
>
> Enlisted are some options below. Perhaps, I am not able to get the
> bigscene, but here is my take. (Could you elaborate the scenario?)
> Upon triggering the call, I hit the controller and there I can cascade the
> request based on the response.
>
> Request cascaded over from one event to another. (Events may be
> simple/minilang or java or ajax)
> Within controller.xml - Single pass
> <request-map uri="createcustomer">
> <security https="true" auth="true" />
> <event type="simple"
> path=
> "component://ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml"
> invoke="createCustomer" />
> <response name="success" type="view" value="main" />
> <response name="error" type="view" value="newcustomer" />
> </request-map>
>
> Within controller.xml - Multiple pass
> The response statements can be cascaded to another request map.
>
> <request-map uri="processCustomerSettings">
> <security https="true" auth="false"/>
> <event type="simple" path="component://..../XYZ.xml" invoke=
> "processCustomerSettings"/>
> <response name="success" type="request" value=
> "createUpdateShippingAddressCheckout"/>
> <response name="error" type="view" value="OnePageCheckout"/>
> </request-map>
> <request-map uri="createUpdateShippingAddressCheckout">
> <security https="true" auth="false" />
> <event type="simple"
> path="component://..../CustomerEvents.xml"
> invoke="createUpdateCustomerAndShippingAddress" />
> <response name="success" type="request" value=
> "setShippingOption" />
> <response name="error" type="view" value="OnePageCheckout"
> />
> </request-map>
>
> Passing request method from within simple method to another.
> <call-bsh><![CDATA[
> java.util.ArrayList userMessagePices = new
> java.util.ArrayList();
> String userFname = (String)
> personContext.get("firstName");
> .....
> XYZ.SmsServicesRegistration.smsServices(request, response,
> userMessagePices, phoneNo.toString());
>
> ]]></call-bsh>
> </simple-method>
>
> Thanks,
> Dev
>
>
>
> From:
> Bhargav.Trivedi@objectedge.com
> To:
> dev@ofbiz.apache.org, user@ofbiz.apache.org
> Date:
> 05/09/2012 04:06 AM
> Subject:
> Send Request and Response to an existing event
>
>
>
> Hi,
> I want to pass the request and response to a simple method (
> createCustomer) of an existing event (CustomerEvent.xml).
>
> I am calling this event as a part of a service which is defined in my
> services.xml file by using the "dispatcher.runsync " .
>
> Could someone please let me know if this is doable and if so then how?
>
> Bhargav
> Software Engineer
> Object Edge Inc.
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>