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 Pedro Lopes · Aug 31, 2023

The program below works perfectly when I call it directly from the Terminal, however when I call it from within a CSP it does not work (It does not do the SELECT).

In the USER namespace, the program works both in the Terminal and on the CSP , but in another namespace it only works when called directly in the Terminal.

PropList(class) ;
 k pl S c=0 s class="'"_class_"'"
 K ^PropList s ^PropList=class
 S lista=$SYSTEM.SQL.Execute("SELECT * FROM Projet.GerePageCSP")
 while lista.%Next() {
 S c=c+1,pl(c)=lista.%Get("NomdePage")
 S ^PropList(c)=pl(c)
 }
 Q

________________________ CSP _______________________

4
0 323
Question Sandeep K C · Aug 23, 2023

Hi Guys,

For Login in CSP application, I am displaying custom Login page which is rendered from subclass CSS.CSP.Login that extends %CSP.Login, and also got IBA.CSP.Page that extends %CSP.Page with overridden method OnPreHTTP(). This setup is working perfectly for normal login.  

When I define Invalid login limit and enable Disable account if login limit reached in System > Security Management > System-wide Security Parameters, the users get disabled after certain invalid login attempts.

4
0 504
Question Sandeep K C · Aug 22, 2023

Hi guys,

In Cache CSP application, I have enabled Password expiration days to certain days in System > Security Management > System-wide Security Parameters. When password expires for the users and they try to login the login page takes to standard cache password change page. 

Is there anyway I can display my overridden page instead of standard cache password change page? 

Reason to display my own page:  I needed to break down the UserName, for eg: UserName into CompanyID - IBA and User ID - san.

2
0 217
Question Sakthivel Perumal · Aug 16, 2023

I have a webpage in CSP in which there is a link to download files (files are located in specific folder). When the user clicks on the link , it has to download the file into their local machine. Attached code for both upload and download the file from server, upload is working and download is printing the file in webpage rather than downloading it. Appreciate your help.

Upload (Working fine): 

4
0 495
Article Robert Cemper · Aug 17, 2023 1m read

Inspired by a Question from @Evgeny Shvarov and a Reply from @Ashok Kumar T
I have created a base for Global download as XML file

How to use:
 
just call the page like http://<your_server>/csp/samples2/dc.Gdown.cls?GBL=global_name

gbl-name  without the initial ^ (caret)
The output has a default name <global_name>.XML  Your choice is available.

Known Limits:

  • you have to install it at your sourcing server
  • it is not tested/working across namespaces
  • there is no partial download
  • error handling is just basic or missing

There is space for personal improvements.
and this is it:

2
1 338
Article Megumi Kakechi · Aug 3, 2023 1m read

InterSystems FAQ rubric

You can set individual error pages for the following Web Gateway error messages/system responses:

  • server error
  • server busy
  • server unavailable
  • server timeout
  • connection closed

Settings are made on the Web Gateway Management screen ([Management Portal] > [System Administration] > [Configuration] > [Web Gateway Management] > [Configuration] > [Default Parameters]).

In the Error Page section of the Default Parameters menu, set the filename of the html page to display or the URL to redirect to when an error occurs.

  

0
1 370
Question Michael Davidovich · Jan 31, 2023

When manually coding REST services and using GET /api/mgmnt/v1/:namespace/spec/:application/ to return an OpenAPI spec, how do you specify supported properties (OpenAPI Properties in Use | Creating REST Services | InterSystems IRIS Data Platform 2021.1) like responses, definitions, and information in paths like summary and description?

GET /api/mgmnt/v1/:namespace/spec/:application/ | Creating REST Services | InterSystems IRIS Data Platform 2022.2

7
1 401
Question Eduard Lebedyuk · Jul 20, 2023

I have the following setup: REST broker calls inProc BO via BS. As BO initialization is time-consuming, I want to reuse the same BO during the CSP process lifetime.

I have tried the following approaches:

  1. Set %session.Preserve to 1 (I would prefer not to use it as the BO object is not linked to a specific client)
  2. Set $$$EnsInProcPersist to 1 (looked relevant)
  3. Cached BS between calls

However, every time I call my REST endpoint, I get a new BO. Is there a way to cache inProc BOs in the CSP context?

0
0 168
Question Jamie Prevo · Jun 17, 2023

Sorry, somewhat of novice here, but how is a mac or a routine created into a binary or is there a way to hide your routines so that no other user can edit them?  Like remove source code and have an executable?

I would like to do this MAC and CSP pages

8
0 513
Article Eduard Lebedyuk · Apr 17, 2017 4m read

In this article I'll cover testing and debugging Caché web applications (mainly REST) with external tools. Second part covers Caché tools.

You wrote server-side code and want to test it from a client or already have a web application and it doesn't work. Here comes debugging. In this article I'll go from the easiest to use tools (browser) to the most comprehensive (packet analyzer), but first let's talk a little about most common errors and how they can be resolved.

2
5 3884
Question Vinay Purohit · Apr 28, 2023

Hi,

I have created two CSP pages. One is the Login page and the other page show the patient details from the database.

I want to set the session dynamically just after the successful login and after login it will be redirected to the Patient Details page. If session timeout, then wants to redirect back to the login page.

Thanks in advance.

Vinay Purohit

1
0 398
Question Ben Spead · Apr 25, 2023

I have a csp page that is using embedded Runtime Expression (https://docs.intersystems.com/ens201817/csp/docbook/Doc.View.cls?KEY=RC…) and within that expression I am using a $data() modulo 2 to look for root-level data elements (https://docs.intersystems.com/ens201817/csp/docbook/Doc.View.cls?KEY=RC…).

E.g:

#($select($data(^ImportantFlag)#2:"Important!",1:"Normal"))#

However, my modulo sign (#) after the $data() call is seen as the ending tag for the runtime expression resulting in a broken compilation.

3
0 242
Question Tiana Andria · Apr 21, 2023

Hello,

I have a form from named otpForm from where I post data to actionCheck.csp and redirect it to another csp file cmain.csp after form post and the redirect is not working. I tried to debug and check the value in the cmain.csp but noticed that redirec t is not working.

Do you know if window.location.href = "cmain.csp";    is working with CSP?

Can someone guide me what to do here please

Thank you

Here is what I did:

//post and redirect form data

1
0 364
Question Norman W. Freeman · Apr 4, 2023

I use the following code to grab 509 certificate and show private key :

set x509 = ##class(%SYS.X509Credentials).GetByAlias("foo")
write x509,!
write x509.OwnerList,!
write x509.PrivateKey,!

It works perfectly fine under Studio (eg: when called from output window) :

29@%SYS.X509Credentials
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKC...

However, it fails when called in the context of a CSP request. I got a stack trace when displaying content of PrivateKey :

5
0 504
Question Elijah Cotterrell · Mar 6, 2023

I'm curious about how embedded Python is handled by %CSP classes, particularly in the case of defining REST endpoints on IRIS.
Here is a simple dispatch class for the endpoint /api/pythonapp on my local IRIS instance (2022.3):

Class Python.App.Dispatch Extends%CSP.REST
{

XData UrlMap [ XMLNamespace = "https://www.intersystems.com/urlmap" ]
{
<Routes>
    <Route Url="/test" Method="GET" Call="Hello" />
</Routes>
}

ClassMethod Hello() As%Status [ Language = python ]
{
    import iris

    print('Hello World!')
    return True
}

}
4
0 336
Question Sabit Issakhan · Oct 29, 2018

Hello Everyone!

Following the example below i can download file only txt format, in other format(pdf,xls,rar) i have errors(can't open file), 

So, how i will change code for download file in other format? 

Thanks! 

3
1 1484
Article Oliver Wilms · Feb 2, 2023 1m read

Messages.log file contains lots of useful information about IRIS. Sometimes the file gets big, and it is not easy to get to the data I am interested to review. It would be nice to jump to a specific date and time we suspect a problem may have started.

Whenever I need support from InterSystems, WRC will ask to send them messages.log file. Dependent on where IRIS is deployed, it may be cumbersome to obtain messages.log file for sending it to InterSystems.

1
0 305
Article Muhammad Waseem · Feb 9, 2023 2m read

Hi Community,
In this article I will demonstrate below steps to add Interactive map and visualize geographic data to web application:

  • Step1 : Install Application
  • Step2 : Create CSP Page
  • Step3 : Extend dc.IrisGeoMap.Folium class
  • Step4 : Invoke DrawGeoDetails() Method

So Let us start.
 

Step1 : Install Application

First of all we need to install iris-geo-map application by using ZPM

zpm "install iris-geo-map"

0
1 416
Question Chris Pursey · Jan 31, 2023

We have created a number of REST adapters that extend %CSP.REST and these have been working fine.  However, we are now facing a problem with a new one where very large XML documents are being posted.  This is the pattern we are following:

Set inMsg = %request.Content.Read()

Set tSC = ##class(Ens.Director).CreateBusinessService("Epro_ItkHttp",.tBusinessService)

Set tSC = tBusinessService.ProcessInput(inMsg, .tBusinessServiceOutput)

However, when the %request is particularly long, it is being truncated, and working with %XML.Reader then fails in the business service class.

4
0 612
Question Enzo Toscano · Jan 19, 2023

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

We would need some help, I have created a csp page, but the first time I access it, it gives me this error:

5918  You are logged out, and can no longer perform that action 

When I refresh the page, it works ... Why?

Thank you in advance!

3
0 331
Question Norman W. Freeman · Aug 19, 2021

I have a CSP page that throw a "414 error - Request-URI Too Long" when I put lot of text (eg : 10000 characters) into a field of a submitted form. The form is submitted using POST method.

Based on some experiments I made, it seems the max size of a URL is around 8200 characters.

What is the official limit, and is there a way to increase it ? I searched in the documentation but couldn't find anything.

5
0 4386
Question Kevin Kindschuh · Nov 3, 2022

Is there a way for web application to set its session timeout value according to the user role or other criteria?

In this case, I have a custom production monitor page, and I want to set 5 minutes for most users but allow managers a longer time or those displaying pages on a monitor a longer time.

1
0 539