4 Followers · 339 Posts

Caché Server Pages (CSP) is both an architecture and toolset used to build an interactive web applications with the InterSystems Data Platform.

Question Tom Van Oosterwyck · Dec 3, 2019

Hello,

I have a couple of IOT devices that communicate via WebSockets to our backend.

I successfully managed to create a websocket connection between server and (iot)client using %CSP.WebSocket
However I would like to implement authentication on this using the HTTP headers at the same time of Connection: Upgrade.

I tried to set the headers to globals in order to debug but they are always empty.

Example code: 

1
0 344
Article Peter Cooper · Mar 13, 2018 3m read

Index to Articles

Hi All

I am an avid user of ZEN for over 10 years now and it works for me.
But it seems that Intersystems are no longer actively developing it (or ZEN Mojo), the only published reference to this  is here

As an aside, Intersystems makes fine products (I have been using the technology for 35 years) and has great support BUT they are not good at being open with their product road map/retirement plans.  This is very embarrassing  to me when talking with my end user clients.

10
1 2077
Article Evgeny Shvarov · Nov 19, 2019 1m read

Hi developers!

I just want to share with you the knowledge aka experience which could save you a few hours someday. 

If you are building REST API with IRIS which contains more than 1 level of "/", e.g. '/patients/all'  don't forget to add parameter 'recurse=1' into your deployment script in %Installer, otherwise all the second and higher entries won't work. And all the entries of level=1 will work.

/patients

- will work,  but

/patients/all

- won't.  

Here is an example of CSPApplicatoin section which fix the issue and which you may want to use in your %Installer class:

    <CSPApplication Url="${CSPAPP}"
      Recurse="1"
      Directory="${CSPAPPDIR}"
      Grant="${RESOURCE},%SQL"
      AuthenticationMethods="96"
      />
0
1 314
Question Michael Davidovich · Nov 14, 2019

I'm playing with Cache web apps (CSP pages) and local dev . . .

My understanding is that when you run Cache, it spins up a very lightweight Apache web server with the web root C:\InterSystems\Cache\CSP (or where your CSP folder happens to be).  I can successfully place a index.html file with a simple header element in any one of the sub directories in \CSP (e.g. samples, sys, user) and it will successfully be served on, for example, http://localhost:57772/CSP/samples/index.html.

5
0 869
Question Rubens Silva · Nov 12, 2019

Pretty straight forward.
I'm tempted to hard-code ISO-8859-1 inside my VSCode extension when working with CSP because this seems to be the encoding used by default, but I need to know if there's any other possible configuration. So can you share your experience when working with CSPs? Like issues with encoding, discoveries regarding it, workarounds etc.
Also, can someone tell me if it's possible to work with UTF-8 encoded CSP files using Atelier without breaking the encoding of the output file?

3
1 931
Article Peter Cooper · May 10, 2018 3m read

Index to Articles

Published 2018-05-11 Last edit -

Hi All

I this article I detail some strategic issues that a new development UI will need to address - these are the ones that I can think of now - others may come to light during this journey.

See the webinar by Eduard Lebedyuk here from the last Global Summit describing  modern web development and Caché

And, as always, if I have missed something please comment....

13
2 1640
Article Gevorg Arutiunian · Apr 27, 2019 2m read

Here is an ObjectScript snippet which lets to create database, namespace and a web application for InterSystems IRIS:

	set currentNS = $namespace
	
	zn "%SYS"
	
	write "Create DB ...",!
	set dbName="testDB"
 	set dbProperties("Directory") = "/InterSystems/IRIS/mgr/testDB"
 	set status=##Class(Config.Databases).Create(dbName,.dbProperties)
	write:'status $system.Status.DisplayError(status)
	write "DB """_dbName_""" was created!",!!
	
	
	write "Create namespace ...",!
	set nsName="testNS"
	//DB for globals
	set nsProperties("Globals") = dbName
	//DB for routines
	set nsProperties("Routines") = dbName
	set status=##Class(Config.Namespaces).Create(nsName,.nsProperties)
	write:'status $system.Status.DisplayError(status)
	write "Namespace """_nsName_""" was created!",!!
	
	
	write "Create web application ...",!
	set webName = "/csp/testApplication"
	set webProperties("NameSpace") = nsName
	set webProperties("Enabled") = $$$YES
	set webProperties("IsNameSpaceDefault") = $$$YES
	set webProperties("CSPZENEnabled") = $$$YES
	set webProperties("DeepSeeEnabled") = $$$YES
	set webProperties("AutheEnabled") = $$$AutheCache
	set status = ##class(Security.Applications).Create(webName, .webProperties)
	write:'status $system.Status.DisplayError(status)
	write "Web application """webName""" was created!",!
	
	zn currentNS
3
6 1857
Question Jose Antonio Benitez · Apr 11, 2019

Hi, I have used CSP to exec SQL selects from  any own NAMESPACE. But in our servers we have many SQL GATEWAY CONNECTIONS.

I'd like to create a CSP page that could use these gateway to exec SQL using these gateway connections, only Administrators will use that page to launch many select at many dsn. I'm not sure if we must deploy that CSP on %SYS namespace and how to use DSN(SQL Gateway connections) that are defined on server.

Anoyone has made that?

For example:

DSN CLIENT ONE

DSN CLIENT ONE

CSP Webpage:

TEXTBOX: Introduce your select:

select count(*) from product where stock<100 

OPTION BUTTON:

1
0 349
Question Massimo Sebastiani · Sep 4, 2019

Hello, has anyone tried to use Caché as a reverse proxy ?

We are trying to embed a dashboard server (Plotly Dash in this case, but it could be anything which runs on its application server) inside our application which is written in Caché.  
The dashboard/report server runs locally (for example, or inside a LAN) on port 8080, and has no authentication features, so we have to implement them on a different layer, and we'd like to use Caché for it.

We'd like to hide the dashboard server (port 8080 not exposed), and use it behind Caché, this way (putting it as simple as possible):

5
0 631
Article David Crawford · Jul 31, 2019 2m read

IRIS provides us with anti login CSRF attack mitigation, however this is not the same as a CSRF attack, as login attacks only occur on the login form. There are currently no built-in tools to mitigate CSRF attacks on api calls and other forms, so this is a step in mitigating these attacks.

See the following link from OWASP for the definition of a CSRF attack:

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)

5
1 830
Question David Crawford · Jul 15, 2019

CSP pages extend %CSP.Page. What about html/css/js/etc that are hosted on the same web application? Is there any way to override how they're processed like with how you can override a CSP page and CSP REST logic?

Thank you!

David

4
1 416
Question Florian Hansmann · Jul 9, 2019

Hey Intersystems-Developer,

I have already used that and know its possible, but can't find it anymore :(

I need dynamic access on proxy objects. For example:

set key = "lastName"

set name = obj.name

set lastName = obj.key <- Not possible 

set lastName = obj.GetAt(key) <- Not possible

How can I get access to that object with my dynamic variable "key" ?

Best regards. 

3
0 368
Question Luk Jesso · Apr 10, 2019

Hello experts,

I'm new to InterSystems software and still not so familiar with it. Therefore I do apologize in front if this question is irrelevant, not making sense or answer is commonly known.
 

I've did my best in search for answer, but unfortunately i haven't found anything helpfull. So I decided to ask for help here.

My problem is repetitive error which occure in CSP Gateway event log : 

Error Condition: Failed to read posted content from the client (Content-Length: 1404; Data Actually Read: 0; Read Error: 70007)

1
0 528
Question Thembelani Mlalazi · Apr 11, 2019

I have a query that I would like to  have refreshing at certain intervals lets say every 30 seconds with out refreshing the page content using the META TAGS

refreshes the whole page but I have a jquery function that will run at those intervals that I can use the problem is getting the jquery to call my COS function or is the way to do it with pure COS

2
0 513
Question Thembelani Mlalazi · Apr 5, 2019

I am trying to get the time difference between two time stamps one is recorded earlier to the one happening current but the problem is sql expect string while I have the other stored in a variable and if I do the following I get errors any help please

&sql(SELECT {fn TIMESTAMPDIFF(SQL_TSI_HOUR,$ZDT($H,3,1,3),tx)})

 

please note that tx is a variable holding the time formatted the same way as the one being compared to

3
0 811
Question Laura Cavanaugh · Apr 4, 2019

On one of our servers, when I am in Mgmt Portal and click the link for Configure / CSP Gateway Management, I get this url:

http://ipaddress.of.server:port/INSTANCENAME/csp/bin/Systems/Module.cxw?CSPSYS=0&CSPSYSreferer=_CSP.Portal.Home.zen

but the page displays a 0, and nothing else. Literally, just a 0.  This link works on our other servers, with the same URL.  Any idea why? 

Thanks,

Laura

4
0 380
Question Thembelani Mlalazi · Mar 25, 2019

I have an application using examples from the lottery example in samples name space how do I create a dynamically link based on the data displayed to add a record id to the link

the idea is to loop over the records displays fields and link to edit the shown data at the end of the record in a table format

1
0 367
Question Chip Gore · Mar 13, 2019

Hi -

I'm having odd behaviors on my EC2 hosted IRIS Community instance.

When I configure a "custom login page" in the System Management Portal for my web application I'm seeing a few different behaviors that are under documented (and also undesired)

The old Caché documentation indicates that the custom login page could be a ".csp" file, but this seems to nor be the case (i kept getting "not found" errors, even though I could bring up the page directly from the url FOR the login.csp file. To get around this, I created an HTML file and then, at least, the login page could be found to be rendered.

2
0 670
Question Olga Smolyar · Feb 27, 2019

Hello,

I'm trying to set up an Apache server using CSP Gateway on Windows 10 (64-bit), but am getting the  error "Cannot load c:/InterSystems/IRIS_2019/CSP/bin/CSPa24.dll into server: %1 is not a valid Win32 application" when attempting to start up httpd.exe after adding the CSP-specific section to httpd.conf.

The CSP gateway is 64-bit (CSPGateway-2018.1.1.643.0-win_x64) and so is the Apache install (httpd-2.4.38-o102q-x64-vc14).

The CSPa24.dll file does exist in the specified location. 

Any suggestions appreciated.

Thank you,

Olga

5
0 961
Question Edward Lautzenhiser · Feb 21, 2019

I'm trying to test SOAP integration by using one Ensemble production to send a SOAP message to another production, but I'm seeing the following error when I try to pass a message between the two:

ERROR #6248: SOAP response is a SOAP fault: faultcode=Server
faultstring=Internal Server Error
faultactor=
detail=
<error xmlns="http://tempuri.org">
<text>ERROR #7900: Service 'SOAP' not enabled for application '/csp/healthshare/hspc/'</text>
</error> 

I'm following this guide to creating a service, and I've done the following steps which I expected to enable SOAP:

4
0 1863
Article Robert Cemper · Feb 8, 2019 2m read

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

The message to send is simply passed as a hash after the CSP_URL. (Mind URL encoding!)

0
0 623
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 Seppo Kruth · Oct 25, 2018

I'm trying to set up a  webserver (Apache 2.4 on Windows 10) for a CSP application on a Cache which is not running on the same Computer. 

My Problem is that in the csp-pages there is a declaration:

<link rel="stylesheet" type="text/css" href="/jbsscan/stylesheets/style.css"></link>
<script language="JavaScript" type="text/javascript" src="/jbsscan/javascript/javascriptScanner.js"></script>
 

5
0 663
Job Simcha Gershon · Oct 20, 2018

Hi every body

I hope it's the right place & I'm not offending any body.

I'm a veteran Mumps/Cache/Ensemble programmer .  I think my only draw back is my age, although my brain is still young & bubbly.

I'm looking a long time for work without success.

I gathered a lot of knowledge & experience during those long years , developed many projects & i'm ready to do any work only to feel useful.

I'll add my resume, I hope & wish that this post will bring some change as I'm desperate to get some work.

Thank you very much Simcha my email is shiluvg@gmail.com

Covering letter

Good day

0
0 515
Question Brian Palmund · Oct 2, 2018

Hi,

We get a lot of errors in the CSP Gateway eventlog like this:

>>> Time: Tue Oct 2 11:32:48 2018; RT Build: 1701.1606aa (linux/apapi:srv=2.4.6/apr=1.4.8/apu=1.5.2/mpm=prefork); Log-Level: 0; Gateway-PID: 16600; Gateway-TID: 140543045277824 
WARNING: The REQUEST_METHOD is absent for this request (CSP_DELETE_VARS) 
HTTP_PRAGMA,HTTP_CACHE_CONTROL,HTTP_ACCESS_CONTROL_REQUEST_METHOD,HTTP_ORIGIN,HTTP_ACCESS_CONTROL_REQUEST_HEADERS

It does not seem to be from an external source. Anyone have an idea where requests like this could originate from and their purpose?

 

Version is: 2017.1.0.792.0

1
0 347
Article Chris Stewart · Apr 24, 2017 2m read

or "Bonus Breakage"

In our last lesson, we added a relationship between 2 persistent classes.  We are clearly going to need to start creating REST Services to expose CRUD operations for each of these classes, but before we do that, we should really finish defining our linkages.  We added code to our Widget toJSON to spool off related Accessory data, so we should really do the reciprocal and allow Accessories to return all Widgets that are compatible.

2
1 1349