cancel
Showing results for 
Search instead for 
Did you mean: 
Tony_Maimone
Star Collaborator
Star Collaborator

What’s New in OnBase 17: Document Composition Enhanced XML Placeholder Creation

XML Query Placeholders have existed in Document Composition for a few versions of OnBase now and the Batch Placeholder Creation update Document Composition brings to the table this release drastically improves their creation process.

Updated User Interface

Figure 1- XML Query Placeholder creation

The new batch creation wizard panel for XML Query Placeholders is vastly improved from the singular creation wizard panel that existed previously. The XML editor takes up a large portion of the left-hand side of the wizard panel, which behaves similarly to the XML editor that Composition Preview provides in Template Builder. Underneath the XML editor is a zoom slider and the current zoom percentage of the XML editor. The default percentage is 100%, but you can zoom out to 50% and zoom in to 300%. Above the editor is a textbox that displays the current XPath of the editor. The “Add” button, which looks like a plus sign, will display a popup when selected, where you can choose the output style of the XML placeholder (Single Value, Image, List, or Table). Once you create an XML Query Placeholder, it will appear in the list on the right-hand side of the wizard as an expandable/collapsible object, which displays the XPath and output style of the placeholder.

New XML Editor

There are three ways to use the XML editor in this wizard panel:

1)      Not at all

2)      Typing XML directly into the editor

3)      Opening an XML file into the editor

You can create XML Query Placeholders without having XML in the editor; this method is similar to how you could create XML Query Placeholders before the batch placeholder creation update, except that you can still create multiple XML Query Placeholders in this way. To create XML Query Placeholders this way, simply type the desired XPath into the “Selected XPath” textbox, and add the Placeholder to the list.

You can also create XML Query Placeholders using sample XML. Sample XML can be loaded either into the editor using the “Open” button or by manually typing the sample XML into the editor. You are able to edit any XML in the editor, even XML loaded from a file. Using this editor does not edit the XML file itself, but it is stored on the template so that you can use it to create more XML Query Placeholders, Repeating XML Query Placeholders, or test the newly created Placeholders using Composition Preview.

Creating XPaths

Once XML exists in the editor, there are two ways to choose XPaths for XML Query Placeholders in this wizard panel:

1)      Manually

2)      Automatically, by the editor

Point and click configuration

Just as before, you are able to type the XPath manually for an XML Query Placeholder. However, one huge benefit of having sample XML in the XML editor is that you are also now able to click on an XML element or attribute in the XML editor and have the XPath of the selected element or attribute automatically generate in the “Selected XPath” textbox. This saves time and headache for straightforward XPaths by eliminating inefficiencies.

All XPaths in XML Query Placeholders and Repeating XML Query Placeholders are limited to 255 characters. If you try to create an XPath that is longer than 255 characters, an error message will appear underneath the “Selected XPath” textbox, and the add button becomes disabled. The error message is only visible when you hover over the textbox with the cursor, but you will know that there is an error message to read when a red glow surrounds the textbox.

Figure 2 - Error message when Xpath exceeds 255 characters

The XPaths generated in the wizard panel are absolute XPaths and do not contain any XPath expressions. The proper XML namespaces are applied to generated XPaths when applicable. Please review the Technical Series: XML Namespaces in OnBase 17 blog post.

XPath Validation

Another benefit of having sample XML in the XML editor is XPath validation. The XML editor validates all XPaths against the provided sample XML (unless there is none). If the XPath provided successfully validates, the XML editor highlights XML elements and attributes in the XML editor based on the evaluation of the XPath. This goes for both automatically generated XPaths as well as manually created ones. The XML editor highlights XML elements in blue and XML attributes in yellow.

If an XPath entered into the textbox does not validate against the provided sample XML, a warning message will display underneath the textbox. The warning message is only visible when you hover over the textbox with the cursor, but you will know that there is a warning message to read when a blue glow surrounds the textbox.

XPath validation is not available when there is no sample XML provided to the editor. You are still able to create Placeholders with XPaths that do not validate against the XML; this warning is in place to warn you that, because this XPath does not validate against the provided sample XML, we cannot guarantee that this Placeholder will result in any output during composition. If you decide to utilize XPath expressions, and if that XPath expression evaluates to a Boolean, numeric value, or string value, the XML editor will not highlight any XML node. A more detailed explanation is available in the Technical Series: Leveraging XPath Functions in OnBase 17 blog post.

Xml Query Placeholders

The list control containing all the Placeholders the wizard will create at its completion is also a new addition due to the batch Placeholder creation updates.

Figure 4 - XML Query Placeholder list

Each item in the list displays the Placeholder’s name at the top, in bold. Each item also contains a delete button, which looks like an “X”, an edit XPath button, which looks like “//..”, followed by the Placeholder’s XPath, and an edit output style button, which looks different depending on the output style of the Placeholder, followed by the output style of the Placeholder. The Placeholder’s XPath serves as a basis for the Placeholder’s automatically generated name. If the list or template contains more than one Placeholder with the same name, the Placeholder name receives an underscore and an incrementing number to make it unique. Buttons inside the list items have a blue glow when you are able to select them. In the image above, the delete button, edit XPath button, and edit output style button in each item is selectable, demonstrated by the blue glow around each. You can expand or collapse items in the list as desired.

Figure 5 - Inserting multiple authors

Collapsed items receive a dark gray color, and the Placeholder’s names have the bold style removed. You can only edit or delete expanded list items. An “Expand/Collapse All” button appears when there is at least one item in the list. The button changes between an “Expand All” button and a “Collapse All” button depending on the number of expanded items in the list. If the number of expanded items is greater than half the total number of items in the list, the button is a “Collapse All” button; otherwise, it is an “Expand All” button.

Editing an XPath

When you edit an XPath of an item in the list, all items (including the item you are editing) become disabled. This gives each item in the list a “washed out” effect, meaning that all the colors of the items become faded. You cannot expand, collapse, or edit disabled items. The item that you are editing retains its border, while the other items lose their borders. The add button on the wizard panel is replaced by an accept edit button, which looks like a checkmark and is surrounded by a green glow, and a cancel edit button, which looks like an “X” and is surrounded by a red glow. The XPath you are editing replaces whatever XPath that was in the “Selected XPath” textbox, and the XML editor highlights the XML elements and attributes accordingly. To make an edit to a Placeholder’s XPath, manually edit the XPath or select an XML node in the editor. When you are done, select the accept button. If you decide not to make any changes to the Placeholder, select the cancel button. Any errors or warnings that would normally apply to XPaths during Placeholder creation still appear while editing an XPath. If an error with the entered XPath occurs, you are not able to accept the edit.

Figure 6 - Unable to accept XPath edit

Creating your new XML Placeholders

When the wizard is complete, a toast message appears, confirming that batch Placeholder creation has taken place. This toast message will be singular if you create only one Placeholder and plural if you create more than one Placeholder.

Figure 7 - Successfully created notification