Content

Overview

Calling the Request Controller

Principle

Syntax

Request Parameters

Definition

About JavaScript Characters

 

Overview

Top ../images/arwup.gif (846 bytes)

When you log into a LabVantage Web Application or attempt to access a LabVantage web page, you must pass through the Request Controller servlet. The Request Controller:

Acts as LabVantage's security gate between clients (web browsers) and the Application Server.
Allows property values to be passed to a page.
Exposes instances of JSTL objects that support JSTL tags.

The Request Controller exposes the following LabVantage functionality:

LabVantage Custom Tags.
The LabVantage Custom Tag Reference describes and provides examples of these tags.

PageTagInfo class, which allows values of the following properties to be passed to a page:
Page properties (properties passed from page to page).
Request properties (properties submitted to the Request Controller from a form or URL).
Session properties (information about the current user).

LabVantage Custom Tags automatically execute methods in the PageTagInfo class. For information concerning these methods, see the Javadoc for the sapphire.* Packages.

Instances of JSTL objects that support JSTL tags. The JSTL Objects section of the topic Web Page Designer describes how JSTL objects work with LabVantage pages.

 

Calling the Request Controller

Top ../images/arwup.gif (846 bytes)

Principle

You can call the Request Controller only after logging into the LabVantage Web Application you are developing. You can login as either the sysadmin LabVantage Named User, or as the owner of the LabVantage tablespace. After logging in, you load pages into the browser by issuing commands to the Request Controller through the URL. During page development, the general format of a page request through the URL is:

http://<hostname>:<port>/<root>/rc?command=[value]&[value]=[target]

where

<hostname> is the name of your development machine.

<port> is the port number at which the Application Server listens for http requests (typically 8080).

<root> is the root folder of the Web Application.

rc is the Request Controller variable assigned to the Web Application. We recommend that you do not change this variable.

[value] is the value of the command parameter.

[target] is the designator for the page you want to load.

Example using testpage.jsp in the root folder of the mydir Web Application:

http://hostname:8080/mydir/rc?command=file&file=testpage.jsp

The calls you issue depend on the kind of page you want to load. For example, the URL

http://hostname:8080/mydir/rc?command=page&page=MyPage

calls a web page that is registered with LabVantage (MyPage is the identifier of the WebPage SDI).

The variable rc is assigned to the Request Controller. Its parameters tell it what to do. In the first example above, the command parameter with a value of file (command=file) tells the Request Controller that you want a JSP file. The file parameter with a value of testpage.jsp (file=testpage.jsp) tells the Request Controller which file you want. In the second example, command=file&page=MyPage tell the Request Controller you want a web page that is registered with LabVantage.

When you register a JSP with LabVantage, you use the Web Page Designer to associate a custom JSP with a WebPage SDI. LabVantage automatically registers "data-driven" pages you make with the Web Page Designer.

When you request a registered JSP (number 1 below), the Request Controller calls the WebPage SDI (2). LabVantage sends the WebPage information to the JSP engine (3), which uses this information to locate and load the page (4).

Syntax

Recall that the value of the command parameter tells the Request Controller what you want to do. The following table describes command parameter values and the parameter-value pairs associated with each. The examples call the Request Controller in a URL and assume the default requestcontrollername value rc.

Possible Values of the command Parameter
Value Description
file Purpose

Requests a JSP file.

Associated Parameter-Value Pairs

Parameter Value
file Name of the JSP file you want to load.

Example

The parameter-value pairs

rc?command=file&file=mydir/testpage.jsp

request the file testpage.jsp, which is in the folder mydir.

page Purpose

Requests a JSP that is registered with LabVantage.

Associated Parameter-Value Pairs

Parameter Value
page Identifier of the WebPage SDI.

Example

The parameter-value pairs

rc?command=page&page=MyPage

request the JSP associated with the WebPage SDI MyPage.

login Purpose

Logs a LabVantage Full Named User into the Web Application.

Associated Parameter-Value Pairs

Parameter Value
username UserId of a LabVantage Full Named User.
password User's password.
database Database Id (name of the Connection Cache the Application Server utilizes to connect the current user to the LabVantage Database in use).

nexturl Request Controller parameter-value pairs specifying the page that loads following login. You must use URL Encoded Characters in place of the equality and ampersand characters (see the Example below).

Example

The parameter-value pairs

rc?command=login&username=JDrake&password=JD
&database=sapphire&nexturl=command%3Dpage%26page%3DSiteMap

log user JDrake into the Web Application, connect to the sapphire database, and load the registered SiteMap JSP after login.

logoff Purpose

Logs a LabVantage Full Named User off of the Web Application.

Associated Parameter-Value Pairs

Parameter Value
url JSP that loads following logoff.

Example

The parameter-value pairs

rc?command=logoff&url=logon.jsp

logs the user off of the Web Application and loads logon.jsp after logoff.

bulletin Purpose

Requests a JSP that is assosciated with a Bulletin SDI.

Associated Parameter-Value Pairs

Parameter Value
bulletin Identifier of the Bulletin SDI.

Example

The parameter-value pairs

rc?command=bulletin&bulletin=B0000001

request the JSP associated with Bulletin SDIId B0000001.

history Purpose

Requests a JSP from the "Recent Items" list.

Associated Parameter-Value Pairs

Parameter Value
history Integer specifying the order in which the page was loaded since login (0 is the first page loaded, 1 is the next). These values are in the webpagelogid column of the webpagelog table (see the file framework/recentlitemlist.jsp in the "process" Demo Web Application).

Example

The parameter-value pairs

rc?command=history&history=3

request the fourth JSP that has been loaded since login.

wizard Purpose

Calls a custom wizard you have made.

Associated Parameter-Value Pairs

Parameter Value
wizard URL of the wizard XML file, which contains the XML file defining the series of pages that make up the wizard.

Example

The parameter-value pairs

rc?command=wizard&wizard=mystuff/newpage.xml

calls the wizard defined by newpage.xml. For more details concerning custom wizards, see Creating Custom Wizards in the Advanced Operations section of the Web Page Designer.

action Purpose

Executes a LabVantage Action and loads a JSP after the Action executes. You can call Actions by ActionId or class.

Calling by ActionId

Associated Parameter-Value Pairs

Parameter Value
actionid Identifier of the Action to execute.
actionversionid Version number of the Action (defaults to 1).
nextpage JSP to load after the Action successfully executes.
property-value pairs for the Action Name and value of each Action property (see the example below).

Example

Assume the current page in the Web Application is security/userlist.jsp. Buttons on this page let you list, add, and delete Users. A button to delete a User could issue the following call to the Request Controller:

rc?command=action&amp;actionid=DeleteSDI&amp;sdcid=User&amp;keyid1=' + keyid1 + '&amp;nextpage=rc?command=file&amp;file=security/userlist.jsp

executes the DeleteSDI Action. The property sdc is set to User, the property keyid1 is set to the SDI key of the User to be deleted (retrieved by a getSelected() method). After deleting this User, the same JSP reloads. The result is a User has been deleted, and the page has been updated.

Calling by Class

Example

To call a class, use the following syntax, replacing com.labvantage.sapphire.actions.ClassName with your package and class:

rc?command=action&actionclass=com.labvantage.sapphire.actions.ClassName

Because there is no ActionId, the method processAction( sapphire.xml.PropertyList) should be overridden.

This is supported through ActionProcessor.processActionClass( String class, HashMap props) and ActionBlock.setActionClass(String name, String class, HashMap props). ActionIds and classes can occupy the same block.

viewattachment

 DEPRECATED 

This command has been deprecated in DM0502.

It has been replaced by the attachment command (below).

Purpose

Retrieves an attachment associated with an SDI.

Associated Parameter-Value Pairs

Parameter Value
attachmentnum In the SDIAttachment table, value of the attachmentnum column corresponding to the attachment.

Example

This call retrieves an attachment (BLOB or file reference) containing attachment number 1 associated with Sample S01:

rc?command=viewattachment&sdcid=Sample&keyid1=S01&keyid2=(null)&keyid3=(null)&attachmentnum=1

For more information concerning attachments, see Attachment Page Type in the topic Web Page Designer.

attachment See the Request Controller Command for the AttachmentManager Page Type.

Request Parameters

Definition

Request Parameters pass specific instructions to values (they are attributes of a value). For example, the following call requests the JSP associated with the WebPage SDI MyPage. This is the same example as page above; however, this time three Samples are passed into MyPage:

rc?command=page&page=MyPage&sdcid=Sample&keyid1=S01;S02;S03

where   page is the command parameter
    MyPage is the value of the command parameter
    sdcid andkeyid1 are Request Parameters.

Note that for multiple values of a Request Parameter, you must use a semicolon to separate each.

The following example shows how to declare a variable as the value of a Request Parameter in the code of a JSP:

String sdcid = pageinfo.getProperty("sdcid");

String keyid1 = pageinfo.getProperty("keyid1");

String keyid2 = pageinfo.getProperty("keyid2");

String keyid3 = pageinfo.getProperty("keyid3");

For information concerning the pageinfo instance, see:

Javadoc for the sapphire.* Packages

Page Tags in the LabVantage Custom Tag Reference

About JavaScript Characters

Request Parameters must not contain invalid JavaScript characters (such as !@#$%^&*()-~,'<.>/?). They generate client-side syntax errors.