[jboss-svn-commits] JBL Code SVN: r19482 - in labs/jbossforums/branches/multipleforums110P26/forums/src: bin/portal-forums-war/default_graphics/common and 13 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Apr 8 14:00:23 EDT 2008
Author: unibrew
Date: 2008-04-08 14:00:23 -0400 (Tue, 08 Apr 2008)
New Revision: 19482
Added:
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml
Modified:
labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno.gif
labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno_new.gif
labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky.gif
labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky_new.gif
labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/index.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml
labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
Log:
[JBFORUMS-214] Small corrections to moderator main view to make it look better. [JBFORUMS-272] Feeds no longer throw NPE. [JBFORUMS-273] I finished RSS/ATOM feeds implementation. Added links on all needed views and created sample configurations for it.
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno.gif
===================================================================
(Binary files differ)
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_anno_new.gif
===================================================================
(Binary files differ)
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky.gif
===================================================================
(Binary files differ)
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/common/forum_ico_sticky_new.gif
===================================================================
(Binary files differ)
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/bin/portal-forums-war/default_graphics/forums_styles.css 2008-04-08 18:00:23 UTC (rev 19482)
@@ -1,3 +1,9 @@
+.bodyStyle{
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ color: #656565;
+}
+
.scroll {
width: 800px;
overflow: auto;
@@ -198,6 +204,7 @@
.forumtablestyle td {
border-bottom:1px solid #e6e7e8;
padding: 3px 5px;
+ font-size:11px;
}
.forumtablestyle a {
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedConstants.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -1,15 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.portlet.forums.feeds;
+/**
+ * Constants used for RSS/ATOM feeds.
+ *
+ * @author tomaszszymanski
+ * @author <a href="ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
+ *
+ */
public class FeedConstants {
- public final static String CATEGORY = "category";
-
- public final static String TOPIC = "topic";
-
- public final static String GLOBAL = "global";
-
- public final static String FORUM = "forum";
-
- public static final String RSS = "rss";
-
- public static final String ATOM = "atom";
+
+ public final static String CATEGORY = "category";
+
+ public final static String TOPIC = "topic";
+
+ public final static String GLOBAL = "global";
+
+ public final static String FORUM = "forum";
+
+ public static final String RSS = "rss";
+
+ public static final String ATOM = "atom";
+
+ public static final String URL_INIT_PARAM_NAME = "org.jboss.forums.feeds.URL";
+
+ public static final String URL_TYPE_INIT_PARAM_NAME = "org.jboss.forums.feeds.URL_TYPE";
+
+ public static final String WRONG_FEED_TYPE = "Wrong feed type: ";
+
+ public static final String WRONG_FEED_REQ = "Wrong feed request";
+
+ public static final String WRONG_FEED_SHOW_TYPE = "Wrong feed forum type: ";
+
+ public static final int POST_LIMIT = 20;
+
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/feeds/FeedsServlet.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -1,7 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.portlet.forums.feeds;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.io.Writer;
+import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
@@ -23,6 +46,8 @@
import org.jboss.portlet.forums.model.Forum;
import org.jboss.portlet.forums.model.Post;
import org.jboss.portlet.forums.model.Topic;
+import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.ForumsJSFPortlet;
import org.jboss.portlet.forums.ui.PortalUtil;
import com.sun.syndication.feed.synd.SyndContent;
@@ -37,240 +62,319 @@
* Servlet used for showing RSS entries
*
* @author tomaszszymanski
+ * @author Ryszard Kozmik <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
*
*/
public class FeedsServlet extends HttpServlet {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
- private ForumsModule forumsModule;
+ private ForumsModule forumsModule;
- private static final Logger log = Logger.getLogger(FeedsServlet.class);
+ private static final Logger log = Logger.getLogger(FeedsServlet.class);
- private static final String WRONG_FEED_TYPE = "Wrong feed type: ";
+ private TransactionManager tm;
- private static final String WRONG_FEED_REQ = "Wrong feed request";
+ public void init() {
+ try {
+ forumsModule = (ForumsModule) new InitialContext()
+ .lookup("java:portal/ForumsModule");
+ } catch (NamingException e) {
+ log.error(e);
+ }
+ }
- private static final String WRONG_FEED_SHOW_TYPE = "Wrong feed forum type: ";
+ protected void doGet(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException {
+ try {
+ String[] uri = request.getRequestURI().split("/");
- private static final int POST_LIMIT = 20;
+ if (uri.length < 5
+ || (uri[4].equals(FeedConstants.GLOBAL) && uri.length != 5)
+ || (!uri[4].equals(FeedConstants.GLOBAL) && uri.length != 6)) {
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+ FeedConstants.WRONG_FEED_REQ);
+ return;
+ }
- private TransactionManager tm;
+ String type = uri[3];
+ String what = uri[4];
- public void init() {
- try {
- forumsModule = (ForumsModule) new InitialContext()
- .lookup("java:portal/ForumsModule");
- } catch (NamingException e) {
- log.error(e);
- }
- }
+ Integer id = null;
- protected void doGet(HttpServletRequest request,
- HttpServletResponse response) throws ServletException, IOException {
- try {
- String[] uri = request.getRequestURI().split("/");
+ if (!what.equals(FeedConstants.GLOBAL))
+ id = Integer.valueOf(uri[5]);
- if (uri.length < 5
- || (uri[4].equals(FeedConstants.GLOBAL) && uri.length != 5)
- || (!uri[4].equals(FeedConstants.GLOBAL) && uri.length != 6)) {
- response.sendError(HttpServletResponse.SC_BAD_REQUEST,
- WRONG_FEED_REQ);
- return;
- }
+ SyndFeed feed = new SyndFeedImpl();
- String type = uri[3];
- String what = uri[4];
+ if (!setFeedType(feed, type)) {
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+ FeedConstants.WRONG_FEED_TYPE + type);
+ return;
+ }
- Integer id = null;
+ if (tm == null) {
+ try {
+ tm = TransactionManagerProvider.JBOSS_PROVIDER
+ .getTransactionManager();
+ } catch (Exception e) {
+ System.out
+ .println("Obtaining TransactionManagerProvider Problem....");
+ }
+ }
+
+ String url = null;
+ String urlType = null;
+
+ String urlRequestParam = request.getParameter("url");
+ String urlTypeRequestParam = request.getParameter("urlType");
+
+ if (urlRequestParam!=null && urlRequestParam.trim().length()!=0
+ && urlTypeRequestParam!=null && urlTypeRequestParam.trim().length()!=0
+ && ( urlTypeRequestParam.compareTo("p")==0 || urlTypeRequestParam.compareTo("s")==0 ) )
+ {
+ url = request.getParameter("url");
+ urlType = urlTypeRequestParam;
+ }
+
+ String urlInitParam = this.getServletContext().getInitParameter(FeedConstants.URL_INIT_PARAM_NAME);
+ String urlTypeInitParam = this.getServletContext().getInitParameter(FeedConstants.URL_TYPE_INIT_PARAM_NAME);
+ if (urlInitParam!=null && urlInitParam.trim().length()!=0
+ && urlTypeInitParam!=null && urlTypeInitParam.trim().length()!=0)
+ {
+ url = urlInitParam;
+ urlType = urlTypeInitParam;
+ }
+
+ if (url==null || urlType==null)
+ {
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST,FeedConstants.WRONG_FEED_REQ);
+ return;
+ }
+
+ javax.transaction.Transaction oldTx = null;
+ try {
+ oldTx = Transactions
+ .applyBefore(Transactions.TYPE_REQUIRED, tm);
+ try {
+ if (what.equals(FeedConstants.CATEGORY)) {
+ createCategoryFeed(feed, id, url, urlType);
+ } else if (what.equals(FeedConstants.FORUM)) {
+ createForumFeed(feed, id, url, urlType);
+ } else if (what.equals(FeedConstants.TOPIC)) {
+ createTopicFeed(feed, id, url, urlType);
+ } else if (what.equals(FeedConstants.GLOBAL)) {
+ createGlobalFeed(feed, id, url, urlType);
+ } else {
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST,
+ FeedConstants.WRONG_FEED_SHOW_TYPE + what);
+ return;
+ }
+ } catch (ModuleException e) {
+ response.sendError(
+ HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e
+ .getMessage());
+ return;
+ }
- if (!what.equals(FeedConstants.GLOBAL))
- id = Integer.valueOf(uri[5]);
+ } catch (TransactionException e) {
+ System.out.println("JTA problem...");
+ } finally {
+ try {
+ Transactions.applyAfter(Transactions.TYPE_REQUIRED, tm,
+ oldTx);
- SyndFeed feed = new SyndFeedImpl();
+ } catch (TransactionException e) {
+ // log.error("", e);
+ }
+ }
+ response.setContentType("text/xml");
- if (!setFeedType(feed, type)) {
- response.sendError(HttpServletResponse.SC_BAD_REQUEST,
- WRONG_FEED_TYPE + type);
- return;
- }
+ Writer writer = response.getWriter();
- if (tm == null) {
- try {
- tm = TransactionManagerProvider.JBOSS_PROVIDER
- .getTransactionManager();
- } catch (Exception e) {
- System.out
- .println("Obtaining TransactionManagerProvider Problem....");
- }
- }
+ SyndFeedOutput output = new SyndFeedOutput();
+ output.output(feed, writer);
- javax.transaction.Transaction oldTx = null;
- try {
- oldTx = Transactions
- .applyBefore(Transactions.TYPE_REQUIRED, tm);
- try {
- if (what.equals(FeedConstants.CATEGORY)) {
- createCategoryFeed(feed, id);
- } else if (what.equals(FeedConstants.FORUM)) {
- createForumFeed(feed, id);
- } else if (what.equals(FeedConstants.TOPIC)) {
- createTopicFeed(feed, id);
- } else if (what.equals(FeedConstants.GLOBAL)) {
- createGlobalFeed(feed, id);
- } else {
- response.sendError(HttpServletResponse.SC_BAD_REQUEST,
- WRONG_FEED_SHOW_TYPE + what);
- return;
- }
- } catch (ModuleException e) {
- response.sendError(
- HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e
- .getMessage());
- return;
- }
+ writer.flush();
- } catch (TransactionException e) {
- System.out.println("JTA problem...");
- } finally {
- try {
- Transactions.applyAfter(Transactions.TYPE_REQUIRED, tm,
- oldTx);
+ } catch (Exception e) {
+ throw new ServletException(e);
+ }
- } catch (TransactionException e) {
- // log.error("", e);
- }
- }
- response.setContentType("text/xml");
+ }
- Writer writer = response.getWriter();
+ private void createGlobalFeed(SyndFeed feed, Integer id, String url , String urlType)
+ throws ModuleException {
+ feed.setTitle("JBoss Forums Global Feed");
+ feed.setLink(globalLink(url,urlType));
+ feed.setDescription("Messages posted in JBoss Forums");
- SyndFeedOutput output = new SyndFeedOutput();
- output.output(feed, writer);
+ List entries = new ArrayList();
- writer.flush();
+ List posts = forumsModule.findPostsDesc(FeedConstants.POST_LIMIT);
- } catch (Exception e) {
- throw new ServletException(e);
- }
+ for (int i = 0; i < posts.size(); i++) {
+ entries.add(getEntry((Post) posts.get(i),url,urlType));
+ }
- }
+ feed.setEntries(entries);
+ }
- private void createGlobalFeed(SyndFeed feed, Integer id)
- throws ModuleException {
- feed.setTitle("JBoss Forums Global Feed");
- feed.setLink(PortalUtil.globalLink());
- feed.setDescription("Messages posted in JBoss Forums");
+ private void createForumFeed(SyndFeed feed, Integer id, String url , String urlType)
+ throws ModuleException {
- List entries = new ArrayList();
+ Forum forum = forumsModule.findForumById(id);
- List posts = forumsModule.findPostsDesc(POST_LIMIT);
+ feed.setTitle("JBoss Forums Forum Feed: " + forum.getName());
+ feed.setLink(forumLink(id.toString(),url,urlType));
+ feed.setDescription("Messages posted in forum " + forum.getName()
+ + " in category " + forum.getCategory().getTitle());
- for (int i = 0; i < posts.size(); i++) {
- entries.add(getEntry((Post) posts.get(i)));
- }
+ List entries = new ArrayList();
- feed.setEntries(entries);
- }
+ List posts = forumsModule.findPostsFromForumDesc(forum, FeedConstants.POST_LIMIT);
- private void createForumFeed(SyndFeed feed, Integer id)
- throws ModuleException {
+ for (int i = 0; i < posts.size(); i++) {
+ entries.add(getEntry((Post) posts.get(i),url,urlType));
+ }
- Forum forum = forumsModule.findForumById(id);
+ feed.setEntries(entries);
- feed.setTitle("JBoss Forums Forum Feed: " + forum.getName());
- feed.setLink(PortalUtil.categoryLink(id.toString()));
- feed.setDescription("Messages posted in forum " + forum.getName()
- + " in category " + forum.getCategory().getTitle());
+ }
- List entries = new ArrayList();
+ private void createTopicFeed(SyndFeed feed, Integer id, String url , String urlType)
+ throws ModuleException {
- List posts = forumsModule.findPostsFromForumDesc(forum, POST_LIMIT);
+ Topic topic = forumsModule.findTopicById(id);
- for (int i = 0; i < posts.size(); i++) {
- entries.add(getEntry((Post) posts.get(i)));
- }
+ feed.setTitle("JBoss Forums Topic Feed: " + topic.getSubject());
+ feed.setLink(topicLink(id.toString(),url,urlType));
+ feed.setDescription("Messages posted in topic " + topic.getSubject()
+ + " in forum " + topic.getForum().getName() + " in category "
+ + topic.getForum().getCategory().getTitle());
- feed.setEntries(entries);
+ List entries = new ArrayList();
- }
+ List posts = topic.getPosts();
- private void createTopicFeed(SyndFeed feed, Integer id)
- throws ModuleException {
+ for (int i = 0; i < posts.size(); i++) {
+ entries.add(getEntry((Post) posts.get(i),url,urlType));
+ }
- Topic topic = forumsModule.findTopicById(id);
+ feed.setEntries(entries);
- feed.setTitle("JBoss Forums Topic Feed: " + topic.getSubject());
- feed.setLink(PortalUtil.topicLink(id.toString()));
- feed.setDescription("Messages posted in topic " + topic.getSubject()
- + " in forum " + topic.getForum().getName() + " in category "
- + topic.getForum().getCategory().getTitle());
+ }
- List entries = new ArrayList();
+ private boolean setFeedType(SyndFeed feed, String type) {
+ if (type.equals(FeedConstants.RSS)) {
+ feed.setFeedType("rss_2.0");
+ } else if (type.equals(FeedConstants.ATOM)) {
+ feed.setFeedType("atom_0.3");
+ } else {
+ return false;
+ }
+ return true;
+ }
- List posts = topic.getPosts();
+ private void createCategoryFeed(SyndFeed feed, Integer id, String url , String urlType)
+ throws ModuleException {
- for (int i = 0; i < posts.size(); i++) {
- entries.add(getEntry((Post) posts.get(i)));
- }
+ Category category = forumsModule.findCategoryById(id);
- feed.setEntries(entries);
+ feed.setTitle("JBoss Forums Category Feed: " + category.getTitle());
+ feed.setLink(categoryLink(id.toString(),url,urlType));
+ feed.setDescription("Messages posted in category "
+ + category.getTitle());
- }
+ List entries = new ArrayList();
- private boolean setFeedType(SyndFeed feed, String type) {
- if (type.equals(FeedConstants.RSS)) {
- feed.setFeedType("rss_2.0");
- } else if (type.equals(FeedConstants.ATOM)) {
- feed.setFeedType("atom_0.3");
- } else {
- return false;
- }
- return true;
- }
+ List posts = forumsModule.findPostsFromCategoryDesc(category,
+ FeedConstants.POST_LIMIT);
- private void createCategoryFeed(SyndFeed feed, Integer id)
- throws ModuleException {
+ for (int i = 0; i < posts.size(); i++) {
+ entries.add(getEntry((Post) posts.get(i),url,urlType));
+ }
- Category category = forumsModule.findCategoryById(id);
+ feed.setEntries(entries);
- feed.setTitle("JBoss Forums Category Feed: " + category.getTitle());
- feed.setLink(PortalUtil.categoryLink(id.toString()));
- feed.setDescription("Messages posted in category "
- + category.getTitle());
+ }
- List entries = new ArrayList();
+ private SyndEntry getEntry(Post post, String url , String urlType) {
+ SyndEntry entry;
+ SyndContent description;
- List posts = forumsModule.findPostsFromCategoryDesc(category,
- POST_LIMIT);
+ entry = new SyndEntryImpl();
+ entry.setTitle(post.getMessage().getSubject() + " by "
+ + post.getPoster().getUser().getUserName());
+ entry.setLink(postLink(post.getId().toString(),url,urlType));
+ entry.setPublishedDate(post.getCreateDate());
+ description = new SyndContentImpl();
+ description.setType("text/html");
+ description.setValue(PortalUtil.formatMessage(post.getMessage()
+ .getText(), post.getMessage().getHTMLEnabled()));
+ entry.setDescription(description);
- for (int i = 0; i < posts.size(); i++) {
- entries.add(getEntry((Post) posts.get(i)));
- }
+ return entry;
+ }
+
+ private String postLink(String id, String url , String urlType)
+ {
+ String viewUrl = ForumsJSFPortlet.getNameForId("t");
+ String completeUrl = buildCompleteUrl(url,urlType,viewUrl);
+ return completeUrl + Constants.p_postId + "=" + id + "#"+ id;
+ }
+
+ private String topicLink(String id, String url , String urlType)
+ {
+ String viewUrl = ForumsJSFPortlet.getNameForId("t");
+ String completeUrl = buildCompleteUrl(url,urlType,viewUrl);
+ return completeUrl + Constants.p_topicId + "=" + id;
+ }
+
+ private String forumLink(String id, String url , String urlType)
+ {
+ String viewUrl = ForumsJSFPortlet.getNameForId("f");
+ String completeUrl = buildCompleteUrl(url,urlType,viewUrl);
+ return completeUrl + Constants.p_forumId + "=" + id;
+ }
+
+ private String categoryLink(String id, String url , String urlType)
+ {
+ return globalLink(url,urlType) + Constants.p_categoryId + "=" + id;
+ }
+
+ private String globalLink( String url , String urlType)
+ {
+ String viewUrl = ForumsJSFPortlet.getNameForId("c");
+ return buildCompleteUrl(url,urlType,viewUrl);
+ }
+
+ private String buildCompleteUrl(String url, String urlType, String viewUrl)
+ {
+ if (urlType.compareTo("p")==0)
+ {
+ try
+ {
+ url += "&"
+ + ForumsJSFPortlet.VIEW
+ + "="
+ + URLEncoder.encode(ForumsJSFPortlet.getIdForName(viewUrl), "UTF-8")
+ + "&";
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ url += viewUrl + "?";
+ }
+
+ return url;
+ }
- feed.setEntries(entries);
-
- }
-
- private SyndEntry getEntry(Post post) {
- SyndEntry entry;
- SyndContent description;
-
- entry = new SyndEntryImpl();
- entry.setTitle(post.getMessage().getSubject() + " by "
- + post.getPoster().getUser().getUserName());
- entry.setLink(PortalUtil.postLink(post.getId().toString()));
- entry.setPublishedDate(post.getCreateDate());
- description = new SyndContentImpl();
- description.setType("text/html");
- description.setValue(PortalUtil.formatMessage(post.getMessage()
- .getText(), post.getMessage().getHTMLEnabled()));
- entry.setDescription(description);
-
- return entry;
- }
-
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/theme/ForumsTheme.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -16,6 +16,7 @@
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @author <a href="mailto:julien at jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
*/
public class ForumsTheme
{
@@ -31,31 +32,47 @@
int status,
boolean hot)
{
- switch (type)
- {
- case ForumsConstants.POST_ANNOUNCE:
- return FOLDER_ANNOUNCE;
-
- case ForumsConstants.POST_STICKY:
- return FOLDER_STICKY;
-
- default:
- if (status == ForumsConstants.TOPIC_LOCKED)
- {
- return FOLDER_LOCKED;
- }
- else
- {
- if (hot)
+ switch (type)
+ {
+ case ForumsConstants.POST_ANNOUNCE:
+ if (status == ForumsConstants.TOPIC_LOCKED)
{
- return FOLDER_HOT;
+ return FOLDER_ANNOUNCE_LOCKED;
}
else
{
- return FOLDER_NORMAL;
+ return FOLDER_ANNOUNCE;
}
- }
- }
+
+ case ForumsConstants.POST_STICKY:
+ if (status == ForumsConstants.TOPIC_LOCKED)
+ {
+ return FOLDER_STICKY_LOCKED;
+ }
+ else
+ {
+ return FOLDER_STICKY;
+ }
+
+ default:
+ {
+ if (status == ForumsConstants.TOPIC_LOCKED)
+ {
+ return FOLDER_NORMAL_LOCKED;
+ }
+ else
+ {
+ if (hot)
+ {
+ return FOLDER_HOT;
+ }
+ else
+ {
+ return FOLDER_NORMAL;
+ }
+ }
+ }
+ }
}
/**
@@ -71,7 +88,17 @@
/**
* DOCUMENT_ME
*/
- public FolderType FOLDER_LOCKED;
+ public FolderType FOLDER_ANNOUNCE_LOCKED;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public FolderType FOLDER_STICKY_LOCKED;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public FolderType FOLDER_NORMAL_LOCKED;
/**
* DOCUMENT_ME
@@ -117,6 +144,11 @@
* DOCUMENT_ME
*/
public String resourceIconGotopostURL;
+
+ /**
+ * DOCUMENT_ME
+ */
+ public String resourceIconFeedURL;
/**
* DOCUMENT_ME
@@ -466,6 +498,7 @@
resourceIconLatestReplyURL = xprops.getResourceURL("icon_latest_reply");
resourceIconNewestReplyURL = xprops.getResourceURL("icon_newest_reply");
resourceIconGotopostURL = xprops.getResourceURL("icon_gotopost");
+ resourceIconFeedURL = xprops.getResourceURL("icon_feed");
resourceFolderURL = xprops.getResourceURL("folder");
resourceFolderNewURL = xprops.getResourceURL("folder_new");
resourceFolderAnnounceURL = xprops.getResourceURL("folder_announce");
@@ -531,7 +564,9 @@
FOLDER_ANNOUNCE =
new FolderType(resourceFolderAnnounceURL, resourceFolderAnnounceNewURL, "Topic_Announcement");
FOLDER_STICKY = new FolderType(resourceFolderStickyURL, resourceFolderStickyNewURL, "Topic_Sticky");
- FOLDER_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "");
+ FOLDER_ANNOUNCE_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "Topic_Announcement");
+ FOLDER_STICKY_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "Topic_Sticky");
+ FOLDER_NORMAL_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, "");
FOLDER_HOT = new FolderType(resourceFolderHotURL, resourceFolderHotNewURL, "");
FOLDER_NORMAL = new FolderType(resourceFolderURL, resourceForumNewURL, "");
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -25,6 +25,7 @@
import java.util.Date;
import java.util.Collection;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.portlet.ActionRequest;
@@ -189,4 +190,17 @@
}
// Luca Stancapiano end
+ public static boolean isFeedsConfigured()
+ {
+ ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
+ String urlParam = ctx.getInitParameter("org.jboss.forums.feeds.URL");
+ String urlType = ctx.getInitParameter("org.jboss.forums.feeds.URL_TYPE");
+ if (urlParam==null || urlParam.trim().length()==0
+ || urlType==null || urlType.trim().length()==0)
+ {
+ return false;
+ }
+ return true;
+ }
+
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -33,6 +33,7 @@
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -187,15 +188,16 @@
RenderResponse renderResponse = (RenderResponse) response;
PortletURL portletURL = null;
-
+
if (isAction)
{
portletURL = renderResponse.createActionURL();
+ portletURL.setSecure(false);
} else
{
portletURL = renderResponse.createRenderURL();
}
-
+
String jsfUrl = portletURL.toString();
jsfUrl += "&"
+ ForumsJSFPortlet.VIEW
@@ -221,66 +223,6 @@
/**
*
*/
- public static String globalLink()
- {
- FacesContext fc = FacesContext.getCurrentInstance();
- BaseController bc = (BaseController) fc.getApplication().
- getVariableResolver().
- resolveVariable(fc,"shared");
- return outputLink(bc.getLinks().get("category").toString(),true);
- }
-
- /**
- *
- */
- public static String categoryLink(String categoryId)
- {
- FacesContext fc = FacesContext.getCurrentInstance();
- BaseController bc = (BaseController) fc.getApplication().
- getVariableResolver().
- resolveVariable(fc,"shared");
- return outputLink(bc.getLinks().get("category").toString(),true) +"&"+ Constants.p_categoryId + "=" + categoryId;
- }
-
- /**
- *
- */
- public static String forumLink(String forumId)
- {
- FacesContext fc = FacesContext.getCurrentInstance();
- BaseController bc = (BaseController) fc.getApplication().
- getVariableResolver().
- resolveVariable(fc,"shared");
- return outputLink(bc.getLinks().get("forum").toString(),true) +"&"+ Constants.p_forumId + "=" + forumId;
- }
-
- /**
- *
- */
- public static String postLink(String postId)
- {
- FacesContext fc = FacesContext.getCurrentInstance();
- BaseController bc = (BaseController) fc.getApplication().
- getVariableResolver().
- resolveVariable(fc,"shared");
- return outputLink(bc.getLinks().get("topic").toString(),true) +"&"+ Constants.p_postId + "=" + postId + "#"+ postId;
- }
-
- /**
- *
- */
- public static String topicLink(String topicId)
- {
- FacesContext fc = FacesContext.getCurrentInstance();
- BaseController bc = (BaseController) fc.getApplication().
- getVariableResolver().
- resolveVariable(fc,"shared");
- return outputLink(bc.getLinks().get("topic").toString(),true) +"&"+ Constants.p_topicId + "=" + topicId;
- }
-
- /**
- *
- */
public static String postPermlink(String postId)
{
@@ -338,21 +280,56 @@
*/
public static String createFeedLink(String type, String what, Integer id)
{
- Object rreq = FacesContext.getCurrentInstance().getExternalContext()
- .getRequest();
- if (rreq instanceof RenderRequest)
+ ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
+ String url = ctx.getRequestContextPath()
+ + "/feeds/"
+ + type
+ + "/"
+ + what
+ + (FeedConstants.GLOBAL.equals(what) ? "" : "/"
+ + id.toString());
+
+ String urlParam = ctx.getInitParameter("org.jboss.forums.feeds.URL");
+ String urlType = ctx.getInitParameter("org.jboss.forums.feeds.URL_TYPE");
+ if (urlParam==null || urlParam.trim().length()==0
+ || urlType==null || urlType.trim().length()==0)
{
- RenderRequest req = (RenderRequest) rreq;
- return req.getContextPath()
- + "/feeds/"
- + type
- + "/"
- + what
- + (FeedConstants.GLOBAL.equals(what) ? "" : "/"
- + id.toString());
+ Object responseObj = ctx.getResponse();
+ if (responseObj instanceof RenderResponse)
+ {
+ RenderResponse response = (RenderResponse)responseObj;
+ PortletURL portletUrl = response.createActionURL();
+
+ try
+ {
+ portletUrl.setSecure(false);
+ } catch(javax.portlet.PortletSecurityException e)
+ {
+ log.error(PortalUtil.class.getName(), e);
+ }
+
+ urlParam = portletUrl.toString();
+ if (urlParam.indexOf("/auth")!=-1)
+ {
+ urlParam = urlParam.replaceFirst("/auth", "");
+ }
+
+ urlType = "p";
+ }
+ else
+ {
+ urlParam = JSFUtil.getContextPath();
+ urlType = "s";
+ }
+
+ url += "?url="
+ + urlParam
+ + "&urlType="
+ + urlType;
}
- return null;
+
+ return url;
}
/**
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -29,6 +29,7 @@
import java.util.Date;
import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.feeds.FeedConstants;
import org.jboss.portlet.forums.model.Category;
import org.jboss.portlet.forums.model.Forum;
import org.jboss.portlet.forums.model.Post;
@@ -136,6 +137,37 @@
return this.categorySelected;
}
+ public String getRssFeed()
+ {
+ if (categorySelected && categories!=null && !categories.isEmpty())
+ {
+ Category category = (Category)categories.iterator().next();
+ return PortalUtil.createFeedLink(FeedConstants.RSS,
+ FeedConstants.CATEGORY, category.getId());
+ }
+ else
+ {
+ return PortalUtil.createFeedLink(FeedConstants.RSS,
+ FeedConstants.GLOBAL,null);
+ }
+ }
+
+ public String getAtomFeed()
+ {
+ if (categorySelected && categories!=null && !categories.isEmpty())
+ {
+ Category category = (Category)categories.iterator().next();
+ return PortalUtil.createFeedLink(FeedConstants.ATOM,
+ FeedConstants.CATEGORY, category.getId());
+ }
+ else
+ {
+ return PortalUtil.createFeedLink(FeedConstants.ATOM,
+ FeedConstants.GLOBAL,null);
+ }
+
+ }
+
//------------user preferences-------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewForum.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -391,13 +391,13 @@
public String getRssFeed()
{
- return PortalUtil.createFeedLink(FeedConstants.RSS,
+ return PortalUtil.createFeedLink(FeedConstants.RSS,
FeedConstants.FORUM, forum.getId());
}
public String getAtomFeed()
{
- return PortalUtil.createFeedLink(FeedConstants.ATOM,
+ return PortalUtil.createFeedLink(FeedConstants.ATOM,
FeedConstants.FORUM, forum.getId());
}
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewTopic.java 2008-04-08 18:00:23 UTC (rev 19482)
@@ -30,6 +30,7 @@
import org.jboss.portal.core.modules.ModuleException;
import org.jboss.portlet.forums.ForumsModule;
+import org.jboss.portlet.forums.feeds.FeedConstants;
import org.jboss.portlet.forums.model.Category;
import org.jboss.portlet.forums.model.Post;
import org.jboss.portlet.forums.model.Topic;
@@ -125,6 +126,19 @@
return isBallotView;
}
+
+ public String getRssFeed()
+ {
+ return PortalUtil.createFeedLink(FeedConstants.RSS,
+ FeedConstants.TOPIC, topic.getId());
+ }
+
+ public String getAtomFeed()
+ {
+ return PortalUtil.createFeedLink(FeedConstants.ATOM,
+ FeedConstants.TOPIC, topic.getId());
+ }
+
// page navigation related methods on this bean--------------------------------------------------------------------------------------------
/**
*
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/classes/default_graphics/theme.properties 2008-04-08 18:00:23 UTC (rev 19482)
@@ -34,6 +34,7 @@
vote_rcap=common/forum_poll_rcap.gif
forums_logo=common/forums_ico_logo.gif
spacer=common/spacer.gif
+icon_feed=common/forums_ico_feed.gif
#LANGUAGE SPECIFIC
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/forums.taglib.xml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -80,7 +80,15 @@
<function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
<function-signature>java.lang.String getPercentStr(double)</function-signature>
</function>
-
+
+ <!--
+ -->
+ <function>
+ <function-name>feedsConfigured</function-name>
+ <function-class>org.jboss.portlet.forums.ui.ForumUtil</function-class>
+ <function-signature>boolean isFeedsConfigured()</function-signature>
+ </function>
+
<!--
-->
<function>
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/WEB-INF/web.xml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -29,7 +29,35 @@
<context-param>
<param-name>org.jboss.forums.UNIQUE_ID</param-name>
<param-value>f</param-value>
- </context-param>
+ </context-param>
+
+ <!-- >context-param>
+ <param-name>org.jboss.forums.feeds.URL</param-name>
+ <param-value>/portal-forums</param-value>
+ <description>
+ This parameter is used to create proper links in portal environment.
+ It must contain a path to a portlet window where Forums are deployed.
+ If the application is deployed in standalone mode then the parameter is ignored.
+ </description>
+ </context-param>-->
+ <context-param>
+ <param-name>org.jboss.forums.feeds.URL</param-name>
+ <param-value>/portal/portal/default/forums/JBossForumsWindow?action=1</param-value>
+ <description>
+ This parameter is used to create proper links in portal environment.
+ It must contain a path to a portlet window where Forums are deployed.
+ If the application is deployed in standalone mode then the parameter is ignored.
+ </description>
+ </context-param>
+ <context-param>
+ <param-name>org.jboss.forums.feeds.URL_TYPE</param-name>
+ <param-value>p</param-value>
+ <description>
+ This parameter is used to create proper links in portal environment.
+ It must contain a path to a portlet window where Forums are deployed.
+ If the application is deployed in standalone mode then the parameter is ignored.
+ </description>
+ </context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/category/viewcategory_body.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -57,7 +57,24 @@
</li>
</ul>
</div>
-
+
+ <c:if test="${forums:feedsConfigured()}">
+ <div class="forumfloatright">
+
+ <!-- feeds -->
+ <a href="#{category.rssFeed}">
+ <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+ RSS
+ </a>
+  
+ <a href="#{category.atomFeed}">
+ <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+ ATOM
+ </a>
+ <br />
+ </div>
+ </c:if>
+
<h:form>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -29,12 +29,10 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
class="forumscontainer"
->
- <!-- stylesheet for this application -->
- <link rel='stylesheet'
- type='text/css'
- href='#{forums:contextPath()}/default_graphics/forums_styles.css'
- media='screen'/>
+>
+
+<ui:composition template="/views/common/common_decoration.xhtml">
+<ui:define name="content">
<!-- resourceBundle to be used by this entire application -->
<f:loadBundle basename="ResourceJSF" var="resource"/>
@@ -100,5 +98,7 @@
<!-- footer -->
<div class="PoweredBy">${resource.Powered_by} <a href="http://labs.jboss.com/jbossforums"><img border="0" src="${forums:themeURL('resourceIconForumsLogoURL')}" /></a></div>
-
+
+</ui:define>
+</ui:composition>
</div>
\ No newline at end of file
Copied: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml (from rev 19478, labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml)
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml (rev 0)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_decoration.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -0,0 +1,67 @@
+<!--
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+-->
+<div xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+ class="forumscontainer"
+>
+<ui:composition>
+
+<c:if test="#{forums:isRunningInPortal()}">
+ <div class="forumscontainer">
+
+ <!-- style sheet for this application -->
+ <link rel='stylesheet'
+ type='text/css'
+ href='#{forums:contextPath()}/default_graphics/forums_styles.css'
+ media='screen'/>
+ <ui:insert name="content"/>
+
+ </div>
+</c:if>
+
+<c:if test="#{forums:isRunningInPortal()==false}">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><h:outputText value="#{shared.mainPageName}"/></title>
+ <meta http-equiv="Content-Type" content="text/html;"/>
+ <!-- style sheet for this application -->
+ <link rel='stylesheet'
+ type='text/css'
+ href='#{forums:contextPath()}/default_graphics/forums_styles.css'
+ media='screen'/>
+ </head>
+ <body class="bodyStyle">
+ <div class="forumscontainer">
+ <ui:insert name="content"/>
+ </div>
+ </body>
+ </html>
+</c:if>
+
+</ui:composition>
+</div>
\ No newline at end of file
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/common/common_noMenu.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -29,12 +29,10 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
class="forumscontainer"
->
- <!-- stylesheet for this application -->
- <link rel='stylesheet'
- type='text/css'
- href='#{forums:contextPath()}/default_graphics/forums_styles.css'
- media='screen'/>
+>
+
+<ui:composition template="/views/common/common_decoration.xhtml">
+<ui:define name="content">
<!-- resourceBundle to be used by this entire application -->
<f:loadBundle basename="ResourceJSF" var="resource"/>
@@ -54,5 +52,7 @@
<!-- footer -->
<div class="PoweredBy">${resource.Powered_by} <a href="http://labs.jboss.com/jbossforums"><img border="0" src="${forums:themeURL('resourceIconForumsLogoURL')}" /></a></div>
-
+
+</ui:define>
+</ui:composition>
</div>
\ No newline at end of file
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/forums/viewforum_body.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -73,9 +73,25 @@
</div>
<h:form>
-
- <c:if test="#{shared.anonymous==false}">
- <div class="forumfloatright">
+
+ <div class="forumfloatright">
+
+ <c:if test="${forums:feedsConfigured()}">
+ <!-- feeds -->
+ <a href="#{forum.rssFeed}">
+ <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+ RSS
+ </a>
+  
+ <a href="#{forum.atomFeed}" class="imglink">
+ <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+ ATOM
+ </a>
+  
+ </c:if>
+
+ <c:if test="#{shared.anonymous==false}">
+
<c:choose>
<c:when test="#{forums:isWatchingForum(forum.forum) ne null}">
<h:commandLink action="#{forumWatch.deActivateWatch}">
@@ -98,8 +114,8 @@
</h:outputLink>
</c:otherwise>
</c:choose>
- </div>
- </c:if>
+ </c:if>
+ </div>
<div class="forumtitletext">
<input type="hidden" name="f" value="#{forum.forum.id}" />
@@ -107,11 +123,6 @@
${forum.forum.name}
</h4>
</div>
-
- <!-- feeds -->
-
- <a href="#{forum.rssFeed}">RSS</a>
- <a href="#{forum.atomFeed}">ATOM</a>
<!-- PAGINATION -->
<c:if test="#{forum.pageNavigator.totalPages gt 1}">
@@ -262,7 +273,8 @@
alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
</td>
<td>
- <h3>
+ <h3>
+ ${forums:folderType(topicrow)} 
<h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
<f:param name="t" value="${topicrow.id}"/>
<h:outputText value="${topicrow.subject}"/>
@@ -378,7 +390,8 @@
alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}"/>
</td>
<td>
- <h3>
+ <h3>
+ ${forums:folderType(topicrow)} 
<h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
<f:param name="t" value="${topicrow.id}"/>
<h:outputText value="${topicrow.subject}"/>
@@ -799,16 +812,6 @@
alt="${resource.New_posts_locked}" width="11" height="14" />
${resource.New_posts_locked}
</li>
- <li>
- <img src="#{forums:themeURL('resourceFolderStickyNewURL')}"
- alt="${resource.Post_Sticky}" width="11" height="14" />
- ${resource.New_posts_sticky}
- </li>
- <li>
- <img src="#{forums:themeURL('resourceFolderAnnounceNewURL')}"
- alt="${resource.Post_Announcement}" width="11" height="14" />
- ${resource.New_posts_annoucement}
- </li>
</ul>
</div>
<div class="forumthreadlegend">
@@ -828,16 +831,6 @@
alt="${resource.No_new_posts_locked}" width="11" height="14" />
${resource.No_new_posts_locked}
</li>
- <li>
- <img src="#{forums:themeURL('resourceFolderStickyURL')}"
- alt="${resource.Post_Sticky}" width="11" height="14" />
- ${resource.No_new_posts_sticky}
- </li>
- <li>
- <img src="#{forums:themeURL('resourceFolderAnnounceURL')}"
- alt="${resource.Post_Announcement}" width="11" height="14" />
- ${resource.No_new_posts_annoucement}
- </li>
</ul>
</div>
<div class="forumthreadlegendtext">
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/index.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/index.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/index.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -29,7 +29,8 @@
xmlns:f="http://java.sun.com/jsf/core"
class="forumscontainer"
>
-
+
+<ui:composition>
<c:if test="#{summary.initialized}">
<c:if test="#{summary.numberOfTopicsFound>0}">
<ui:include src="/views/summary/viewsummary_body.xhtml"/>
@@ -39,5 +40,6 @@
<ui:include src="/views/category/viewcategory_body.xhtml"/>
</c:if>
</c:if>
+</ui:composition>
</div>
\ No newline at end of file
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -83,9 +83,9 @@
<div class="forumtitletext">
<h4>${resource.Mod_CP}</h4>
<p>${resource.Mod_CP_explain}</p>
- <p class="successtext">
+ <!-- <p class="successtext">
<h:messages layout="table" infoStyle="color:green" warnStyle="color:red"/>
- </p>
+ </p>-->
</div>
<!-- PAGINATION -->
@@ -188,7 +188,7 @@
<td class="tableheader"> ${resource.Topics} </td>
<td class="tableheader"> ${resource.Replies} </td>
<td class="tableheader"> ${resource.Last_Post} </td>
- <td class="forumheaderlast"> ${resource.Select} </td>
+ <td class="forumheadernarrow"> ${resource.Select} </td>
</tr>
<c:forEach items="#{moderator.page}" var="topicrow" varStatus="status">
@@ -201,13 +201,13 @@
</td>
<td class='rowline ${(status.last)?"bottomline":""}'>
- ${forums:folderType(topicrow)}
+ ${forums:folderType(topicrow)} 
<h:outputLink value="#{forums:outputLink(shared.links['topic'],true)}">
<f:param name="t" value="${topicrow.id}"/>
<h:outputText value="${topicrow.subject}"/>
</h:outputLink>
</td>
- <td class='rowline ${(status.last)?"bottomline":""}' width="30px">
+ <td class='rowline ${(status.last)?"bottomline":""} forumheadercentered' width="30px">
${topicrow.replies}
</td>
<td class='rowline ${(status.last)?"bottomline":""}' width="150px">
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -189,7 +189,7 @@
</td>
</tr>
<tr>
- <td class="spacerRow" colspan="6"><img src="#{forums:themeURL('resourceSpacerURL')}" /></td>
+ <td class="spacerRow" colspan="6" />
</tr>
</table>
@@ -296,7 +296,7 @@
</td>
</tr>
<tr>
- <td class="spacerRow" colspan="6"><img src="#{forums:themeURL('resourceSpacerURL')}" /></td>
+ <td class="spacerRow" colspan="6" />
</tr>
</table>
Modified: labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml
===================================================================
--- labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2008-04-08 17:54:03 UTC (rev 19481)
+++ labs/jbossforums/branches/multipleforums110P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_body.xhtml 2008-04-08 18:00:23 UTC (rev 19482)
@@ -85,9 +85,25 @@
</ul>
</div>
- <c:if test="#{shared.anonymous==false}">
<div class="forumfloatright">
+
<h:form>
+
+ <c:if test="${forums:feedsConfigured()}">
+ <!-- feeds -->
+ <a href="#{topic.rssFeed}" >
+ <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+ RSS
+ </a>
+  
+ <a href="#{topic.atomFeed}" >
+ <img src="#{forums:themeURL('resourceIconFeedURL')}" border="0" />
+ ATOM
+ </a>
+  
+ </c:if>
+
+ <c:if test="#{shared.anonymous==false}">
<c:choose>
<c:when test="#{topicWatch.watched}">
@@ -115,9 +131,9 @@
</c:otherwise>
</c:choose>
+ </c:if>
</h:form>
</div>
- </c:if>
<div class="forumtitletext">
<input type="hidden" name="f" value="#{forum.forum.id}" />
@@ -405,9 +421,7 @@
<li>
<a name="${postrow.id}" />
<h:outputLink value="#{forums:postPermlink(postrow.id)}" style="text-decoration: none;">
- <f:verbatim>
- <h:outputText value="${resource.Permalink}"/>
- </f:verbatim>
+ <h:outputText value="${resource.Permalink}"/>
</h:outputLink>
</li>
<li>${resource.Posted}: #{forums:dateStr(postrow.createDate)}</li>
@@ -575,9 +589,7 @@
</td>
</tr>
<tr>
- <td colspan="2" class="forumthreadfooter">
- <img src="#{forums:themeURL('resourceSpacerURL')}" />
- </td>
+ <td colspan="2" class="forumthreadfooter" />
</tr>
</c:forEach>
More information about the jboss-svn-commits
mailing list