Let's imagine if you would like to write some real web application, for instance, some simple clone of medium.com. Such sort of application can be written using any different language on the backend side, or with any framework on the frontend side. So many ways to do the same application, and you can look at this project. Which offers a bunch of frontends and backends realizations for exactly the same application. And you can easily mix them, any chosen frontend should work with any backend.
Let me introduce the same application realization for InterSystems IRIS on a backend side.
Doing a new project with %JSON.Adaptor, unexpectedly realized that %JSON.Adaptor does not support export to native JSON. %JSONExport just outputs directly to the current device, and there are two more methods %JSONExportToString, and %JSONExportToStream.
In conjunction with generating REST from swagger specification, where any generated method accepts as a result %DynamicObject, which is good.
I have multiple places in my REST where I have to return JSON for an object, but I have to modify the result a bit, just extend it with some other way.
This is a detailed guide to develop RESTful services using InterSystems Ensemble. The goal of this guide is to make you understanding the basic concept and building blocks of a RESTful service. The service is going to provide a very basic functionality (a “Hello world!”).
You will learn how to create required components as Ensemble classes, configure the run-time as an Ensemble Production and create a service configuration as a web application.
I build an API and there I use $order to get the Data from my Globals. When I first time use that API it's get an error (504 Gateway-Timout > 60 Sec.).
After 2 reloads it works with a loading time of 2 Sec.! Sounds for me like the $order is cached and it works faster. Is it true $order will be cached?
When it works, I only get the error at the next day. So it's very hard to reproduce that error. Is it possible to delete the cache for $order?
This is a coding example working on Caché 2018.1.3 and IRIS 2020.2
It will not be kept in sync with new versions
It is also NOT serviced by InterSystems Support !
This an example of a customized SystemFunction extension (ZZISJSON) in Caché & IRIS This time it is to be included in %ZLANGF00.mac
A JSON string is mostly imported from a file or over REST. You rely on a clean and compatible structure. This is the check.
This is a coding example working on Caché 2018.1.3 and IRIS 2020.2
It will not be kept in sync with new versions
It is also NOT serviced by InterSystems Support !
It is also an example of a customized command extension (ZZJSN) in Caché / Ensemble & IRIS
This is the Caché version for fast JSON formatting. But iIt also works in IRIS . To allow parallel existence in IRIS with the previous example this is named ZZJSN
This is a coding example working on Caché 2018.1.3 and IRIS 2020.2
It will not be kept in sync with new versions
It is also NOT serviced by InterSystems Support !
install and usage
Packed Pretty.xml installs routine ZPretty in any namespace. calling $$Do^ZPretty(input,[filler],[newline])returns a wrapped JSON string. filler is the optional string for the indent, default = " " newline is optional, default = $C(13,10) input accepts: JSON_String, JSON_Stream, %DynamicAbstractObject
when I'm using the %JSONExport-function on Caché-Objects containing properties of type %integer, %numeric or %boolean, this properties are all automatically converted to Strings in the JSON-Output.
Is there a way to get around this type-cast?
Example:
Result with %JSONExport:
maxOrderable and maxReserveable are of type %integer, deliverable and assembly of type %boolean. All 4 properties are shown as quoted Strings.
This is a coding example working on Caché 2018.1.3
It will not be kept in sync with new versions
It is also NOT serviced by InterSystems Support !
Full backport from IRIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT
IRIS brought us an excellent %JSON.Package It is an essential component of the Project Manager (ZPM) This backport makes it available also in Caché and builds a base to eventually backport also ZPM.
I'm trying to make a REST API call in JSON format. When using the example in the class reference documentation the getJSON method in the %Net.Http class throws the error <METHOD DOES NOT EXIST> on a %Clone() method in the %LIbrary.DynamicObject class. I even changed the parameter to a JSON string to no avail. The code will then fail on the %Compose method (examples below). My workaround is to use the %Net.HttpRequest functionality. Is there another workaround to this?
Say I have an ObjectScript object called Book. It has 2 properties title and author. It extends JSON.%Adaptor, so I can call book.%JSONExport() and get this output:
{ "title": "For Whom the Bell Tolls", "author": "Hemmingway" }
In my web service I want to have a search function that returns an array of Books along with the total number of responses, like this:
Sometimes you need quickly and easily import data into IRIS. For this, an IRIS import manager has been developed.
This application allows you to import JSON data and also provides a really simple interface for transferring data from MongoDB collections to IRIS globals. It has never been so easy.
Hi All This is the index to a series of articles I hope to create over the coming months.
ZEN and ZEN Mojo are no longer being actively developed by Intesystems - this is a great shame as it is a fine product that works so well for business applications. However ZEN is a 15 year old product and I need a path forward to replace the ZEN UI with a supported development framework.
This article is an index of the other articles I have, or plan to write. - the articles will be subject to change as I develop my thoughts and climb the learning curve.
I am compiling a REST Operation to call our hospital Administration system, following tutorials around the REST API's etc. First time we have integrated like this so not much knowledge around our hospital - hoping someone on here can help.
I have been using the JSONStreamToObject Method which is working as i expected, apart from trying to get a specific item in the example JSON Response as follows:
JSON-Patch (RFC6902) is a standard format that allows you to update a JSON document by sending the changes rather than the whole document.
JSON Patch plays well with the HTTP PATCH verb (method) and REST style programming.
I am using studio 2015 version which does not have dynamic objects and I need to read xml and convert that to a json I have managed to come close to json string but with little difficulties .I need to be able to identify the root element and specify where to put braces between objects anyone with any idea is welcome he is my code so far
ObjectScript doesn't include any built-in method for appending one JSON dynamic array to another. Here's a code snippet I use that's equivalent to the JavaScript concat() method.
Call it with any number of arguments to concatenate them into a new array. If an argument is a dynamic array, its elements will be added. Otherwise the argument itself will be added.