Customizing the BPF toolbar

This section describes modification of the toolbar in the BPF Case user interface using Toolbar.xml.

Standard BPF Tools List

This section details the standard toolbar options included in the base BPF deployment. Some of these tools are configurable using the BPF Explorer configuration tool while others are configured by modifying the Toolbar.xml file. Still others (Action, Mode) are required and cannot be removed. Each standard tool is described in the table below

Tool Source Description
Attach Document Configuration - BPF Explorer Allows a user to browse the Content Engine (CE) object store and attach a document to the Case.
Add Document Configuration - BPF Explorer Allows a user to attach a document from the local file store to the Case. The document will be checked into CE in this process before being associated with the Case.
Queue Depth Configuration - BPF Explorer Displays a pop-up window containing Case counts for all Inbaskets this user (and current role) can access.
Save Configuration - BPF Explorer Saves changes to the current Case.
Close Configuration - BPF Explorer Closes the current Case.
Action Required Displays a list of configured actions which may be applied to the current Case. Actions save Case data and dispatch the work item.
Mode Configuration - BPF Explorer Existence of the Mode toolbar option is determined by BPF Inbasket configuration. Inbaskets by be configured for browse or sequential mode. Only if an Inbasket is configured for both modes will the option to switch between modes be available. Users who have only the sequential mode will see this link as Last Case, which will allow them to work the current Case and then log off or click this link to return to sequential mode.
Create Case Configurable - Toolbar.xml Can be used to expose multiple CreateCase tools as drop-down items under a single menu configured in Toolbar.xml. See the section of Toolbar.xml just below the "EXTENSION TIP: Drop-down Create Case menu" comment for examples of how to configure all of the various Create Case tools, including the create_case tool and the create_browse tool (using the executeToolFromToolbar method) as well as the eForms create case functionality (using the invokeFormTemplate method).
Search Configurable - Toolbar.xml The search tool utilizes invokeWorkplaceObject to open a CE folder containing stored search definitions executable by users.
Preferences Configurable - Toolbar.xml Used to open the BPF preferences page for defining user preferences.
Sign Out Configurable - Toolbar.xml Allows the user to end the current session. Changes to the current Case are lost on logoff. Utilizes the confirmLogoff function.
Custom Search Configurable - Toolbar.xml
Disabled by default
Utilizes the invokeWorkplaceObject function to execute a stored search. A pop-up window provides results of the search.
Cases in Store Configurable - Toolbar.xml
Disabled by default
Utilizes the invokeWorkplaceObject function to execute a stored search. A pop-up window provides results of the search.
Documents in Store Configurable - Toolbar.xml
Disabled by default
Utilizes the invokeWorkplaceObject function to execute a stored search. A pop-up window provides results of the search.
Help Configurable - Toolbar.xml
Disabled by default
Calls a javascript function which executes a search providing context sensitive help. This function is not currently completed, and requires target help content be provided.
Notes
  • Makup of the Custom Search, Cases in Store, and Documents in Store tools above are identical with the exception of the GUID value passed by each. These tool entries in Toolbar.xml do not constitute working tools but rather pointers to stored searches which require creation by the system administrator or installer.

Structure of the Toolbar.xml file

The Toolbar.xml file contains a single primary section <Toolbar> sub-sections of <Item> contain each additional tool to be displayed on the toolbar. The Toolbar.xml is located in the /WEB-INF folder. By adding a <Item> section tools may be added to the toolbar. Toolbar item entries make reference to javascript functions, generally located in Bp8InitMain.js in the /js folder. An example of a toolbar item entry is detailed below.

<Item Caption='Preferences' Name='Preferences' SearchMode='no'>
  <Description></Description>
  <Action>javascript:showUserPreferences()</Action>
</Item>

Item Description
Item  
      Caption The Caption value is the text displayed in the Case user interface as the link to invoke the tool.
      Name The Name Value is used to uniquely identify the tool definition.
      SearchMode The SearchMode value is used to execute a CE search to gather parameters for tool execution. This is used when parameters passed to the javascript function called by the tool are not static or not readily available. Default value is No.
Description Used to hold a tool description for the mouse-over popup.
Action  
      javascript Denotes execution of a javascript function
      showUserPreferences Name of javascript function to call followed by parameters passed to the function by the tool.

An included tool that is not activated is the SearchCases tool. Viewing the Toolbar.xml will show that this tool is commented out. By uncommenting the tool entry, and updating the GUID for the search being invoked (the parameter passed to the invokeWorkplaceObject function) to a valid GUID this tool can be activated. This tool utilizes the invokeWorkplaceObject function which simply executes the appropriate activity for the CE object specified in the GUID passed. In this Case, a stored search configured to locate cases with specific parameters will be executed.


<Item Caption='Search Cases' Name='SearchCases' >
   <Description>Search Cases by their name</Description>
   <Action>javascript:invokeWorkplaceObject("{3FFD7AC9-7F44-4053-B34B-CF79AAA2B9AC}","searchtemplate")</Action>
</Item>

NOTE that, if the invokeWorkplaceObject method is used to invoke versionable content in CE (for example, if you choose to configure it to point to an actual Search Template or other document rather than a Folder in which Searches are stored), you will need to change the GUID value here whenever a new version of the content is created. Otherwise, invokeWorkplaceObject will continue to invoke the old (original) version.

Bp8InitMain.js file and custom functions

The Bp8InitMain.js file contains functions related to the display of a Case in the Case user interface but should not be altered for customer functions. Functions called by custom tools added to the Toolbar.xml should be placed in the Bp8BusinessObjects.js file.


// Function to invoke Workplace commands 
function invokeWorkplaceObject(id,objectType){
	RemoteFunctions.keepSession();
	var id = id;
	var objectType = objectType;
	var urlCaseQuery = "ExtCommand.jsp?ExtTask=Search&id="+id+"&objectType="+objectType;
	var winFeatures = "resizable=yes, scrollbars=yes";
	var windowName = "winCaseQuery";
	var searchWindow = window.open(urlCaseQuery, windowName, winFeatures);

	openedWindows.dependent.push( searchWindow );
	try {searchWindow.focus();} catch (e) {;}
}


// Function to invoke Form Template from Workplace 
// NOTE: the two GUID parameter values passed here represent the OIID (object_id) and the vsId (version_series_id), 
// respectively, of the eForms Form Template (.itx) to be invoked from the CE ObjectStore.
 function invokeFormTemplate(id,vsId){
	RemoteFunctions.keepSession();
	var id = id;
	var vsId = vsId;
	var objectType = "document";
	var urlEForm = "ExtCommand.jsp?ExtTask=create_eform_case&id="+id+"&vsId="+vsId+"&objectType="+objectType;
	var winFeatures=centerWindow(400,500)+"resizable=yes, scrollbars=yes";
	var windowName = "winEForm";
	var eFormsWindow = window.open("", windowName, winFeatures);
	var msg=localize("LoadingTemplate","Loading...Please wait");
	eFormsWindow.document.write(' <table style="width:100%; height:100%;">'+
        '<tr><td style="text-align:center; vertical-align:middle;"> '+msg+
        '</td></tr> </table>');
	self.setTimeout(window.open(urlEForm, windowName, winFeatures), 5000);
	openedWindows.dependent.push( eFormsWindow );
	try {eFormsWindow.focus();} catch (e) {;}
}

// Function to invoke tools via toolbar.xml
//	1. Tool Name - Name of the tool displayed in the child window's title bar.
//	2. Handler URL - URL for the location of the tool code itself (JSP for example)
//	3. Width - Width of the child window raised for the tool.
//	4. Height - Height of the child window raised for the tool.
//	5. Resizable - Whether the child window raised for the tool is resizable.
//	6. Modal - Whether the child window raised for the tool is modal.
function executeToolFromToolbar(toolName, aHandlerURL, width, height, resizable, modal){
	
	RemoteFunctions.keepSession();
	aHandlerURL += (aHandlerURL.indexOf('?') > 0) ? '&' : '?';
	aHandlerURL += 'ToolName='+toolName;
	aHandlerURL += '&Inbasket='+getCurrentInbasket().id;
	
	var toolpath="plugins/tools/"+toolName;
	if (null != toolpath) {
		var pathnpos = aHandlerURL.indexOf('?');
		var urlval = aHandlerURL.substring(0, pathnpos);
		if (urlval.indexOf('/') < 0) {
			aHandlerURL = toolpath+'/'+aHandlerURL;
		}
	}

	if (currentCase != undefined) {
		aHandlerURL += '&' + paramCaseID + '=' + currentCase.caseId;
		aHandlerURL += '&workobjectNumber='+escape( currentCase.workobjectNumber );
	}
	if ('/' == aHandlerURL.substring(0, 1)) {
		aHandlerURL = getBaseURL() + aHandlerURL.substring(1);
	}
	if (modal==1) {
		return displayModalDialog( aHandlerURL, width, height, resizable, window );
	} else {
		return modelessToolWindows.openTool( toolName, aHandlerURL, window, width, height, resizable );
	}
	
}