A
alextcl
Guest
Hi all, I am working on a mobile app and collaborating with another OpenEdge developer for his REST service data model design. The type of Mobile App is OpenEdge Mobile. One of the functionality of the app is to allow user to provide respond for questions that will be displayed in each page individually. It could be a multiple choice, numeric or character input answers. The app will store the answers in form of stringify JSON data to the local storage variable. It will then send the answers back to the server once the user confirm the submission. The sample data that I stored locally is as below: { "TaskNo": "45687", "DateTime": "Mon, 14 Jul 2014 07:00:00 GMT", "Latitude": 53.48137, "Longitude": -2.23174, "Answers": [ { "QuestionId": "WA210", "Type": "R", "StaticDynamic": "Dynamic", "ResponseValue": "Yes", "IssueSeverity": null, "Comments": null, "PhotoImage": null }, { "QuestionId": "WA211", "Type": "I", "StaticDynamic": "Dynamic", "Answers": "10", "IssueSeverity ": null, "Comments": null, "PhotoImage": null }, { "QuestionId": "WA212", "Type": "I", "StaticDynamic": "Dynamic", "ResponseValue ": "10", "IssueSeverity ": ‘Mandatory’, "Comments": "Mandatory", "PhotoImage": [ "image encoded in base64 /photopath1.jpg" ] }, { "QuestionId": "WA212", "Type": "I", "StaticDynamic": "Static", "ResponseValue": "10", "IssueSeverity": null, "Comments": "Write a really long message here", "PhotoImage": [ "image encoded in base64 /photopath1.jpg", "image encoded in base64 /photopath1.jpg" ] } ] } And the table definition of OpenEdge JSDO service for the answer would be similar to the following: DEFINE TEMP-TABLE ttCheckQuestions no-undo FIELD TaskNo AS INTEGER FIELD ConfDateTime AS DATETIME-TZ FIELD LegNo AS INTEGER FIELD DisplaySeq AS INTEGER FIELD VehicleType AS CHARACTER FIELD StaticDynamic AS CHARACTER FIELD QuestionID AS CHARACTER FIELD QuestionText AS CHARACTER FIELD QuestionHelp AS CHARACTER FIELD QuestionType AS CHARACTER FIELD ValidValues AS CHARACTER FIELD ResponseValue AS CHARACTER FIELD IssueSeverity AS CHARACTER FIELD Comments AS CHARACTER FIELD Longitude AS CHARACTER FIELD Latitude AS CHARACTER FIELD PhotoImage AS BLOB INDEX KEY-1 DisplaySeq. However, the JSDO service for Create method generated by the OpenEdge server will only create a single record and the request parameters only dedicated for one object creation. In this case, we couldn’t utilize the data source mapping features with Rollbase Mobile App designer. I could think of multiple solutions to this problem, as listed below; but I don’t know if they are possible because I have no experience with OpenEdge development. Define a JSDO method at OpenEdge server that will accept and parse my data format, which then create multiple line of record at the database by writing some Progress Code. Loop and call the JSDO create method for each answer object that I wanted to send back to the server ( Anoyone could share how to call the JSDO service without using the data mapping features of Rollbase App Designer? ). Could anyone please advise us on this matter? Thank you.
Continue reading...
Continue reading...