<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
  <header>
    <title>Welcome to the Feeder Plugin Example</title>
  </header>
  <body>
    <warning>
      This plugin is at an early stage of development, some features are not yet
      complete and the techniques for using it may change. Patches are, as
      always, welcome
    </warning>
    <section>
      <title>Apache Forrest - Feed Plugin</title>
      <p>
        This is an example site for the Apache Forrest Feeder Plugin. It
        provides examples of all the functionality in the plugin (look on the
        samples tab).
      </p>
      <section>
        <title>Usable Features</title>
        <section>
          <title>Embeding an RSS Feed in a Forrest content object</title>
          
          <p>
              This sample shows how a single RSS feed can be converted to an XDoc and
              included in a Forrest site. In order to do this you must first create a
              <code>feedDescriptor</code> file. This describes all the feeds that your
              project knows about. A simple example is:
            </p>
            <source>
        <![CDATA[
        <feedDescriptor>
          <feed id="BBCSport_UK">
            <url>http://news.bbc.co.uk/rss/sportonline_uk_edition/front_page/rss.xml</url>
          </feed>
        </feedDescriptor>
            ]]>
            </source>

            <p>
              Note that the <code>feedDescriptor</code> file has <strong>not</strong>
              xdoc format. A file named <code>feedDescriptor.xml</code> with exactly the
              above content should just work.
            </p>

            <p>
              In order to embed the data from the <code>planetApache</code> feed you
              create a link in the following form:
            </p>
            <source>&lt;a href="PATH_TO_FEED_DESCRIPTOR/FEED_DESCRIPTOR_NAME.rss.EXTENSION&gt;</source>
            <p>
              In this URL you must replace <code>PATH_TO_FEED_DESCRIPTOR</code> with the
              directory path to your feed descriptor file,
              <code>FEED_DESCRIPTOR_NAME</code> with the name of the descriptor file,
              and <code>EXTENSION</code> with the extension indicating the format you
              want the feed to be delivered in (i.e. html, pdf etc.)
            </p>
          <ul>
            <li><a href="samples/singleFeed.rss">As RSS</a> (no EXTENSION)</li>
            <li><a href="samples/singleFeed.rss.xml">As XDoc</a> (xml EXTENSION)</li>
            <li><a href="samples/singleFeed.rss.html">As HTML</a> (html EXTENSION)</li>
          </ul>
        </section>
      </section>
      <section>
        <title>In Progress Features</title>
        <section>
          <title>Aggregation</title>
            
            <note>aggregation works but is quite inflexible at present</note>
            
            <p>
              This sample shows how a number of different feeds can be aggregated into a
              single feed and then displayed in a Forrest site. Creating an aggregated
              feed is no different to embedding a <a href="samples/singleFeed.xml">single
              feed</a>. Simply add more feeds into your feed descriptor file and then
              link to it in the same way.
            </p>
            <p>
              For example:
            </p>
            <source>
        <![CDATA[
        <feedDescriptor>
          <feed id="BBCSport_UK">
            <url>http://news.bbc.co.uk/rss/sportonline_uk_edition/front_page/rss.xml</url>
          </feed>
          <feed id="USAToday_Sports">
            <url>http://www.usatoday.com/repurposing/SportsRss.xml</url>
          </feed>
        </feedDescriptor>
        ]]>
            </source>
            <ul>
              <li><a href="samples/aggregateFeed.rss">As RSS</a></li>
              <li><a href="samples/aggregateFeed.rss.xml">As XDoc</a></li>
              <li><a href="samples/aggregateFeed.rss.html">As HTML</a></li>
            </ul>
        </section>
        
        <section>
          <title>Tag Aggregation</title>
          <p>Aggregate feeds from multiple tagged sources, for example,
          include commonly tagged resources from multiple social bookmarking services.</p>
          
          <note>It works but doesn't remove duplicates and since it uses the aggregation templates
          (see above) is quite inflexible.</note>
          
          <section>
            <title>Configuration</title>
            <p>The feeder plugin provides a default set of resources that will be
            used for all tag aggregation requests. To customise this configuration 
            you need to provide a locationmap match in your project locationmap like the following:</p>
            
            <source><![CDATA[
    <match pattern="feeder.tag-[DESIRED_TAG].sources>
      <location src="resources/taggedSources.xml"/>
    </match>
            ]]></source> 
            
            <p>Remember to replace [DESIRED-TAG] with your chosen tag, or, if you want to use
            the same sources for all tags us a '*'.</p> 
            
            <p>Replace the source file with one of your own that describes the locations to retrieve content from.
            This document should be in the following format:</p>
            
            <p>Now request you resource with the URL:</p>
            
            <source>http://foo.org/DESIRED-TAG.tagFeed.rss.html</source>
            
            <p>For example, the following links aggregate content using the "JISCCommunityDevelopment"
            tag:</p>
            
            <source><![CDATA[
            ]]></source> 
            <ul>
              <li><a href="samples/JISCCommunityDevelopment.tagFeed.rss">As RSS</a></li>
              <li><a href="samples/JISCCommunityDevelopment.tagFeed.rss.xml">As XDoc</a></li>
              <li><a href="samples/JISCCommunityDevelopment.tagFeed.rss.html">As HTML</a></li>
            </ul>
          </section>
        </section>
      </section>
    </section>
  </body>
</document>
