/
Atom Query Response Transformer

Atom Query Response Transformer

Description

The Atom Query Response Transformer transforms a Query Response into an Atom 1.0 feed. The Atom transformer maps a QueryResponse object as described in the Query Result Mapping

Sample Results

Sample Atom Feed from QueryResponse object
 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
	<title type="text">Query Response</title>
	<updated>2013-01-31T23:22:37.298Z</updated>
	<id>urn:uuid:a27352c9-f935-45f0-9b8c-5803095164bb</id>
	<link href="#" rel="self" />
	<author>
		<name>Lockheed Martin</name>
	</author>
	<generator version="2.1.0.20130129-1341">ddf123</generator>
	<os:totalResults>1</os:totalResults>
	<os:itemsPerPage>10</os:itemsPerPage>
	<os:startIndex>1</os:startIndex>
	<entry xmlns:relevance="http://a9.com/-/opensearch/extensions/relevance/1.0/" xmlns:fs="http://a9.com/-/opensearch/extensions/federation/1.0/"
		xmlns:georss="http://www.georss.org/georss">
		<fs:resultSource fs:sourceId="ddf123" />
		<relevance:score>0.19</relevance:score>
		<id>urn:catalog:id:ee7a161e01754b9db1872bfe39d1ea09</id>
		<title type="text">F-15 lands in Libya; Crew Picked Up</title>
		<updated>2013-01-31T23:22:31.648Z</updated>
		<published>2013-01-31T23:22:31.648Z</published>
		<link href="http://123.45.67.123:8181/services/catalog/ddf123/ee7a161e01754b9db1872bfe39d1ea09" rel="alternate" title="View Complete Metacard" />
		<category term="Resource" />
		<georss:where xmlns:gml="http://www.opengis.net/gml">
			<gml:Point>
				<gml:pos>32.8751900768792 13.1874561309814</gml:pos>
			</gml:Point>
		</georss:where>
		<content type="application/xml">
			<ns3:metacard xmlns:ns3="urn:catalog:metacard" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns1="http://www.opengis.net/gml"
				xmlns:ns4="http://www.w3.org/2001/SMIL20/" xmlns:ns5="http://www.w3.org/2001/SMIL20/Language" ns1:id="4535c53fc8bc4404a1d32a5ce7a29585">
				<ns3:type>ddf.metacard</ns3:type>
				<ns3:source>ddf.distribution</ns3:source>
				<ns3:geometry name="location">
					<ns3:value>
						<ns1:Point>
							<ns1:pos>32.8751900768792 13.1874561309814</ns1:pos>
						</ns1:Point>
					</ns3:value>
				</ns3:geometry>
				<ns3:dateTime name="created">
					<ns3:value>2013-01-31T16:22:31.648-07:00</ns3:value>
				</ns3:dateTime>
				<ns3:dateTime name="modified">
					<ns3:value>2013-01-31T16:22:31.648-07:00</ns3:value>
				</ns3:dateTime>
				<ns3:stringxml name="metadata">
					<ns3:value>
						<ns6:xml xmlns:ns6="urn:sample:namespace" xmlns="urn:sample:namespace">Example description.</ns6:xml>
					</ns3:value>
				</ns3:stringxml>
				<ns3:string name="metadata-content-type-version">
					<ns3:value>myVersion</ns3:value>
				</ns3:string>
				<ns3:string name="metadata-content-type">
					<ns3:value>myType</ns3:value>
				</ns3:string>
				<ns3:string name="title">
					<ns3:value>Example title</ns3:value>
				</ns3:string>
			</ns3:metacard>
		</content>
	</entry>
</feed>

 

Query Result Mapping

XPath to Atom XMLValue
/feed/title"Query Response"
/feed/updatedISO 8601 dateTime of when the feed was generated
/feed/idGenerated UUID URN
/feed/author/namePlatform Global Configuration organization
/feed/generatorPlatform Global Configuration site name
/feed/generator/@versionPlatform Global Configuration version
/feed/os:totalResultsSourceResponse Number of Hits
/feed/os:itemsPerPageRequest's Page Size
/feed/os:startIndexRequest's Start Index
/feed/entry/fs:resultSource/@fs:sourceIdSource Id from which the Result came. Metacard.getSourceId()
/feed/entry/relevance:scoreResult's relevance score if applicable. Result.getRelevanceScore()
/feed/entry/idurn:catalog:id:<Metacard.ID>
/feed/entry/titleMetacard.TITLE
/feed/entry/updatedISO 8601 dateTime of Metacard.MODIFIED
/feed/entry/publishedISO 8601 dateTime of Metacard.CREATED
/feed/entry/link[@rel='related']URL to retrieve underlying resource (if applicable and link is available)
/feed/entry/link[@rel='alternate']Link to alternate view of the Metacard (if a link is available)
/feed/entry/categoryMetacard.CONTENT_TYPE
/feed/entry//georss:whereGeoRSS GML of every Metacard attribute with format AttributeFormat.GEOMETRY
/feed/entry/content

Metacard XML generated by ddf.catalog.transform.MetacardTransformer with shortname=xml.

If no transformer found, /feed/entry/content/@type will be text and Metacard.ID is displayed

Sample Content with no Metacard Transformation
<content type="text">4e1f38d1913b4e93ac622e6c1b258f89</content>

Usage

Use this transformer when Atom is the preferred medium of communicating information such as for feed readers or federation. An integrator could use this with an endpoint to transform query responses into an Atom feed. 

For example, clients can use the OpenSearch Endpoint. The client can query with the format option set to the shortname, atom

Sample OpenSearch query with Atom specified as return format
http://localhost:8181/services/catalog/query?q=ddf?format=atom
 

Developers could use this transformer to programmatically transform QueryResponse objects on the fly (See Implementation Details on the details to acquire the Service).

Installation and Uninstallation

Catalog Transformers App will install this feature when deployed. This transformer's feature, catalog-transformer-atom, can be uninstalled or installed using the normal processes described in the Configuration section.