DocBook|Search
Class Reference
%CSP.Page
   
Server:basexml
Instance:SOAXML
User:UnknownUser
 
-
  [%SYS] >  [%CSP] >  [Page]
Private  Storage  

abstract class %CSP.Page extends %Library.Base

The %CSP.Page object serves as an event handler for CSP requests. All .csp pages by default derive from %CSP.Page, although you can override this using the <CSP:CLASS> tag. CSP Servlets can be created by deriving a class from %CSP.Page, see %CSP.StreamServer as an example.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
14 30


Summary

Methods
%ClassIsLatestVersion %ClassName %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %Extends %GetParameter %IsA
%OriginalNamespace %PackageName ConvertParameter Decrypt
Encrypt EscapeHTML EscapeURL HyperEventBody
HyperEventCall HyperEventFrame HyperEventHead Include
InsertHiddenField InsertHiddenFields IsPrivate Link
OnHTTPHeader OnPage OnPageError OnPostHTTP
OnPostHyperEvent OnPreHTTP OnPreHyperEvent Page
QuoteJS RewriteURL ShowError StartTimer
StopTimer ThrowError UnescapeHTML UnescapeURL

Subclasses
%Activate.UI.WizardDone %BI.AnalyzerGrid %BI.CDC
%BI.CSPsuper %BI.Chart %BI.ChartCus
%BI.ChartLgnd %BI.CodeTableCSP %BI.ComLinkTable
%BI.ComSQLGenerator %BI.DMG %BI.DashboardGrid
%BI.DataAlerts %BI.DatePicker %BI.DocMgmt
%BI.EchoClass %BI.EchoClsRoutine %BI.EdmundPageCSP
%BI.Excel %BI.ExcelExport %BI.ExcelTry
%BI.ExportImport %BI.ExportList %BI.FilterLocation
%BI.Generator %BI.GridChartDisplay %BI.GridColSort
%BI.GridColorScheme %BI.GridPivoting %BI.Help
%BI.ImportList %BI.KnowledgeCSP %BI.LanguageSVGCSP
%BI.LanguageSub %BI.ListFolderData %BI.MailClient
%BI.PerfAlert2 %BI.PivotHeader %BI.QueryVariableMgmt
%BI.RulesSetup %BI.SMSTemplateMod %BI.SMSmsg
%BI.SVGCtxtMenu %BI.Scorecard %BI.SystemVariable
%BI.TaskMgmt %BI.TestExcel %BI.TestSVG
%BI.TimeSeries %BI.Trees %BI.UserObjectListWeb
%BI.ValueRange %BI.VanDiagSetup %BI.VennSVG
%BI.WebADTM %BI.WebAccessLog %BI.WebAddressBook
%BI.WebAnalyzer %BI.WebAnalyzer2 %BI.WebAnalyzerSetup
%BI.WebBlog %BI.WebCMeditor %BI.WebCdnEditor
%BI.WebChartList %BI.WebClsCom %BI.WebCodeTableEnc
%BI.WebColorScheme %BI.WebComBank %BI.WebCompSetup
%BI.WebComponentKPI %BI.WebComponentTree %BI.WebContactFunc
%BI.WebCtxtMenu %BI.WebCurrency %BI.WebDLimitAcc
%BI.WebDList %BI.WebDashboard %BI.WebDashboardE
%BI.WebDashboardLibCom %BI.WebDashboardWiz %BI.WebDataCapture
%BI.WebDimML %BI.WebDocBrwsr %BI.WebDtAnalysis
%BI.WebETL %BI.WebEditQueryCom %BI.WebEmail
%BI.WebExcelTemplate %BI.WebFile %BI.WebFold
%BI.WebGrid %BI.WebHelp %BI.WebKPIClass
%BI.WebKPIEx %BI.WebKnowledge %BI.WebLesenReg
%BI.WebList %BI.WebListbackup %BI.WebLnkRpt
%BI.WebMain %BI.WebMain2 %BI.WebMainTable
%BI.WebManEnt %BI.WebMapTable %BI.WebMedList
%BI.WebMessaging %BI.WebMessagingExt %BI.WebMetricsBuild
%BI.WebMultiSites %BI.WebOCR %BI.WebPerfMet
%BI.WebPivTable %BI.WebPrinter %BI.WebPrn
%BI.WebQuery %BI.WebQueryVariable %BI.WebReporter
%BI.WebReporter2 %BI.WebRoleCheck %BI.WebRoleMtns
%BI.WebSCActions %BI.WebSCMod %BI.WebSMS
%BI.WebSQLComGen %BI.WebSVG %BI.WebSVGTest
%BI.WebScheduler %BI.WebScheduler2 %BI.WebSchema
%BI.WebSchemaMain %BI.WebSecCorrection %BI.WebShortcut
%BI.WebSqlWiz %BI.WebStoredProc %BI.WebSysFn
%BI.WebTAClassDialogBox %BI.WebTCWF %BI.WebTableList
%BI.WebTaskMgmt %BI.WebTrakSpeedMap %BI.WebTransformation
%BI.WebTranslation %BI.WebTranslationD %BI.WebUsersMtn
%BI.WebUtil %BI.WebWorkFlow %BI.WebWorkFlowE
%BI.WordExport %BI.swDashBoardLibCode %BI.webPreference
%CSP.Broker %CSP.Documatic %CSP.Error
%CSP.Login %CSP.PageLookup %CSP.RuleDoc
%CSP.StreamServer %CSP.StudioTemplateSuper %CSP.UI.Portal.Dialog.CompileOutput
%CSP.UI.Portal.Dialog.ExportOutput %CSP.UI.Portal.Dialog.ImportOutput %CSP.UI.Portal.Dialog.IntegLogContent
%CSP.UI.Portal.Dialog.IntegOutput %CSP.UI.SQL.Error %CSP.UI.SQL.ExImWizard
%CSP.UI.SQL.ExImWizardResultPage %CSP.UI.SQL.FormPane %CSP.UI.SQL.LinkWizard
%CSP.UI.SQL.LinkWizardResultPage %CSP.UI.SQL.QueryForm %CSP.UI.SQL.USER
%CSP.UI.System.ApplicationPane %CSP.UI.System.AutoPageCSP %CSP.UI.System.ExpResultPage
%CSP.UI.System.ExpResultPane %CSP.UI.System.GlobalDrillPane %CSP.UI.System.GlobalViewPane
%CSP.UI.System.LockForm %CSP.UI.System.ManageAuditPane %CSP.UI.System.ViewCode
%CSP.Util.AutoPage %CSP.Util.Domain %CSP.Util.EnsStart
%CSP.Util.HTMLDashboardPane %CSP.Utils %CSP.WLD.Base
%CSP.WebLink %CSP.XMLSQL %DeepSee.AbstractKPI
%DeepSee.DataConnector %DeepSee.UI.Dialog.CubeCompileOutput %DeepSee.UI.MDXExcel
%DeepSee.UI.TermListExport %Library.SysLog %Monitor.Alert
%Monitor.AlertLog %SOAP.WebService %SOAP.WebServiceInfo
%SOAP.WebServiceInvoke %UnitTest.Report %WebStress.Portal.AppStats
%WebStress.Portal.Encrypt %XML.DataSet %XML.Utils.SchemaServer
%ZEN.Component.abstractPage %ZEN.PageServer %ZEN.Report.reportLauncher
%ZEN.Report.reportPage %ZEN.SVGComponent.svgPage %ZEN.Template.AddInWizard.SOAPWizardOutput
%ZEN.Template.AddInWizard.XSLTransformWizardOutput %ZEN.Template.ObjectGatewayWizard.DotNetDone %ZEN.Template.ObjectGatewayWizard.JavaDone
%ZEN.application Monitor.Sample

Parameters

• parameter CHARSET;
Specifies the default character set for the page. This can be overriden using the <CSP:CONTENT CHARSET=> tag, or by setting the %response.CharSet property in the OnPreHTTP method. If this parameter is not specified, then for Unicode systems the default charset is utf-8 and for 8-bit systems it is the system default charset.
• parameter CONTENTTYPE;
Specifies the default content type for the page. This can be overriden using the <CSP:CONTENT TYPE=> tag, or by setting the %response.ContentType property in the OnPreHTTP method. The default value if this parameter is not set is text/html.
• parameter CSPFILE;
If this page was compiled from a .csp file, then this parameter contains the filename used for compilation.
• parameter CSPSTRICT;
The CSPSTRICT parameter is set to 1, if the DOCTYPE indicates that this is a strict or frameset XHTML or HTML 4 page.
• parameter CSPURL;
This parameter is used to make sure that if multiple CSP applications are mapped to the same namespace that the CSP engine can correctly identify which class corresponds with which URL. If 'LockCSPName' is true (the default, defined in the CSP application) then you can only access this page if the url exactly matches this 'CSPURL'. You can set this parameter to "" if you wish to disable this check for this class. This check is applied for all CSP urls (cls/csp/zen).
If this page was compiled from a .csp file, then this parameter is automatically set to contain the url of this file used for compilation.
• parameter CSPXHTML;
The CSPXHTML parameter is set to 1, if the DOCTYPE indicates that this is an XHTML page.
• parameter DOMAIN;
The default domain for csp:text, span and div tags. This parameter is used to specify the subset of localized messages to be used on this page.
• parameter ENCODED = 0;
Controls how the query parameters for this page are passed, it can be set to one of the following:

  • ENCODED=0 - Query parameters are not encrypted
  • ENCODED=1 - Query parameters are encrypted and passed within CSPToken
  • ENCODED=2 - Same as '1' except any unencrypted parameters are removed from the %request object before calling the Page method. This ensures that only encrypted parameter are available in the %CSP.Request object.
• parameter ERRORPAGE;
Specify a custom error page to call if there are any problems with generating this page. If this is not specified it will use the default error page specified for this CSP application, and if this is not specified it will use the system default error page. For example this could be set to '/csp/samples/error.csp' to display the sample error page.
• parameter EXPIRES = -1;
Specified the default value for the %response.Expires.
It can be set to one of the following values:
  • -1: Expire immediately, this is the default for a CSP page
  • "": Never expire (no HTTP Expires header is sent)
  • nnnnn: Number of seconds from now when the object should expire
  • Thu, 29 Oct 1998 17:04:19 GMT: Absolute time at which the object should expire
  • ddddd,sssss: Absolute time the object should expire in $ZTimeStamp format. Note that this must be specified in the GMT timezone
Note that setting this header also effects the 'Cache-Control' and 'Pragma' headers. If the page is set to expire immediately then it will send a 'Cache-Control: no-cache' and 'Pragma: no-cache' to prevent any caches from storing the page. If the page is set to never expires then it will not send any 'Cache-Control' or 'Pragma' headers. If you set an expires date then it will not modify the 'Cache-Control' or 'Pragma' headers so if they are set they will be sent as specified and if you did not set them then nothing will be sent for these headers.
• parameter NOCHARSETCONVERT;
Specifies if we wish to turn off charset conversion for this page. Normally CSP uses the tables built into Cache to convert between different charset's, however if you do not have a charset available you may wish to turn this off to avoid getting the error page saying that this charset is not installed. Then the data will be output and read in using RAW mode. This can be overridden using the <CSP:CONTENT NOCHARSETCONVERT=1> tag, or by setting the %response.NoCharSetConvert property in the OnPreHTTP method.
• parameter PAGETIMING = 0;
If this parameter is true then we automatically record timing statistics of how long it takes to produce this page. It is off by default.
• parameter PRIVATE = 0;
Controls the access to the page, it can be set to one of the following:

  • PRIVATE=0 - Page can be linked to/bookmarked
  • PRIVATE=1 - Can only be referenced from another CSP page
The user needs initially to enter the site through a PUBLIC page.
• parameter TIMINGSLOTS = 48;
Used by the timing to decide how many slots a day should be divided up into. The default is to record the timings over half an hour (48 slots per day). If you need more detail you can modify this value in the superclass.

Methods

• final classmethod ConvertParameter(url As %String, ByRef name As %String, ByRef value As %String) as %Status
You pass this the url of the page you are going to and a name and value parameter and it will return the name and value encrypted if the target page is encoded.
• final classmethod Decrypt(data As %String) as %Binary
Decrypts the input string using the %session.Key value that is unique to this user session. The input string is the string provided by the Encrypt method, the output is the decoded string.
• final classmethod Encrypt(data As %Binary) as %String
Encrypts the input string using the %session.Key value that is unique to this user session. The output string is a string that can be included in HTML and in URLs as it does not contain any characters that need to be escaped in these environments. It can be decrypted with the Decrypt.

Note that the data must not contain any unicode characters as the encryption function just takes a byte stream. If you wish to encrypt unicode data then the simplest way is to form a $listbuild of the string first to convert it into a byte stream.

• final classmethod EscapeHTML(in) as %String
This method converts input HTML text into Escaped HTML text.
• final classmethod EscapeURL(in) as %String
This method converts the in input URL string into Escaped URL string. Note that '/' is not escaped which is consistent with rfc3986
• final classmethod HyperEventBody() as %String
This method is deprecated since Java applet based hyperevents are no longer supported.

This method returns the text that needs to be written to the current device during the generation of the <body> section in order to use #server()# style HyperEvents. If you only need to use the #call()# style HyperEvents then this is not required. See HyperEventCall for details. This is not needed if you are using #server, #vbserver or #call calls from a .csp page as this is automatically inserted, it is only required when generating the class or the HyperEvent calls directly.

• final classmethod HyperEventCall(methodName As %String, args As %String, type As %Integer = 0) as %String
This method returns the string that needs to be written to the current device in order to insert a HyperEvent into a CSP page that is defined via a class. This method is the hand written class equivalent of using #call(...)#, #server(...)# or #vbserver(...)# in a CSP page.

The methodName argument defines the method to call in the same format as #server: either ..method or package.class.method.

The args argument defines the runtime JavaScript arguments to be passed to the Cache method as a comma separated string.

The type argument is 0 if you wish to use a #server(...)# style HyperEvent (this is the default), 1 if you wish to use a #call(...) style HyperEvent. Note that if the argument is 0 then it will use double quotes for the JavaScript which is the behaviour of #vbserver in a csp page, this will work correctly in both JavaScript and VBScript but you need to be aware that it will quote its parameter with ".

In order to use this method, HyperEventHead must be used in the <head> section and if you are using the #server style hyperevent then you also need HyperEventBody be used in the <body> section.

An example of an OnPage method for your page using a #call(...)# style HyperEvent:

	Write "<html>",!
	Write "<head>",!
	Write ..HyperEventHead(),!
	Write "</head>",!
	Write "<body>",!
	Write "My New CSP Page!",!
	Write "<form name=""f"">",!
	Write "<input type=""text"" name=""f1"" value=""fieldabc"">",!
	Write "<input type=""text"" name=""f2"" value=""fielddef"">",!
	Write "<input type=""button"" value=""Go"" onclick='"
	Write ..HyperEventCall("..MyMethod","self.document.f.f1.value,self.document.f.f2.value",1)
	Write ";'>",!
	Write "</form>",!
	Write ..HyperEventFrame(),!
	Write "</body>",!
	Write "</html>",!
	Quit $$$OK
• final classmethod HyperEventFrame(strict As %Boolean) as %String
This method is deprecated since iframe based hyperevents are no longer supported.

This method returns the text that needs to be written to the current device just before the generation of the </BODY> section in order to use #call()# style HyperEvents. This is not needed if you are using #call calls from a .csp page as this is automatically inserted, it is only required when generating the class or the HyperEvent calls directly. Passing the argument strict=1 will create strict HTML 4 format of script tag.

• final classmethod HyperEventHead(iframeOnly As %Boolean, strict As %Boolean = 0, optionalBroker As %Boolean) as %String
This method returns the string that needs to be written to the current device during generation of the <head> section in order to use HyperEvents. See HyperEventCall for details. This is not needed if you are using #server, #vbserver or #call calls from a .csp page as this is automatically inserted, it is only required when generating the class or the HyperEvent calls directly. Passing the argument iframeOnly=1 will suppress loading Javascript to be used only for XMLHttpRequest. The iframeonly argument is now ignored since #call and #server now both use XMLHttpRequest. However, the iframeonly argument is kept for compatibility. Passing the argument strict=1 will create strict HTML 4 format of script tag.
• final classmethod Include(url As %String)
Include another csp page or file in the output at this point. If the url ends in either 'csp' or 'cls' then it will call the csp or cls class to generate output skipping the output of the HTML headers. If the url is a file then it uses the stream server to output this file. This url can be a relative path in which case it will be resolved based on the current page url first. This is called by the <csp:include Page="page.csp"> tag.

You can pass additional parameters to the included page by adding them to the url to call. These parameters will only exist for the included page and the %request object is restored when it returns to the calling page. For example:

<csp:include Page="page.csp?PARAM=VALUE">

• final classmethod InsertHiddenField(url As %String, name As %String, value As %String, extra As %String = "") as %String
Inserts a '<input type="hidden" name="Name" value="Value">' tag into the current document. If the target url you are submitting to (url) is encoded then this will encrypt the data in this hidden link. In this way it is similar to the Link. The extra are any extra attributes to add to the tag.

For example:

<form action="target.csp">
#(..InsertHiddenField("target.csp","Name","Value"))#
<input type=submit name=Submit>
</form>
• final classmethod InsertHiddenFields(url As %String, ByRef query As %String) as %String
Return the string containing the hidden form tags. You pass it the url URL of the target page that this form is submitted to (the action=xxx attribute).

The array, query, contains an optional set of name-value pairs which are also output as hidden input fields. This is normally called automatically directly after the <FORM> tag to insert any hidden input tags that are required. However if you generate a form programatically then you may need to call this function just after you output the <FORM> tag.

• classmethod IsPrivate() as %Boolean
Returns 1 if this page is in fact a private page (see PRIVATE).
• final classmethod Link(link As %String, ByRef query As %String, addQ As %Boolean = 0) as %String
Tranforms the link specified by link into a URL and returns it as a string.

The URL may be encrypted.

The array, query, contains an optional set of name-value pairs which are added to the URL. For example 'Set query("name")="data"'

If the optional argument addQ is true, then a ? or &, as appropriate, is added to end of the URL

• abstract classmethod OnHTTPHeader(ByRef OutputBody As %Boolean) as %Status
Event handler for PAGE event: this is invoked in order to send HTTP headers. The default action is to invoke the WriteHTTPHeader() of the %CSP.Response which generates HTTP 1.0 standard headers. Set OutputBody to 0 to prevent prevent OnPage from being called, leave it unchanged otherwise. Returns a %Status code.
• classmethod OnPage() as %Status
Event handler for PAGE event: this is invoked in order to generate the content of a csp page.
• abstract classmethod OnPageError(ByRef sc As %Status)
Event handler for any error that occurs on the page. If an error occurs and this method is defined it calls this method passing it the error code by reference. You may change the error code if wished, if you set it to $$$OK then it will cancel the error and the CSP error page will not be displayed.
• abstract classmethod OnPostHTTP()
Event handler for POSTPAGE event: this is invoked after the data for the CSP page has been sent to the browser from the Cache server.
• classmethod OnPostHyperEvent(class As %String, method As %String) as %Status
Event handler which is invoked after a hyperevent method is called on this page.
• abstract classmethod OnPreHTTP() as %Boolean
Event handler for PreHTTP event: this is invoked before the HTTP headers for a CSP page have been sent. All changes to the %CSP.Response class, such as adding cookies, HTTP headers, setting the content type etc. must be made from within the OnPreHTTP() method. Also changes to the state of the CSP application such as changing %session.EndSession or %session.AppTimeout must be made within the OnPreHTTP() method. It is prefered that changes to %session.Preserve are also made in the OnPreHTTP() method as this is more efficient, although it is supported in any section of the page. Return 0 to prevent OnPage from being called.
• classmethod OnPreHyperEvent(class As %String, method As %String) as %Status
Event handler which is invoked before a hyperevent method is called on this page. This gives you a chance to modify the behavior of every hyperevent call within this page. Return an error code to prevent the hyperevent from being called.
• classmethod Page(skipheader As %Boolean = 1) as %Status
Process a request to serve a CSPPage. This method is invoked by the Caché CSP Server. In turn, this method invokes:

  • OnPreHTTP()
  • OnPage()
  • OnPostHTTP()

Note that OnPostHTTP() always gets run, even if there was an error.
skipheader will skip the running of the OnPreHTTP() method.
• final classmethod QuoteJS(in) as %String
This method converts input string into quoted JavaScript literal
• final classmethod RewriteURL(url As %String) as %String
This method will rewrite a URL to use #url()# if needed
• classmethod ShowError(sc As %Status)
Display a %Status error code to the CSP Page.
• classmethod StartTimer(name As %String)
Used to get performance information on your CSP pages. This is called to start the timing of a block of code. The name specifies the type of component we are timing, for example we automatically call this with 'Page' at the start and end of the rendering of the CSP page. The idea is that you can call this at the start and end of any block of code to log information on how long this is taking.

This is a default implementation of what sort of information to log, however you can subclass this and StopTimer to enhance the information that is logged.

• classmethod StopTimer(name As %String)
Used to time performance information on your CSP pages. This is called to stop the timing of a block of code. The name specifies the type of component to time. See StartTimer for more information on this.
• classmethod ThrowError(sc As %Status)
Passed a %Status code this goes to the error page passing this status code
• final classmethod UnescapeHTML(in) as %String
This method converts Escaped HTML text into normal HTML text
• final classmethod UnescapeURL(in) as %String
This method converts the in Escaped URL string back to its original form.