Building a mashup using the feed mashup builder requires an understanding of the operators available to manipulate the data from within the builder. The Feed Mashup Builder supplies eight operators for importing and manipulating the data in a mashup.
Estimated time to complete this lesson: 15 minutes
Each Mashup Builder operator is described below. This information will help you to understand how the operators are used in the mashups created later in the module.
The Mashup Builder Help
contains additional information about the operators. It is available from the right corner of the screen, directly above the canvas of the Mashup Builder. Once an operator is placed on the canvas, help about that operator is available by clicking on the ?
(question mark) in the right, upper corner of the Details window.
The feed mashup examples, available from the Getting Started
section of the home tab, contain usage examples for each operator in a complete mashup. These examples contain simple scenarios to create mashups that are limited in scope.
Refer to the example mashups before or after completing the mashups in the tutorial to gain a deep understanding of the process of using the mashup operators in the feed mashup builder.
- Source Operator
- Combine Operator
- Filter Operator
- For Each Operator
- Group Operator
- Merge Operator
- Publish Operator
- Sort Operator
- Transform Operator
The Source operator imports data into the mashup. The data must be an XML, Atom or RSS feed. The feed can be a MashupHub feed in the catalog, or an Internet or intranet feed or file. A Source operator is always the first operator in a mashup.
The Combine operator takes two or more input operators and creates one feed containing all the entries from each input operator.
For example, if three input operators are used as input to the Combine operator and each input operator has five entries, the outgoing feed will have fifteen entries. The five from the first feed will be listed, then the five from the second feed, and so on.
The Filter operator takes one input operator, applies one or more conditions to the incoming entries and retains only those entries that satisfy the condition.
Variables can be declared in the Filter operator. The variable can be set with a default value used at run time, or when running the feed mashup they can be overridden in the query string.
For Each Operator
The For Each operator takes two input operators and creates a feed which places the values from one operator into the URL parameter for another operator and runs the URL to return the results.
An example of using the For Each operator is combining the first input feed which contains a list of hotels with corresponding zip codes, and the second input operator which is a weather service URL feed. The weather URL contains a parameter for the zip code to return the weather conditions at that zip code. The operator runs the weather feed URL for each hotel zip code by assigning the zip code to the weather feed URL zip code parameter. The result is a weather report for the zip code at the particular hotel location.
The Group operator takes one input operator and groups the incoming elements into categories based on the group element specified. Nesting elements, or associated data elements, can also be specified.
For example, if an incoming feed contains state and city elements and the feed is grouped by state, one entry for each unique state will appear in the output. If an associated data element of city is also specified, the output contains one entry for each state and a list of all cities (not unique) that are in that state.
Multiple grouping and nesting elements can be specified.
The Merge operator takes two input operators and applies a condition to each element value specified in the condition.
For instance, if one feed has an element called title, and another feed has an element called name, the condition if title/text() contains name/text()
can be applied. Only those entries where the value of the title contained the value of the name elements in the other feed appear in the output. Each entry from each input is compared to the other.
: Always use the text value of elements when applying conditions in Merge. The syntax shown above, title/text()
, refers to the text element contained under the title
The Publish operator is used to specify the format of the saved feed mashup. The format output types for the Publish operator are Atom, RSS and XML. Once the mashup is saved to the catalog, the output specified in this operator is applied to the feed and the appropriate header elements are added to the mashup. In the case of XML output type, the root and repeating elements are added to the output.
: The Publish operator only changes the Header of the feed. If a valid feed format is required, use the Transform operator to convert the individual elements of the feed to the desired format.
The Sort operator takes one input operator and performs a datetime, decimal, integer or string based sorting of the element specified in the condition. Either an ascending or descending order can be specified.
For example, an RSS feed contains a pubDate element for each entry in the feed. By specifying the element as a datetime, the Sort operator can sort the entries by the pubDate element. Supported datetime formats are ISO-8601, RFC-822, and RFC-2822. Atom and RSS feeds use these formats.
The Transform operator takes one input operator and modifies the output by manipulating the incoming elements. Elements can be removed, new elements can be added, and the value of existing elements can be modified to produce new output.
Text and math functions are used to modify the element values. Right-click a new element in the Output area of the Transform operator to specify the use of a function.
Lesson 3: Learning How to Create a Mashup V1.0
MashupHub Tutorial - Table of Contents:
Welcome to MashupHub V1.0
Module 1: Introduction to MashupHub V1.0
Module 2: Creating Feeds V1.0
Module 3: Creating Feed Mashups V1.0
Module 4: Using MashupHub Objects in Lotus Mashups V1.0
Module 5: Additional Resources and Summary V1.0