Last active
August 29, 2015 14:15
Revisions
-
bsenduran revised this gist
Mar 5, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ try { } }; resource = { content: JSON.stringify(reg_initial_js) }; dataStore.put(path, resource); } -
bsenduran renamed this gist
Feb 10, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bsenduran created this gist
Feb 10, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ <% var carbon = require('carbon'); var server = new carbon.server.Server(); var options = {system: true, domain: carbon.server.tenantDomain() , tenantId: carbon.server.tenantId()}; var dataStore = new carbon.registry.Registry(server, options); var res; var mycontent; var path = "/_system/governance/sen/hello"; try { res = dataStore.get(path); mycontent = res.content; var log = new Log(); mycontent = JSON.parse(mycontent); log.info(mycontent); log.info(mycontent.a); print(typeof mycontent); mycontent["c"] = {c1:"1", c2:"2"}; mycontent["d"] = {d1:"1", d2:"2"}; //delete mycontent['d']; var content = JSON.stringify(mycontent); log.info("content is " + content); res.content = content; dataStore.put(path, res); } catch (error) { print(error); print("<br/>"); print('Adding new hello file'); var reg_initial_js = { a: { a1: "1", a2: "2" }, b: { b1: "1", b2: "2" } }; resource = { content: stringify(reg_initial_js) }; dataStore.put(path, resource); } var regResource = dataStore.get(path); print("=============="); print("<br/>"); print(regResource.content); print("<br/>"); print("=============="); %>