From: <jbo...@li...> - 2006-04-20 15:56:18
|
Author: dam...@jb... Date: 2006-04-20 11:56:09 -0400 (Thu, 20 Apr 2006) New Revision: 3852 Added: labs/shotoku/trunk/shotoku-feeds/lib/ labs/shotoku/trunk/shotoku-feeds/lib/informa/ labs/shotoku/trunk/shotoku-feeds/lib/informa/jars/ labs/shotoku/trunk/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar Modified: labs/shotoku/trunk/shotoku-feeds/maven.xml labs/shotoku/trunk/shotoku-feeds/project.properties labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java Log: Added informa and a few changes from project to site. Added: labs/shotoku/trunk/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar =================================================================== (Binary files differ) Property changes on: labs/shotoku/trunk/shotoku-feeds/lib/informa/jars/informa-0.6.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: labs/shotoku/trunk/shotoku-feeds/maven.xml =================================================================== --- labs/shotoku/trunk/shotoku-feeds/maven.xml 2006-04-20 14:25:28 UTC (rev 3851) +++ labs/shotoku/trunk/shotoku-feeds/maven.xml 2006-04-20 15:56:09 UTC (rev 3852) @@ -6,19 +6,23 @@ <project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> <!-- Default war-project goals --> - <goal name="all"> - <attainGoal name="prj-all" /> - </goal> <goal name="build"> - <attainGoal name="prj-war-build" /> + <attainGoal name="war" /> </goal> <goal name="deploy"> - <attainGoal name="prj-war-deploy" /> + <ant:copy + file="target/shotoku-feeds.war" + todir="${local.deploy.dir}" /> </goal> <goal name="clean"> <attainGoal name="prj-clean" /> </goal> + <goal name="all"> + <attainGoal name="clean" /> + <attainGoal name="build" /> + <attainGoal name="deploy" /> + </goal> </project> Modified: labs/shotoku/trunk/shotoku-feeds/project.properties =================================================================== --- labs/shotoku/trunk/shotoku-feeds/project.properties 2006-04-20 14:25:28 UTC (rev 3851) +++ labs/shotoku/trunk/shotoku-feeds/project.properties 2006-04-20 15:56:09 UTC (rev 3852) @@ -1,3 +1,4 @@ maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/ maven.junit.fork=yes maven.war.src=${basedir}/src/web +maven.jar.informa=lib/informa/jars/informa-0.6.0.jar Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java =================================================================== --- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java 2006-04-20 14:25:28 UTC (rev 3851) +++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java 2006-04-20 15:56:09 UTC (rev 3852) @@ -124,6 +124,11 @@ */ private Map<String, String> feedDisplayNames; + /** + * <code>siteDisplayNames</code> - map: site name -> site display name. + */ + private Map<String, String> siteDisplayNames; + private DelegateContext context; private String baseServerAddress; @@ -133,8 +138,8 @@ String feedsBaseDir = ContentManager.getProperty(FEEDS_BASEDIR); if (feedsBaseDir == null) - throw new RuntimeException(FEEDS_BASEDIR" property missing from "+ - "shotoku.properties. Shotoku feeds needs"+ + throw new RuntimeException(FEEDS_BASEDIR+" property missing from "+ + "shotoku.properties. Shotoku Feeds needs"+ " this to know where to load the feeds "+ "descriptor files."); @@ -145,6 +150,7 @@ feeds = new HashMap<String, Map<String, Feed>>(); feedGroups = new LinkedHashMap<String, Set<String>>(); feedDisplayNames = new HashMap<String, String>(); + siteDisplayNames = new HashMap<String, String>(); // Preparing maps which will hold feed definitions. Map<String, Node> remoteFeedDefs = new HashMap<String, Node>(); @@ -212,7 +218,7 @@ * @return An array of site ids for this shotoku feeds instance. */ private String[] getSiteIds() { - if (FeedsHelper.getSiteIds() != null) { + if (FeedsHelper.getSiteIds() != null) return FeedsHelper.getSiteIds(); else return new String[] { "" }; @@ -465,7 +471,7 @@ newFeed.generate(new URL(address)); addFeed(feedNameReplaced, type, newFeed); } catch (Exception e) { - log.debug("Can't add feeed " + address + " : " + type + log.debug("Can't add feed " + address + " : " + type + ".", e); } } @@ -662,28 +668,36 @@ /** * Adds definitions of feeds to the given map, placing child nodes of * the given node in the appropriate map. - * @param feedDefinitions - * @param node + * @param feedDefinitions A map into which feeds will be added. + * @param node The node of the feeds descriptor file. * @throws SAXException * @throws IOException */ private void addFeedDefinitions(Map<String, Map<String, Node>> feedDefinitions, org.jboss.shotoku.Node node) throws SAXException, IOException { DOMParser parser = new DOMParser(); + // Parse the descriptor at the given Shotoku node. parser.parse(new InputSource(node.getContentInputStream())); + // Get the XML document element of the feed descriptor file. Node root = parser.getDocument().getDocumentElement(); Node n; NodeList nodes = root.getChildNodes(); Set<String> feedGroup = new LinkedHashSet<String>(); + // Each feed descriptor file has one feed group. + // Get the name of the feed group for this file. feedGroups.put(XmlTools.getAttributeValue(root, "display-name"), feedGroup); + // Iterate through the rest of the feed descriptor + // file to load all feeds for a given feed group. for (int i = 0; i < nodes.getLength(); i++) { n = nodes.item(i); if (feedDefinitions.get(n.getNodeName()) != null) { + // Get the name of the feed. String feedName = XmlTools.getAttributeValue(n, "name"); + // Add the feeds in the file to the group. addFeedNamesToGroup(feedGroup, feedName, n); feedDefinitions.get(n.getNodeName()).put(feedName, n); } |