Vignette IDM Browser Client 20.1 for Unix
Transcription
Vignette IDM Browser Client 20.1 for Unix
IDM Browser Client for Unix API Reference Version 20.1 rev 1 Notices PUBLISHER This document is published and distributed by Vignette Corporation. It was designed and produced using FrameMaker publishing software. VERSION IDM Browser Client for Unix API Reference, version 20.1 rev 1 (Publication Date: 21 March 2006) DISCLAIMER Vignette does not warrant, guarantee, or make representations concerning the contents of this document. All information is provided "AS-IS," without express or implied warranties of any kind including, without limitation, the warranties of merchantability, fitness for a particular purpose, quality and title. Any information provided by Vignette customers or partners was obtained after the implementation of Vignette software and may have changed as of the Publication Date. You may not achieve the same results or benefits from using Vignette as described in this document. Nothing in this document is considered to be part of any product documentation or specification for any purpose. Vignette reserves the right to change the contents 2 of this document and the features or functionalities of its products and services at any time without obligation to notify anyone of such changes. COPYRIGHT AND TRADEMARKS Copyright © 2006 Vignette Corporation. All rights reserved. Vignette, the V Logo, e:fficiency and e:fficiency experts are trademarks or registered trademarks of Vignette Corporation in the United States and other countries. All other company, product, and service names and brands are the trademarks or registered trademarks of their respective owners. SEND US YOUR COMMENTS If you have comments or suggestions about this manual, please send them to this address: publications@vignette.com A member of the Publications team will acknowledge your mail as soon as possible. You can also reach us at the following address: Vignette Corporation Publications Department 1301 South MoPac Expressway, Suite 100 Austin, TX 78746 USA © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Table of Contents Chapter 1. Chapter 2. Introduction 7 Scope Additional information 7 7 HTML, JSP and JavaScript 9 Overview File lists The public interface To retrieve a document directly To retrieve a Title List directly To import a file directly External validation Creating an external validation routine Chapter 3. Public Java APIs Introduction Package summary com.towertechnology.jsp.generic com.towertechnology.jsp.security com.towertechnology.jsp.tower com.towertechnology.jsp.tower.search com.towertechnology.jsp.util com.towertechnology.jsp.generic Description 9 9 22 22 24 25 26 26 29 29 30 30 30 30 30 30 31 31 TdpJbException 32 com.towertechnology.jsp.security Description 34 34 Logon 35 com.towertechnology.jsp.tower Description 41 41 Annotation 43 IBCU annotation information interchange format 44 AppList 46 AppListCollection 57 v20.1 rev 1 IDM Browser Client for Unix API Reference 3 Table of Contents AppListEntry 58 Disk 60 Diskset 61 Doc 70 Doc.UploadElem 84 DocOperations 86 DocumentHistory 103 DocumentManagement 106 DocumentManagementAction 113 DocumentStatus 115 FileData 117 HardCopy 119 PropertiesHelper 124 ResultInfo 125 ResultRecord 127 ServerExec 130 Template 132 TemplateField 133 TitleList 137 TitleList.TableRow 148 TitleList.TableTemplateEntry 150 TitleList.TitleListData 152 TowerHelper 153 TowerLogger 156 com.towertechnology.jsp.tower.search Description 157 157 StringSearch 158 com.towertechnology.jsp.util 164 Logger 165 ResourceLocator 167 Chapter 4. 4 CORBA objects 169 Overview ttuwsupload_tao ttuwsdoc_tao ttuwsdocmgt_tao ttuwshardcopy_tao ttuwslogger_tao ttuwslogon_tao ttuwsqbe_tao ttuwssys_tao ttuwstitlelist_tao ttuwsapplist_tao ttuwsannot_tao 169 169 169 169 170 170 170 170 170 170 170 170 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Table of Contents Chapter 5. Error handling Overview of error processing in IBCU Error number format JSP level JavaBean layer v20.1 rev 1 IDM Browser Client for Unix API Reference 171 171 172 174 175 5 Table of Contents 6 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Chapter Introduction 1 Scope This document describes all the configurable parts of the IDM Browser Client for Unix (IBCU). It should be used to assist in the building of custom web sites incorporating IBCU. Chapter 2, HTML, JSP and JavaScript, lists and describes all of the standard Java Server Pages and HTML pages provided with IBCU; it also describes the use of JSPs as a public interface. Chapter 3, Public Java APIs, lists all the public interface Java API components used by IBCU to communicate with the CORBA objects on IDM Server. The components are arranged according to the packages in which they are located. Chapter 4, CORBA objects, describes all the standard CORBA objects used by IBCU. Chapter 5, Error handling, describes error processing and gives examples of errorhandling code. Additional information If your IDM Server is based on the IDM database, note that it supports only a subset of SQL functions. This subset is defined in the IDM Database Technical Reference. v20.1 rev 1 IDM Browser Client for Unix API Reference 7 Chapter 8 1 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Chapter HTML, JSP and JavaScript 2 Overview This chapter lists all of the *.html, *.jsp, and *.js files used by IBCU. It also provides a description of the “public interface”—how to invoke certain jsp files from the browser’s address bar. File lists The following is a guide and outline only; it is not intended to be a fully detailed technical description. Files used by the off-the-shelf IBCU during runtime are listed in Table 1. Additional files, provided as examples, are listed in Table 2. Each table is in alphabetical order. The return code from IBCU JavaBeans is available for processing at the JSP level (via the exception catching mechanism). To use this facility, any JSP that executes IBCU JavaBeans must include: import='com.towertechnology.jsp.generic.TdpJbException' or: import='com.towertechnology.jsp.generic.*' For example: <%@ page language="java" import='com.towertechnology.jsp.generic.TdpJbException' session="true" errorPage="/jsp/ttuwserror.jsp" %> NOTE: All pages listed in the following table include /jsp/include/TdpJspCommon.jsp, and almost all include the standard error page errorPage="/jsp/ttuwserror.jsp” v20.1 rev 1 IDM Browser Client for Unix API Reference 9 Chapter 2 Table 1: Details of HTML, JSP, and JS files Name Description Dependencies CancelCheckout.jsp Cancel the checkout of a document using the cancelCheckOut method. Refresh the title list frame or document history list frame at the end of the process. TdpJspTitlelist.jsp HistoryList.jsp com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.DocumentManagement CheckOutDocument.jsp Display the document check out page. Submit the request to CheckOutServlet servlet for processing. Refresh the title list frame or document history list frame when the window is closed. TdpJspTitlelist.jsp HistoryList.jsp com.towertechnology.jsp. generic.TdpJbError com.towertechnology.servlet. docmgt.CheckOutServlet DisplayHistory.jsp Display the document history page which includes the document history list frame and the document content viewer frame. Refresh the title list frame when it is closed. HistoryList.jsp TdpJspViewerApplet.jsp TdpJspDoc.jsp PublishDocument.jsp Publish a document using the publishDocument method. Refresh the title list frame or document history list frame at the end of the process. Dependencies TdpJspTitlelist.jsp HistoryList.jsp com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.DocumentManagement CheckInDocument.jsp Display the document check in page. Submit the request to CheckInServlet servlet for processing. Refresh the title list frame or document history list frame when the window is closed. TdpJspTitlelist.jsp HistoryList.jsp com.towertechnology.servlet. docmgt.CheckInServlet com.towertechnology.jsp. tower.DocumentStatus CreateDocument.jsp Generate a DocImportElem object by parsing the request. Check "title" case setting (UPPER/LOWER/MIXED) and convert the field name and value pairs accordingly to a String object before calling createDocument method to create a new document in the managed application. TdpJspImport.jsp com.towertechnology.jsp. tower.Doc com.towertechnology.jsp. tower.SysSettings com.towertechnology.jsp. tower.doc.DocImportElem com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.DocumentManagement com.towertechnology.jsp. tower.DocumentStatus 10 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies HistoryList.jsp Display a list of document versions found in the history table for a document. DisplayHistory.jsp CancelCheckout.jsp CheckOutDocument.jsp PublishDocument.jsp CheckInDocument.jsp TdpJspViewerApplet.jsp ttuwsdocbot.jsp com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.DocumentManagement com.towertechnology.jsp. tower.TitleList documenthistory.js Maintain all dynamic processing for document history page(such as load document, check out, publish, cancel check out and check in). HistoryList.jsp TdpJsAdvSearch.js Maintains all dynamic processing for Advanced Search (such as some field validation, clear option, IDM data type check). TdpJspAdvSearch.jsp TdpJspTitlelist.jsp ttuwsqbe_frame.jsp ttuwstitlelistonly_frame.jsp TdpJsChangePwd.js Creates the dialog and invokes TdpJspChangePwd.jsp. TdpJspChangePwd.jsp TdpJspAdvSearch.jsp Displays and performs Advanced Search. com.towertechnology.jsp. tower.Diskset com.towertechnology.jsp. tower.AdvSearchSettings com.towertechnology.jsp. tower.AppList TdpJsAdvSearch.js TdpJspChangePwd.jsp Displays the change password dialog and reports the result of the change password request back to the user. TdpJspExecChangePwd.jsp TdpJsChangePwd.js TdpJspCommon.jsp v20.1 rev 1 TdpJspSessionValidationRelogin. jsp The “common” script for all JSP pages. Currently, the common script consists of Web Server communication and frame - session management. NOTE: TdpJspCommon.jsp should be included in all other JSP pages. IDM Browser Client for Unix API Reference 11 Chapter 2 Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies TdpJspDoc.jsp Separates the standard document frame (the GetDoc frame) into two subframes. The GetDocTop frame loads ttuwsdoctop.jsp and ttuwsdocbot.jsp. TdpJspDoc.jsp is the Public API; for example, executing: TdpJspDoc.jsp?ifn=222/2-264 &pages=1&appname=demo results in the document being displayed in a standard document frame format (not the viewer applet). For more details, see The public interface on page 22. ttuwsdoctop.jsp ttuwsdocbot.jsp ttuwstimeout.jsp TdpJspGuestLogon.jsp ttuwslogin.jsp TdpJspViewerApplet.jsp TdpJspDocDetails.jsp Maintains document related information, such as: number of pages, zoom factor (if rendered image), perform zoom on the server (or locally), file size, document height, etc. ttuwsdocbot.jsp TdpJspDocDetailsError.jsp Error page for TdpJspDocDetails.jsp TdpJspDoImport.jsp Performs document import using uploadDoc Java public method. Checks “title” case setting (UPPER/ LOWER/MIXED) and converts the input data accordingly before calling insertIndex Java public method. com.towertechnology.jsp. tower.doc com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.SysSettings TdpJspImport.jsp TdpJspExecChangePwd.jsp Sends the request for a password change and provides the status back to TdpJspChangePwd.jsp and Javascript. TdpJspChangePwd.jsp TdpJspExportFile.jsp Main export file JSP; uses ttuwsexportdialog.jsp to display the dialog. ttuwsexportdialog.jsp TdpJspExtractBlankRgn.jsp Extracts or blanks a region—for a TIFF image com.towertechnology.jsp. tower.DocOperations TdpJspGetAppName.jsp Retrieves and displays a list of available applications. ttuwsmain*.jsp com.towertechnology.jsp. tower.AppList TdpJspGetDocSubpage.jsp Retrieves from IDM Server information about the selected document, such as: sub-page number, zoom factor, whether this is the last sub-page, document type (filename extension), and actual name and location (on the Web Server). This information is then passed to the viewer applet. (Not used by standard document frame.) com.towertechnology.jsp. tower.Doc com.towertechnology.jsp. tower.DocOperations TdpJspGetSubpageAnnot.jsp For a given IFN, page, and sub-page, retrieves annotations (as a string) com.towertechnology.jsp. tower.Annotation 12 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Table 1: Details of HTML, JSP, and JS files (Continued) Name Description TdpJspGetTccFile.jsp Displays Vignette Web Capture files using a plugin. TdpJspImport.jsp Imports a file directly to IDM Server. This is the public page; for more information, refer to The public interface on page 22. TdpJspImportTop.html TdpJspImportIndex.jsp TdpJspImportBot.jsp ttuwstimeout.jsp TdpJspImport.jsp Uploads the newly created file to IDM Server. If successful, then submits all the indexing information for the newly uploaded file. Redirects the user to TdpJspImportBot.jsp in case the user wants to upload another file and displays the status of the previous uploads. TdpJspImportTop.html TdpJspImportIndex.jsp TdpJspImportBot.jsp TdpJspImportBot.jsp Manages “execute upload” and “close upload window” dialog. TdpJspImportIndex.jsp Manages the indexing part of document upload. TdpJspImportTop.html Displays the top frame in the “document upload” dialog. TdpJspMisc.jsp Manages login, sets the session timeout. com.towertechnology.jsp. security.Logon com.towertechnology.jsp. generic.Params TdpJspSearch.jsp Main string search page, which invokes other string search-related JSPs. TdpJspSearchSet.jsp TdpJspSearchError.jsp Error processing during string search. In case of failure, prints stack trace. com.towertechnology.jsp. generic.TdpJbError TdpJspSearchList.jsp Displays and maintains list frame. TdpJspSearchStart.jsp TdpJspSearchResult.jsp Maintains search result list com.towertechnology.jsp. tower.search.StringSearch TdpJspViewerApplet.jsp (if viewer applet used) or ttuwsdocbot.jsp (when std doc frame is configured) and TdpJspDoc.jsp (to auto-display a document page which contains the searched string). v20.1 rev 1 IDM Browser Client for Unix API Reference Dependencies com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.SysSettings TdpJspDoImport.jsp TdpJspImportIndex.jsp ttuwscommon.js ttuwsformChecking.js 13 Chapter 2 Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies TdpJspSearchSet.jsp Search parameters validation and recognition. TdpJspSearchResult.jsp TdpJspSearchStop.jsp TdpJspSearchStart.jsp Starts a search com.towertechnology.jsp. tower.search.StringSearch TdpJspSearchStop.jsp Stops a search com.towertechnology.jsp. tower.search.StringSearch TdpJspServerEmail.jsp Used by applet viewer to email documents. ttuwsserver_doemail.jsp TdpJspServerFax.jsp Used by applet viewer to fax documents. ttuwsserver_dofax.jsp TdpJspSessionValidation.jsp Checks whether current session is valid; if not, sets the status to “expired” and redirects to ttuwstimeout.jsp ttuwstimeout.jsp TdpJspSessionValidationRelogin. jsp Validates current session. If not valid sets the status to “relogin” and redirects to ttuwstimeout.jsp ttuwstimeout.jsp TdpJspSetAnnotations.jsp This is the Web Server script which reads new/updated annotations sent to the Web Server by the viewer applet. com.towertechnology.jsp. tower.Annotation com.towertechnology.jsp. security.Logon TdpJspTitle.jsp Processes title modification requests com.towertechnology.jsp. tower.TitleList TdpJspTitleUpdate.jsp TdpJspTitleAdd.jsp TdpJspTitleAdd.jsp Adds a new title to a selected IFN TdpJspTitlelist.jsp TdpJspTitleDelete.jsp Deletes selected title(s) from the Title List frame com.towertechnology.jsp. tower.TitleList TdpJspTitlelist.jsp 14 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies TdpJspTitlelist.jsp Displays the list of found documents. When showing a selected document, posts requests to ttuwsdocbot.jsp. For more details, see The public interface on page 22. com.towertechnology.jsp. tower.TitleList com.towertechnology.jsp. tower.TowerHelper TdpJspGuestLogon.jsp TdpJspImport.jsp TdpJspDoc.jsp TdpJspAdvSearch.jsp TdpJspCheckImportPermisiion. jsp getTitleListAsString getTitleListAsObject): TdpJspGuestLogon.jsp TdpJspImport.jsp TdpJspDoc.jsp TdpJspAdvSearch.jsp TdpJspCheckImportPermisiion. jsp jscript/popups/tt/*.js images/doc_iconover.gif images/doc_iconup.gif TdpJspViewerApplet.jsp TdpJspTitle.jsp TdpJspTitleDelete.jsp TdpJspSearchList.jsp ttuwstitlelistonly_frame.jsp ttuwsdocbot.jsp ttuwsdoconly_frame.jsp ttuwslogin.jsp ttuwstimeout.jsp ttuwsserver_fax.jsp ttuwsserver_email.jsp ttuwsserver_print.jsp TdpJspTitleUpdate.jsp Updates existing selected title. TdpJspTitlelist.jsp TdpJspTitleUpdate.jsp Updates a selected title from the Title List frame com.towertechnology.jsp. tower.TitleList TdpJspTitlelist.jsp v20.1 rev 1 IDM Browser Client for Unix API Reference 15 Chapter 2 Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies TdpJspViewerApplet.jsp This is the main JSP page related to the viewer applet. It is similar to TdpJspDoc.jsp; it detects browser type (IE or Netscape) and the size of the frame to fit the Applet Viewer, downloads the Applet Viewer, and displays the requested document. For example, executing: TdpJspViewerApplet.jsp ?ifn=222/2-264 &npages=1&appname=demo displays the same document as the example for TdpJspDoc.jsp, this time in the viewer applet. If TdpJspViewerApplet.jsp ?appname=demo&ifn=222/2-264 is executed (npages is not specified), and this is a multi-page document, then npages is populated with the total number of pages in this document, allowing next page/ previous page/goto page operations. If npages is supplied, then the supplied value will be used regardless of the actual number of pages. No additional validation/tests will be performed. TdpJspViewerAppletBot.jsp ttuwsblank.html TdpJspViewerAppletBot.jsp Displays AppletViewer. Maintains connection with Web Server. If required initiates JRE/JAI download. TdpJspGetDocSubpage.jsp ttuwsmain_*.jsp TdpJsAdvSearch.js ttuwsblank.html ttuwslogout.jsp TdpJspViewerApplet.jsp TdpJspGetViewerConfig.jsp TdpJspGetSubpageAnnot.jsp TdpJspSetAnnotations.jsp TdpJspExtractBlankRgn.jsp TdpJspExportFile.jsp TdpJspServerEmail.jsp TdpJspServerFax.jsp TdpJspViewerError.jsp Prepares an error message to be displayed by the applet viewer. com.towertechnology.jsp.gener ic.TdpJbError TdpJsTest.js Used in Document Operations to invoke appropriate JSPs from the directory $TDP_WS_HOME/tower/jsp/examples to process requests ttuwsblank.html Blank page. ttuwscommon.js Checks whether a field is blank. 16 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies ttuwsdocbot.jsp Executes both “document retrieval” (using rendering, etc.) and “document export” using public Java methods. com.towertechnology.jsp .tower.Doc ttuwstimeout.jsp ttuwsblank.html TdpJspDocDetails.jsp TdpJspGetTccFile.jsp TdpJspDoc.jsp com.towertechnology.jsp. security.Logon ttuwsdoconly_frame.jsp This is the same as TdpJspDoc.jsp, except that it displays the document in maximized mode. ttuwsdocbot.jsp ttuwsdoctoop.jsp ttuwsdocprops.jsp For documents displayed in the standard document frame, this JSP is invoked from the standard toolbar; it displays properties of the current document. These properties are: temporary document name (used for storing the document in the temporary session directory), number of the Page and Sub-Page currently displayed, and the size of the current document. ttuwsdoctop.jsp Display the document toolbar for exporting, printing, page navigating and maximizing/minimizing, etc. Posts the user requests to ttuwsdocbot.jsp, to the layout page (default ttuwsmain_bot.jsp) or to the printer. ttuwserror.jsp Displays error messages. ttuwsexportdialog.jsp Displays the document export dialog ttuwsexportfile.jsp ttuwscommon.js ttuwsexportfile.jsp Processes document export requests. com.towertechnology.jsp. tower.Doc ttuwsformChecking.js Contains Javascript functions to process forms. Standard validation functions include date check, is field empty, is small integer, etc. Also checks all fields in a template according to IDM data type, prepares “where” clause (used to display titles), etc. ttuwsgotopage.jsp For documents displayed in the standard document frame, when “goto page” is selected from the standard toolbar, displays a dialog box to specify which page to go to. ttuwslogin.jsp This is the IBCU entry page (the first page displayed). Creates two frames for login purposes. v20.1 rev 1 IDM Browser Client for Unix API Reference images/toolbar*.gif ttuwsmain_bot.jsp ttuwsdoconly_frame.jsp ttuwstop_logout.html ttuwstowerlogin.jsp 17 Chapter 2 Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies ttuwslogout.html Separates the page into two frames. The top frame loads the top_logout.html and the bottom frame loads the timeout.jsp frame with status logout. ttuwstop_logout.html ttuwstimeout.jsp ttuwsmain.jsp This page separates the browser into frames to give the application its look and feel. Frames will be created depending on the initial (configurable) layout. TdpJspGetAppName.jsp ttuwsmain_bot*.jsp ttuwstop.jsp ttuwsuser.jsp ttuwsblank.html ttuwsmain_bot.jsp This page splits the initial bottom frame into three sub-frames. The QBE frame loads ttuwsqbe_frame.jsp, the GetTitleList frame loads TdpJspTitlelist.jsp, and the GetDoc frame loads TdpJspDoc.jsp (or, if the system is configured to use Applet Viewer, TdpJspViewerApplet.jsp). ttuwsqbe_frame.jsp TdpJspTitlelist.jsp TdpJspDoc.jsp TdpJspViewerApplet.jsp ttuwsblank.html ttuwsmain_both2.jsp Same as ttuwsmain_bot.jsp except displays only the TitleList frame and Doc frame horizontally. TdpJspTitlelist.jsp TdpJspDoc.jsp TdpJspViewerApplet.jsp ttuwsblank.html ttuwsmain_botv2.jsp Same as ttuwsmain_bot.jsp except displays only the TitleList frame and Doc frame vertically. TdpJspTitlelist.jsp TdpJspDoc.jsp TdpJspViewerApplet.jsp ttuwsblank.html ttuwsmain_botv3.jsp Same as ttuwsmain_bot.jsp except displays the QBE and TitleList frames vertically and the Doc frame horizontally. ttuwsqbe_frame.jsp TdpJspTitlelist.jsp TdpJspDoc.jsp TdpJspViewerApplet.jsp ttuwsblank.html ttuwspagerange.jsp Specifies the “page range” to be printed or sent by fax/email. ttuwsserver_fax.jsp or ttuwsserver_email.jsp or ttuwsserver_print.jsp (depending on “what is selected”) and ttuwserror.jsp for errors 18 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies ttuwsqbe_frame.jsp Displays the AppList and subsequent QBE form for TitleList retrieval. Posts the user’s search information to the TitleList frame. Allows the user to bring up a popup menu to search or reset anywhere in the frame. If the session is invalid, redirects the user to ttuwstimeout.jsp. com.towertechnology.jsp. security.Logon com.towertechnology.jsp. tower.AppList com.towertechnology.jsp. tower.Diskset com.towertechnology.jsp. util.ResourceLocator jscript/formChecking.js jscript/popups/qbe/*.js TdpJspTitlelist.jsp ttuwstimeout.jsp ttuwsqbeonly_frame.jsp The same as ttuwsqbe_frame.jsp, but displays the QBE template in maximized mode. com.towertechnology.jsp. security.Logon com.towertechnology.jsp. tower.AppList ttuwstitlelistonly_frame.jsp com.towertechnology.jsp. tower.SysSettings ttuwsmain*.jsp ttuwsformChecking.js TdpJsAdvSearch.js ttuwsserver_doemail.jsp Sends the selected documents by email from IDM Server. com.towertechnology.jsp. tower.HardCopy ttuwsserver_dofax.jsp Sends the selected documents by fax from IDM Server. com.towertechnology.jsp. tower.HardCopy ttuwsserver_doprint.jsp Prints out the selected document on IDM Server. com.towertechnology.jsp. tower.HardCopy ttuwsserver_email.jsp Displays the Server Email dialog box and posts requests to ttuwsserver_doemail.jsp. ttuwsserver_doemail.jsp ttuwsserver_fax.jsp Displays the Server Fax dialog box and posts requests to ttuwsserver_dofax.jsp. ttuwsserver_dofax.jsp ttuwsserver_print.jsp Displays the Server Print dialog box and posts requests to ttuwsserver_doprint.jsp. ttuwsserver_doprint.jsp ttuwstimeout.jsp Displays a message about the user’s session status. com.towertechnology.jsp. security.Logon ttuwslogin.jsp ttuwstitlelist.js This script is used to highlight the current active document icon, and retrieve (and identify) all checked title list rows, etc. v20.1 rev 1 IDM Browser Client for Unix API Reference 19 Chapter 2 Table 1: Details of HTML, JSP, and JS files (Continued) Name Description Dependencies ttuwstitlelistonly_frame.jsp The same as TdpJspTitlelist.jsp, but displays the frame in maximized mode. com.towertechnology.jsp. tower.TitleList TspJspTitle.jsp com.towertechnology.jsp. tower.AdvSearchSettings ttuwsmain*.jsp ttuwstitlelist.js TdpJspImport.jsp ttuwsserver_*.jsp TdpJspDoc.jsp TdpJspTitleDelete.jsp TdpJspSearchList.jsp ttuwsToolbar.js Contains document toolbar handlers (used by ttuwsdoctop.jsp). ttuwstop.html Frame containing Vignette and Vignette IDM logos, and the main window toolbar with log-out and frame layout selection functions. ttuwstop_logout.jsp Displays the Vignette banner (ttuwstop.html) without the logout/ frame layout toolbar. ttuwstower.jsp This page validates the user’s login details, such as the username and password, against IDM Server. If login is successful, the user is given a unique session ID. The user is also redirected to the ttuwsmain.jsp page. If login is unsuccessful, the user is redirected to the ttuwslogin.jsp page with errcode set to login failed. com.towertechnology.jsp. security.Logon TdpJspTitleList.jsp TdpJspDoc.jsp ttuwsmain.jsp ttuwslogin.jsp TdpJspImport.jsp ttuwstowerlogin.jsp Displays the login form. It is used to post the login information to ttuwstower.jsp for validation against IDM Server. It also initializes all static classes for resources and logging. This is where the properties file is read. com.towertechnology.jsp. tower.PropertiesHelper TdpJspTitleList.jsp TdpJspDoc.jsp ttuwstower.jsp ttuwsmain.jsp TdpJspImport.jsp ttuwsuser.jsp Displays the user’s name and login time as well as the number of users logged in. com.towertechnology.jsp. security.Logon ttuwsValidateIFN.js Checks whether the supplied IFN is in correct format. 20 © 2006 Vignette Corporation. All rights reserved. ttuwslogout.html TdpJsAdvSearch.js ttuwsmain_*.jsp TdpJsChangePwd.js v20.1 rev 1 HTML, JSP and JavaScript Table 2: HTML, JSP, and JS files provided as examples Name Description TdpCopyPages.jsp Copies pages from an existing IFN to a new IFN-dialog. TdpDelDoc.jsp Deletes a document-dialog. TdpDisksets.jsp Lists available disksets. TdpDocDisk.jsp Gets disk information for a given IFN-dialog. TdpDoCopyPages.jsp Copies pages from an existing IFN to a new IFN-JavaBeans interface. TdpDocPool.jsp Gets the pool the document belongs to-dialog. TdpDoDelDoc.jsp Deletes a document-JavaBeans interface. TdpDoImport.jsp Imports (uploads) a document to a specified diskset-JavaBeans interface. TdpDoMoveDoc.jsp Moves a document (IFN) to another pool-JavaBeans interface. TdpDoServerExec.jsp Executes a process on IDM Server from a browser-JavaBeans interface. TdpExtValidateFns.js “External validation functions” sample file (if TdpExtValidateFns was used as a “module name” during External Validation configuration). For more details see External validation on page 26. TdpExtValidateFns.js Provides example of “external validation functions” (requires that TdpExtValidateFns was used as a module name during External Validation configuration). For more details see External validation on page 26. TdpGetDocDisk.jsp Gets disk information for a given IFN-JavaBeans interface. TdpGetDocPool.jsp Gets the pool the document belongs to-JavaBeans interface. TdpImport.jsp Imports (uploads) a document to a specified diskset-dialog to select the file to be uploaded. TdpJspGetViewerConfig. jsp This page reads data from $TDP_WS_HOME/tower/WEB-INF/ttuws.props related to the viewer applet (for example, which annotation buttons should be displayed in the viewer applet toolbar, and which color they should be displayed in). TdpJspGuestLogon.jsp Sample page illustrating how to perform a piggy-back login. TdpJspGuestLogon.jsp Sample page “how to auto-logon to Vignette IDM Server”. May be used before executing Public JSP pages. TdpMoveDoc.jsp Moves a document (IFN) to another pool-dialog. TdpServerExec.jsp Executes a process on IDM Server from a browser-dialog. TdpUploadFile.jsp Displays a list of disksets for selecting the diskset where a selected document is to be uploaded. v20.1 rev 1 IDM Browser Client for Unix API Reference 21 2 Chapter The public interface Users can call TdpJspDoc.jsp and TdpJspTitlelist.jsp directly from a web browser, with an appropriate query string, to retrieve a document or a Title List. To retrieve a document directly Invoke TdpJspDoc.jsp Retrieving a document with login Required parameters: appname the IDM application of the requested document ifn the IFN of the requested document Optional parameters: npages the total number of pages in the requested document; if not supplied, then it will be set to the total number of pages in the requested document. This will allow next page/previous page/ goto page toolbar operations. If supplied, then this value will be used regardless of the actual number of pages. (For example, npages can be set to 97 even if the document contains 15 pages, or only 1 page, so that page 97 does not exist.) No additional validation/tests will be performed. pg the number of the page to be displayed. Should be in the range 1.. npages; default is 1 subpg the number of the subpage to be displayed; default is 1 zoom zoom factor; default is 0 (no zooming) negate whether to display the document in inverted colors. Should be 0 (no inversion) or 1(inversion); default is 0 Example: http://sundev6:8088/tower/jsp/TdpJspDoc.jsp?appname=mxtest&ifn=34/2843&npages=4&pg=2 The user will be presented with the IDM login page. Upon successful login, the requested document will be displayed, either in the standard IBCU document display frame or in the IDM viewer applet, depending on the user settings on IDM Server. If npages is included in the URL and is greater than 1, then the next page/previous page/goto page toolbar buttons will be enabled. If npages is not included in the URL, then if this is a multi-page document, npages will be populated with the correct value and the next page/previous page/goto page buttons will be enabled and fully functional. This is the case when the following is executed: http://172.16.1.234:8088/tao/jsp/TdpJspDoc.jsp?appname=demo&ifn=34/28-43 provided that ifn 34/28-43 represents a multi-page document. If it is a single-page document, then npages will be set to 1 and the next page/previous page/goto page buttons will not be enabled. 22 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Retrieving a document without login Required parameters: appname the IDM application of the requested document NOTE: IDM application name is a mandatory parameter when Document Type Security is turned on. If DTS is not enabled then this parameter is still required, although it can be “anything”, allowing the user to view documents without indexing (provided the user has permission to retrieve the document; see the publication IDM System Administration for details). ifn the IFN of the requested document orb IBC host details, in the format ipAddress, portNumber, towerServerName where portNumber is the port number used by the TAO Naming_Service. Optional parameters: npages the total number of pages in the requested document; if not supplied, then it will be set to the total number of pages in the requested document. This will allow next page/previous page/ goto page toolbar operations. If supplied, then this value will be used regardless of the actual number of pages. (For example, npages can be set to 97 even if the document contains 15 pages, or only 1 page, so that page 97 does not exist.) No additional validation/tests will be performed. pg the number of the page to be displayed. Should be in the range 1.. npages; default is 1 subpg the number of the subpage to be displayed; default is 1 zoom zoom factor; default is 0 (no zooming) negate whether to display the document in inverted colors. Should be 0 (no inversion) or 1 (inversion); default is 0 NOTE: negate works with some images only and is applicable to the standard document frame only (not the Applet Viewer). To make this facility available, you must create a guest user and password on IDM Server. The user name and password pair must be the same as the values used in the file TdpJspGuestLogon.jsp. By default, the guest user is WebGuest, and the password is an empty string “”. Example: http://sundev6:8088/tower/jsp/ TdpJspDoc.jsp?orb=172.16.1.35,14737,sundev6&appname=mxtest&ifn=34/28-43 v20.1 rev 1 IDM Browser Client for Unix API Reference 23 Chapter 2 The user will be presented with the IDM Login page. Upon successful login, the requested document will be displayed, either in the standard document display frame or in the viewer applet, depending on the user settings on IDM Server. NOTE: The optional parameter zoom is used in the process of IBCU rendering; it does not refer to the zoom attribute of the html img object. To retrieve a Title List directly Invoke TdpJspTitlelist.jsp Retrieving a Title List with login Required parameter: appname the IDM application of the requested document Optional parameter: where the search criteria in the form of a URL encode string. (For example, a where string fn>'doc1' should be encoded as fn%3E%27doc1%27.) If this parameter is not provided or its value is null or empty, all the documents that the user can access will be returned. Examples: http://sundev6:8088/tower/jsp/TdpJspTitlelist.jsp?appname=mxtest http://sundev6:8088/tower/jsp/ TdpJspTitlelist.jsp?appname=mxtest&where=fn%3E%27doc1%27 The user will be presented with the IDM login page. Upon successful login, the search result will be displayed in the standard Title List frame. Retrieving a Title List without login Required parameters: appname the Vignette Application of the requested Title List orb IBCU host details, in the format ipAddress, portNumber, towerServerName where portNumber is the port number used by the TAO Naming_Service. Optional parameter: where the search criteria in the form of a URL encode string. If this parameter is not provided or its value is null or empty, all the documents that the user can access will be returned. To make this facility available, you must create a guest user and password on IDM Server. The user name and password pair must be the same as the values used in the file TdpJspGuestLogon.jsp. By default, the guest user is WebGuest, and the password is an empty string “”. Examples: http://sundev6:8088/tower/jsp/ TdpJspTitlelist.jsp?orb=172.16.1.35,14737,sundev6&appname=mxtest 24 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript http://sundev6:8088/tower/jsp/ TdpJspTitlelist.jsp?appname=mxtest&where=fn>'honda1'&where=fn%3E%27doc1%27 The user will be presented with the Title List displayed in the standard IBCU Title List frame. To import a file directly Invoke TdpJspImport.jsp Importing a File with login Required parameter: appname the IDM Application to which the file will be imported Example: http://sundev6:8088/tower/jsp/TdpJspImport.jsp?appname=demo The user will be presented with the login page. After successful login the file import dialog will be displayed. Importing a file without login Required parameters: appname the IDM application to which the file will be imported orb IBC host details, in the format ipAddress, portNumber, towerServerName where portNumber is the port number used by the TAO Naming_Service or the Visibroker osagent. To make this facility available, you must create a guest user and password on IDM Server. The user name and password pair must be the same as the values used in the file TdpJspGuestLogon.jsp. By default, the guest user is WebGuest, and the password is an empty string “”. Examples: http://sundev6:8088/tower/jsp/ TdpJspImport.jsp?orb=172.16.1.35,14995,sundev6&appname=demo The user will be presented with a file selecting page. After the Import button is clicked, the standard IBC file indexing page will be displayed. After saving the indexing form, the file selecting page will be presented with the import result. v20.1 rev 1 IDM Browser Client for Unix API Reference 25 2 Chapter External validation IBCU allows custom-defined validation functions to be used to validate input fields. These fields include “input” and “select” (drop-down list box) fields in QBE, indexing, and title forms. Although the same custom validation can be achieved by providing a custom JSP which executes a custom validation directly, the recommended way is to use the facility provided. The advantages of doing so are: • Consistency with standard IBCU and standard IDM Client; • Ease of configuring and checking the settings. Creating an external validation routine 1. Set up the validation module/function using IDM System Administration. (Refer to the IDM System Administration User Guide for details.) 2. Write a custom validation function in Javascript. Ensure that it is appropriately named (<filename>.js) and stored in the standard IBCU Javascript directory, $TDP_WS_HOME/ tower/jsp/jscript. The function must have one parameter, the value of the id property of the field; it must return true when the value in the field is valid, and false otherwise. In standard IBCU, the id parameter is transparent and does not have to be supplied or known (apart from defining it as a parameter in the custom validation function). This method provides easy and unambiguous access to a particular field. For example, to retrieve the value of a specific field: if (document.getElementById(i).value == "test") (This fragment is copied from the function isTestField in the sample file TdpExtValidateFns.js, which is included in the standard IBCU installation.) NOTE: Fields of type date are split into three separate ID numbers. So, for example, if the first field is a date field, it will use ID values of 0, 1, and 2; then the second field will have an ID value of 3. The Javascript file name must then be defined as a module name during External Validation configuration. A sample module (TdpExtValidateFns.js) containing a sample function (isTestField) is included in the standard IBCU distribution. Two sets of functions are available: • Standard IBCU passes generated HTML; • If you need to set up the QBE, Index, or Title display to be different from standard IBCU, another set of functions defined as *AsObject is supplied. The implementation of External Validation differs between these two sets. Standard IBCU In standard IBCU, only the two steps described in Creating an external validation routine (above) are required. 26 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 HTML, JSP and JavaScript Custom code using “*AsObject” methods If you create a custom QBE, indexing, or title form using the functions getQBEAsObject(), getIndexAsObject(), or getTitleAsObject(), validation of submitted forms should include the standard validation functions. The recommended way to do this is for the new form checking function, which must be executed when the form is submitted, to first call the function checkAllFields(), defined in the file ttuwsformChecking.js (this function performs standard validation). The external validation functions should then be called. For compatibility, all external functions should also be defined using IDM System Administration. For example, if an external validation function extValidateFunction() is to be applied to a field with ID sampleField, then the new form checking function, custFormValidate(), should invoke the external function as follows: function custFormValidate(formname, allowallblank) { if (checkAllFields(formname, allowallblank) == false) { return false; } return extValidateFunction("sampleField"); } Common for standard IBCU and custom code using “*AsObject” If an external validation module/function is defined for an application, then a custom validation function must be provided (even if this is an “empty” function)—at least to avoid errors being reported to the user. As it is technically impossible to catch an exception generated in such a case, a message will be displayed similar to the following: NOTE: Definition of external validation function(s) is shared between standard IDM Client and IBCU. If a validation module/function is defined for standard IDM Client, such a module/function must also be provided for IBCU (and vice versa). Standard field validation ensures that a value is of the correct data type. Standard validation functions for IBCU are: checkDate() checkNumber() checkSmall_Int(). Custom validation (if provided) is in addition to these standard tests. v20.1 rev 1 IDM Browser Client for Unix API Reference 27 Chapter 28 2 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Chapter Public Java APIs 3 Introduction Java API components are used by IBCU to communicate with the CORBA objects on IDM Server. These Java API components are collected into Packages. This chapter discusses only the public interface Java API components, arranged according to the packages in which they are located. v20.1 rev 1 IDM Browser Client for Unix API Reference 29 Chapter 3 Package summary com.towertechnology.jsp.generic This package contains classes used to process exceptions. com.towertechnology.jsp.security This package contains classes supporting user login/logout, setting up and retrieving userrelated settings, and maintaining user sessions. com.towertechnology.jsp.tower This package contains classes supporting all business functionality, such as getting the applications list, retrieving QBE templates, and returning the results list. com.towertechnology.jsp.tower.search This package contains classes supporting the Search text function. com.towertechnology.jsp.util This package contains classes providing support functions such as logging to the IBCU Web Server log file. 30 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.generic Description This package contains classes used to process exceptions. Class summary TdpJbException v20.1 rev 1 This class is used to pass exception information from JavaBeans to JSP pages. IDM Browser Client for Unix API Reference 31 3 Chapter com.towertechnology.jsp.generic TdpJbException public class TdpJbException java.lang.Exception | +--com.towertechnology.jsp.generic.TdpJbException This class is used to pass exception information from JavaBeans to JSP pages. Member Summary Methods int java.lang.String int getErrorCode() Gets the error code. getMessage() Gets the error description. getOrigErrorCode() Gets the third party error code. Method details getErrorCode() public int getErrorCode() Gets the error code. The error code is an IBCU error code. It is a 9-digit number with the following format. Format: PPSCCXXXX where PP indicates the product scope. This value is always 88, which indicates it is within the IBCU scope; S indicates the subsystem; CC indicates the sub component; XXXX indicates the error code. For specific values, refer to the chapter Error handling on page 171. Returns: int - Error code. getMessage() public java.lang.String getMessage() Gets the error description. 32 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Overrides: getMessage() in class java.lang.Throwable Returns: String - The error description. getOrigErrorCode() public int getOrigErrorCode() Gets the third party error code. IBCU uses some third party libraries. If a function provided by a third party library fails, the error code set by the third party library can be retrieved using this method. Returns: int - Third party library error code. v20.1 rev 1 IDM Browser Client for Unix API Reference 33 Chapter 3 com.towertechnology.jsp.security Description This package contains classes supporting user login/logout, setting up and retrieving userrelated settings, and maintaining user sessions. Class summary Logon 34 The logon object is used to logon to IDM Server. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.security Logon public class Logon The logon object is used to logon to IDM Server. The following steps should be performed in JSP pages to initialize and logon to IDM Server. 1. Retrieve the application server list by using JavaBean PropertiesHelper. Example: <SELECT name='orb'> <% String options = com.towertechnology.jsp.tower.PropertiesHelper.getOrbOptionsAsHTMLString(); out.write(options); %> </SELECT> The application server information is defined by the values of property names tao.NameService.addr and tao.NameService.port in the IBCU properties file on the web server; e.g., the file ttuws.props (in the directory $TDP_WS_HOME/tower/WEB-INF). The returned string of method getOrbOptionsAsHTMLString() is constructed using these property values. The string is a formatted HTML string which represents a dropdown list. The value of each option is in the format of (host name, port number) where host name is the property value of property name tao.NameService.addr. Example: If the following name and value pairs are in the IBCU properties file: tao.NameService.addr=172.16.1.3 tao.NameService.port=14777 tao.NameService.addr=172.16.1.234 tao.NameService.port=14777 then the returned string will be: "<OPTION value='172.16.1.3,14777'>172.16.1.3 on port: 14777</OPTION>\n <OPTION value='172.16.1.234,14777'>172.16.1.234 on port: 14777</OPTION>" 2. Request the user to select an application server from the application server list, then submit the user name and password. The following illustration shows the JSP page provided by IBCU for obtaining the user’s login information: 3. Execute the method init(String, String, String). Example: v20.1 rev 1 IDM Browser Client for Unix API Reference 35 3 Chapter String selected = request.getParameter("orb"); String host = selected.substring(0, selected.indexOf(',')); String port = selected.substring(selected.indexOf(',') + 1); try { logon.init(host, port, session.getId()); } catch(TdpJbException tje) { // Error handling } 4. Logon to IDM Server by calling method login(String, String, String, String, String). If logon is successful, get the timeout value. This value is set in the system configuration file on IDM Server. In IDM System Administration, set Session Expired Time to the required value. Set session attributes by using the values of user name, user password, and valid session respectively, as illustrated below. Please note that the maximum session inactive interval should be the same as the session timeout set for IDM Server. Example: String user = request.getParameter("username"); String passwd = request.getParameter("passwd"); String remoteIP = request.getRemoteAddr(); try { logon.login(user, passwd, session.getId(), remoteIP, null); int secs = logon.getExpireTimeSeconds(session.getId()); session.setMaxInactiveInterval(secs); session.setAttribute("expiry", new Integer(secs)); session.setAttribute("userid", user); session.setAttribute("passwd", passwd); session.setAttribute("isvalid", new Boolean("true")); url = "ttuwsmain.jsp"; } catch (TdpJbException e) { url = "ttuwslogin.jsp?err=" + e.getMessage(); } Member Summary Methods void static int int 36 changePassword(String, String, String) Changes the password for the current user. getExpireTimeSeconds(String) Gets the expire time for a session. getUserCount() Gets the number of users currently logged on to the IBCU system via the web server. void init(String, String, String) Initializes the system. void login(String, String, String, String, String) Attempts to logon to IDM Server. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Member Summary void login(String, String, String, String, String, String) Changes the user’s password. void login(String, String, String, String, HttpSession, String, String, String) Changes the user’s password. static void void logout(String) Attempts to logout from IDM Server. setTowerHostName(String) Sets the repository server name to be the value specified. Method details init(String, String, String) public void init( java.lang.String host, java.lang.String port, java.lang.String session) throws TdpJbException Initializes the system with the specified host name and port number. The method must be called prior to any other method calls on remote objects; otherwise, the remote call will fail. Parameters: host - The host name where the orb is running. port - The port on which the orb is listening. session - The session ID. getExpireTimeSeconds(String) public static int getExpireTimeSeconds( java.lang.String s) Gets the expiry time in seconds for the specified session. Parameters: s - The session ID. Returns: int - The expiry time in seconds. getUserCount() public int getUserCount() Gets the number of users currently logged on to the IBCU system via the web server. This is the number of active users on the local web server only. If there are multiple web servers, then each object will report the number of users on that server. v20.1 rev 1 IDM Browser Client for Unix API Reference 37 Chapter 3 Returns: int - The number of users logged on to the IBCU system via the web server. login(String, String, String, String, String) public void login( java.lang.String username, java.lang.String passwd, java.lang.String sessionId, java.lang.String ipaddress, java.lang.String unused) throws TdpJbException Attempts to login to IDM Server with the specified user name and password. The third parameter is the user’s session ID. It should be obtained by calling method session.getId(). The fourth parameter is the user’s IP address. It should be obtained by calling method request.getRemoteAddr(). Parameters: username—The user name entered by the client. passwd—The password entered by the client. session—The session ID. ipaddress—The Internet Protocol (IP) address of the client that sent the request. unused—Not used. Should be null. login(String, String, String, String, String, String) public void login( java.lang.String username, java.lang.String passwd, java.lang.String newPassword, java.lang.String sessionId, java.lang.String ipaddress, java.lang.String unused) throws TdpJbException Attempts to log in to IDM Server with the specified user name and password, and change the password. This is to be used when a login is successful except that the password has expired. Parameters: username—The user name entered by the client. passwd—The password entered by the client. newPassword—The new password entered by the client. session—The session ID. ipaddress—The Internet Protocol (IP) address of the client that sent the request. unused—Not used. Should be null. 38 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs login(String, String, String, String, HttpSession, String, String, String) public void login( java.lang.String username, java.lang.String passwd, java.lang.String newPassword, java.lang.String ipaddress, HttpSession session, java.lang.String idmHostName, java.lang.String nsHost, java.lang.String nsPort) throws TdpJbException Attempts to log in to IDM Server with the specified user name and password, and change the password. This is to be used when a login is successful except that the password has expired. Parameters: username—The user name entered by the client. passwd—The password entered by the client. newPassword—The new password entered by the client. ipaddress—The Internet Protocol (IP) address of the client that sent the request. session—The session object allocated by the web server to this client session. idmHostName—The IDM Server host name. nsHost—The Naming Service host name. nsPort—The Naming Service port. logout(String) public static void logout( java.lang.String session) throws TdpJbException Attempts to logout from IDM Server. This method is called either explicitly by the JSP page when the user logs out of the system, or implicitly by the Logon object when the JSP container notifies that the session has timed out or become invalid. All attempts to clean up the user’s resources will be done here. All user files will also be removed from the web server. Parameters: session - The user’s session ID. changePassword(String, String, String) public void changePassword( java.lang.String sessionId, java.lang.String password, java.lang.String newPassword) throws TdpJbException Changes the password for the current user. Parameters: sessionId - The user’s session ID. password - The current password provided by the user. newPassword - The new password provided by the user. v20.1 rev 1 IDM Browser Client for Unix API Reference 39 Chapter 3 setTowerHostName(String) public void setTowerHostName(String val) Sets the repository server name to be the value specified. The value must be the $HOSTNAME of the repository server not its IP address. Parameters: val - the $HOSTNAME of the repository server (not its IP address). 40 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower Description This package contains classes supporting all business functionality, such as getting the applications list, retrieving qbe templates, and returning the results list. Class summary Annotation This class is used to encapsulate the JavaBean interfaces to access the IDM document’s annotation information. AppList The AppList class is used to provide a list of IDM applications for the user to choose from and the subsequent QBE (query by example) form. It is also used to upload a document and insert the corresponding indexing into IDM Server. AppListCollection This class is used to maintain a collection of the IDM application table(s). AppListEntry This class is used to represent an IDM application list entry. Disk This class is used to represent an optical disk. Diskset This class is used to represent an IDM diskset. Doc This class is used to retrieve documents from IDM Server, and to upload documents to IDM Server. Doc.UploadElem This inner class contains the uploaded file properties such as file size and file name. DocOperations This class is used to implement the document operations. DocumentHistory This class is used to represent a version of a document in the history table. DocumentManagement This class is used to perform document management actions on IDM Server. DocumentManagementAction This class defines document management actions that can be performed on a document. DocumentStatus This class is used to define document statuses that can be held by a document. FileData This class is used to obtain file names and contents. HardCopy This class allows users to send email, print, or fax jobs to IDM Server. PropertiesHelper A helper class to generate an HTML string from properties. ResultInfo This class is used to store the search result. ResultRecord This class is used to store search result details related to a single document. ServerExec This class is used to run a program on the server. Template This class is used to maintain the IDM template. TemplateField This class is used to represent an IDM template field. TitleList This class is used to build the Result List form, update a Title, and delete Titles. TitleList.TableRow This class is used to represent both the abstract key data and the row data in an IDM application table. v20.1 rev 1 IDM Browser Client for Unix API Reference 41 Chapter 3 Class summary TitleList.TableTemplateEntry This class is used to represent IDM application Template information. TitleList.TitleListData This class is used to represent the heading template information, the data template information, and the information corresponding to all the titles for a given application table. TowerHelper This class maps the IDM database constant variables to Java. 42 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower Annotation public class Annotation This class is used to encapsulate the JavaBean interfaces to access the IDM document’s annotation information. It interacts with the IDM annotation CORBA service. Member Summary Methods java.lang.String getSubpageAnnotationsAsString( String, int, int) Gets the annotation(s) within a subpage for an IDM document page and returns the information formatted as a string. void setAnnotations(String, String, boolean) Saves annotation(s), as represented in a formatted string, for the IDM document specified in the IFN. void setUser(String) Sets the JavaBean’s user property within the session context. Method details setUser(String) public void setUser( java.lang.String session) Sets the JavaBean’s user property within the session context. Parameters: session - The session ID from the JSP page’s context. getSubpageAnnotationsAsString(String, int, int) public String getSubpageAnnotationsAsString( java.lang.String ifn, int pageNum, int subpageNum) Gets the Annotations within a subpage for a document page as string. This method calls the CORBA method to get the annotations for a subpage within a document page. Parameters: ifn - The document ID. pageNum - The document page number. subpageNum - The subpage number within the document page. v20.1 rev 1 IDM Browser Client for Unix API Reference 43 Chapter 3 Throws: TdpJbException - If there is an error. Returns: String - A formatted annotation information string. See IBCU annotation information interchange format. setAnnotations(String, String, boolean) public void setAnnotations( java.lang.String ifn, java.lang.String annotInfoStr, boolean forceWrite) Saves annotation information (as represented in the formatted string) for the IDM document page (as specified in IFN). This method calls the CORBA method to save the annotations for a document page. Parameters: ifn - The document ID. annotInfoStr - A string representation of the annotation data. See IBCU annotation information interchange format. forceWrite - Flag controlling behavior if there is an annotation conflict. A conflict arises if another user has made changes to the annotation information since it was loaded by the present user. If the forceWrite flag is true, the new annotations will be stored regardless; if there is a conflict, it will be ignored, no warning will be issued, and no exception will be raised. By default (when IBCU is installed “off the shelf”), forceWrite is set to false. Throws: TdpJbException - Raised if there is an error, or (provided that the forceWrite flag is false) if there is any annotation conflict with another user. In case of such a conflict, any annotation(s) where there is no conflict will be saved, but the annotation(s) in conflict will not be saved. The conflict count is returned as part of the exception’s error description. IBCU annotation information interchange format When annotation information is passed between the Annotation JavaBean, the JSP pages, and the IBCU viewer applet, it is in the following format. <Prefix>=<Version_Info> <OverallPermission> [<Page Number> <Number of subpages that contain annotations> <UserCanCreatePermission> <FileVersion> <Subpage Annotation info>] where: <Prefix> = ANNOTINFO <Version Info> = VERSION:1 <SubpageAnnotationInfo> = <Subpage Number> <Number of annotations> <AnnotationInfo> <AnnotationInfo> = <Status> <Permissions> <Creator User Info Length> <Creator User Info> <Creator User Group Info Length> <Creator Group Info> <Creator Timestamp> <Last Modified User Info Length> <Last Modified User Info> <Last Modified Group Info Length> <Last Modified Group Info> <Last Modified Timestamp> <Colour> <Annotation Type> <Specific Annotation Info> <Colour> = <Red Value> <Green Value> <Blue Value> When annotation information is passed for saving, <OverAllPermission>, <UserCanCreatePermission>, <Status>, and <Permissions> are not used, but need to be set to dummy values of the appropriate data type. 44 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs All atomic tokens are separated by one space, except the equal sign “=” between <Prefix> and <Version Info>. For AnnotationType = HIGHLIGHT <Specific Annotation Info> = <x1> <y1> <x2> <y2> <Border Colour> <Translucency> <Pen Width> <Line Style> For AnnotationType = STICKYNOTE <Specific Annotation Info> = <x1> <y1> <x2> <y2> <Rotation> <Shape> <Data Length> <Special Type> <Data String Length> <Data String> For AnnotationType = UNDERLINE <Specific Annotation Info> = <x1> <y1> <x2> <y2> <PenWidth> <LineStyle> For AnnotationType = MARGINCOMMENT <Specific Annotation Info> = <x1> <y1> <x2> <y2> <Rotation> <Font Size> <Font Style> <Font Family Info> <Special Type> <Data String Length> <Data String> For AnnotationType = FREEHAND <Specific Annotation Info> = <Xorigin> <Yorigin> <PenWidth> <Line Style> <Special Type> <Points Info> <PointsInfo> = <Number Of Points> <x1> <y1>[... <xn> <yn>] For AnnotationType = ELLIPSE <Specific Annotation Info> = <x1> <y1> <x2> <y2> <Border Colour> <Translucency> <Pen Width> <Line Style> <Border Colour> = <Red Value> <Green Value> <Blue Value> v20.1 rev 1 IDM Browser Client for Unix API Reference 45 Chapter 3 com.towertechnology.jsp.tower AppList public class AppList The AppList class is used to provide a list of IDM applications for the user to choose from, and subsequently provides the corresponding QBE (query by example) form. It is also used to upload a document and insert the corresponding indexing into IDM Server. To get the list of Applications and the subsequent QBE form: 1. The JSP page provides: • the unique session ID of the user’s session. This is used to set the bean’s user property. • the Application name. This is used to set the bean’s app property. Please note that the Application name must be in the same format as the values of the choices in the Application drop-down list, i.e. “Application short name, Application diskset”. A diskset is a named storage partition on IDM Server for the storage of related documents. Each diskset can have a number of applications assigned to it. 2. The JSP page calls the getAppListAsString() method to get the Application list. This method returns a formatted HTML string which represents a drop-down list. The drop-down list shows all the available Applications for this user to choose from. The value of each option in the list is in the form of “short name of the Application, diskset of the Application”. The display value is the Application’s long name. Example The returned string of method getAppListAsString() might be as follows, if there are two Applications available for the specified user: <OPTION selected value="app[1].shortname,app[1].diskset">app[1].longname <OPTION value="app[2].shortname,app[2].diskset">app[2].longname The JSP page for Applications and QBE could have the following code section. <jsp:useBean id='appList' class='com.towertechnology.jsp.tower.AppList'/> <jsp:setProperty name='appList' property='user' value='<%=session.getId()%>'/> <jsp:setProperty name='appList' property='app' value='<%=appname%>'/> <SELECT> <% String applist = null; try { applist = appList.getAppListAsString(); } catch(TdpJbException tje) { // Error handling } if (applist != null) out.println(applist); %> </SELECT> 3. 46 The JSP page calls the getQBE() method to get the QBE form. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs This method returns a formatted HTML string which represents rows and cells in a table. It is assumed that the “FORM” tag has been previously defined by the calling JSP page. Each row in the table represents one query field, and consists of three cells. The first cell is the label using the data in the query field. The second cell is the operator list which lists all operators that can be applied to this field. Please note that if the data type of the query field is SQL_VARCHAR, the operator list also includes like, is null, and is not null. The third cell is either three drop-down lists (for SQL_DATE and SQL_TIMESTAMP fields) or an input box (for other fields). The string returned by method getQBE() is in the following format if the data type of the first field is SQL_NUMERIC, the data type of field i is SQL_VARCHAR, and the data type of field j is SQL_DATE or SQL_TIMESTAMP: <TABLE bgcolor='#f0f0f0' border='0' width='100%' cellspacing='0' cellpadding='1'> <TR bgcolor='#F0F0F0'> <TD align='left' colspan='3'> <FONT color='#000000' size='-2'><STRONG> Query-By-Example</STRONG<</FONT> </TD> </TR> <TR> <TD align='left' width='30%'> <FONT color='#000000' size='-2'> field[1].data</FONT> </TD> <TD align='left' width='20%'> <SELECT name='op_field[1].name'> <OPTION selected value='='>= <OPTION value='<>'><> <OPTION value=''>> <OPTION value='='>>= <OPTION value='<'>< <OPTION value='<='><= </SELECT> </TD> <TD align='left'> <INPUT type='text' size='field[1].length' maxlength='field[1].length' name='field_field[1].name:field[1].datatype'></TD> </TR> ... <TR> <TD align='left' width='30%'> <FONT color='#000000' size='-2'> field[i].data</FONT> </TD> <TD align='left' width='20%'> <SELECT name='op_field[i].name'> <OPTION selected value='='>= <OPTION value='<>'><> <OPTION value=''>> <OPTION value='='>>= <OPTION value='<'>< <OPTION value='<='><= <OPTION value='like'>like <OPTION value='is null'>null <OPTION value='is not null'>not null </SELECT> </TD> <TD align='left'> v20.1 rev 1 IDM Browser Client for Unix API Reference 47 Chapter 3 <INPUT type='text' size='field[i].length' maxlength='field[i].length' name='field_field[1].name:field[i].datatype'> </TD> </TR> ... <TR> <TD align='left' width='30%'> <FONT color='#000000' size='-2'> field[j].data</FONT> </TD> <TD align='left' width='20%'> <SELECT name='op_field[j].name'> <OPTION selected value='='>= <OPTION value='<>'><> <OPTION value=''>> <OPTION value='='>>= <OPTION value='<'>< <OPTION value='<='><= </SELECT> </TD> <TD align='left'> <SELECT name='field_field[j].name_y:field[j].datatype'> <OPTION selected value='-'>year <OPTION value='1990'>1990 <OPTION value='1991'>1991 <OPTION value='1992'>1992 ... <OPTION value='2040'>2040 </SELECT> <SELECT name='field_field[j].name_m:field[j].datatype'> <OPTION selected value='-'>month <OPTION value='01'>JAN <OPTION value='02'>FEB <OPTION value='03'>MAR <OPTION value='04'>APR <OPTION value='05'>MAY <OPTION value='06'>JUN <OPTION value='07'>JUL <OPTION value='08'>AUG <OPTION value='09'>SEP <OPTION value='10'>OCT <OPTION value='11'>NOV <OPTION value='12'>DEC </SELECT> <SELECT name='field_field[j].name_d:field[j].datatype'> <OPTION selected value='-'>day <OPTION value='01'>1 <OPTION value='02'>2 ... <OPTION value='09'>9 <OPTION value='10'>10 <OPTION value='11'>11 ... <OPTION value='31'>31 </SELECT> </TD> </TR> ... </TABLE> 48 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Example The JSP code section for getting QBE form might be as follows: <jsp:useBean id='appList' class='com.towertechnology.jsp.tower.AppList'/> <jsp:setProperty name='appList' property='user' value='<%=session.getId()%>'/> <jsp:setProperty name='appList' property='app' value='<%=appname%>'/> ... <FORM name='qbe' action='TdpJspTitlelist.jsp?search=new' method='post' target='gettitlelist'> ... <% String qbe = null; try { qbe = appList.getQBE(); } catch(TdpJbException tje) { // Error handling } if (qbe != null) out.println(qbe); %> </FORM> The Application list and QBE form on the following html page are generated by using the above code sections within the JSP page. To get the Indexing form for indexing a document that is to be uploaded: 1. The JSP page provides: • the unique session ID of the user’s session. This is used to set the AppList user property. • the Application name. This is used to set the AppList app property. 2. The JSP page calls the getIndex() method. This method returns a formatted HTML string which represents rows and cells in a table. It is assumed that the FORM tag has been previously defined by the calling JSP page. Each row in the table represents one index field. It consists of two cells. The first cell is the label using the data from the index field. The second cell is the input box or dropdown list for SQL_DATE and SQL_TIMESTAMP fields. v20.1 rev 1 IDM Browser Client for Unix API Reference 49 Chapter 3 Example The string returned by method getIndex() is in the following format if the data type of the first field is numeric: <TABLE bgcolor='#f0f0f0' border='0' width='100%' cellspacing='0' cellpadding='1'> <TR bgcolor='#F0F0F0'> <TD align='left' colspan='3'> <FONT color='#000000' size='-2'><STRONG> Indexing</STRONG<</FONT> </TD> </TR> <TR> <TD align='left' width='30%'> <FONT color='#000000' size='-2'> field[1].data</FONT> </TD> <TD align='left'> <INPUT type='text' size='field[1].length' maxlength='field[1].length' name='field_field[1].name: field[1].datatype'></TD> </TR> ... </TABLE> If the field data type is SQL_DATE or SQL_TIMESTAMP, the corresponding row will be as follows: <TR> <TD align='left' width='30%'> <FONT color='#000000' size='-2'> field.data</FONT> </TD> <TD align='left'> <SELECT name='field_field.name_d:field.datatype'> <OPTION selected value='-'>day <OPTION value='01'>1 <OPTION value='02'>2 ... <OPTION value='09'>9 <OPTION value='10'>10 <OPTION value='11'>11 ... <OPTION value='31'>31 </SELECT> <SELECT name='field_field.name_m:field.datatype'> <OPTION selected value='-'>month <OPTION value='01'>JAN <OPTION value='02'>FEB ... <OPTION value='09'>SEP <OPTION value='10'>OCT <OPTION value='11'>NOV <OPTION value='12'>DEC </SELECT> <SELECT <OPTION <OPTION <OPTION ... 50 name='field_field.name_y:field.datatype'> selected value='-'>year value='1990'>1990 value='1991'>1991 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs <OPTION value='2040'>2040 </SELECT> </TR> The JSP code section for getting a Indexing form might be as follows: <FROM name='indexing' action='<%= url %>' method='post'> ... <% String index = null; try { index = appList.getIndex(); } catch(TdpJbException tje) { // Error handling } if (index != null) out.println(index); %> </FROM> where url is the JSP page doing the uploading of a document. The Indexing form on the html page illustrated below is generated by using the above code section within the JSP page. The location of the file that the indexing is applied to is C:\test.txt and its size is 11 bytes. v20.1 rev 1 IDM Browser Client for Unix API Reference 51 Chapter 3 To upload a document into IDM Server: 1. The JSP page provides: • the unique session ID of the user’s session. This is used to set the AppList user property. • the Application name. This is used to set the AppList app property. The document will be uploaded to the specified Application. • uploading the file to the web server by submitting a form with encoding multipart/form-data. Example <FORM name="upload" action="ttuwsdoupload.jsp" enctype="multipart/form-data" method="post"> <INPUT type="file" name="fileupload"> <INPUT type="submit" value="Upload File"> </FORM> Please note that security checking will be applied to uploading a document. The user’s permission can be checked by calling method getPermission("ttuws_p_import"). If there is no permission checking at the JSP level and the user does not have permission to upload, the execution of method createUploadFile(ServletInputStream, String) will fail and exception TdpJbException will be thrown. 2. The JSP page: • calls Doc JavaBean’s createUploadFile(ServletInputStream, String) method. This method writes the uploaded file to a temporary file on the web server. It returns a Doc.UploadElem object. The first parameter is the request as a binary data stream. The second parameter is the boundary string of the MIME type multipart/form-data. Example Assume that we use the previous sample code to upload a file. The following code can be in the file ttuwsdoupload.jsp to process the uploaded file. String boundary = "boundary="; int boundaryLen = boundary.length(); String contentType = request.getContentType(); int idx = contentType.indexOf(boundary); String boundaryStr = contentType.substring(index + boundaryLen); Doc.UploadElem elm = (Doc.UploadElem)doc.createUploadFile(request.getInputStream(), boundaryStr); • obtains the diskset value from the Application name. Example The diskset value can be obtained from the following statements: <% int diskset = 0; int idx = appname.indexOf(","); diskset = Integer.parseInt(appname.substring(idx + 1)); %> where appname is the Application name. • calls Doc JavaBean’s uploadDoc(String, int) method. This method uploads a file on the web server to IDM Server and returns an integer array where [0] = ifnid and [1] = npages. 52 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs The first input parameter is the name of the temporary file created for the uploading file on the web server. It is obtained by calling method getUploadFileName() of object Doc.UploadElem which is returned by the previously called method createUploadFile(ServletInputStream, String). The second input parameter is the diskset value of the Application. • provides the Indexing form for the user to enter indexing data for the uploaded file. • calls insertIndex(String) method to insert the indexing data for the uploaded file into the Application table (provided the upload is successful). This method requires one String parameter, which must be in the following form: (ifnid, ifnds, npages, field[1].name, field[2].name, ..., field[n].name) values (ifnidValue, ifndsValue, npagesValue, field[1].value, field[2].value, ..., field[n].value) There are three mandatory fields: ifnid, ifnds, and npages. The ifnds field contains the diskset value of the Application. The other two mandatory values are the return value of the method uploadDoc(String, int) as mentioned above. The other fields correspond to the input controls on the Indexing form. The field name can be extracted from the NAME attribute of the input control on the form. The NAME attribute is usually in the form of field_fieldName:fieldDataType. However, for field types SQL_DATE and SQL_TIMESTAMP, there are three drop-down lists for each field; their NAME attributes are in the forms field_fieldName_d:fieldDataType for day, field_fieldName_m:fieldDataType for month, and field_fieldName_y:fieldDataType for year. Member Summary Methods AppListCollection getAppListAsObject() Returns the application list as an AppListCollection object. java.lang.String getAppListAsString() Generates the Application List as an HTML string. java.lang.String getAppListAsStringForImport() throws TdpJbException Connects with the user’s credentials to the CORBA object and attempts to retrieve the Applist Table for importing new documents. java.lang.String getAppName() Returns the appName property of the class which indicates the IDM application being operated on. java.lang.String getIndex() Returns the index template. Template boolean java.lang.String Template v20.1 rev 1 getIndexAsObject() Gets the index template. getPermission(String) Returns the permission value. getQBE() Builds the QBE form as an HTML string within the context of a form. getQBEAsObject() Gets the QBE template as a QBECollection object. IDM Browser Client for Unix API Reference 53 Chapter 3 Member Summary void insertIndex(String) Inserts an index into IDM Server. void setApp(String) Sets the app property. void setUser(String) Sets the user property. Method details getPermission(String) public boolean getPermission( java.lang.String key) Returns a boolean indicating whether the user has the permission to perform the task specified by the input parameter. Example: getPermission("ttuws_p_import") will indicate whether the user can upload a document to IDM Server. Returns: boolean - The access permission. getAppListAsObject() public AppListCollection getAppListAsObject() throws com.towertechnology.jsp.generic.TdpJbException Returns the application list as an AppListCollection object. This method will connect with the user’s credentials to the CORBA object and attempt to retrieve the IDM application tables. Returns: Reference to an AppListCollection object. getAppListAsString() public java.lang.String getAppListAsString() throws com.towertechnology.jsp.generic.TdpJbException Generates the IDM application list as an HTML string. The properties user and app must be set before calling this method. Returns: String - A formatted HTML string. 54 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getAppListAsStringForImport() public String getAppListAsStringForImport() throws TdpJbException Connects with the user’s credentials to the CORBA object and attempts to retrieve the Applist Table for importing new documents. It only retrieves applications that the user has document type security permission DOCTYPE_CREATE on at least one slevel value. Returns: A formatted HTML string. getAppName() public java.lang.String getAppName() Gets the appName property of the class which indicates the IDM application being operated on. Returns: String - The related IDM application name. getQBE() public java.lang.String getQBE() throws com.towertechnology.jsp.generic.TdpJbException Builds the QBE form as an HTML string within the context of a form. The properties user and app must be set before calling this method. The HTML element FORM must be previously defined by the calling JSP page. Returns: String - The formatted HTML string. getQBEAsObject() Template getQBEAsObject() throws com.towertechnology.jsp.generic.TdpJbException Gets the QBE template as a QBECollection object. This method will connect using the user’s credentials to the CORBA objects to build the QBE form. Returns: A reference to the IDM template object getIndex() public java.lang.String getIndex() throws com.towertechnology.jsp.generic.TdpJbException Retrieves the index template as a formatted HTML string. The properties user and app must be set before calling this method. Returns: String - The formatted HTML string. v20.1 rev 1 IDM Browser Client for Unix API Reference 55 Chapter 3 getIndexAsObject() Template getIndexAsObject() throws com.towertechnology.jsp.generic.TdpJbException Gets the index template. This method will attempt to retrieve the indexing template data by means of a remote call to the indexing object. Returns: A reference to the IDM template object. insertIndex(String) public void insertIndex( java.lang.String valuesClause) throws com.towertechnology.jsp.generic.TdpJbException Inserts an index into IDM Server. The properties user and app must be set before calling this method. It will insert an index into current Application in IDM Server. The input parameter provides the value clause for an insert SQL statement. Parameters: valuesClause - The values for the indexing object. setApp(String) public void setApp( java.lang.String appname) Sets the app property. Parameters: appname - The application name, in the form “Application short name, Application diskset”. setUser(String) public void setUser( java.lang.String session) Sets the user property. Parameters: session - The session ID from the JSP. 56 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower AppListCollection java.lang.Object | +--com.towertechnology.jsp.tower.AppListCollection public class AppListCollection extends java.lang.Object This class is used to maintain a collection of the IDM application table(s). Member Summary Fields AppListEntry[] appList An array of the AppListEntry objects. Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Field details appList public AppListEntry[] appList An array of the IDM AppListEntry object(s). v20.1 rev 1 IDM Browser Client for Unix API Reference 57 3 Chapter com.towertechnology.jsp.tower AppListEntry java.lang.Object | +--com.towertechnology.jsp.tower.AppListEntry public class AppListEntry extends java.lang.Object This class is used to represent an IDM application list entry. Member Summary Fields long disksetAsNumber The IDM diskset represented as a numeric value. java.lang.String disksetAsString The IDM diskset represented as a string value, e.g. “222/0”. java.lang.String longName The IDM application table’s description. java.lang.String shortName The IDM application table name. Methods static java.lang.String disksetToString(long) Converts the diskset number as specified to its string representation. Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Field details longName public java.lang.String longName The IDM application table description. shortName public java.lang.String shortName The IDM application table name. 58 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs disksetAsNumber public long disksetAsNumber The IDM diskset number as a numeric value. disksetAsString public java.lang.String disksetAsString The IDM diskset number in string representation. Method details disksetToString(long) public static java.lang.String disksetToString( long diskset) Converts the numeric representation of the diskset as specified to its string representation. Parameters: diskset - The numeric representation of the diskset. Returns: String - string representation of the specified diskset number. v20.1 rev 1 IDM Browser Client for Unix API Reference 59 Chapter 3 com.towertechnology.jsp.tower Disk java.lang.Object | +--java.lang.Object com.towertechnology.jsp.tower.Disk public class Disk extends java.lang.Object This class is used to represent an optical disk. Member Summary Methods java.lang.String int getDiskName() Gets the disk name. getDiskNumber() Gets the disk number. Method details getDiskNumber() public int getDiskNumber() Gets the disk number. Returns: int - The disk number. getDiskName() public java.lang.String getDiskName() Gets the disk name. Returns: String - The disk name. 60 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower Diskset java.lang.Object | +--com.towertechnology.jsp.tower.Diskset public class Diskset extends java.lang.Object This class is used to represent an IDM diskset. Member Summary Fields long java.lang.String cloneset The Clone diskset of this diskset. java.lang.String current Current disk. static int static java.lang.String java.lang.String long java.lang.String v20.1 rev 1 aclIndex ACL to use for security on this diskset. DE7001_MEDIA The ID of the DE7001- 5.25 inch optical disk. DE7001_STRING The string representing of DE7001- 5.25 inch optical disks. disksetName The name of the diskset. disksetNumberInt The diskset number represented in data type long. disksetNumberStr The diskset number represented in data type String. static int DS_BACKUP The BACKUP diskset. static int DS_CACHED The CACHED diskset. static int DS_EXPORTED The EXPORTED disket. static int DS_EXTERNAL The EXTERNAL disket. static int DS_HOLDING The HOLDING diskset. static int DS_IMPORTED The IMPORTED disket. static int DS_IMPORTING The IMPORTING disket. IDM Browser Client for Unix API Reference 61 Chapter 3 Member Summary static int DS_UNWRITEABLE The UNWRITABLE diskset. static int FILE_MEDIA The ID for media type of magnetic disk f iles. static java.lang.String short static int static java.lang.String static int static java.lang.String static int static java.lang.String long static int static java.lang.String int flags The diskset flag. HP_MEDIA The ID for media type of HP - 5.25 inch optical disks. HP_STRING The string representation for media type of HP - 5.25 inch optical disks. IBM632_MEDIA The ID for media type of IBM632- 5.25 inch optical disks. IBM632_STRING The string representation for media type of IBM632- 5.25 inch optical disks. L1200_MEDIA The ID for media type of L1200 - 12 inch LMS optical disks. L1200_STRING The string representation for media type of L1200 - 12 inch LMS optical disks. lastBlockWritten Last block used in this diskset. LD510_MEDIA The ID for media type of LD510 - 5.25 inch optical disks. LD510_STRING The string representation for media type of LD510 - 5.25 inch optical disks. mediaType The media type of this diskset. long missingFileId The missing file ID. long missingFileTimeout The missing file timeout. long nextId The next IFN. long nextToCommit Next ID in queue. static int static java.lang.String long 62 FILE_STRING The string representation for media type of magnetic disk f iles. NULL_MEDIA The ID for no media type. NULL_STRING The string representation for no media type disksets. queuedData The amount of data in queue. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Member Summary static int static java.lang.String static int static java.lang.String static int static java.lang.String static int static java.lang.String long TAPE_MEDIA The ID for media type of TAPE - magnetic tape. TAPE_STRING The string representation for media type of TAPE - magnetic tape. UNKNOWN_MEDIA The ID for unknown media type. UNKNOWN_STRING The string representation for unknown media type. W3000_MEDIA The ID for media type of W3000 - 12 inch Sony optical disks. W3000_STRING The string representation for media type of W3000 - 12 inch Sony optical disks. WD93x_MEDIA The ID for media type of WD930 - 12 inch Sony optical disks. WD93x_STRING The string representation for media type of WD930 - 12 inch Sony optical disks. wraparound The diskset surface cycles. Methods java.lang.String getFlagDescription(short) Gets the description of the diskset flag. java.lang.String getMediaTypeDescription() Gets the description of the media type of the diskset. java.lang.String getMediaTypeDescription(int) Gets the description of the media type of the diskset. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Field details L1200_MEDIA public static final int L1200_MEDIA The ID for media type of L1200 - 12 inch LMS optical disks. v20.1 rev 1 IDM Browser Client for Unix API Reference 63 Chapter 3 FILE_MEDIA public static final int FILE_MEDIA The ID for media type of magnetic disk files. TAPE_MEDIA public static final int TAPE_MEDIA The ID for media type of TAPE - magnetic tape. LD510_MEDIA public static final int LD510_MEDIA The ID for media type of LD510 - 5.25 inch optical disks. NULL_MEDIA public static final int NULL_MEDIA The ID for no media type. W3000_MEDIA public static final int W3000_MEDIA The ID for W3000 - 12 inch Sony optical disks. DE7001_MEDIA public static final int DE7001_MEDIA The ID for DE7001- 5.25 inch optical disk. WD93x_MEDIA public static final int WD93x_MEDIA The ID for WD930 - 12 inch Sony optical disks. IBM632_MEDIA public static final int IBM632_MEDIA The ID for IBM632- 5.25 inch optical disks. HP_MEDIA public static final int HP_MEDIA The ID for HP - 5.25 inch optical disks. UNKNOWN_MEDIA public static final int UNKNOWN_MEDIA The ID for unknown media type. 64 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs L1200_STRING public static final java.lang.String L1200_STRING The string representation for media type of L1200 - 12 inch LMS optical disks. FILE_STRING public static final java.lang.String FILE_STRING The string representation for media type of magnetic disk files. TAPE_STRING public static final java.lang.String TAPE_STRING The string representation for media type of TAPE - magnetic tape. LD510_STRING public static final java.lang.String LD510_STRING The string representation for media type of LD510 - 5.25 inch optical disks. NULL_STRING public static final java.lang.String NULL_STRING The string representation for no media type. W3000_STRING public static final java.lang.String W3000_STRING The string representation for the media type of W3000 - 12 inch Sony optical disks. DE7001_STRING public static final java.lang.String DE7001_STRING The string representation for the media type of DE7001- 5.25 inch optical disk. WD93x_STRING public static final java.lang.String WD93x_STRING The string representation for the media type of WD930 - 12 inch Sony optical disks. IBM632_STRING public static final java.lang.String IBM632_STRING The string representation for the media type of IBM632- 5.25 inch optical disks. HP_STRING public static final java.lang.String HP_STRING The string representation for the media type of HP - 5.25 inch optical disks. v20.1 rev 1 IDM Browser Client for Unix API Reference 65 Chapter 3 UNKNOWN_STRING public static final java.lang.String UNKNOWN_STRING The string representation for unknown media type. DS_UNWRITEABLE public static final int DS_UNWRITEABLE Unwritable diskset. DS_EXPORTED public static final int DS_EXPORTED EXPORTED diskset. DS_IMPORTED public static final int DS_IMPORTED IMPORTED diskset. DS_IMPORTING public static final int DS_IMPORTING IMPORTING diskset. DS_HOLDING public static final int DS_HOLDING A holding diskset is a temporary diskset with no optical disks associated with it, used to “hold” documents on magnetic disk. Documents are first allocated in a holding diskset until further processing or further indexing has been done. They are then re-allocated in a permanent diskset, or deleted as appropriate. DS_CACHED public static final int DS_CACHED A cached diskset is a permanent diskset which may have optical disks associated with it. When documents are flushed to optical disk, they are also left on magnetic disk and moved to the cache pool. DS_BACKUP public static final int DS_BACKUP A backup diskset is a permanent diskset which may have optical disks associated with it. When documents are flushed to optical disk, they are also left on magnetic disk and moved to the copyout pool. DS_EXTERNAL public static final int DS_EXTERNAL An external diskset is used to implement a legacy link to another external system. 66 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs disksetName public java.lang.String disksetName The name of the diskset. disksetNumberInt public long disksetNumberInt The diskset number as a long. disksetNumberStr public java.lang.String disksetNumberStr The diskset number as a String, in the format SSN/DS, where SSN is the system serial number of IDM Server and DS is the numeric ID of the diskset. For example, 144/2. current public java.lang.String current The current surface in the disk chain. This is the surface that is to be written to in the output run. cloneset public java.lang.String cloneset The clone diskset of this diskset. wraparound public long wraparound The surface cycles of this diskset. It defines how many A surfaces are written before writing the B surface of the first disk in the wrap. mediaType public int mediaType The media type of this diskset. flags public short flags Status flags. A set of status flags are maintained to indicate particular aspects of the disk set, for example, a disk set may be WRITE PROTECTED or a flag set to indicate that documents should be moved to cache after writing. Spare flags are reserved for future use. nextId public long nextId The next IFN ID. The next document added to the diskset will be allocated this IFN ID. v20.1 rev 1 IDM Browser Client for Unix API Reference 67 Chapter 3 lastBlockWritten public long lastBlockWritten The last block written. This is used by IDM Server’s OUTPUT module and indicates where on the physical platter the next document should be written. The OUTPUT module maintains this value but ALWAYS crosschecks this value with the physical disk before writing (an algorithm termed locate first free is executed to find the first blank block in the document area of the disk). nextToCommit public long nextToCommit The next IFN to commit. This is used by IDM Server’s OUTPUT module. When output is initiated, all documents from the next IFN to commit to the next IFN will be committed. queuedData public long queuedData The amount of data still remaining to be flushed to optical. missingFileTimeout public long missingFileTimeout The missing file timeout. missingFileId public long missingFileId The missing file ID. aclIndex public long aclIndex The ACL to use for security on this diskset. Method details getMediaTypeDescription() public java.lang.String getMediaTypeDescription() Gets the description of the media type of the diskset. Returns: String - The description of the media type. getMediaTypeDescription(int) public java.lang.String getMediaTypeDescription( int mediaType) Gets the description of the specified media type. 68 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Parameters: mediaType - The media type. Returns: String - The description of the media type. getFlagDescription(short) public java.lang.String getFlagDescription( short flg) Gets the description of the specified diskset flag. Parameters: flg - The diskset flag. Returns: String - The description of the media flag which is a space character separated string, such as “HOLDING EXTERNAL”. v20.1 rev 1 IDM Browser Client for Unix API Reference 69 3 Chapter com.towertechnology.jsp.tower Doc public class Doc This class is used to retrieve documents from IDM Server, and to upload documents to IDM Server. To retrieve a document for display on a browser: 1. The JSP page provides: • the unique session ID of the user’s session. This is used to set the user property. • the Application name. This is used to set the appName property. • the document IFN. This is used to set the ifn property. • the page number of the document to retrieve. This is used to set the pageNumber property. • (optionally) the subpage number to retrieve. This is used to set the subpageNumber property. The subpage number is used on some multi-media document types, such as doc and pdf. The default value is 1. • (optionally) extra rendition input parameters using the method setRenderProperty(String, Object). 2. The JSP page calls the getDoc() method to retrieve a document for display on the browser. This method will retrieve a document from IDM Server and store it on the web server. The path of the document relative to virtual directory jsp/docs is returned. Please make sure that the returned path is appended to the string docs/ when it is used as the value of the src attribute of an HTML img element. Example: Suppose the returned value of the getDoc() method is String relativeDocPath and the file is a jpg file. Then the retrieved document can be displayed using the following simplified code section in a JSP page: <% String docsrc = null; if (relativeDocPath != null) { docsrc = "docs/" + relativeDocPath; document.writeln('<body>'); document.writeln('<img src='<%=docsrc%>'>'); document.writeln('</body>'); } %> 3. The JSP page sets: • (optionally) the total number of subpages retrieved using the getTotalSubpages() method. • (optionally) the retrieved subpage number using the getSubpageNumber() method. It can differ from the subpage number requested. 70 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs • (optionally) extra rendition output parameters using the getRenderProperty(String) method. To upload a document to IDM Server: See class AppList for details. Member Summary Methods java.lang.Object createUploadFile(ServletInputStream, String) Writes the upload document to a temporary file on the web server. java.lang.String exportDoc(String, int, int, Boolean) Exports a file to the client from IDM Server. java.lang.String exportDoc(String, Boolean) Exports a file to the client from IDM Server. java.lang.String getAppName() Gets the appName property. java.lang.String getDoc() Retrieves the document and returns the path of the document relative to virtual directory jsp/docs on the web server. java.lang.String getDoc(String, int, int, boolean) Retrieves the document and returns the path of the document relative to virtual directory jsp/docs on the web server. java.lang.String getDoc(String, int, int) Retrieves the document and returns the path of the document relative to virtual directory jsp/docs on the web server. int getEndPageNumber() Gets the end page number set for document exports. int getIntRenderProperty(int) Gets a rendition parameter as an integer. java.lang.String getRawFileName() Gets the raw document file name. java.lang.Object getRenderProperty(String) Gets a rendition parameter. java.lang.Object [] getSettingVal(Object) The value of the setting key from $TDP_WS_HOME/tower/WEB-INF/ ttuws.props. If the setting is not found, returns null. int java.lang.String v20.1 rev 1 getStartPageNumber() Gets true if the specified file extension is in the pass through list. getStrRenderProperty(String) Gets a rendition parameter as a string. int getSubpageNumber() Gets the subpage number. int getTotalPages() Gets the totalPages property. int getTotalSubpages() Gets the total number of subpages. IDM Browser Client for Unix API Reference 71 Chapter 3 Member Summary int[] boolean java.lang.String passThroughExtension(String) Returns true if the specified file extension is in the pass through list. renderDoc(String, int) Retrieves a document, and renders it. void setAppName(String) Sets the appName property. void setEndPageNumber(int) Sets the end page number for document exports. void setExportFlag(boolean) Sets the exportFlag property. void setIfn(String) Sets the ifn property. void setPageNumber(int) Sets the pageNumber property. void setRenderProperty(String, Object) Sets a rendition parameter. void setStartPageNumber(int) Sets the start page number for document exports. void setSubpageNumber(int) Sets the subpageNumber property. void setUser(String) Sets the user property. int[] 72 getZoomRange() Gets zoom range settings from the ttuws.props file. uploadDoc(String, int) Uploads a document to IDM Server. int getPageSize(String, int) Retrieves the document page size. int getPageSize(int) Retrieves the document page size. int getPageSize() Retrieves the document page size. string getNextPage(String, int, int) Retrieve the next page having page size greater than or equal to the page size threshold. string getNextPage(String, int) Retrieve the next page having page size greater than or equal to the page size threshold. string getNextPage(int) Retrieve the next page having page size greater than or equal to the page size threshold. string getNextPage() Retrieve the next page having page size greater than or equal to the page size threshold. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Method details setUser(String) public void setUser( java.lang.String session) Sets the user property from the session. Parameters: session - The session ID from the JSP. setExportFlag(boolean) public void setExportFlag( boolean newValue) Sets the exportFlag property. If this flag is true, the raw document will be retrieved, suitable for export. Otherwise, the rendered document will be provided. Parameters: newValue - True if the document is required for export, false otherwise. setAppName(String) public void setAppName( java.lang.String newValue) Sets the appName property. This method sets the appName property of the JavaBean to indicate the IDM application being operated on. Parameters: newValue - The application name. getAppName() public String getAppName() Gets the appName property of the class which indicates the IDM application being operated on. Returns: String - The related IDM application name. setIfn(String) public void setIfn( java.lang.String newValue) Sets the ifn property. Parameters: newValue - The IFN of the document. v20.1 rev 1 IDM Browser Client for Unix API Reference 73 Chapter 3 getTotalPages() public int getTotalPages() Gets the totalPages property. Returns: int - The total number of pages in the document. setPageNumber(int) public void setPageNumber( int newValue) Sets the pageNumber property. Parameters: newValue - Page number of the document. setSubpageNumber(int) public void setSubpageNumber( int newValue) Sets the subpageNumber property. Parameters: newValue - The subpage number of the document. getSubpageNumber() public int getSubpageNumber() Gets the subpage number of the document. Returns: int - The subpage number. getTotalSubpages() public int getTotalSubpages() Gets the total number of subpages in the document. Returns: int - The total number of subpages. renderDoc(String, int) java.lang.String renderDoc( java.lang.String ifn, int pageNumber) throws TdpJbException Retrieves a document, and renders it. Parameters: ifn - The IFN of the file. pgNumber - The page number of the file. 74 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Returns: String - The relative path to the rendered file. setRenderProperty(String, Object) public void setRenderProperty( java.lang.String key, java.lang.Object newValue) Sets a rendition parameter for rendering the document. The available input rendition parameters are: Parameter Description zoomfactor Zoom factor as a percentage. Set to ‘100’ for 1:1 conversion. force8bits Flag forcing the conversion of the image to 8-bit format. Set to ‘1’ to convert the image to 8-bit format. Set to ‘0’ if the image is not to be converted. conversiontype Specifies whether to convert a color image to black/white. Set to ‘0’ if images are not to be converted. Set to ‘1’ if only monochrome images are to be converted to black/white. Set to ‘2’ if all images are to be converted to black/white. height Specifies the required image height in pixels. width Specifies the required image width in pixels. fullcolor Specifies whether to convert color images to grayscale. Set to ‘1’ if color images are not to be converted. Set to ‘0’ if color images are to be converted to grayscale. Parameters: key - The parameter name. newValue - The name of the object to be stored. getRenderProperty(String) public java.lang.Object getRenderProperty( java.lang.String key) Gets a rendition parameter. Parameters: key - The parameter name. Returns: Object - The parameter value. NOTE: The two following methods are provided to avoid “casting”. getStrRenderProperty(String) public java.lang.String getStrRenderProperty( java.lang.String key) Gets a rendition parameter as a string. v20.1 rev 1 IDM Browser Client for Unix API Reference 75 Chapter 3 Parameters: key - The parameter name. Returns: String - The parameter value. getIntRenderProperty(int) public int getIntRenderProperty( java.lang.String key) Gets a rendition parameter as an integer. Parameters: key - The parameter name. Returns: int - The parameter value. getRawFileName() public java.lang.String getRawFileName() Gets the name of the raw file. A raw file is a retrieved document which has not been rendered. The raw file name is the path of the raw file relative to the virtual directory jsp/docs on the web server. Returns: String - The raw file name. getZoomRange() int[] getZoomRange() Gets zoom range settings from the ttuws.props file. Returns: int [] - An integer array containing the following properties from the ttuws.props file: jsp.render.zoom.max jsp.render.zoom.min jsp.render.zoom.increment getDoc() public java.lang.String getDoc() throws com.towertechnology.jsp.generic.TdpJbException Retrieves the document and returns the path of the document relative to virtual path jsp/ docs on the web server. This method attempts to retrieve the document from IDM Server and store it on the web server. All directories and filenames are created with a flag to “delete on close”; this is a JVM directive to delete the allocated resources when the JVM is shut down (i.e., when the JSP container is closed). The cleanup of these directories and files is also done on user session timeout and user logout. Additionally, this method might try to convert the document to another format by using a renderer specified in the IBCU properties file located on the web server. 76 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Example: If jsp.render.extension.tif=com.towertechnology.jsp.render.TIFRenderer is defined in the IBCU properties file, then a retrieved TIF document will be rendered using the TIFRenderer JavaBean. Parameters: ifn - The IFN of the document to retrieve. pageNumber - The page number (numbered starting at 1). Returns: String - The path of the requested document relative to the virtual directory jsp/docs on the web server. getDoc(String, int, int, boolean) public java.lang.String getDoc) String ifn, int pageNumber, int totalPages, boolean getNpages) throws com.towertechnology.jsp.generic.TdpJbException Retrieves the document and returns the path of the document relative to virtual path jsp/ docs on the web server. This method attempts to retrieve the document from IDM Server and store it on the web server. All directories and filenames are created with a flag to “delete on close”; this is a JVM directive to delete the allocated resources when the JVM is shut down (i.e., when the JSP container is closed). The cleanup of these directories and files is also done on user session timeout and user logout. Additionally, this method might try to convert the document to another format by using a renderer specified in the IBCU properties file located on the web server. Parameters: ifn - The IFN of the document to retrieve. pageNumber - The page number (numbered starting at 1). totalPages - The total number of pages. getNpages - Whether to retrieve the total number of pages of this document from IDM Server. If set to yes, the total number of pages of this document is retrieved from IDM Server. If set to no, the total number of pages of this document will not be retrieved. Returns: String - The path of the requested document relative to the virtual directory jsp/docs on the web server. getDoc(String, int, int) public String getDoc( String ifn, int pageNumber, int totalPages) throws com.towertechnology.jsp.generic.TdpJbException Parameters: ifn - The document's IFN. pageNumber - The current page number. v20.1 rev 1 IDM Browser Client for Unix API Reference 77 Chapter 3 totalPages - The total number of pages in the document. Returns: The filename of the exported document if the file extension is in the pass through list and the web_pass_through_all_pages option is set to Y. (The web_pass_through_all_pages option is set for each group in IDM System Administration. For more information on pass-through, refer to the separate publication IDM Browser Client for UNIX Technical Reference.) Otherwise returns the filename of the current page obtained from IDM Server using the getDoc() method. createUploadFile(ServletInputStream, String) public java.lang.Object createUploadFile( javax.servlet.ServletInputStream in, java.lang.String boundary) throws com.towertechnology.jsp.generic.TdpJbException Writes the upload document to a temporary file on the web server. This method will parse the javax.servlet.ServletInputStream in parameter using java.lang.String boundary to get the file name and file contents. The JSP page provides javax.servlet.ServletInputStream by uploading a file in a multipart/form-data encoded HTML form. Currently, when a file is uploaded to the web server in HTML format with encoding multipart/form-data, the HTML request data stream is broken into blocks of data separated by boundary strings: Boundary 1: blank Boundary 2: filename=xxx; filetype=xxx;... Boundary 3: mime types Boundary 4: blank Boundary 5: file contents Example: String boundary = "boundary="; int boundaryLen = boundary.length(); String contentType = request.getContentType(); int idx = contentType.indexOf(boundary); String boundaryStr = contentType.substring(index + boundaryLen); Doc.UploadElem elm = (Doc.UploadElem)doc.createUploadFile(request.getInputStream(), boundaryStr); Parameters: in - The JSP input stream. boundary - The string representing the boundary between data blocks. Returns: Object - The Doc.UploadElem. 78 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs exportDoc(String, int, int, Boolean) public String exportDoc( String ifn, int startPage, int endPage, boolean exportAs) throws com.towertechnology.jsp.generic.TdpJbException Exports a file to the client from IDM Server. Parameters: ifn - The document’s IFN. startPage - First page of the page range to export. endPage - Last page of the page range to export (if specified as zero, all pages will be exported). exportAs - Reserved for future use (enhancement). Must be set to true. exportDoc(String, Boolean) public String exportDoc( String ifn, boolean exportAsOneFile) throws com.towertechnology.jsp.generic.TdpJbException Exports a file to the client from IDM Server. The user and appName properties must be set before calling this method. Parameters: ifn - The document’s IFN. exportAsOneFile - Whether the document is to be exported as one file. If true, all pages of the document will be exported in one file; otherwise, the document will be exported as one file per page (not currently supported). Returns: String - The relative path to the requested file. uploadDoc(String, int) public int[] uploadDoc( java.lang.String docname, int diskset) throws com.towertechnology.jsp.generic.TdpJbException Uploads a file on the web server to IDM Server. The first input parameter is the name of the temporary file created for the uploading document. It is obtained by calling method getUploadFileName() of object Doc.UploadElem which is returned by the method createUploadFile(ServletInputStream, String). The second input parameter is the diskset value of the Application. It should be obtained from the current Application name. The following example shows how to get the diskset value. Example: The diskset value can be obtained using the following code: <% int diskset = 0; int idx = appname.indexOf(","); diskset = Integer.parseInt(appname.substring(idx + 1)); %> v20.1 rev 1 IDM Browser Client for Unix API Reference 79 Chapter 3 where appname is the Application name. Parameters: docname - The absolute path of the file on the web server. diskset - The diskset the document is uploaded to. Returns: int[] - the array where [0] = ifnid (the identifier of the IFN assigned to the uploaded document) and [1] = npages (the number of pages in the uploaded document). Throws: TdpJbException - If upload was unsuccessful. setStartPageNumber(int) public void setStartPageNumber( int newValue) Parameters: newValue - Sets the start page number property. getStartPageNumber() public int getStartPageNumber() Returns: The value of the startPageNumber property. setEndPageNumber(int) public void setEndPageNumber( int newValue) Parameters: newValue - Sets the end page number property. getEndPageNumber() public int getEndPageNumber() Returns: The value of the endPageNumber property. passThroughExtension(String) public boolean passThroughExtension( String fileExt) Returns: True if the file extension fileExt is in the pass through list, false otherwise. The pass through list is defined for each group in IDM System Administration. For more information on pass-through, refer to the separate publication IDM Browser Client for UNIX Technical Reference. 80 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getSettingVal(Object) public java.lang.Object[] java.lang.Object key) getSettingVal( Returns: The value of the setting key from $TDP_WS_HOME/tower/WEB-INF/ttuws.props. If the setting is not found, returns null. getPageSize(String, int) public int getPageSize( String ifn, int pageNumber) throws com.towertechnology.jsp.generic.TdpJbException This method attempts to retrieve a document page size from the IDM Repository. The user and appName properties must be set before calling this method. Parameters: ifn - The IFN of the document. pageNumber - The page number (numbered starting at 1). Returns: int - The document page size in bytes. getPageSize(int) public int getPageSize( int pageNumber) throws com.towertechnology.jsp.generic.TdpJbException This method attempts to retrieve a document page size from the IDM Repository. The user, appName and ifn properties must be set before calling this method. Parameters: pageNumber - The page number (numbered starting at 1). Returns: int - The document page size in bytes. getPageSize() public int getPageSize() throws com.towertechnology.jsp.generic.TdpJbException This method attempts to retrieve a document page size from the IDM Repository. The user, appName, ifn and pageNumber properties must be set before calling this method. Returns: int - The document page size in bytes. v20.1 rev 1 IDM Browser Client for Unix API Reference 81 Chapter 3 getNextPage(String, int, int) public String getNextPage( String ifn, int startPage, int pageSize) throws com.towertechnology.jsp.generic.TdpJbException Retrieve the next page of a document with the page size greater than or equal to the page size threshold. This method attempts to retrieve the document page with a page number greater than or equal to the start page number and the page size greater than or equal to the page size threshold. The actual page number can be obtained by calling the method getPageNumber(). If there is no such page, the page number is set to -1. The user and appName properties must be set before calling this method. Additionally, this method might try to convert the document to another format by using a renderer specified in the IBCU properties file located on the web server. Parameters: ifn - The IFN of the document. startPage - The start page number. pageSize - The page size threshold. Returns: String - The file name of the retrieved document page if it exists, otherwise null is returned. getNextPage(String, int) public String getNextPage( String ifn, int startPage) throws com.towertechnology.jsp.generic.TdpJbException Retrieve the next page of a document with the page size greater than or equal to the page size threshold. This method attempts to retrieve the document page with a page number greater than or equal to the start page number and the page size greater than or equal to the page size threshold. The actual page number can be obtained by calling the method getPageNumber(). If there is no such page, the page number is set to -1. The page size threshold is the property jsp.pagesize.threshold in the property file on the web server. The user and appName properties must be set before calling this method. Parameters: ifn - The IFN of the document. startPage - The start page number. Returns: String - The file name of the retrieved document page if it exists, otherwise null is returned. 82 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getNextPage(int) public String getNextPage( int startPage) throws com.towertechnology.jsp.generic.TdpJbException Retrieve the next page of a document with the page size greater than or equal to the page size threshold. This method attempts to retrieve the document page with a page number greater than or equal to the start page number and the page size greater than or equal to the page size threshold. The actual page number can be obtained by calling the method getPageNumber(). If there is no such page, the page number is set to -1. The page size threshold is the property jsp.pagesize.threshold in the property file on the web server. The user, appName and ifn properties must be set before calling this method. Parameters: startPage - The start page number. Returns: String - The file name of the retrieved document page if it exists, otherwise null is returned. getNextPage() public String getNextPage() throws com.towertechnology.jsp.generic.TdpJbException Retrieve the next page of a document with the page size greater than or equal to the page size threshold. This method attempts to retrieve the document page with a page number greater than or equal to the start page number and the page size greater than or equal to the page size threshold. The actual page number can be obtained by calling the method getPageNumber(). If there is no such page, the page number is set to -1. The page size threshold is the property jsp.pagesize.threshold in the property file on the web server. The property pageNumber is used as the start page number. The user, appName, ifn and pageNumber properties must be set before calling this method. Returns: String - The file name of the retrieved document page if it exists, otherwise null is returned. v20.1 rev 1 IDM Browser Client for Unix API Reference 83 3 Chapter com.towertechnology.jsp.tower Doc.UploadElem public class Doc.UploadElem Enclosing class: Doc This inner class contains the uploaded file properties such as file size and file name. Member Summary Methods java.lang.String getOrigFileName() Gets the original file name. int getSize() Gets the size of the file. java.lang.String getUploadFileName() Gets the file name as generated for the local file system. Method details getOrigFileName() public java.lang.String getOrigFileName() Gets the original file name, which is the name of the file on the user machine. Returns: String - The file name. getUploadFileName() public java.lang.String getUploadFileName() Gets the name of the temporary file created on the web server corresponding to the user’s file. Returns: String - The file name. getSize() public int getSize() Gets the size of the file. 84 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Returns: int - The file size. v20.1 rev 1 IDM Browser Client for Unix API Reference 85 Chapter 3 com.towertechnology.jsp.tower DocOperations public class DocOperations This class is used to implement the document operations. The methods in this class can be made available to all users by enabling the DocOperations toolbar, which will appear in the Query frame. The toolbar contains eight icons: From left to right, the icons are List all disksets, Move document to pool, Delete document, Get pool of document, Import document, Copy document, Start process on server, Disk information. To enable the toolbar, set jsp.document.operations=true in the file ttuws.props. Some document operations refer to “pools”. A pool is a logical collection of documents in a similar state; for example, there is a print pool, which holds temporary documents (such as banner pages) that can be deleted after printing. Physically, a pool is a flag in the header of an IFN (document). To move a document between pools, a flag in the header is changed (the file is not actually moved).. Member Summary Fields static int static java.lang.String static int static java.lang.String static int static java.lang.String static int static java.lang.String static int static java.lang.String 86 CACHE_POOL_ID The ID that represents a cache pool on IDM Server. CACHE_POOL_STR The string that represents a cache pool. COPYIN_POOL_ID The ID that represents a copyin pool on IDM Server. COPYIN_POOL_STR The string that represents a copyin pool. COPYOUT_POOL_ID The ID that represents a copyout pool on IDM Server. COPYOUT_POOL_STR The string that represents a copyout pool. HOLDING_POOL_ID The ID that represents a holding pool on IDM Server. HOLDING_POOL_STR The string that represents a holding pool. OUTPUT_POOL_ID The ID that represents a output pool on IDM Server. OUTPUT_POOL_STR The string that represents a output pool. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Member Summary static int static java.lang.String v20.1 rev 1 PRINT_POOL_ID The ID that represents a print pool on IDM Server. PRINT_POOL_STR The string that represents a print pool. static int PT_AFP_COLDIMP_DOC The parcel type of a document of IBM AFP format requiring inline resource. static int PT_AFP_DOC The parcel type of an IBM Advanced Function Presentation format document. static int PT_AFP_INLINE_RESOURCE The parcel type of IBM AFP inline resource. static int PT_AMIPRO The parcel type of Lotus AmiPro. static int PT_ANNOTATION The parcel type of an IDM annotation. static int PT_BINARY The parcel type of a binary document. static int PT_DCF The parcel type of Document Composition Facility. static int PT_EPS The parcel type of an Adobe PostScript Format document. static int PT_EXCEL The parcel type of a MS Excel document. static int PT_JPEG The parcel type of a Joint Photographic Experts Group Colour document. static int PT_MARKUPS_ANNOT The parcel type of a Markups Annotation document. static int PT_MIME The parcel type of a Multipurpose Internet Mail Extensions document. static int PT_MSWORD The parcel type of a MS Word document. static int PT_NULL The Null parcel type. static int PT_OCR The parcel type of an Optical Character Recognition document. static int PT_PDA The parcel type of a Process Document Architecture Format document. static int PT_TEXT The parcel type of a text document. static int PT_TIFF The parcel type of an Aldus Tagged Image File Format document. IDM Browser Client for Unix API Reference 87 3 Chapter Member Summary static int PT_TOWER_AUDIT The parcel type of an IDM Audit Record document. static int PT_TOWER_FINFO The parcel type of an IDM Table of Contents document. static int PT_TOWER_FPOINT The parcel type of an IDM Table of Contents Pointer document. static int PT_TOWER_ICON The parcel type of an IDM Icon document. static int PT_TOWER_IMAGE The parcel type of an IDM Image document. static int PT_TOWER_TEXT The parcel type of an IDM Text document. static int PT_TOWER_TILED The parcel type of an IDM Tiled Image document. static int PT_WORDPERFECT The parcel type of a WordPerfect document. static int SCAN_POOL_ID The ID that represents a scan pool on IDM Server. static java.lang.String static int SCAN_POOL_STR The string that represents a scan pool. TOTAL_POOL The total number of pools defined on IDM Server. Methods java.lang.String blankRegion(int, int, int, int, int, int, int) Blanks a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. java.lang.String blankRegion(String, int, int, int, int, int, int, int) Blanks a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. void changeDocPool(int) Moves the document to a specified pool. void changeDocPool(String, int) Moves the document to a specified pool. int copyPages(int, int, int, int) Copies pages from a document to create a new document in the specified diskset and pool. int copyPages(String, int, int, int, int) Copies pages from a document to create a new document in the specified diskset and pool. void deleteDocument() Deletes a document from IDM Server. void deleteDocument(String) Deletes a document from IDM Server. java.lang.String 88 extractRegion(int, int, int, int, int, int, int) Extracts a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Member Summary java.lang.String int[] extractRegion(String, int, int, int, int, int, int, int) Extracts a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. getAllPools() Gets ID values of all the pools defined on IDM Server. java.lang.String getAppName() Gets the name of the Application in which IFNs are stored. java.lang.String getCreatedIfn() Gets the IFN of the document created by copyPages(String, int, int, int, int). com.towertechnology.jsp .tower.Disk getDocDisk() Gets the information of the optical disk that a document is stored on. com.towertechnology.jsp .tower.Disk getDocDisk(String) Gets the information of the optical disk that a document is stored on. int getDocDiskset() Gets the disket number of the document from its IFN. int getDocDiskset(String) Gets the disket number of the document from its IFN. int getDocPool() Gets the pool value of the document. int getDocPool(String) Gets the pool value of the document. java.lang.String v20.1 rev 1 getIfn() Gets the IFN. int getParcelType(int) Gets the parcel type of the document. int getParcelType(String, int) Gets the parcel type of the document. java.lang.String getPoolDescription(int) Gets the description of the pool value. boolean isValidForExtractBlank(int) Checks whether the specified page of the document is valid for performing extract or blank region operation. boolean isValidForExtractBlank(String, int) Checks whether the specified page of the document is valid for performing extract or blank region operation. void setAppName(String) Sets the Application in which the IFNs are stored. void setCreatedIfn(String) Sets the IFN of the document created from copy pages from a document. void setIfn(String) Sets the document IFN. IDM Browser Client for Unix API Reference 89 Chapter 3 Member Summary void setUser(String) Sets the user property from the session. Field details TOTAL_POOL public static final int TOTAL_POOL The total number of pools defined on IDM Server. SCAN_POOL_ID public static final int SCAN_POOL_ID The ID that represents a scan pool on IDM Server. PRINT_POOL_ID public static final int PRINT_POOL_ID The ID that represents a print pool on IDM Server. HOLDING_POOL_ID public static final int HOLDING_POOL_ID The ID that represents a holding pool on IDM Server. COPYIN_POOL_ID public static final int COPYIN_POOL_ID The ID that represents a copyin pool on IDM Server. OUTPUT_POOL_ID public static final int OUTPUT_POOL_ID The ID that represents a output pool on IDM Server. COPYOUT_POOL_ID public static final int COPYOUT_POOL_ID The ID that represents a copyout pool on IDM Server. CACHE_POOL_ID public static final int CACHE_POOL_ID The ID that represents a cache pool on IDM Server. 90 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs SCAN_POOL_STR public static final java.lang.String SCAN_POOL_STR The string description of a scan pool. PRINT_POOL_STR public static final java.lang.String PRINT_POOL_STR The string description of a print pool. HOLDING_POOL_STR public static final java.lang.String HOLDING_POOL_STR The string description of a holding pool. COPYIN_POOL_STR public static final java.lang.String COPYIN_POOL_STR The string description of a copyin pool. OUTPUT_POOL_STR public static final java.lang.String OUTPUT_POOL_STR The string description of a output pool. COPYOUT_POOL_STR public static final java.lang.String COPYOUT_POOL_STR The string description of a copyout pool. CACHE_POOL_STR public static final java.lang.String CACHE_POOL_STR The string description of a cache pool. PT_NULL public static final int PT_NULL The NULL parcel type. PT_TOWER_IMAGE public static final int PT_TOWER_IMAGE The IDM Image parcel type. PT_TOWER_AUDIT public static final int PT_TOWER_AUDIT The IDM Audit Record parcel type. v20.1 rev 1 IDM Browser Client for Unix API Reference 91 Chapter 3 PT_TOWER_FPOINT public static final int PT_TOWER_FPOINT The IDM Table of Contents Pointer parcel type. PT_TOWER_FINFO public static final int PT_TOWER_FINFO The IDM Table of Contents parcel type. PT_TOWER_TILED public static final int PT_TOWER_TILED The IDM Tiled Image parcel type. PT_TOWER_ICON public static final int PT_TOWER_ICON The IDM Tiled Icon parcel type. PT_TOWER_TEXT public static final int PT_TOWER_TEXT The IDM Tiled Text parcel type. PT_TEXT public static final int PT_TEXT The Text parcel type. PT_BINARY public static final int PT_BINARY The binary parcel type. PT_WORDPERFECT public static final int PT_WORDPERFECT The WordPerfect parcel type. PT_OCR public static final int PT_OCR The Optical Character Recognition parcel type. PT_MARKUPS_ANNOT public static final int PT_MARKUPS_ANNOT The Markups Annotation parcel type. 92 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs PT_MSWORD public static final int PT_MSWORD The MS Word parcel type. PT_EXCEL public static final int PT_EXCEL The MS Excel parcel type. PT_AMIPRO public static final int PT_AMIPRO The Lotus AmiPro parcel type. PT_DCF public static final int PT_DCF The Document Composition Facility parcel type. PT_JPEG public static final int PT_JPEG The Joint Photographic Experts Group Color parcel type. PT_TIFF public static final int PT_TIFF The Aldus Tagged Image File Format parcel type. PT_PDA public static final int PT_PDA The Process Document Architecture Format parcel type. PT_EPS public static final int PT_EPS The Adobe PostScript Format parcel type. PT_ANNOTATION public static final int PT_ANNOTATION The IDM Annotation parcel type. PT_MIME public static final int PT_MIME The Multipurpose Internet Mail Extensions parcel type. v20.1 rev 1 IDM Browser Client for Unix API Reference 93 Chapter 3 PT_AFP_INLINE_RESOURCE public static final int PT_AFP_INLINE_RESOURCE The IBM AFP Inline Resource parcel type. PT_AFP_COLDIMP_DOC public static final int PT_AFP_COLDIMP_DOC The IBM AFP Format Requiring Inline Resource parcel type. PT_AFP_DOC public static final int PT_AFP_DOC The IBM Advanced Function Presentation parcel type. Method details setUser(String) public void setUser( java.lang.String session) Sets the user from the session ID. Parameters: session - The session ID from the JSP page0. setAppName(String) public void setAppName( java.lang.String newValue) Sets the Application in which the IFNs are stored. Parameters: newValue - The application name. getAppName() public java.lang.String getAppName() Gets the name of the application in which IFNs are stored. Returns: String - The related IDM application name. setIfn(String) public void setIfn( java.lang.String newValue) Sets the ifn property. Parameters: newValue - The new ifn value. 94 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getIfn() public java.lang.String getIfn() Gets the IFN. Returns: String - The doument IFN. setCreatedIfn(String) public void setCreatedIfn( java.lang.String newValue) Sets the IFN of the document created by copying pages from a document. Parameters: newValue - The new ifn value. getCreatedIfn() public java.lang.String getCreatedIfn() Gets the IFN of the document created by copyPages(String, int, int, int, int). Returns: String - The created document IFN. getPoolDescription(int) public java.lang.String getPoolDescription( int poolInt) Gets the description of the pool integer value. Parameters: poolInt - The pool value. Returns: String - The description of the pool. isValidForExtractBlank(String, int) public boolean isValidForExtractBlank( java.lang.String ifn, int pageNum) Checks whether the specified page of the document is valid for performing extract or blank region operation. The user property must be set before calling this method. Parameters: ifn - The IFN of the document. pageNum - The page number of the document. Returns: boolean - Indicates whether a region on the page of the document can be extracted or blanked. v20.1 rev 1 IDM Browser Client for Unix API Reference 95 Chapter 3 isValidForExtractBlank(int) public boolean isValidForExtractBlank( int pclType) Checks whether the specified page of the document is valid for performing extract or blank region operation. The user property must be set before calling this method. Parameters: pclType - The parcel type of a document. Returns: boolean - Indicates whether a region on the document can be extracted or blanked. getDocDiskset(String) public int getDocDiskset( java.lang.String ifn) throws com.towertechnology.jsp.generic.TdpJbException Gets the diskset number of the document from its IFN. The user property must be set before calling this method. Parameters: ifn - The IFN of the document whose diskset value is to be retrieved. Returns: int - Diskset value of the document. getDocDiskset() public int getDocDiskset() throws com.towertechnology.jsp.generic.TdpJbException Gets the disket number of the document from its IFN. The user and ifn properties must be set before calling this method. Returns: int - The diskset value of the document. getParcelType(String, int) public int getParcelType( java.lang.String ifn, int pageNum) throws com.towertechnology.jsp.generic.TdpJbException Gets the parcel type of the document. The user property must be set before calling this method. Parameters: ifn - the IFN of the document whose parcel type is to be retrieved. pageNum - the page number of the document. Returns: int - The parcel type of the document. 96 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getParcelType(int) public int getParcelType( int pageNum) throws com.towertechnology.jsp.generic.TdpJbException Gets the parcel type of the document. The user and ifn properties must be set before calling this method. Parameters: pageNum - The page number of the document. Returns: int - The parcel type of the page in the document. getDocPool(String) public int getDocPool( java.lang.String ifn) throws com.towertechnology.jsp.generic.TdpJbException Gets the pool value of the document. The user property must be set before calling this method. Parameters: ifn - The name of the document whose pool value is to be retrieved. Returns: int - The pool value of the document. getDocPool() public int getDocPool() throws com.towertechnology.jsp.generic.TdpJbException Gets the pool value of the document. The user and ifn properties must be set before calling this method. Returns: int - The pool value of the document. changeDocPool(String, int) public void changeDocPool( java.lang.String ifn, int pool) throws com.towertechnology.jsp.generic.TdpJbException Moves the document to a specified pool. The user property must be set before calling this method. Parameters: ifn - The IFN of the document to be moved. pool - The destination pool of the document. v20.1 rev 1 IDM Browser Client for Unix API Reference 97 Chapter 3 changeDocPool(int) public void changeDocPool( int pool) throws com.towertechnology.jsp.generic.TdpJbException Moves the document to a specified pool. The user and ifn properties must be set before calling this method. Parameters: pool - The destination pool of the document. getAllPools() public int[] getAllPools() Gets integer pool values of all the pools defined on IDM Server. The user property must be set before calling this method. Returns: int[] - A list of pool IDs. deleteDocument(String) public void deleteDocument( java.lang.String ifn) throws com.towertechnology.jsp.generic.TdpJbException Deletes a document from IDM Server. The user property must be set before calling this method. Parameters: ifn - The IFN of the document to be deleted. deleteDocument() public void deleteDocument() throws com.towertechnology.jsp.tower.TdpJbException Deletes a document from IDM Server. The user and ifn properties must be set before calling this method. copyPages(String, int, int, int, int) public int copyPages( java.lang.String srcIfn, int startPage, int endPage, int dstDiskset, int dstPool) throws com.towertechnology.jsp.generic.TdpJbException Copies pages from a document to create a new document in the specified diskset and pool. The user property must be set before calling this method. Parameters: srcIfn - The IFN of the document to copy from. startPage - The page number of the source document to start the copy. endPage - The page number of the source document to end the copy. dstDiskset - The diskset number of the created document. 98 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs dstPool - The pool of the created document. Returns: The number of pages copied from the source document. copyPages(int, int, int, int) public int copyPages( int startPage, int endPage, int dstDiskset, int dstPool) throws com.towertechnology.jsp.generic.TdpJbException Copies pages from a document to create a new document in the specified diskset and pool. The user and ifn properties must be set before calling this method. Parameters: startPage - The page number of the source document to start the copy. endPage - The page number of the source document to end the copy. dstDiskset - The diskset number of the created document. dstPool - The pool of the created document. Returns: The number of pages copied from the source document. extractRegion(String, int, int, int, int, int, int, int) public java.lang.String extractRegion( java.lang.String srcIfn, int pg, int xoff, int yoff, int width, int length, int dstDiskset, int dstPool) throws com.towertechnology.jsp.generic.TdpJbException Extracts a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. The user property must be set before calling this method. Parameters: srcIfn - The string expression representing an image file number that contains the region to be extracted. pg - The 1-based page number of the image file that contains the region to be extracted. xoff - The X coordinate of the start of the extracted region in the specified page in the image file. yoff - The Y coordinate of the start of the extracted region in the specified page in the image file. width - The width of the extracted region in the specified page in the image file. length - The length of the extracted region in the specified page in the image file. dstDiskset - The diskset in which the extracted image region will be stored. dstPool - The pool in which the extracted image region will be stored. Returns: The IFN of the extracted image. v20.1 rev 1 IDM Browser Client for Unix API Reference 99 Chapter 3 extractRegion(int, int, int, int, int, int, int) public java.lang.String extractRegion( int pg, int xoff, int yoff, int width, int length, int dstDiskset, int dstPool) throws com.towertechnology.jsp.generic.TdpJbException Extracts a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. The user and ifn properties must be set before calling this method. Parameters: pg - The 1-based page number of the image file that contains the region to be extracted. xoff - The X coordinate of the start of the extracted region in the specified page in the image file. yoff - The Y coordinate of the start of the extracted region in the specified page in the image file. width - The width of the extracted region in the specified page in the image file. length - The length of the extracted region in the specified page in the image file. dstDiskset - The diskset in which the extracted image region will be stored. dstPool - The pool in which the extracted image region will be stored. Returns: The IFN of the extracted image. blankRegion(String, int, int, int, int, int, int, int) public java.lang.String blankRegion( java.lang.String srcIfn, int pg, int xoff, int yoff, int width, int length, int dstDiskset, int dstPool) throws com.towertechnology.jsp.generic.TdpJbException Blanks a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. The user property must be set before calling this method. Parameters: srcIfn - The string expression representing an image file number that contains the region to be blanked. pg - The 1-based page number of the image file that contains the region to be blanked. xoff - The X coordinate of the start of the blanked region in the specified page in the image file. yoff - The Y coordinate of the start of the blanked region in the specified page in the image file. width - The width of the blanked region in the specified page in the image file. 100 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs length - The length of the blanked region in the specified page in the image file. dstDiskset - The diskset in which the blanked image region will be stored. dstPool - The pool in which the blanked image region will be stored. Returns: The IFN of the blanked image. blankRegion(int, int, int, int, int, int, int) public java.lang.String blankRegion( int pg, int xoff, int yoff, int width, int length, int dstDiskset, int dstPool) throws com.towertechnology.jsp.generic.TdpJbException Blanks a specified region of a page in a given IFN and saves it as a new image in the specified pool and diskset. The user and ifn properties must be set before calling this method. Parameters: pg - The 1-based page number of the image file that contains the region to be blanked. xoff - The X coordinate of the start of the blanked region in the specified page in the image file. yoff - The Y coordinate of the start of the blanked region in the specified page in the image file. width - The width of the blanked region in the specified page in the image file. length - The length of the blanked region in the specified page in the image file. dstDiskset - The diskset in which the blanked image region will be stored. dstPool - The pool in which the blanked image region will be stored. Returns: The IFN of the blanked image. getDocDisk(String) public com.towertechnology.jsp.tower.Disk getDocDisk( java.lang.String ifn) throws com.towertechnology.jsp.generic.TdpJbException Gets the information of the optical disk that a document is stored on. The user property must be set before calling this method. Parameters: ifn - The IFN of the document. Returns: Disk - Which contains the disk information. v20.1 rev 1 IDM Browser Client for Unix API Reference 101 Chapter 3 getDocDisk() public com.towertechnology.jsp.tower.Disk getDocDisk() throws com.towertechnology.jsp.generic.TdpJbException Gets the information of the optical disk that a document is stored on. The user and ifn properties must be set before calling this method. Parameters: ifn - The IFN of the document. Returns: Disk - Which contains the disk information. 102 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower DocumentHistory public final class DocumentHistory The DocumentHistory contains information about a version of a document in its version history. Strings used as headings when display a history version public static final String DISPLAY_STATUS public static final String DISPLAY_VERSION public static final String DISPLAY_AUTHOR public static final String DISPLAY_CREATE_DATE public static final String DISPLAY_CREATE_TIME public static final String DISPLAY_COMMENT Member Summary Fields public string ifn IFN value of the document public int npages Total number of pages in the document public String docExt Document extension public String dmid Unique document management ID of the document public int versionNumber Version number of the document public int revisionNumber Revision number of the document public String author Author of the document public String createDate Date when this document was created public String createTime Time when this document was created v20.1 rev 1 IDM Browser Client for Unix API Reference 103 Chapter 3 Member Summary public DocumentStatus status Status of the document public String comment Comment made when this document was checked out Field details ifn public string ifn IFN value of the document npages public int npages Total number of pages in the document docExt public String docExt Document extension dmid public String dmid Unique document management ID of the document versionNumber public int versionNumber Version number of the document revisionNumber public int revisionNumber Revision number of the document author public String author Author of the document createDate public String createDate Date when this document was created 104 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs createTime public String createTime Time when this document was created status public DocumentStatus status Status of the document comment public String comment Comment made when this document was checked out v20.1 rev 1 IDM Browser Client for Unix API Reference 105 Chapter 3 com.towertechnology.jsp.tower DocumentManagement public class DocumentManagement extends IDMClient implements Traceable This class is used to perform document management actions on the IDM Server. Member Summary Public Methods public void public String public void setAppName(String newValue) Sets the appName property. This method sets the appName property of the JavaBean to indicate the IDM application being operated on. getAppName() Gets the appName property of the class which indicates the IDM application being operated on. setIfn(String newValue) Sets the ifn property. public String getIfn() Gets the ifn property of the class which indicates the document being operated on. public void public String setDmID(String newValue) getDmID() Gets the dmid property of the class. public void setCreatedIfn(String newValue) Sets the createdIfn property. The createdIfn is the IFN of the document created by checking in a new version of a document or publishing a document. public String getCreatedIfn() Gets the createdIfn property of the class. public String getExtension() Gets document extension property of the class. public int createDocument ( String filename, DocumentStatus status, String title ) throws TdpJbException Create a new document in the IDM repository 106 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Member Summary public String checkOutDocument ( String ifn, String comment ) throws TdpJbException Check out a document from the IDM repository public int checkInDocument ( String filename, String ifn, DocumentStatus status ) throws TdpJbException Check in a new version of a document into the IDM repository. public void cancelCheckOut(String ifn) throws TdpJbException Cancels the check out of a document public int publishDocument(String ifn) throws TdpJbException Publish a document public CheckOutDetails getCheckOutDetails(String ifn) throws TdpJbException Obtains information about a checked out document public DocumentHistory[] getDocumentHistory ( String dmid, String whereClause, String orderBy ) throws TdpJbException Retrieve the history of a document public String getDocumentHistoryListAsString ( String dmId, String where, String orderBy, String docFrameName, String docSrcFile, String contextPath, boolean useLoadDocument ) throws TdpJbException Retrieves the history list as a formatted HTML string. public boolean hasPermissionOnApplication ( DocumentManagementAction action ) throws TdpJbException Check if current user has the permission to perform the requested document management action on current application. v20.1 rev 1 IDM Browser Client for Unix API Reference 107 Chapter 3 Member Summary public boolean hasPermissionOnDocument ( DocumentManagementAction action, String ifn ) throws TdpJbException Check if current user has the required permission to perform the document management action on a particular document in the application. Public method details setAppName(String newValue) public void setAppName(String newValue) Sets the appName property. This method sets the appName property of the JavaBean to indicate the IDM application being operated on. Parameters: newValue - The application name. getAppName() public String getAppName() Gets the appName property of the class which indicates the IDM application being operated on. Returns: String - The related IDM application name. setIfn(String newValue) public void setIfn(String newValue) Sets the ifn property. Parameters: newValue - The IFN of the document. getIfn() public String getIfn() Gets the ifn property of the class which indicates the document being operated on. Returns: String - The related document IFN. 108 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs setDmID(String newValue) public void setDmID(String newValue) Sets the dmid property. Parameters: newValue - The unique document management ID of the document. All versions of the same document have the same value of dmid. getDmID() public String getDmID() Gets the dmid property of the class. Returns: String - The related document dmid. setCreatedIfn(String newValue) public void setCreatedIfn(String newValue) Sets the createdIfn property. The createdIfn is the IFN of the document created by checking in a new version of a document or publishing a document. Parameters: newValue - The IFN of a new version of a document created by checking a new version of a document or publishing a document. getCreatedIfn() public String getCreatedIfn() Gets the createdIfn property of the class. Returns: String - The IFN of a newly created document version. getExtension() public String getExtension() Gets document extension property of the class. Returns: String - The file extension of the document. createDocument public int createDocument ( String filename, DocumentStatus status, String title ) throws TdpJbException Create a new document in the IDM repository v20.1 rev 1 IDM Browser Client for Unix API Reference 109 Chapter 3 Parameters: filename - the path of the file in local file system to be uploaded to the IDM repository status - status of the document to be created and must be either DocumentStatus.DRAFT or DocumentStatus.IN_REVIEW title - database field names and values pairs to be used as title for the created document. It must be in the format of "fieldname = fieldvalue,..." Returns: int - total number of pages of the created document checkOutDocument public String checkOutDocument ( String ifn, String comment ) throws TdpJbException Check out a document from the IDM repository Parameters: ifn - the IFN of the document to be checked out comment - reason for checkout Returns: String - the path of the file on the web server that has the content of the checked out document checkInDocument public int checkInDocument ( String filename, String ifn, DocumentStatus status ) throws TdpJbException Check in a new version of a document into the IDM repository. Parameters: filename - the path of the file on the web server file system to be uploaded to the repository ifn - the IFN of the document status - status of checked in document and must be either DocumentStatus.DRAFT or DocumentStatus.IN_REVIEW. Returns: int - total number of pages of the new document version cancelCheckOut(String ifn) public void cancelCheckOut(String ifn) throws TdpJbException Cancels the check out of a document Parameters: ifn - the IFN of the document to be cancelled check out 110 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs publishDocument(String ifn) public int publishDocument(String ifn) throws TdpJbException Publish a document Parameters: ifn - the IFN of the document to be published Returns: int - total number of pages of the published document getCheckOutDetails(String ifn) public CheckOutDetails getCheckOutDetails(String ifn) throws TdpJbException Obtains information about a checked out document Parameters: ifn - the IFN of the checked out document Returns: CheckOutDetails - the checked out details getDocumentHistory public DocumentHistory[] getDocumentHistory ( String dmid, String whereClause, String orderBy ) throws TdpJbException Retrieve the history of a document Parameters: dmid - the unique document ID whereClause - the search criteria as a sql where clause orderby - the order by fields Returns: DocumentHistory[] - the document history getDocumentHistoryListAsString public String getDocumentHistoryListAsString ( String dmId, String where, String orderBy, String docFrameName, String docSrcFile, String contextPath, boolean useLoadDocument ) throws TdpJbException Retrieves the history list as a formatted HTML string. v20.1 rev 1 IDM Browser Client for Unix API Reference 111 Chapter 3 Parameters: dmId - the unique document ID whereClause - the search criteria as a sql where clause orderby - the order by fields docFrameName - the name of the frame where document is displayed docSrcFile - the name of the jsp file that displays the document content contextPath - the context path useLoadDocument - whether calling the loadDocument() java script function when a history entry is clicked Returns: String - the formatted history list as HTML string hasPermissionOnApplication public boolean hasPermissionOnApplication ( DocumentManagementAction action ) throws TdpJbException Check if current user has the permission to perform the requested document management action on current application. Parameters: action - the document management action to be performed by current user Returns: boolean - whether the user has the permission. hasPermissionOnDocument public boolean hasPermissionOnDocument ( DocumentManagementAction action, String ifn ) throws TdpJbException Check if current user has the required permission to perform the document management action on a particular document in the application. Parameters: action - the document management action to be performed by current user ifn - the IFN of the document Returns: boolean - whether the user has the permission. 112 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower DocumentManagementAction public final class DocumentManagementAction Defines document management actions that can be performed on a document. Member Summary Public Methods public int value() Get the integer value of the class public static DocumentManagementAction fromInt(int value) Get the DocumentManagementAction object from an integer value. This returns the DocumentManagementAction object which represents the same document management action by the given integer value. Actions represented by int values public static final int INT_CREATE public static final int INT_VIEW_HISTORY public static final int INT_CHECK_OUT public static final int INT_CHECK_IN public static final int INT_CANCEL_CHECKOUT public static final int INT_PUBLISH Actions represented by DocumentManagementAction objects public static final DocumentManagementAction CREATE public static final DocumentManagementAction VIEW_HISTORY public static final DocumentManagementAction CHECK_OUT public static final DocumentManagementAction CHECK_IN public static final DocumentManagementAction CANCEL_CHECKOUT public static final DocumentManagementAction PUBLISH v20.1 rev 1 IDM Browser Client for Unix API Reference 113 Chapter 3 Methods value() public int value() Get the integer value of the class Returns: int - the action value DocumentManagementAction public static DocumentManagementAction fromInt(int value) Get the DocumentManagementAction object from an integer value. This returns the DocumentManagementAction object which represents the same document management action by the given integer value. Parameters: value - the value of the action Returns: DocumentManagementAction - the action value as a DocumentManagementAction object 114 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower DocumentStatus public final class DocumentStatus Defines the document statuses that a document can have. Member Summary Public Methods public int value() Get the integer value of the document status. This returns the integer value which represents the same document status by this object. public String toString() Get the string representation of this status This returns the string that represents this status. public static DocumentStatus fromInt(int value) Get the DocumentStatus object from an integer value This returns the DocumentStatus object which represents the same document status by the given integer value. Status represented by int value public static final int INT_DRAFT public static final int INT_IN_REVIEW public static final int INT_PUBLISHED public static final int INT_OBSOLETE String used to display the corresponding status public static final String STR_DRAFT public static final String STR_IN_REVIEW public static final String STR_PUBLISHED public static final String STR_OBSOLETE Status represented by DocumentStatus object public static final DocumentStatus DRAFT public static final DocumentStatus IN_REVIEW public static final DocumentStatus PUBLISHED public static final DocumentStatus OBSOLETE v20.1 rev 1 IDM Browser Client for Unix API Reference 115 Chapter 3 Methods value() public int value() Get the integer value of the document status. This returns the integer value which represents the same document status by this object. Returns: int - the status value toString() public String toString() Get the string representation of this status This returns the string that represents this status. Returns: String - the status value as a String object fromInt(int value) public static DocumentStatus fromInt(int value) Get the DocumentStatus object from an integer value This returns the DocumentStatus object which represents the same document status by the given integer value. Parameters: value - the value of the status Returns: DocumentStatus - the status value as a DocumentStatus object 116 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower FileData java.lang.Object | +--com.towertechnology.jsp.tower.FileData public class FileData extends java.lang.Object This class is used to represent the content of a file. Member Summary Constructors FileData(String, byte[]) Methods byte[] java.lang.String getFileData() This method gets the content of the file as a byte array. getFileName() This method returns the name of the file. Constructor details FileData(String, byte[]) FileData(String fileName, byte[] fileData) Parameters: fileName - The full path of the file on the local machine, e.g., “C:\temp\example.gif”. fileData - The content of the file as a byte array. Method details getFileData() byte[] getFileData() Gets the content of the file as a byte array. v20.1 rev 1 IDM Browser Client for Unix API Reference 117 Chapter 3 getFileName() java.lang.String getFileName() Gets the name of the file. 118 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower HardCopy public class HardCopy This class allows users to send email, print, or fax jobs to IDM Server. Security checking will be applied to any HardCopy job. JSP pages can check the user’s permissions by calling the method getPermission(String) with input parameter ttuws_p_print for server print and ttuws_p_fax for server email and fax respectively. Example: <script language='javascript' type='text/javascript'> var printAllowed = titlelist.getPermission("ttuws_p_print"); var faxAllowed = titlelist.getPermission("ttuws_p_fax"); </script> where titlelist is a TitleList JavaBean defined previously. Another layer of security checking will be done in the CORBA objects level using the user’s credentials. For a print job, the method getPrintDeviceAsString() should be called to get all available print device information from IDM Server. Users can select from the list of available devices. The method setPrintDevice(String) must be called to select the proper server print device before sending a print job. Member Summary Methods void email(Object[], String, String, String, String, String) Sends an email job to IDM Server. void fax(Object[], Boolean, String, String, String, String, String) Sends a fax job to IDM Server. java.lang.String getAppName() Returns the appname property. java.lang.String getPrintDeviceAsString() Retrieves the HardCopy print device information as an HTML string. v20.1 rev 1 void print(Object[], Boolean) Sends a print job to IDM Server. void setAppName(String) Sets the appName property. void setPrintDevice(String) Sets the print device name and device number. void setUser(String) Sets the user property. IDM Browser Client for Unix API Reference 119 Chapter 3 Method details setUser(String) public void setUser( java.lang.String session) Sets the user property. Parameters: session - The session ID from the JSP. setAppName(String) public void setAppName( java.lang.String newValue) Sets the appName property. Parameters: newValue - The application name that the document belongs to. getAppName() public String getAppName() Retrieves the appName property of the class which indicates the IDM application being operated on. Returns: String - The related IDM application name. setPrintDevice(String) public void setPrintDevice( java.lang.String devicename) Sets the user-selected print device to which the hardcopy output will be directed. The string devicename is in the format of “device name, device number”; e.g., “printer1,1”. Parameters: devicename - The selected print device, in the format of “device name, device number”. getPrintDeviceAsString() public java.lang.String getPrintDeviceAsString() throws com.towertechnology.jsp.generic.TdpJbException This method generates the Hard Copy printer device information as an HTML string representing a drop-down list. A JSP page can provide this list for the user to select a printer device. The print device information is defined using IDM System Administration, in IDM Configuration Management under the Hardcopy folder. 120 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Example: The returned HTML string can be as follows: <OPTION <OPTION <OPTION <OPTION value value value value = = = = printerName, printerNumber>Printer Description printer1,1>Number 1 printer printer2,2>Number 2 printer printer3,3>Number 3 printer Returns: String - A formatted HTML string. print(Object[], Boolean) public void print( java.lang.Object[] ifnlist, java.lang.Boolean useBanner) throws com.towertechnology.jsp.generic.TdpJbException Sends a print job to IDM Server. The properties user and appname, and the selection of a print device, must be set before calling this method. The user should select one or more documents from the Title List before trying to submit a server print job. Parameters: ifnlist - The IFNs of all the documents to be printed. useBanner - Whether or not to output a banner for job separation. email(Object[], String, String, String, String, String) public void email( java.lang.Object[] ifnlist, java.lang.String emailTo, java.lang.String emailCc, java.lang.String emailReplyTo, java.lang.String emailSubject, java.lang.String emailBody) throws com.towertechnology.jsp.generic.TdpJbException Sends an email job to IDM Server. The properties user and appname must be set before calling this method. The JSP page should present an HTML form to the user, requesting required information for server emailing. The following illustration shows the form provided by IBCU JSP pages: v20.1 rev 1 IDM Browser Client for Unix API Reference 121 Chapter 3 Parameters: ifnlist - The IFNs of all the documents to be emailed. emailTo - The receiver's email address, use comma or space to separate multiple addresses. emailCc - The email address of the carbon copy, use comma or space to separate multiple addresses. emailReplyTo - The email address of the reply email. emailSubject - The subject of the email. emailBody - The content of the email. fax(Object[], Boolean, String, String, String, String, String) public void fax( java.lang.Object[] ifnlist, java.lang.Boolean useBanner, java.lang.String faxTo, java.lang.String faxCompany, java.lang.String faxFaxNum, java.lang.String faxFrom, java.lang.String faxSubject) throws com.towertechnology.jsp.generic.TdpJbException Sends a fax job to IDM Server. The properties user and appname must be set before calling this method. The JSP page should present an HTML form to the user, requesting required information for server faxing. Parameters: ifnlist - The IFNs of all the documents to be faxed. userBanner - Whether to use banner or not. faxTo - The receiver’s name. faxCompany - The receiver’s company name. 122 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs faxNum - Fax number. faxFrom - Sender name. faxSubject - Title of the fax. v20.1 rev 1 IDM Browser Client for Unix API Reference 123 Chapter 3 com.towertechnology.jsp.tower PropertiesHelper public class PropertiesHelper A helper class to generate an HTML string from properties. This class is a static class used to generate HTML strings from various properties in the properties file. Member Summary Methods static java.lang.String getOrbOptionsAsHTMLString() Builds a list of possible CORBA orbs from the properties in the IBCU properties file. Method details getOrbOptionsAsHTMLString() public static java.lang.String getOrbOptionsAsHTMLString() Builds a list of possible CORBA orbs from the properties in the IBCU properties file. This method will read in the properties from the resource locator and attempt to build the option list from it for use by the JSP pages. Returns: String - The formatted HTML string. 124 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower.search ResultInfo java.lang.Object | +--com.towertechnology.jsp.tower.search.ResultInfo public class ResultInfo extends java.lang.Object This class is used to store the search result. Member Summary Methods ResultRecord[] java.lang.String getRecords() Gets the array ResultRecord objects. getStatus() Gets the search status description, which can be one of Initialized, Scheduled, Running, or Stopped. boolean isResultComplete() Gets the completion status. boolean isSearchStopped() Gets the search status. Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Method details getRecords() public ResultRecord[] getRecords() Gets the array of ResultRecord objects. Returns: The array of result records. isResultComplete() public boolean isResultComplete() Gets the completion status. v20.1 rev 1 IDM Browser Client for Unix API Reference 125 Chapter 3 Returns: True, if the result is complete. isSearchStopped() public boolean isSearchStopped() Gets the search status. Returns: True, if the search is stopped. getStatus() public java.lang.String getStatus() Gets the search status description, which can be either Initialized, Scheduled, Running, or Stopped. Returns: The status description. 126 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower.search ResultRecord java.lang.Object | +--com.towertechnology.jsp.tower.search.ResultRecord public class ResultRecord extends java.lang.Object This class is used to store search result details related to a single document. Member Summary Fields static int PAGE_ERR_GENERAL static int PAGE_ERR_INVALIDTYPE static int PAGE_ERR_SUCCESS Methods int java.lang.String gerErrorCode() Gets the errorCode property. getDescription() Gets the description property. int getHits() Gets the hits property. int getPageNumber() Gets the pageNumber property. Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait v20.1 rev 1 IDM Browser Client for Unix API Reference 127 Chapter 3 Field details PAGE_ERR_SUCCESS public static final int PAGE_ERR_SUCCESS PAGE_ERR_GENERAL public static final int PAGE_ERR_GENERAL PAGE_ERR_INVALIDTYPE public static final int PAGE_ERR_INVALIDTYPE Method details getDescription() public java.lang.String getDescription() Gets the description property. Returns: The document description. getPageNumber() public int getPageNumber() Gets the pageNumber property. Returns: The page number. getHits() public int getHits() throws com.towertechnology.jsp.generic.TdpJbException Gets the hits property. The method throws an exception, if the searcher is unable to handle this document format. Returns: The number of hits. gerErrorCode() public int gerErrorCode() Gets the errorCode property. 128 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Returns: The error code. v20.1 rev 1 IDM Browser Client for Unix API Reference 129 Chapter 3 com.towertechnology.jsp.tower ServerExec public class ServerExec This class is used to run a program on the server. Member Summary Methods void serverExec(String, String) Requests the server to start a process on the server. void serverExec(String, String, boolean) Requests the server to start a process on the server. void setUser(String) Sets the user property from the session ID. Method details setUser(String) public void setUser( java.lang.String session) Sets the user property from the session ID. Parameters: session - The session ID from the JSP. serverExec(String, String) public void serverExec( java.lang.String processName, java.lang.String processArgs) throws com.towertechnology.jsp.tower.TdpJbException Requests the server to start a process on the server. An entry for this process must exist in the file $CTL_RUNTIME_DIR/is/admin/HANDLERS or the file $CTL_RUNTIME_DIR/is/ config/HANDLERS. Parameters: process - The name of the process. processArgs - The command line arguments with which to start the process. There arguments are appended to those specified in the HANDLERS file. 130 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs serverExec(String, String, boolean) public void serverExec( java.lang.String processName, java.lang.String processArgs, boolean opt) throws com.towertechnology.jsp.tower.TdpJbException Requests the server to start a process on the server. An entry for this process must exist in the file $CTL_RUNTIME_DIR/is/admin/HANDLERS or the file $CTL_RUNTIME_DIR/is/ config/HANDLERS. Parameters: process - The name of the process. processArgs - The command line arguments with which to start the process. There arguments are appended to those specified in the HANDLERS file. opt - Reserved. v20.1 rev 1 IDM Browser Client for Unix API Reference 131 Chapter 3 com.towertechnology.jsp.tower Template java.lang.Object | +--com.towertechnology.jsp.tower.Template public class Template extends java.lang.Object This class is used to maintain the IDM template. Member Summary Fields TemplateField fields An array of the IDM TemplateField object(s). Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Field details fields public TemplateField[] fields An array of the IDM TemplateField object(s). 132 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower TemplateField java.lang.Object | +--com.towertechnology.jsp.tower.TemplateField public class TemplateField extends java.lang.Object This class is used to represent an IDM template field. Member Summary Fields static int int CHECK_BOX Possible value for entryType meaning the field is a check box. col The column position for the field to display. int static int java.lang.String dataType The SQL data type that the field represents. DATE_PICKER Possible value for entryType meaning the field is a date picker. defaultVal The default value of this field. static int DOCTYPE_TO_SLEVEL Possible value for entryType meaning the field is document type to slevel. static int DROPDOWN_COMBO Possible value for entryType meaning the field is a drop down combo box. static int DROPDOWN_LIST Possible value for entryType meaning the field is a drop down list. int entryType The entry type of this field. java.lang.String fieldData The string data to be displayed. int fieldLength The field’s length in characters. java.lang.String fieldName The column name of the field in the Database table. int fieldType The I/O type of the field. Possible values are TYPE_DISPLAY or TYPE_INPUT. int row The row position for the field to display. static int v20.1 rev 1 STD_EDIT_BOX Possible value for entryType meaning the field is a standard text input field. IDM Browser Client for Unix API Reference 133 Chapter 3 Member Summary static int TYPE_DISPLAY Possible value for fieldType meaning the field is used for display. static int TYPE_INPUT Possible value for fieldType meaning the field is used for capturing input. java.lang.String validFn Identifies the customer-defined validation function. java.lang.String valueList A list of values for a drop down field; values are separated by forward slash character ‘/’. Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Field details entryType public int entryType The display type of the field. Possible values are STD_EDIT_BOX, DROPDOWN_COMBO, DROPDOWN_LIST, CHECK_BOX, DATE_PICKER, or DOCTYPE_TO_SLEVEL. STD_EDIT_BOX public static final int STD_EDIT_BOX The field should be a standard text input box. DROPDOWN_COMBO public static final int DROPDOWN_COMBO The field should be a drop down combo box. DROPDOWN_LIST public static final int DROPDOWN_LIST The field should be a drop down list box. CHECK_BOX public static final int CHECK_BOX The field should be a check box. 134 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs DATE_PICKER public static final int DATE_PICKER The field should be a date picker. DOCTYPE_TO_SLEVEL public static final int DOCTYPE_TO_SLEVEL The field should be a “document type to slevel” field. fieldType public int fieldType The I/O type of the field. Possible values are TYPE_DISPLAY or TYPE_INPUT. TYPE_DISPLAY public static final int TYPE_DISPLAY Indicates that the field is used for display. TYPE_INPUT public static final int TYPE_INPUT Indicates the field is used for capturing input. row public int row The row position where the field is to be displayed. col public int col The column position where the field is to be displayed. dataType public int dataType The SQL data type the field represents. For details, see TowerHelper. fieldLength public int fieldLength The length in characters that the field occupies. fieldName public String fieldName The corresponding column name in the database table. v20.1 rev 1 IDM Browser Client for Unix API Reference 135 Chapter 3 fieldData public String fieldData The string data that used for displaying purpose. Valid only when fieldType is TYPE_DISPLAY. valueList public String valueList A list of values for a drop down field (entryType is DROPDOWN_COMBO or DROPDOWN_LIST); values are separated by forward slash character ‘/’. defaultVal public String defaultVal The string that appears in the field when the template is first displayed; this will be used if the user does not enter a different value. validFn public String validFn This field represents the customer-defined validation function, in the format <module>:<functionName>, where <module> is the name of the JavaScript file where the function is defined and <functionName> is the name of the function. 136 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower TitleList com.towertechnology.jsp.tower.AppList | +--com.towertechnology.jsp.tower.TitleList public class TitleList extends AppList This class is used to build the Result List form, update a Title, and delete Titles. The user must have selected an Application and submitted the subsequent QBE form before getting the Title List. The QBE form should be validated before it is submitted to the web server. SQL_NUMERIC, SQL_DATE, and SQL_TIMESTAMP fields should be validated. The current implementation to retrieve the Result List is as follows: 1. The JSP page provides: • the unique session ID of the user’s session. This is used to set the user property. • the Application name. This is used to set the app property. The Application name is the value of the option that the user chose from the Application list. See class AppList for more details. • the where clause. This is used to set the where property. The where clause is constructed from the user-submitted QBE form. It must follow a certain format. Assume that the total number of fields on the QBE form is n, and the data types of the first and the last fields are not SQL_VARCHAR. The data type of field i is SQL_VARCHAR and its selected operator is is null. The data type of field j is also SQL_VARCHAR and its selected operator is is not null. The format of the String will be as follows: field[1].name field[1].operand 'field[1].value' AND ... AND field[i].name is null AND ... AND field[j].name is not null AND ... AND field[n].name field[n].operand 'field[n].value' • a boolean value to set the maximum property. This is an optional value. The default value of property maximum is false. This property specifies whether the document display frame will be maximized when the user selects a document from the Title List. For the IBCU JSP pages, the layout is hard-coded and this is only a configurable parameter. 2. The JSP calls one of the following methods to get the Title List form. getTitleListAsString( java.lang.String maxDocFrameName, java.lang.String maxDocSrcFile, java.lang.String docFrameName, java.lang.String docSrcFile, boolean changeImageIcon) getTitleListAsString( java.lang.String java.lang.String java.lang.String java.lang.String maxDocFrameName, maxDocSrcFile, docFrameName, docSrcFile) public String getTitleListAsString( String maxDocFrameName, v20.1 rev 1 IDM Browser Client for Unix API Reference 137 Chapter 3 String maxDocSrcFile, String docFrameName, String docSrcFile, String contextPath, boolean changeImageIcon) throws TdpJbException The contextPath parameter specifies the context path of the Web Server application, e.g., /tower, /tao getTitleListAsObject() Assume that there are n columns and m+1 rows in the Title List. The first function getTitleListAsString() is called with parameter changeImageIcon being true, or the second function is called. The returned formatted HTML string will be as follows: <TABLE bgcolor='#f0f0f0' cellspacing='0' cellpadding='1' border='0' width='100%'> <TR bgcolor='#3c64ac'> <TD width='1%' nowrap> <FONT size='-2' color='#ffffff'> </FONT> </TD> <TD width='1%' nowrap> <FONT size='-2' color='#ffffff'> </FONT> </TD> <TD nowrap> <FONT size='-1' color='#ffffff'><STRONG> Column 1 Heading </STRONG></FONT> </TD> <TD nowrap> <FONT size='-1' color='#ffffff'><STRONG> Column 2 Heading </STRONG></FONT> </TD> ... <TD nowrap> <FONT size='-1' color='#ffffff'><STRONG> Column n Heading </STRONG></FONT> </TD> </TR> <TR bgcolor='#f0f0f0'> <TD colspan=25 valign='middle' align='left'> <FONT size='-2' color='#000000' family='helvetica,verdana'><STRONG> totalDocuments documents found. </STRONG></FONT> </TD> </TR> <TR bgcolor='#f0f0f0'> <TD width='1%' valign='middle' align='left'> <INPUT type='checkbox' name='checkSelect' value='Row(0)_IFN'> </TD> <TD width='1%' valign='middle' align='left'> <A target=targetDocFrameName href=targetDocSrcFileName?ifn=Row(0)_IFN&npages=Row(0)_nPages&appname=App Name' onclick="setActiveDocIcon('tlst0')" onmouseover="document.images['tlst0'].src='images/dociconover.gif'" onmouseout="if (curActiveDocIcon != 'tlst0') document.images['tlst0'].src='images/dociconup.gif'" <img border='0' width='12' height='14' name='tlst0' src='images/dociconup.gif' alt=''></ 138 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs A> </TD> <TD width='30%'> <FONT size='-1' color='#000000'> Row(0) Column 1 data </FONT> </TD> ... <TD width='30%'> <FONT size='-1' color='#000000'> Row(0) Column n data </FONT> </TD> </TR> ... <TR bgcolor='#b4ccfc'> <TD width='1%' valign='middle' align='left'> <INPUT type='checkbox' name='checkSelect' value='Row(m)_IFN'> </TD> <TD width='1%' valign='middle' align='left'> <A target=targetDocFrameName href=targetDocSrcFileName?ifn=Row(m)_IFN&npages=Row(m)_nPages&appname=App Name' onclick="setActiveDocIcon('tlstm')" onmouseover="document.images['tlstm'].src='images/dociconover.gif'" onmouseout="if (curActiveDocIcon != 'tlstm') document.images['tlstm'].src='images/dociconup.gif'" <img border='0' width='12' height='14' name='tlstm' src='images/dociconup.gif' alt=''></ A> </TD> <TD width='30%'> <FONT size='-1' color='#000000'> Row(m) Column 1 data </FONT> </TD> ... <TD width='30%'> <FONT size='-1' color='#000000'> Row(m) Column n data </FONT> </TD> </TR> </TABLE> If the maximum property is set to true, then set targetDocFrameName and targetDocSrcFileName equal to maxDocFrameName and maxDocSrcFile respectively; otherwise, set them to docFrameName and docSrcFile respectively. If the first function is called with parameter changeImageIcon being false, then for each HTML element A in the above string, the attributes onclick, onmouseover, and onmouseout will not be set. Please note that the background color for each row depends on the row number. The bgcolor attribute of the TR element for row i will be #b4ccfc if the row number i is even; otherwise, it will be #f0f0f0. In the above returned string, we assume that m is not even. To use the method getTitleListAsObject(), the following sample code can be added into the JSP page. Example: <%@ page language="java" import="com.towertechnology.jsp.tower.TowerHelper, com.towertechnology.jsp.tower.TitleList.TitleListData" session='true' v20.1 rev 1 IDM Browser Client for Unix API Reference 139 3 Chapter errorPage='ttuwserror.jsp' %> ... <jsp:useBean id='titleList' class='com.towertechnology.jsp.tower.TitleList' /> <jsp:setProperty name='titleList' property='user' value='<%= session.getId() %>'/> <jsp:setProperty name='titleList' property='app' value='<%= appname %>'/> <jsp:setProperty name='titleList' property='where' value='<%= where %>'/> ... <% TitleListData titlelist = null; try { titlelist = titleList.getTitleListAsObject(); } catch(com.towertechnology.jsp.generic.TdpJbException tje) { // Error handling ... } %> <% if(titlelist != null) { // construct the html string from TitleListData object String href = "target='getdocbot' href='ttuwsdocbot_test.jsp"; %> <TABLE bgcolor='#f0f0f0' cellspacing='0' cellpadding='1' border='0' width='100%' <TR bgcolor='#3c64ac' <TD bgcolor='#3c64ac' width='1%' nowrap><FONT size='-2' color='#ffffff'> </ FONT></TD> <TD bgcolor='#3c64ac' width='1%' nowrap><FONT size='-2' color='#ffffff'> </ FONT></TD> <% for(int i = 0; i < titlelist.headingInfo.length; ++i) { out.println("<TD bgcolor='#3c64ac' nowrap><FONT size='-1' color='#ffffff'><STRONG>" + titlelist.headingInfo[i].fieldData + "</STRONG></ FONT></TD>\n"); } %> </TR> <TR bgcolor='#f0f0f0'> <% out.println( "<TD colspan=" + (titlelist.headingInfo.length + 2) + " valign='middle' align='left'>"); out.println("<FONT size='-2' color='#000000' family='helvetica,verdana'><STRONG>" + titlelist.rows.length + " documents found.</STRONG></FONT>"); out.println("</TD>"); out.println("</TR>\n"); for(int i = 0; i < titlelist.rows.length; ++i) { if(i % 2 == 0) { out.println("<TR bgcolor='#f0f0f0'>\n"); } else { 140 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs out.println("<TR bgcolor='#b4ccfc'>\n"); } out.println("<TD width='1%' valign='middle' align='left'>"); out.println("<INPUT type='checkbox' name='checkSelect' value='" + titlelist.rows[i].IFN + "'>"); out.println("</TD>\n"); out.println("<TD width='1%' valign='middle' align='left'>"); out.println("<A " + href + "?ifn=" + titlelist.rows[i].IFN + "&npages=" + titlelist.rows[i].nPages + "&appname="+ session.getAttribute("applist") + "' onclick=\"setActiveDocIcon(\'tlst" + i + "\')\" onmouseover=\"document.images[\'tlst" + i + "\'].src=\'images/ dociconover.gif\'\" onmouseout=\"if (curActiveDocIcon != \'tlst" + i + "\') document.images[\'tlst" + i + "\'].src=\'images/dociconup.gif\'\"><img border='0' width='12' height='14' name='tlst" + i + "' src='images/ dociconup.gif' alt=''></A>"); out.println("</TD>\n"); for(int j = 0; j < titlelist.rows[i].rowData.length; ++j) { out.println( "<TD> <FONT size='-1' color='#000000'>" + titlelist.rows[i].rowData[j] + "</FONT></TD>\n"); } out.println("</TR>\n"); } out.println("</TABLE>\n"); } %> 3. The JSP page calls one of the following methods to get the Title details. getTitleAsString( java.lang.String maxDocFrameName, java.lang.String maxDocSrcFile, java.lang.String docFrameName, java.lang.String docSrcFile, boolean changeImageIcon) getTitleAsObject() Users can view or modify a Title on the page. 4. The JSP page uses method updateTitle(java.lang.String, java.lang.String) to update a title to IDM Server. 5. The JSP page uses method deleteTitles(java.lang.String[]) to delete one or more titles from IDM Server. Member Summary Methods void java.lang.String com.towertechnology.jsp .tower.Template java.lang.String v20.1 rev 1 deleteTitles(String[]) Deletes the Titles from IDM Server. getOrderBy() Retrieves the order by clause. getTitleAsObject(String) Gets the Title as an object of class Template. getTitleAsString(String) Gets the Title as a formatted HTML string. IDM Browser Client for Unix API Reference 141 Chapter 3 Member Summary java.lang.String TitleList.TitleListData getTitleAsString(String, String) Builds the title form as an HTML string within the context of a form. getTitleListAsObject() Generates the Title List as an object of class TitleListData. java.lang.String getTitleListAsString(String, String, String, String, String, boolean, boolean) Generates the Title List as a formatted HTML string. java.lang.String getTitleListAsString(String, String, String, String, boolean) Generates the Title List as a formatted HTML string. java.lang.String getTitleListAsString(String, String, String, String) Generates the Title List as a formatted HTML string. java.lang.String getTitleListAsString(String) Generates the Title List as a formatted HTML string. void setOrderBy(String) Sets the search property in the form of a SQL order by clause used to retrieve the appropriate title list. void setMaximum(boolean) Sets the maximum property. void setWhere(String) Sets the where property. void updateTitle(String, String) Updates a Title to IDM Server. Methods inherited from class com.towertechnology.jsp.tower.AppList getAppListAsString(), getIndex(), getPermission(String), getQBE(), insertIndex(String), setApp(String), setUser(String) Method details setOrderBy(String) public void setOrderBy(String orderBy) Sets the search property in the form of a SQL order by clause used to retrieve the appropriate title list. Example: Modify file TdpJspTitlelist.jsp: <jsp:setProperty name='titleList' property='where' value='<%= where %>'/> <jsp:setProperty name='titleList' property='orderBy' value='FN'/> 142 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getOrderBy() public String getOrderBy() Retrieves the order by clause. setWhere(String) public void setWhere( java.lang.String whereClause) Sets the where property. The TitleList class will use this property as search criteria in a SQL search statement to retrieve the appropriate Title List. The input parameter must follow the SQL search criteria syntax. Parameters whereClause - The search criteria. setMaximum(boolean) public void setMaximum( boolean max) Sets the maximum property. Parameters max - Whether to maximize the document display frame. getTitleListAsString(String, String, String, String, String, boolean, boolean) public java.lang.String getTitleListAsString( java.lang.String maxDocFrameName, java.lang.String maxDocSrcFile, java.lang.String docFrameName, java.lang.String docSrcFile, java.lang.String contextPath, boolean changeImageIcon, boolean useLoadDocument) throws com.towertechnology.jsp.generic.TdpJbException Generates the Title List as a formatted HTML string. The properties user, app, and where must be set before calling this method. If the sixth parameter is true, the java script file ttuwstitlelist.js must be included in the JSP page where this method is called. This method will attempt to connect to the CORBA object using the User credentials, and attempt to retrieve the titlelist based on the search criteria. Parameters: maxDocFrameName - The frame name of maximized document display frame. maxDocSrcFile - The JSP file name of maximized document diplay frame. docFrameName - The frame name of normal document display frame. docSrcFile - The JSP file name of normal document display frame. contextPath - The context path. changeImageIcon - Whether the image icon for each title in the title list will be changed when the mouse moves on, moves off, or clicks on the image icon. useLoadDocument - If true, the JavaScript function loadDocument() is called on the click event, otherwise setActiveDoc() function is called. v20.1 rev 1 IDM Browser Client for Unix API Reference 143 Chapter 3 Returns: String - The formatted HTML string representing the Title List. getTitleListAsString(String, String, String, String, boolean) public java.lang.String getTitleListAsString( java.lang.String maxDocFrameName, java.lang.String maxDocSrcFile, java.lang.String docFrameName, java.lang.String docSrcFile, boolean changeImageIcon) throws com.towertechnology.jsp.generic.TdpJbException Generates the Title List as a formatted HTML string. The properties user, app, and where must be set before calling this method. If the fifth parameter is true, the java script file ttuwstitlelist.js must be included in the JSP page where this method is called. This method will attempt to retrieve the Title List from IDM Server based on the search criteria. Parameters: maxDocFrameName - The frame name of maximized document display frame. maxDocSrcFile - The JSP file name of maximized document diplay frame. docFrameName - The frame name of normal document display frame. docSrcFile - The JSP file name of normal document display frame. changeImageIcon - Whether the image icon for each title in the title list will be changed when the mouse moves on, moves off, or clicks on the image icon. Returns: String - The formatted HTML string representing the Title List. getTitleListAsString(String, String, String, String) public java.lang.String getTitleListAsString( java.lang.String maxDocFrameName, java.lang.String maxDocSrcFile, java.lang.String docFrameName, java.lang.String docSrcFile) throws com.towertechnology.jsp.generic.TdpJbException Generates the Title List as a formatted HTML string. Calling this method is the same as calling getTitleListAsString(String, String, String, String, boolean) with the parameters (maxDocFrameName, maxDocSrcFile, docFrameName, docSrcFile, true). The properties user, app, and where must be set before calling this method. The java script file ttuwstitlelist.js must be included in the JSP page where this method is called. Parameters: maxDocFrameName - The frame name of maximized document display frame. maxDocSrcFile - The JSP file name of maximized document display frame. docFrameName - The frame name of normal document display frame. docSrcFile - The JSP file name of normal document display frame. Returns: String - The formatted HTML string representing the Title List. 144 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getTitleListAsString(String) public java.lang.String getTitleListAsString( java.lang.String docDisplayFile) throws com.towertechnology.jsp.generic.TdpJbException Generates the Title List as a formatted HTML string. The properties user, app, and where must be set before calling this method. The java script file ttuwstitlelist.js must be included in the JSP page where this method is called. Parameters: docDisplayFile - The name of the JSP file for displaying documents. Returns String - The formatted HTML string representing the Title List. getTitleListAsObject() public TitleList.TitleListData() getTitleListAsObject() throws com.towertechnology.jsp.generic.TdpJbException Generates the Title List as an object of class TitleListData. Returns: TitleListData - The TitleListData object. getTitleAsString(String) public java.lang.String getTitleAsString( java.lang.String uniqueId) throws com.towertechnology.jsp.generic.TdpJbException Gets the Title form as a formatted HTML string. The properties user and app must be set before calling this method. It is intended for use in title addition or modification. Therefore, this function must be executed with appropriate permission to add/modify. For searching and displaying a title list, getTitleListAsString is recommended; this requires no additional permission. This method will attempt to retrieve the Title details from IDM Server based on the unique ID. It is expected that the HTML form tag has been previously defined by the calling JSP page. Parameters: uniqueId - The unique ID of the requested title. Returns: String - The formatted HTML string. getTitleAsString(String, String) public String getTitleAsString( String uniqueId, String onchangeHandler) throws com.towertechnology.jsp.generic.TdpJbException Builds the title form as an HTML string within the context of a form. Connects (using the user credentials) to the CORBA objects to build the title form. This method is intended for use in title addition or modification. Therefore, this function must v20.1 rev 1 IDM Browser Client for Unix API Reference 145 Chapter 3 be executed with appropriate permission to add/modify. For searching and displaying a title list, getTitleListAsString is recommended; this requires no additional permission. The form tag is assumed to have been previously defined by the calling JSP. Parameters: uniqueId - The ID of the requested title. onchangeHandler - The handler of the onchange event for input text fields and select fields. Returns: String - The formatted HTML string. Example: If the second input parameter is checkValue, then the returned HTML string might contained the following string: <INPUT type='text' size='10' maxlength='10' name='field_ifstr:12' id='4' onchange='checkValue(4)' value='o'> getTitleAsObject(String) public com.towertechnology.jsp.tower.Template getTitleAsObject( java.lang.String uniqueId) throws com.towertechnology.jsp.generic.TdpJbException Gets the Title as an object of class Template(TemplateField[]). The properties user and app must be set before calling this method. It is intended for use in title addition or modification. Therefore, this function must be executed with appropriate permission to add/modify. For searching and displaying a title list, getTitleListAsObject is recommended; this requires no additional permission. This method will attempt to retrieve the Title details from IDM Server based on the unique ID. This method can be used to write customized JSP pages to display Title details. Parameters: uniqueId - The unique ID of the requested title. Returns: Template - the Template object updateTitle(String, String) public void updateTitle( java.lang.String valuesClause, java.lang.String uniqueId) throws com.towertechnology.jsp.generic.TdpJbException Updates a title to its associated application in IDM Server. The properties user and app must be set before calling this method. The first parameter will form the value clause in the SQL statement for updating a record in a database. It must be in the form fieldName=fieldValue, ... Parameters: valuesClause - The update values for the title. uniqueId - The unique ID of the title. 146 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs deleteTitles(String[]) public void deleteTitles( java.lang.String[] uniqueIds) throws com.towertechnology.jsp.generic.TdpJbException Deletes titles from IDM Server. The properties user and app must be set before calling this method. This method will delete the titles with the unique IDs from their associated Application in IDM Server. Parameters: uniqueIds - A list of unique IDs of the titles to be deleted. v20.1 rev 1 IDM Browser Client for Unix API Reference 147 Chapter 3 com.towertechnology.jsp.tower TitleList.TableRow public class TitleList.TableRow This class is used to represent both the abstract key data and the row data in an IDM application table. Member Summary Fields java.lang.String IFN The IFN associated with this row. int nPages Number of pages in the associated IFN, if there is an npages field in the Application. java.lang.String overlay Default overlay of the associated document, if there is an overlay field in the Application. int pageNumber Default page number of this IFN, if there is a pagenum field in the Application. int slevel Security level of this IFN, if there is an slevel field in the Application. java.lang.String[] java.lang.String int rowData Sequence of the retrieved row data. thumbnailIFN Thumbnail IFN of the associated document. uniqueID Unique ID for a row in an IDM application table. Field details uniqueID public int uniqueID Unique ID for a row in an IDM application table. IFN public java.lang.String IFN The IFN associated with this row. 148 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs nPages public int nPages Number of pages of the associated IFN, if there is an npages field in the application. pageNumber public int pageNumber Default page number of this IFN, if there is a pagenum field. overlay public java.lang.String overlay Default overlay of the associated document, if there is an overlay field in the application. slevel public int slevel Security level of this IFN, if there is an slevel field in the application. thumbnailIFN public java.lang.String thumbnailIFN Thumbnail IFN of the associated document. rowData public java.lang.String[] rowData The retrieved row data. v20.1 rev 1 IDM Browser Client for Unix API Reference 149 Chapter 3 com.towertechnology.jsp.tower TitleList.TableTemplateEntry public class TitleList.TableTemplateEntry This class is used to represent IDM application Template information. Member Summary Fields short col Column position of the field. short java.lang.String conv Conversion function. fieldData Data of this field (display string for an output field). short fieldNumber Ordinal field number within the specific application table. short fieldType Data type that this field represents. short ioType Input/output type of this field (0 = Input, 1 = output). short len Width of this field. java.lang.String pic Type of characters that may be entered in the field. short row Line position of the field. Field details fieldNumber public short fieldNumber Ordinal field number within the specific application table. fieldType public short fieldType Data type that this field represents. 150 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs fieldData public java.lang.String fieldData Data of this field. It is the actual display string for an output field. row public short row Line position of the field on screen. col public short col Column position of the field on screen. len public short len Width of this field. ioType public short ioType Input/output type of this field. 0 represents an input field and 1 an output field. pic public java.lang.String pic Defines the type of characters that may be entered in the field, by character position: ? if an alphabetic character must be entered; 9 if numeric; X if alphanumeric; or the actual character if a specific character must be entered. Example: “??-999-XX” requires two alphabetic characters, a hyphen, three digits, another hyphen, then two alphanumeric characters. conv public short conv This field value should always be 0 in the Title List template. It is used for input fields in some other IDM templates. v20.1 rev 1 IDM Browser Client for Unix API Reference 151 Chapter 3 com.towertechnology.jsp.tower TitleList.TitleListData public class TitleList.TitleListData This class is used to represent the heading template information, the data template information, and the information corresponding to all the titles for a given application table. The information is structured according to the document retrieval security schema, the criteria that the where clause specified, and the maximum number of rows that one search invocation may return. Member Summary Fields TitleList.TableTemplateEntry() headingInfo Column headings information. TitleList.TableTemplateEntry() rowDisplayInfo Row data display information. TitleList.TableRow() rows Title data. Field details headingInfo public TitleList.TableTemplateEntry[] headingInfo Column heading information. rowDisplayInfo public TitleList.TableTemplateEntry[] rowDisplayInfo Row data display information. rows public TitleList.TableRow[] rows Title data. 152 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower TowerHelper public class TowerHelper This class maps the IDM database constant variables to Java. This is a static class and all its public methods are static. Member Summary Fields static int SQL_CHAR static int SQL_DATE static int SQL_DECIMAL static int SQL_DOUBLE static int SQL_FLOAT static int SQL_INTEGER static int SQL_NUMERIC static int SQL_REAL static int SQL_SMALLINT static int SQL_TIME static int SQL_TIMESTAMP static int SQL_VARCHAR Methods static java.lang.String getJDBCDataType(int) Converts the IDM data type to JDBC data type. static java.lang.String getTowerDataType(int) Converts the IDM data type to a String. v20.1 rev 1 IDM Browser Client for Unix API Reference 153 Chapter 3 Field details SQL_CHAR public static final int SQL_CHAR SQL_NUMERIC public static final int SQL_NUMERIC SQL_DECIMAL public static final int SQL_DECIMAL SQL_INTEGER public static final int SQL_INTEGER SQL_SMALLINT public static final int SQL_SMALLINT SQL_FLOAT public static final int SQL_FLOAT SQL_REAL public static final int SQL_REAL SQL_DOUBLE public static final int SQL_DOUBLE SQL_VARCHAR public static final int SQL_VARCHAR SQL_DATE public static final int SQL_DATE SQL_TIME public static final int SQL_TIME SQL_TIMESTAMP public static final int SQL_TIMESTAMP 154 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Method details getTowerDataType(int) public static java.lang.String getTowerDataType( int type) Converts the IDM data type to a String. Parameters: type - The IDM data type. The allowable values are as listed above (SQL_*). Returns: String - The String representation of the IDM data type. getJDBCDataType(int) public static java.lang.String getJDBCDataType( int type) Converts the JDBC data type to a String. Parameters: type - The JDBC data type. The allowable values are as defined in java.sql.Types. Returns: String - The String represenation of the JDBC data type. v20.1 rev 1 IDM Browser Client for Unix API Reference 155 Chapter 3 com.towertechnology.jsp.tower TowerLogger public class TowerLogger Provides support for custom data to be logged to a custom file (located in IDM Server). Public methods only are listed here. Member Summary Methods public void java.lang.String setUser() This method sets the user proprty from the session. log() This method logs a message. Method Detail setUser() public void setUser(String session) Sets the user property from the session. log() public void log(String filePath, boolean createFile, String message) throws TdpJbException Logs a message to a file on IDM server. Set the user property by calling setUser() before calling this method. Parameters: filePath - The file path. If filepath starts with ‘/’, then it is regarded as an absolute path; otherwise, it is relative to $CTL_RUNTIME/is/log. createFile - The file creation flag (if true, create file if it does not exist). It does not create nonexistent subdirectories specified in the path. message - The message to log. 156 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.tower.search Description This package contains classes supporting the Search text function. Class summary StringSearch v20.1 rev 1 This class is responsible for searching a string in a specified list of documents. IDM Browser Client for Unix API Reference 157 3 Chapter com.towertechnology.jsp.tower.search StringSearch java.lang.Object | +--com.towertechnology.jsp.generic.ORBClient | +--com.towertechnology.jsp.tower.search.StringSearch public class StringSearch extends com.towertechnology.jsp.generic.ORBClient implements com.towertechnology.jsp.util.Traceable The StringSearch class is responsible for searching a string in a specified list of documents. The JSP client provides: • unique session ID of the user (use this ID to set the user attribute). • application name (set the appName attribute) • search details: • the string to search (it should not be blank) • the Whole Word option (default is false) • the Case Ignore option (default is false) • the At End Line option (default is false) • the At Start Line option (default is false) • the Has Wild Cards option (default is false) • maximum hits per page (default is 1) • maximum hits per doc (default is 0, which means no limit) • maximum hits per search (default is 0) • items to search To start a search, the JSP client calls the find() method, and then makes consecutive calls to the getLatestResult() method to retrieve the list of hits/errors per search item. It can also call the stop() method to stop the string search. All implemented interfaces: com.towertechnology.jsp.util.Traceable Member Summary Methods void addSearchItem(String, int, int, int, int) Adds a document to search. void addSearchItem(String, String, int, int) Adds a document to search. java.lang.String 158 find(boolean) Starts string search. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs Member Summary java.lang.String ResultInfo getAppName() Returns the appname property of the Bean. getResult(String) Returns the search result. void setAppName(String) Sets the appName property of the bean. void setAtEndLine(boolean) Sets the atEndLine property. void setAtStartLine(boolean) Sets the atStartLine property. void setHasWildCards(boolean) Sets the hasWildCards property. void setIgnoreCase(boolean) Sets the ignoreCase property. void setMaxPageHitsPerDoc(int) Sets the setMaxPageHitsPerDoc property. void setMaxHitsPerPage(int) Sets the maxHitsPerPage property. void setMaxPageHitsPerSearch(int) Sets the maxPageHitsPerSearch property. void setSearchString(String) Sets the searchString property. void setUser(String) Sets the user property from the session. void setWholeWord(boolean) Sets the wholeWord property. void stop(String) Stops string search. Fields inherited from interface com.towertechnology.jsp.util.Traceable LOG_DBG, LOG_ERR, LOG_INF, LOG_TCE, LOG_WRN Methods inherited from class com.towertechnology.jsp.generic.ORBClient getRemoteContext Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait v20.1 rev 1 IDM Browser Client for Unix API Reference 159 Chapter 3 Method details setUser(String) public void setUser( java.lang.String session) Sets the user property from the session. This method is used to set the user from the session ID. Parameters: session - The session ID from the JSP. setAppName(String) public void setAppName( java.lang.String newValue) Sets the appName property of the bean. This method sets the appName property of the class to indicate the IDM application being operated on. Parameters: newValue - The application name. getAppName() public java.lang.String getAppName() Gets the appname property of the Bean. This method retrieves the appName property of the class which indicates the IDM application being operating on. Returns: String - The related IDM application name. setSearchString(String) public void setSearchString( java.lang.String str) Sets the searchString property. Parameters: str - The string to search for. setWholeWord(boolean) public void setWholeWord( boolean val) Sets the wholeWord property. Parameters: val - If true, then match only string occurrences as a whole word. 160 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs setIgnoreCase(boolean) public void setIgnoreCase( boolean val) Sets the ignoreCase property. Parameters: val - If true, then match string occurrences ignoring character case. setAtEndLine(boolean) public void setAtEndLine( boolean val) Sets the atEndLine property. Parameters: val - If true, then match only string occurrences at the end of lines. setAtStartLine(boolean) public void setAtStartLine( boolean val) Sets the atStartLine property. Parameters: val - If true, then match only string occurrences at the beginning of lines. setHasWildCards(boolean) public void setHasWildCards( boolean val) Sets the hasWildCards property. Parameters: val - Set to true if the string contains wild cards. setMaxHitsPerPage(int) public void setMaxHitsPerPage( int val) Sets the maxHitsPerPage property. Parameters: val - The maximum number of hits per page. setMaxPageHitsPerDoc(int) public void setMaxPageHitsPerDoc( int val) Sets the setMaxPageHitsPerDoc property. Parameters: val - The maximum number of hits per document. v20.1 rev 1 IDM Browser Client for Unix API Reference 161 Chapter 3 setMaxPageHitsPerSearch(int) public void setMaxPageHitsPerSearch( int val) Sets the setMaxPageHitsPerSearch property. Parameters: val - The maximum number of hits per search. addSearchItem(String, int, int, int, int) public void addSearchItem( java.lang.String description, int ifnds, int ifnid, int pageStart, int nPages) Adds a document to search. Parameters: description - The document description. ifnds - The diskset number. ifnid - The document ID. pageStart - The page number to start searching. nPages - The number of pages to search. addSearchItem(String, String, int, int) public void addSearchItem( java.lang.String description, java.lang.String ifn, int pageStart, int nPages) throws com.towertechnology.jsp.generic.TdpJbException Adds a document to search. Parameters: description - The document description. ifn - The document IFN as a string. pageStart - The page number to start searching. nPages - The number of pages to search. find(boolean) public java.lang.String find( boolean checkCache) throws com.towertechnology.jsp.generic.TdpJbException Starts a string search. Parameters: checkCache - Whether to check the session cache for the result. Returns: The search ID. 162 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs getResult(String) public ResultInfo getResult( java.lang.String searchID) throws com.towertechnology.jsp.generic.TdpJbException Gets the search result. Parameters: searchID - The search ID returned by find(boolean). Returns: The search result. stop(String) public void stop( java.lang.String searchID) throws com.towertechnology.jsp.generic.TdpJbException Stops the current string search. Returns: The search ID. v20.1 rev 1 IDM Browser Client for Unix API Reference 163 Chapter 3 com.towertechnology.jsp.util This package contains classes providing support functions such as logging to the IBCU Web Server log file. The default log file is /tmp/ttuws.log. Class summary Logger This is an abstract class used to set the severity threshold for error logging on the web server. ResourceLocator This is a helper class to get and set IBCU properties. 164 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.util Logger public abstract class Logger This is an abstract class used to set the severity threshold for error logging on the web server. Member Summary Methods static void setLogThreshold(int) Overrides the severity threshold. void setUser(String) Sets the user property from the session. void log(String, boolean, String) Logs a message to a file on IDM Server. Method details setLogThreshold(int) public static void setLogThreshold( int threshold) Overrides the severity threshold. Parameters: threshold - The new threshold. setUser(String) public void setUser( java.lang.String session) Sets the user property from the session. Parameters: session - The session ID. v20.1 rev 1 IDM Browser Client for Unix API Reference 165 Chapter 3 log(String, boolean, String) public void log( java.lang.String filePath, boolean createFile, java.lang.String message) throws TdpJbException Logs a message to a file on IDM Server. Set the user property by calling setUser() before calling this method. Parameters: filePath - The file path. If the path starts with a slash (/), it is regarded as an absolute path; otherwise, it is relative to $CTL_RUNTIME/is/log. createFile - The file creation flag. If true, forces the file to be created if it does not exist, but does not force creation of nonexistent subdirectories specified in the path. message - The message to be written to the log. 166 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Public Java APIs com.towertechnology.jsp.util ResourceLocator public class ResourceLocator This is a helper class to get and set IBCU properties. Member Summary Methods static java.lang.Object static void getProperty(String) Gets the property for a key. setResource(String) Sets the IBCU properties from a source properties file. Method Detail setResource(String) public static void setResource( java.lang.String res) Sets the IBCU properties from a source properties file. Example: <% com.towertechnology.jsp.util.ResourceLocator.setResource(application.getRealPat h("ttuws.props")); %> where ttuws.props is the IBCU properties file on the web server (in the directory $TDP_WS_HOME/tower/WEB-INF). Parameters: res - The absolute path of the source properties file. getProperty(String) public static java.lang.Object getProperty( java.lang.String key) Gets the property for a key. Example: <% int threshold = Integer.parseInt((String)com.towertechnology.jsp.util.ResourceLocator.getProper ty("jsp.util.Logger.Threshold")); %> v20.1 rev 1 IDM Browser Client for Unix API Reference 167 Chapter 3 Parameters: key - The property name. Returns: Object - The property value. 168 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Chapter CORBA objects 4 Overview This chapter describes the CORBA objects residing with IDM Server in the storage tier of IBCU. These objects are accessed by the IBCU JSP pages via the corresponding JavaBeans in the middle tier of IBCU. The following objects are described in this chapter: Object name for TAO ttuwsupload_tao ttuwsdoc_tao ttuwsdocmgt_tao ttuwsexception_tao ttuwshardcopy_tao ttuwslogger_tao ttuwslogon_tao ttuwsqbe_tao ttuwssys_tao ttuwstitlelist_tao ttuwsapplist_tao ttuwsannot_tao Multiple instances can be run of all objects, except ttuwslogon_tao; this object must have only a single instance running on each IDM Server. ttuwsupload_tao The ttuwsupload_tao object is responsible for uploading files to IDM Server. Co-operating with the ttuwsqbe_tao object, as described later, a document file can be uploaded and saved to IDM Server with a corresponding index entry. The index information facilitates future access to the document. ttuwsdoc_tao The ttuwsdoc_tao object is responsible for retrieving the document from IDM Server. ttuwsdocmgt_tao This object is responsible for performing document management actions on the IDM Repository. v20.1 rev 1 IDM Browser Client for Unix API Reference 169 Chapter 4 ttuwshardcopy_tao The ttuwshardcopy_tao object supports printing, faxing and emailing on IDM Server. ttuwslogger_tao The ttuwslogger_tao object allows logging of custom information to a custom file. ttuwslogon_tao The ttuwslogon_tao object is responsible for the logon/logoff process when a user is interacting with IBCU. The ttuwslogon_tao object manages the user’s validation and licensing, and keeps track of the validation of any subsequent access to IBCU by the user. When a user successfully logs on to IDM Server, the ttuwslogon_tao object makes an entry to a table which contains at least fields such as Session ID, User ID, Password, and License ID. After this information has been provided, subsequent access can proceed with IDM Server. When a connection has been inactive for a configured time, the ttuwslogon_tao object removes the corresponding entry from the table based on the user’s Session ID. This means the user will be logged off after the configured timeout. Another logon must be performed before IDM Server can be accessed again. ttuwsqbe_tao This object is responsible for retrieving the Query-By-Example (qbe0) template from IDM Server. The entries in the template are ordered from top to bottom, left to right. The ttuwsqbe_tao object is also used for creating document indices and entering these into the database. ttuwssys_tao The ttuwssys_tao object is used to retrieve information from configuration files. ttuwstitlelist_tao The ttuwstitlelist_tao object is responsible for performing searches for rows and columns of the database according to the specified WHERE clause of a SQL statement. Note that the information for making this WHERE clause is gathered from the QBE form. The ttuwstitlelist_tao object should exercise security control on the list returned. That is, the returned information is filtered according to the standard IDM document security control model, which depends on the privileges of the logged-in user. ttuwsapplist_tao The ttuwsapplist_tao object is responsible for the retrieval of the IDM application tables. The object should be able to produce a list of the IDM application tables with their long names (Descriptions) and short names (IDM application table names), based on the privileges of the given user ID. ttuwsannot_tao The ttuwsannot_tao object is responsible for the retrieval and storage of annotations, including distributed annotations. 170 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Chapter Error handling 5 Overview of error processing in IBCU This chapter describes the functions IBCU provides for retrieving and processing errors. In general, custom code for error handling should be introduced at the JSP level. JSP error processing is described in detail later in this chapter. All errors reported by IBCU are represented as a number, in the nine-digit form PPSCCXXXX where PP indicates the Product scope S indicates the subsystem CC indicates the subcomponent XXXXrepresents the actual error code. (Errors generated in 3rd party software might depart form this format, as described later in this document.) This format is relevant to the interpretation of error messages in the file ttuws_errlog, although each message also includes an error description, as detailed as possible, to help identify the problem. Further identifying information is also added to the message. This includes date/time, process ID (useful when multiple instances of the same object are executed), process name, and the source file name (and the line number) which logged the error. Example of an error logged in ttuws_errlog: ERROR: Fri Feb 1 16:00:15 2002 | PID= 26357 | PROC_NAME='ttuwslogon' | FILE='../ttuwslogontable.C' | LINE= 682 | ERR_CODE=880005002 | DESC='LogonTable::Delete|Session not found.|pszSessionID=iu1dl04501' Note that custom error-handling code in a JSP does not require detailed knowledge of the message format or internal handling, as IBCU JavaBean methods allow direct retrieval of both the error number and the description. NOTE: The character “|” cannot be used in an error description, because this character is used as an internal separator. The error number and error description are passed together, in the format “%d|%s”, with “|” being the delimiter between error number and error description. Also, if any processing of the description is to be performed using a scripting language, the error description should not contain any characters that can produce a script error. v20.1 rev 1 IDM Browser Client for Unix API Reference 171 Chapter 5 Error number format The highest 2 bytes, PP, are always set to 88, which indicates that the error is within the IBCU scope. The next 3 bytes, SCC, are used to indicate the subsystem which encountered an error. In particular, the value of S indicates the layer: 0: the error happened in the CORBA layer. 1: the error occurred in the JavaBeans layer 2: JSP pages reported the problem 3: the error originated in the IBCU viewer applet 4: the error is reported by the COM layer. The next 2 bytes, CC, indicate the sub component: Error in CORBA layer (S = 0); values of CC: 00: ttuwsLogon object 01: ttuwsAppList object 02: ttuwsQbe object 03: ttuwsTitleList object 04: ttuwsDoc object 05: ttuwsSys object 06: RESERVED for future use 07: ttuwsUpload object 08: ttuwsHardCopy object 10: RESERVED for future use 11: ttuwsAnnot object 12: ttuwssearch object 13: ttuwsLogger object The last 4 bytes (XXXX) represent the actual error number. If this part of the error number is in the range [0000..4999], then this is a “common” error (common to all CORBA objects if S is 0, or common to all COM objects if S is 4). An example of a common error is “Out of memory”. An error number (XXXX) in the range of [5000..9999] represents an error specific to a CORBA object. Examples of returned errors: 880000000 Error allocating memory in the ttuwsLogon object 880030000 Error allocating memory in the ttuwsTitleList CORBA object 880005000 “No more available licenses” reported by ttuwsLogon object External software errors, including OS errors, are returned “as is”. When an error occurs in a CORBA object, an appropriate exception is raised: • Authentication • Generic. A generic exception is raised when a call to a system library failed, caused by an error such as too long a string being passed as a parameter. A similar exception can be thrown from COM objects (part of the Windows rendering subsystem). • System 172 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Error handling These exceptions are caught by a JavaBean, which then throws a new (equivalent) exception, which can be caught and processed by JSP pages. Whenever an error is returned by an IDM API called from IBCU CORBA object (that is, the calling function returns -1), an exception will be thrown with the appropriate IDM error code and error description. All generated errors are passed to a higher layer in the format %d|%s. IBCU provides convenient methods to extract the actual error number and error description, as described in the sections JSP level on page 174 and JavaBean layer on page 175. The following example illustrates how an error is processed and passed from the CORBA servant to JSP. The situation illustrated is where a request to connect to IDM Server fails, and an appropriate exception is raised: // connect to tower imagestore rc = Misc_Imagestore_Connect(UNIXWEBSERVER); if (rc != 0) { //error handling, cannot connect to Tower Server nErrNum = Get_Ctlerrno(); TTUWS_ERRLOG(nErrNum, "Connect to Tower Imagestore from exportDoc failed"); throw TTUWSEXCEPTION::TTLLSystemException(nErrNum, "Connect to Tower Imagestore from exportDoc failed"); where TTUWS_ERRLOG is a macro that logs the error to the file ttuws_errlog, located in the directory $CTL_RUNTIME/is/log. Please note that these errors are passed “as is”; the IDM error is retrieved into nErrNum, and a system exception is thrown (with this number) in the final line. The next example illustrates handling a system error, defined in IBCU: rc = stat(fileName, &st); if (rc < 0) { unlink(fileName); sprintf(errMsg, "stat(%s) failed", fileName); TTUWS_ERRLOG(COMMON_ERR_DOC(COMMON_ERR_FILE_OPERATION), errMsg); throw TTUWSEXCEPTION::GenericException(COMMON_ERR_DOC(COMMON_ERR_FILE_OPERATION), errMsg); } In this example, a generic exception is thrown; the error number is 880040015. The next example illustrates how 3rd party (including OS) errors are handled: if ((dirPtr = opendir(dirName)) == 0) { sprintf(errMsg, "Cannot open directory %s", dirName); TTUWS_ERRLOG(errno, errMsg); throw TTUWSEXCEPTION::GenericException(errNo, errMsg); } A generic exception is an exception which is not specific to any particular 3rd party product. This definition includes OS errors. v20.1 rev 1 IDM Browser Client for Unix API Reference 173 5 Chapter The next example illustrates how a specific 3rd party product can raise an exception then. In the case of an internal problem in HTML Export, the following exception might be raised: throw TTUWSHTMLEXPORT::HtmlExport::HtmlExportException(errNo, errMsg);" JSP level When error processing is required in custom JSP pages these pages must include the following line: <%@ page language="java" import='com.towertechnology.jsp.generic.*' session='true' errorPage='/jsp/ttuwserror.jsp' %> Some pages included in the standard IBCU release illustrate how this can be done. The JSP illustrated below is ttuwsdocbot.jsp. Suppose that there is no document identified by IFN=34/28-417. Then a browser attempting to retrieve the URL http://172.16.1.234:8080/tower/jsp/TdpJspDoc.jsp?ifn=34/28-417 will fail, resulting in an error message from IBCU. The message will indicate that the requested image does not exist, and will also display the error as returned by IDM Server (1307). A similar situation arises if we specify an incorrect disk set. For example: http://172.16.1.234:8080/tower/jsp/TdpJspDoc.jsp?ifn=34/278-417 The message will indicate that the disk set is invalid, and will also display the error as returned by IDM Server (1401). The following code is extracted from ttuwsdocbot.jsp. It represents typical error processing. try { str = thedoc.getDoc(docname,pageNum,Integer.parseInt(totalPages)); // place the rest of processing here } catch(TdpJbException tje) { // Error handling errorCode = tje.getErrorCode(); errorMsg = tje.getMessage(); // replace all double quotes with single quotes // for the future use with Javascript code errorMsg = errorMsg.replace('\"','\''); // the third-party software error code origErrorCode = tje.getOrigErrorCode(); // followed by the rest of code which process errors } Points to note: 174 1. The execution of the JavaBean method must be within a pair of try and catch statements. 2. To retrieve the error code, as passed by IDM Server (and reported by a CORBA object), call method tje.getErrorCode();. Similarly, to retrieve the error description, call method tje.getMessage();. If this message is to be used in Javascript, then single quotes must be changed to double quotes, for example using the method errorMsg.replace('\"','\'');. 3. The reference to an “original” error code (“Orig”) in the name of the method tje.getOrigErrorCode(); refers to 3rd-party errors, including OS errors. © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1 Error handling As described earlier in this chapter, the “original” error does not comply with the internal IBCU standard format (PPSCCXXXX), and represents the exact error number as returned by the 3rd party library or OS. If the error to be processed is related to IDM Server business logic (for example, the image is on an off-line disk, or the disk set is currently being exported), then from the custom code point of view only the method tje.getErrorCode(); is relevant. JavaBean layer The JavaBean layer implements exceptions in the class TdpJbErrors.java. This class extends the Java Exception class and contains a method getErrorCode() to support error processing. Exceptions are propagated from CORBA objects to JavaBeans, which then pass the exception to JSP pages and subsequently to Applet Viewer if required. (This is done after logging the error to the file ttuws.log; a new exception, equivalent to the exception originally caught, is thrown to allow error processing at the JSP level). All exceptions thrown from CORBA objects to JavaBeans contain two attributes: • errorCode • errorDescription The exception is passed from the JavaBean to JSP. If it needs to be caught at JSP level, the JSP page must import the class TdpJbException, as described under JSP level on page 174. v20.1 rev 1 IDM Browser Client for Unix API Reference 175 Chapter 176 5 © 2006 Vignette Corporation. All rights reserved. v20.1 rev 1