Enrico Parisi · Jan 12, 2023 go to post

SQL Compute Code runs outside the class context, in that circumstance you can use:

##class(YourPkg.YourClassName).#YourParamName

Enrico

Enrico Parisi · Jan 14, 2023 go to post

Often SqlComputed is used for properties that are also calculated like:

Property TestCalc As %String [ Calculated, SqlComputeCode = { Set {*} = ..#TestParam }, SqlComputed ];

but in that case ..#ParamName does not work, this works:

Property TestCalc As %String [ Calculated, SqlComputeCode = { Set {*} = ##class(test.CalcParm).#TestParam }, SqlComputed ];

Enrico

Enrico Parisi · Jan 16, 2023 go to post

In what part/context and how (constant? function/expression? report data?) of a ZEN Report do you want to insert it?

Maybe a little snipped of the report may help us in helping you...

Enrico

Enrico Parisi · Jan 16, 2023 go to post

Single character greater than or equal symbol is $c(8805), so:

.......
set 
text=^||TestProfile("Table",p,"PostInfo",r)
set text=$replace(text,">=",$c(8805))
.......

Try and let us know.

Enrico

Enrico Parisi · Jan 16, 2023 go to post

Regarding:

Set mgr.StringQuote = ""

I think it should be:

Set mgr.StringQuote = """"

Otherwise you set the StringQuote to null.

Regarding the date/time export, what's the datatype of the columns (class properties) you are exporting?

Enrico

Enrico Parisi · Jan 18, 2023 go to post

Hi Con,
I was afraid of that, the $zcvt function does not handle that translation.

You need to modify your code to something like:

set text=$zcvt(text,"O","XML")
set text =$replace(text,">=","≥")
write !,"<PostInfo>"_text_"</PostInfo>"

Enrico

Enrico Parisi · Jan 19, 2023 go to post

How is the BS pulling the data? From files? From SQL? Or?

I think you need to parallelize the dequeuing, but I don't think a BS can have more than one job. You can move the dequeuing to a Business Operation, in that case you can assign as many jobs (pool size) as required.

Enrico

Enrico Parisi · Jan 21, 2023 go to post

I don't think is possible, ANY IRIS.DAT can be mounted and named as desired when mounted (configured) in an IRIS instance.

If the database is mounted, then it's possible to find out the name and path of the IRIS.DAT that correspond to a mounted database: System Management Portal -> System Operations - Databases, there you have the list of configured databases with name and corresponding path.

If you have a "spare" unmounted/unconfigured database then you can mount it (add it to the IRIS configuration) and check the content and see what it contains to understand what was used for.

Enrico

Enrico Parisi · Feb 2, 2023 go to post

There are plenty of options, as discussed in the thread linked above.

Personally, a little more than 10 years ago I've used a (commercial) .NET library called hiqpdf and wrote a very tiny .NET wrapper. Works great and since then it's still running fine.

Enrico

Enrico Parisi · Feb 2, 2023 go to post

The solution depends on the problem, my understanding is that the problem is to convert any arbitrary HTML to PDF, then I don't think Zen report can do it.

Enrico Parisi · Feb 7, 2023 go to post

I would  send the message to a Business Operation and set state as deferred, then "later" (when? what trigger? from where?) using some logic, choose the message(es) and send response to that BO from somewhere (Business Service? Any other Business Host? ...to little info to know) to continue the process.

Not enough info to elaborate it further.

Enrico

Enrico Parisi · Feb 23, 2023 go to post

You need to provide a datatype for your properties, try with:

Property aaa As %Integer;

Property bbb As %Integer;

Enrico

Enrico Parisi · Feb 23, 2023 go to post

Personally I'd rather use a default numeric ID and if needed an additional UUID/GUID unique property.

To implement what you asked you can use something like:

Class My.TestClass Extends%Persistent
{
Property PrimaryUUID As%String [ InitialExpression = {$system.Util.CreateGUID()} ];Property MyOtherData As%String;

Index PrimaryUUIDIndex On PrimaryUUID [ IdKey, Unique ];
}

In this way the primary key (PrimaryUUID) is automatically assigned, no need to set it manually, in SQL is mapped as ID (as well as PrimaryUUID).

Enrico

Enrico Parisi · Feb 24, 2023 go to post

Yes, of course, I tested it and it works after adding the datatype.

How do you rebuild the indices?

Enrico

Enrico Parisi · Feb 26, 2023 go to post

I'm lazy typing, in my test I've used the portal and it worked just fine.

What version are you using?

Enrico

Enrico Parisi · Feb 26, 2023 go to post

Ciao Pietro,

there are 2 cases for routines, INT and MAC.

INT are generated when MAC is compiled but may also be written directly ("old style"), so I'd use:

do $system.OBJ.Export("*.mac,*.int","c:\temp\myexport.xml","/generated=0")

This way you export all INT and MAC but exclude generated INT.

Enrico

Enrico Parisi · Feb 26, 2023 go to post

Yes, there is, at least "everything" IRIS is aware of, so some item maybe missing but can be added.

In SMP, Iteroperability -> List -> Productions, select the production and click "Export" button.

Or, open production configuration, production settings, actions, Export button.

All production items are selected and you can manually add additional classes/components like search tables, custom schema, deployable system default settings, data transformations, etc.

Then, when you deploy your production you can also create a rollback file, in case you want to rollback, see:

https://docs.intersystems.com/irisforhealth20222/csp/docbook/DocBook.UI…

Enrico

Enrico Parisi · Mar 8, 2023 go to post

Hi Claude,

both the json samples you provide do no parse correctly, can you provide a valid json sample?

Enrico

Enrico Parisi · Mar 20, 2023 go to post

To create a custom CSP login page:

  1. Ensure that the Web Gateway user (CSPSystem) has permissions to read the database for where the custom login page is located. Assign the desired database resource to an appropriate role, and then assign that role to the CSPSystem user.

See:
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…

And...this is the demonstration that the feedback button in the documentation pages really does work!
I admit I ran into this problem sometime ago, after realizing the problem I felt the documentation had to mention that "detail"....so I pressed the feedback button and filed the request/advice.

Now that "detail" is the first step in the recipe of creating a custom login page.

Well done InterSystems Documentation team!

Now we only need to encourage people to actually read the documentation wink

Or search the community:
https://community.intersystems.com/post/custom-login-page-iris

Enrico smiley

Enrico Parisi · May 10, 2023 go to post

Supposing it's possible, does it make sense? Note that it's a genuine question, a doubt I have.

What would be the instance (i.e. $this) of the method?

Enrico

Enrico Parisi · May 10, 2023 go to post

If you are looking for actual call that have been made (and not purged), you can SQL query the table Ens.MessagHeader and look in the columns SourceConfigName and TargetConfigName.

The lines down in the production configuration are...well....derived looking/parsing the code and are not fully reliable/accurate depending on how you pass the target parameter to the SendRequestSync/SendRequestAsync methods (if you writhe the code of your Business Hosts).

Enrico

Enrico Parisi · May 10, 2023 go to post

The problem/error is importing the project/code from the global, not importing the global itself.

My guess is that the code has been exported in deployed mode without source, so it can be imported only in the same version. If so, you need the source to recompile.

Enrico

Enrico Parisi · May 10, 2023 go to post

Create a new class, say myCSP.WebSocket, that extends %CSP.WebSocket.

Add your instance method to myCSP.WebSocket class and use it as superclass of your CSP page(s).

Enrico

Enrico Parisi · May 10, 2023 go to post

In fact, even subclassing %CSP.WebSocket or adding your instance methods class as superclass would not work because all the code you write inside a CSP page run in class methods, so you cannot call an instance method.

And this brings back my initial question:

What would be the instance (i.e. $this) of the method?

None I think, within a CSP page code there is no current instance, the "page" is not instantiated, even when using %CSP.WebSocket as superclass.

But...how are you using %CSP.WebSocket??

Something like:
<CSP:CLASS SUPER="%CSP.WebSocket">

Or what/how?

Enrico

Enrico Parisi · May 16, 2023 go to post

I know this is old, but recently I found a new way to export/import a package to a global, this may simplify the solution.

1) create a studio project with all the classes that need to me exported. This can be done programmatically, create an instance of %Studio.Project, use AddItem()...etc.

2) Export the project to a global like ^IRIS.Temp("myProjExport"). Open %Studio.Project, export ot global using DeployToGbl() method

3) in target namespace import calling ##class(%Studio.Project).InstallFromGbl()

Using ^IRIS.Temp has the advantage of easy/shared access from all namespaces.

Enrico

Enrico Parisi · May 16, 2023 go to post

why would a query against a Linked Table spawn a new connection every time, wouldn't it reuse a connection?

AFAIK it should work exactly that way and reuse the existing connection.

Evidently in your case it is not reusing the existing connection and create a new connection leaving the old connection "floating".

The "kill %JDBCGateway()" suggested by WRX simply force the close connection so you don't have "floting" connections left over.

There is probably some peculiar behavior in your code......if it's not a bug in your IRIS version.

In fact connections are stored in %JDBCGateway() array, it would be interesting, after disabling the kill, to see the full content of that array before & after using the linked tables a few times.

Enrico

Enrico Parisi · May 16, 2023 go to post

In a tag-based CSP page...

 just use a class and the CSPURL parameter 

Well, that's a change of the game! 😁

Enrico