Hi Team,
I am planning to integrate OFBiz eCommerce module with android native app. OFBiz deals with HTTP request/response format but i want in JSON. Is there any easy way out to achieve the target? Or any suggested approach (if JSON not possible) to implement with android app? Regards Abhishek |
Hi Abhishek,
there is a JSON response handler available in OFBiz, see common-controller.xml: <request-map uri="json"> <security direct-request="false"/> <event type="java" path="org.apache.ofbiz.common.CommonEvents" invoke="jsonResponseFromRequestAttributes"/> <response name="success" type="none"/> </request-map> You can find some examples how it's used in the request-controller searching for value="json" in the controller.xml files. It's also used in the ecommerce plugin. Hope that helps, regards, Michael Michael Brohl Geschäftsführer Fon +49 521 448 157-91 Fax +49 521 448 157-99 Mobil +49 160 3664918 Xing www.xing.com/profile/Michael_Brohl Company and Management Headquarters: ecomify GmbH, Meisenstraße 65, 33607 Bielefeld, Deutschland Fon: +49 521 448157-90, Fax: +49 521 448157-99, www.ecomify.de Court Registration: Amtsgericht Bielefeld HRB 41683 Chief Executive Officer: Martin Becker, Michael Brohl Am 11.06.17 um 06:24 schrieb Abhishek Sharma: > Hi Team, > > I am planning to integrate OFBiz eCommerce module with android native app. > OFBiz deals with HTTP request/response format but i want in JSON. Is there > any easy way out to achieve the target? Or any suggested approach (if JSON > not possible) to implement with android app? > > > Regards > Abhishek > smime.p7s (5K) Download Attachment |
Thanks Michael for replying on this thread. What about the requests which
are served using Groovy? For example, the request " https://localhost:8443/ecommerce/control/main" is served by groovy and ftl to display the main page. How should i modify it to display the output in android native app? Kindly suggest. Regards Abhishek On Sun, Jun 11, 2017 at 2:43 PM, Michael Brohl <[hidden email]> wrote: > Hi Abhishek, > > there is a JSON response handler available in OFBiz, see > common-controller.xml: > > <request-map uri="json"> > <security direct-request="false"/> > <event type="java" path="org.apache.ofbiz.common.CommonEvents" > invoke="jsonResponseFromRequestAttributes"/> > <response name="success" type="none"/> > </request-map> > > You can find some examples how it's used in the request-controller > searching for > > value="json" > > in the controller.xml files. > > It's also used in the ecommerce plugin. > > Hope that helps, > > regards, > > Michael > > > Michael Brohl > Geschäftsführer > > Fon +49 521 448 157-91 > Fax +49 521 448 157-99 > Mobil +49 160 3664918 > Xing www.xing.com/profile/Michael_Brohl > > Company and Management Headquarters: > ecomify GmbH, Meisenstraße 65, 33607 Bielefeld, Deutschland > Fon: +49 521 448157-90, Fax: +49 521 448157-99, www.ecomify.de > > Court Registration: Amtsgericht Bielefeld HRB 41683 > Chief Executive Officer: Martin Becker, Michael Brohl > > Am 11.06.17 um 06:24 schrieb Abhishek Sharma: > > Hi Team, >> >> I am planning to integrate OFBiz eCommerce module with android native app. >> OFBiz deals with HTTP request/response format but i want in JSON. Is there >> any easy way out to achieve the target? Or any suggested approach (if JSON >> not possible) to implement with android app? >> >> >> Regards >> Abhishek >> >> > > |
Hi Abhishek,
I think this depends on what you want to achieve. Do you want to receive data (in Json format) to be displayed by the native UI of your app? Or do you just want to display the pages as they are delivered from standard OFBiz? The ecommerce main page shows different data like categories, products, special offers etc.. If you want to show it like it's shown in standard OFBiz, you might want to simply use a browser widget to show the contents in your app. I'm pretty sure the default ecommerce UI is not responsive so you'll have to change it. If you want to display all these contents in a native app using your own design, you'll have to get the different data sets (categories, products, special offers etc.) with different requests to OFBiz which have to return Json data. You will have to change or add requests to receive the data and deliver it with the "json" request chained after them. This is not available OOTB in OFBiz for all kind of data. Regards, Michael Brohl ecomify GmbH www.ecomify.de Am 11.06.17 um 12:53 schrieb Abhishek Sharma: > Thanks Michael for replying on this thread. What about the requests which > are served using Groovy? For example, the request " > https://localhost:8443/ecommerce/control/main" is served by groovy and ftl > to display the main page. How should i modify it to display the output in > android native app? Kindly suggest. > > Regards > Abhishek > > On Sun, Jun 11, 2017 at 2:43 PM, Michael Brohl <[hidden email]> > wrote: > >> Hi Abhishek, >> >> there is a JSON response handler available in OFBiz, see >> common-controller.xml: >> >> <request-map uri="json"> >> <security direct-request="false"/> >> <event type="java" path="org.apache.ofbiz.common.CommonEvents" >> invoke="jsonResponseFromRequestAttributes"/> >> <response name="success" type="none"/> >> </request-map> >> >> You can find some examples how it's used in the request-controller >> searching for >> >> value="json" >> >> in the controller.xml files. >> >> It's also used in the ecommerce plugin. >> >> Hope that helps, >> >> regards, >> >> Michael >> >> >> Michael Brohl >> Geschäftsführer >> >> Fon +49 521 448 157-91 >> Fax +49 521 448 157-99 >> Mobil +49 160 3664918 >> Xing www.xing.com/profile/Michael_Brohl >> >> Company and Management Headquarters: >> ecomify GmbH, Meisenstraße 65, 33607 Bielefeld, Deutschland >> Fon: +49 521 448157-90, Fax: +49 521 448157-99, www.ecomify.de >> >> Court Registration: Amtsgericht Bielefeld HRB 41683 >> Chief Executive Officer: Martin Becker, Michael Brohl >> >> Am 11.06.17 um 06:24 schrieb Abhishek Sharma: >> >> Hi Team, >>> I am planning to integrate OFBiz eCommerce module with android native app. >>> OFBiz deals with HTTP request/response format but i want in JSON. Is there >>> any easy way out to achieve the target? Or any suggested approach (if JSON >>> not possible) to implement with android app? >>> >>> >>> Regards >>> Abhishek >>> >>> >> smime.p7s (5K) Download Attachment |
Free forum by Nabble | Edit this page |