How to fetch the orbeon form (yform) data that got stored in database in xml file? How to send that to third party apps? - forms

I am Working on yforms with Hybris 6.5.
Currently I have created forms. After clicking on save button, data is getting saved in my database. Now I am facing problems for:- 1) Fetching the data by fields (as they are in form). 2) Sending that data to any third party apps

In Hybris , they are using hybris database as persistence API for orbeon form. So the orbeon form data will be stored and retrieved from hybris database. Coming to your issues ,
1) whole xml data will be stored as String . So its not possible to get the particular field separately by getter/setter. But you can parse the whole xml string using some xml parser and get the field you want.
2) There are two ways , you can do it . One is directly from Orbeon forms, sending the submitted directly to some controller and from there parse the data and send to the 3rd party or any other action you want to do . Another way is writing an interceptor in hybris for yformDataModel and do your action . I would prefer thge

There are 3 main ways for you to access the XML data captured based on the answers provided by users to your forms:
You can setup Orbeon Forms to send that data to a service you provide when users submit the form.
You can call a REST API provided by Orbeon Forms to access the data it stored in the database.
You can access the database directly.
For more on this, see Accessing Data.

Related

Magento 2 - receive XML in post data (API)

In my store, I need to build Soap API, which accepts XML data from 3rd party solution, parses it and creates new customer based on provided data.
My questions is how can I get XML from post body data?
Thanks!
Just don't. Create separate service that is going to do that using Magento framework (check Customer or Catalog module for guidance). Because your request at the moment looks like you're going wrong way.
Just capture the XML in Controller's execute function.

Populating new form data from REST api

I've come from a background of ASP.Net MVC where when the user wants to create a new entity the server returns values to populate drop down lists(for example).
Now I'm doing a UI that is invoking a REST Api. I have my urls for creating/retrieving etc but this is purely for actual resources. How would the REST be defined to get data to populate the create form.
For example:
a user wants to create a new order. They go to the 'create order' screen and need to select their payment method. They have 3 payment methods (card, paypal, amazon) but the logic on the server side knows that amazon cannot be accepted on this order. How would I go about letting the UI know what can be populated in the drop down list using REST?
I can't seem to get this to fit into REST principles but then I don't want the user to submit amazon and then the server return a Bad Request, just seems bad implementation.
Thanks

Java Web Service to connect to a mysql database

Guys i need to develop a JAVA web service which reads data from a HTML form and stores the data into the MYSQL database. i have no idea about how to achieve this. Can someone give me a detailed step by step explanation as to how i should proceed.
i know i can do it using servlets. But my requirement is that it has to be done only through a web service
So , first of all you have to create a structure like this :
DAO for storing and retrieving data from DB
Web Service exposes methods to save datas (simply calling dao and passing data)
Your web app with html form. Submitting your form you have to call a servlet to manage received data. On this servlet simply call the web service client.
Take a look at this : https://netbeans.org/kb/docs/websvc/jax-ws.html if this is your first web service

Regarding REST API

I'm new to REST APIs and trying to understand the basics of them. So lets begin by saying that I have created a simple CMS web application using PHP (You create an user, you post an entry and assign some categories maybe, etc...).
That being said, if I wanted to create a mobile app that would do the same, I'll have to create some PHP functions in order to send data as JSON or XML and also in order to process a POST or PUT request.
is a REST API the collection of those functions I'd use to handle the mobile app POST, PUT and GET request using JSON or XML as the data format? if not, can I get an example, not a definition, please.
To answer your question,yes, the REST API is a collection of those functions for any client you wish to expose it to for creating an user, posting an entry etc. The accepted data format is something you decide for your API. It may be JSON, XML or even both.
Some examples:
http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/
http://peter.neish.net/building-a-mobile-app-backend-using-mongodb-and-slim-a-php-rest-framework/

creating a POST request in objective-C

I have implemented a REST based web service and used it to access data back in MySQL database.
I am using this framework to access the json data http://code.google.com/p/json-framework/
I have no problems in getting the content from this web service, but how can I put something in the database? Should I just make a special query string and have the php code in the backend to interpret this special keyword/query string as an insert to the database?
You're looking for ASIHTTPRequest. You can use that for everything from dumping pages to submitting data via POST or FORM.
Have fun :)
POST is a HTTP method. Your web service should behave differently depending on the method used for the request, if you're implementing REST.
If you send a POST request, your web service should inspect the parameters and do what it needs to do.
What parameters you send and how is dependent on how you've written the web service. Ie. Is the web service expecting XML requests or JSON or URL parameters?