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 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 395
Article Henrique Dias · Aug 20, 2019 2m 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 2403
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 614
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 1132
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 1032
Article Chris Stewart · Apr 21, 2017 3m read

So, one day you're working away at WidgetsDirect, the leading supplier of widget and widget accessories, when your boss asks you to develop the new customer facing portal to allow the client base to access the next generation of Widgets..... and he wants you to use Angular 1.x to read into the department's Caché server.   

There's only one problem:  You've never used Angular, and don't know how to make it talk to Caché.

This guide is going to walk through the process of setting up a full Angular stack which communicates with a Caché backend using JSON over REST.  

11
5 7030
Question Hoi Lai · Jun 26, 2020

I am working on an angular applications and build a web application (Rest API) on IRIS for health, the web application uses a password authentication and setup with the default csp session time out (15 minutes). If the user make an REST API call from the angular application after the session expired, it displays a login prompt...is that anyway that we can disable the login prompt and just simply return http status 401?  When the angular application received the status 401, it can redirect to angular error page.

Thanks,

Hoi

5
0 498
Question Kishan Vaja · Jul 1, 2021

I want to add time slot and category metadata to complete my cinema application.

I am following the documentation of the cinema application "https://docs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=TWEB2…" and in that,

I was trying to add theater and time slot. But I was not able to do that.

I was also trying to filter the records as per the ratings and category selection on the search bar. but this is showing some error.

I also want to know that how to add bootstrap in cps page?

Thank you

2
0 260
Question Michael Lei · Jun 28, 2021

Why do I upload files faster with webservice than with csp?

The soap protocol used by webservice has to go through http protocol. csp directly handles http, no xml encapsulation, so it should be faster.

After testing, for a 1M file, csp is about 0.1s slower. After the gateway connection to 1972, there is a stall of about 0.1s, not sure why.

Is there any way to make the file upload speed of csp faster than webservice?

webservice用的soap协议也得走http呀。csp直接处理http,少了xml的封装,按理来说应该更快。

经测试,1M的文件,csp慢了0.1s左右。在网关连接到1972后,有0.1s左右的停滞,不知道原因。

有什么办法能够使csp的文件上传速度比webservice快吗?

1
0 473
Question Virginia Rogers · Apr 20, 2021

Hello,

I'm using $ZF(-1) in a class method which will be invoked from a csp page.

What determines the environment of the spawned process?  If I use $ZF(-1,"echo hello world > output.txt"), the resulting file is owned by cacheusr:cacheusr.  However, when I use $ZF(-1,"printenv > output.txt"), the environment is from my personal unix account, no matter which Cache username I'm logged in under when running the web application.  

Thanks

9
0 396
Question Krishnamuthu Venkatachalam · Mar 26, 2021

Dear Folks,

I have recently studied deepsee and developed few dashboards needed for our web app users. I am trying to embed them in our existing web app which uses angular with delegated user access. I need to embed the native IRIS dashboard into it. ( I can't use Highcharts or any other js tools). 

How do I setup the dashboards to work with delegated authentication (Without providing access to management portal or other parts) ? Also should I use the default csp/{Namespace}/_DeepSee.UserPortal.DashboardViewer.zen? or any other web application URL ?

Thanks

1
0 259
Question Evgenii Ermolaev · Mar 25, 2021

Currently, I am working on a CSP application that is supposed to generate reports. Users will have varying access to said reports. To achieve that, I plan to use LDAP (because it's used in other systems where those users already exist). Documentation does not provide enough information, so I'd like a clarification:Do I need to enable LDAP authentication for the whole Cache instance to use LDAP authentication in a single CSP application in that instance?We (as in me and my organization) use Cache Authentication for our instances, and one of the reasons to use LDAP for this system was to avoid

5
0 379
Question max simpson · Mar 21, 2021

Hi All,
I am implementing REST API's in IRIS using the below link as a guide. 
I chose this approach so i could have a single entry point for requests regardless of namespace

https://community.intersystems.com/post/restful-exception-handling 

a sample form the HIHLib.REST.Server class i am using is below. my question is does IRIS and CSP cache responses for requests to the CSP.REST class?
and if so what parameters or properties do i need to enable?

2
0 568
Question Enzo Toscano · Mar 9, 2021

First of all thank you for your time in reading this question and writing a response,

We would need some help,

What is the best method for save a %CSP.BinaryStream to a file?

Thank you in advance!! 

2
0 780
Question Markus Kogler · Jan 16, 2021

Hi Community,

is there a possibility to implement a "remember password" feature in a ZEN Application?

In the management portal I added a web-application for a ZEN application with password authentification. I created an own login page, and now I want to implement a "remember password" feature (User should not have to login again after the session times out or when the browser window is closed).

2
0 328
Question Andy Coutinho · Feb 25, 2021

Does anyone know how to get the closing tab/menu changing event in a CSP? I've tried the JS "OnBeforeUnload" already but it seems the browsers aren't allowing it anymore. I need to show a pop-up that holds the user if trying to get away before completing the stage.

1
0 168
Question Orlando Lagman · Jan 14, 2021

I created a csp that will capture image data from a html canvas element.  I created a button element to save the contents as a dataURL string from jpeg and make a server call.

the string is too long

I would appreciate any suggestions in saving the data into the server, currently just a global.

2
0 476
Article Oliver Wilms · Oct 5, 2020 2m read

IRIS Interoperability Productions formerly known as Ensemble are fun to work with. Yes, I really think my work is fun. I have seen File Passthrough Services and File Passthrough Operations come in handy. At one point we placed test messages in files, then we utilized a File Passthrough Service with Inbound File Adapter to send the contents of the file as a Stream to a File Passthrough Operation with Outbound TCP Adapter. The Operation pointed at a TCP service and sent the test messages.

1
0 461
Question Florian Hansmann · Nov 10, 2020

Hey Intersystems Community,

I have a Problem with the Session Handling in .csp.

I wrote all my Web Services in .csp-Pages and do the work for example in the OnPreHttp Method for to get some data.

After that the Web Service response is in JSON.

I call These Web Services via fetch in my react Single Page application, also Many request parallel. The react App is Rolled out as index.html.
Everything Works Fine with the session Handling via Cookie.

3
0 567
Question Phuc Nguyen · Oct 27, 2020

Hello,

I have a csp that occasionally will show Timeout error.

 


I am looking at the SQL Statements tab of the SQL Explorer:

The Average time is around 1.4, what would cause the CSP page to timeout if the query average time is 1.4 while the CSPGateway Server Response Timeout and Queued Request Timeout are default to 60 seconds? Does sql query from CSP that causes web pages to timeout get logged into SQL Statements ?

Thanks

9
0 437
Article Michael Smart · Oct 7, 2016 4m read

One useful feature of our REST framework is the ability for a dispatch class to identify request prefixes and forward them to another dispatch class. This approach of modularizing your URL map will improve code readability, enable you to easily maintain separate versions of an interface, and provide a means to protect API calls that only certain users will be allowed to access.

Overview

1
0 3984