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 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 449
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 3803
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 305
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 197
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 304
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 439
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 272
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 1435
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 268
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 346
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 498
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 277
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 3951
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 454
Question Chip Gore · Sep 20, 2022

Hi -

I'm looking for some help in getting an OS level application on my server to startup from a csp page and I'm just missing something.

I have a routine (and I've tried the same code from an instance method, with the same results) that will launch an application at the OS level using the $zf(-100,keywords,program,parms) from a terminal session, but it won't/doesn't seem to work when I call the code from a #server() call from my webpage. I don't know if there is some combination of keywords or perhaps a different version of the $zf() call that should/would work.

7
1 347
Question Cacio Watt · Aug 28, 2022

Hi,

Over time I have created an house-automation solution based on IRIS:
90% of my code is pure ObjectScript, with the most recent 10% being the use of Python libraries for specific tasks.
All of the above being terminal based up to now.
I would like to expose some configuration options / parameters via a very simple web page, to be serviced with the IRIS private web service (so I don't want to use an external Webserver just for this..)

7
0 553
Question Michael Davidovich · Jul 29, 2022

What are other's thoughts, opinions and experiences going from CSP to RESTful services, specifically when it comes to reusing code in CSP files?

One could define a method in CSP as follows:

<script language="cache" method="SubmitSomethingAwesome" arguments="aswesomeId:%Numeric"> 

And it's generated in csp.mycsppage.cls ascsp.mycsppage.SubmitSomethingAwesome(awesomeId as %Numeric).

Have people had success defining there rest call by calling the generated CSP classmethod?

Things that work well I've found:

3
0 464
Article Oliver Wilms · Jul 10, 2022 1m read

As I was thinking what I could develop for InterSystems Full Stack Contest, I saw this post:

https://community.intersystems.com/post/how-access-production-items-through-objectscript

I developed ProductionManager.csp. It displays items in the active production. It also displays the Class in use and the date and time of last message. I believe these data points can help you make decisions which items to remove from the production.

0
0 272