/
Wiki Help API

Wiki Help API



The Wiki Help API allows developers to create context driven help pages for each screen. The API exports screen and field information, which can be used to determine which help page to load. Wiki sites are often used for help, because they're designed for easy contribution. A Wiki is also useful with Profound UI driven screens, because you can load different help pages by passing different text to the URL to load different pages. However, not just Wikis, but any sites that accept URL parameter strings can be setup to host the help documentation.

The API allows you to create two different types of help: screen-level or field-level. The API works for Rich Display Files but not for Genie.

The WIki Help API became available with Profound UI Version 5, Fix Pack 3.0.

Screen-Level Help

Screen-Level help is intended to be used when your help website uses a different help page for each screen.

To setup help pages that describe an entire screen, not each specific widget, you might use the API function, pui.wikihelp.getScreenInfo(). getScreenInfo() returns an object with the following members:

  • formats - An array of strings naming the screen's current record formats.

  • dspf - The name of the display file.

If your help pages

Field-Level Help

Field-level help is designed to be used when your help site uses a different page for each field on a screen. Also, some pages might show multiple fields on a help page, and passing some text to the URL causes the page to scroll to the appropriate field. For those pages, field-level help is useful.

The field-level help creates overlays for each field that the user clicks to load a help page. For this feature, you'll need to call API functions to enable and disable the help, write a click event handler, and add custom CSS for the overlay. You as the developer must provide the interface to toggle the help overlays on and off. Some example interfaces are given below.

You can optionally add some text or an image to the overlays.

API Functions

To enable the field help overlays, call pui.wikihelp.overlayOn(). A "div" element is placed over each field on the page for the current record formats.

Call pui.wikihelp.overlayOff() to hide the overlays.

Some sample user interface code is included below.  Place your custom JavaScript in the custom js folder in your Profound installation's IFS directory. For example, create a file named, /profoundui/userdata/custom/js/wikiHelp.js.

The first example places a toggle button in the top-right corner of the page. Clicking the button toggles the help overlay on or off.

Toggle Button
pui.onload = function(parms) { var helpButton = document.getElementById("wikihelp-toggle"); // Don't show help toggle if screen isn't sign-on, end-of-job, or timeout. if( helpButton && (parms.name === "SIGNONSCRN" || parms.name === "EOJSCRN" || parms.name === "TIMOUTSCRN") ) { helpButton.parentNode.removeChild(helpButton); helpButton = null; } else if(! helpButton ) { // The help toggle wasn't already added; create it. var helpButton = document.createElement("input"); helpButton.id = "wikihelp-toggle"; helpButton.value = "Help On"; helpButton.type = "button"; helpButton.helpOverlayOn = false; helpButton.style.position = "absolute"; helpButton.style.zIndex = "1010"; helpButton.style.top = "2px"; helpButton.style.right = "2px"; helpButton.style.width = "75px"; document.getElementsByTagName("body")[0].appendChild(helpButton); helpButton.onclick = function() { if( this.helpOverlayOn ) { pui.wikihelp.overlayOff(); this.value = "Help On"; } else { pui.wikihelp.overlayOn(); this.value = "Help Off"; } this.helpOverlayOn = ! this.helpOverlayOn; }; } };

Note: pui.onload is called after the record format is rendered on the page.



The next example toggles the help overlay when the F1 key is pressed.

Keyboard Toggle
var helpOverlayOn = false; function toggleHelp() { if( helpOverlayOn ) pui.wikihelp.overlayOff(); else pui.wikihelp.overlayOn(); helpOverlayOn = !helpOverlayOn; } // Internet Explorer if("onhelp" in window) { window.onhelp = function(){ toggleHelp(); return false; } } // Other browsers. else { addEvent(window, "keyup", function(){ if( e.keyCode === 112 ) { // F1. toggleHelp(); } });