An icon that exports the contents of a specified table to a syndication feed such as a RSS/Atom. You must contain the Atom Feed Icon in a Form. You must set the Form control's requireSessionToken
property to false.
To provide custom content for the export, for example to provide custom feed metadata like title or last updated date, you can bind the Atom Feed Icon control's feedProvider
property value to a custom com.webmethods.caf.faces.data.IContentProvider
instance, or bind the Atom Feed Icon control's entriesProvider
property to a separate com.webmethods.caf.faces.data.ITableContentProvider
instance.
An IContentProvider
designed for atom feed metadata is the com.webmethods.caf.faces.data.export.AtomFeedExportProvider
class. It maps the properties of an existing IContentProvider
to a custom set of feed metadata elements or attributes with each element or attribute's content specified using a binding expression.
An ITableContentProvider
designed for atom entry metadata is the com.webmethods.caf.faces.data.export.AtomEntriesExportProvider
class. It maps the content of an existing ITableContentProvider
to a custom set of entry metadata elements or attributes with each element or attribute's content also specified using a binding expression.
The following example demonstrates the creation of an AtomFeedExportProvider
and an AtomEntriesExportProvider
in custom page bean methods. You bind the properties for which these methods are getters, myAtomFeedProvider and myAtomEntriesProvider to the Atom Feed Icon control's feedProvider
and entriesProvider
property values.
This example assumes that you have an existing table content provider for the raw table data, accessible using the getMyExistingTableContentProvider()
method. The getMyAtomFeedProvider()
method creates a map of property name/value pairs for the feed metadata, specifying the standard atom id, title, and author elements, and including a custom newToday
property to render as an attribute because its value is a simple String value. Although the AtomFeedExportProvider
allows for remapping keys from the feed's original content provider, in this example the content provider is just a static map, so there is no need to do so. The keys are generated with the AtomFeedExportProvider
static createDefaultKeys()
method performs an identity mapping by mapping each property to itself. You can use this static method to get the default set of keys for a dynamic content-provider, and remap just one or two custom properties, without changing the remaining properties.
The getMyAtomEntriesProvider()
method maps the three standard atom entry elements, id, title, and updated, plus two custom properties, priority
and priorityName
to row data, using binding expressions. You must specify the name of the row variable as the third argument to the AtomEntriesExportProvider
constructor. For each atom entry, the content of the entry's id element is generated from the value of the table row's projectId
and id
properties. The content of the entry's title element is generated from the value of the table row's title
property
public IContentProvider getMyAtomFeedProvider() {
Map feedProperties = new HashMap();
// standard atom metadata
feedProperties.put("id", "issues");
feedProperties.put("title", "Issues");
feedProperties.put("author", "DevTrack");
// custom metadata
feedProperties.put("newToday", getNewToday());
MapContentProvider feed = new MapContentProvider(feedProperties);
Map keys = AtomFeedExportProvider.createDefaultKeys(feed,"feed");
return new AtomFeedExportProvider(feed, keys, "feed"); }
public ITableContentProvider getMyAtomEntriesProvider() {
ITableContentProvider existingProvider =
getMyExistingTableContentProvider();
Map keys = new HashMap(); // standard atom metadata keys.put("id",
createValueBinding("#{row.projectId}_#{row.id}")); keys.put("title",
createValueBinding("#{row.title}")); keys.put("updated",
createValueBinding("#{row.lastModifiedDate}"));
// custom metadata
keys.put("priority", createValueBinding("#{row.priorityValue}"));
keys.put("priorityName", createValueBinding("#{row.priorityName}"));
return new AtomEntriesExportProvider(existingProvider,keys, "row"); }
This example shows how you might render the atom feed. The export processing handles escaping property values, for example, the Name should be "MWS"
value is escaped as Name should be "MWS")
:
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:base="http://mws:8585/" xml:lang="en-US"
xmlns="http://www.w3.org/2005/Atom"
xmlns:x="http://webmethods.com/caf/faces/data/export/atom/custom"
x:newToday="2">
<id>issues</id>
<title>Issues</title>
<updated>2007-05-22T21:18:40Z</updated>
<author>
<name>DevTrack</name>
</author>
<generator uri="http://webmethods.com/caf/faces/data/export/atom"
version="1.0">webMethods CAF AtomExportBean</generator>
<entry x:priority="1" x:priorityName="Critical">
<id>higgins_123</id>
<title>Nothing Works</title>
<updated>2007-05-22T21:18:40Z</updated>
</entry>
<entry x:priority="3" x:priorityName="Medium">
<id>higgins_ABC</id>
<title>Name should be 'MWS'</title>
<updated>2007-05-22T12:22:33Z</updated>
</entry>
<entry x:priority="4" x:priorityName="Low">
<id>getraer_TLC</id>
<title>I like monkey</title>
<updated>2007-03-02T01:12:11Z</updated>
</entry>
</feed>
To render custom properties such as the newToday
feed property and the priority
and priorityName
entry properties as elements, you can compose their values using Map
or IContentProvider
objects. Use the content key to indicate if the Map
property or the IContentProvider
should render as the content of the custom element.
In the following example, the feed's newToday
property is built out of a map with the map's content
property set to a String value. The feed's newToday
property renders as an element with the specified String value as the element's content.
In the following example, the entries' priority
property is built out of a map, with the map's content
property bound to the current table row's priorityName
property, and the map's number
property bound to the current table row's priorityValue
property. As a result, each entry's priority
property renders as an element, with the table row's priorityName
property as the entry's priority
element's content, and the table row's priorityValue
property as the number
attribute of the entry's priority
element.
public IContentProvider getMyAtomFeedProvider() {
Map feedProperties = new HashMap();
// standard atom metadata
feedProperties.put("id", "issues");
feedProperties.put("title", "Issues");
feedProperties.put("author", "DevTrack");
// custom metadata
Map newToday = new HashMap();
newToday.put("content", getNewToday());
feedProperties.put("newToday", newToday);
MapContentProvider feed = new MapContentProvider(feedProperties);
Map keys = AtomFeedExportProvider.createDefaultKeys(feed, "feed");
return new AtomFeedExportProvider(feed, keys, "feed");
}
public ITableContentProvider getMyAtomEntriesProvider() {
ITableContentProvider existingProvider =
getMyExistingTableContentProvider();
Map keys = new HashMap(); // standard atom metadata keys.put("id",
createValueBinding("#{row.projectId}_#{row.id}")); keys.put("title",
createValueBinding("#{row.title}")); keys.put("updated",
createValueBinding("#{row.lastModifiedDate}"));
// custom metadata
Map priority = new HashMap();
priority.put("content", createValueBinding("#{row.priorityName}"));
priority.put("number", createValueBinding("#{row.priorityValue}"));
feedProperties.put("priority", priority);
return new AtomEntriesExportProvider(existingProvider, keys, "row");}
You could render the atom feed as follows:
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:base="http://mws:8585/" xml:lang="en-US"
xmlns="http://www.w3.org/2005/Atom"
xmlns:x="http://webmethods.com/caf/faces/data/export/atom/custom">
<x:newToday>2</x:newToday>
<id>issues</id>
<title>Issues</title>
<updated>2007-05-22T21:18:40Z</updated>
<author>
<name>DevTrack</name>
</author>
<generator uri="http://webmethods.com/caf/faces/data/export/atom"
version="1.0">webMethods CAF AtomExportBean</generator>
<entry>
<x:priority number="1">Critical</x:priority>
<id>higgins_123</id>
<title>Nothing Works</title>
<updated>2007-05-22T21:18:40Z</updated>
</entry>
<entry>
<x:priority number="3">Medium</x:priority>
<id>higgins_ABC</id>
<title>Name should be 'MWS'</title>
<updated>2007-05-22T12:22:33Z</updated>
</entry>
<entry>
<x:priority number="4">Low</x:priority>
<id>getraer_TLC</id>
<title>I like monkey</title>
<updated>2007-03-02T01:12:11Z</updated>
</entry>
</feed>
You can specify a substitute URL for the syndication feed, using this control's feedUrl
property. You must manually generate the feed at that location using a servlet.
Using a Feed Reader
When a user attempts to subscribe to a feed generated in this manner, the user's feed reader first must log into My webMethods Server. The user must use a desktop-based feed reader. The user can add a Web-based feed reader when My webMethods Server is accessible outside of the corporate firewall, or when the Web-based feed reader is hosted within the same firewall as My webMethods Server. The user must also configure the feed with My webMethods Server credentials by adding username and password parameters to the feed URL. For example, if the atom feed URL was the following:
http://mws:8585/meta/default/wm_xt_fabricfolder/0000005202?export=atom
The user can add his or her username and password to the URL as in the following:
http://mws:8585/meta/default/wm_xt_fabricfolder/0000005202?export=atom&username=alice&password=alicepassword
Some feed readers also allow specifying authentication credentials directly in the user interface. To enable the feed reader to authenticate the credentials, a system administrator must set the feed�s authentication scheme to use the basic authentication scheme. For more information on setting a page's authentication scheme, see the Portlet URL Script control.
Children
Any. Children are displayed as the icon label, after the icon.
javax.faces.Parameter
children are added as request parameters to the link.
com.webmethods.caf.faces.portleturl.PortletUrlScript
children can hook into clientside JavaScript events such as onClick
.
Info | Value |
---|---|
Component Type | com.webmethods.caf.faces.export.AtomFeedIcon |
Handler Class | None |
Renderer Type | com.webmethods.caf.faces.export.AtomFeedIcon |
Description | Icon with a link to the atom syndication feed for a table |
Palette Location | CAF Html/Control/Table/Atom Feed Icon |
Client-Side Model | CAF.Link.Model |
Name | Required | Type | Description |
---|---|---|---|
accesskey | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Keyboard shortcut letter |
alt | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Text to display in place of image, when image cannot be viewed |
charset | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The character encoding of the resource designated by this hyperlink |
converter | false | javax.el.ValueExpression
(must evaluate to javax.faces.convert.Converter )
| A value binding expression for a method that returns a converter instance. |
converterMessage | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Will be used as the text of the converter message, replacing any message that comes from the converter. |
coords | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The position and shape of the hot spot on the screen (for use in client-side image maps) |
dir | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
Specifies the directionality of the flow of the content for the current element
Valid values are:
|
disabled | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True if control is grayed-out and un-modifiable
If not specified, the default value is "false". |
entriesProvider | false | javax.el.ValueExpression
(must evaluate to com.webmethods.caf.faces.data.ITableContentProvider )
| Table provider for the entries of the atom syndication feed |
feedProvider | false | javax.el.ValueExpression
(must evaluate to com.webmethods.caf.faces.data.IContentProvider )
| Provider for the feed properties of the atom syndication feed |
for | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Table Control to which this icon applies |
hreflang | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The language code of the resource designated by this hyperlink |
id | false | java.lang.String | Control identifier |
label | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Control label |
lang | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Specifies the language of the enclosed content |
onblur | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onblur" event handler |
onclick | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onclick" event handler |
ondblclick | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "ondblclick" event handler |
onfocus | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onfocus" event handler |
onkeydown | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onkeydown" event handler |
onkeypress | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onkeypress" event handler |
onkeyup | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onkeyup" event handler |
onmousedown | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmousedown" event handler |
onmousemove | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmousemove" event handler |
onmouseout | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmouseout" event handler |
onmouseover | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmouseover" event handler |
onmouseup | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmouseup" event handler |
rel | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The relationship from the current document to the anchor specified by this hyperlink. The value of this attribute is a space-separated list of link types |
rendered | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to render control; false to ignore it
If not specified, the default value is "true". |
rev | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| A reverse link from the anchor specified by this hyperlink to the current document. The value of this attribute is a space-separated list of link types. |
shape | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
The shape of the hot spot on the screen (for use in client-side image maps)
Valid values are:
|
style | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| HTML "style" attribute value |
styleClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
HTML "class" attribute value
Valid values are:
|
tabindex | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Order in tab (key) sequence, from 1 to n. Zero adds control to tab sequence, negative integer removes control. |
target | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
Name of a frame where the resource retrieved via this hyperlink is to be displayed
Valid values are:
|
title | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| HTML "title" attribute value (often displayed as a tooltip) |
type | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The content type of the resource designated by this hyperlink |
url | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of (base) image source |
urlMousedown | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| (optional) URL of image source to use when mouse is down over image |
urlMouseover | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| (optional) URL of image source to use when mouse is up over image |
value | false | javax.el.ValueExpression
(must evaluate to java.lang.Object )
| Control value |
Output generated by Vdldoc View Declaration Language Documentation Generator.