Question Pravin Barton · Apr 25 Possible to export a class without specific members? 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. #Interoperability #ObjectScript #Ensemble #Health Connect #InterSystems IRIS #InterSystems IRIS for Health 0 3 0 123
Question Pravin Barton · Sep 12, 2023 How to exclude folders from VS Code ObjectScript search I have a VS Code workspace using server-side editing with separate folders for different namespaces on the instance: #VSCode 0 3 0 426
Question Pravin Barton · Apr 18, 2023 Allow string or number values for a property with JSON adaptor 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. #JSON #InterSystems IRIS 0 1 0 273
Question Pravin Barton · Apr 7, 2023 How can I change the default string collation of a SQL stored procedure? 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: #SQL #InterSystems IRIS 0 2 0 317
Article Pravin Barton · Sep 1, 2022 4m read Using OAuth 2.0 / OIDC for single sign-on to an IRIS REST application 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? #Best Practices #OAuth2 #REST API #InterSystems IRIS 7 2 3 968
Question Pravin Barton · Aug 11, 2022 How to get IP address of client calling SOAP web service 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. #SOAP #InterSystems IRIS 0 2 1 657
Article Pravin Barton · May 12, 2022 1m read Making an existing property Required in a Persistent class 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: #SQL #InterSystems IRIS 6 7 0 463
Announcement Pravin Barton · Nov 2, 2021 Introducing the Evaluation Service for Community Edition Downloads 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. #InterSystems IRIS #InterSystems IRIS for Health 6 3 2 1.4K
Question Pravin Barton · Jun 14, 2021 How to deal with rate limiting in a Business Operation 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: #Business Operation #Interoperability #InterSystems IRIS 0 1 0 268
Article Pravin Barton · May 1, 2020 1m read Code sample to concatenate JSON arrays 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. #Code Snippet #JSON #InterSystems IRIS 5 2 3 749
Question Pravin Barton · Aug 23, 2019 Testing interoperability productions without connecting to external systems 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: #Interoperability #Ensemble 0 4 1 263
Question Pravin Barton · Apr 3, 2019 Best way to document a SQL view 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 #SQL #Caché #InterSystems IRIS 0 2 0 587
Article Pravin Barton · Mar 28, 2019 2m read ObjectScript error handling snippets 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. #Best Practices #Code Snippet #Error Handling #ObjectScript #Caché #InterSystems IRIS 24 5 21 3.5K
Question Pravin Barton · Nov 20, 2018 How to XML project a Boolean/Integer property as an empty element 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? #Object Data Model #XML #Caché 0 2 0 591
Question Pravin Barton · Sep 6, 2018 Using Caché OAuth 2.0 authorization server with password grant 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: #Caché #OAuth2 1 3 1 688
Question Pravin Barton · Apr 2, 2018 Link method of %CSP.Page doesn't add query 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. #CSP #Caché 0 1 0 443
Question Pravin Barton · Jan 31, 2018 How to assign unique IDs to rows in the product of a table join 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. #SQL #Caché 0 12 0 1.7K
Question Pravin Barton · Oct 30, 2017 How to put a character limit on a textarea? 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? #ZEN #Caché 1 3 0 687
Question Pravin Barton · Aug 1, 2017 Disable journaling on an Ensemble data purge 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. #Ensemble #Journaling 0 3 0 919
Question Pravin Barton · May 24, 2017 How to include a macro file in a CSP page 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? #CSP #Caché 0 3 0 471