[jboss-svn-commits] JBL Code SVN: r5391 - in labs/shotoku/trunk: lib/portal lib/taglibs shotoku-base/src/java/org/jboss/shotoku/tools shotoku-feeds shotoku-feeds/src/java/org/jboss/shotoku/feeds shotoku-feeds/src/java/org/jboss/shotoku/feeds/data shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter shotoku-feeds/src/java/org/jboss/shotoku/feeds/service shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools shotoku-feeds/src/web/WEB-INF

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 1 18:11:19 EDT 2006


Author: adamw
Date: 2006-08-01 18:11:11 -0400 (Tue, 01 Aug 2006)
New Revision: 5391

Added:
   labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
   labs/shotoku/trunk/lib/taglibs/portlet.jar
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AbstractFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/DummyFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/FeedsViewPortlet.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/AbstractFeedGetter.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/ViewFeedGetterWrapper.java
   labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml
   labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml
Removed:
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/
   labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/faces-config.xml
   labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/tld/
Modified:
   labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Constants.java
   labs/shotoku/trunk/shotoku-feeds/project.xml
   labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/CommentsService.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/CommentFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteCommentFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteTagFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/TagFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/BlankFeedGetter.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/StandardFeedGetter.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/ViewFeedGetter.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/CommentsServiceImpl.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedDefAttributes.java
   labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/web.xml
Log:
http://jira.jboss.org/jira/browse/JBSHOTOKU-38

Added: labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/shotoku/trunk/lib/taglibs/portlet.jar
===================================================================
(Binary files differ)


Property changes on: labs/shotoku/trunk/lib/taglibs/portlet.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Constants.java
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Constants.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Constants.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -61,4 +61,14 @@
      * Default key base prefix.
      */
     public final static String SHOTOKU_CACHE_KEY_BASE = "shotoku:cacheitem:keybase:";
+
+    /**
+     * A string denoting "true" value.
+     */
+    public static final String TRUE     = "true";
+
+    /**
+     * A string denoting "false" value.
+     */
+    public static final String FALSE    = "false";
 }

Modified: labs/shotoku/trunk/shotoku-feeds/project.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/project.xml	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/project.xml	2006-08-01 22:11:11 UTC (rev 5391)
@@ -95,10 +95,30 @@
         </dependency>
 
         <dependency>
-            <groupId>myfaces</groupId>
-            <artifactId>myfaces-all</artifactId>
-            <version>1.1.1</version>
+            <groupId>portlet-api</groupId>
+            <artifactId>portlet-api</artifactId>
+            <version>1.0</version>
         </dependency>
+
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>jstl</artifactId>
+            <version>1.0</version>
+            <jar>jstl.jar</jar>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>standard</artifactId>
+            <version>1.0</version>
+            <jar>standard.jar</jar>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
     </dependencies>
 
     <build>

Modified: labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml	2006-08-01 22:11:11 UTC (rev 5391)
@@ -11,13 +11,13 @@
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="shotoku-base" />
     <orderEntry type="module" module-name="shotoku-aop" />
-    <orderEntry type="library" name="feeds" level="application" />
     <orderEntry type="library" name="jboss" level="application" />
     <orderEntry type="library" name="velocity" level="application" />
     <orderEntry type="module" module-name="shotoku-tags" />
     <orderEntry type="library" name="junit" level="application" />
     <orderEntry type="module" module-name="shotoku-user" />
-    <orderEntry type="library" name="myfaces" level="application" />
+    <orderEntry type="library" name="feeds" level="application" />
+    <orderEntry type="library" name="portlet" level="application" />
     <orderEntryProperties />
   </component>
 </module>

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/CommentsService.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/CommentsService.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/CommentsService.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -19,8 +19,7 @@
             UnauthorizedToCommentException;
 
     public String getCommentFeedLink(String feedName,
-                                     String feedElement, String feedType,
-                                     String type);
+                                     String feedElement, String feedType);
 
     public Directory getCommentsDirectory(Node commentedNode)
             throws ResourceDoesNotExist;

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AbstractFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AbstractFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AbstractFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,98 @@
+package org.jboss.shotoku.feeds.data;
+
+import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
+
+import java.util.Map;
+
+import static org.jboss.shotoku.feeds.tools.FeedDefAttributes.EntriesExpandMode;
+import org.jboss.shotoku.tools.Tools;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public abstract class AbstractFeed implements Feed {
+    private String id;
+    private String name;
+    private String displayName;
+    private String type;
+    private Map<String, Object> attributes;
+    private Integer entriesVisible;
+    private EntriesExpandMode entriesExpandMode;
+    private Boolean entriesExpanded;
+    private String guid;
+
+    protected AbstractFeed(String id, String name, String displayName,
+                           String type, Map<String, Object> attributes) {
+        this.id = id;
+        this.name = name;
+        this.displayName = displayName;
+        this.type = type;
+        this.attributes = attributes;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public Map<String, Object> getAttributes() {
+        return attributes;
+    }
+
+    public int getEntriesVisible() {
+        if (entriesVisible == null) {
+            try {
+                entriesVisible = Integer.parseInt(Tools.toStringNotNull(
+                        attributes.get(
+                                FeedDefAttributes.ENTRIES_VISIBLE_ATTR)));
+            } catch (NumberFormatException e) {
+                entriesVisible = FeedDefAttributes.ENTRIES_VISIBLE_DEFAULT;
+            }
+        }
+
+        return entriesVisible;
+    }
+
+    public EntriesExpandMode getEntriesExpandMode() {
+        if (entriesExpandMode == null) {
+            try {
+                entriesExpandMode = EntriesExpandMode.valueOf(
+                        Tools.toStringNotNull(attributes.get(
+                                FeedDefAttributes.ENTRIES_EXPAND_MODE_ATTR)));
+            } catch (IllegalArgumentException e) {
+                entriesExpandMode =
+                        FeedDefAttributes.ENTRIES_EXPAND_MODE_DEFAULT;
+            }
+        }
+
+        return entriesExpandMode;
+    }
+
+    public boolean getEntriesExpanded() {
+        if (entriesExpanded == null) {
+            entriesExpanded = Tools.isTrue(Tools.toStringNotNull(
+                    attributes.get(FeedDefAttributes.ENTRIES_EXPANDED_ATTR)));
+        }
+
+        return entriesExpanded;
+    }
+
+    public String getGuid() {
+        if (guid == null) {
+            guid = getId() + "/" + getName() + "/" + getType() + "/";
+        }
+
+        return guid;
+    }
+}

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/DummyFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/DummyFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/DummyFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,71 @@
+package org.jboss.shotoku.feeds.data;
+
+import org.jboss.shotoku.feeds.data.model.FeedEntries;
+import org.jboss.shotoku.feeds.data.model.DummyFeedEntries;
+import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public class DummyFeed implements Feed {
+    public void write(OutputStream os,
+                      HttpServletRequest request) throws IOException {
+
+    }
+
+    public void write(HttpServletResponse response,
+                      HttpServletRequest request) throws IOException {
+
+    }
+
+    public String getName() {
+        return null;
+    }
+
+    public String getDisplayName() {
+        return null;
+    }
+
+    public String getType() {
+        return null;
+    }
+
+    public String getId() {
+        return null;
+    }
+
+    public void release() {
+
+    }
+
+    public Map<String, Object> getAttributes() {
+        return new HashMap<String, Object>();
+    }
+
+    public FeedEntries getFeedEntries() {
+        return new DummyFeedEntries();
+    }
+
+    public int getEntriesVisible() {
+        return 0;
+    }
+
+    public boolean getEntriesExpanded() {
+        return false;
+    }
+
+    public FeedDefAttributes.EntriesExpandMode getEntriesExpandMode() {
+        return FeedDefAttributes.EntriesExpandMode.TOP;
+    }
+
+    public String getGuid() {
+        return null;
+    }
+}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Feed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -1,6 +1,7 @@
 package org.jboss.shotoku.feeds.data;
 
 import org.jboss.shotoku.feeds.data.model.FeedEntries;
+import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
@@ -72,4 +73,32 @@
      * @return Entries of this feed.
      */
     public FeedEntries getFeedEntries();
+
+    /**
+     * Gets the number of entries that should be shown when displaying
+     * this feed, as stated in attributes.
+     * @return Number of entries that should be shown on one page.
+     */
+    public int getEntriesVisible();
+
+    /**
+     * Checks if entries should be displayed expanded when displaying
+     * this feed, as stated in attributes.
+     * @return True iff entries should be shown expanded on the page.
+     */
+    public boolean getEntriesExpanded();
+
+    /**
+     * Gets the default expand mode of entries for this feed. Only
+     * valid if {@see getEntriesExpanded()} return <code>false</code>.
+     * @return Mode in which selected entries of this feed should be
+     * shown when displaying.
+     */
+    public FeedDefAttributes.EntriesExpandMode getEntriesExpandMode();
+
+    /**
+     * Gets a unique identifier of this feed.
+     * @return A unique identifier of this feed.
+     */
+    public String getGuid();
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FileBasedFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -40,22 +40,14 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-public abstract class FileBasedFeed implements NormalFeed {
-    private String id;
+public abstract class FileBasedFeed extends AbstractFeed
+        implements NormalFeed {
     private File file;
-    private String name;
-    private String displayName;
-    private String type;
-    private Map<String, Object> attributes;
 
     public FileBasedFeed(String id, String name, String displayName,
                          String type, File file, Map<String, Object> attributes) {
-        this.id = id;
-        this.name = name;
-        this.displayName = displayName;
-        this.type = type;
+        super(id, name, displayName, type, attributes);
         this.file = file;
-        this.attributes = attributes;
     }
 
     public void generate(URL url) throws IOException {
@@ -127,27 +119,7 @@
         }
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public String getDisplayName() {
-        return displayName;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public String getId() {
-        return id;
-    }
-
     public void release() {
         file.delete();
     }
-
-    public Map<String, Object> getAttributes() {
-        return attributes;
-    }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -4,6 +4,7 @@
 import org.jboss.shotoku.Node;
 import org.jboss.shotoku.feeds.data.model.FeedEntries;
 import org.jboss.shotoku.feeds.tools.FeedsTools;
+import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
 import org.jboss.shotoku.feeds.comments.UnauthorizedToCommentException;
 import org.jboss.shotoku.feeds.comments.CommentsNotAvialableException;
 import org.jboss.shotoku.feeds.comments.FeedDoesNotExistException;
@@ -156,4 +157,20 @@
     public String getId() {
         return nf.getId();
     }
+
+    public FeedDefAttributes.EntriesExpandMode getEntriesExpandMode() {
+        return nf.getEntriesExpandMode();
+    }
+
+    public boolean getEntriesExpanded() {
+        return nf.getEntriesExpanded();
+    }
+
+    public int getEntriesVisible() {
+        return nf.getEntriesVisible();
+    }
+
+    public String getGuid() {
+        return nf.getGuid();
+    }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/CommentFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/CommentFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/CommentFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -13,6 +13,7 @@
 import org.jboss.shotoku.feeds.data.Feed;
 import org.jboss.shotoku.feeds.data.CommentableFeed;
 import org.jboss.shotoku.feeds.data.ShotokuCommentableFeed;
+import org.jboss.shotoku.feeds.data.AbstractFeed;
 import org.jboss.shotoku.feeds.data.model.FeedEntries;
 import org.jboss.shotoku.feeds.tools.FeedsTools;
 import org.jboss.shotoku.feeds.tools.NodesFeedsProperties;
@@ -31,11 +32,8 @@
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
-public abstract class CommentFeed implements SpecialFeed {
-    private String id;
-    private String name;
-    private String type;
-    Map<String, Object> attributes;
+public abstract class CommentFeed extends AbstractFeed
+        implements SpecialFeed {
     private VelocityContext vcOriginal;
 
     private int nameLength;
@@ -43,10 +41,7 @@
 
     public CommentFeed(String id, String name, String type,
                        Map<String, Object> attributes, VelocityContext vc) {
-        this.id = id;
-        this.name = name;
-        this.type = type;
-        this.attributes = attributes;
+        super(id, name, null, type, attributes);
         this.vcOriginal = vc;
 
         nameLength = name.length();
@@ -81,7 +76,7 @@
         String feedElement = info.substring(lastSlash+1);
 
         CommentableFeed feed = FeedsTools.getService().getCommentableFeed(
-                id, feedName, type);
+                getId(), feedName, getType());
 
         check(feed != null);
         //noinspection ConstantConditions
@@ -137,7 +132,7 @@
         try {
             OutputStreamWriter osw = new OutputStreamWriter(os);
             cm.getVelocityEngine().mergeTemplate(
-                    Tools.toString(attributes.get(
+                    Tools.toString(getAttributes().get(
                             FeedDefAttributes.VELOCITY_TEMPLATE)), vc, osw);
             osw.flush();
         } catch (Exception e) {
@@ -159,31 +154,11 @@
         throw new IOException("Can't write a non-concrete comment feed");
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public String getDisplayName() {
-        return null;
-    }
-
-    public String getType() {
-        return type;
-    }
-
     public void release() {
 
     }
 
-    public Map<String, Object> getAttributes() {
-        return attributes;
-    }
-
     public FeedEntries getFeedEntries() {
         throw new RuntimeException("Can't get entries of a special feed");
     }
-
-    public String getId() {
-        return id;
-    }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteCommentFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteCommentFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteCommentFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -2,6 +2,7 @@
 
 import org.jboss.shotoku.feeds.data.Feed;
 import org.jboss.shotoku.feeds.data.model.FeedEntries;
+import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -58,4 +59,20 @@
     public String getId() {
         return commentFeed.getId();
     }
+
+    public int getEntriesVisible() {
+        return commentFeed.getEntriesVisible();
+    }
+
+    public FeedDefAttributes.EntriesExpandMode getEntriesExpandMode() {
+        return commentFeed.getEntriesExpandMode();
+    }
+
+    public boolean getEntriesExpanded() {
+        return commentFeed.getEntriesExpanded();
+    }
+
+    public String getGuid() {
+        return commentFeed.getGuid();
+    }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteTagFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteTagFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/ConcreteTagFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -2,6 +2,7 @@
 
 import org.jboss.shotoku.feeds.data.Feed;
 import org.jboss.shotoku.feeds.data.model.FeedEntries;
+import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
@@ -58,4 +59,20 @@
     public String getId() {
         return tagFeed.getId();
     }
+
+    public boolean getEntriesExpanded() {
+        return tagFeed.getEntriesExpanded();
+    }
+
+    public FeedDefAttributes.EntriesExpandMode getEntriesExpandMode() {
+        return tagFeed.getEntriesExpandMode();
+    }
+
+    public int getEntriesVisible() {
+        return tagFeed.getEntriesVisible();
+    }
+
+    public String getGuid() {
+        return tagFeed.getGuid();
+    }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/TagFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/TagFeed.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/special/TagFeed.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -3,6 +3,7 @@
 import org.apache.velocity.VelocityContext;
 import org.jboss.shotoku.ContentManager;
 import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.data.AbstractFeed;
 import org.jboss.shotoku.feeds.data.model.FeedEntries;
 import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
 import org.jboss.shotoku.feeds.tools.VelocityContextAttributes;
@@ -25,11 +26,7 @@
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
-public abstract class TagFeed implements SpecialFeed {
-    private String id;
-    private String name;
-    private String type;
-    Map<String, Object> attributes;
+public abstract class TagFeed extends AbstractFeed implements SpecialFeed {
     private VelocityContext vcOriginal;
 
     private int limit;
@@ -38,10 +35,7 @@
 
     public TagFeed(String id, String name, String type,
                    Map<String, Object> attributes, VelocityContext vc) {
-        this.id = id;
-        this.name = name;
-        this.type = type;
-        this.attributes = attributes;
+        super(id, name, null, type, attributes);
         this.vcOriginal = vc;
 
         nameLength = name.length();
@@ -112,7 +106,7 @@
 
         String infoDataDecoded = infoTokens[1];
         infoDataDecoded = URLDecoder.decode(infoDataDecoded, "UTF-8");
-        String template = Tools.toString(attributes.get(
+        String template = Tools.toString(getAttributes().get(
                 FeedDefAttributes.VELOCITY_TEMPLATE));
 
         List<Tag> tags;
@@ -212,31 +206,11 @@
         throw new IOException("Can't write a non-concrete tag feed");
     }
 
-    public String getName() {
-        return name;
-    }
 
-    public String getDisplayName() {
-        return null;
-    }
-
-    public String getType() {
-        return type;
-    }
-
     public void release() {
 
     }
-
-    public Map<String, Object> getAttributes() {
-        return attributes;
-    }
-
     public FeedEntries getFeedEntries() {
         throw new RuntimeException("Can't get entries of a special feed");
     }
-
-    public String getId() {
-        return id;
-    }
 }

Copied: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet (from rev 5347, labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view)

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/FeedsViewPortlet.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/FeedsViewPortlet.java	2006-07-28 20:45:47 UTC (rev 5347)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/FeedsViewPortlet.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,239 @@
+package org.jboss.shotoku.feeds.portlet;
+
+import org.jboss.shotoku.feeds.portlet.getter.ViewFeedGetter;
+import org.jboss.shotoku.feeds.portlet.getter.BlankFeedGetter;
+import org.jboss.shotoku.feeds.portlet.getter.ViewFeedGetterWrapper;
+import org.jboss.shotoku.feeds.tools.FeedsTools;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
+import org.jboss.shotoku.feeds.FeedsDescriptor;
+import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.data.model.FeedEntry;
+import org.apache.log4j.Logger;
+
+import javax.portlet.*;
+import java.io.IOException;
+import java.util.List;
+
+import static org.jboss.shotoku.feeds.tools.FeedDefAttributes.EntriesExpandMode;
+import org.jboss.shotoku.tools.Constants;
+import org.jboss.shotoku.tools.Tools;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public class FeedsViewPortlet extends GenericPortlet {
+    private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
+
+    /*
+     * Paths to JSP pages.
+     */
+    private static final String JSP_BASE_PATH =
+            "/repo-access/shotoku-test/blog/";
+    private static final String JSP_MAIN    = JSP_BASE_PATH + "main.jsp";
+    private static final String JSP_SINGLE  = JSP_BASE_PATH + "single.jsp";
+
+    /*
+     * Names of session attributes where display info is held.
+     */
+    private static final String BEGIN_ATTR  = "begin";
+    private static final String END_ATTR    = "end";
+    private static final String SHOW_GUID   = "showGuid";
+    private static final String SHOW_ALL    = "showAll";
+    private static final String SHOW_SINGLE = "showSingle";
+
+    /**
+     * Parameter where operation type is held when doing ActionRequests.
+     */
+    private static final String OP_PARAM    = "op";
+
+    /**
+     * Parameter where guid of an entry is held when doing ActionRequests.
+     */
+    public static final String GUID_PARAM   = "guid";
+
+    /**
+     * Operation types.
+     */
+    private enum Operations {
+        // View an entry.
+        VIEW,
+        // Next page of entries.
+        NEXT,
+        // Previous page of entries.
+        PREVIOUS,
+        // Back from a single-entry view to the list view.
+        BACK
+    }
+
+    private ViewFeedGetter vfg;
+
+    private String getId() {
+        return "default";
+    }
+
+    public void init(PortletConfig portletConfig)
+            throws PortletException {
+        super.init(portletConfig);
+
+        try {
+            vfg = (ViewFeedGetter) Class.forName(FeedsTools.getService().
+                    getProperty(getId(), FeedsConstants.VIEW_FEED_GETTER)).
+                    newInstance();
+        } catch (Exception e) {
+            log.error("View feed getter class not found.", e);
+            vfg = new BlankFeedGetter();
+        }
+
+        vfg = new ViewFeedGetterWrapper(vfg);
+    }
+
+    private Object getSessionAttribute(PortletRequest request,
+                                       String feedGuid, String attrName) {
+        return request.getPortletSession().getAttribute(
+                feedGuid + attrName);
+    }
+
+    private void setSessionAttribute(PortletRequest request,
+                                     String feedGuid, String attrName,
+                                     Object attrValue) {
+        request.getPortletSession().setAttribute(
+                feedGuid + attrName, attrValue);
+    }
+
+    private int getEntriesBegin(String feedGuid, PortletRequest request) {
+        Integer begin = ((Integer) getSessionAttribute(request, feedGuid,
+                BEGIN_ATTR));
+
+        if (begin == null) {
+            // Setting to default
+            setSessionAttribute(request, feedGuid, BEGIN_ATTR, 0);
+            begin = 0;
+        }
+
+        return begin;
+    }
+
+    private int setEntriesBegin(String feedGuid, PortletRequest request,
+                                int newBegin) {
+        if (newBegin < 0) { newBegin = 0; }
+        setSessionAttribute(request, feedGuid, BEGIN_ATTR, newBegin);
+        return newBegin;
+    }
+
+    private int getFeedEntryIndex(List<FeedEntry> entries, String guid) {
+        int i = 0;
+        for (FeedEntry fe : entries) {
+            if (fe.getGuid().equals(guid)) {
+                return i;
+            }
+
+            i++;
+        }
+
+        return 0;
+    }
+
+    public void processAction(ActionRequest request,
+                              ActionResponse response)
+            throws PortletException, IOException {
+        // Getting the action.
+        Operations opType;
+        try {
+            opType = Operations.valueOf(request.getParameter(OP_PARAM));
+        } catch (IllegalArgumentException e) {
+            // Do nothing.
+            return;
+        }
+
+        // If action name is correct, getting the currently displayed feed.
+        Feed feed = vfg.getFeed(getId(), request);
+
+        switch (opType) {
+            case VIEW:
+                String guid = request.getParameter(GUID_PARAM);
+                setSessionAttribute(request, feed.getGuid(), SHOW_GUID, guid);
+
+                switch (feed.getEntriesExpandMode()) {
+                    case TOP :
+                        // We have to look up the entry and move the begin
+                        // index.
+                        setEntriesBegin(feed.getGuid(), request,
+                                getFeedEntryIndex( feed.getFeedEntries().
+                                        getEntries(), guid));
+                        break;
+
+                    case SINGLE:
+                        setSessionAttribute(request, feed.getGuid(),
+                                SHOW_SINGLE, true);
+                        break;
+
+                    case INPLACE:
+                        // No actions needed.
+                        break;
+                }
+
+                break;
+
+            case BACK:
+                setSessionAttribute(request, feed.getGuid(), SHOW_GUID, null);
+                setSessionAttribute(request, feed.getGuid(), SHOW_SINGLE, null);
+                break;
+
+            case NEXT:
+                setSessionAttribute(request, feed.getGuid(), SHOW_GUID, null);
+                setEntriesBegin(feed.getGuid(), request, getEntriesBegin(
+                        feed.getGuid(), request) +
+                        feed.getEntriesVisible());
+                break;
+
+            case PREVIOUS:
+                setSessionAttribute(request, feed.getGuid(), SHOW_GUID, null);
+                setEntriesBegin(feed.getGuid(), request, getEntriesBegin(
+                        feed.getGuid(), request) -
+                        feed.getEntriesVisible());
+                break;
+        }
+    }
+
+    public void doView(RenderRequest request,
+                       RenderResponse response)
+            throws PortletException, IOException {
+        // Getting the feed to display.
+        Feed feed = vfg.getFeed(getId(), request);
+
+        Object showSingleObj = getSessionAttribute(request, feed.getGuid(),
+                SHOW_SINGLE);
+        boolean showSingle = ((showSingleObj != null) &&
+                ((Boolean) showSingleObj));
+
+        response.setContentType("text/html");
+        if (showSingle) {
+            String guid = Tools.toStringNotNull(
+                    getSessionAttribute(request, feed.getGuid(), SHOW_GUID));
+
+            List<FeedEntry> entries = feed.getFeedEntries().getEntries();
+            request.setAttribute("entry",
+                    entries.get(getFeedEntryIndex(entries, guid)));
+
+            getPortletContext().getRequestDispatcher(JSP_SINGLE).include(
+                    request, response);
+        } else {
+            request.setAttribute("entries", feed.getFeedEntries());
+
+            // Setting posts boundaries.
+            int begin = getEntriesBegin(feed.getGuid(), request);
+            request.setAttribute(BEGIN_ATTR, begin);
+            request.setAttribute(END_ATTR, begin + feed.getEntriesVisible() - 1);
+
+            if (feed.getEntriesExpanded()) {
+                request.setAttribute(SHOW_ALL, true);
+            } else {
+                request.setAttribute(SHOW_GUID,
+                        getSessionAttribute(request, feed.getGuid(), SHOW_GUID));
+            }
+
+            getPortletContext().getRequestDispatcher(JSP_MAIN).include(request,
+                    response);
+        }
+    }
+}

Copied: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter (from rev 5372, labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/getter)

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/AbstractFeedGetter.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/getter/AbstractFeedGetter.java	2006-07-31 22:05:07 UTC (rev 5372)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/AbstractFeedGetter.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,23 @@
+package org.jboss.shotoku.feeds.portlet.getter;
+
+import org.jboss.shotoku.feeds.data.CommentableFeed;
+import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.tools.FeedsTools;
+
+import javax.portlet.PortletRequest;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public abstract class AbstractFeedGetter implements ViewFeedGetter {
+    public CommentableFeed getCommentableFeed(String id,
+                                              PortletRequest request) {
+        return FeedsTools.getService().getCommentableFeed(id,
+                getName(request), getType(request));
+    }
+
+    public Feed getFeed(String id, PortletRequest request) {
+        return FeedsTools.getService().getFeed(id, getName(request),
+                getType(request));
+    }
+}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/BlankFeedGetter.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/getter/BlankFeedGetter.java	2006-07-31 22:05:07 UTC (rev 5372)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/BlankFeedGetter.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -1,22 +1,24 @@
-package org.jboss.shotoku.feeds.view.getter;
+package org.jboss.shotoku.feeds.portlet.getter;
 
+import javax.portlet.PortletRequest;
+
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
-public class BlankFeedGetter implements ViewFeedGetter {
-    public String getName() {
+public class BlankFeedGetter extends AbstractFeedGetter {
+    public String getName(PortletRequest request) {
         return null;
     }
 
-    public String getType() {
+    public String getType(PortletRequest request) {
         return null;
     }
 
-    public String getEntry() {
+    public String getEntry(PortletRequest request) {
         return null;
     }
 
-    public Integer getFrom() {
+    public Integer getFrom(PortletRequest request) {
         return 0;
     }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/StandardFeedGetter.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/getter/StandardFeedGetter.java	2006-07-31 22:05:07 UTC (rev 5372)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/StandardFeedGetter.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -1,33 +1,28 @@
-package org.jboss.shotoku.feeds.view.getter;
+package org.jboss.shotoku.feeds.portlet.getter;
 
-import javax.faces.context.FacesContext;
-import java.util.Map;
+import javax.portlet.PortletRequest;
 
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
-public class StandardFeedGetter implements ViewFeedGetter {
-    private Map<String, String> getParameters() {
-        //noinspection unchecked
-        return FacesContext.getCurrentInstance().
-                getExternalContext().getRequestParameterMap();
+public class StandardFeedGetter extends AbstractFeedGetter {
+    public String getName(PortletRequest request) {
+        return "kosmos";
+        //return request.getParameter("name");
     }
 
-    public String getName() {
-         return getParameters().get("name");
+    public String getType(PortletRequest request) {
+        return "rss2";
+        //return request.getParameter("type");
     }
 
-    public String getType() {
-         return getParameters().get("type");
+    public String getEntry(PortletRequest request) {
+        return request.getParameter("entry");
     }
 
-    public String getEntry() {
-        return getParameters().get("entry");
-    }
-
-    public Integer getFrom() {
+    public Integer getFrom(PortletRequest request) {
         try {
-            return Integer.parseInt(getParameters().get("from"));
+            return Integer.parseInt(request.getParameter("from"));
         } catch (NumberFormatException e) {
             return null;
         }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/ViewFeedGetter.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/getter/ViewFeedGetter.java	2006-07-31 22:05:07 UTC (rev 5372)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/ViewFeedGetter.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -1,11 +1,20 @@
-package org.jboss.shotoku.feeds.view.getter;
+package org.jboss.shotoku.feeds.portlet.getter;
 
+import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.data.CommentableFeed;
+
+import javax.portlet.PortletRequest;
+
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
 public interface ViewFeedGetter {
-    public String getName();
-    public String getType();
-    public String getEntry();
-    public Integer getFrom();
+    public String getName(PortletRequest request);
+    public String getType(PortletRequest request);
+    public String getEntry(PortletRequest request);
+    public Integer getFrom(PortletRequest request);
+
+    public Feed getFeed(String id, PortletRequest request);
+    public CommentableFeed getCommentableFeed(String id,
+                                              PortletRequest request);
 }

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/ViewFeedGetterWrapper.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/view/getter/ViewFeedGetterWrapper.java	2006-07-31 22:05:07 UTC (rev 5372)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/getter/ViewFeedGetterWrapper.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,43 @@
+package org.jboss.shotoku.feeds.portlet.getter;
+
+import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.data.CommentableFeed;
+import org.jboss.shotoku.feeds.data.DummyFeed;
+
+import javax.portlet.PortletRequest;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public class ViewFeedGetterWrapper implements ViewFeedGetter {
+    private ViewFeedGetter vfg;
+
+    public ViewFeedGetterWrapper(ViewFeedGetter vfg) {
+        this.vfg = vfg;
+    }
+
+    public String getName(PortletRequest request) {
+        return vfg.getName(request);
+    }
+
+    public String getType(PortletRequest request) {
+        return vfg.getType(request);
+    }
+
+    public String getEntry(PortletRequest request) {
+        return vfg.getEntry(request);
+    }
+
+    public Integer getFrom(PortletRequest request) {
+        return vfg.getFrom(request);
+    }
+
+    public Feed getFeed(String id, PortletRequest request) {
+        Feed feed = vfg.getFeed(id, request);
+        return feed == null ? new DummyFeed() : feed;
+    }
+
+    public CommentableFeed getCommentableFeed(String id, PortletRequest request) {
+        return vfg.getCommentableFeed(id, request);
+    }
+}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/CommentsServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/CommentsServiceImpl.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/CommentsServiceImpl.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -107,10 +107,9 @@
     }
 
     public String getCommentFeedLink(String feedName,
-                                     String feedElement, String feedType,
-                                     String type) {
+                                     String feedElement, String feedType) {
         return "/feeds/comments/" + feedName + "/" +
-                Tools.encodeURL(feedElement) + "/" + type;
+                Tools.encodeURL(feedElement) + "/" + feedType;
     }
 
     private String getCommentsDirectoryName(Node commentedNode) {

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedDefAttributes.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedDefAttributes.java	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedDefAttributes.java	2006-08-01 22:11:11 UTC (rev 5391)
@@ -1,5 +1,7 @@
 package org.jboss.shotoku.feeds.tools;
 
+import org.jboss.shotoku.tools.Constants;
+
 /**
  * Names of meaningful xml-node attributes in definitions
  * of feeds.
@@ -53,4 +55,61 @@
      * Author of a feed.
      */
     public static final String AUTHOR   = "author";
+
+    /*
+    * Feed view parameters.
+    */
+
+    /**
+     * Attribute name: number of visible entries on the page.
+     */
+    public static final String ENTRIES_VISIBLE_ATTR     = "entriesVisible";
+
+    /**
+     * Attribute <code>ENTRIES_VISIBLE_ATTR</code>
+     * value: default number of visible entries on the page.
+     */
+    public static final Integer ENTRIES_VISIBLE_DEFAULT  = 10;
+
+    /**
+     * Attribute name: should entries be expanded or not
+     * (defaults to false).
+     */
+    public static final String ENTRIES_EXPANDED_ATTR    = "entriesExpanded";
+
+    /**
+     * Attribute name: expansion mode of entries (valid when
+     * <code>ENTRIES_EXPANDED_ATTR</code> is false) - the selected
+     * entry can be displayed at the top, or in the place where it was
+     * when it was selected.
+     */
+    public static final String ENTRIES_EXPAND_MODE_ATTR = "expandMode";
+
+    public static enum EntriesExpandMode {
+        /**
+         * Attribute <code>ENTRIES_EXPAND_MODE_TOP</code> value:
+         * selected entry should be displayed at the top.
+         */
+        TOP,
+        /**
+         * Attribute <code>ENTRIES_EXPAND_MODE_TOP</code> value:
+         * selected entry should be displayed where it was when it
+         * was selected.
+         */
+        INPLACE,
+        /**
+         * Attribute <code>ENTRIES_EXPAND_MODE_TOP</code> value:
+         * selected entry should be displayed as the only entry
+         * on the page (required for comments).
+         */
+        SINGLE
+    };
+
+    /**
+     * Attribute <code>ENTRIES_EXPAND_MODE_ATTR</code>
+     * value: by default, selected entries should be shown at the
+     * top.
+     */
+    public static final EntriesExpandMode ENTRIES_EXPAND_MODE_DEFAULT =
+            EntriesExpandMode.TOP;
 }

Deleted: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/faces-config.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/faces-config.xml	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/faces-config.xml	2006-08-01 22:11:11 UTC (rev 5391)
@@ -1,133 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<!DOCTYPE faces-config PUBLIC
-  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
-  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config>
-    <navigation-rule>
-		<from-view-id>/repo-access/shotoku-test/blog/main2.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>main2</from-outcome>
-			<to-view-id>/repo-access/shotoku-test/blog/main2.jsp</to-view-id>
-		</navigation-case>
-        <navigation-case>
-			<from-outcome>main3</from-outcome>
-			<to-view-id>/repo-access/shotoku-test/blog/main3.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-    <navigation-rule>
-		<from-view-id>/repo-access/shotoku-test/blog/main3.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>main2</from-outcome>
-			<to-view-id>/repo-access/shotoku-test/blog/main2.jsp</to-view-id>
-		</navigation-case>
-        <navigation-case>
-			<from-outcome>main3</from-outcome>
-			<to-view-id>/repo-access/shotoku-test/blog/main3.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-    <navigation-rule>
-		<from-view-id>/</from-view-id>
-		<navigation-case>
-			<from-outcome>main2</from-outcome>
-			<to-view-id>/repo-access/shotoku-test/blog/main2.jsp</to-view-id>
-		</navigation-case>
-        <navigation-case>
-			<from-outcome>main3</from-outcome>
-			<to-view-id>/repo-access/shotoku-test/blog/main3.jsp</to-view-id>
-		</navigation-case>
-    </navigation-rule>
-
-    <managed-bean>
-		<managed-bean-name>configuration</managed-bean-name>
-		<managed-bean-class>org.jboss.shotoku.feeds.view.ViewConfigurationBean</managed-bean-class>
-		<managed-bean-scope>application</managed-bean-scope>
-	</managed-bean>
-
-    <managed-bean>
-		<managed-bean-name>feed</managed-bean-name>
-		<managed-bean-class>org.jboss.shotoku.feeds.view.FeedBean</managed-bean-class>
-		<managed-bean-scope>session</managed-bean-scope>
-		<managed-property>
-			<property-name>configuration</property-name>
-			<value>#{configuration}</value>
-		</managed-property>
-	</managed-bean>
-
-    <!--<navigation-rule>
-		<from-view-id>/repo-access/default/contributor/contributor.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>apply</from-outcome>
-			<to-view-id>/repo-access/default/contributor/apply.jsp</to-view-id>
-		</navigation-case>
-		<navigation-case>
-			<from-outcome>admin</from-outcome>
-			<to-view-id>/repo-access/default/contributor/admin.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-	<navigation-rule>
-		<from-view-id>/repo-access/default/contributor/admin.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>back</from-outcome>
-			<to-view-id>/repo-access/default/contributor/contributor.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-	<navigation-rule>
-		<from-view-id>/repo-access/default/contributor/apply.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>back</from-outcome>
-			<to-view-id>/repo-access/default/contributor/contributor.jsp</to-view-id>
-		</navigation-case>
-		<navigation-case>
-			<from-outcome>individual</from-outcome>
-			<to-view-id>/repo-access/default/contributor/individual.jsp</to-view-id>
-		</navigation-case>
-		<navigation-case>
-			<from-outcome>corporate</from-outcome>
-			<to-view-id>/repo-access/default/contributor/corporate.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-	<navigation-rule>
-		<from-view-id>/repo-access/default/contributor/individual.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>back</from-outcome>
-			<to-view-id>/repo-access/default/contributor/apply.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-	<navigation-rule>
-		<from-view-id>/repo-access/default/contributor/corporate.jsp</from-view-id>
-		<navigation-case>
-			<from-outcome>back</from-outcome>
-			<to-view-id>/repo-access/default/contributor/apply.jsp</to-view-id>
-		</navigation-case>
-	</navigation-rule>
-
-	<managed-bean>
-		<managed-bean-name>conServer</managed-bean-name>
-		<managed-bean-class>org.jboss.forge.contributor.ConServer</managed-bean-class>
-		<managed-bean-scope>application</managed-bean-scope>
-	</managed-bean>
-
-	<managed-bean>
-		<managed-bean-name>con</managed-bean-name>
-		<managed-bean-class>org.jboss.forge.contributor.ConMainBean</managed-bean-class>
-		<managed-bean-scope>session</managed-bean-scope>
-		<managed-property>
-			<property-name>server</property-name>
-			<value>#{conServer}</value>
-		</managed-property>
-	</managed-bean>
-
-	<managed-bean>
-		<managed-bean-name>conAccessBean</managed-bean-name>
-		<managed-bean-class>org.jboss.forge.contributor.ConAccessBean</managed-bean-class>
-		<managed-bean-scope>request</managed-bean-scope>
-	</managed-bean> -->
-</faces-config>

Added: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+    <deployment>
+        <if-exists>overwrite</if-exists>
+        <instance>
+            <instance-name>FeedsViewPortletInstance</instance-name>
+            <component-ref>feeds.FeedsViewPortlet</component-ref>
+        </instance>
+    </deployment>
+
+    <deployment>
+		<if-exists>overwrite</if-exists>
+		<parent-ref>default</parent-ref>
+		<page>
+			<page-name>feedsview</page-name>
+			<window>
+				<window-name>FeedsViewPortletWindow</window-name>
+				<instance-ref>FeedsViewPortletInstance</instance-ref>
+				<region>center</region>
+				<height>0</height>
+			</window>
+		</page>
+	</deployment>
+</deployments>

Added: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml	2006-08-01 22:11:11 UTC (rev 5391)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0">
+    <portlet>
+        <portlet-name>FeedsViewPortlet</portlet-name>
+        <portlet-class>org.jboss.shotoku.feeds.portlet.FeedsViewPortlet</portlet-class>
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+        </supports>
+        <supported-locale>en</supported-locale>
+        <portlet-info>
+            <title>JBoss Feeds View Portlet</title>
+        </portlet-info>
+    </portlet>
+</portlet-app>

Modified: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/web.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/web.xml	2006-08-01 22:07:14 UTC (rev 5390)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/web.xml	2006-08-01 22:11:11 UTC (rev 5391)
@@ -56,21 +56,4 @@
         <servlet-name>commentsServlet</servlet-name>
         <url-pattern>/comments/*</url-pattern>
     </servlet-mapping>
-
-    <!-- Feeds-view JSF servlet -->
-
-    <listener>
-        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-    </listener>
-
-    <servlet>
-        <servlet-name>Faces Servlet</servlet-name>
-        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>Faces Servlet</servlet-name>
-        <url-pattern>/view/*</url-pattern>
-    </servlet-mapping>
 </web-app>
\ No newline at end of file




More information about the jboss-svn-commits mailing list