#Caché

30 Followers · 4.5K Posts

  

InterSystems Caché is a multi-model DBMS and application server. See more details here.

Documentation.

Article John Kumpf · Jan 14, 2019 2m read

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:

<script language="cache" method="giveMeAFalse" arguments="" returntype="%Boolean" procedureblock='1'>
return 0
</script>

A javascript method that logs what the value's actually interpreted as:

3
0 631
Question Duncan Priest · Sep 5, 2018

I'm writing a SOAP client in Ensemble (2017.2.2) that is required to pass empty elements to the SOAP server in the form <xsi:type="ns:ResponsibleUser"/> where ResponsibleUser is a class that itself has no properties. I initially thought I'd found the answer with the XMLIGNORENULL parameter of XML enabled classes but this didn't make any difference for SOAP requests, only working when I wrote the XML to a file. Then I came across the XMLIGNORENULL parameter for the SOAP client class (inherited from %SOAP.WebBase), but this only works for %String properties and not for properties of arbitrary

1
0 631
Question Thembelani Mlalazi · Jan 15, 2019

I have an sql statement that I would like to execute but I get the error

"zSearchChanges+5^MergeHyland.TypeTwoUtil.1 *KeyID"

and here is my sq

l  "&sql(SELECT Key INTO :KeyID FROM MergeHyland.TypeTwoDimesionalTable WHERE Key = :Key)" any ideas why 
2
0 318
Question Dmitrii Kuznetsov · Jan 9, 2019

Found a strange documentation block about Python bindings in Chapter 3.6 of the Caché manipulation functions with time and date. It looks like this text accidentally copied one to one of the Perl binging documentation. It's funny that the packages of functions called PTIME_STRUCTPtr, PDATE_STRUCTPtr and PTIMESTAMP_STRUCTPtr is suspicious for Python :)  

On the other hand, nothing is said about the functions parse_time, parse_date, parse_timestamp, which are present in /dev/python/intersys/pythonbind.py ahhh!

Has anyone encountered this problem?

2
1 617
Article Gevorg Arutiunian · Jan 11, 2019 2m read

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 -&gt; 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()
}

}

Here's a link to the code on GitHub

0
0 972
Article Steve Pisani · Jun 6, 2016 7m read

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.  


Why would I need or want to add new commands ?

5
4 1547
InterSystems Official Jeff Fried · Jan 9, 2019

Caché  2018.1.1 and Ensemble 2018.1.1 maintenance releases are now available!   

Full product installation kits can be downloaded from the WRC Software Distribution site.

For information about the corrections in this release, refer to the release notes.

 

This release is supported on the same platforms as Caché and Ensemble 2018.1.  You can see details in this Supported Platforms document.

0
0 1738
Question Michael Davidovich · Jan 3, 2019

Hello,

I have some beginner questions as I am working through the InterSystems Cache learning path:

- Where I work, we us Cache, but we often learning about and train on MUMPS.  No one really talks about or mentions MUMPS here, but my understanding is that ObjectScript is basically MUMPS plus whatever new things InterSystems put on top of it.  Is that a fair assessment?

- The training online often refers to IRIS.  We don't use IRIS, but we use globals to store data.  I suppose I'm just confused on the difference between Cache, Zen, IRIS and other products as they all seem to do similar things.  

16
0 924
Question Scott Roth · Dec 21, 2018

Has anyone called any outside Javascript code from inside their class files? I asked a long time ago if there was a way to manipulate an image within Cache Object Script, and since Cache doesn't have any image libraries its not really possible. However I have found Javascript to resize an image and wonder how hard it would be to mesh the two together.

Can anyone share any examples?

Thanks

Scott

9
1 1693
Question Chip Gore · Jan 2, 2019

Hi -

I'm wondering if anyone has coded up a means to create an extension for a %Persistent class from a base class to a sub-class without making a ton of assumptions about the Global structure. I'm trying to create a new "extension" record that would have the same ID as the Base Class 

Class BaseRecord Extends %Persistent

and

Class SubRecord Extends BaseRecord

where I would have an instance of a "BaseRecord" and I want to turn it into a "SubRecord" instance and have all of the existing references to the BaseRecord survive.

7
0 580
Article Rob Tweed · Dec 13, 2018 2m read

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.

QEWD-Up supports both monolithic application designs and MicroService-based architectures where APIs are broken down by, for example, functional role.

3
4 924
Article Gevorg Arutiunian · Dec 27, 2018 2m read

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()
	}
}

Here's a link to the code on GitHub: https://github.com/intersystems-community/code-snippets/blob/master/src/cls/objectscript/walkDOM.cls

0
0 418
Article Eduard Lebedyuk · Oct 8, 2018 5m read

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.

2
9 2995
Question Edmund White · Jan 24, 2018

I am trying to use Entity Framework with Visual Studio 2017. After following the Intersystems documentation ("Using the Caché Entity Framework Provider") I still cannot see the data source in Server Explorer.  Any ideas why?

9
1 1151
Question Karthikeyan G · Dec 20, 2018

How to configure Remotedatabase into our local instance. While connecting remote database i am getting "ERROR #463: Database C:\InterSystems\HealthShare2\mgr\Remote\ is not allowed for ECP Mirror Connection". so can anyone  help me to sort this out.

1
0 265
Question Sean Connelly · Dec 20, 2018

I've been looking at the idea of developing a Time Travel Debugger utility.

It would take a debug target and have a few options such as stack depth and disclude system code.

The debugger would either be started from an external tool, or triggered from a line of code inserted into a method that I want to record.

The debugger would execute the code from start to end and record the full stack on each step to the configured depth.

A visualisation tool would provide a set of controls to play the recording forwards and backwards and provide various ways to search and jump to points in the recording.

4
0 537
Question Pratik Mankar · Dec 19, 2018

In Persistent class, a data global is created which holds the data similar to the table created . Through terminal we can add more records to this table according to the structure of the table. How are the records reflected back into the table which has been set at global . In other words How are the global mapped to the SQL table?

2
0 699
Article Sergey Mikhailenko · Jan 23, 2018 20m read

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.

##The process of installing the InterSystems Caché DBMS with maximum security settings

OS security settings

2
5 1915