Write Data from Model back into json File UI5 - sapui5

Is it possible to write Data from an UI5 JSON Model back into a local JSON File.
Maybe by using: new sap.ui.core.util.MockServer({....
The MockServer emulates an OData Service and there it should be possible to save Data.

Since you are working in a browser you cannot access the file system. You will have to either implement a back-end service that saves your data or you can save the data from the JSONModel in local storage.
With local storage the changed data will of course only be available in the browser where you saved it.
See for example
https://developer.mozilla.org/en/docs/Web/API/Window/localStorage
https://openui5.hana.ondemand.com/#docs/api/symbols/jQuery.sap.storage.html

Related

How to prevent edit game data JSON file in mobile game?

I'm making mobile 2D puzzle game by Unity
using LitJson, Save&Load game data by .json file (public data)
I made class Userdata, in the class there are money and items.. also read & write by json
But I don't want to edit this json file who downloaded apk
How to prevent this?
You cannot completely protect data stored in the application. The most secure way to prevent players/ users from altering (save)game data, is to store them on a remote storage/database.
Taking database as an example, you could write PHP scripts which serve as middleman communicating between the database and your application.
In these scripts you would generally determine the logic and security handling on who gets to retrieve/ send what data to which table.
you can use binary formter as it will save your data in binary encrypted formate.
while this still can be decrypted, but will minimize the chances for regular users
Edit: Binary formater is no longer secured to be used, use binary writer instead for data about monetizing.

AEM 6.1 - Store data in session

In our AEM instance we are getting data from an external system, per user this data is the same during his session. So it make sense to store this data in their session / cache or something like that. With another CMS we used before we always stored such data in the session. Is that also the right solution here for AEM 6.1 or are there better alternatives?
Call 1 that needs to be stored: Size in bytes: 34597
Call 2 that needs to be stored: Size in bytes: 2201
Thanks for your response.
I can think of 3 solutions..
Get the data from the Session into a java class, create a pojo, and build the object of the pojo with the data in the session. Then serialize this pojo and save it in your browser's cookie.
While retrieving it, you can de-serialize it and use it on your form or in your java code.
Have to see how big of the object it becomes with the data that comes. Cookies have a 4KB limit on size.
If you can use Angular(or JQuery), you can save this session to "HTML5 LocalStorage" and retrieve it to manipulate and display on the form or send to a webservice.
The advantage is that the LocalStorage has bigger capacity(5MB) and most modern browsers support it.
The drawback is that you cannot access this locastorage from Java (server-side).
I have attached a screenshot with browser storage options that show up when you press "Ctrl + i" on Chrome.
Save the session data to AEM repository and manage it from there (add data, remove, read etc.)
I have implemented each of the above and let me know if you need examples.

Write back data to the source in Project Siena app

I have a requirement to save data added by the user to a server. Is there any way to write back data to the source? or to somehow send the data to an azure server in project siena

How do I create a webpage that reports data on a local network?

I need some advice and guidance with starting a project. I have a MATLAB program that outputs data into a JSON file and a folder of images. I would like to have a webpage accessible through a local network that visualizes this data. My input data is well defined and I will visualize the data using d3js, but I do not know the rest.
How to setup a webpage for a local network?
How do I create a webpage that will periodically check the contents of the JSON file and update the display with the latest data?

How to retrieve data offline in iphone programming

In my application i want to save some data to be accessed while being offline, This data contain the text as well images so can any one suggest how can i make it.
You could load your web content using ASIHTTPRequest and store the contents of the response locally to the file system or in an sqlite database. For persistent storage, you can use Core Data or fmdb