cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Koning
Star Contributor
Star Contributor

We continue on with our examination of new client-side Indexing Unity Scripts with the Scan Queue - Indexing Keyword Focus, Scan Queue - Indexing Keyword Blur, and Scan Queue - Point and Shoot Indexing script hooks. These script hooks provide convenient extension points to validate, and possibly, manipulate user entered indexing Keyword values.

Scan Queue - Indexing Keyword Focus

The Scan Queue – Indexing Keyword Focus script hook is invoked when the user interface transfers focus into a keyword input field in the indexing panel. A Unity Script must implement the newly added IScanQueueKeywordFocusEventScript interface in order to be properly exposed as this script hook.

The interface is given quite a bit of information about the Keyword value being focused via the ScanQueueKeywordFocusEventArgs object. Most notably are the ScanQueue, KeywordType, and KeywordValue properties which allow access to the Scan Queue, KeywordType, and user-entered string value of the Keyword, respectively. Furthermore, an API representation of the indexing panel as seen by the user is exposed as the KeywordPanel property along with the indexed values already stored in the database for the proto-Document.

These properties work together along with the Results property to allow a developer control over the indexing panel, including the focused Keyword which triggered the Unity Script. Possible uses include: pre-population of Keyword values (possibly related to the focused Keyword), validation of existing Keyword values with a Windows Forms or WPF message box explaining the problem, or indexing input lookup and correction.

One thing to really keep in mind with this script hook: the focus Unity Script can be called quite frequently during an active indexing process with a user. These scripts should execute quickly to prevent an interruption of the indexer’s processing flow.

Scan Queue - Indexing Keyword Blur

The Scan Queue – Indexing Keyword Blur script hook is quite similar in concept and application to the previously explained Scan Queue - Indexing Keyword Focus script hook. They are actually inverses of one another: the focus script hook fires when user interface focus is transferred into the Keyword input field while the blur script hook fires when the focus leaves the Keyword input field. A Unity Script must implement the newly added IScanQueueKeywordBlurEventScript interface in order to be properly exposed as this script hook.

The blur interface provides the same programming experience as the focus interface via the ScanQueueKeywordBlurEventArgs object. The exact same properties and functionality is exposed except for the addition of the ScriptResult property. This property allows the developer to request that the focus not be allowed to transfer away from the Keyword input field. Such functionality is useful when an indexing error was detected with the recent input and the Keyword input field focus should not be lost.

Lastly, a word of warning similar to the focus script hook: this Unity Script can be called quite frequently and should have a reasonably fast execution time.

Scan Queue - Point and Shoot Indexing

The final script hook we will be looking at today is the Scan Queue – Point and Shoot Indexing script hook. This script hook is invoked immediately before a keyword value scraped from a document via Point and Shoot Indexing is applied to the indexing panel. A Unity Script must implement the newly added IScanQueuePointAndShootIndexingEventScript interface in order to be properly exposed as this script hook.

The interface is provided a similar amount of information as the focus and blur interfaces, while spinning the user input value into the point and shoot indexing context. The raw selected and parsed (but not validated or otherwise changed) Keyword value is exposed via the FieldText property. Also similar to the blur interface is the ScriptResults property which allows for the result of the scrape operation to be thrown away and the event cancelled.

Conclusion

The script hooks covered today relate to controlling the Keyword values a user enters. The Unity Script interfaces provide a convenient way to programmatically validate and alter values to enforce indexed value expectations.

I presented a few general use cases applicable to a wide range of situation, but I have no doubt there are a lot more interesting applications out there. Feel free to leave any suggestions to where you may find this functionality useful in the comments below.

1 Comment