[seam-commits] Seam SVN: r10397 - in trunk/examples/wiki: src/main/org/jboss/seam/wiki/core/plugin/metamodel and 6 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Apr 14 10:49:31 EDT 2009


Author: christian.bauer at jboss.com
Date: 2009-04-14 10:49:30 -0400 (Tue, 14 Apr 2009)
New Revision: 10397

Added:
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml
Modified:
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml
   trunk/examples/wiki/view/userProfile_d.xhtml
Log:
JBSEAM-2629, new user profile plugin showing forum posting history

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/WikiPluginMacro.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -19,7 +19,6 @@
 import java.io.Serializable;
 import java.util.Map;
 import java.util.HashMap;
-import java.util.UUID;
 import java.util.Date;
 
 /**
@@ -121,11 +120,11 @@
     }
 
     public String getRequestImagePath() {
-        return getRequestPathPrefix() + getMetadata().getRequestImagePath();
+        return getRequestPathPrefix() + getMetadata().getImagePath();
     }
 
-    public String getRequestCSSPath() {
-        return getRequestPathPrefix() + getMetadata().getRequestCSSPath();
+    public String getRequestStylesheetPath() {
+        return getRequestPathPrefix() + getMetadata().getStylesheetPath();
     }
 
     private String getRequestPathPrefix() {

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/MacroPluginModule.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -126,20 +126,6 @@
         return Collections.unmodifiableList(new ArrayList(parameters));
     }
 
-    public String getRequestImagePath() {
-        return Plugin.GENERATE_RESOURCE_PATH_THEME
-                + "/" + getPlugin().getKey()
-                + "/" + getKey()
-                + "/" + Plugin.PACKAGE_THEMES_IMG;
-    }
-
-    public String getRequestCSSPath() {
-        return Plugin.GENERATE_RESOURCE_PATH_THEME
-                + "/" + getPlugin().getKey()
-                + "/" + getKey() 
-                + "/" + Plugin.PACKAGE_THEMES_CSS;
-    }
-
     // TODO: This is only used in the Administration UI
     public String getModuleTypeLabel() {
         return "Macro";

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/plugin/metamodel/PluginModule.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -109,5 +109,19 @@
         return getFullyQualifiedKey() + "." + name;
     }
 
+    public String getImagePath() {
+        return Plugin.GENERATE_RESOURCE_PATH_THEME
+                + "/" + getPlugin().getKey()
+                + "/" + getKey()
+                + "/" + Plugin.PACKAGE_THEMES_IMG;
+    }
+
+    public String getStylesheetPath() {
+        return Plugin.GENERATE_RESOURCE_PATH_THEME
+                + "/" + getPlugin().getKey()
+                + "/" + getKey()
+                + "/" + Plugin.PACKAGE_THEMES_CSS;
+    }
+
     public abstract String getModuleTypeLabel();
 }

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -16,10 +16,8 @@
 import org.jboss.seam.util.Resources;
 import org.jboss.seam.web.AbstractResource;
 import org.jboss.seam.wiki.core.plugin.PluginRegistry;
-import org.jboss.seam.wiki.core.plugin.WikiPluginMacro;
 import org.jboss.seam.wiki.core.plugin.metamodel.Plugin;
-import org.jboss.seam.wiki.core.plugin.metamodel.MacroPluginModule;
-import org.jboss.seam.wiki.core.model.WikiTextMacro;
+import org.jboss.seam.wiki.core.plugin.metamodel.PluginModule;
 import org.jboss.seam.core.Expressions;
 
 import javax.servlet.ServletException;
@@ -41,9 +39,9 @@
  * <p>
  * It is primarily used for serving up plugin CSS and image files. It can also interpolate
  * EL expressions in certain resources, configured with <tt>interpolatedResourcesExtensions</tt>.
- * The default is to parse resources with <tt>css</tt> extension. A temporary
- * <tt>WikiPluginMacro</tt> instance is available in these expressions as <tt>currentMacro</tt>,
- * you can utilize this to access the metadata (e.g. paths) of the plugin.
+ * The default is to parse resources with <tt>css</tt> extension. A <tt>PluginModule</tt> instance
+ * is always available as variable <tt>currentPluginModule</tt>, which allows direct access to metadata
+ * and path information such as <tt>imagePath</tt> and <tt>styleSheetPath</tt>.
  * </p>
  *
  * @author Christian Bauer
@@ -57,7 +55,7 @@
 
     private static final Pattern EL_PATTERN = Pattern.compile("#" + Pattern.quote("{") + "(.*)" + Pattern.quote("}"));
 
-    // Resources URIs end with /<pluginKey/<pluginMacroModuleKey>/<themeResourceName>.<themeResourceExtension>
+    // Resources URIs end with /<pluginKey/<pluginModuleKey>/<themeResourceName>.<themeResourceExtension>
     public static Pattern PLUGIN_RESOURCE_PATTERN =
             Pattern.compile("^/(" + Plugin.KEY_PATTERN + ")/(" + Plugin.KEY_PATTERN + ")/(.+?)\\.([a-z]+)$");
 
@@ -97,19 +95,19 @@
         String pathInfo = request.getPathInfo().substring(getResourcePath().length());
 
         String pluginKey = null;
-        String pluginMacroModuleKey = null;
+        String pluginModuleKey = null;
         String themeResourceName = null;
         String themeResourceExtension = null;
 
         Matcher matcher = PLUGIN_RESOURCE_PATTERN.matcher(pathInfo);
         if (matcher.find()) {
             pluginKey = matcher.group(1);
-            pluginMacroModuleKey = matcher.group(2);
+            pluginModuleKey = matcher.group(2);
             themeResourceName = matcher.group(3);
             themeResourceExtension = matcher.group(4);
             log.debug("request for resource,"
                     + " plugin key '" + pluginKey + "'"
-                    + " plugin macro module key '" + pluginMacroModuleKey + "'"
+                    + " plugin module key '" + pluginModuleKey + "'"
                     + " theme resource name '" + themeResourceName + "'"
                     + " theme resource ext '" + themeResourceExtension + "'"
             );
@@ -118,8 +116,8 @@
             response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Plugin key not found");
             return;
         }
-        if (pluginMacroModuleKey == null) {
-            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Plugin macro module key not found");
+        if (pluginModuleKey == null) {
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Plugin module key not found");
             return;
         }
         if (themeResourceName == null) {
@@ -130,28 +128,16 @@
         PluginRegistry registry = PluginRegistry.instance();
         Plugin plugin = registry.getPlugin(pluginKey);
         if (plugin == null) {
-            response.sendError(HttpServletResponse.SC_NOT_FOUND, "Plugin key not found in registry: " + pluginKey);
+            response.sendError(HttpServletResponse.SC_NOT_FOUND, "Plugin not found in registry: " + pluginKey);
             return;
         }
-
-        // First, check the registry if we have the fully qualified name as a macro plugin module
-        MacroPluginModule macroPluginModule =
-                registry.getMacroPluginModulesByKey().get(plugin.getKey() + "." + pluginMacroModuleKey);
-
-        // Then also check if it's a module of the given plugin
-        if (macroPluginModule == null || plugin.getModuleByKey(pluginMacroModuleKey) == null) {
-            response.sendError(
-                HttpServletResponse.SC_NOT_FOUND,
-                "Plugin macro module key not found in registry or not available for plugin: " + pluginMacroModuleKey
-            );
+        PluginModule pluginModule = plugin.getModuleByKey(pluginModuleKey);
+        if (pluginModule == null) {
+            response.sendError(HttpServletResponse.SC_NOT_FOUND, "Plugin module not found: " + pluginKey+"."+pluginModuleKey);
             return;
         }
 
-        // Create a new WikiPluginMacro instance which will be available during interpolation as 'currentMacro'
-        WikiPluginMacro pluginMacro = registry.createWikiPluginMacro(
-                new WikiTextMacro(macroPluginModule.getName())
-        );
-        org.jboss.seam.contexts.Contexts.getEventContext().set(WikiPluginMacro.CURRENT_MACRO_EL_VARIABLE, pluginMacro);
+        org.jboss.seam.contexts.Contexts.getEventContext().set("currentPluginModule", pluginModule);
 
         String resourcePath = plugin.getPackageThemePath() + "/" + themeResourceName + "." + themeResourceExtension;
         InputStream in = Resources.getResourceAsStream(resourcePath, getServletContext());

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/renderer/jsf/MacroIncludeTextRenderer.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -222,7 +222,7 @@
         String cssPath = "/" + pluginMacro.getMetadata().getPlugin().getPackageCSSPath() + "/" + pluginMacro.getName() + ".css";
         log.debug("trying to load CSS resource from classpath: " + cssPath);
         if (ResourceLoader.instance().getResource(cssPath) != null) {
-            String cssRequestURIPath = pluginMacro.getRequestCSSPath() + "/" + pluginMacro.getName() + ".css";
+            String cssRequestURIPath = pluginMacro.getRequestStylesheetPath() + "/" + pluginMacro.getName() + ".css";
             log.debug("including macro CSS file, rendering URI for document head: " + cssRequestURIPath);
 
             // Use Ajax4JSF loader, it can do what we want - add a CSS <link> to the HTML <head>

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/Forum.plugin.xml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -98,5 +98,11 @@
         </skins>
     </macro>
 
+    <profile key="postingHistory" template="postingHistory" priority="110">
+        <skins>
+            <skin name="d"/>
+        </skins>
+    </profile>
+
 </plugin>
 

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -2,7 +2,6 @@
 
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.AutoCreate;
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.wiki.core.model.*;
 import org.jboss.seam.wiki.core.dao.WikiNodeDAO;
@@ -30,6 +29,69 @@
     @In
     Integer currentAccessLevel;
 
+    public List<WikiDirectory> findForumDirectories() {
+        return getSession(true).getNamedQuery("forumDirectories")
+                .setComment("Finding forum directories")
+                .list();
+    }
+
+    public Long findForumPostingsCount(List<WikiDirectory> forumDirectories, User user) {
+        return (Long) getSession(true).getNamedQuery("forumTopicsForUserCount")
+                .setParameterList("parentDirectories", forumDirectories)
+                .setParameter("user", user)
+                .setComment("Finding forum topcis count for user: " + user)
+                .uniqueResult();
+    }
+
+    public List<TopicInfo> findForumPostings(List<WikiDirectory> forumDirectories, User user, int firstResult, int maxResults) {
+
+        final Map<Long, TopicInfo> topicInfoMap = new LinkedHashMap();
+
+        getSession(true).getNamedQuery("forumTopicsForUser")
+                .setParameterList("parentDirectories", forumDirectories)
+                .setParameter("user", user)
+                .setComment("Finding forum topcis for user: " + user)
+                .setResultTransformer(
+                        new ResultTransformer() {
+                            public Object transformTuple(Object[] result, String[] strings) {
+                                WikiDocument doc = (WikiDocument) result[0];
+                                topicInfoMap.put(
+                                        doc.getId(),
+                                        new TopicInfo(doc)
+                                );
+                                return null;
+                            }
+                            public List transformList(List list) { return list; }
+                        }
+                )
+                .setFirstResult(firstResult)
+                .setMaxResults(maxResults)
+                .list();
+
+        if (topicInfoMap.size() > 0) {
+            getSession(true).getNamedQuery("forumTopicsReplies")
+                .setParameterList("topicIds", topicInfoMap.keySet())
+                .setComment("Retrieving forum topic replies")
+                .setResultTransformer(
+                    new ResultTransformer() {
+                        public Object transformTuple(Object[] result, String[] strings) {
+                            if (topicInfoMap.containsKey((Long)result[1])) {
+                                TopicInfo info = topicInfoMap.get( (Long)result[1] );
+                                info.setNumOfReplies((Long)result[2]);
+                                info.setLastComment((WikiComment)result[0]);
+                            }
+                            return null;
+                        }
+                        public List transformList(List list) { return list; }
+                    }
+                )
+                .list();
+        }
+
+        return new ArrayList(topicInfoMap.values());
+    }
+
+
     public List<WikiMenuItem> findForumsMenuItems(WikiDirectory forumsDirectory) {
         return getSession(true).getNamedQuery("forumsMenuItems")
                 .setParameter("parentDir", forumsDirectory)

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -12,6 +12,40 @@
 
 <hibernate-mapping>
 
+    <query name="forumDirectories">
+        select
+            dir
+        from
+            WikiDirectory dir, WikiDocument doc
+        where
+            dir = doc.parent
+            and doc.contentMacrosString like '%forumTopics%'
+    </query>
+
+    <query name="forumTopicsForUserCount">
+        select
+            count(t)
+        from
+            WikiDocument t
+        where
+            t.parent in (:parentDirectories)
+            and (t.headerMacrosString like '%forumPosting%' or t.headerMacrosString like '%forumStickyPosting%')
+            and t.createdBy = :user
+    </query>
+
+    <query name="forumTopicsForUser">
+        select
+            t
+        from
+            WikiDocument t
+        where
+            t.parent in (:parentDirectories)
+            and (t.headerMacrosString like '%forumPosting%' or t.headerMacrosString like '%forumStickyPosting%')
+            and t.createdBy = :user
+        order by
+            t.createdOn desc
+    </query>
+
     <query name="forumsCount">
         select count(d.id)
         from

Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java	                        (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/PostingHistory.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -0,0 +1,65 @@
+package org.jboss.seam.wiki.plugin.forum;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.*;
+import org.jboss.seam.wiki.core.action.Pager;
+import org.jboss.seam.wiki.core.action.UserHome;
+import org.jboss.seam.wiki.core.model.WikiDirectory;
+
+import java.util.List;
+import java.io.Serializable;
+
+/**
+ * @author Christian Bauer
+ */
+ at Name("postingHistory")
+ at Scope(ScopeType.PAGE)
+public class PostingHistory implements Serializable {
+
+    @In
+    UserHome userHome;
+
+    @In(create = true)
+    ForumDAO forumDAO;
+
+    private List<WikiDirectory> forumDirectories;
+    private List<TopicInfo> topics;
+    private Pager topicPager = new Pager("TopicPager", 15l);
+
+    @Create
+    public void onCreate() {
+        forumDirectories = forumDAO.findForumDirectories();
+        refreshTopics();
+    }
+
+    @Observer(value = {"TopicPager.pageChanged"}, create = false)
+    public void refreshTopics() {
+        countTopics();
+        loadTopics();
+    }
+
+    public List<TopicInfo> getTopics() {
+        return topics;
+    }
+
+    public Pager getTopicPager() {
+        return topicPager;
+    }
+
+    protected void countTopics() {
+        Long numOfRecords = forumDAO.findForumPostingsCount(forumDirectories, userHome.getInstance());
+        topicPager.setNumOfRecords(numOfRecords);
+    }
+
+    protected void loadTopics() {
+
+        topics =
+                forumDAO.findForumPostings(
+                        forumDirectories,
+                        userHome.getInstance(),
+                        topicPager.getQueryFirstResult(),
+                        topicPager.getQueryMaxResults()
+                );
+
+    }
+}

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/TopicInfo.java	2009-04-14 14:49:30 UTC (rev 10397)
@@ -2,9 +2,11 @@
 
 import org.jboss.seam.wiki.core.model.WikiDocument;
 import org.jboss.seam.wiki.core.model.WikiComment;
+import org.jboss.seam.wiki.core.model.WikiDirectory;
 
 public class TopicInfo {
 
+    private WikiDirectory forum;
     private WikiDocument topic;
     private boolean unread;
     private boolean sticky;
@@ -17,6 +19,11 @@
         this.replies = replies;
     }
 
+    public TopicInfo(WikiDocument topic) {
+        this.forum = (WikiDirectory) topic.getParent();
+        this.topic = topic;
+    }
+
     public void setTopic(WikiDocument topic) {
         this.topic = topic;
     }
@@ -25,6 +32,10 @@
         return topic;
     }
 
+    public WikiDirectory getForum() {
+        return forum;
+    }
+
     public boolean isUnread() {
         return unread;
     }

Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties	                        (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/i18n/messages_postingHistory_en.properties	2009-04-14 14:49:30 UTC (rev 10397)
@@ -0,0 +1,10 @@
+forum.postingHistory.label=Forum Posting History
+forum.postingHistory.description=Overview of all forum postings of a particular user.
+forum.postingHistory.titlePluralSuffix='s
+forum.postingHistory.title=Forum Topics
+forum.postingHistory.date=Date
+forum.postingHistory.forum=Forum
+forum.postingHistory.topic=Topic
+forum.postingHistory.lastReply=Last Reply
+
+

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumListTable.xhtml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -24,8 +24,7 @@
                             defaultColumn rightBorder bottomBorder alignLeft wrapWhitespace,
                             fivePercentColumn rightBorder bottomBorder alignCenter smallFont,
                             fivePercentColumn rightBorder bottomBorder alignCenter smallFont,
-                            tenPercentColumn rightBorder bottomBorder alignCenter smallFont,
-                            tenPercentColumn rightBorder bottomBorder alignCenter smallFont"
+                            twentyPercentColumn rightBorder bottomBorder alignCenter smallFont"
              rowClasses="forumListRow"
              cellpadding="0" cellspacing="0" border="0">
 
@@ -82,6 +81,7 @@
         <h:outputText value="-" rendered="#{empty f.totalNumOfPosts}"/>
     </h:column>
 
+    <!--
     <h:column rendered="#{not forumListHome.managed}">
         <f:facet name="header">#{messages['forum.label.NewestTopic']}</f:facet>
         <s:fragment rendered="#{not empty f.lastTopic}">
@@ -96,6 +96,7 @@
             -
         </s:fragment>
     </h:column>
+    -->
 
     <h:column rendered="#{not forumListHome.managed}">
         <f:facet name="header">#{messages['forum.label.LatestPost']}</f:facet>

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/lastTopicPost.xhtml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -10,7 +10,7 @@
 
     <s:div>
         <h:outputLink value="#{link}" tabindex="1">
-            <h:outputText value="#{wiki:truncateString(name, 25, '...')}"/>
+            <h:outputText value="#{wiki:truncateString(name, 45, '...')}"/>
             <h:graphicImage styleClass="topicGotoIcon" value="#{currentMacro.requestImagePath}/icon.posting_goto.gif" width="18" height="9"/>
         </h:outputLink>
     </s:div>

Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml	                        (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/postingHistory.xhtml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -0,0 +1,120 @@
+<s:fragment
+        rendered="#{not empty postingHistory.topics}"
+        xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:ui="http://java.sun.com/jsf/facelets"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:f="http://java.sun.com/jsf/core"
+        xmlns:wiki="http://jboss.com/products/seam/wiki"
+        xmlns:s="http://jboss.com/products/seam/taglib">
+
+    <s:div styleClass="box">
+
+        <s:div styleClass="boxHeader">
+            <h:outputText value="#{userHome.instance.fullname}#{messages['forum.postingHistory.titlePluralSuffix']}"/>
+            <h:outputText value="&#160;#{messages['forum.postingHistory.title']}"/>
+        </s:div>
+
+        <s:div styleClass="boxContent" style="border:none">
+
+            <h:form>
+                <s:div id="topicList">
+
+                    <ui:include src="/includes/pager.xhtml">
+                        <ui:param name="pager" value="#{postingHistory.topicPager}"/>
+                        <ui:param name="pagerStyleClass" value="pagerTop smallFont"/>
+                        <ui:param name="pagerSingularLabel" value="topic"/>
+                        <ui:param name="pagerPluralLabel" value="topics"/>
+                        <ui:param name="useAjax" value="true"/>
+                        <ui:param name="renderOnSelect" value="topicList"/>
+                    </ui:include>
+
+                    <h:dataTable id="topicListTable" cellpadding="0" cellspacing="0"
+                            styleClass="datatable smallFont undecoratedLink topLeftBottomBorder"
+                            headerClass="sortableHeader alignCenter rightBorder"
+                            columnClasses="fifteenPercentColumn alignRight rightBorder,
+                                           fifteenPercentColumn alignCenter rightBorder,
+                                           defaultColumn alignLeft wrapWhitespace rightBorder,
+                                           twentyPercentColumn alignCenter rightBorder"
+                            rowClasses="rowOdd,rowEven"
+                            var="topicInfo" value="#{postingHistory.topics}">
+
+                        <h:column>
+                            <f:facet name="header">
+                                <h:outputText value="#{messages['forum.postingHistory.date']}"/>
+                            </f:facet>
+
+                            <h:outputText value="#{topicInfo.topic.createdOn}">
+                                <f:convertDateTime pattern="dd. MMM yyyy, HH:mm"
+                                                   timeZone="#{preferences.get('Wiki').timeZone}"/>
+                            </h:outputText>
+                        </h:column>
+
+                        <h:column>
+                            <f:facet name="header">
+                                <h:outputText value="#{messages['forum.postingHistory.forum']}"/>
+                            </f:facet>
+
+                            <h:outputText value="#{topicInfo.forum.name}"/>
+                        </h:column>
+
+                        <h:column>
+                            <f:facet name="header">
+                                <h:outputText value="#{messages['forum.postingHistory.topic']}"/>
+                            </f:facet>
+
+                            <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.topic)}">
+                                <h:outputText value="#{wiki:truncateString(topicInfo.topic.name, 60, '...')}"/>
+                            </h:outputLink>
+
+                        </h:column>
+
+                        <h:column>
+                            <f:facet name="header">
+                                <h:outputText value="#{messages['forum.postingHistory.lastReply']}"/>
+                            </f:facet>
+
+                            <s:fragment rendered="#{not empty topicInfo.lastComment}">
+                                <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.lastComment)}">
+                                    <h:outputText value="#{topicInfo.lastComment.createdOn}">
+                                        <f:convertDateTime pattern="dd. MMM yyyy, HH:mm "
+                                                           timeZone="#{preferences.get('Wiki').timeZone}"/>
+                                    </h:outputText>
+                                    <h:graphicImage styleClass="topicGotoIcon"
+                                                    value="#{currentPluginModule.imagePath}/icon.posting_goto.gif"
+                                                    width="18" height="9"/>
+                                </h:outputLink>
+
+                                <ui:include src="/includes/userProfileLink.xhtml">
+                                    <ui:param name="user" value="#{topicInfo.lastComment.createdBy}"/>
+                                </ui:include>
+
+                            </s:fragment>
+
+                            <s:fragment rendered="#{empty topicInfo.lastComment}">
+                                <s:div style="line-height:300%">
+                                    <h:outputText value="-"/>
+                                </s:div>
+                            </s:fragment>
+
+                        </h:column>
+
+                    </h:dataTable>
+
+                    <ui:include src="/includes/pager.xhtml">
+                        <ui:param name="pager" value="#{postingHistory.topicPager}"/>
+                        <ui:param name="pagerStyleClass" value="pagerBottom smallFont"/>
+                        <ui:param name="pagerSingularLabel" value="topic"/>
+                        <ui:param name="pagerPluralLabel" value="topics"/>
+                        <ui:param name="useAjax" value="true"/>
+                        <ui:param name="renderOnSelect" value="topicList"/>
+                    </ui:include>
+
+                </s:div>
+
+            </h:form>
+
+        </s:div>
+
+    </s:div>
+
+</s:fragment>

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/topicTable.xhtml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -18,7 +18,7 @@
     <s:div styleClass="box">
 
     <h:dataTable id="topicTable"
-                 var="t"
+                 var="topicInfo"
                  value="#{forumQuery.topics}"
                  styleClass="datatable topLeftBottomBorder topicTable"
                  headerClass="regularHeader rightBorder alignCenter smallFont"
@@ -30,29 +30,29 @@
 
         <h:column>
             <f:facet name="header">&#160;</f:facet>
-            <h:graphicImage value="#{currentMacro.requestImagePath}/icon.#{t.iconName}.gif" width="22" height="26"/>
+            <h:graphicImage value="#{currentMacro.requestImagePath}/icon.#{topicInfo.iconName}.gif" width="22" height="26"/>
         </h:column>
 
         <h:column>
             <f:facet name="header">Topic</f:facet>
 
-            <h:outputLink value="#{wikiURLRenderer.renderURL(t.topic)}" tabindex="1">
-                <h:outputText value="#{wiki:truncateString(t.topic.name, 60, '...')}"/>
+            <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.topic)}" tabindex="1">
+                <h:outputText value="#{wiki:truncateString(topicInfo.topic.name, 60, '...')}"/>
             </h:outputLink>
 
         </h:column>
 
         <h:column>
             <f:facet name="header">Replies</f:facet>
-            <h:outputText value="#{t.numOfReplies}" rendered="#{t.numOfReplies != 0}"/>
-            <h:outputText value="-" rendered="#{t.numOfReplies == 0}"/>
+            <h:outputText value="#{topicInfo.numOfReplies}" rendered="#{topicInfo.numOfReplies != 0}"/>
+            <h:outputText value="-" rendered="#{topicInfo.numOfReplies == 0}"/>
         </h:column>
 
         <h:column>
             <f:facet name="header">Author</f:facet>
 
             <ui:include src="/includes/userProfileLink.xhtml">
-                <ui:param name="user" value="#{t.topic.createdBy}"/>
+                <ui:param name="user" value="#{topicInfo.topic.createdBy}"/>
             </ui:include>
 
         </h:column>
@@ -60,30 +60,30 @@
         <h:column>
             <f:facet name="header">Last Post</f:facet>
 
-            <s:fragment rendered="#{not empty t.lastComment}">
-                <h:outputLink value="#{wikiURLRenderer.renderURL(t.lastComment)}" tabindex="1">
-                    <h:outputText value="#{t.lastComment.createdOn}">
+            <s:fragment rendered="#{not empty topicInfo.lastComment}">
+                <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.lastComment)}" tabindex="1">
+                    <h:outputText value="#{topicInfo.lastComment.createdOn}">
                         <f:convertDateTime pattern="dd. MMM yyyy, HH:mm" timeZone="#{preferences.get('Wiki').timeZone}"/>
                     </h:outputText>
                     <h:graphicImage styleClass="topicGotoIcon" value="#{currentMacro.requestImagePath}/icon.posting_goto.gif" width="18" height="9"/>
                 </h:outputLink>
 
                 <ui:include src="/includes/userProfileLink.xhtml">
-                    <ui:param name="user" value="#{t.lastComment.createdBy}"/>
+                    <ui:param name="user" value="#{topicInfo.lastComment.createdBy}"/>
                 </ui:include>
 
             </s:fragment>
 
-            <s:fragment rendered="#{empty t.lastComment}">
-                <h:outputLink value="#{wikiURLRenderer.renderURL(t.topic)}" tabindex="1">
-                    <h:outputText value="#{t.topic.createdOn}">
+            <s:fragment rendered="#{empty topicInfo.lastComment}">
+                <h:outputLink value="#{wikiURLRenderer.renderURL(topicInfo.topic)}" tabindex="1">
+                    <h:outputText value="#{topicInfo.topic.createdOn}">
                         <f:convertDateTime pattern="dd. MMM yyyy, HH:mm" timeZone="#{preferences.get('Wiki').timeZone}"/>
                     </h:outputText>
                     <h:graphicImage styleClass="topicGotoIcon" value="#{currentMacro.requestImagePath}/icon.posting_goto.gif" width="18" height="9"/>
                 </h:outputLink>
 
                 <ui:include src="/includes/userProfileLink.xhtml">
-                    <ui:param name="user" value="#{t.topic.createdBy}"/>
+                    <ui:param name="user" value="#{topicInfo.topic.createdBy}"/>
                 </ui:include>
 
             </s:fragment>

Modified: trunk/examples/wiki/view/userProfile_d.xhtml
===================================================================
--- trunk/examples/wiki/view/userProfile_d.xhtml	2009-04-14 14:42:50 UTC (rev 10396)
+++ trunk/examples/wiki/view/userProfile_d.xhtml	2009-04-14 14:49:30 UTC (rev 10397)
@@ -32,6 +32,7 @@
 
     <s:div>
         <c:forEach var="pm" items="#{pluginRegistry.profilePluginModulesAsList}">
+            <c:set value="#{pm}" var="currentPluginModule"/>
             <ui:include src="/#{pm.plugin.getPackageDefaultTemplatePath(pm.template)}"/>
             <br/>
         </c:forEach>




More information about the seam-commits mailing list