on 10-01-2013 7:31 AM
Hi ,
I am newbie, and i have created a xsjs project which displays data in an html page.Now i want to get the data from the tables and apply some logic,convert them to JSON and store in a text file which can be consumed by the HTML file and display in the browser.
JSON is a predefined file with contents which determine the structure of the HTML file.I have to fill the values in this JSON.txt from the tables dynamically and save so that when html file is loaded the JSON have the real time values.
Are there any XS IO libraries which help in reading and writing to files in the project on the server side?
Regards,
Phani
I don't understand why you would actually want to store the JSON as a file on the server side. You should retrieve the data and format it as JSON in the XSJS each time you need it. If you need to persist the JSON results across multiple sessions (for instance a shopping cart), you should write it into a database table not store it in the Repository. The Repository is for design time objects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Completely agree with Thomas here. Once you store the data in tables you can then expose and consume that data in JSON format using the built in XSODATA concept.
You can turn the output of any OData service into JSON by adding the $format=json flag to the end of the URL. e.g. myService.xsodata/collectionName?$format=json
Brenton.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.