Lorenzo Scalese · Apr 15, 2021 go to post

Thank you @Evgeny Shvarov !

iris-config.json - empty? Yes, this is template. Loading this file do nothing.

For testing purposes, you should fill this file with the content in this article.

Lorenzo Scalese · Apr 15, 2021 go to post

Thank you @Evgeny Shvarov 
So, the main goals are REST expose and the rupture between config and code. 

%Installer allows to create, users, roles, mapping too, but it's not possible to configure SQL Privileges, SSL Configuration, SQL Connexion (config-api can do).

There are a few features existing in %Installer and not in config-api, but we have a good base to implement if needed.

Lorenzo Scalese · Apr 15, 2021 go to post

Exactly @Guillaume Rongier

I am a Manifest Installer user and It works fine. 

However, sometimes people which deploy applications aren't ObjectScript developers.

Manifest Installer, need to create a class, write an XML, compile. 
I would like a rupture between the configuration and the code. 

Moreover, everything is exposed in REST.  It could be interesting to integrate IRIS configuration from a tool in another language.

Thank you!

Lorenzo Scalese · Nov 24, 2020 go to post

It's useless on your local dev, but depending your goal : You can try to dump

zzDumpDoc(pkg, targetDir="c:\dev\testdumpdoc\")
	new (pkg, targetDir)
	
	Do:'##class(%File).DirectoryExists(targetDir) ##class(%File).CreateDirectoryChain(targetDir)
	
	Set pkgDot = pkg _ ".", class = pkgDot, restore = 0
	
	If $Isobject($Get(%request)) {
		Set oldRequest = %request
		Set oldResponse = %response
		Set oldSession = %session
		Set restore = 1
		
	}
	
	Set %request = ##class(%CSP.Request).%New()
	Set %response = ##class(%CSP.Response).%New()
	Set %session = ##class(%CSP.Session).%New("0123456789")
	Do %session.Unlock()
	
	Set %request.Data("PAGE",1) = "CLASS"
		
	For  {
		Set class = $Order(^oddDEF(class))
		Quit:$e(class,1,$l(pkgDot))'=pkgDot
		Set %request.Data("LIBRARY",1) = $namespace
		Set %request.Data("CLASSNAME",1) = class
		
		Set initialIO = $IO
		Set file = targetDir_class_".html"
		OPEN file:("NRW"):2
		USE file
		Do ##class(%CSP.Documatic.PrintClass).OnPage()
		USE initialIO
		CLOSE file
	}
	
	If restore {
		Set %request = oldRequest
		Set %response = oldResponse
		Set %session = oldSession
	}
	quit

There exits more elegant way to redirect the output (check the community).

Lorenzo Scalese · Nov 24, 2020 go to post

Hi @Yuri Marx ,

I don't know.

If nothing exists:

Perhaps we can write a script to call CSP.Documatic.PrintClass.cls and dump the html response into file.

ex : /csp/documatic/%25CSP.Documatic.PrintClass.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Library.Integer

A %Net.HttpRequest is not required.   I guess we can create a %request object,  redirect the IO and calling OnPage method.

Lorenzo Scalese · Nov 23, 2020 go to post

What an exciting contest!   

So happy to win in experts votes and third in community votes.

Congrats to all participants for your great apps. 

Thanks to experts and community for your support!

Also special thanks to the OEX Team and all members behind the scene.  

Lorenzo Scalese · Apr 29, 2020 go to post

Hi @lw wei,

I don't know if an API exists to do this, but if nothing exists you can use the job command with an input file.
example :

JOB ^STURECOV:("%SYS"::infile:outfile):3

"infile" is the path to your input file that contains all entries for each read.
"outfile" optional, but interesting to know what happened.

Lorenzo Scalese · Apr 29, 2020 go to post

Hello @Arto Alatalo 

If there is no overload on production server,  perhaps can you perform a D ^%BENCHLANG on production and dev machine?

It's benchmark CPU against ObjectScript language.

Compare the COSMark result.

Lorenzo Scalese · Apr 28, 2020 go to post

Thank you for your feedback @Robert Cemper 
I didn't run a benchmark, because in my case it's a deprecated class without intensive usage.

It's good to know the indirection performance is not bad. smiley

Lorenzo Scalese · Apr 28, 2020 go to post

Interesting @Robert Cemper  !

I wrote a similar code the last year in order to have storage compatible Caché\healthshare and Iris.

We have a legacy persistent class mapped on ^CacheMsg global, my solution : 

<SQLMap name="CacheMsg">
<Data name="msg">
<Delimiter>"^"</Delimiter>
<Piece>1</Piece>
</Data>
<Global>@($s($zv'["IRIS":"^CacheMsg",1:"^IRIS.Msg"))@</Global>

It works very well, but perhaps a little bit slow due to indirection usage.

I'll keep this code until a complete migration to Iris and then It will be removed.

Lorenzo Scalese · Apr 9, 2020 go to post

Hello @Timothy Leavitt
Thank you for this great article!

I tried to add "UnitTest" tag to my module.xml but something wrong during the publish process.
<UnitTest Name="tests" Package="UnitTest.Isc.JSONFiltering.Services" Phase="test"/>

tests directory contain a directory tree UnitTest/Isc/JSONFiltering/Services/ with a %UnitTest.TestCase sublcass.

Exported 'tests' to /tmp/dirLNgC2s/json-filter-1.2.0/tests/.tests
ERROR #5018: Routine 'tests' does not exist
[json-filter]   Package FAILURE - ERROR #5018: Routine 'tests' does not exist
ERROR #5018: Routine 'tests' does not exist


I also tried with objectscript-math project.  This is the output of objectscript-math publish -v :
Exported 'src/cls/UnitTests' to /tmp/dir7J1Fhz/objectscript-math-0.0.4/src/cls/unittests/.src/cls/unittests
ERROR #5018: Routine 'src/cls/UnitTests' does not exist
[objectscript-math]     Package FAILURE - ERROR #5018: Routine 'src/cls/UnitTests' does not exist
ERROR #5018: Routine 'src/cls/UnitTests' does not exist

Did I miss something or is a package manager issue ?
Thank you.

Lorenzo Scalese · Mar 22, 2020 go to post

Hello @Evgeny Shvarov ,

I tested the following code in an Iris terminal to add %DB_%DEFAULT role, It seems to work :

Write !,"Current user roles : ",$Roles
Zn "%SYS"
Set tSc = ##class(Security.Applications).Get("/csp/user",.p)
Write !,"Get application : ",$SYSTEM.Status.GetOneErrorText(tSc)
Set p("MatchRoles")=p("MatchRoles")_":%DB_%DEFAULT"
Set tSc = ##class(Security.Applications).Modify("/csp/user",.p)
Write !,"Modify application : ",$SYSTEM.Status.GetOneErrorText(tSc)
Kill p
Lorenzo Scalese · Mar 17, 2020 go to post

Hello @Mario Sanchez Macias ,


I think it's not a correct usage of %ConvertJSONToObject, the third argument must be a target object instance.

Depending on your need,  you should use "%Array of %String".  It's more flexible for SQL that "%List".

If "valueRecived" variable is a dynamic array like ["green","yellow","blue"], you can test this code :

Set valueRecived = ["green","yellow","blue"]
Set array = ##class(%ArrayOfDataTypes).%New()
Do ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(valueRecived.%ToJSON(),,.array)
Zw array