The Data Editor
widget uses common operations such as sort
, and limit
to transform content received from one widget into outgoing content to be sent to a second widget. Using the Data Editor
widget, you can send only the content you need in a format that can be consumed by other data-displaying widgets.
The Data Editor
widget can consume the following two types of data:
- A URL from a remote Atom feed. In most cases, you will simply configure the Data Editor widget to point to an Atom feed URL in the catalog. Note that only Atom feeds are supported. If you attempt to use a different type of feed, you may get an error.
- Data in a table format.
The Data Editor
widget is one of several data converters in Mashup Center that transform and republish the event data, either to modify event data types or the output.
- You can wire the Data Editor widget to other widgets on the mashup page so that the Data Editor widget receives data from one widget, transforms the data, and then sends the data to another widget to display the data. For example, you can wire the Customer List widget to send data to the Data Editor widget, and then wire the Data Editorwidget to send the data to the Data Viewer widget.
Note: After wiring the three widgets, you may want to view the data in the Data Viewer widget before you do any transformation to confirm that the data is being sent properly. However, the data does not display in the Data Viewer widget immediately, as you might expect. In order to view the data in the Data Viewer widget before transforming the data in the Data Editor widget, you must open the configuration window of the Data Editor widget and click Save, even though you have not actually performed any data transformation.
- To configure the Data Editor widget, click the display menu in the upper right corner of the widget frame, and select Edit Settings to open the transformation window.
- To define a feed source and start the transformation, click Get Data from Feed, and either type or paste the URL to the remote feed or the feed created with the Mashup Center feed generator.
- After you define the feed source, you can do any of the following actions to the data:
- Click Select Fields to remove, rename, and reorder fields.
- Click Filter Entries to filter data based on the field, data type, and comparison type and value.
- Click Sort to sort data in ascending or descending order.
- Click Limit to limit the number of records in the data.
- Click Undo to undo all your changes and start over.
- To search for a service to retrieve additional data, click Add Fields, and do the following steps:
After you finish transforming the feed data and click Save, you can return to the transformation window to make additional changes by clicking Edit Transformation in the widget window or by clicking Edit Settings in the configuration window.
After you finish transforming the feed data and click Save, you may want to start the entire transformation process over again. To do this, click Redo Transformation in the widget window.
- Type a keyword in the field, for example stock, and click the search button.
- After the results display, click Set input >.
- In the field, select a field to use as input for this service.
- Click Test this service. Now Item 1 displays and shows you the data that this service provides.
- To select which piece of data to use in the new field, select Select new data.
- Click OK to save your changes and continue using the editor.
See the following table to learn which events the Data Editor
widget can send and receive:
Table 1. Data Editor events
- Content as Text: sends transformed data in a CSV-like string, for example:
Umpire Burls,Baba Reboot,
Hyde your Jekyll,Boney Thomas,
Greatest Hits,Donnie B Goode,
Still got lots,Gerry Jones,
Susie,Susie Cue,EU,Ad Tech,
One night long,Bebe Jeeze,
Onward Mother,Junior Brook,
May Flower,Stewart Lightel,
What a man likes,Perry
- Content as Table: sends data in a table structure.
- Content using URL (ATOM): receives a URL from an Atom feed. Produces errors if the feed or URL is not valid
- Content using Table: receives data in a table structure
Use the Data Editor
widget to filter customer revenue data from a feed and display the data in a bar chart.
- Download the sample spreadsheet to your local machine.
- Use the Mashup Center feed generator to create a feed from the spreadsheet. Name the new feed Customer Revenue.
- In the Details window of the Customer Revenue widget, copy the URL of the feed to your clipboard
- In the mashup builder, drag the Data Editor and Chart widgets onto the page.
- Click the display menu in the upper right corner of the Data Editor widget frame, and select Edit Wiring to open the wiring interface, and do the following steps:
- In the Select content to send section, select Content as Text.
- In the Select a widget to receive content section, select Chart.
- In the Select an action section, select Display Data using Any Data.
- Click Done.
- Click the display menu in the upper right corner of the Data Editor widget frame, and select Edit Settings.
- Click Get Data from Feed.
- In the Feed URL field, paste the URL of the Customer Revenue feed into the field, and click OK. Now the data from the feed displays at the top of the window
- In the window, do the following steps to filter the customer name and yearly revenue data from the rest of the data in the feed:
- Click Select Fields.
- At the bottom of the window, continue deselecting fields until you have only these four fields selected: Customer_Name, Y2005, Y2006, and Y2007.
- Click OK. Now the top left field updates to show the data you selected.
- To preview the data in a bar chart, click Preview. Now, in the bottom section of the window, you should see a bar chart that displays yearly revenue for the customers in the spread sheet.
- Click Done to close the window. You should now see the bar chart of customer revenue data on the mashup page.
- Click the display menu in the upper right corner of the Data Editor widget frame, and select Hide to move the widget from the page to the hidden widgets corral.
Parent topic: Widget reference: imc3