In recent discussion on CachéQuality I was (friendly) blamed for old syntax promotion and deliberate obfuscation of the code. Therefore I decided to clarify my point and shed some light on one of possible source of side effects that may unexpectedly occur with RETURN command with an argument.
InterSystems Data Platform includes utilities and tools for system monitoring and alerting, however System Administrators new to solutions built on the InterSystems Data Platform (a.k.a Caché) need to know where to start and what to configure.
This guide shows the path to a minimum monitoring and alerting solution using references from online documentation and developer community posts to show you how to enable and configure the following;
Caché Monitor: Scans the console log and sends emails alerts.
System Monitor: Monitors system status and resources, generating notifications (alerts and warnings) based on fixed parameters and also tracks overall system health.
Health Monitor: Samples key system and user-defined metrics and compares them to user-configurable parameters and established normal values, generating notifications when samples exceed applicable or learned thresholds.
History Monitor: Maintains a historical database of performance and system usage metrics.
pButtons: Operating system and Caché metrics collection scheduled daily.
Remember this guide is a minimum configuration, the included tools are flexible and extensible so more functionality is available when needed. This guide skips through the documentation to get you up and going. You will need to dive deeper into the documentation to get the most out of the monitoring tools, in the meantime, think of this as a set of cheat sheets to get up and running.
In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:
Git 101
Git flow (development process)
GitLab installation
GitLab Workflow
Continuous Delivery
GitLab installation and configuration
GitLab CI/CD
In the previous article, we covered Git basics, why a high-level understanding of Git concepts is important for modern software development, and how Git can be used to develop software. Still, our focus was on the implementation part of software development, but this part presents:
GitLab Workflow - a complete software life cycle process - from idea to user feedback
Continuous Delivery - software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. It aims at building, testing, and releasing software faster and more frequently.
(Originally posted by @Sascha Kisser on March 11, 2014)
The following 2 classes are a component for a webcam, and a ZEN page that incorporates it. The webcam can take a snapshot and save it to Caché:
The Caché / Ensemble standard distribution contains in namespace SAMPLES a nice example of a CSP page consuming WebService as a Client. I have modified it not only to display the replies but to feed them back into a Global. I used the classic Hyperevent to achieve this. The replies end up as a log in global^WSREPLY. When there is no input anymore the page closes and goes away.
There are 2 versions with visible and hidden display during operation. dc.WSCSP.reverseVerbose.cls and dc.WSCSP.reverseHidden.cls
It will demonstrate the wide range that is openend by making use of the power embedded in Node.js and its adapter to Caché, Ensemble, Health,..* Node / JavaScript have wide reputation to work as a WebSocket client. By using the Caché adapter it becomes easy to control it and to consume the results as a Client for WebSocket Servers and to collect the replies in Caché, Ensemble, ..
I used node-v6.16.0-x64.msi and cache610.node as cache.node
The goal of this post is to discuss working with Websockets in a Caché environment. We are going to have a quick discussion of what websockets are and then talk through an example chat application implemented on top of Websockets.
The class method "test" in the following code snippet sends an HTML email with an embedded image. Edit the literal strings to change the embedded image, to address, from address, subject, and body of the email.
Headache-free stored objects: a simple example of working with InterSystems Caché objects in ObjectScript and Python
Neuschwanstein Castle
Tabular data storages based on what is formally known as the relational data model will be celebrating their 50th anniversary in June 2020. Here is an official document – that very famous article. Many thanks for it to Doctor Edgar Frank Codd. By the way, the relational data model is on the list of the most important global innovations of the past 100 years published by Forbes.
On the other hand, oddly enough, Codd viewed relational databases and SQL as a distorted implementation of his theory. For general guidance, he created 12 rules that any relational database management system must comply with (there are actually 13 rules). Honestly speaking, there is zero DBMS's on the market that observes at least Rule 0. Therefore, no one can call their DBMS 100% relational :) If you know any exceptions, please let me know.
This is a quick note on what happens when, on your CSP page, you call a cache script which returns a %Boolean and store that value in a javascript variable.
When you call a script with language="cache" and returntype="%Boolean" from a javascript script, the return value is interpreted as a string, not as a boolean.
Here's an example:
A cache script that returns (in theory) a "false" value:
This code snippet sends an XML request to a server and saves the response to a file. The class method "test" runs the code:
Class objectscript.postXML
{
classmethod test() {
Set HTTPRequest = ##class(%Net.HttpRequest).%New()
Set HTTPRequest.ContentType = "text/xml"
Set HTTPRequest.NoDefaultContentCharset = 1
Set HTTPRequest.Location = "ITOMCZ"
Set HTTPRequest.Server = "wph.foactive.com"
Do HTTPRequest.RemoveHeader("User-Agent")
Do HTTPRequest.RemoveHeader("Accept-Encoding")
Do HTTPRequest.RemoveHeader("Connection")
Do HTTPRequest.SetHeader("Expect","100-continue")
Set RequestXML = ##class(%Library.File).%New("c:\test.xml")
Do RequestXML.Open("RS")
Do HTTPRequest.EntityBody.CopyFrom(RequestXML)
Do RequestXML.%Close()
Do HTTPRequest.Post(HTTPRequest.Location)
Do $System.OBJ.Dump(HTTPRequest)
Do $System.OBJ.Dump(HTTPRequest.HttpResponse)
Write HTTPRequest.HttpResponse.Data.Size
Write HTTPRequest.ContentLength
Set ResponseStream = ##class(%Stream.FileBinary).%New()
// Second part is typically the file extension, i.e.: application/pdf -> pdf
Set FileType = $Piece(HTTPRequest.HttpResponse.GetHeader("CONTENT-TYPE"),"/",2)
Set ResponseStream.Filename = "C:\test."_FileType
Write ResponseStream.CopyFrom(HTTPRequest.HttpResponse.Data)
Write ResponseStream.%Save()
Do ResponseStream.%Close()
}
}
This is a posting about a particular feature of Caché which I find useful but is probably not well known or used. I am referring to the feature of Language Extensions.
This feature allows you to extend the commands, special variables and functions available in Caché Object Script with commands, special variables and functions of your own. This functionality also applies to other languages the Caché supports at the server, including Caché Basic and Multivalue Basic.
This post is intended to guide you through the new JSON capabilities that we introduced in Caché 2016.1. JSON has emerged to a serialization format used in many places. The web started it, but nowadays it is utilized everywhere. We've got plenty to cover, so let's get started.
There's a new and exciting enhancement to QEWD that has just been released - it's an additional layer of abstraction known as QEWD-Up. QEWD-Up hides away all the mechanics of QEWD itself, allowing you to focus on just your REST APIs and the code that implements them.
Additionally, and importantly, QEWD-Up simplifies the maintenance of your REST APIs, allowing you (and others) to quickly and easily understand their life-cycle and implementation.
Recently I reread this article by @Bernd Mueller. It's about calling DELFATE function from zlib library. In this article I'll demonstrate several different approaches to callout libraries, we'll build the same functionality (compress function) in several different languages and compare them.
When working at the Caché command prompt I sometimes want to run an operating system command on the server host. By prefixing my command line with ! or $ I can do this with ease. The following examples are from 2017.1 on Windows, but the feature is available on all versions and platforms:
The following code walks a DOM using %XML.Node. It also prevents %XML.Writer to change whitespace. Run the code using the class method "test":
Class objectscript.walkDOM Extends %Persistent
{
ClassMethod dfs(node As %XML.Node)
{
s entrynode=node.NodeId
do {
//element nodes with one whitespacetyped child are the ones we want to change
if (node.NodeType=$$$xmlELEMENTNODE){
s snode=node.NodeId
if (node.MoveToFirstChild())
{
i ('node.MoveToNextSibling()){
i (node.NodeType=$$$xmlWHITESPACENODE){
s node.NodeType=$$$xmlTEXTNODE
s node.NodeId=snode
}
}
}
s node.NodeId=snode
}
if (node.HasChildNodes()){
d node.MoveToFirstChild()
d ..dfs(node)
}
} while (node.NodeType'="" && node.MoveToNextSibling())
s node.NodeId=entrynode
}
ClassMethod test()
{
set xml = "abcdefg<![CDATA[ ]]>"
s reader=##class(%XML.Reader).%New()
do reader.OpenString(xml)
set writer = ##class(%XML.Writer).%New()
//do some magic
d ..dfs(reader.Document)
w !,"with indent=1:",!
set writer.Indent = 1
do writer.OutputToString()
do writer.Document(reader.Document)
w writer.GetXMLString()
set writer.Indent = 0
w !,"with indent=0:",!
do writer.OutputToString()
do writer.Document(reader.Document)
w writer.GetXMLString()
}
}
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.
This article was written as an attempt to share the experience of installing the InterSystems Caché DBMS for production environment.
We all know that the development configuration of a DBMS is very different from real-life conditions.
As a rule, development is carried out in “hothouse conditions” with a bare minimum of security measures, but when we publish our project online, we must ensure its reliable and uninterrupted operation in a very aggressive environment.
Did you know that Caché (and now InterSystems IRIS) has available parser for ObjectScript ?
Well, technically, lexer. It hides under the name of %SyntaxColor class. This class provides API to the DLL used by Studio to do syntax highlighting. As a result if works only under Windows.
I bet that not everyone familiar with InterSystems Caché knows about Studio extensions for working with the source code. You can actually use the Studio to create your own type of source code, compile it into interpretable (INT) and object code, and sometimes even add code completion support. That is, theoretically, you can make the Studio support any programming language that will be executed by the DBMS just as well as Caché ObjectScript. In this article, I will give you a simple example of writing programs in Caché Studio using a language that resembles JavaScript. If you are interested, please read along.
Some people are lucky enough to have a totally separate environment to run production in.
-- Unknown
.
In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:
Git 101
Git flow (development process)
GitLab installation
GitLab WorkFlow
GitLab CI/CD
CI/CD with containers
This first part deals with the cornerstone of modern software development - Git version control system and various Git flows.
(Originally posted on Intersystems CODE by @Iain Bray) The following code snippet converts all indices in a package to bitmap indices. The subroutine "test" runs the code: