How to: |
Once you have identified the incoming data field values you want, you must convert the XML document to an HTML document using a Transform object. In this HTML document, you define the links associated with the field values that were set up in the Store Values object.
A Transform object within the process flow triggers an XML-to-HTML transform that has been designed with the iWay Adapter Transformer tool. As you configure the Transform object, you can design a transform that maps the XML elements to HTML elements. As a minimum you must map the fields that were designated for the Dynamic Categorization tree, and then map any additional metadata, content, and paths to images and WebFOCUS reports to be invoked from the search results interface.
The Dynamic Categorization tree fields we will map from our example are Brand, Category, Color, Department, Gender, PriceRange, Promotion, Price, and Style. We will also add the information to call the WebFOCUS report, include the two additional links, and add a few images, as noted in Magnify Search Configuration Example.
The following procedure provides the details to create the XML-to-HTML mapping while maintaining the required HTML format. You can refer to your Configuration Worksheet for the information needed to set up the mapping.
To create an HTML document from the incoming XML document:
In our example, the object name is Create HTML.
The Transform Type dialog box opens, as shown in the following image. By default, New Transformer appears in the Transform field.
Note: Once a transformation is created and published, it becomes available in the Transform drop-down list. This procedure explains how to create a new transform.
The iWay Adapter Transformer tool, shown in the following image, opens in a separate window.
The Project Location dialog box opens, as shown in the following image.
The transform for our example is named XMLtoHTML_Search.
The Project Type dialog box opens, as shown in the following image.
Note: Because XML provides a certain flexibility and can be used to produce an HTML document, you can choose XML as the output format for the XML-to-HTML transform.
The Input Properties dialog box opens, as shown in the following image.
Note: All iWay listeners produce an XML formatted file.
The following image shows the Validation options.
The Output Properties dialog box, shown in the following image, opens.
Note: If you have a template of the output structure, browse to it in the Structure field. This is helpful, but not necessary, when building the output structure in the mapping step of this procedure.
For the required HTML output structure, see Creating the HTML Document.
The project appears in the main Transformer window, as shown in the following image. The Input Items Structure pane reflects the XML input file structure and the Output (unless you provided a template) contains the Target_Root tag. You will build the HTML output structure under this root tag.
As noted in Creating the HTML Document, the HTML document you send to the search engine must have a specific format. The following tables list the required HTML parameters and values when using:
Use the information you recorded in the configuration worksheets as you build the HTML output.
The following table describes the HTML format required for all access types.
Parameter |
Value |
---|---|
HTML |
None. |
HEAD |
None. |
TITLE |
Title to be displayed as the search result link. |
Custom Meta Tags | |
META NAME="X" CONTENT="Y" |
Meta tags that are stored with the search result, but are not index or available for searching. |
Unique Key | |
META name="WF_INDEX_UNIQUE_KEY" |
Used to identify a unique document when updating or deleting records from the index. This can be the document URL address or a database field value. This is a required meta tag and must be unique within each index library. |
Target for Search Results | |
META name="TITLE_TARGET" |
Specifies the target in which the results of the main search result link displays. Valid values are as follows:
|
META name="LINK_TARGETn" |
Specifies the target in which the results for each additional link displays. Valid values are as follows:
Where n must be in sequential order (1, 2, 3, and so on). |
Date Information | |
META name="date" |
By default, Magnify adds a date field for each record. The date field value contains the date in which the record was indexed. Optionally, you can add your own date information by adding a date META tag in your transformation. If date information is provided with the record, Magnify will include this value in the index and not the default date value. The format for the date must be as follows: yyyy-mm-dd where:
|
META name="datetime" |
By default, Magnify adds a datetime field for each record. The datetime field value contains the date and time in which the record was indexed, including the timezone difference. Optionally, you can add your own date and time information by adding a datetime META tag in your transformation. If date/time information is provided with the record, Magnify will include this value in the index and not the default datetime value. The format for the datetime value must be as follows: yyyy-mm-dd hh:mm:ss.ttt-xxxx where:
|
Data That Can be Searched On | |
BODY |
Data to be indexed (and therefore searchable) by the search engine. |
The following table describes optional meta tag information when indexing documents.
Parameter |
Value |
---|---|
File Metadata Information | |
META name= "MAGNIFY_ACTION_FILE_PROPERTY_FIELD" |
Defines the meta-properties of the file in the Dynamic Categorization Tree. |
META name= "MAGNIFY_ACTION_FILE_PROPERTY_TITLE" |
Defines the text used to display the meta-properties of the file that are included in the Dynamic Categorization Tree. |
META name= "MAGNIFY_ACTION_FILE_PROPERTY_BODY" |
Defines the meta-property values of the file to be indexed as part of the file search body (IBI_CONTENT). |
META name="MAGNIFY_ACTION_FILE_BODY" |
Defines any additional static values used to enrich the file content, such as data from the database record or an email. |
The following table describes the HTML format required for a standalone report procedure.
Parameter |
Value |
---|---|
WebFOCUS Standard Report Access Details | |
META name="FOCEXEC_FOR_TITLE" |
WebFOCUS report (FOCEXEC) to be executed when you click the title link. Can include images, if necessary. |
META name= "FOCSOURCEDATABASE_FOR_TITLE" |
Name of the database accessed when you click the title link. |
META name= "FOCEXECCAPPNAME_FOR_TITLE" |
Name of the FOCUS application accessed (where the FOCEXEC resides) when you click the title link. |
Additional Links | |
META name="LINK_DISPLAY_NAMEn" |
Name of additional search result links. Can include images, if necessary. Where n is the sequential number of the link you are creating (1, 2, 3, and so on). |
META name="FOCEXECn" |
Name of the report procedure that will be executed when nth link is clicked. |
META name="FOCSOURCEDATABASEn" |
Name of the data source for the nth link. Where n is the sequential number of the link (1, 2, 3, and so on). |
META name="FOCEXECAPPNAMEn" |
FOCUS application name for the nth link. Where n is the sequential number of the link (1, 2, 3, and so on). |
The following table describes the HTML format for a Managed Reporting report procedure.
Parameter |
Value |
---|---|
WebFOCUS Managed Reporting Access Details | |
META name="IBIMR_action_FOR_TITLE" |
Parameters to use for a Managed Reporting report that will execute when the main link is clicked. |
META name="IBIMR_sub_action_FOR_TITLE" | |
META name="IBIMR_fex_FOR_TITLE" | |
META name="IBIMR_folder_FOR_TITLE" | |
META name="IBIMR_drill_FOR_TITLE" | |
META name="IBIMR_domain_FOR_TITLE" | |
Additional Links | |
META name="LINK_DISPLAY_NAMEn" |
Name of additional search result links. Where n is the sequential number of the link you are creating (1, 2, 3, and so on). |
META name="IBIMR_actionn" |
Parameter to the Managed Reporting report for the nth link. |
META name="IBIMR_sub_actionn" | |
META name="IBIMR_fexn" | |
META name="IBIMR_folderN" | |
META name="IBIMR_drilln" | |
META name="IBIMR_domainn" |
The following table describes the HTML format required for an external URL.
Parameter |
Value |
---|---|
URL Access Details | |
META name="TITLE_URL" |
URL of the title link. |
META name="LINK_URLn" |
URL of the nth link. |
Additional Links | |
META name="LINK_DISPLAY_NAMEn" |
Name of additional search result links. Where n is the sequential number of the link you are creating (1, 2, 3, and so on). |
In the subsequent steps of this procedure, we will build our HTML output using the standalone report procedure parameters.
Give the TITLE tag a value, as noted in the previous table, that corresponds to the title you want to appear as the search result link.
When you assign a value to an output item, you can:
The Edit - Output Item Mapping dialog box opens, as shown in the following image.
In our example, the title is Acme Delux Classic Basketball Spike Mens.
The TITLE tag mapping field (in the Output Items Mapping pane) is populated. The following image shows these elements in the Output Mapping pane.
An Output_Attribute appears under the META tag.
Using our example, we type Department.
The name Mapping field is populated with your entry.
Select the retaildb.Department field to point to the value for Department in the database, as shown in the following image.
The name Mapping field is populated with your entry.
The following image shows the new mapping for the Department META entry. (You can set the View to represent the mapping between input and output items as a line.)
FOCEXEC_FOR_TITLE
The name Mapping field is populated with your entry.
The FOCEXEC in our example is prddet.
The content Mapping field is populated with your entry, as shown in the following image.
FOCSOURCEDATABASE_FOR_TITLE
FOCEXECAPPNAME_FOR_TITLE
The additional links in our example are Product Sheet and Summary Report.
LINK_DISPLAY_NAME1
The name Mapping field is populated with your entry.
In our example, the link name is Product Sheet. We also want a PDF icon to appear next to this name, so we include the path to the image in this element content, as follows:
content = "Product Sheet <img src="http://vlamdemo.ibi.com:8080/ ibi_html/javaassist/images/mr/mr_ex_pdf.gif" border="0">"
FOCEXEC1
FOCSOURCEDATABASE1
FOCEXECAPPNAME1
The following shows the META elements in the Output Items Mapping pane.
In our example, the second link is Summary Report. Our entries for this example are:
META name = "LINK_DISPLAY_NAME2" content = "Summary Report" META name = "FOCEXEC2" content = "prdsum" META name = "FOCSOURCEDATABASE2" content ="retaildb" META name = "FOCEXECAPPNAME2" content = "retail"
Note: Because this element can contain lengthy content, you can use the concatenate function to join strings, as shown in this procedure.
The Parameter and Parameter Value fields appear below the function pane.
Note: We recommend that you include all of the items from the XML document in the body. You can also add additional words or phrases you think will help locate this record.
Tip: Use the following guidelines when working with the concatenate functions.
To illustrate nesting Concatenate functions, use our example XML document, which contains 13 items that we want to include in the BODY element. In addition we want to include the word "Sporting" to make a total of 14. Because we have so many items to include, we select the @CONCAT(Param1, Param2, Param3, Param4) function to start. The following diagram shows the structure of the nested concatenate functions to join the desired string values and spaces for the record in our example.
Note: Considerations should be made in preparing data earlier in the process.
The Edit -- Param1 window opens with the same options (Edit from Input, Use Functions, Type in Constant, and Use Expression).
The value of our example Param1 will be @CONCAT(Param1, Param2, Param3, Param4). The following image shows the first concatenate selection (Step d) in the left Edit window, and the Param1 Edit window in the right Edit window.
Note: An additional Edit window appears each time you select a function as a parameter value.
From our example, we select Department for the Param1 value.
The Parameter Value field is populated with this value.
Using our example, we choose Category for Param3.
The Parameter Value field is populated with this value.
The following image shows the original Edit window and the Edit -- Param1 window. In the Edit -- Param1 window, we have assigned values for the 4 parameters of the Parma1 concatenate. Note that parameters 2 and 4 contain spaces.
The Edit -- Param1 window closes and the concatenate value appears in the Parameter Value field of the original Edit window, as shown in the following image.
The XML to HTML transform project is now complete. The following image is an example of the mapping between the input and output structure that shows the META tags and the BODY tags mapped to the original XML elements. (This image only shows one expanded META element to reveal its mapping.)
The transformation output is then indexed and becomes part of the content of a record.
The test results, which are the resulting HTML documents, appear in the Test Transform pane.
For more information on the structure of the document, see Magnify Protocols for Indexing Documents.
The Transform Location dialog box opens.
Note: The Transforms pane lists the transform projects that exist in the selected folder.
The transform now resides on the iWay server and configuration you selected and is available for selection in the Adapter Designer Transform object.
For our example, select XMLtoHTML_Search.
The Transform object appears in the Designer workspace.
The following image shows the process flow with the Create HTML object.
WebFOCUS |