4 Followers · 342 Posts

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

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 4420
Question André-Claude Gendron · Oct 28, 2022

I have to create a SOAP WebService that receives the username/password as part of a field in the Request. I have no control of the client's application.

<soapenv:Envelopexmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:tem="http://tempuri.org"><soapenv:Body><tem:ProcessRequest><!--Optional:--><tem:myRequest><tem:NomUtilisateur>ACGendron</tem:NomUtilisateur><tem:MotDePasse>MyPassword</tem:MotDePasse><!-- Other request fields --><tem:PrenomMere>?</tem:PrenomMere><tem:NumeroTele
3
0 913
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 540
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.

I am open to any suggestions at

7
1 406
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..)

My question:
how should I approach the creation of this simple, one page, web page?
Should I write it manually, in the "old" CSP way, copying some examples from

7
0 677
Question Timothy Leavitt · Aug 31, 2022

Consider the simplest possible CSP file upload/download page - you upload a file, it's saved in the database, and the file is immediately re-download via %CSP.StreamServer:

Class DC.Demo.CSPUpload.Page Extends (%Persistent, %CSP.Page)
{

Property stream As%CSP.BinaryStream [ Required ];ClassMethod OnPage() As%Status
{
	&html<<formmethod="post"enctype="multipart/form-data"><inputtype="file"name="file" /><inputtype="submit" /></form>>quit$$$OK
}

ClassMethod OnPreHTTP() As%Boolean [ ServerOnly = 1 ]
{
	#dim%requestAs%CSP.Request#dim%responseAs%CSP.Res
2
1 322
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:

- Procedure block is off so you can easily pass the symbol table around from the REST

3
0 538
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.

I read that contest asked for apps which insert, update, or delete data in InterSystems IRIS.

0
0 292
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 383
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.

9
1 1680
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 559
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.

Change Log

3
1 518
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.

I've set the object passed a string to a global and debugged a bit on command line and was successfully able to convert to a dynamic object and use the %Get method to get the

5
0 488
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 1028
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 320
Article Robert Cemper · May 27, 2022 1m read

There is a popular package "WebTerminal". It is excellent in most situations.
Except:

  • running system commands in your operating shell is not so easy
  • as it communicates to the IRIS host over HTTP and WSS it consumes 2 connections
    • With only 5 connections in the community license (and the "Grace Period of CSP")
    • you can hit the limits rater fast: 2 Webterminals + 1 SMP and you are done
  • WebCommand is a pure CSP page consuming just 1 single connection
  • WebCommand allows multiple ObjectScript command lines running in sequence
  • With $ or ! your command goes to Operating System same as with
1
0 310
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.  

Had a minor success

7
0 322
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:

  1. type - Content Type value, e.g. 'text/javascript'
  2. bin - 1 if this is binary
2
0 366
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>

If I 'w $$$displayString' outside of the embedded html, the string is written to the page as expected so I know the Macro is being

2
0 359
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 1037
Question Evgenii Ermolaev · Apr 11, 2021

Working with CSP applications, I've noticed behaviour that does not seem to be documented anywhere.

When you create a new application, Cache seems to create a virtual folder and populate it with everything that is in the physical path you set for that application.
This leads to some weird issues regarding compilation of the CSP pages that exist in both physical folder and virtual folder.

9
0 736
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:

<script language="Cache

8
0 398
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

  • Enhancements
    • Compile asynchronously to avoid timing out (#890)
    • Add objectscript.explorer.alwaysShowServerCopy setting to make ObjectScript Explorer always open server-side code, even when local copy exists (#494)
    • Move
0
0 340
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 446