Json Construct in Alfresco JavaScript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2014 09:40 AM
Hi All,
I need help to find a way to write data in json format in Alfresco Javascript.
I know we have jsonUtils object in alfresco that can generate a json from Javascript Native object through jsonUtils.toJsonString() method, the object only available in Webscripts only.
I need to write a script in Alfresco the script will be in Data Dictionary / Scripts location, from there when the script executes that need to generate a output file in the same location that contain data in Json format, I have the data with me that need to generate in Json format, i cannot use that method jsonUtils.toJsonString() because its not a webscript.
please help to slove the issue.
Regards.
pmr
I need help to find a way to write data in json format in Alfresco Javascript.
I know we have jsonUtils object in alfresco that can generate a json from Javascript Native object through jsonUtils.toJsonString() method, the object only available in Webscripts only.
I need to write a script in Alfresco the script will be in Data Dictionary / Scripts location, from there when the script executes that need to generate a output file in the same location that contain data in Json format, I have the data with me that need to generate in Json format, i cannot use that method jsonUtils.toJsonString() because its not a webscript.
please help to slove the issue.
Regards.
pmr
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2014 01:21 AM
Well you can always use javascripts functions which could do this for you.
http://www.w3schools.com/json/json_eval.asp
http://stackoverflow.com/questions/16507222/create-json-object-dynamically-via-javascript-without-co...
Also untlimatly if you see jsonUtils of Alfresco they have create those APIs on top of basic javascript functions only.So even you can raplicate that in your javascript file.
http://www.w3schools.com/json/json_eval.asp
http://stackoverflow.com/questions/16507222/create-json-object-dynamically-via-javascript-without-co...
Also untlimatly if you see jsonUtils of Alfresco they have create those APIs on top of basic javascript functions only.So even you can raplicate that in your javascript file.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2014 03:20 AM
Hi mitpatoliya,
Thanks for you reply, the first link you gave for json eval that will parse the json string into javascript native object, but i need to construct a json string from my javascript native object and write the same json string in to a node. If i am wrong please give a example so that i can go through that.
Thankyou
Param
Thanks for you reply, the first link you gave for json eval that will parse the json string into javascript native object, but i need to construct a json string from my javascript native object and write the same json string in to a node. If i am wrong please give a example so that i can go through that.
Thankyou
Param
