Search

Clear filter
Announcement
Mike Morrissey · Mar 7, 2018

InterSystems Launches FHIR® Sandbox at HIMSS18

The InterSystems FHIR® Sandbox is a virtual testing environment that combines HealthShare technology with synthetic patient data and open source and commercial SMART on FHIR apps, to allow users to play with FHIR functionality.The sandbox is designed to enable developers and innovators to connect and test their own DSTU2 apps to multi-source health records hosted by the latest version of HealthShare. Share your experience with others or ask questions here in the FHIR Implementers Group. Click here to access the InterSystems FHIR® Sandbox.
Question
CM Wang · Jun 27, 2018

Parse binary data by InterSystems ObjectScript

I am trying to read some binary data from a local file or through socket.The binary data is like H.264 codec, I need to read data BYTE by BYTE (even BIT by BIT) and decide the next step based on the data read so far.I check the documentation and it seems like most of the sample focus on human readable IO, ie: LINE by LINE.Could I achieve my goal through COS?Thanks. you have the option to read by character usingREAD *varThen you read exactly 1 byte in its decimal representation set file="C:\ZZ\myfile.bin"open file:"RS":0 else write "file not open", ! quitfor use file read *byte use 0 write byte,?5,"x\"_$ZHEX(byte),?12,"char:",$C(byte),!Docs on READYou may also use %File Class and use a Read method with length 1 You can use %Stream.FileBinary and %Stream.GlobalBinary classes. In addition to other answers, if want to operate with bits, you can use functions:$zhex - converts integer to hex and vice versa, be careful with type of variables. If you pass string it will convert from hex to dec, if you will pass integer it will convert from dec to hex.$factor - converts integer to a $bit string$bit (with bunch of $bit* functions) - operates with bitstrings.You may possible need some encryption functions, you can findAnd possible zlib, $system.Util.Compress and $system.Util.Decompress from class %SYSTEM.Util If you are going to work with H.264, I would not recommend to try to implement it in COS, it will not be fast enough. I'm not very know with this technology but I'm sure I know, it is too complicated and encoding should work in GPU. But it is impossible with Caché. I don't know why exactly do you need it, but I would recommend you to look at external tool ffmpeg, which is very useful and leader on work with video. And I think you can connect ffmpeg.dll, to work from Caché with $zf functions.
Article
Bob Binstock · May 16, 2018

Using InterSystems IRIS Containers with Docker for Windows

InterSystems supports use of the InterSystems IRIS Docker images it provides on Linux only. Rather than executing containers as native processes, as on Linux platforms, Docker for Windows creates a Linux VM running under Hyper-V, the Windows virtualizer, to host containers. These additional layers add complexity that prevents InterSystems from supporting Docker for Windows at this time. We understand, however, that for testing and other specific purposes, you may want to run InterSystems IRIS-based containers from InterSystems under Docker for Windows. This article describes the differences between Docker for Windows and Docker for Linux that InterSystems is aware of as they apply to working with InterSystems-provided container images. Other, unanticipated issues may arise. When using InterSystems IRIS images and containers on a Windows platform, ensure that you have access to the Docker documentation for convenient reference; see in particular Getting started with Docker for Windows Because handling by a container of external persistent storage under Docker for Windows involves both the Windows and Linux file systems and file handling, the differences noted are largely storage-related. For general information about running InterSystems IRIS in Docker containers using image provided by InterSystems, see Running InterSystems IRIS in Docker Containers and First Look: InterSystems IRIS in Docker Containers. Share Disk Drives On Windows, you must give Docker access to any storage with which it interacts by sharing the disk drive on which it is located. To share one or more drives, follow these steps (you can combine this with the procedure in the previous item): Right-click the Docker icon in the system tray and select Settings ... . Choose the Shared Drives tab, then select the drive(s) on which the storage is located and click Apply. If a drive is already selected (the C drive is selected by default), clear the checkbox and click Apply, then select it and click Apply again. Enter your login credentials when prompted. Docker automatically restarts after applying the changes; if it does not, right-click the Docker icon in the system tray and select Restart. Copy External Files Within the Container When using Docker, it is often convenient to mount a directory in the external file system as a volume inside the container, and use that as the location for all the external files needed by the software inside the container. For example, you might mount a volume and place the InterSystems IRIS licence key, iris.key, and a file containing the intended InterSystems IRIS password in the external directory for access by the --key option of iris-main program and the password change script, respectively (see The iris-main Program and Changing the InterSystems IRIS Password in Running InterSystems IRIS in Containers). Under Docker for WIndows, however, file-handling and permissions differences sometimes prevent a file on a mounted external volume from being used properly by a program in the container. You can often overcome permissions difficulties by having the program copy the file within the container and then use the copy. For example, the iris-main --before option is often used to change the password of the InterSystems IRIS instance in the container, for example: --before "changePassword.sh /external/password.txt" If this fails to change the password as intended on Windows, try the following: --before "cp /external/password.txt /external/password_copied.txt && \changePassword.sh /external/password_copied.txt" Use Named Volumes When numerous dynamic files are involved, any direct mounting of the Windows file system within a container is likely to lead to problems, even if individual mounting and copying of all the files were feasible. In the case of InterSystems IRIS, this applies in particular to both the durable %SYS feature for persistent storage of instance-specific data (see Durable %SYS for Persistent Instance Data in Running InterSystems IRIS in Containers) and journal file storage. You can overcome this problem by mounting a named volume, which is a storage volume with a mount point in the filesystem of the Linux VM hosting the containers on your system. Because the VM is file system-based, the contents of such a volume are saved to the Windows disk along with the rest of the VM, even when Docker or your system goes down. For example, the standard way to enable durable %SYS when running an InterSystems IRIS container is to mount an external volume and use the --env option to set the ISC_DATA_DIRECTORY environment variable to a location on that volume, for example: docker run ... \--volume /nethome/pmartinez/iris_external:/external \--env ISC_DATA_DIRECTORY=/external/durable/ This will not work with Docker for Windows; you must instead create a named volume with the docker volume create command and locate the durable %SYS directory there. Additionally, you must include the top level of the durable %SYS directory, /irissys, in the ISC_DATA_DIRECTORY specification, which is not the case on Linux. On Windows, therefore, your options would look like this: docker volume create durabledocker run ... \--volume durable:/durable \--env ISC_DATA_DIRECTORY=/durable/irissys/ To use this approach for the instance's journal files, create and mount a named volume, as in the durable %SYS example above, and then use any configuration mechanism (the ^JOURNAL routine, the Journal Settings page in the Management Portal, or the iris.cpf file) to set the current and alternate journal directories to locations on the named volume. To separate the current and alternate journal directories, create and mount a named volume for each. (Note that this approach has not been thoroughly tested and that journal files under this scheme may therefore be at risk.) To discover the Linux file system mount point of a named volume within the VM, you can use the docker volume inspect command, as follows: docker volume inspect durable_data[ { "CreatedAt": "2018-05-04T12:11:54Z", "Driver": "local", "Labels": null, "Mountpoint": "/var/lib/docker/volumes/durable_data/_data", "Name": "durable_data", "Options": null, "Scope": "local" }] Command Comparison Taking all of the preceding items together, the following presents a comparison between the final docker run command described Run and Investigate the InterSystems IRIS-based Container in First Look: InterSystems IRIS in Docker Containers, which is intended to be executed on a Linux platform, and the equivalent docker run command using Docker for Windows. Linux $ docker run --name iris3 --detach --publish 52773:52773 \ --volume /nethome/pmartinez/iris_external:/external \ --env ISC_DATA_DIRECTORY=/external/durable \ --env ICM_SENTINEL_DIR=/external iris3:test --key /external/iris.key \ --before "changePassword.sh /external/password.txt" Windows C:\Users\pmartinez>docker volume create durableC:\Users\pmartinez>docker volume create journalsC:\Users\pmartinez>docker run --name iris3 --detach --publish 52773:52773 \--volume durable:/durable\--volume journals:/journals--env ISC_DATA_DIRECTORY=/durable/irissys \--env ICM_SENTINEL_DIR=/durable iris3:test --key /external/iris.key \--before "cp /external/password.txt /external/password_copied.txt && \changePassword.sh /durable/password_copied.txt" If you have any information to contribute about using InterSystems-provided containers with Docker for Windows, please add as a comment here, or post your own article! Hi Bob,in Windows, for the key/password it works if you just define a volume where the files are. Then the call would be simpler/smaller:docker run --name iris3 --detach --publish 52773:52773 \--volume C:\pmartinez\iris_external:/external \--volume durable_data:/durable --env ISC_DATA_DIRECTORY=/durable/irissys \--env ICM_SENTINEL_DIR=/durable iris3:test --key /external/iris.key \--before "/usr/irissys/dev/Cloud/ICM/changePassword.sh /external/password.txt"I understand that using a named volume will store the durable %SYS within the Linux VM itself which would avoid issues with Windows FS regarding database files updating, permissions,... but, is there any reason why you choose to mount each file separately instead of this way I include? In the end we just use these 2 files (iris.key and password.txt) once when starting the container. Some of the examples developed for Windows came from me within the Learning Services team. We map the key and password files in separately as we have to pull different key files for different product training. We also rotate passwords and keys on a regular basis, so we found it was easier to have them living in their own directories on the local host so we can manage them better.That said, you are correct that you can put them in one folder and only map it once. The docker run commands get a bit complex, so we have moved to mostly using docker-compose and an .ENV file to help us parameterize different settings as we move containers from test (on a local Windows 10 machine) to staging to production (on Linux). in deference to the wisdom of Salva and Doug, i have removed the section about mounting files individually. Please note, if you are running into permissions issues, that seems to be a windows only problem and can be worked around by creating a derivative image like this: ~~~ FROM intersystems/iris:2018.2.0.490.0 RUN adduser irisusr root && adduser irisusr irisusr ~~~ And use that. The errors you might expect look like this: ~~~ Sign-on inhibited. See messages.log for details. [ERROR] Execvp failure. Executable /usr/irissys/bin//./irisdb. errno=13, file uid=0 gid=1000 perms=r-xr-x---, user uid=1000 gid=0 Call InterSystems Technical Support. : Permission denied [ERROR] Possible causes: [ERROR] - InterSystems IRIS was not installed successfully [ERROR] - Invalid InterSystems IRIS instance name [ERROR] - Insufficient privilege to start InterSystems IRIS (proc not in InterSystems IRIS group?) [FATAL] Error starting InterSystems IRIS ~~~ Alternatively you could add those statements to the before parameter, but that seems less elegant. Thanks, Fab Hi Bob,I believe the docker for windows command for creating the named volume inside the linux vm should bedocker volume create durablerather than docker create volume durable David, you are correct the command is actually docker volume create <name of volume>You can then do docker volume ls to list your existing volumes, or docker volume purge to delete volumes that are no longer associated with a running container.We should probably update this article a bit as the new Docker for Windows no longer supports AUFS, but the Overlay2 driver issues have been fixed. So setting your driver to AUFS isn't needed anymore if you are running on the newest 2.0+ version.I also tend to prefer using docker-compose for some of this so I can map out the volumes, a specific network, container names, etc that all help you connect other containers to your IRIS, such as Zeppelin/Spark, a browser based IDE, or a Java app, etc. i corrected it, David. thank you. The article is considered as InterSystems Data Platform Best Practice. finally removed the Storage Driver section, thanks Doug Hello Fabian, is exactly my problem - could you go a bit in detail; I've no idea how and where exactly to use the mentioned commands; btw. pls. keep in mind i'm using Windows ;-) Thanks in advance, Stefan Hi Stefan, I believe Fabian was describing creating a new image, based off of the default InterSystems image, but modifying the user and group. (By the way, even though you are on Docker for Windows, InterSystems IRIS images are based on Ubuntu, and Docker for Windows runs in a Linux VM) The excerpt above would be placed in a new Dockerfile and you would build a new custom image. This approach is described here: https://irisdocs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=ADOCK#ADOCK_iris_creating However, may I ask, what version of InterSystems IRIS are you using? I have seen these "Sign-on inhibited" errors frequently in the past, but I think they've been mitigated in recent versions. 2019.3 was just released, and should be available in the Docker Store and cloud marketplaces in the next few days. -Steve Hey, i am currently facing permission issues with bind mount. I tried your solution - My Dockerfile: FROM store/intersystems/iris-community:2020.2.0.204.0RUN adduser irisusr root && adduser irisusr irisusr But I am getting an error when building the Dockerfile: "adduser: Only root may add a user or group to the system." Could you help me what is going wrong?
Question
Tony Beukes · Jul 8, 2018

Terminal access to the InterSystems IRIS Experience sandbox

Is Terminal access to the InterSystems IRIS Experience sandbox available? Are you looking for full ssh/bash access into the container, or would an interactive InterSystems Terminal session? To run SQL shell or other database specific commands?Full ssh is difficult as it opens up potential security issues. The InterSystems Terminal would be possible. We have a web accessible version that is in testing right now that we could add.If you clarify what you are looking to do, we can see what meets the needs best.Doug Thanks Doug,It would be great if we could have access via the InterSystems Terminal.Any idea when we could expect it to be available? Good news, we have updated the Direct Access to InterSystems IRIS container to include a terminal link in the management portal.When you get launch your InterSystems IRIS instance, you will get a set of links to that instance. Use the Management Portal link and log in with the username/password provided.Then on the home page of the management portal, you will see a "Terminal" link in the "Links" section. When you click on that link, you will need to enter the username/password again, but then will be in an interactive terminal session that defaults to the USER namespace. This is the same as an iris session iris -U USER at the shell, or the "Terminal" menu option in the launcher.Please let us know if you have any other suggestions or request as we want to make it easy to test out and learn InterSystem IRIS functionality.
Question
Vineeth Jagannathan · Jul 11, 2017

Is there any settings for do automatic logout in InterSystems.

If the session is in inactive state for some time. It should be logging out automatically. Is there any settings for that?? On %CSP.Session /// Specifies the timeout value for the session in seconds./// <P>If no user requests are received within the specified time period, /// then the session will end. The default value comes from the CSP application/// setting for the application that the session starts in which is set in the/// Cache configuration manager, this is often 900 seconds or 15 minutes./// Note that if you start a session in one applicaiton and move to another application/// the AppTimeout will not be changed to the new applications timeout value, if you wish/// to modify this when the application changes you can use the session events 'OnApplicationChange'/// method./// <P>For no timeout, set this property to 0.Property AppTimeout As %Integer [ InitialExpression = 900 ];You can also specify the timeout for your App as a whole: <your server ip:57772>/csp/sys/sec/%25CSP.UI.Portal.Applications.Web.zen?PID=%2Fcsp%2Fuser I have done the setting but it is not logging out. I am getting this below error. Even i tried keep alive disabled in CSP Gateway. Even though it is not working. What exactly did you do? Quote from doc:By default, the session timeout is to 900 seconds (15 minutes). You can change this default for a CSP application in the Management Portal; [Home] > [Security] > [Web Applications] page. Select the application and click Edit. Note that if a session changes CSP applications during its life span, its timeout value will not be updated according to the default timeout defined in the application that the session moved into. For example, if a session starts out in CSP Application A, with a default timeout of 900 seconds, and then moves into CSP Application B, which has a default timeout of 1800 seconds, the session will still timeout after 900 seconds.Check these points. Still see the page parameter AUTOLOGOUT. Exactly these are the settings for Auto Logout. This is working now after a fix from Intersystem Vineeth, please help the community by accepting the answer that helped you. The animation in this article shows you how to do that. Session TimeoutFind:Session Termination and Cleanup Session Timeout Session Timeout for CSP Gateway I have done the setting but it is not logging out. I am getting this below error. Even i tried keep alive disabled in CSP Gateway. Even though it is not working.
Announcement
Andreas Dieckow · Jul 11, 2018

InterSystems products running on AIX on Power 9

InterSystems products (InterSystems IRIS, Caché and Ensemble) support AIX on Power 9 chips starting with:Caché/Ensemble 2017.1.3InterSystems IRIS 2018.1.1
Announcement
Anastasia Dyubaylo · Jul 16, 2018

Group: Prague Meetup for InterSystems Data Platform

Hi Community!User or developer working with Caché, Ensemble or other InterSystems products? Healthcare or banking IT professional? Or just a developer seeking new challenges?Come and join us for discussing what's up once you are in Prague, Czech Republic, or near by! We'll share news and experience on how to develop modern big-data, multi-model oriented applications.Please, feel free to ask your questions about InterSystems Meetup group in Prague. @Daniel.Kutac and @Ondrej.Hoferek will provide details.
Announcement
Jeff Fried · Sep 29, 2018

InterSystems Caché and Ensemble 2018.1 Release

InterSystems is pleased to announce that InterSystems Caché and Ensemble 2018 are now released!New in these releases are features that improve security and operations, including:· Key Management Interoperability Protocol (KMIP) support· Microsoft Volume Shadow Copy (VSS) integration· Integrated Windows Authentication support for HTTP· SSH enhancementsThe releases also include many important updates and fixes.See the documentation for release notes and upgrade guides for both Caché and Ensemble. The platforms for these releases are the same as for 2017.2. Full details can be found in this supported platforms document.
Article
Eduard Lebedyuk · Sep 10, 2018

Dynamic objects and JSON support in InterSystems products

Generally speaking, InterSystems products supported dynamic objects and JSON for a long while, but version 2016.2 came with a completely new implementation of these features, and the corresponding code was moved from the ObjectScript level to the kernel/C level, which made for a substantial performance boost in these areas. This article is about innovations in the new version and the migration process (including the ways of preserving backward compatibility).Working with JSONLet me start with an example. The following syntax works now and it’s the biggest innovation in ObjectScript syntax: Set object = { "property": "val", "property2": 2, "property3": null } Set array = [ 1, 2, "string", true ] As you can see, JSON is now an integral part of ObjectScript. So what happens when values are assigned this way? The “object” becomes an instance of the %Library.DynamicObject object, while “array” is an instance of %Library.DynamicArray. They are both dynamic objects. Dynamic objects Cache had dynamic objects for a while in the form of the %ZEN.proxyObject class, but now the code has been moved to the kernel for greater performance. All dynamic object classes are inherited from %Library.DynamicAbstractObject, which offers the following functionality: Getting an object from a JSON string, stream, fileOutput of an object in the JSON format to a string or variable, automatic detection of the output format depending on contextWriting an object to a file in the JSON formatWriting an object to a globalReading an object from a global Transition from %ZEN.proxyObject So you want to migrate from %ZEN.proxyObject/%Collection.AbstractIterator towards %Library.DynamicAbstractObject? This is a relatively simple task that can be completed in several ways: If you are not interested in compatibility with versions of Caché earlier than 2016.2, just use Ctrl+H thoughtfully and you’ll be fine. Keep in mind, though, that indexes in arrays start with a zero now and you need to add $ to the names of system methodsUse macros that transform the code into the necessary form during compilation depending on the version of Caché.Use an abstract class as a wrapper for corresponding methods The use of the first method is obvious, so let’s focus on the remaining two. Macros An approximate set of macros that work with either new or old dynamic objects class depending on the availability of %Library.AbstractObject. Macros property #if $$$comClassDefined("%Library.dynamicAbstractObject") #define NewDynObj {} #define NewDynDTList [] #define NewDynObjList $$$NewDynDTList #define Insert(%obj,%element) do %obj.%Push(%element) #define DynObjToJSON(%obj) w %obj.%ToJSON() #define ListToJSON(%obj) $$$DynObjToJSON(%obj) #define ListSize(%obj) %obj.%Size() #define ListGet(%obj,%i) %obj.%Get(%i-1) #else #define NewDynObj ##class(%ZEN.proxyObject).%New() #define NewDynDTList ##class(%ListOfDataTypes).%New() #define NewDynObjList ##class(%ListOfObjects).%New() #define Insert(%obj,%element) do %obj.Insert(%element) #define DynObjToJSON(%obj) do %obj.%ToJSON() #define ListToJSON(%obj) do ##class(%ZEN.Auxiliary.jsonProvider).%ObjectToJSON(%obj) #define ListSize(%obj) %obj.Count() #define ListGet(%obj,%i) %obj.GetAt(%i) #endif #define IsNewJSON ##Expression($$$comClassDefined("%Library.DynamicAbstractObject")) This code: Set obj = $$$NewDynObj Set obj.prop = "val" $$$DynObjToJSON(obj) Set dtList = $$$NewDynDTList Set a = 1 $$$Insert(dtList,a) $$$Insert(dtList,"a") $$$ListToJSON(dtList) Will compile into the following code for Cache version 2016.2+: set obj = {} set obj.prop = "val" w obj.%ToJSON() set dtList = [] set a = 1 do dtList.%Push(a) do dtList.%Push("a") w dtList.%ToJSON() For previous versions, it will look like this: set obj = ##class(%ZEN.proxyObject).%New() set obj.prop = "val" do obj.%ToJSON() set dtList = ##class(%Library.ListOfDataTypes).%New() set a = 1 do dtList.Insert(a) do dtList.Insert("a") do ##class(%ZEN.Auxiliary.jsonProvider).%ObjectToJSON(dtList) Abstract class The alternative is to create a class that abstracts the dynamic object being used. For example: Class Utils.DynamicObject Extends %RegisteredObject { /// A property storing a true dynamic object Property obj; Method %OnNew() As %Status { #if $$$comClassDefined("%Library.DynamicAbstractObject") Set ..obj = {} #else Set ..obj = ##class(%ZEN.proxyObject).%New() #endif Quit $$$OK } /// Getting dynamic properties Method %DispatchGetProperty(pProperty As %String) [ Final ] { Quit ..obj.%DispatchGetProperty(pProperty) } /// Setting dynamic properties Method %DispatchSetProperty(pProperty As %String, pValue As %String) [ Final ] { Do ..obj.%DispatchSetProperty(pProperty,pValue) } /// Converting to JSON Method ToJSON() [ Final ] { Do ..obj.%ToJSON() } } Using this class is completely identical to working with a regular one: Set obj = ##class(Utils.DynamicObject).%New() Set obj.prop = "val" Do obj.ToJSON() What to choose It’s totally your call. The option with a class looks more conventional, the one with macros is a bit faster thanks to the absence of intermediate calls. For my MDX2JSON project, I chose the latter option with macros. The transition was fast and smooth. JSON performance The speed of JSON generation went up dramatically. The MDX2JSON project has JSON generation tests that you can download to see the performance boost with your own eyes! Conclusion New dynamic objects and improvements in JSON support will help your applications work faster. Links Documentation
Discussion
Sean Connelly · Sep 12, 2018

How many InterSystems product developers are there worldwide?

I know we have nearly 5000 members on the DC site, but not even sure if this is a majority share or a minority share. Anyone have a good guesstimate? Sean. Thanks Evgeny, probably sounds about right.I would hazard a guess then that upwards of 0.1% of developers worldwide use Caché in one shape or form.It's interesting to compare that to the last stackoverflow survey...https://insights.stackoverflow.com/survey/2018/#technology-databasesespecially since some of those at the bottom of the list are developed on top of Hadoop, opens up some ideas for what could be possible on top of the IRIS Hadoop platform.On a side note, how about an annual DC survey? Would give some fascinating insights. Hi Sean! Moved the discussion to the Other group.4,800+ are the registered members, stats. We also have about 20,000 unique DC visitors monthly.From them we have about 3,000 visitors who come directly to the site - so we can assume as "real" developers who reads/writes on DC daily. But this touches only the English world. And not all of them know about DC. My evaluation is 10,000-15,000 developers worldwide.E.g. last the IT Planet contest in Russia this year gathered 2,400 participants for InterSystems contest (mostly students). Should we count students as developers? Today maybe not, but tomorrow...
Announcement
Stefan Cronje · Oct 6, 2018

Debug Stack for InterSystems Cache, Ensemble and IRIS

Hey folks,I've shared a debug stack we created on the Open Exchange.I want to post the link here, but need the link to this article for the Open Exchange. Which came first, the chicken or the egg? The github link: https://github.com/stefanc82/Cache-Debug-Stack Please show a sample output. The repo contains an example. Here is an example of exporting the stack to a string in terminal DEV>set sc = ##class(Examples.DebugStack).TestDebugStack() Examples.DebugStack TestDebugStack Calling Method InnerStackTest with value: 5 | |- Examples.DebugStack TestInnterStack pVal argument: 5 | |- Examples.DebugStack TestInnterStack tMyVal: 15 | |- Examples.DebugStack TestInnterStack Calling TestThirdLevelStack with tMyVal: 15 | | |- Examples.DebugStack TestThirdLevelStack pVal argument: 15 | | |- Examples.DebugStack TestThirdLevelStack tFinalVal: 35 | |- Examples.DebugStack TestInnterStack TestThirdLevelStack completed OK Examples.DebugStack TestDebugStack TestInnerStack completed OK DEV> It will be more readable if placed in a text file or a CSV. The "columns" are tab delimited. It has the option of providing output to a string or a global character stream. The "egg" is available now on Open Exchange )
Article
Eduard Lebedyuk · Oct 8, 2018

Configuring Apache to work with InterSystems products on Linux

InterSystems products (IRIS, Caché, Ensemble) already include a built-in Apache web server. But the built-in server is designed for the development and administration tasks and thus has certain limitations. Though you may find some useful workarounds for these limitations, the more common approach is to deploy a full-scale web server for your production environment. This article describes how to set up Apache to work with InterSystems products and how to provide HTTPS access. We will be using Ubuntu, but the configuration process is almost the same for all Linux distributions.Installing ApacheI assume that you have already installed let's say Caché to /InterSystems/Cache.By default, Caché is supplied with a plugin for Apache, so you can simply go to /InterSystems/Cache/csp/bin and select the corresponding file:CSPa24.so (Apache Version 2.4.x)CSPa22.so (Apache Version 2.2.x)CSPa20.so (Apache Version 2.0.x)CSPa.so (Apache Version 1.3.x)If several are available it's better to choose the latest one.Now it's time to install Apache. For Ubuntu execute apt-get update apt-get install apache2 zlib1g-dev In some OSes, there's no apache2 package (you'd get an "unable to locate package" error) and it's named httpd instead. If there's no apache build for your OS in the default repositories, I recommend searching for a repository against building apache yourself. While it's possible, it's fairly challenging and binaries generally could be found. Once the installation is complete, make sure that the installed Apache version meets the requirements: apache2 -v Then open the full list of modules to check whether 'mod_so' is on the list: apache2 -l So, Apache is now up and running. To test your Apache installation, type the IP address of your server in a web browser and see if the following page appears: Apache config structure Again, this can change depending on your OS and Apache versions but usually, Apache has the following configuration structure: In here: apache2.conf - main config file, loads first and loads everything elseenvvars - default environment variables for apache2ctlports.conf - ports that apache listens (usually 80 and 443)conf-available/conf-enabled - configuration snippets that are available or enabledmods-available/mods-enabled - mods (for example we need to add CSP mod to work with InterSystems products)sites-available/sites-enabled - sites (i.e. on port 80, on port 443, on host test.domain.com and so on) There are also several utilities to run and configure Apache: apache2 - main program (can be used to run apache2 in debug mode)apache2ctl - Apache control interfacea2enconf, a2disconf - enable or disable an apache2 configuration filea2enmod, a2dismod - enable or disable an apache2 modulea2ensite, a2dissite - enable or disable an apache2 site / virtual hostservice apache2 - manages apache2 in service mode Linking CSP to Apache Now that Apache is up and running let's connect it to Cache. To do this, make some changes to the Apache configuration. Edit the following files:1. /etc/apache2/envvars contains the environment variables. Set the variables APACHE_RUN_USER and APACHE_RUN_GROUP to cacheusr or (irisusr for InterSystems IRIS) 2. In a mod directory /etc/apache2/mods-available create a new mod - a file named CSP.load: CSPModulePath /InterSystems/Cache/csp/bin/ LoadModule csp_module_sa /InterSystems/Cache/csp/bin/CSPa24.so AddHandler csp-handler-sa csp cls cxw zen 3. Enable CSP module using a2enmod programm 4. Create a new site in /etc/apache2/sites-available named Cache80.conf: <IfModule mod_ssl.c> <VirtualHost _default_:80> ServerName test.domain.com DocumentRoot "/InterSystems/Cache/csp" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LogLevel info <Location /> CSP On SetHandler csp-handler-sa </Location> <Location "/csp/bin/Systems/"> SetHandler csp-handler-sa </Location> <Location "/csp/bin/RunTime/"> SetHandler csp-handler-sa </Location> DirectoryIndex index.csp index.html index.htm </VirtualHost> </IfModule> 5. Using a2dissite/a2ensite disable old site on port 80 and enable Cache site 6. Restart apache with: service apache2 restart 7. Open http://<ip>/csp/sys/UtilHome.csp and see if the system management portal appears: If apache didn't start, check the logs - it usually points to the problem line in configuration. Run apachectl configtest to check your configuration. If there's no pointer to error or configtest says that everything is fine, try starting apache in a foreground apache2 -DFOREGROUND -e debug If you're getting "application path" error it means that apache is unable to access CSP\bin directory and CSP.ini file inside. SSL Now let's set up https. To do this, you need a domain name, they start at $2/year. After you bought your domain name and configured DNS A record to point to your IP address go to any certificate authority for certificates. I'll show how it can be done with Let's Encrypt for free. 1. Using a2dissite/a2ensite disable Cache site on port 80 and enable default site 2. Restart apache with: service apache2 restart 3. Follow these instructions (I recommend forcing http->https redirect) 4. Create new site combining SSL configuration and Cache site: <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerName test.domain.com DocumentRoot "/InterSystems/Cache/csp" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LogLevel info <Location /> CSP On SetHandler csp-handler-sa </Location> <Location "/csp/bin/Systems/"> SetHandler csp-handler-sa </Location> <Location "/csp/bin/RunTime/"> SetHandler csp-handler-sa </Location> #DirectoryIndex index.csp index.php index.html index.htm DirectoryIndex index.html SSLCertificateFile /etc/letsencrypt/live/test.domain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/test.domain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf ServerAlias test.domain.com </VirtualHost> </IfModule> Make sure that 'Server Name' matches the 'commonName' parameter in the server certificate, and that the paths to all keys (server key 'SSLCertificateKeyFile', server certificate 'SSLCertificateFile' issued by the certificate authority) are valid. 5. Enable it, disable default SSL site, enable Cache SSL site 6. Restart apache with: service apache2 restart 7. Check whether the system management portal is now available at https://<ip>/csp/sys/UtilHome.csp 8. Enable auto-updating certificate. Edit crontab with: crontab -e and add a line there: 0 0 * * 0 certbot renew Summary It's easy to start running Apache server with InterSystems products. Increase security by implementing HTTPS on your sites. Links DocumentationApache documentation The configuration structure for apache is actually much more dependent on which distribution you are using than the OS. There are pretty huge differences in the way Ubuntu/SuSE/RH/Centos are setting things up. Even down to some of them calling the system service apache vs apache2 vs httpd. There are also differences with some of them using systemd vs still the old sysvinit. The good news is, you can always re-arrange your apache config to your liking. Please also note, setting ~~~ CSP On SetHandler csp-handler-sa ~~~ Is redundant. CSP On on a path already maps all filetypes to be handled by the gateway. Adding the sethandler doesn't add anything. If you are omitting CSP On, but use the csp-handler-sa as detailed above, the gateway will not serve static files. Either you will need to add them (ok for low traffic sites), or you will need to configure apache to serve the static files directly (if your apache is not on the same machine as your instance you will need to copy the static files or mount a network drive) Thanks for the info, Fabian.I myself am a fan of Ubuntu structure, do you know how to get that automatically on other OSes, primarily CentOS?
Announcement
Evgeny Shvarov · Oct 9, 2018

InterSystems Open Exchange - New Service for Developers!

Hi, Community!I'm pleased to announce that InterSystems Open Exchange is now operating and available for everyone!InterSystems Open Exchange is a gallery of software Solutions, Technology Examples, and Frameworks which were developed with InterSystems Data Platforms: Caché, Ensemble, HealthShare, InterSystems IRIS or InterSystems IRIS for Health.Also, it is a place where you can find tools and solutions which can help you with development, deployment and support the solutions built with InterSystems Data Platforms.Open Exchange is the new online service for developers on InterSystems Data Platforms in addition to Online Learning, Documentation and Community! Find solutions and examples you need, upload tools and share code snippets you developed and let InterSystems Data Platforms technology be more helpful for your business and software development!Please feel free to share your feedback here on Developer Community with Open Exchange tag and you can report bugs and enhancement requests in this public repository of open exchange.Stay tuned!
Article
Evgeny Shvarov · Oct 18, 2018

How to Publish an Application on InterSystems Open Exchange?

Hi Community!As you know we launched the InterSystems Open Exchange — the marketplace for solutions and tools on InterSystems Data Platforms!But how to publish your application on OE?Before we start, let me answer the few basic questions.Who can publish?Basically, everyone. You can sign in to Open Exchange with your InterSystems Developer Community or WRC account.What is the application?Open Exchange application is a solution, tool, interoperability adapter or interfaces developed using any InterSystems Data Platforms product: Caché, Ensemble, HealthShare, InterSystems IRIS or InterSystems IRIS for Health.Or this tool or solution should help in the development, testing, deployment or management solutions on InterSystems Data Platforms.What is the application for Open Exchange? Actually, it is the name, description and set of links to the application entries: download page, documentation, code repository (if any), license, etc.Let me illustrate the process with my personal example.Submitting the Application to Open ExchangeIn order to illustrate the procedure, I developed a fantastic application on ObjectScript for InterSystems IRIS and want to share it with Developer Community: Ideal ObjectScript.It demonstrates the ideal usage of ObjectScript coding guidelines for various ObjectScript use cases.There are mandatory fields, which need to be presented on every Open Exchange application.1. Name - a unique to Open Exchange name for the application2. Description - description of the application. The field supports markdown.3. Product URL - the link to a Download page of your application. 4. License - the link to the page which shows the license for your application.5. InterSystems Data Platforms - set of InterSystems Data Platforms your application is intended for.All the rest fields are optional.So, let's submit my app.I have the Name: Ideal ObjectScriptDescription: Ideal ObjectScript demonstrates the ideal usage of InterSystems ObjectScript coding guidelines for various ObjectScript use cases.Product URL: https://github.com/evshvarov/ideal_objectscript/releases/tag/1.0 - the link to 1.0 version on Github releases section of the app.License URL: https://github.com/evshvarov/ideal_objectscript/blob/1.0/LICENSE - the link to the LICENSE file of the app.InterSystems Data Platforms: And the application supports InterSystems IRIS, Caché, and Ensemble - this is the list of InterSystems products I tested the application with by myself.With that, we are ready to submit the app.Application versionOnce you click Send For Approval you need to provide the version of the app and release notes. We use Semver for versioning. The release notes will be published in the Open Exchange News, DC Social Media and version history section of the app.After that application enters the approval workflow which results with approval and automatic publishing on OpEx or with some recommendations on how to correct the application's descriptions and links.Enter Additional parametersImage URLplace an URL to an image icon of your app to let it be displayed on a tile. You can omit this and the standard OpEx icon will be shown.Github URLPlace the link to a Github repository if you have it for your application. We have the integration with Github on Open Exchange, so if you introduce the link to the Github repository of your app Open Exchange will show the description from Github automatically (everything which is listed in Readme.md). E.g. see how Ideal ObjectScript page is displayed on Open Exchange.Community Article URLOf course, you can tell about your application on Developer Community with the nice article so place the URL to it here!As you can see the procedure is very simple! Looking forward to seeing your InterSystems Data Platforms applications on Open Exchange!Stay tuned! That's great !Does it have to be a Github repo or can I use BitBucket ?Also - if we find an error (eg WebTerminal on IRIS), can we leave a comment generally or for the developer ?Steve Hi, Steve!Thanks for your feedback! Does it have to be a Github repo or can I use BitBucket ?It can be any public repository: Github, BitBucket or Gitlab. But today we have the embedded support only for Github. E.g. if you submit Github repo in the application OE will use README.md as description, LICENSE.md as license and we plan to introduce more support in the near future.You can add the request for BitBucket support in Open Exchange issues.Also - if we find an error (eg WebTerminal on IRIS), can we leave a comment generally or for the developer ?Every application has either repo with issues or the support link which are intended to receive feedback, bug reports, and feature requests.If you find an error on Open Exchange, please submit it here! ) @Evgeny can you tell me:How to edit an application (title, image, description, etc.) after published? I can't find the option.And also, how to you publish new versions?many thanks! Hi, David!Thanks for the question!Today the procedure is the following: Unpublish, Edit, Send for Approval again. I've previously logged this issue #1 at https://github.com/intersystems-community/openexchange/issues/1 Good to know. I'll be tuned to the issue. Thanks And we have video instruction for this now. Hi @Evgeny.Shvarov The "Image URL" has some default dimension? I would like to change my application icon. Hi @Henrique! We updated the interface and now it's the matter of click Upload Image menu in the App Editor. See the article. Let me know if this works! Hi @Evgeny.Shvarov Thanks for the link to the updated article. I found out the error using the Google Chrome DevTools. I was trying to upload an image in a Published App. In the DevTools console I got the error: POST https://openexchange.intersystems.com/mpapi/packages/image/446 500 (Internal Server Error) Using the Network tab, I could see the details in the Response: { "errors":[ { "code":5001, "domain":"%ObjectErrors", "error":"ERROR #5001: You can't to change title image of the published package. Please, unpublish package or create draft.", "id":"GeneralError", "params":["You can't to change title image of the published package. Please, unpublish package or create draft." ] } ], "summary":"ERROR #5001: You can't to change title image of the published package. Please, unpublish package or create draft." } As a suggestion, this response could be shown in a toast message? Thanks, @Henrique.GonçalvesDias ! Filed here
Announcement
Evgeny Shvarov · Oct 26, 2018

5,000 Members in InterSystems Developer Community!

Hi Community!I'm pleased to announce that InterSystems Developer Community reached 5,000 registered members!Thank you, developers, not only for registering but rather for making this place more and more helpful for everyone who develops and supports solutions on InterSystems Data Platforms all over the world! Big applause to all of us! Here are some other statistics what makes Developer Community crowdy and helpful:800+ articles, stats2,800+ questions and answers, stats100 applications on Open Exchange100+ videos on Developer Community YouTube600+ InterSystems Global Masters members – a club of InterSystems technology Advocates.Thank you for your continuous feedback in DC Feedback group and public issue tracker. And special thanks to our noble Developer Community Team: Content Manager @Anastasia.Dyubaylo, Global Masters Managers: @Olga.Zavrazhnova2637 and @Julia.Fedoseeva, and DC Moderators: @Robert.Cemper1003, @Eduard.Lebedyuk , @Dmitry.Maslennikov and @John.Murray.So!Dear Developers! We in DC team will continue to work hard to make InterSystems Developer Community the best and the most convenient place to ask questions, share experience and discuss the best practices on InterSystems Data Platforms.Thank you for your choice and your contribution, and do not hesitate to provide feedback and enhancement requests!Stay tuned! Evgeny Shvarov,Community Manager. Congratulations to the community 5000 - is a house number. Congratulations to all of us.