Native API for ObjectScript Demo
The demo is based on the raw class descriptions.
The data classes used are Address, Person, Employee, Company
For a more attractive demo, a JSONtoString method by ID was added.
After installation with ZPM just run from Terminal
USER>do ##class(ONAPI.demo).Run()
Adjust Parameters
host[127.0.0.1]:
port[1972]:
namespace[USER]:
user[_SYSTEM]:
pwd[SYS]:
timeout[5]:
****** connected ********
Next, you get a list of possible demo actions.
No input means no action.
The menu loops until you exit.
Populate Person by:100
100
Populate Company by:10
10
Populate Employee by:50
50
Show Person by ID:3
{
"Name":"O'Donnell,Mark I.",
"SSN":"871-87-4555",
"DOB":"1934-05-24",
"Home":{
"Street":"3012 Elm Drive",
"City":"Ukiah",
"State":"IN",
"Zip":"11758"
},
"Office":{
"Street":"1326 Maple Street",
"City":"Jackson",
"State":"MD",
"Zip":"61987"
},
"FavoriteColors":[
"Green"
],
"Age":91
}
Show Company by ID:3
{
"Name":"TeleData Gmbh.",
"Mission":"Experts in innovative nano-connectivity for social networks.",
"TaxID":"E4116",
"Revenue":33297336,
"Employees":[
{
"Name":"Larson,Dave G.",
"SSN":"761-57-3123",
"DOB":"2011-09-28",
"Home":{
"Street":"6346 Second Street",
"City":"Chicago",
"State":"NJ",
"Zip":"16814"
},
"Office":{
"Street":"6702 Clinton Drive",
"City":"Tampa",
"State":"CT",
"Zip":"91275"
},
"Spouse":{
"Name":"Willeke,Rhonda A.",
"SSN":"434-63-3541",
"DOB":"1974-02-15",
"Home":{
"Street":"1910 Oak Blvd",
"City":"St Louis",
"State":"ND",
"Zip":"62884"
},
"Office":{
"Street":"5148 Ash Court",
"City":"St Louis",
"State":"DE",
"Zip":"36764"
},
"FavoriteColors":[
"White",
"Yellow"
],
"Age":51
},
"FavoriteColors":[
"Black"
],
"Age":14,
"Title":"Product Specialist",
"Salary":28870
},
{
"Name":"Quincy,Mo V.",
"SSN":"345-36-6735",
"DOB":"1945-05-14",
"Home":{
"Street":"399 Oak Court",
"City":"Youngstown",
"State":"LA",
"Zip":"75634"
},
"Office":{
"Street":"6307 Clinton Avenue",
"City":"Oak Creek",
"State":"NH",
"Zip":"85911"
},
"Spouse":{
"Name":"Iacobelli,Barb E.",
"SSN":"951-91-9488",
"DOB":"2020-09-04",
"Home":{
"Street":"8413 Elm Blvd",
"City":"Denver",
"State":"ID",
"Zip":"91025"
},
"Office":{
"Street":"4276 Oak Court",
"City":"Oak Creek",
"State":"ID",
"Zip":"20879"
},
"Age":5
},
"FavoriteColors":[
"Blue"
],
"Age":80,
"Title":"Global Sales Rep.",
"Salary":89381
}
]
}
Show Employee by ID:103
{
"Name":"Larson,Dave G.",
"SSN":"761-57-3123",
"DOB":"2011-09-28",
"Home":{
"Street":"6346 Second Street",
"City":"Chicago",
"State":"NJ",
"Zip":"16814"
},
"Office":{
"Street":"6702 Clinton Drive",
"City":"Tampa",
"State":"CT",
"Zip":"91275"
},
"Spouse":{
"Name":"Willeke,Rhonda A.",
"SSN":"434-63-3541",
"DOB":"1974-02-15",
"Home":{
"Street":"1910 Oak Blvd",
"City":"St Louis",
"State":"ND",
"Zip":"62884"
},
"Office":{
"Street":"5148 Ash Court",
"City":"St Louis",
"State":"DE",
"Zip":"36764"
},
"FavoriteColors":[
"White",
"Yellow"
],
"Age":51
},
"FavoriteColors":[
"Black"
],
"Age":14,
"Title":"Product Specialist",
"Salary":28870
}
Show Global PersonD by ID:4
$Data()=1
Value=$lb("","Eastman,Mary C.","887-18-3730",44711,$lb("3889 Ash Blvd","Washington","TX",67862),$lb("5709 Oak Blvd","Chicago","IL",30845),"","")
Index list for Person & Employee (n,y):y
$Employee
$Person
NameIDX
SSNKey
ZipCode
Exit Demo (n,y,*):y
****** done ********
USER>
Discussion (0)0