I have an IRIS persistent class with a %Stream property whose value is a JSON object. I'd like to use a SQL trigger to pull some value out of the JSON and persist it in another property, for easy querying and indexing. See below for a minimal example:
For some build scripting with the InterSystems Package Manager, I'd like to first uninstall a package with `zpm "uninstall"` and then load it from disk using `zpm "load"`. That way anything that got deleted from the source will also be deleted from IRIS.
The problem is that `zpm "uninstall"` takes in a module name and I only have the directory path to the package source. Is there a way to get the module name for an installed IPM module given the source path? It's okay to assume that it has previously been installed from that same directory with `zpm "load"`.
Is there a way to exclude specific members from a class when exporting to an XML or UDL file? Bonus question: is there a way to import from that file without overwriting those members that were excluded?
The use case is to export an interoperability production class without the ProductionDefinition XDATA. We plan to source control the production items through the Ensemble Deployment Manager, but we still need to export any custom code in the class definition itself.
I have a VS Code workspace using server-side editing with separate folders for different namespaces on the instance:
{
"folders": [
{
"name": "SYS",
"uri": "isfs://server:%SYS/"
},
{
"name": "cls",
"uri": "isfs://server:USER/?filter=*.cls"
}
]
}
The VS Code search works well to find symbols in ObjectScript files, but it searches across all folders. Is there a way to include or exclude certain folders from the search? I've tried adding some patterns to the "files to exclude" dialog, but none of these seem to work: SYS/**, /SYS/**, %.*, \%.*
I have a class using the JSON adaptor:
Class pbarton.test Extends (%RegisteredObject, %JSON.Adaptor)
{
Property Version As %String;
}
The Version property could be either a string or a number in the JSON source data. If it's a string, importing it will succeed. If it's a number, importing fails.
On an IRIS system, we expect the default string collation for SQL columns to be SQLUPPER. This means WHERE conditions will be case-insensitive. However, when I make a WHERE condition on a SQL procedure that returns a string, it's case sensitive.For example:
Class Sample.Person Extends%Persistent
{
Property Name As%String;ClassMethod Test() As%String [ SqlProc ]
{
return"Abe Lincoln"
}
} Say I've been developing a web application that uses IRIS as the back end. I've been working on it with unauthenticated access. It's getting to the point where I would like to deploy it to users, but first I need to add authentication. Rather than using the default IRIS password authentication, I'd like users to sign in with my organization's Single Sign On, or some other popular identity provider like Google or GitHub. I've read that OpenID Connect is a common authentication standard, and it's supported by IRIS. What is the simplest way to get up and running?
Example 1: a plain CSP app
I have a SOAP web service on an IRIS system. From within the code of the WebMethod I would like to log the remote IP address of the client. Is there any way to get access to the client's IP address from the ObjectScript code in the SOAP service? This will save me some headaches correlating logs from IRIS with web server logs.
Say I have a persistent class in IRIS with an optional property EmailOptIn:
Class Person Extends %Persistent
{
Property Name As %String;
Property EmailOptIn As %Boolean;
}
I later realize that I'm doing a lot of null-checking on this property where I shouldn't need to. The solution is to make this a required property:
Class Person Extends %Persistent
{
Property Name As %String;
Property EmailOptIn As %Boolean [ Required ];
}
Hello everybody! We’re happy to announce a new way to download Community Edition kits of InterSystems IRIS and IRIS for Health. The Community Edition is a no-cost developer edition that makes it easy to start developing solutions with IRIS. You can now download these kits through the Evaluation service: evaluation.intersystems.com.
If you already have an InterSystems single sign-on account (for example, to post here on the Developer Community), you can log in with those credentials. If you're new to InterSystems, please follow the link from the login page to register for a new account.
I'm working with a REST API that will sometimes rate limit our requests by returning an HTTP 429 Too Many Requests status code. Is there a good way in a business operation to handle this by throttling our requests until we get a success response? My initial thoughts are:
- Reduce the pool size on the business operation to 1 so all requests are first in, first out.
- If the API returns a 429 response,
set %rate = $get(%rate,1)*2, thenhang %rate, then send the request to the back of the queue. - If the API returns a success response,
kill %rate
ObjectScript doesn't include any built-in method for appending one JSON dynamic array to another. Here's a code snippet I use that's equivalent to the JavaScript concat() method.
Call it with any number of arguments to concatenate them into a new array. If an argument is a dynamic array, its elements will be added. Otherwise the argument itself will be added.
Hello all, I'm trying to write tests for an interoperability production using %UnitTest.TestProduction. I'd like to control the behavior of the SOAP operations so they don't actually connect to external systems when I'm testing. My first thought for this is to create a mock outbound adapter class that answers with some configured class method:
I use Documatic a lot to generate class documentation from comments embedded in the code. Is there a good way to create documentation for SQL views as well? Ideally I want to document each column in the view with HTML markup similar to how I document each method of a class with Documatic.
ObjectScript has at least three ways of handling errors (status codes, exceptions, SQLCODE, etc.). Most of the system code uses statuses but exceptions are easier to handle for a number of reasons. Working with legacy code you spend some time translating between the different techniques. I use these snippets a lot for reference. Hopefully they're useful to others as well.
For each instance of an XML-enabled class I want to control whether a property is projected as an empty element or not projected at all. With string properties, I can set the value as $c(0) for an empty element, or an empty string for no projection. But it looks like this isn't consistent for properties with type %Boolean or %Integer. With booleans $c(0) gets projected as "false". With integers $c(0) stays as a zero-width space in the XML output (which gives me a SAX parser error if I try to read it).
Is there a way to do this that works for all datatype properties?
I'm using Caché as an OAuth authorization server and I want to accept the password credentials grant type. I've found that if I make an authorize request, the Caché authorization server requires some URL parameters that shouldn't be required in password grant (redirect_uri, state, scope, and response_type). If I include these parameters, it calls my DirectLogin() method instead of just calling ValidateUser() as I would expect from the docs. I have two questions:
1. Why does the authorize request fail without these additional parameters?
The Link() method of %CSP.Page claims to take a link and an array of query parameters and transform them into a URL. The documentation is here. But when I pass in query parameters, they aren't included.
What am I missing?
This might be more of a math problem than a Caché question.
I have a SQL query that joins two tables. I want to assign a unique ID to each row of the product table.
- I could append the GUIDs of the rows in the two tables, but there are a number of clients that expect a maximum length of 50 on this unique ID. Two GUIDs appended make 72 characters.
- I could append the two GUIDs and then truncate the result, but now I'm worried about collision.
What's the chance of collision if I append the GUIDs and truncate the result to 50 characters? Is there a good way to solve this without updating the clients?
I want to limit the length of the value of a textarea in Zen. In HTML the textarea element has a 'maxlength' attribute, but the Zen component doesn't have an equivalent property. Is there any way to add a maximum length in Zen short of creating my own custom component?
I'm purging a lot of management data from an Ensemble production, which is creating 100s of GBs of journals. Has anybody succeeded in disabling journaling on an Ensemble purge? The user interface doesn't have an option for this, but I'm thinking you might be able to identify the process and externally disable journaling on it.
I'd like to include a .inc file in a tag-based CSP page. The include file defines a bunch of macros that I want to use in CSP runtime expressions. Is there any way to do this?
When I try to open an HTML file from the Server Explorer, it fails with the error message "Failed to create the part's controls". HTML files open without any problem from the Atelier Explorer.
Has anyone else had this problem?
It would be nice if there were a permalink displayed for each comment. That way I could bookmark or send a link to a specific comment. I can see links to my own comments in the My Account page, but I don't see any way to get permalinks for other people's comments.
Say you have a global in one database that you instead want to map from a different database. If you just create a global mapping to the new database, the existing global will become inaccessible because it still lives on the old database. The documentation notes this problem here but doesn't give details on how to fix it.
I thought I'd share some issues I had today with Zen development in a custom component. Say we have created a Zen composite component with a few javascript methods that modify its child components. In order to modify these components, we can use something like the following method:
{
var component = this.getChildById('Control1');
component.setValue('');
}
In JavaScript methods on the client, this refers to the current component or page. The equivalent for expressions that are values of XML attributes is zenThis (see documentation).
I'd like to have an array as a parameter for a SQL 'WHERE... IN' statement. The array would be modified in javascript on the browser. Here's a simplified example:
<tablePane width="25%" id="testTable" sql="SELECT Id from Tracking_Data.Person WHERE Id IN (?)" showQuery="true">
<parameter/>
</tablePane>
<button caption="Test" onclick="zenThis.composite.testTestTable();"/>
ClientMethod testTestTable() [ Language = javascript ]
{
var table = zenThis.composite.getChildById("testTable");
table.setProperty('parameters', 1, [1,2]);
}