0 Followers · 332 Posts

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

Question Oliver Wilms · Jul 10, 2022

I am still working on iris-for-money app: https://github.com/oliverwilms/iris-for-money

Account.csp posts a rest call with _SYSTEM username and the password.

xhttp.open("POST", "/restapi/sql/" + query, true,"_SYSTEM","SYS");
xhttp.send();

/restapi web application has Password Authentication Method enabled.

SYS is the correct password for _SYSTEM user.

I do not understand why I see login failure in Audit database.

1
0 341
Article Fabio Goncalves · Dec 12, 2016 3m read

Suppose you have developed your own web app with InterSystems technologies stack and now want to perform a captcha validation on the client side in order to determine whether or not the user is human and make it safer. There are some modern frameworks to address the captcha issue, however most part of them needs internet access to generate codes and sometimes are complex to implement. Take this as basic example considering that image recognition has gotten too good. That's why you nowadays you tend to see more pattern recognition captchas than mere reading ones. (I.e. click all the images with

9
2 1619
Question Jordan Everett · Jun 4, 2022

Hi all!

I'm currently trying to find out how to have one Web Gateway route to multiple servers Management Portal. The only thing that I have come up with so far is to potentially make different routes per server?

I have a development, test, and production server and I want to use the same Gateway server using IIS to do SSL/TLS encryption for the CSP pages.

Any ideas or recommendations to pull this off?

4
0 473
InterSystems Official Raj Singh · May 2, 2022

This month I announce the release of version 1.8.0 of the VS Code extension, which contains the following enhancements and bug fixes.

The big news is support for server-side project files as some of you old-timers will remember from Studio. If you work client-side, VS Code already has great project management features. You can simply use a folder as a project, or use multi-root workspaces. But if you work server-side, you might appreciate some better artifact management capabilities, and that's what this feature is about. Read more in this new Projects chapter of the documentation.

3
1 460
Question Michael Davidovich · Jun 6, 2022

Hi there,

I'm passing a JSON object to the server as such:

{"key":"value","key":"value","key":"value"}

From the client:

- Build object

object=JSON.stringify(object)

-pass to server side method as %String

On the server:

s object={}.FromJSON(object)

Instead of getting something like

object=<OBJECT REFERENCE>[2@%Library.DynamicObject]

I get

object="991@%Library.DynamicObject"

I can't access that object using %Get as if says invalid OREF.

5
0 416
Article Muhammad Waseem · May 30, 2022 3m read

Hi Community,

This post is a introduction of my open exchange iris-fhir-client application.

 iris-fhir-client can connect to any open FHIR Server by using embedded python with the help of fhirpy Library.
Get Resource information by terminal and by using CSP web application.

2
0 894
Question Steve Riddle · Nov 1, 2021

Hi,

Has anyone experienced any issues when using Cloudflare in front of a csp application?
I keep getting 502 errors when Cloudflare is active?

Strangely, the SMP works but only if I remove the trailing question mark from the url but it doesn't resolve the issue when I try any other csp application URL's.

3
0 282
Article Robert Cemper · May 29, 2022 1m read

ZPM is a great tool.
You can compose a large WebApplication following the existing examples.   
But differently, to Classes, Routines, Macros, or Globals I found no direct way     
to deploy a few additional CSP pages directly into an existing Namespace     
without touching the existing content.

A side issue was to find a solution that is independent of WIN or Linux directories.

My solution acts in 2 steps

  1. Loading the CSP sources from ZPM
  2. Moving them into the Namespace and compiling them.

#1 is a ZPM default and uses an intermediate CSP_directory
#2 is covered by $System.OBJ.ImportDir()

0
1 212
Question Michael Davidovich · May 13, 2022

We are experience this with our own web app and even the demo/template here: intersystems-community/iris-fullstack-template: This template shows you how to build, test and deploy a simple full-stack application using InterSystems IRIS REST API (github.com)

When changes are made to CSS or HTML files, we can see the changes are saved to file in the Docker container by visiting the command line.  However, after refreshing, clearing cache, etc. the changes don't appear on the web application in the browser.  Viewing the source css in the browser, we see it's the old file.  

7
0 249
Question Timothy Leavitt · Apr 25, 2022

I have a .woff2 file I'm trying to serve over CSP.

If I set:
^%SYS("CSP","DefaultFileCharset")="UTF8"

Then it "just works" - but I'd rather not do something so heavy-handed/instance-wide, on principle. (This is for something that will ultimately be published on the Open Exchange.)

A more granular option, it seems, is described in the %CSP.StreamServer class reference:

if you need to define settings per extension (in uppercase) you can use ^%SYS("CSP","MimeFileClassify",$zcvt(ext,"U"))=$listbuild(type,bin,charset) where:

2
0 321
Question Michael Davidovich · Apr 22, 2022

I am referencing the documentation here: https://docs.intersystems.com/ens201815/csp/docbook/DocBook.UI.Page.cls…

I have embedded html within a <script language="cache" runat="server"> block.  Within that I'm defining and using a macro, but it doesn't display at all. Something like:

<script language="cache" runat="server"> 
s stringData=obj.data 
#Define displayString stringData 
&html< 
<p>$$$displayString</p> 
> 
</script>
2
0 310
Question Chip Gore · Sep 22, 2020

Hi -

I'm trying to get my VS Code instance that is connected to an AWS IRIS instance to edit/save/compile .csp files, but it's failing to work and I'm not sure why. The ".csp" is associated with the objectscript-csp code, and the server is connected, but things just don't act like they are enabled.

Should this work? and if so, what might I have missed in configuring things?

5
0 998
Question Michael Davidovich · Apr 5, 2022

The documentation suggests this method for calling server side methods via SUBMIT: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…

Following that, the form I'm submitting needs to validate the dates entered (the startDate isn't past the endDate).  

Trying to keep everything in the .CSP file, I add a tag:

<script language="Cache" method="Validate" arguments="startDate:%Date,endDate:%Date">

I'm able to validate the dates here, but not matter what I do (quit, return false, redirect) the code that runs on the SUBMIT goes:

8
0 339
Announcement Raj Singh · Mar 21, 2022

I'm pleased to announce the release of version 1.4.4 of the VS Code extension, which contains the following enhancements and bug fixes. Links will take you to the GitHub issue being addressed. As always, if you already have the extension installed, VS Code should automatically update your extension. If you're a new user, use these instructions to get started. 

Change Log

0
0 306
Question David Hockenbroch · Feb 28, 2022

Is there a way, for testing purposes at least, to change a CSP session over to a different user? We have a lot of things in our system that are allowed or restricted based on the user login, so it would be useful for me to be able to occasionally run as a different user to see how things look and work for them. I've tried using the %CSP.Session.Login function, but that still shows the CSP session as being from the original user, not the one I've switched to.

3
0 388
Question Manikandasubramani S · Jan 26, 2019

Hi,

I have been trying to implement SPA using routing between two components in a CSP page. 

If i use the line which i commented the page views and gets data from the vue instance (when not using the <route-view> and other 2 vue route functions below).

since i need to implement routing i am using as below, now the property "selectedYear" is not getting data from vue instane and i am getting the below error as well.

I dont know whether i am going down the right path.

please see my code below and help me

1
1 1955
Article Alex Kogan · Jan 22, 2021 2m read

This concept may be known to some, but I just found it very useful and I would like to share as it may help someone else.

If you are working with CSP or Zen you sometimes come across the need to use embedded JavaScript. Suppose you are working with some loops, which use < or > as shown in example below:

&js< 

               var test = document.getElementById('seTest');

               for (var i = 0; i < test.options.length; i++) {

                              // Do Something here with my test.options[i]...

               }             

>

2
5 554
Question Martin Staudigel · Jan 24, 2022

Hello Community,

to return data from the OnPage() method of a %CSP.Page I used to simply write out the value of a %DynamicArray e.g. via

write tResponse.%ToJSON()

and return $$$OK afterwards.

Large objects bigger than 4MB result in an exception when trying to create return values using this way. What is best practice for returning values as JSON, especially if values exceeding the capcity of the %String class are to be expected? I saw that it is possible to write data to a file with e.g.:

set tmp = tResponse.%ToJSON("/opt/home/tmp/test_stream.txt")

3
0 342
Article Muhammad Waseem · Jan 14, 2022 3m read

With the release of InterSystems IRIS 2021.2 Preview and all-new LOAD DATA functionality dataset can by added with Objectscript Package Manager (ZPM) 

Medical Datasets contains following 12 datasets. For dataset tables and data details please visit ONLINE DEMO by using SuperUser | SYS 

0
0 237
Article Henrique Dias · Aug 20, 2019 3m read

Hi, everyone!


I want to share a personal project that started with a simple request at work: 

Is it's possible to know how many Caché licenses we are using? 

Reading other articles here in the community, I found this excellent article by  David Loveluck 


APM - Using the Caché History Monitor
https://community.intersystems.com/post/apm-using-cach%C3%A9-history-monitor

So, using David's article, I started using Caché History Monitor and to show all that information. 

When facing the question: Which cool tech should I use? 

24
8 2361
Article Semion Makarov · Jan 4, 2022 2m read

Hi Devs!

Recently, I needed to create templates for newsletters.
I couldn't find any tools, so I decided to use the CSP (Caché Server Pages) to build the templates.

Let's figure out how to make a newsletter similar to Weekly OEX Digest.


Weekly OEX Digest

There are strict requirements for HTML email messages.
Basic requirements:

  1. The page should be static;
  2. You have to use inline styles for mailer compatibility (so much code);
  3. Use custom fonts, some images, etc., is not allowed
0
0 541
Question James Westley-Farrell · Dec 7, 2021

I've never had a problem changing the content-type on a response using either %CSP.Page or %CSP.REST until now. No matter where I put the line to set the content-type to "application/json", it stubbornly emits a content-type of "text/html".

In OnPreHTTP: (I tried one at a time)
either
    do %response.SetHeader("content-type", "application/json") // didn't work
or

    set %response.ContentType = "text/plain" // didn't work

The same lines in OnProcessInput() didn't change the output content-type, either.

4
0 1029
Question Niklas Thilmont · Nov 17, 2021

Hey Intersystems Community!

I'm trying to get IRIS to serve static files, including security and redirect to login if no session is present.

This is the flow I am trying to accomplish:

  1. User Opens a page, <my-iris-instance>/my-app/index.html, index.html being a static file
  2. User is redirected to the default IRIS Login page since no session is present
  3. User logs in
  4. User gets redirected back to index.html
1
1 511
Question Oliver Wilms · Aug 22, 2021

I want to try SAM in AWS. I followed these steps:

docker pull store/intersystems/sam:1.0.0.115

git clone intersystems-community/sam: System Alerting and Monitoring (SAM) (github.com)

git clone https://github.com/intersystems-community/sam

tar zpxvf sam-<version>.tar.gz

tar zpxvf sam-1.0.0.115-unix.tar.gz

$ cd sam-<version>

cd /home/ec2-user/git/sam/sam-1.0.0.115-unix/

$ ./start.sh

7
0 898