Managing Cypress.Web Pages

This topic provides instructions for creating Cypress.Web pages.

Adding Cypress.Web Code to HTML Pages

The simplest way to incorporate Cypress.Web into HTML pages is by the use of frames. This approach requires three pages in a frameset:

  • A header frame that contains a corporate banner, links to other pages, and any code that may be required to perform a DocuVault Query.
  • A viewer frame (e.g., Client_launch_frame.htm) that calls a JavaScript function in a separate file to load the appropriate ActiveX control or controls based on the client operating system and browser type. If the ActiveX control is already present on the client, it will not be downloaded. If it is older than the version on the server, an updated ActiveX control will be downloaded by referencing the appropriate .cab or .jar file containing the ActiveX control. (The JavaScript file should also include code that checks the browser to ensure that minimum browser requirements are met.)
  • A launch page a user can access to launch a specific Cypress.Web function and references the header and viewer frames.

Function-specific versions of these files are provided and distributed across the CypressWeb directory on the Cypress Server. Launch pages are located in the function-specific subdirectories within the SampleHTML directory (such as Inbox or TextQuery). Each launch page is designed to launch a specific function. Header frames and header frame support images are also located in the function-specific subdirectories within the SampleHTML directory.

Viewer frames (and Client_launch_frame) are located in the Components directory. The is_header.js file in the Components directory includes functions that load and configure each ActiveX control. ActiveX controls are archived in .cab and .jar files within the Components directory.

Copying Code from the Sample Files

While you can copy and edit the sample files as you wish, you might prefer to copy the content from the Cypress.htm file in the CypressWeb directory, and the viewer_frame.htm and Client_launch_frame.htm files in the Components directory.

Viewer_frame and Client_launch_frame files: When creating the frames that will launch the Inbox Viewer, the DocuVault Query function, or the Cypress client user interface, it is important to include all code within the provided viewer_frame and Client_launch_frame files. The only code in these files that is specific to a particular site are the DocuVault name and IP address of the Cypress Server, which you must alter.

Header_frame files: In some cases, the header file is nothing more than a reference to an image. The query-related header files, however, contain code you might find useful when you are learning to format user input into a valid Cypress expression query. These are relatively simple scripts that you should be able to quickly regenerate.

Launch_page files: Launch page files only contain HTML only to reference the required frames and specify the height of the frame. It is unlikely that you will need to copy the contents of these files.

Creating Pages that Link to Cypress.Web Pages

You will probably need to copy control-downloading code from cypress.htm into pages that link to Web pages that contain Inbox and query functions or launch the Cypress main user interface. The purpose of this code is to ensure that the appropriate controls are available at the client when Cypress.Web pages are launched. This code performs these tasks:

Determines browser type and version
Dynamically add the Cypress.Web controls to the web page to workaround problems in some older versions of Internet Explorer.

Creating Pages that Download Controls Automatically

To download the Cypress.Web ActiveX controls automatically from a Web page

1. Copy this code into the <HEAD> of the page from which users will first access Cypress. The home page of a corporate intranet is a common location for this data.

<HTML>

<HEAD>

<TITLE>Cypress</TITLE>

<script src = "is_header.js"> </script>

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

<META HTTP-EQUIV="Expires" CONTENT="-1">

2. Copy the code that checks the browser version and creates the control inside the BODY element.

<HTML>

<HEAD>

<script src =”is_config.js”></script>

<script src = ”is_header.js”> </script>

<META HTTP-EQUIV=”Pragma” CONTENT=”no-cache”>

<META HTTP-EQUIV=”Expires” CONTENT=”-1”>

<TITLE>Cypress Web Query Interface</TITLE>

<META HTTP-EQUIV=”Pragma” CONTENT=”no-cache”>

</HEAD>

 

<BODY LEFTMARGIN=0 TOPMARGIN=0>

<script language=”JavaScript”>

 

document.write(“<div id=\”query_ctrl_location\”>”)

document.write(“<script language=\”JScript\”>load_cypress_query
(\”query_ctrl_location\”);<\/script>”);

document.write(“</div>”)

 

</Script>

</BODY>

</HTML>

Creating Pages with Cypress.Web Client Control

Cypress.Web Control Identifiers and CAB Sources

Each Cypress.Web ActiveX control has a unique ID, called a CLSID, which is used to create the control. In a web page, you specify the CLSID using the CLASSID attribute of the OBJECT tag. In addition, you must specify the installation source for the control via the CODEBASE attribute.

The CODEBASE attribute value must be followed by "#Version=-1,-1,-1,-1" to ensure that Internet Explorer automatically downloads new versions of the controls.

All control CABs require an additional CAB named dependencies.cab that contains files common to each control. This file must be posted in the same directory as the Cypress.Web CABs. The dependencies.cab has no CLSID and does not need to be referenced in your web page.

Control

CLSID

CAB

Query

D09509FF-1827-11D3-8C15-006008B059FF

query.cab

Inbox

9F73A958-3084-11D3-8C1B-006008B059FF

inbox.cab

UI

2F136723-5D01-11D1-83FE-00A0C98CE9D9

ui.cab

 

Imaging

14BBE102-5DB6-4605-A865-3AF983D0EC08

imaging.cab

Implementing the CypressClient Control

This topic describes how to create a Cypress.Web client page. Each client page contains these two parts:

An HTML page that will contain the CypressClient object
The Cypress.Web CypressClient object that will display the results

Most Cypress.Web page designers prefer to use one HTML frame as a container for company logos and other Web page look and feel considerations and a separate HTML frame as a container for the code that calls the CypressClient object.

This example demonstrates how you can code the client page as two HTML frames. When taking this approach, you will need to include an HTML page that binds the two frames together, as shown:

<HTML>
<HEAD>
<TITLE>Launch the Cypress Client</TITLE>
</HEAD>

<FRAMESET ROWS="130, *" FRAMEBORDER="1">

<!-- Client_header_frame.htm builds the top part the frame with a nice -->
<!-- jpeg and text -->

<FRAME SRC="Client_header_frame.htm">

<!-- Client_launch_frame.htm builds the bottom part with the Cypress -->
<!-- button component -->

<FRAME SRC="..\..\Components\Client_launch_frame.htm" SCROLLING="NO">

</FRAMESET>

</HTML>

The bottom frame page (..\..\Components\Client_launch_frame.htm) contains a reference to the JavaScript code that calls the CypressClient object. The Components\is_header.js file includes the JavaScript code that loads and configures the object. The Client_launch_frame.htm and is_header.js files are included with your Cypress.Web installation. You can customize this page with various property values for the CypressClient object. If you choose not to customize the properties, this page needs no modification.

The top frame page (Client_header_frame.htm) provides for the display of a graphic image. You may customize it with logos and text of your choosing, as shown:

<html>
<title>Inbox</title>
<BODY BACKGROUND="Client_header_frame.jpg" BGCOLOR="FFFFFF">
<h1 align="center"></h1>
</body>

</html>

Changing the CypressClient’s CmdLine Property

Long-running or complex queries to the DocuVault can sometimes take longer than expected to execute, resulting in a timeout error message. You can modify a Cypress.Web client page to increase the timeout period, thus allowing these complex operations to complete properly.

Use the CmdLine property to increase the DocuVault timeout period. The dv_timeout parameter allows you to specify the maximum length of inactivity (in seconds) before Cypress aborts the client request. The default DocuVault timeout is 30 seconds.

To specify the DocuVault timeout, add the CmdLine property and the dv_timeout parameter to the appropriate function in the Cypress\CypressWeb\Components\is_header.js file.

The property should be added in the form

<param name="CmdLine" value="-dv_timeout [DocuVault timeout in seconds]">.

For example, if your is_header file currently reads

div.innerHTML =

"<object id=\"CypressClient\" width=\"50\", height=\"50\" " +

" classid=\"clsid:2f136723-5d01-11d1-83fe-00a0c98ce9d9\" " +

" codebase=\"../../Components/ui.cab#Version=-1,-1,-1,-1\">" +

" <param name=\"TooltipText\" value=\"Click here to start the client\">" +

" </object>";

and you want to provide a timeout longer than 30 seconds, you would modify the file so that it looks like this:

div.innerHTML =

"<object id=\"CypressClient\" width=\"50\", height=\"50\" " +

" classid=\"clsid:2f136723-5d01-11d1-83fe-00a0c98ce9d9\" " +

" codebase=\"../../Components/ui.cab#Version=-1,-1,-1,-1\">" +

" <param name=\"TooltipText\" value=\"Click here to start the client\">" +

" <param name=\"CmdLine\" value=\"-dv_timeout 60\"> ");

" </object>";

The line that you need to add has been bolded for clarity.

The HTML code shown above will set the DocuVault timeout to 60 seconds.

Customizing the Tool Tip Text

The tool tip text of the CypressClient launch button can be customized to better accommodate your site’s needs.

The sample code provided may be entered in the is_header.js file found in the Cypress\CypressWeb\Components directory.

You can use this property only in the CypressClient control.

The property should be added in the form

<param name="ToolTipText" value="[new tool tip value]">.

For example, if your is_header file currently reads

div.innerHTML =

"<object id=\"CypressClient\" width=\"50\", height=\"50\" " +

" classid=\"clsid:2f136723-5d01-11d1-83fe-00a0c98ce9d9\" " +

" codebase=\"../../Components/ui.cab#Version=-1,-1,-1,-1\">" +

" </object>";

and you want to add special tool tip text, you would modify the file so that it looks like this:

div.innerHTML =

"<object id=\"CypressClient\" width=\"50\", height=\"50\" " +

" classid=\"clsid:2f136723-5d01-11d1-83fe-00a0c98ce9d9\" " +

" codebase=\"../../Components/ui.cab#Version=-1,-1,-1,-1\">" +

" <param name=\"TooltipText\" value=\"Click here to start the client\">" +

" <param name=\"CmdLine\" value=\"-dv_timeout 60\"> ");

" </object>";

Creating Pages with Cypress.Web Inbox Control

This topic describes how to create Cypress.Web pages that display Inbox contents. Each page contains these two parts:

An HTML page that will contain the CypressInbox object
The Cypress.Web CypressInbox object that will display the results

Most Cypress.Web page designers prefer to use one HTML frame as a container for company logos and other Web page “look and feel” considerations and a separate HTML frame as a container for the CypressInbox object.

This example demonstrates how you can code the client page as two HTML frames. When taking this approach, you will need to include an HTML page that binds the two frames together, as shown:

<HTML>
<title>World Wide Enterprise Inboxes</title>
<FRAMESET ROWS="110, *" FRAMEBORDER="1">
<!-- Inbox_header_frame.htm builds the top part the frame with a nice -->
<!-- jpeg and text -->
<FRAME SRC="Inbox_header_frame.htm">

<!-- Inbox_viewer_frame.htm builds the bottom part with the Cypress
<!-- viewer component -->
<FRAME SRC="..\..\Components\Inbox_viewer_frame.htm" SCROLLING="NO">

</FRAMESET>

</HTML>

The bottom frame page (..\..\Components\Inbox_launch_frame.htm) contains a reference to the JavaScript code that calls the CypressInbox object. The Components\is_header.js file includes the JavaScript code that loads and configures the object. We include both the Inbox_launch_frame.htm and the is_header.js files with your Cypress.Web installation. You can customize the JavaScript file with various property values for the CypressInbox object. If you choose not to customize the properties, this file needs no modification.

The top frame page (Inbox_header_frame.htm) provides for the display of a graphic image. You may customize it with logos and text of your choosing, as shown:

<html>
<title>Inbox</title>
<BODY BACKGROUND="Inbox_header_frame.jpg" BGCOLOR="FFFFFF">
<h1 align="center">
</h1>
</body>

</html>

Creating Pages with Cypress.Web Imaging Control

If you have a working knowledge of HTML and a Web scripting language such as VBScript or JavaScript, you should find it easy to create an Cypress imaging page. Each page contains these two parts:

An HTML page that will contain the CypressImaging object
The Cypress.Web CypressImaging object that will display the results

Most Cypress.Web page designers prefer to use one HTML frame as a container for company logos and other Web page “look and feel” considerations and a separate HTML frame as a container for the CypressImaging object.

This example demonstrates how you can code the client page as two HTML frames. When taking this approach, you will need to include an HTML page that binds the two frames together, as shown:

<HTML>
<title>Cypress Personal Imaging Module</title>
<FRAMESET ROWS="140, *" FRAMEBORDER=1 FRAMESPACING=0>
<FRAME SRC="Image_header_frame.htm">
<FRAME SCROLLING="NO" SRC="..\..\Components\Image_Viewer_frame.htm">
</FRAMESET>

</HTML>

The bottom frame page (..\..\Components\Image_Viewer_frame.htm) contains a reference to the JavaScript code that calls the CypressImaging object. The Components\is_header.js file includes the JavaScript code that loads and configures the object. Both the Image_Viewer_frame.htm and is_header.js files are included with your Cypress.Web installation. You can customize the JavaScript file with various property values for the CypressImaging object. If you choose not to customize the properties, this file needs no modification.

The top frame page (Image_header_frame.htm) provides for the display of a graphic image. You can customize it with logos and text of your choosing, as shown:

<html>
<title>Inbox</title>
<BODY BACKGROUND="Inbox_viewer_frame.jpg" BGCOLOR="FFFFFF">
<h1 align="center">
</h1>
</body>

</html>

Any Cypress query can be coded in the script language of choice. All index types—Full Text, System, and Data—may be used.

Indexing Pages and Batches with Cypress.Web Imaging Control

Indexing a Page

The CypressImaging control’s IndexPage method provides a method for adding index values or page variables to individual pages in imaging batches. When you specify a valid Cypress index or page variable name, the desired value, and an integer indicating whether to set a page variable, an index, or both, Cypress will index the current page in the selected batch.

You can use the IndexPage method with JavaScript or VBScript. Typically, an HTML form will submit the parameters.

You will call the method like this:

IndexPage “<index or page variable name>”, “<index value>”, <index type>

Replace the <index or page variable name> parameter with a valid Cypress index or page variable and the <index value> parameter with the desired string value. Replace the <index type> parameter with one of the settings described in this table:

Parameter

Meaning

1

set an index to the specified value

2

set a page variable to the specified value

3

set both an index and a page variable to the specified value

This code shows how you might use JavaScript to call this function:

function do_index()
{
var inx_type;
var inx_classify;
var inx_airbags;
var inx_svc_brake;
.
.
.
//Index document as a “Classified Document”
inx_classify = parent.frames[4].CypressImaging.IndexPage(“Classified Documents”, “true”, 1);
if (inxform.Type.value != “null”)
inx_type = parent.frames[4].CypressImaging.IndexPage(“ReportType”, inxform.Type.value, 1);

//Index Category if selected
if (inxform.Category.value != “null”)
inx_category = parent.frames[4].CypressImaging.IndexPage(“Group 1 Manufacturer”, inxform.Category.value, 1);

//Index Model if selected
if (inxform.Model.value != “null”)
inx_model = parent.frames[4].CypressImaging.IndexPage(“Model”, inxform.Model.value, 1);

//Index Make if selected
if (inxform.Make.value != “null”)
inx_make = parent.frames[4].CypressImaging.IndexPage(“Make”, inxform.Make.value, 1);
.
.

.

This table lists the IndexPage method’s possible return codes and their meanings:

Return Code

Meaning

0

Cypress indexed the page successfully

1

The command is not allowed under the current circumstances

2

CypressImaging received an invalid parameter

3

Cypress encountered an invalid return code

7

Cypress encountered a database transaction error

Indexing a Batch

The CypressImaging control’s IndexBatch method provides a method for adding index values or page variables to all pages in an imaging batch. When you specify a valid Cypress index or page variable name, the desired value, and an integer indicating whether to set a page variable, an index, or both, Cypress will index every page in the selected batch.

You can use the IndexBatch method with JavaScript or VBScript. Typically, an HTML form will submit the parameters.

You will call the method like this:

IndexBatch “<index or page variable name>”, “<index value>”, <index type>

Replace the <index or page variable name> parameter with a valid Cypress index or page variable and the <index value> parameter with the desired string value. Replace the <index type> parameter with one of the settings described in this table:

Parameter

Meaning

1

set an index to the specified value

2

set a page variable to the specified value

3

set both an index and a page variable to the specified value

This code shows how you might use JavaScript to call this function:

function do_index()

{
var inx_type;
var inx_classify;
var inx_airbags;
var inx_svc_brake;
.
.
//Index document as a “Classified Document”
inx_classify = parent.frames[4].CypressImaging.IndexBatch(“Classified Documents”, “true”, 1);
if (inxform.Type.value != “null”)
inx_type = parent.frames[4].CypressImaging.IndexBatch(“ReportType”, inxform.Type.value, 1);

//Index Category if selected
if (inxform.Category.value != “null”)
inx_category = parent.frames[4].CypressImaging.IndexBatch(“Group 1 Manufacturer”, inxform.Category.value, 1);

//Index Model if selected
if (inxform.Model.value != “null”)
inx_model = parent.frames[4].CypressImaging.IndexBatch(“Model”, inxform.Model.value, 1);

 

//Index Make if selected

if (inxform.Make.value != “null”)

inx_make = parent.frames[4].CypressImaging.IndexBatch(“Make”, inxform.Make.value, 1);

.

.

This table lists the IndexBatch method’s possible return codes and their meanings:

Return Code

Meaning

0

Cypress indexed the page successfully

1

The command is not allowed under the current circumstances

2

CypressImaging received an invalid parameter

3

Cypress encountered an invalid return code

7

Cypress encountered a database transaction error

Creating Pages with Cypress.Web Query Control

HTML pages designed to query a DocuVault can be created using a wide variety of approaches. If you are well-versed in creating Web applications, creating the necessary HTML pages will most likely be a simple task. These are some general guidelines that you should consider when creating your pages, followed by HTML code that illustrates how these guidelines may be implemented:

In general, your pages must be minimally designed to perform these functions:

Identify the specific Cypress index(es) to query
Create a form in your HTML page
Create form variables to identify indexes and capture end-user entries and settings
Generate and submit a valid Cypress expression query.

The queries you create may focus on one or more Cypress indexes (such as Document Creator, Document Creation Time, Document Title, or Customer_ID). A key benefit of expression queries is that you may search across any number or type of indexes using a single query. The indexes you choose to search will be based on the end-user needs and application being developed.

Using the form name and on_submit HTML tags, you can create the name of a form and identify the string (a valid expression query) to be submitted when the Submit button is selected.

In your HTML, you will need to create variables that contain the name of the index or indexes to be searched (such as cust_id, date, or color), and variables to capture the various entries and settings made by your users (such as 00-98751, 2000-12-31, or topaz). The values associated with these variables can then be extracted when creating your query. Every Expression Query begins with the name of the index to be queried. A brief example of the HTML is listed:

<INPUT TYPE="Hidden" NAME="key" value="[Document Creator] =">

You must enclose the Document Creator index in braces.

You can use JavaScript or VBScript to create functions that reference the Cypress ActiveX control and pass a valid expression query that is dynamically constructed based on the values in your form. While simple, your JavaScript or VBScript functions must preserve Cypress’s syntax.

Creating a Cypress.Web Query Page

Cypress.Web pages that query the DocuVault are easy to create. It is assumed that the Cypress.Web page coder will have a full understanding of the Cypress index structures implanted in your environment and be familiar with Knowledge Builder in addition to HTML and a Web scripting language such as VBScript or JavaScript.

Each Cypress.Web query page has these three parts:

An HTML Form that will submit the query
A script that will form the Cypress query and execute the Cypress.Web DoQuery method
The Cypress.Web CypressQuery object that will display the results

These three parts can be coded all in one frame. However, most Cypress.Web page designers prefer one HTML frame as a container for the HTML form and script and a separate HTML frame to contain the CypressQuery object.

What follows is an example of coding the query page as two HTML frames. When taking this approach, it is necessary to have an HTML page that binds the two frames together. This is a sample of this type of page:

<HTML>
<title>Cypress Document Full Text Query</title>
<FRAMESET ROWS="140, *" FRAMEBORDER=1 FRAMESPACING=0>
<FRAME SRC="Query_header_frame.htm">
<FRAME SCROLLING="NO" SRC="..\..\Components\Query_Viewer_frame.htm">
</FRAMESET>

</HTML>

The bottom frame page (..\..\Components\Query_Viewer_frame.htm) contains a reference to the JavaScript code that calls the CypressQuery object. The Components\is_header.js file includes the JavaScript code that loads and configures the object. We include both the Query_Viewer_frame.htm and the is_header.js files with your Cypress.Web installation. You can customize the JavaScript file with various property values for the CypressQuery object. If you choose not to customize the properties, this file needs no modification.

The top frame page (Query_header_frame.htm) contains the form to submit the query and the script that builds the Cypress query and executes the Cypress.Web DoQuery method. The sample code provided implements an HTML form that contains a text entry box, two radio buttons, and a submit button. When the submit button is clicked, JavaScript is run to create an Cypress query that will search the DocuVault using the Full Text index for the word or words entered in the form’s text box. Whether the search is for any word entered in the text box or all words entered in the text box is based upon which radio button has been selected.

<html>
<title>Full Text Query</title>
<BODY BACKGROUND="Query_header_frame.jpg" BGCOLOR="FFFFFF">
<br>
<div align="center">
<font face="Arial" color="white">
<form name="queryform" onsubmit="return queryform_onsubmit()" language="JavaScript">
<br><br><br><br>Search For:
<input type="text" name="full_text">
<input type=radio name="radio" checked>match any word
<input type=radio name="radio">match all words
<input type="button" value="Search" onClick="submit_query()" language="JavaScript">
<input type="reset" value="Clear Search">
</form></font></div>

<script language="JavaScript">

function submit_query()
{
var query_crit;

if (document.queryform.radio[0].checked)
{
query_crit="[word]=any_word(\""+document.queryform.full_text.value+"\")";
alert (query_crit)
parent.frames[1].CypressQuery.DoQuery(query_crit);
}
else
{
query_crit="[word]=all_word(\""+document.queryform.full_text.value+"\")";
parent.frames[1].CypressQuery.DoQuery(query_crit);
}
}

function queryform_onsubmit()
{
submit_query();
return(false);
}

</script></body></html>

Any Cypress query can be coded in the script language of choice. All index types—Full Text, System, and Data—may be used.

Creating a Cypress Query and Index Page

Creating Cypress.Web pages that query the DocuVault and allow the user to apply additional index values to selected documents and/or pages is not difficult. It is assumed that the Cypress.Web page coder will have a full understanding of the Cypress index structures and be familiar with Knowledge Builder in addition to HTML and a Web scripting language such as VBScript or JavaScript.

Cypress.Web query and index pages have these four parts:

An HTML Form that will submit the query
A script that will form the Cypress query and execute the Cypress.Web DoQuery method
The Cypress.Web CypressQuery object that will display the results
A script that will add additional the Cypress index values by executing the Cypress.Web DoDataIndex method

These four parts can be coded all in one frame, or spread across separate pages if desired; however most Cypress.Web page designers prefer one HTML frame as a container for the HTML form and script (parts 1 and 2, and 4), and a separate HTML frame to contain the CypressQuery object (part 3).

What follows is an example of coding the query page as two HTML frames. When taking this approach, it is necessary to have an HTML page that binds the two frames together. This is a sample of this type of page:

<html>
<head>
<title>Document Classification</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="*" cols="*,720" framespacing="0" frameborder="NO" border="0">
<frame src="Classify_left_frame.htm" name="mainFrame">
<frame src="../../Components/Query_Viewer_frame.htm" name="rightFrame" scrolling="NO" noresize>
</frameset>

<noframes><body>
</body></noframes>

</html>

The bottom frame page (..\..\Components\Query_Viewer_frame.htm) contains a reference to the JavaScript code that calls the CypressQuery object. The Components\is_header.js file includes the JavaScript code that loads and configures the object. We include both the Query_Viewer_frame.htm and the is_header.js files with your Cypress.Web installation. You can customize the JavaScript file with various property values for the CypressQuery object. If you choose not to customize the properties, this file needs no modification.

The left frame page (Classify_left_frame.htm) contains a form to submit the query, the script that builds the Cypress query and executes the Cypress.Web DoQuery method, a form to submit the indexing, and the script that adds additional indexing by executing the DoDataIndex method.

The code sample provided implements two HTML forms. The first form contains two radio buttons, and a submit button. When the submit button is clicked, JavaScript is run to create an Cypress Query that will search the DocuVault using a data index named Classified, and optionally the system index Document Creation Time.

Once the documents or pages have been retrieved, the end user may select individual documents or pages for classification using the check boxes provided by the CypressQuery object.

The second form in the sample code provided contains several drop-down lists, a text field, and a submit button. When the submit button is clicked, JavaScript is run to index the selected documents or pages using the DoDataIndex method.

<html>
<script language="JavaScript">

// Fill first drop down list when desired

function refill()
{
FillSortDropDownWithFields(inxform.dropdown1, xmlDoc.namedRecordset("", ""));
}

// Refill second drop down list when desired

function refill2(x)
{
dRecordSet=xmlDoc.namedRecordset("");
dRecordSet.MoveFirst();

for (i=0; i<x; i++)
{
dRecordSet.MoveNext();
}

FillSortDropDownWithFields(inxform.dropdown2, xmlDoc.namedRecordset("", "document"));
}

// Refill third drop down list when desired

function refill3(x)
{
dRecordSet=xmlDoc.namedRecordset("");
dRecordSet.MoveFirst();

for (i=0; i<x; i++)
{
dRecordSet.MoveNext();
}

FillSortDropDownWithFields(inxform.dropdown3, xmlDoc.namedRecordset("", "document.section"));
}

// Fill dropdown with field names from the ADO RecordSet

function FillSortDropDownWithFields(oDropDown, oRecordSet)
{
// Clear out the current drop down values
for (i=0; i<oDropDown.options.length;i+1)
{
oDropDown.options[i]=null;
}

//Get to the first element of the dataset
oRecordSet.MoveFirst();

// add each of the elements in the dataset to the drop-down

for (i = 0; i < oRecordSet.RecordCount; i++)
{
oField = oRecordSet.fields;
oDropDown.options[i]=new Option(oField(0).value,oField(1).value)
oRecordSet.MoveNext();
}
}

function submit_query()
{
var query_string="[Classified]="+"\""+"false"+"\""+" and [Classified]!="+"\""+"true"+"\""

if(queryform.radiobutton(1).checked)
{
query_string +=" and [Document Creation Time]>= day(-0)"
}

parent.document.frames(1).document.CypressQuery.DoQuery(query_string);
}

function queryform_onsubmit()
{
submit_query();
return(false);
}

function do_index()
{
var Current;

//Index document as a "Classified Document"
inx_classify=parent.frames[1].CypressQuery.DoDataIndex("Classified", "true",0);

//Index Document Type
Current = document.inxform.dropdown1.selectedIndex;
inx_type=parent.frames[1].CypressQuery.DoDataIndex("Document Type", inxform.dropdown1.options(Current).text, 0);

alert("Indexing has been scheduled");
}

</script>
<head>
<title>P&amp;P Left Frame</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onLoad="refill(); refill2(0); refill3(0)">
<!-- Include the XML file with the report list for the drop down -->
<XML ID=xmlDoc src="Template.xml"></XML>

<form name="queryform" id="queryform" onsubmit="return queryform_onsubmit()" language="JavaScript">
<p>
<input name="radiobutton" type="radio" value="radiobutton" checked>
<font size="2" face="Arial, Helvetica, sans-serif">All Unclassified</font></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">
<input type="radio" name="radiobutton" value="radiobutton">
Today's Unclassified</font></p>
<p align="center"><font size="2" face="Arial, Helvetica, sans-serif">
<input name="querysubmit" type="submit" id="querysubmit" value="Find Unclassified P&amp;P">
<br>
</font></p>
</form>

<p>&nbsp;</p>

<form name="inxform" id="inxform" onsubmit="return do_index()" language="JavaScript">
<p><font size="2" face="Arial, Helvetica, sans-serif">Doc Type:
<select name="dropdown1" id="dropdown1" onchange="refill2(this.options.selectedIndex)">
</select>
</font></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">Doc Name:
<select name="dropdown2" id="dropdown2" onchange="refill3(this.options.selectedIndex)">
</select>
</font></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">Section:
<select name="dropdown3" id="dropdown3">
</select>
</font></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">Keyword:</font>
<input name="keyword" type="text" id="keywords">
</p>
<div align="center"><br>
<input name="inxubmit" type="submit" id="inxubmit" value="Classify &amp; Release">
</div>
</form>
</body>

</html>

Any Cypress query can be coded in the script language of choice. All index types (Full Text, System, and Data) may be used.

Customizing Cypress.Web DocuVault Connections

The DocuVault property contains the names of the DocuVaults to which Cypress should connect and the IP address of the servers on which they are located.

You can enter the sample code provided in the is_header.js found within the Components directory.

To specify the DocuVault to which you should connect, add the value for the DocuVault property to the is_header.js file. The line that currently appears in these files is shown; the portion that should be modified appears in boldface.

<param name=\"DocuVault\" value=\"ABC_DV@127.0.0.1\">

The previous example has an IPv4 format for the IP address. If your system is running in a Windows Server 2008 environment, you can use either the IPv4 (i.e., 127.0.0.1) format or the IPv6 format for IP addresses, (i.e., ::1). If your system is running an environment other than Windows Server 2008, you must use the IPv4 format. Cypress supports either format.

To specify multiple DocuVaults, separate the DocuVault names and IP addresses with commas:

<param name=\"DocuVault\" value=\"ABC_DV@127.0.0.1,ABC_Test@127.0.0.2\">

This property is required by the Cypress.Web CypressInbox, CypressQuery, and CypressImaging controls. Note that while the Cypress.Web DocuVault property is case-insensitive, the actual DocuVault name is case-sensitive.

Using XML with Cypress.Web Pages

To ease document searches, Web pages often offer drop-down lists of report titles and associated indexes. To simplify Web page design and administration, these lists can be created and maintained in XML files that are used by the Web page. This allows administration to occur by updating the XML files with new options and alleviates the necessity to modify and re-publish HTML Web pages.

To enable access to an XML file from a Web page, you must format the XML file into organized record sets (see www.msdn.com for articles on DSO recordsets). This XML file extract shows the XML tags and record sets used for this example:

<reports>
<report>
<name>All Reports</name>
<doctype>All</doctype>
</report>
<report>
<name>Accounts Payable</name>
<doctype>AccountsPayabl</doctype>
</report>
<report>
<name>Accounts Receivable</name>
<doctype>AccountsReceivab</doctype>
</report>

</reports>

This figure shows an Cypress.Web page that uses the sample XML shown above to offer a drop-down list of the report names:

The full HTML code for this example above is given at the end of this topic. What follows is a description of the various portions of the full HTML code that is critical to the drop-down list fill.

The portion of the HTML code that uses the XML file to drive the drop-down list begins with the HTML tag <XML…>. This tag gives the Web page an identifier name and the location (directory path and file name) of the XML record set. Typically this tag is identified after the <body…> tag as shown:

<body onLoad="refill()" bgcolor="#FFFFCC" text="#000000" color="black">

<XML ID=xmlDoc src="report_list.xml"></XML>

The ID parameter gives the identifier name that will used to reference the XML file with javascript or vbscript. The src parameter defines the path and XML file name.

Once the XML identifier and source have been defined, JavaScript or VBScript functions can be called to access the file.

In the example, the JavaScript to fill the drop-down list is called by the onLoad="refill()” attribute of the <body> tag (see above). This calls a JavaScript function named refill that fills the drop-down list defined by the <SELECT…> tag.

<b><SELECT NAME=DropDown1 size="1"></SELECT></b>

The refill JavaScript function shown calls a second JavaScript function and passes two parameters, the name of the drop-down list and the XML file recordset to be used (the default).

function refill()
{
FillSortDropDownWithFields(form1.DropDown1, xmlDoc.namedRecordset("", ""));

}

The FillSortDropDownWithFields JavaScript function loops through the records within the XML file and builds the <option …> tags for the drop-down list.

function FillSortDropDownWithFields(oDropDown, oRecordSet)
{
// Clear out the current drop down values
for (i=0; i<oDropDown.options.length;i+1)
{
oDropDown.options[i]=null;
}

//Get to the first element of the dataset
oRecordSet.MoveFirst();

// add each of the elements in the dataset to the drop-down
for (i = 0; i < oRecordSet.RecordCount; i++)
{
oField = oRecordSet.fields;
oDropDown.options[i]=new Option(oField(0).value,oField(1).value)
oRecordSet.MoveNext();
}

}

The HTML and Javascript shown drive the expression query that is passed to the Cypress.Web controls.

<html>
<head>
<!--

This is a simple example of using an XML file to control drop down list values. There is only one drop down list on this page.
It contains a list of report types pulled from the XML file.
At the <report> level is the <name> of the report to be displayed in the first drop down list and the <doctype> which is the index name in Cypress.

-->
<title>Cypress XML driven Single Index Query Page</title>
<script language="JavaScript">

function refill()
{
FillSortDropDownWithFields(form1.DropDown1, xmlDoc.namedRecordset("", ""));
}

// Fill dropdown with field names from the ADO RecordSet
function FillSortDropDownWithFields(oDropDown, oRecordSet)
{
// Clear out the current drop down values
for (i=0; i<oDropDown.options.length;i+1)
{
oDropDown.options[i]=null;
}

//Get to the first element of the dataset
oRecordSet.MoveFirst();

// add each of the elements in the dataset to the drop-down
for (i = 0; i < oRecordSet.RecordCount; i++)
{
oField = oRecordSet.fields;
oDropDown.options[i]=new Option(oField(0).value,oField(1).value)
oRecordSet.MoveNext();
}
}

// Build the Cypress Expression Query
function submit_query()
{
var query_string="";
if(document.form1.DropDown1.value != "All")
{
query_string +="[DocumentType]="+"\""+document.form1.DropDown1.value+"\""

// To display the Cypress expression query being passed to the Active-X, uncomment the following lin
// alert(query_string);
parent.document.frames(1).document.CypressQuery.DoQuery(query_string);
}
else /* No specification of Document Type */
{
query_string +="[DocumentType]>"+"\""+"\""

// To display the Cypress expression query being passed to the Active-X, uncomment the following line
//alert(query_string);

parent.document.frames(1).document.CypressQuery.DoQuery(query_string);
}
}

function queryform_onsubmit()
{
submit_query();
return(false);
}

</script>
</head>

<body onLoad="refill()" bgcolor="#FFFFCC" text="#000000" color="black">

<!-- Include the XML file with the report list for the drop down -->

<XML ID=xmlDoc src="report_list.xml"></XML>

<!-- Begin search form portion of the page -->

<form name="form1" ONSUBMIT="return queryform_onsubmit()" LANGUAGE="JScript">
<font face="Arial Narrow" color="#000000" size="4">
<table width="98%" border="0">
<tr>
<td>
<b>Search for:</b>
<!-- This is the main drop down list. -->
<b><SELECT NAME=DropDown1 size="1"></SELECT></b>
<!-- This is the Submit button. -->
<b><input type="submit" name="test" value="Go"></b>
</td>
</tr>
</table>
</font>
</form>
</body>

</html>

This information is offered to users as an example only. Cypress does not support XML configuration as part of the core product. If you do not have the internal Web design resources necessary to facilitate a desired XML implementation, please contact your Cypress Account Manager to hear about our Web design services.