Using grouping in a live text My Widget.
Regular expressions is a very powerful system of pattern matching text and pulling sub strings out. In this example we are going to create a live text link to SPR numbers contained in documents and have it look up the SPR on the fixlist website.
To better match the SPR we are going to look for the following combinations.
(and variations of these).
1. Click on the "Getting started with widgets..." smarticon. (looks like a jigsaw piece with a star)
2. On the Start Configuring Widgets dialog select "Web Page" and click next.
3. Select "Web page by URL:" and then enter in the following URL.
This URL is the result of a search that was already done on the APAR search. This allows us to get access to the search related fields. For this example I have removed the attribute "Query=LO00000" that I had used to generate this URL.
4. Click Next.
5. Select "From a form on this web page" option and click next.
6. The web page will now display in the dialog box along with a list of Forms (by number). In this example there should only be one form to choose from. Click on the "1". To confirm this is correct scroll over to the right side of the form and ensure the search field is highlighted. Click next.
7. Click on the ID selection for "newquery" display name. Click on "Wire as an action" and then click next.
8. On the wire an action dialog box we need to teach the action what an SPR number looks like so we will be back to this dialog in a second. For the moment click "New Recogniser".
9. On the "Configure a Recognizer" dialog box click "New Type" (we will be back to this dialog in a second as well).
10. On the Configure a Content Type type in "SPR Number" in the name field. As we are looking for a subsection of the search text we need to create a group item. Click the "+" button to add a group item. Give the new line the property name of "SPR" and description of "SPR Number". Once done click OK.
11. On the configure a recognizer dialog give the name "SPR" and choose the content type of "SPR Number".
12. We are now going to tell the action how to reconise an SPR number. Enter in the following regular expression.
If you are new to regular expressions don't panic. It is quite simple. This tells the action to look for "A string starting with SPR, may contain #, : or a space followed by 4 capital characters of A to Z and then 6 characters of A to Z or 0 to 9. The brackets ( ) tell the action that you want to group those results together as a separate group.
To tell the action to catch that group click the "+" button and enter in grouping number "1" and content property as "SPR". Click OK when done.
13. On the wire an action to configure a widget dialog enter in the following. Action name of "SPR search on fixlist". Recognised content selected and set to "SPR Number". Content property should be "SPR" and the component property set to "newquery". Finally click "Tab" for where you want to see the results and click finish.
You now have a working live text! You should see a live text link under text on the following examples (if entered into a document).
Installing a pre-made Widget
download the file (right click and save file). You can then install the widget by drag and dropping the file into your "My Widgets" sidebar.