Search

Clear filter
Announcement
Kevin Xu · Jul 14

Advisory for IRISSECURITY in InterSystems IRIS 2025.2

InterSystems IRIS 2025.2 introduces the IRISSECURITY database, the new home for security data. Unlike IRISSYS, the previous home for security data, IRISSECURITY can be encrypted, which secures your sensitive data at rest. In a future version, IRISSECURITY will be mirrorable. This version also introduces the %SecurityAdministrator role for general security administration tasks. The changes described here affect both continuous delivery (CD) and extended maintenance (EM) release tracks. That is, starting with versions 2025.2 (CD, released on 23 July, 2025) and 2026.1 (EM), InterSystems IRIS will include the IRISSECURITY database, and all security data is automatically moved from IRISSYS to IRISSECURITY when you upgrade. Before You Upgrade IRISSECURITY makes several potentially breaking changes to how users interact with security data: Users can no longer directly access security globals without %All and must instead use the APIs provided by the various security classes. OAuth2 globals can no longer be mapped to a different database. Users can no longer arbitrarily query security tables, even when SQL security is disabled. System databases now use predefined resources that cannot be changed. On Unix, if you created and assigned a new resource to a system database in a previous version, it will be replaced by the predefined resource when you upgrade (though if any roles reference the non-default resource, they must be changed manually to use the default resource to keep database access). On Windows, you must change the resource back to the default. If you attempt to upgrade on Windows while databases have non-default resources, the upgrade will halt (the instance is not modified) and display an error message "Database must have a resource label of..." The following sections go into detail about these changes and what you should do instead if you depended on the original behavior, but in general, before you upgrade, you should verify and test that your applications and macros: Use the provided security APIs to administer security (as opposed to direct global access). Have the necessary permissions (%DB_IRISSYS:R and Admin_Secure:U) for using those APIs. Global Access Previously, when security globals were stored in the IRISSYS database, users could access security data with the following privileges: %DB_IRISSYS:R: Read security globals both directly and through security APIs. %DB_IRISSYS:RW: Read and write security globals. %DB_IRISSYS:RW and Admin_Secure:U: Administer security through security APIs. In InterSystems IRIS 2025.2: Users can no longer access security globals directly without %All. Both %DB_IRISSYS:R and %Admin_Secure:U are the minimum privileges needed to both access security data (through the provided security APIs) and administer security through the various security classes. For general security administration, you can use the new %SecurityAdministrator role. Read-only access to security data (previously available through %DB_IRISSYS:R) has been removed. Global Locations In InterSystems IRIS 2025.2, the following security globals have been moved from IRISSYS to the ^SECURITY global located in IRISSECURITY: ^SYS("SECURITY") ^OAuth2.* ^PKI.* ^SYS.TokenAuthD The following table lists the most notable globals that have been moved, their security classes, old locations, and new locations: Security Class Old Location (IRISSYS) New Location (IRISSECURITY) N/A ^SYS("Security","Version") ^SECURITY("Version") Security.Applications ^SYS("Security","ApplicationsD") ^SECURITY("ApplicationsD") Security.DocDBs ^SYS("Security","DocDBsD") ^SECURITY("DocDBsD") Security.Events ^SYS("Security","EventsD") ^SECURITY("EventsD") Security.LDAPConfigs ^SYS("Security","LDAPConfigsD") ^SECURITY("LDAPConfigsD") Security.KMIPServers ^SYS("Security","KMIPServerD") ^SECURITY("KMIPServerD") Security.Resources ^SYS("Security","ResourcesD") ^SECURITY("ResourcesD") Security.Roles ^SYS("Security","RolesD") ^SECURITY("RolesD") Security.Services ^SYS("Security","ServicesD") ^SECURITY("ServicesD") Security.SSLConfigs ^SYS("Security","SSLConfigsD") ^SECURITY("SSLConfigsD") Security.System ^SYS("Security","SystemD") ^SECURITY("SystemD") Security.Users ^SYS("Security","UsersD") ^SECURITY("UsersD") %SYS.PhoneProviders ^SYS("Security","PhoneProvidersD") ^SECURITY("PhoneProvidersD ") %SYS.X509Credentials ^SYS("Security","X509CredentialsD") ^SECURITY("X509CredentialsD ") %SYS.OpenAIM.IdentityServices ^SYS("Security","OpenAIMIdentityServersD") ^SECURITY("OpenAIMIdentityServersD") OAuth2.AccessToken ^OAuth2. AccessTokenD ^SECURITY("OAuth2.AccessToken ") OAuth2.Client ^OAuth2.ClientD ^SECURITY("OAuth2.Client") OAuth2.ServerDefinition ^OAuth2.ServerDefinitionD ^SECURITY("OAuth2.ServerDefinitionD") OAuth2.Client.MetaData ^OAuth2.Client.MetaDataD ^SECURITY("OAuth2.Client.MetaDataD") OAuth2.Server.AccessToken ^OAuth2.Server.AccessTokenD ^SECURITY("OAuth2.Server.AccessTokenD") OAuth2.Server.Client ^OAuth2.Server.ClientD ^SECURITY("OAuth2.Server.ClientD") OAuth2.Server.Configuration ^OAuth2.Server.ConfigurationD ^SECURITY("OAuth2.Server.ConfigurationD") OAuth2.Server.JWTid ^OAuth2.Server.JWTidD ^SECURITY("OAuth2.Server.JWTidD") OAuth2.Server.Metadata ^OAuth2.Server.MetadataD ^SECURITY("OAuth2.Server.MetadataD") PKI.CAClient ^PKI.CAClientD ^SECURITY("PKI.CAClient") PKI.CAServer ^PKI.CAServerD ^SECURITY("PKI.CAServer") PKI.Certificate ^PKI.CertificateD ^SECURITY("PKI.Certificate") %SYS.TokenAuth ^SYS.TokenAuthD ^SECURITY("TokenAuthD") OAuth2 Global Mapping Previously, you could map OAuth2 globals to a different database, which allowed OAuth2 configurations to be mirrored. In InterSystems IRIS 2025.2, OAuth2 globals can no longer be mapped, and IRISSECURITY cannot be mirrored. If you depended on this behavior for mirroring, you can use any of the following workarounds: Manually make changes to both the primary and failover. Export the settings from the primary and then import them to the failover (requires %ALL). To export OAuth2 configuration data: set items = $name(^|"^^:ds:IRISSECURITY"|SECURITY("OAuth2"))_".gbl" set filename = "/home/oauth2data.gbl" do $SYSTEM.OBJ.Export(items,filename) To import OAuth2 configuration data: do $SYSTEM.OBJ.Import(filename) SQL Security Previously, SQL security was controlled by the CPF parameter DBMSSecurity. When DBMSSecurity was disabled, users with SQL privileges could arbitrarily query all tables in the database. In InterSystems IRIS 2025.2: The DBMSSecurity CPF parameter has been replaced with the system-wide SQL security property. You can set this in several ways: Management Portal: System Administration > Security > System Security > System-wide Security Parameters > Enable SQL security SetOption: ##class(%SYSTEM.SQL.Util).SetOption("SQLSecurity", "1") Security.System.Modify: ##Class(Security.System).Modify(,.properties), where properties is properties("SQLSecurity")=1 Security tables can now only be queried through the Detail and List APIs, which require both %DB_IRISSYS:R and %Admin_Secure:U even when SQL security is disabled. For example, to get a list of roles, you can no longer directly query the Security.Roles table. Instead, you should use the Security.Roles_List() query: SELECT Name, Description FROM Security.Roles_List() Encrypting IRISSECURITY To encrypt IRISSECURITY, use the following procedure: Create a new encryption key. Go to System Administration > Encryption > Create New Encryption Key File and specify the following: Key File – The name of the encryption key. Administrator Name – The name of the administrator. Password – The password for the key file. Activate the encryption key. Go to System Administration > Encryption > Database Encryption and select Activate Key, specifying the Key File, Administrator Name, and Password from step 1. Go to System Administration > Encryption > Database Encryption and select Configure Startup Settings. From the Key Activation at Startup dropdown menu, select a key activation method. InterSystems highly recommends Interactive key activation. From the Encrypt IRISSECURITY Database dropdown, select Yes. Restart your system to encrypt IRISSECURITY. Percent-class Access Rules In previous versions of InterSystems IRIS, the procedure for managing a web application’s access to additional percent classes involved writing to security globals. You can accomplish this in InterSystems IRIS 2025.2 through the Management Portal or the ^SECURITY routine. Management Portal To create a percent-class access rule with the Management Portal: Go to System Administration > Security > Web Applications. Select your web application. In the Percent Class Access tab, set the following options: Type: Controls whether the rule applies to the application’s access to just the specified percent class (AllowClass) or all classes that contain the specified prefix (AllowPrefix). Class name: The percent class or prefix to give the application access to. Allow access: Whether to give the application access to the specified percent class or package. Add this same access to ALL applications: Whether to apply the rule for all applications. ^SECURITY To create a class access rule with the ^SECURITY routine: From the %SYS namespace, run the ^SECURITY routine: DO ^SECURITY Choose options 5, 1, 8, and 1 to enter the class access rule prompt. Follow the prompts, specifying the following: Application? – The name of the application. Allow type? – Whether the rule applies to the application's ability to access a particular class (AllowClass) or all classes that contain the specified prefix (AllowPrefix). Class or package name? – The class or prefix to give the application access to. Allow access? – Whether to give the application access to the specified class or package. IRISSECURITY cannot be mirrored, yet*. 😎 an active project now
Article
Derek Gervais · Sep 8

How to get InterSystems IRIS Community Edition

Hey folks! Having recently onboarded to InterSystems, I realized that despite having a totally free and awesome Community Edition, it's not super clear how to get it. I decided to write up a guide highlighting all the different ways you can access the Community Edition of InterSystems IRIS: Get InterSystems IRIS Community Edition as a Container Working with a containerized instance of the Community Edition is the recommended approach for folks who are new to developing on InterSystems IRIS, and in my opinion it's the most straightforward. InterSystems IRIS Community Edition can be found on DockerHub; if you have an InterSystems SSO account, you can also find it in the InterSystems Container Registry. In either case, you'll want to pull the image you want using the docker CLI: docker pull intersystems/iris-community:latest-em // or docker pull containers.intersystems.com/intersystems/iris-community:latest-em Next, you'll need to start the container: In order to interact with IRIS from outside the container (for example, to use the management portal) you'll need to publish some ports. The following command will run the IRIS Community Edition container with the superserver and web server ports published; note that you can't have anything else running that depends on ports 1972 or 52773! docker run --name iris -d --publish 1972:1972 --publish 52773:52773 intersystems/iris-community:latest-em Get InterSystems IRIS Community Edition in the Cloud You might want to avoid having to deal with a local installation entirely; if that's the case, you can get up and running with a cloud deployment of InterSystems IRIS Community Edition. All major cloud providers are supported; check our Cloud Partners page for more information. For this example, we're going to focus on deploying on AWS. Start by finding the InterSystems IRIS Community Edition on the AWS Marketplace: You can click "View purchase options" and log into your account to view the subscription page: Scrolling down, you can click "Subscribe," fill out the required information, and then click "Deploy" to deploy the IRIS Community Edition as a cloud node! Check out our documentation on deploying InterSystems IRIS to the cloud for more information. Get InterSystems IRIS Community Edition as an Install Kit If you prefer to work with InterSystems IRIS installed directly to your machine and you don't want to deal with containers, you can download an install kit for your system from the InterSystems Evaluation Service. In order to download an install kit, you'll need an InterSystems SSO login; the good news is, if you have an account here on the Developer Community you already have one! Otherwise, you can click "Register for a new account" and complete the steps that follow: Once you've logged in, you should see the following page; click "Download Community Edition" to begin downloading the install kit: You'll be prompted to fill out some information on exactly which version of InterSystems IRIS you need, and which platform you will be installing it on: For most use cases, you'll want to select "InterSystems IRIS Community" and the most recent version available for your platform. After agreeing to the TOS, you're ready to download the install kit! Follow the installation instructions in the platform-specific documentation, and you're all set!
Announcement
Evgeny Shvarov · Jun 9, 2019

InterSystems ObjectScript is Supported by GitHub

Hi Community! I have very good news for the developers, who are using GitHub to host projects with InterSystems ObjectScript. GitHub introduced the support of InterSystems ObjectScript this week! How does it work? Now all the .cls files in your repository are considered as InterSystems ObjectScript and highlighted according to the language rules of ObjectScript. For example WebTerminal, Samples-Data. All the credits go to @Dmitry.Maslennikov, who is developing VSCode ObjectScript module and code highlighting of VSCode and GitHub both use TextMate grammar. Dmitry had introduced the PR to Github Linguist which was reviewed by the GitHub community and has been recently approved. So your repositories with cls will no longer go as strange Apex or TeX but as InterSystems ObjectScript. Thanks, Dmitry! Hope you'll provide the details on how ObjectScript is supported in GitHub. Great news!Coloring works, but still APEX, VB, TeX. Commit triggered a recalculation. Great news, congratulations!P.S. Special thanks to Evgeny for pointing out to exactly WebTerminal's analytics class :) I have published a little bit more details. And there you can find info, how to count and highlight the source of MAC, INT, INC files as well. Thank you @Dmitry.Maslennikov and @Evgeny.Shvarov this is great news! You are welcome, Nikita! This was pretty random but must admit that WebTerminal is a really popular app. And looking forward to seeing the commit to make the repo considered as InterSystems ObjectScript application ;) Thanks a lot @Dmitry.Maslennikov !
Question
Kevin Furze · Aug 15, 2019

intersystems Open exchange suggestion

I've just been tempted to the option exchange (curiosity) and when browsing, I often right-click, and open links in a new tab, eventually ;-) I have enough interesting open tabs to go off and read the tabbed articles,I can't do this in open exchange, it will only allow a direct click to open the url.even worse, when I come back (to where I left off) It starts from the top of the page.any chance of changing the url's to allow us to right click and open in a new tabI'm guessing that this applies to may other URL's around the intersystems community, but it's the first time it annoyed me. kev Hi Kevin!This is fixed. Check the new UX. Evgeny.I've played with the links, much better, thumbs up, one thing, and it may be my imagination.if you open a link (new tab or otherwise), it seems to jump part way down the article.could you tweak it, so that it opens at the top of the new page please.subtle, but would helpkev Hi Kevin!Thanks for the feedback!This is a good point. Submitted an issue. If this describes the problem right?
Question
Luis-Ángel Pérez-Ramos · Jun 17, 2019

Intersystems IRIS Dialect for HIBERNATE

Good morning!I am developing a Java project (Spring Boot + Maven + Hibernate) but I've a big issue when I try to define the Hibernate Dialect org.hibernate.dialect.InterSystemsIRISDialect... that dialect is neither in the Hibernate library nor in the IRISDriver class com.intersystems.jdbcHow should I define the IRISDialect in my project? Thank you in advance! I think there may be another jar, probably available from hibernate.org, which has the driver. I don't know for certain, but I think that is how things work. Note "org.hibernate.dialect" as the prefix of the URL means that hibernate has and owns the driver, including its support.Just my two cents,Jonathan Thank you Jonathan for your answer, but I don't find any reference to InterSystemsIRISDialect in any page of Hibernate.It's mysterious... The dialect of Intersystems IRIS being approved in the hibernate git repository.The depot managers want to stop the "support" of the Cache dialect to position the IRIS one.https://github.com/hibernate/hibernate-orm/pull/2335 Unfortunately, deployment of the Hibernate dialect for InterSystems IRIS is still a bit of a work in progress: https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=BTPI_hibernate There's an old dialect for Caché in the Hibernate distribution itself, but the IRIS dialect lives in a handful of files that you can get from the WRC. I created a new dialect see: https://community.intersystems.com/post/using-new-intersystems-iris-hibernate-6-dialect-springboot-project
Question
Ashish Gupta · Feb 1, 2019

Intersystems Cache & Security Standards

Hi All, Can someone help me getting the security features & standards which InterSystmes Cache adheres to ISO 27001 & other security & privacy standards. Also if you can tell me the algorithm used for database encryption & key strength by default. This is required for a security audit. Thanks in advance. Ashish Check Cache Security Administration Guide. And also this article. You might be interested in this page: https://docs.intersystems.com/ens20181/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_standards Or potentially some of the documents on this one: https://www.intersystems.com/gt/ Database encryption uses AES. You select the key size when creating the key; 128, 192, and 256 bits are all options. If you have a specific question about standards not covered there, I would recommend contacting the WRC.
Announcement
Anastasia Dyubaylo · Aug 5, 2022

New Rubric "InterSystems Memes"

Hi Community! While we're on a roll with new ideas for the Developer Community, we decided to also give the credit where the credit is due (meaning you, our dearest members), and share your creativity and imagination with others. We're going to introduce a new rubric "InterSystems Memes"! 😜 A month ago we launched a challenge on Global Masters where we asked you to post memes that make you smile. We had a lot of fun seeing all the entries so we decided to share this merriment with all DC members! We'll be posting your memes in special fun announcements on DC soon. Stay tuned! 😝 Have an idea for a new meme related to ISC technology? Don't hesitate to share the memes in the comments to this post as well. We're going to restart the challenge and every month we will choose the best memes and publish them here, on Developer Community, so that every member has a good laugh ;) Join the fun as an author of the memes, or as a reader!
Discussion
Erik Svensson · Sep 18, 2020

Intersystems Mirroring of code databases

Hello! First of all, let me state that I am no senior InterSystems expert. In my organization, we have a HealthShare Health Connect setup where each namespace has one code database and one data database, which are both actively mirrored. We have two nodes in the mirror. We had a controlled failover last night to make sure that the backup node works as intended, which it didn't. It turned out that we had only deployed code onto the primary node in several namespaces causing errors with missing classes after the failover. So it seems that each time you deploy productions, you have to manually deploy it to both instances (the primary and failover). That makes me wonder: What is actually mirrored when you mirror a code database Obviously not new classes changes to existing classes? settings on the production adapters? something else? How do you guys go about deploying new code? Are you utilizing some kind of automation tool to keep the mirrored nodes consistent regarding code and versions of code? Are you just manually deploying to each node and have good routines doing it? Or do we have some kind of faulty setup which makes this not work as intended? I don't think our setup is faulty, I think we just missed this a bunch of times which makes me want to abstract this to a way where you deploy to something that deploys the same code to both nodes. An example: We have 3 environments (production, QA and test), for each of QA and prod, we receive webservice requests from 2 different networks, an internal network and an external one. For each network, we have a pair of web servers running httpd with web gateway. This makes 4 web server hosts for each production and qa environment and in the test environment, we have slimmed this to only have the one pair. Totally 10 web servers. This is bound to be time consuming to maintain and create inconsistency and details that is not done exactly the same between the hosts if you are not extremely thorough, if you would do it manually. So we use Ansible. I have made a playbook and a set of configs for each environment and each network type so each pair is treated exactly the same and the playbook is always used to deploy changes and keep consistency. I would like to achieve something similar with deploying code to our HeathConnect mirrored instances. How do you guys do it? #1) check that ALL code Dbs are part of your Mirror. There is a fair chance that not all code you use is in a single code DB but is mapped to other DBs.I'm not talking about implicitly mapped pieces like all System and %* Utilities.#2) If you use code mapping It is highly important that Package mapping AND routine mapping go hand in hand#3) Whatever Mirror is synchronizing is based on Global Journal. So also all code DBs require Journalling. Since every routine or class whether deployed or not is stored in some global. But my personal preference is not to apply Mirror to code DBs.Mainly to control the point in time when a Change/Update happens. I'm a fan of the Red Fire Button and like to control the moment of essential changes Hi Robert, Seeing as how I'm fighting the same issue (keeping mirror members synched, not code DBs though), what does the "Red Fire Button" refer to? Thanks, Dan Definitely, something wrong in the configuration. Code in InterSystems in fact is no different from any other data stored there. So, you may have some wrong mappings, or store some of your code in %SYS. I have a configuration with mirroring + ECP, and it works perfectly, I don't even care which of the nodes is primary, and can switch it any time, with no issues. And I have even more than one Code databases, and more than 20 Data databases. Mirroring Nodes works on 2018.1 while ECP Application Servers on 2012.2, with no issues. If you have some doubts about your configuration, you can ask for help through WRC, or we can help you with it, we can review your settings, and say what actually happened and how to solve it Hi @Dan.Pahnke The "Red Fire Button" is a synonym I used over the years with my various teams for an action/decisionthat should not be taken by a single person but follows (at least) the 4-eyes-principle. Inspired by an endless number of Airforce fighting movies from Hollywood andthe old but still incredible song from The Dubliners.And its best cover version The issue was that the general package mappings we had in %ALL namespace was not mirrored and they were not mapped in the backup node.
Question
José Ademar de Oliveira Junior · Jan 6, 2022

REST APIs with Intersystems technolgy

Hello developers, I'm a newbie to Intersystems technologies and I started to work with Caché and Ensemble, and to be more specific I'm working with systems integration. In a scenario where I need to develop new software from scratch, would it be better to develop this new software using REST APIs? Does anyone have any recommendations about courses? 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. https://community.intersystems.com/post/learning-path-beginnershttps://community.intersystems.com/post/intersystems-iris-rest-application-patternshttps://community.intersystems.com/post/objectscript-rest-api-cookbook Hi.I've used Cache/IRIS Native Provider, but recently I'm moving all my apps to REST. It is OS/IDE independent and commonly used. Cache/IRIS REST API services are very efficient and very easy to use. Recommended. Regards, Matjaž.
Question
Joseph Lovato · Aug 5, 2021

Intersystems Cache Studio Download

I am unable to download Cache Studio from the Intersystems web page. The download link times out. https://www.intersystems.com/developing-with-intersystems-iris/ Scroll down and click on 'Studio'. Spins then times out. @Andreas.Dieckow can you provide any insight? Joe I think this may happen, due to some issues with availability of some internal services. In any way it’s now possible using VSCode for development with InterSystems versions 2016.2 and later. So, I would recommend using it instead. Documentation doc.intersystems.com has been down for the last week which is where the link takes you to download You can use VSCode with the ObjectScript plugin while Studio is not available Thanks! We thought it was very temporary. We'll try the VSCode extension.
Question
Daniel Durdin · Oct 10, 2024

New to working with files in Intersystems

Hi there, I'm hoping that someone may be able to point me in the right direction to get started with working with files in Intersystems. I am currently trying to build an interface that will consume a text file containing a list of IDs (one per line) and then write those IDs to an external database. I am comfortable working with the database end but have not worked with files/Stream containers etc yet. I am struggling with the BP logic as I can't figure out how to access the data within the stream container. My Trace Statements don't appear in the management console when checking despite Trace Logging enabled on the BP. I really appreciate your time and your help, Thanks Dan My rudimentary ObjectScript looks as follows: Class ELHTPRODPKG.Interfaces.LancsCare.Processes.LancsCareCSVProcess Extends Ens.BusinessProcess{ Method OnRequest(pRequest As Ens.StreamContainer, Output pResponse As %Persistent) As %Status{ Set sc = $$$OK // Create a new stream to read the content $$$TRACE("Step 1") Set tStreamFile = pRequest.StreamGet() Set fileContent = tStreamFile.Read() $$$TRACE("File Content: "_fileContent) //Set pResponse = sc //Return the status of the operation Quit sc // Return status} start here in docs Hi Robert, Thanks for the link but I'm not sure this applies to my interface development. It appears to describe accessing files from the application using Terminal? Kind Regards, Dan it applies to any code in ObjectScript Thanks Robert. I ended up resolving my issue by changing my approach to use a Record Mapper for the inbound file. Thanks again for pointing me at this resource. Edit.. for some reason I didnt see the above reply. Given that you are extending Ens.BusinessProcess you have access to Ensemble/Interoperability. If you are going down this path you might want to review RecordMaps which is a general purpose way of consuming data from files via a business service based on EnsLib.RecordMap.Service.FileService. This will open the file, for each line create an instance of your RecordMap object and then if you define in the service the TargetConfigNames sent the Record as a message to commonly a business process. In the busines process you will receive each line as a message object. From there you can do what you like with it. This could be a bit overkill if all you have is a single column in the file(just a column for ID) but is a general way of handling the ingestion of files. Thanks Stephen. This is the solution I landed on in the end; it has the added benefit of being a little bit more user friendly for our support team also. Thank you for your time and help.
Article
Mark OReilly · Dec 13, 2024

SharePoint/ SPO API with intersystems

As part of the Open Exchange competition Salford Royal (Dean White and Mark O'Reilly) developed a REST API for sharepoint as a template that works but can also be a starting point to your own Rest Applications Prerequisites This is using the v1 REST sharepoint API you need a tennant id, client id, client secret and tennant name Setup Configure an OAuth server The code in the middle is the tennant ID Create a client config name as whatever you want Set up the oauth client replacing your server ip with the ip of the server you are on (not the VIP address- if not part of a VIP localhost may work) Add in client credentials change over the settings on SharepointRESTConnector like HTTPSERVER,SHAREPOINT-SITENAME- SHAREPOINT FILEPATH- SSL (blank up to 1.3) params replace the tennant name and tennant id. Code SharePointOnlineRESTOperation OAuth Scope isn't user in this example but left here as a template if you need it for other rest implementation It uses and builds on default rest Set tSC=..AddAccessToken(.tHttpRequest) which manages the token and will pass through any additional properties required for the API. For sharepoint API it requires a resource and this gets added in the settings in the comment notes /// For SPO the Params should be {"resource":"00000003-0000-0ff1-ce00-000000000000/{TennantName}.sharepoint.com@{TennantID}"} <p> /// 00000003-0000-0ff1-ce00-000000000000 is the ResourceID asigned to SPO by Microsoft, and should not change <p> /// {TennantName} should be changed to the same as the HTTP server e.g.intersystems.sharepoint.com <p> /// {TennantID} is the ID for your server name tennancy Get File list Will call list of files in the folder you have. It can run the time since you last downloaded or all files It queries ens header. It calls the GetFolderByServerRealativeURL Set ..Adapter.URL="/sites/"_$$$URLENCODE(..SharepointSitename)_"/_api/web/GetFolderByServerRelativeUrl('"_$$$URLENCODE(..SharepointFilePath)_"')/Files"_filter Set ..Adapter.URL="/sites/"_$$$URLENCODE(..SharepointSitename)_"/_api/web/GetFolderByServerRelativeUrl('"_$$$URLENCODE(..SharepointFilePath)_"')/Files"_filter The response gets read by the processer. It all sends http messages like POSTMAN would A Constuct response method was taken from the generic operation intersystems had written to return http responses DeleteFile Calls a delete send request to getfolderbyserverrelativeurl/files key lines below Set ..Adapter.URL="/sites/"_$$$URLENCODE(..SharepointSitename)_"/_api/web/GetFolderByServerRelativeUrl('"_$$$URLENCODE(..SharepointFilePath)_"')/Files('"_$$$URLENCODE(pRequest.FileName)_"')" Set tSC=..AddAccessToken(.tHttpRequest) s tSC = ..SendRequest(.tHttpResponse,send,tHttpRequest, .pResponse) Quit ..constructResponse(.tHttpResponse,.pResponse) DownloadFile if it is a Ens.StringContainer (you could make this a bespoke message extending this of like Messages.DownloadSharpointFile) it reads the name and then sends the name in the api url. it reads the response pack and will add to a steamcontainer the binary stream. As always we create the stream and then package it up into the streamcontainer. Key code below (changed some s to set for display here) set binaryStream =##Class(%Stream.FileBinary).%New() Set tSC=..AddAccessToken(.tHttpRequest) Set ..Adapter.URL="/sites/"_$$$URLENCODE(..SharepointSitename)_"/_api/web/GetFolderByServerRelativeUrl('"_$$$URLENCODE(..SharepointFilePath)_"')/Files('"_$$$URLENCODE(pRequest.StringValue)_"')/OpenBinaryStream()" Set tHttpResponse = ##class(%Net.HttpResponse).%New() set send="GET" set tSC = ..SendRequest(.tHttpResponse,send,tHttpRequest, .pResponse) set pDownloadResponse =##Class(Ens.StreamContainer).%New(binaryStream) set pDownloadResponse.OriginalFilename=pRequest.StringValue Add File GetFolderByServerRelativeUrl/filepath/Files/add(url=filename,overwrite?) Key lines Set ..Adapter.URL="/sites/"_$$$URLENCODE(..SharepointSitename)_"/_api/web/GetFolderByServerRelativeUrl('"_$$$URLENCODE(..SharepointFilePath)_"')/Files/add(url='"_fn_"',overwrite="_$$$URLENCODE(..OverwriteExistingFile)_")" Set tSC=..AddAccessToken(.tHttpRequest) s tHttpRequest.EntityBody=##Class(%Stream.FileBinary).%New() s sc=tHttpRequest.EntityBody.CopyFromAndSave(pFileToUpload.Stream) Set tHttpResponse = ##class(%Net.HttpResponse).%New() S send="POST" s tSC = ..SendRequest(.tHttpResponse,send,tHttpRequest, .pResponse) Send Request This does the sending of any request expecting a http response. Does the handing of responses and reuns a ENSLIB.HTTP.GenericMessage. A lot of headers come back and there is a check box to simplify the response back to just be error code and data. Construct Response Used from elsewhere in TIE not original code in this method AddAccessToken This was the real learning. this is default type code to use the intersystems OAuth settings and not hardcode this each time we need to use it. It's all built around three calls is authorised and Set isAuthorised = ##class(%SYS.OAuth2.AccessToken).IsAuthorized(..OAuthClientApplicationName,sessionId,..OAuthScope,.accessToken,,.responseProperties,.error) Get access token Set tSC = ##class(%SYS.OAuth2.Authorization).GetAccessTokenClient(..OAuthClientApplicationName,..OAuthScope,.properties,.error,.sessionId) and a Add token which adds it to the header - unfortunetly it doesn't look like it could add to the body if credential is required there by other apis ;The default for sslConfiguration comes from the OAuth2.Client instance. Set tSC = ##class(%SYS.OAuth2.AccessToken).AddAccessToken(pHttpRequest,sendType,,..OAuthClientApplicationName,sessionId) The additional bit is the Sharepoint API requires a resource. Now we have generalised this to use JSON so if you need any other parameters we thought lets add it as JSON so we can reuse the template in the future. it adds it to the string object that the properties used. its like an array serialised string or something s paramsarr = [].%FromJSON(..Params) s iterator = paramsarr.%GetIterator() s properties="" While iterator.%GetNext(.key,.value) { s properties(key)=value } Example traces Getting file list Downloading files deleting files is if you tick this box Adding files Thanks to @Dean.White4269 https://youtu.be/485dTXYp2BU Update - add YouTube link and fix open exchange link this is great, thank you for taking the time to share! Hi Mark, Your video is available on InterSystems Developers YouTube: ⏯️SharePoint Online SPO REST API
Question
omer · Jan 13

Intersystems Data Models and ACID

Hello! So my question is quite simple, Do the different data models of Intersystems all support the ACID properties?I assume that for the SQL data model implementation it does, But does it also work for global (i.e the hierarchical data model)?I searched the docs and the different articles, It seems for example that here its implied that the different data models of Intersystems DO indeed support the ACID properties and allow for safe insertion, deletion etc... in concurrent operations to the server that is. Would love to get a clarification, Thx! does it also work for global (i.e the hierarchical data model)? Simple answer: yes, it sure does. Your code implementation need to use transactions (TSTART, TCOMMIT, TROLLBACK) commands to implement ACID. Don't forget that, in the end, using Objects and/or SQL, the code executed use globals. Using Objects and/or SQL the framework implement transaction for you, using globals you need to implement/code it. And in case i just directly access globals?for example a simple code such as: s ^myTracker("onSomething") = ^myTracker("onSomething") + 1 would that line above be handled by intersystems safely or not? Hello @omer The above same is ACID complaint when using transactions. It will be reverted to old value under transaction rollback. However, The counter values are incremented by $Increment and $Sequence are will not changed even rollback. LEARNING>w ^myTracker("onSomething") 1 LEARNING>ts TL1:LEARNING>s ^myTracker("onSomething")=12 TL1:LEARNING>w ^myTracker("onSomething") 12 TL1:LEARNING>trollback LEARNING>w ^myTracker("onSomething") 1 LEARNING> $Increment and $sequence LEARNING>write ^myTracker("onSomething") 1 LEARNING>tstart TL1:LEARNING>do $Increment(^myTracker("onSomething")) TL1:LEARNING>write ^myTracker("onSomething") 2 TL1:LEARNING>trollback LEARNING>write ^myTracker("onSomething") 2 LEARNING> Sorry, I forgot to mention that to implement properly ACID you need transactions AND locking mechanism using LOCK command. Hi @Ashok.Kumar , you also need to use lock to properly implement ACID, something like: LEARNING>lock +^myTracker("onSomething") LEARNING>w ^myTracker("onSomething") 1 LEARNING>ts TL1:LEARNING>s ^myTracker("onSomething")=12 TL1:LEARNING>w ^myTracker("onSomething") 12 TL1:LEARNING>trollback LEARNING>w ^myTracker("onSomething") 1 LEARNING>lock -^myTracker("onSomething") LEARNING> Hi @Enrico.Parisi Yes. Lock is crucial to achieve the ACID complaint and avoid the concurrency control issues. Thank you for your comments! It really clarified what i needed. 💡 This question is considered a Key Question. More details here.
Question
Veerraju Grandhi · Jun 7, 2024

Powershell and intersystems sql shell

i want to update some values in tsysparameters table through powershell. how to write the script. first you need to install a valid DSN: Defining an ODBC Data Source on Windowsfor PS you may take the same approach as described here Thanks Robert. I have downloaded the x64 driver and to configure ODBC. On a side note, just want to understand where do we get all the tables in the IRIS/Healthshare application. once you know what namespace you are looking at you may list available schemata bySELECT * FROM INFORMATION_SCHEMA.SCHEMATA which returns 750 rows for namespace HSCUSTOM Thanks a lot Robert. This helps a lot. Also, the ODBC Driver also worked for me.
Question
Manoj R · Feb 3

To configure VSCode as Studio for Intersystems

Hello All, I'm new to InterSystems, just wanted to check if we can configure the Visual Studio code to use it as Studio for Intersystems development. I tried following the instructions in few posts but nothing worked. Please guide me to setup this Please follow the documentation starting from Visual Studio Code (VS Code) Introduction First thing to decide if you want to use client-side editing or server-side editing. server-side editing is more similar to working with InterSystems Studio. Then, if you encounter problems, please come back and provide details on what you have done, what the problem you encountered, any error you get etc. Hi Manoj, we offer training for users migrating from Studio to VS Code. Take a look at our website for more information - https://georgejames.com/vscode-training/ If you have any questions, feel free to message me here or you can send an email to laurelj@georgejames.com. Thanks, Laurel Hello Manoj, i had a similar problem. In my case was the problem that after the Installation of IRIS the web-server port was "80". This port on my system was used by other software. After switching to "8080" VS Code was working well. regards Matthias