/**   
 * License Agreement for OpenSearchServer
 *
 * Copyright (C) 2013 Emmanuel Keller / Jaeksoft
 * 
 * http://www.open-search-server.com
 * 
 * This file is part of OpenSearchServer.
 *
 * OpenSearchServer is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 * OpenSearchServer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with OpenSearchServer. 
 *  If not, see <http://www.gnu.org/licenses/>.
 **/

package com.jaeksoft.searchlib.parser;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.io.IOUtils;

import com.jaeksoft.searchlib.SearchLibException;
import com.jaeksoft.searchlib.analysis.ClassPropertyEnum;
import com.jaeksoft.searchlib.analysis.LanguageEnum;
import com.jaeksoft.searchlib.streamlimiter.StreamLimiter;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;

public class RssParser extends Parser {

	private static ParserFieldEnum[] fieldList = { ParserFieldEnum.parser_name,
			ParserFieldEnum.channel_title, ParserFieldEnum.channel_link,
			ParserFieldEnum.channel_description, ParserFieldEnum.title,
			ParserFieldEnum.link, ParserFieldEnum.description };

	public RssParser() {
		super(fieldList);
	}

	@Override
	public void initProperties() throws SearchLibException {
		super.initProperties();
		addProperty(ClassPropertyEnum.SIZE_LIMIT, "0", null);
		addProperty(ClassPropertyEnum.RSS_METHOD,
				ClassPropertyEnum.RSS_METHODS[0], ClassPropertyEnum.RSS_METHODS);
	}

	@Override
	protected void parseContent(StreamLimiter streamLimiter, LanguageEnum lang)
			throws IOException {

		String p = getProperty(ClassPropertyEnum.RSS_METHOD).getValue();
		boolean oneResult = p == null
				|| ClassPropertyEnum.RSS_METHODS[0].equals(p);

		XmlReader reader = null;
		try {
			SyndFeedInput input = new SyndFeedInput();
			reader = new XmlReader(streamLimiter.getNewInputStream());
			SyndFeed feed = input.build(reader);
			List<?> entries = feed.getEntries();
			if (entries == null)
				return;
			Iterator<?> itEntries = entries.iterator();

			ParserResultItem resultItem = oneResult ? getNewParserResultItem()
					: null;

			while (itEntries.hasNext()) {
				if (!oneResult)
					resultItem = getNewParserResultItem();

				SyndEntry entry = (SyndEntry) itEntries.next();
				resultItem.addField(ParserFieldEnum.channel_title,
						feed.getTitle());
				resultItem.addField(ParserFieldEnum.channel_link,
						feed.getLink());
				resultItem.addField(ParserFieldEnum.channel_description,
						feed.getDescription());
				resultItem.addField(ParserFieldEnum.title, entry.getTitle());
				resultItem.addField(ParserFieldEnum.link, entry.getLink());
				resultItem.addField(ParserFieldEnum.description, entry
						.getDescription().getValue());
				addDetectedLink(entry.getLink());
			}
		} catch (IllegalArgumentException e) {
			throw new IOException(e);
		} catch (FeedException e) {
			throw new IOException(e);
		} finally {
			if (reader != null)
				IOUtils.closeQuietly(reader);
		}

	}
}

@@ -3125,24 +3125,112 @@
 ription());%0A
+%09%09%09%09resultItem.addField(ParserFieldEnum.creation_date,%0A%09%09%09%09%09%09entry.getPublishedDate());%0A
 %09%09%09%09resultIt

Add publication date to RSSParser