Hi!
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
Hi!
As Bill has mentioned earlier in his post, we have carefully reviewed the JSON capabilities and made some adjustments to ensure they deliver the best benefit to you. In this post, I am going to describe the modifications in more detail and provide guidance for you to understand the implication for your code base.
Hi Team,
We were able to convert XML file to JSON using Studio and terminal, but kindly let us know how this conversion occurs using Ensemble production.
Thanks.
In our last lesson, we added some formatting and validation to our Edit Widget form. So, now we are ready to add the ability to add new Widgets to our application. However, the great Widget Wars have come to an abrupt end, as Widget Direct has purchased its biggest competitor, WorldWideWidgets. In order to maintain some continuity, we need to display their catalog on our new application.
So, we have good news and bad news.
We finished our last lesson with our Widgets Direct page iterating over a list of widgets, displaying an ID and a Name value. While we have been able to achieve this with only a small amount of coding, the page itself is not the most visually appealing place to be. The AngularJS framework is providing a powerful Model-View-Controller framework for our structure and logic, but it does not implement anything that will provide a nice UI experience. For that we need to implement a UI toolkit.
Hi All,
I use SQL function JSON_OBJECT to get data as a JSON object.
However, sometimes I get error with function JSON_OBJECT when values contain [, ], { or }.
Error:
[SQLCODE: <-400>:<Fatal error occurred>]
Unexpected error occurred in JSON_OBJECT() function execution of <JSON_OBJECT>.%FromJSON().Parsing error
For example,
Query: SELECT JSON_OBJECT('idSQL':id, 'content':content) FROM DocBook.
We finished our last lesson with our Widgets Direct page receiving a Welcome message as a property of a JSON object, which was unpacked and displayed on the page. However, we are on Lesson 3, and we still haven't had any talk of displaying widgets yet.
Let's change that. Widgets Direct are a leader in widget and widget accessories, so we clearly have numerous items to display. To transfer this, we will need to declare and return our first array. Let's go back to our REST.Dispatch class, and add this data to our Service.
Hello,
is there some kind ZEN component available (e.g. tree or anything), which can display raw JSON string data nicely on ZEN webpage ?
JSON string contains primary nodes, subnodes, arrays.
here is my $ZV string "Cache for Windows (x86-64) 2016.2.1 (Build 803) Wed Oct 26 2016 12:43:35 EDT"
two questions
1. How do i convert any Persistent object to JSON String ?
2. How do i convert an y Register object to JSON string ?
3. Do i need to extend from any adaptor class for 1 & 2 ?
Hi everyone, I have and Zen Mojo application, it's all working but I have some doubts about what is recommended to use: There is some reports of employees, for example, and actually I'm using some plugins : "Excelent export" to generate Excel reports and "jspdf" to generate PDF reports in client side.
I have an REST service, that receives the request, process and returns JSON, after client side receive the response it's processed.
- This can be slow/bad in applications with large data?
- It's better/recommended to use ZenReports even with ZenMojo applications?
Is there any way that I can check the native type of an object script variable? (similar to the typeof check in javascript)
I see that the DynamicArray class uses the type of the variable for its output, I would like to do something similar when I receive a value as an argument to my method.
USER>s var1 = 123 //No quotes, number type
USER>s var2 = "123" //quotes, string type
//DynamicArray can tell the difference
USER>s arr = []
USER>d arr.%Push(var1)
USER>d arr.%Push(var2)
USER>w arr.%ToJSON()
[123,"123"] //first value is output without quotes, second value is quoted
How can I prevent large number truncation when using the DynamicObject and DynamicArray classes to create JSON in objectscript and then parsing the result in javascript. Are there any global settings that configure the output when using these classes?
I am looking at converting to the new DynamicObject and DynamicArray classes to build JSON. Our current (homegrown) JSON library forces string representation of numbers too long because of errors we were seeing with long numbers being truncated on the client, I am hoping to accomplish the same with the new classes.
Hi,
I am working with this Ensemble Business Operation, which extends the EnsLib.Rest.Operation.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…
I built the OpenWeatherMap Rest Operation described in the article above.
I would like to access the weather.id weather.main, and weather.description. However, these objects are in a JSON Array.
How do you access these three objects in Objectscript.
In my, Test.REST.WeatherOperation class, I added these three lines.
set pResponse.WeatherId = tProxy.weather.id
set pResponse.WeatherMain = tProxy.
I have a project to convert a JSON message with two patient identifiers into an HL7 ADT^A31. Is there any documentation or training that you would think is appropriate?
Currently using Ensemble 2014.1.5 on AIX
I'm working on a REST service which will include a binary stream as a request property. I'm currently encoding the stream as BASE64 and passing it as a string value, but I was wondering if there is anything in the Caché JSON support that may be a better fit for encoding this data? Thanks Chris
If you spend a lot of time working with javascript, json and html and you are new to Eclipse / Atelier you may like this tip.
Instead of the default Atelier HTML you can install a JS plugin for eclipse which works quite good handling javascript files, allowing you to see functions, color syntax, etc. The one I used is the JSDT.
My organization has been tasked with parsing raw EDI 271 messages into JSON strings in order to feed a downstream application. A few key details about the task:
Caché 2016.1 introduced some very powerful JSON features. Unfortunately, the syntax used in the 2016.1 release is going to be changed in the 2016.2 release to bring it closer to Caché ObjectScript syntax. This will mean that code that works in 2016.1 may not be forwards compatible. See this announcement and this article for more details about the changes.
The article is a step by step guide for beginners to learn how to build a RESTful web service consumer (or client) in Ensemble. The provider can be any RESTful service, but the example is based on the service we made during the previous sessions.
It is more than obvious that many client development environment has programming libraries or containers to build a RESTful client. For example in the earlier sessions we used Java Script to access services. Ensemble as a container also offers client functionality. Let us have a quick list what Ensemble offers.
Hi all,
We're creating a series of RESTful APIs that output data from a Cache database (made up of global storage that we've mapped to classes). I'm running into some problems with object-to-JSON conversions when relationships are involved.
A beginners guide to develop Ensemble RESTful web services.
Before you start reading this short introduction please go through the on-line documentation of Ensemble with special attention to chapter “Creating REST services and clients with Ensemble”.
The approach in the documentation is undisputable the fastest and easiest way to create RESTful services. As a beginner I went through the documentation and I had several questions. This short article is listing those questions plus my humble answers.
When I refer to documentation I mean Ensemble 2016.2 and onwards.
I want to create a simple Json extract from a database in Cache. Suggestions as to classes, method, etc. are most welcome.
Hi, all.
I have CSP application and it needs to get and process data from ajax request with json-content. JSON can be very big.
In this case:
TRY
{
Set RequestObj = ##class(%Object).$fromJSON(%request.Content.Read())
} CATCH(Exception) {
Set Status=Exception.AsStatus()
}
I get just part of getting JSON and validate error in $fromJSON.
If I try to read it all in cycle:
TRY
{
While (%request.Content.AtEnd = 0) {
Set Data=Data_%request.Content.Read()
}
Set RequestObj = ##class(%Object).$fromJSON(Data)
} CATCH(Exception) {
Set Status=Exception.AsStatus()
}
I get
In this article I'll describe how to set up web services and/or REST services using EWD 3.
Since EWD 3 is designed to be modular, you can construct the environment that exactly meets your needs, but for much of the time you'll probably find that the pre-built EWD 3 ewd-xpress super-module does most of what you need because it hooks together all the core EWD 3 and other building-blocks you'll need:
As Rob explained in an earlier post, Caché's Node.js interface allows you to create Web Services and REST Services using the very modular EWD 3 framework.
These services by default return a JSON response with Content-Type: application/json and the response body contains the JSON you return using the finished() method, so:
finished({ test: 'test response' });
returns
{ "test": "test response" }
with a HTTP content-type of application/json
For other external services and tools like e.g.
Recently I have been posting some updates to our JSON capabilities and I am very glad that so many of you provided feedback. Today I would like to focus on another facet: Producing JSON with a SQL query.
Hi,
I am trying to use data transformation (DTL) to map a JSON to SDA. My elements in the source JSON is not one to one with SDA object. That means I have to add code to loop through these objects in order to complete the mapping. Can someone send me a sample that can look to create that? I am not very comfortable with scripting language used in Health Share. Appreciate your help.
Regards
Joseph
The field test of Caché 2016.2 has been available for quite some time and I would like to focus on one of the substantial features that is new in this version: the document data model. This model is a natural addition to the multiple ways we support for handling data including Objects, Tables and Multidimensional arrays. It makes the platform more flexible and suitable for even more use cases.
Hi community!
Does anyone know if it´s possible to override a property name to generate a JSON message based on the instance of object?
Thanks,
José Sampaio
I am playing with json output from result sets
I've generated a dynamic resultset and now doing the json and I can get Array's with nested Objects but I'm trying to get to Objects nested with another object
s mainObj = ##class
array
what I actually want is