Home Applications Custom ZenProxy

Custom ZenProxy

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
3.75
2 reviews
0
Awards
163
Views
0
IPM installs
0
0
Details
Releases
Reviews
Issues
Pull requests
Articles
%ZEN.proxyObject send numeric as String

What's new in this version

Add ZPM package

CustomZenProxy

Customization of ZenProxy Intersystems to be enable to send numeric attributes in String format.

Just download an import files of src folder.
or use

zpm "install custom-zen-proxy"

EXAMPLE:

CODE:

Class %ZENproxy.Test
{
  ClassMethod Json() As %Status
  {
	#Dim objectA As %ZENproxy.Object
	Set objectA=##class(%ZENproxy.Object).%New()
	Set objetoB=##class(%ZENproxy.Object).%New()
	Set objetoB.phone2=961365378
	Set objetoB.name="Dani"
	Set objectA.objetoB=objetoB
	Set objectA.phone=964121214
	u 0 w "NORMAL",!
Do objectA.%ToJSON()

U 0 W !!

u 0 w "WITH PARAMETER",!
Do objectA.%ToJSON(,"aelotwux")

U 0 W !!

u 0 w "WITH PARAMETRO AND EXCLUDED",!
Do objectA.excludeStringformat.Insert("phone")
Do objectA.%ToJSON(,"aelotwux")

U 0 W !,!

u 0 w "WITH FORCED LIST",!
Do objectA.forceStringFormat.Insert("phone")
Do objectA.%ToJSON()
 }

}

RESULT:

NORMAL

{
“objetoB”: {
“name”:“Dani”,
“phone2”:961365378
},
“phone”:964121214
}

WITH PARAMETER

{
“objetoB”: {
“name”:“Dani”,
“phone2”:“961365378”
},
“phone”:“964121214”
}

WITH PARAMETER AND EXCLUDED

{
“objetoB”: {
“name”:“Dani”,
“phone2”:“961365378”
},
“phone”:964121214
}

WITH FORCED LIST

{
“objetoB”: {
“name”:“Dani”,
“phone2”:961365378
},
“phone”:“964121214”
}

Docker Support

Prerequisites

Make sure you have git and Docker desktop installed.

Installation

Clone/git pull the repo into any local directory

$ git clone https://github.com/intersystems-community/objectscript-docker-template.git

Open the terminal in this directory and run:

$ docker-compose build

Run the IRIS container with your project:

$ docker-compose up -d

​Test it

$ docker-compose exec iris iris session iris
USER>
do ##class(%ZENproxy.Test).Json()
NORMAL
{
        "objetoB": {
                "name":"Dani",
                "phone2":961365378
        },
        "phone":964121214
}

WITH PARAMETER
{
"objetoB": {
"name":"Dani",
"phone2":"961365378"
},
"phone":"964121214"
}

WITH PARAMETRO AND EXCLUDED
{
"objetoB": {
"name":"Dani",
"phone2":"961365378"
},
"phone":964121214
}

WITH FORCED LIST
{
"objetoB": {
"name":"Dani",
"phone2":961365378
},
"phone":"964121214"
}
USER>

Read more
Made with
Install
zpm install custom-zen-proxy
Version
1.0.121 Mar, 2023
Category
Integration
Works with
InterSystems IRISInterSystems IRIS for HealthCaché
First published
13 Feb, 2023
Last checked by moderator
27 Jun, 2023Works