To preserve
the functionality of the original
SAS/IntrNet example, copy the HTML
file to a new location before modifying it.
Note: This example shows you how
to use the input component from the Application Dispatcher program
as a custom input form for the stored process. You can use the _PROGRAM
variable along with _ACTION=FORM in the URL to display the custom
input form for the stored process. However, copying the HTML file
is optional. You can run stored processes without a custom input form.
-
If you want this Web
page to be used as the default input form in the SAS Stored Process
Web Application, then copy the webtab1.html file to a physical location
under the JBoss folder. The exploded directory might be something
like
C:\Program Files\JBoss\server\SASServer1\deploy_sas\sas.storedprocess9.3.ear\sas.storedprocess.war\input\Converted_Samples
. (The physical location corresponds to the metadata location. This
location is correct only if the new stored process is registered in
the
/Converted Samples
folder in the metadata repository. Otherwise,
the path is different.)
Note: The SAS Stored Process Web
Application is delivered in an EAR file, and can be run directly from
the EAR file or from the exploded directory. For more information
about how to explode the EAR file, see the
SAS Intelligence Platform: Web Application Administration Guide.
Note: You can also copy the HTML
file to a new directory under the IIS Web Server, or to a new directory
under the JBoss folder with the SAS Stored Process Web Application.
However, if you decide to do this, you should be aware that appending
_ACTION=FORM to the URL to find the custom input form does not work.
-
Modify the HTML page
to call the stored process instead of the
SAS/IntrNet program.
-
Open webtab1.html in
an HTML editor.
-
Change the value of
the ACTION attribute in the FORM tag to
http://myserver:8080/SASStoredProcess/do
.
-
Remove the hidden field
for _SERVICE.
-
Change the value of
the hidden field for _PROGRAM to the metadata location, and name of
the stored process:
/Converted Samples/Regional Shoe
Sales
.
-
You can leave the _DEBUG
check box with a value of
131
. This
is equivalent to the value
LOG,TIME,FIELDS
.
-
You can change the text
that appears on the Web page. If you want to use images, then you
need to move them to a location in the current directory or change
the tag to point back to the old directory.
-
The body of the file
now contains the following HTML:
<H1>Regional Shoe Sales</H1>
<p>Select a region in order to display shoe sales data for that
region by subsidiary and style. This sample program uses ODS and
the TABULATE procedure.</p>
<HR>
<FORM ACTION="http://myserver:8080/SASStoredProcess/do">
<INPUT TYPE="HIDDEN"
NAME="_PROGRAM" VALUE="/Converted Samples/Regional Shoe Sales">
<b>Select a region:</b> <SELECT NAME="regionname">
<OPTION VALUE="Africa">Africa
<OPTION VALUE="Asia">Asia
<OPTION VALUE="Central America/Caribbean">Central America/Caribbean
<OPTION VALUE="Eastern Europe">Eastern Europe
<OPTION VALUE="Middle East">Middle East
<OPTION VALUE="Pacific">Pacific
<OPTION VALUE="South America">South America
<OPTION VALUE="United States">United States
<OPTION VALUE="Western Europe">Western Europe
</SELECT>
<HR>
<INPUT TYPE="SUBMIT" VALUE="Execute">
<INPUT TYPE="CHECKBOX" NAME="_DEBUG" VALUE="131">Show SAS Log
</FORM>
-
Save the file as Regional
Shoe Sales.jsp, and close it.
Note: If this JSP file is located
somewhere other than in the SAS Stored Process Web Application directory,
then you need to specify the complete URL to the stored process servlet,
as follows, in the ACTION attribute in the FORM tag:
http://myserver:8080/SASStoredProcess/do
. Otherwise, this URL can be a relative
link, as follows:
/SASStoredProcess/do
. If you do place the JSP file under the same directory as the SAS
Stored Process Web Application, then you need to be careful to preserve
the application if you later upgrade or redeploy the SAS Stored Process
Web Application.
You should also convert
any HTML pages that link to your stored process to use the SASStoredProcess
URL syntax. For example, you might use the following URL to link to
the Hello World sample program using the Application Broker:
http://myserver/cgi-bin/broker?
_service=default&_program=sample.webhello.sas
The URL specifies your
Application Server, an absolute path to the Application Broker, and
the query string (followed by the question mark character). The query
string contains the name/value pair data that is input to the application.
Each name is separated from the following value by an equal sign (=).
Multiple name/value pairs are separated by an ampersand (&). The
Web page that executes an Application Dispatcher program must pass
the _SERVICE and _PROGRAM variables. In this example, the _SERVICE=DEFAULT
pair specifies the service that handles this request, and the _PROGRAM=SAMPLE.WEBHELLO.SAS
pair specifies the library, name, and type of request program to be
executed.
For the SAS Stored Process
Web Application, the URL in the preceding example would need to be
changed. You might use the following URL if you want to run the program
from the SAS Stored Process Web Application:
http://myserver:8080/SASStoredProcess/do?
_program=/Samples/Stored+Processes/Sample:+Hello+World
The URL specifies your
stored process server, an absolute path to the SAS Stored Process
Web Application (instead of the Application Broker), and the query
string. Notice that
/cgi-bin/broker?
has been replaced with the stored process Web application equivalent:
/SASStoredProcess/do?
. The _SERVICE name/value pair
is not used with stored processes, and _PROGRAM is the reserved input
parameter that specifies the metadata location and the name of the
stored process to be executed.
There are special rules
for the formatting of name/value pairs in a URL. Special characters
(most punctuation characters, including spaces) in a value must be
URL-encoded. Spaces can be encoded
as a plus sign (+) or %20. Other characters are encoded using the
%
nn convention, where
nn is the hexadecimal representation of the character
in the ASCII character set. In the previous example, the value
/Samples/Stored+Processes/Sample:+Hello+World
actually
identifies the stored process named
Sample: Hello World
. The space in the name is encoded as a plus sign (+). If your parameter
values contain special characters, then they should be
URL-encoded.