David Hockenbroch · Feb 1, 2022 go to post

Are you trying for the Cache driver, or the IRIS driver? I'm pretty sure the 3.0.0 jar you're using is an IRIS driver, and in that case, the driver is com.intersystems.jdbc.IRISDriver, not com.intersys.jdbc.CacheDriver (note that in that transition, the beginning of the package changed from com.intersys to com.intersystems.)

David Hockenbroch · Jan 17, 2022 go to post

I've never done that, but if you add it as a menu item, can you then go to View -> Toolbars -> Customize and find it in the commands tab? And if so, can you drag it to the toolbar you want it on from there?

David Hockenbroch · Jan 12, 2022 go to post

Depending on your needs, you might consider creating a class that extends both %Net.HttpRequest and %JSON.Adaptor and using the %JSON.Adaptor methods to create a JSON representation of the instance. That would be easier to analyze.

David Hockenbroch · Jan 11, 2022 go to post

Your result.HttpResponse.Data can be either a string or a stream object. If it's a stream object you'll have to handle it a little bit differently using result.HttpResponse.Data.Read():

set response=result.HttpResponse.Data.Read()
while 'result.HttpResponse.Data.AtEnd{
    set response = response_result.HttpResponse.Data.Read()
}
David Hockenbroch · Jan 7, 2022 go to post

This is a long shot, but is the ODBC connection defined in User DSN or System DSN? We had an issue after a recent round of Windows updates where Excel suddenly wasn't always correctly seeing the System DSN connection, and setting it up under User DSN instead resolved that issue.

David Hockenbroch · Jan 7, 2022 go to post

Here is some useful documentation.

You're going to want to make a class that extends %CSP.REST and set up an application that uses that class as its dispatch class. You'll have a URL map in that class to tell IRIS or Cache what to do with the request. Depending on your specific application, you might also want to get familiar with using %request and %response in that process.

David Hockenbroch · Dec 22, 2021 go to post

If you're using the IRIS ODBC driver, try switching to the IRIS ODBC35 driver. This kind of error may mean that the application is expecting the driver to do some ODBC 3.x stuff that the older driver might not be capable of.

David Hockenbroch · Dec 22, 2021 go to post

The ones in italics are the ones that are a part of your current project. If you click on the Project tab, they'll show up there too.

David Hockenbroch · Dec 13, 2021 go to post

You can also open your log4j.jar as you would a zip file, go to the META-INF folder, open MANIFEST.MF and look for "Implementation-Version" to see which version of log4j it is.

David Hockenbroch · Dec 3, 2021 go to post

In your class definition, if you wanted a maximum length of 1000 as an example, you would define your string as:

Property mystring As %String (MAXLEN = 1000);

But as Robert has already pointed out, if you're dealing with something very large, it's better to use some sort of %Stream instead.

David Hockenbroch · Dec 2, 2021 go to post

If I try to replicate some of these steps in my instance of Cache 2016, I get an error at:

Set httpRequest.Https = $$$YES

Does it make a difference if you try:

Set httpRequest.Https = 1

David Hockenbroch · Dec 1, 2021 go to post

..Adapter.SSLConfig should get you the name of the SSL Configuration that the adapter is using. The property of the %Net.HttpRequest is called SSLConfiguration. So it should be:

set httpRequest.SSLConfiguration = ..Adapter.SSLConfig
David Hockenbroch · Nov 23, 2021 go to post

In that case, does it meet your needs to make it a list of %String instead of making a separate class?

David Hockenbroch · Nov 23, 2021 go to post

When you're projecting a list of a class to XML, you usually have a parent element for each of those objects, then a separate element for each of it's properties. So I think what you'd need to do would be something more like:

<Results>
    <PersonIDs>
        <PersonID>
            <PersonID>1000000</PersonID>
        </PersonID>
        <PersonID>  
            <PersonID>1000001</PersonID>
        </PersonID>  
        <PersonID>  
            <PersonID>1000005</PersonID>
        </PersonID>  
    </PersonIDs> 
</Results>

So that the outer PersonID element indicates your PersonID object, and the PersonID inside of that is the PersonID property of that object.

David Hockenbroch · Nov 22, 2021 go to post

Jacquie, I did that a couple of weeks ago, but the challenge is still "pending" even though the review was published by Gartner. How long should we expect it to take to get approved?

David Hockenbroch · Nov 18, 2021 go to post

Here's a possible alternative to using SqlComputeCode.

You can override the getter method for that property so that it always returns the related document name. In your Question class, define your docFileName property as:

Property docFileName As %String [ReadOnly];

You'll want it to be read only because you aren't going to want to be able to set this property in the question object. You're going to want to retrieve it from the document object. If it could also be set here, you'd have things weirdly out of sync. Then, in that same class, include the following method:

Method docFileNameGet() As %String{
    if ..Document '= ""{
        return ..Document.FileName
    }
    else{
        return ""
    }
}

Once you do that, whenever you refer to the question's docFileName, it'll give you the document's file name, or an empty string if there isn't one.

David Hockenbroch · Nov 18, 2021 go to post

I don't think you can reference relationships in SqlComputeCode, so I'm not sure how you'd do this. But out of curiosity, why have a calculated field in the question class rather than just referring to it as Document.FileName (or Document->FileName in SQL)?

David Hockenbroch · Nov 17, 2021 go to post

You're exactly right; by default, the contents of the dataCombo are empty until the user clicks on it, then the query gets executed. If you set the cached property of the dataCombo to 1, it'll load as soon as the page loads instead.

David Hockenbroch · Nov 16, 2021 go to post

Rochdi, when you say you've figured out how to save it to C:\Temp\filename.csv, are you saying you have it saved on the client, or on the server?

If it's saving the file on the server, you can create a class that extends %CSP.StreamServer, then override the OnPreHTTP and OnPage class methods like this for simple text files:

Class fileserver Extends %CSP.StreamServer{ClassMethod OnPreHTTP() As %Boolean{do %response.SetHeader("Content-Type","text/csv")do %response.SetHeader("Content-Disposition","attachment;filename=""myfile.csv""")quit 1}ClassMethod OnPage() As %Status{set file = ##class(%File).%New("/path/to/file.csv")do file.Open("R")while file.AtEnd '= 1{write file.ReadLine(),!}quit $$$OK}}

and then just link to it that page to download.

Once you get to things that aren't plain text, it gets a little more complicated, but this should work for a simple csv.

David Hockenbroch · Nov 13, 2021 go to post

I'm glad you found it helpful, Nigel. A fair number of our customers are still on Cache 2018. That required additional licensing costs for Ensemble, which is why I've done some of these automation projects this way. I didn't have Ensemble as an option! The Task Manager has been sufficient for our needs so far.

David Hockenbroch · Nov 11, 2021 go to post

To use something in the task scheduler, you have to create a class that extends %SYS.Task.Definition. Within that class you have to define:

Method OnTask() As %Status{
    //The stuff you want to happen when the task is scheduled goes here.
    //In your case, that probably means calling your task method.
}

If that method is not defined, you get the "Not Implemented" error. If you've created such a class, make sure the method had the right name, isn't a classmethod, is As %Status, and does return a %Status. Also make sure the class is compiling correctly.

David Hockenbroch · Nov 11, 2021 go to post

There's a syntax error in this line:

Set tRS = ##class(%SQL.Statement).%ExecDirect(, "Select ID From %SYS.Task Where Namespace = ? And TaskClass = ?", PICIS, "picis.core.tasks.senddelayedtrigger")

PICIS needs to be in quotes.

That wouldn't typically cause a not implemented error, though. Are you getting any errors when you try to compile the class?

David Hockenbroch · Nov 5, 2021 go to post

Your result set should be an EnsLib.SQL.GatewayResultSet, which has a method called GetSnapshot(). That method has you pass a EnsLib.SQL.Snapshot by reference. You're probably going to want to set the FetchAll parameter on the GetSnapshot() method to 1 so it gets all the results, but you can also create your EnsLib.SQL.Snapshot before using GetSnapshot() and set it's starting row and max rows if you'd like. Then you can iterate over the snapshot instead of the result set. Once you've gone through it once, you could either create a new snapshot by calling the GetSnapshot() method again, or you can use the snapshot's Rewind() method.

David Hockenbroch · Nov 4, 2021 go to post

According to this page, if it's something that still in development, you can use the CleanProduction() method to clear the message queues. Using it in a live system isn't recommended because it clears out everything pretty indiscriminately, but it's useful for debugging.

Productions get the suspend status when after shutting down there are still synchronous messages that could not be processed.

David Hockenbroch · Nov 2, 2021 go to post

You'll need the resource %Admin_Task to use task manager functions.

Once you have access to it, set up a class that extends %SYS.Task.Definition and override the OnTask() method. Then you can set it up in the task scheduler and it'll run the OnTask() method according to whatever schedule you set.

David Hockenbroch · Nov 2, 2021 go to post

It looks like where you defined your method, it takes zero arguments. When you're calling it, you're providing two. That would make the event not work properly.