S/Web User Manual

Home S/Web Description S/Web Overview S/Web Installation S/Web Features S/Web Functions S/Web Objects S/Web Settings S/Web Troubleshoot S/Web FAQ S/Web Appendices

Links on this page:
 

OpenInsight "OICGI" Compatibility

Security

User Validation

Per Request Security

S/Web Repository

S/Web embedded processor commands

S/Web Features

OpenInsight "OICGI" Compatibility

S/Web has a special flag that enables it to run using OpenInsight's OICGI command structure. When running in this mode certain S/Web features are disabled. This mode is global across all servers.

Security

S/Web incorporates a robust security model.  Security takes the form of:

User Validation

Per Request Security

S/Web Repository

S/Web embedded processor commands

S/Web allows you to embed commands within your HTML document that are processed when the server returns it to the client. These range from swapping out placeholder values with those defined in the SWAPLIST to executing programs to insert dynamic content.

The commands start with the string '<$$' and end with the string '$$>'. Alternatively they may start with the string '<%%' and end with the string %%>' (this makes the HTML more HTML editor friendly!). Between these start and end tags is the command itself along with any arguments it needs. Note that embedded processor commands can be embedded into items to be embedded as the processing is recursive.

The "=" command is used to insert a special system variable - the valid arguments are:

COMMANDDESCRIPTION
DATEInserts the date
TIMEInserts the time
TIMEDATEInserts the date and time
SESSIONIDInserts the sessionID in the format NAME=VALUE
SESSIONIDXAs above, but ignores scrambling
LOGINIDInserts the login ID used by the CLIENT object
SERVER_NAMEInserts the SERVER_NAME CGI environment variable
SERVER_USERInserts the SERVER_URL CGI environment variable
SCRIPT_NAMEInserts the SCRIPT_NAME CGI environment variable

So to insert the date and time in your HTML you could do something like this:

<html>
   <head>
      <title>Example document</title>
   </head>
   <body>
      The time is <$$=TIME$$>
      The date id <$$=DATE$$>
   </body>
</html>

Other commands invariable have the format:

<$$CMD;ARG1,ARG2,ARG3,..,ARGn$$>

The command is separated from the arguments by a ';' character and each argument is delimited by a ',' character.

XLATE:

This inserts an entire row from a table into the content. Multiple rows may be defined by separating them with a ",".

<$$XLATE;TABLE*ROWID$$>

Each argument is the name of a table followed by the row key to use, delimited by a "*". So if we wanted to insert these rows:

TEST1 from the HTML_TEST table

TEST*23 from the WIBBLE table

We would use:

<$$XLATE;HTML_TEST*TEST1,WIBBLE*TEST*23$$>

JS:

This inserts a JavaScript entity(s) as defined in the S/Web Repository. Multiple entities may be defined by separating them with a ",".

<$$JS;ENTID$$>

So to insert the REVSTRING JavaScript library into our document we use:

<$$JS;REVSTRING$$>

Note that SCRIPT tags are automatically inserted around the script inserted.

CSS:

This inserts a Cascading Style Sheets entity(s) defined in the S/Web Repository. Multiple entities may be defined by separating them with a ",".

<$$CSS;ENTID$$>

So to insert the ZZ_STYLES CSS Sheet into our document we use:

<$$JS;ZZ_STYLES$$>

Note that STYLE tags are automatically inserted around the sheet inserted.

SWAP:

This command allows you replace placeholder strings with alternative strings held in the global SWAPLIST array. Multiple swap-strings may be defined by separating them with a ",".

<$$SWAP;PLACEHOLDER,PLACEHOLDER$$>

For example, if the SWAPLIST was set to replace an instance of "IMAGEDIR" with the string "http://www.someserver.com/images" then this document:

<html>
<head>
<title>Example document</title>
</head>
<body>
<img src="<$$SWAP;IMAGEDIR$$>/testpic.gif">
</body>
</html>

would be sent to the client as:

<html>
<head>
<title>Example document</title>
</head>
<body>
<img src="http://www.someserver.com/images/testpic.gif">
</body>
</html>

For more information on the SWAPLIST see XX

EXEC:

This command tells the system to execute a program and insert the results of the system variable @ans into the document at that point. Multiple programs may be defined by separating them with ','s.

<$$EXEC;PROG1,PROG2$$>

For example if we had this (very!) simple program:

subroutine testExec( void )
@ans = "Text inserted by testExec()"
return

we could use it like so:

<html>
<head>
<title>Example document</title>
</head>
<body>
<p><$$EXEC;TESTEXEC$$></p>
</body>
</html>

Which would return to the browser this:

<html>
<head>
<title>Example document</title>
</head>
<body>
<p>Text inserted by testExec()</p>
</body>
</html>

Parameters can be passed to the EXECed routine as follows


<html>
<head>
<title>Example document</title>
</head>
<body>
<p><$$EXEC;TESTEXEC(BLUE,RED),NEWEXEC$$></p>
</body>
</html>

where BLUE and RED are literals not variables.

EVAL:

<$$EVAL;code$$>

Eval evaluates and executes R/Basic script and inserts the contents of @ANS into the content stream. The results of this statement can be any HTML or text that would appear in your document. This can be embedded anywhere in your document, including Javascript or VBScript programs. For example, suppose you wish to have your Javascript contain the value of a symbolic.

......
sCompName = <$$EVAL;
Properties = "NAME"
CompName = ""
if www_Exec_Method( "GET", "PROPERTY", "NAME", CompName, "", "", "", "", errorText )
CompName = XLate( "COMPANY", CompName, "COMPANY_NAME", "X" )
If Len( CompName ) Else
CompName = "Unknown Company"
End
End
@ANS = CompName
$$> ;
alert( "Your company name is " + sCompName ) ;
..........

NOTE: Some visual HTML editors will escape the '$$' characters when working with your HTML pages so please bear this in mind when designing your pages!!

[top]

Copyright © 2005 The Sprezzatura Group. All rights reserved.