HYPERLINK property
The HYPERLINK property defines actions to be taken with pages, annotations, JavaScript, and web pages.
This property uses the following format:
HYPERLINK = <hyperlink type><hyperlink property>[<hyperlink property>]
- The user clicks an annotation.
- The user double-clicks the annotation and the annotationDblClick HTML parameter is used.
- The annotations toolbar is open in IBM® Daeja® ViewONE.
| Hyperlink type | Description |
|---|---|
| page | An internal hyperlink that takes the user to a specific page in the document. |
| annotation | An internal hyperlink that takes the user to a specific annotation in the document. |
| javascript | A hyperlink that calls the JavaScript event handler. |
| web | An external hyperlink that opens another web page. |
Each of these hyperlink types has parameters that you specify.
The easiest way to set up annotation hyperlinks is to use the IBM Daeja ViewONE user interface.
Before you define hyperlinks in a definitions file, test the hyperlinks in the IBM Daeja ViewONE user interface to see how they work. For example, both a JavaScript hyperlink and a web hyperlink can be used to open a web page. However, you might find that a JavaScript hyperlink works better for some tasks because the JavaScript hyperlink gives flexibility over how the window looks.
JavaScript hyperlinks can also be used for any other task, such as opening another document or starting a custom job. However, JavaScript hyperlinks require the use of the IBM Daeja ViewONE JavaScript event-handler. Therefore, these hyperlinks are more complex to set up initially.
Page hyperlinks
HYPERLINK = <page><page number>If the page number is not in the document's page range, the hyperlink does not work. Instead, the user remains on the current page.
Annotation hyperlinks
HYPERLINK = <annotation><annotation label>
The annotation label variable specifies the label of the annotation that the hyperlink links to. If a link is made to a label name that is shared by two or more annotations in a document, IBM Daeja ViewONE links to the first of those annotations.
By default, IBM Daeja ViewONE scrolls the page to as close to the upper left of the linked annotation as possible. IBM Daeja ViewONE uses the current scale preference such as fit to height or fit to width. However, if window settings such as a scroll position or rotation angle are associated with the linked annotation, IBM Daeja ViewONE uses these settings instead. For more information, see the HYPERLINKSETTINGS property.
JavaScript hyperlinks
HYPERLINK = <javascript><any text>
When a user clicks the annotation for which a JavaScript hyperlink is defined, IBM Daeja ViewONE calls the designated JavaScript event handler.
The any text variable is used as the event handler's text property and can be interpreted in any way. For example, it might be interpreted as a document identifier, a web page, or a comment. The event identifier is 23.
A JavaScript hyperlink is useful for designing implementation-specific hyperlink behavior. For example, after the JavaScript event handler receives the hyperlink's text string, the event handler might display a dialog box with help information. Alternatively, the event handler might use IBM Daeja ViewONE JavaScript calls to open a new document.
Web page hyperlinks
HYPERLINK = <web><web page url><target>The web page url variable specifies the URL of the web page that is to open when the user clicks the annotation. Use the standard format for entering this URL, for example, <http://www.mysite.com/page.html> The web page URL can be relative to the IBM Daeja ViewONE codebase parameter or it can be absolute. If you use the annotationHyperlinkWeb HTML parameter, a relative URL is relative to the base address as defined by that parameter.
The target variable specifies the window in which the new web page is displayed. For example, setting the target variable to <_self> causes the browser to open the new page in the web page that currently displays IBM Daeja ViewONE. Setting the target variable to <_blank> opens a new window that contains the new web page.
| Target | Menu label text |
|---|---|
| <_self> | <Same window> |
| <_blank> | <New window> |
| <_parent> | <Parent frame> |
| <_top> | <Top frame> |
Alternatively, you can specify a custom target for the target variable by using the annotationTarget HTML parameter.
Adding annotation tooltips to help with hyperlinks
When you create any annotation, you can use the Help text and hyperlink option to add a tooltip that provides explanatory text when a user hovers the mouse pointer over the annotation. For example, if you define a hyperlink annotation to jump to another page, you can include a tooltip to tell users what happens when they click the annotation. The tooltip might say "Click here to see page 5" or "Click here to see the index."