Author: christian.bauer(a)jboss.com
Date: 2008-01-25 06:24:26 -0500 (Fri, 25 Jan 2008)
New Revision: 7229
Added:
trunk/examples/wiki/src/etc/messages_forumTopPosters_en.properties
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumTopPostersPreferences.java
trunk/examples/wiki/view/plugins/forumTopPosters/
trunk/examples/wiki/view/plugins/forumTopPosters/plugin.xhtml
trunk/examples/wiki/view/themes/default/img/star.gif
trunk/examples/wiki/view/themes/default/img/star_grey.gif
trunk/examples/wiki/view/themes/sfwkorg/img/star.gif
trunk/examples/wiki/view/themes/sfwkorg/img/star_grey.gif
Modified:
trunk/examples/wiki/src/etc/WEB-INF/components.xml
trunk/examples/wiki/src/etc/import-prod.sql
trunk/examples/wiki/src/etc/messages_en.properties
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/NodeRemover.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserSearch.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQuery.java
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/FAQData.dbunit.xml
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/ForumData.dbunit.xml
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/HelpDocuments.dbunit.xml
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/KnowledgeBase.dbunit.xml
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/UploadData.dbunit.xml
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java
trunk/examples/wiki/view/docDisplay_d.xhtml
trunk/examples/wiki/view/includes/commentsDisplay.xhtml
trunk/examples/wiki/view/plugins/forumReplies/plugin.xhtml
trunk/examples/wiki/view/plugins/jiraIssueList/plugin.xhtml
trunk/examples/wiki/view/themes/default/css/forumReplies.css
trunk/examples/wiki/view/themes/default/css/template.css
trunk/examples/wiki/view/themes/default/template.xhtml
trunk/examples/wiki/view/themes/sfwkorg/css/forumReplies.css
trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
trunk/examples/wiki/view/themes/sfwkorg/template.xhtml
trunk/examples/wiki/view/userInfo_d.xhtml
Log:
Rating system for comments and top posters plugin
Modified: trunk/examples/wiki/src/etc/WEB-INF/components.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/components.xml 2008-01-25 00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/etc/WEB-INF/components.xml 2008-01-25 11:24:26 UTC (rev 7229)
@@ -120,6 +120,7 @@
<value>messages_jiraConnector</value>
<value>messages_feedAggregator</value>
<value>messages_feedConnector</value>
+ <value>messages_forumTopPosters</value>
</core:bundle-names>
</core:resource-loader>
Modified: trunk/examples/wiki/src/etc/import-prod.sql
===================================================================
--- trunk/examples/wiki/src/etc/import-prod.sql 2008-01-25 00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/etc/import-prod.sql 2008-01-25 11:24:26 UTC (rev 7229)
@@ -19,38 +19,69 @@
INSERT INTO PREFERENCE
VALUES(16,'Wiki','showTags',NULL,NULL,NULL,TRUE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(17,'Wiki','showEmailToLoggedInOnly',NULL,NULL,NULL,TRUE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(18,'Wiki','trashArea',NULL,NULL,NULL,NULL,'Trash',0,NULL)
+INSERT INTO PREFERENCE
VALUES(19,'Wiki','showSiteFeedInMenu',NULL,NULL,NULL,TRUE,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(20,'DocEditor','minorRevisionEnabled',NULL,NULL,NULL,TRUE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(21,'DocEditor','regularEditAreaRows',15,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(22,'DocEditor','regularEditAreaColumns',65,NULL,NULL,NULL,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(30,'UserManagement','activationCodeSalt',NULL,NULL,NULL,NULL,'MySecretSalt123',0,NULL)
INSERT INTO PREFERENCE
VALUES(31,'UserManagement','passwordRegex',NULL,NULL,NULL,NULL,'^[0-9A-Za-z]{6,15}',0,NULL)
INSERT INTO PREFERENCE
VALUES(32,'UserManagement','newUserInRole',NULL,NULL,NULL,NULL,'member',0,NULL)
INSERT INTO PREFERENCE
VALUES(33,'UserManagement','enableRegistration',NULL,NULL,NULL,TRUE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(34,'UserManagement','createHomeAfterUserActivation',NULL,NULL,NULL,FALSE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(35,'UserManagement','homepageDefaultContent',NULL,NULL,NULL,NULL,'This
is your homepage, login to edit it.',0,NULL)
+
INSERT INTO PREFERENCE
VALUES(40,'Comments','listAscending',NULL,NULL,NULL,FALSE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(41,'Comments','enableByDefault',NULL,NULL,NULL,TRUE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(42,'Comments','threaded',NULL,NULL,NULL,TRUE,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(110,'LastModifiedDocuments','numberOfItems',5,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(111,'LastModifiedDocuments','showUsernames',NULL,NULL,NULL,TRUE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(112,'LastModifiedDocuments','documentTitleLength',20,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(113,'LastModifiedDocuments','title',NULL,NULL,NULL,NULL,'Last
Site Updates',0,NULL)
+
INSERT INTO PREFERENCE
VALUES(120,'Blog','pageSize',5,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(121,'Blog','archiveSubscribeIcon',NULL,NULL,NULL,FALSE,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(122,'Blog','recentEntriesItems',10,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(123,'Blog','recentEntriesTruncateTitle',40,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(124,'Blog','recentEntriesSubscribeIcon',NULL,NULL,NULL,TRUE,NULL,0,NULL)
-INSERT INTO PREFERENCE
VALUES(130,'FeedTeasers','title',NULL,NULL,NULL,NULL,'Site news
feed:',0,NULL)
+
+INSERT INTO PREFERENCE
VALUES(130,'FeedTeasers','title',NULL,NULL,NULL,NULL,'Site news
feed',0,NULL)
INSERT INTO PREFERENCE
VALUES(131,'FeedTeasers','numberOfTeasers',5,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(132,'FeedTeasers','truncateDescription',200,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(133,'FeedTeasers','showAuthor',NULL,NULL,NULL,TRUE,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(140,'Flash','allowedDomains',NULL,NULL,NULL,NULL,'video.google.com,www.youtube.com',0,NULL)
+
INSERT INTO PREFERENCE
VALUES(150,'DirMenu','title',NULL,NULL,NULL,NULL,'Directory
Menu',0,NULL)
INSERT INTO PREFERENCE
VALUES(151,'DirMenu','menuLevels',3,NULL,NULL,NULL,NULL,0,NULL)
INSERT INTO PREFERENCE
VALUES(152,'DirMenu','menuDepth',3,NULL,NULL,NULL,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(160,'Tags','linkToCurrentDocument',NULL,NULL,NULL,TRUE,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(170,'DocPager','showNames',NULL,NULL,NULL,TRUE,NULL,0,NULL)
+
INSERT INTO PREFERENCE
VALUES(180,'Forum','topicsPerPage',20,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(190,'JiraIssueList','title',NULL,NULL,NULL,NULL,'JIRA
Issues',0,NULL)
+INSERT INTO PREFERENCE
VALUES(191,'JiraIssueList','truncateSummary',35,NULL,NULL,NULL,NULL,0,NULL)
+
+INSERT INTO PREFERENCE
VALUES(200,'FeedAggregator','title',NULL,NULL,NULL,NULL,'Aggregated
Feeds',0,NULL)
+INSERT INTO PREFERENCE
VALUES(201,'FeedAggregator','truncateDescription',100,NULL,NULL,NULL,NULL,0,NULL)
+
+INSERT INTO PREFERENCE
VALUES(210,'ForumTopPosters','title',NULL,NULL,NULL,NULL,'Top Forum
Posters',0,NULL)
+INSERT INTO PREFERENCE
VALUES(211,'ForumTopPosters','numberOfPosters',10,NULL,NULL,NULL,NULL,0,NULL)
+
+INSERT INTO PREFERENCE
VALUES(300,'JiraConnector','connectionTimeoutSeconds',15,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(301,'JiraConnector','replyTimeoutSeconds',10,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(302,'JiraConnector','issueListCacheUpdateTimeoutSeconds',600,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(303,'JiraConnector','issueListCacheIdleTimeoutSeconds',36000,NULL,NULL,NULL,NULL,0,NULL)
+
+INSERT INTO PREFERENCE
VALUES(310,'FeedConnector','connectionTimeoutSeconds',30,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(311,'FeedConnector','feedCacheUpdateTimeoutSeconds',600,NULL,NULL,NULL,NULL,0,NULL)
+INSERT INTO PREFERENCE
VALUES(312,'FeedConnector','feedCacheIdleTimeoutSeconds',36000,NULL,NULL,NULL,NULL,0,NULL)
+
INSERT INTO `ROLES` (`ROLE_ID`, `ACCESS_LEVEL`, `CREATED_ON`, `DISPLAY_NAME`, `NAME`,
`OBJ_VERSION`) VALUES (1,1000,'2006-06-27
13:45:00','Administrator','admin',0)
INSERT INTO `ROLES` (`ROLE_ID`, `ACCESS_LEVEL`, `CREATED_ON`, `DISPLAY_NAME`, `NAME`,
`OBJ_VERSION`) VALUES (2,0,'2006-06-27
13:45:00','Guest','guest',0)
INSERT INTO `ROLES` (`ROLE_ID`, `ACCESS_LEVEL`, `CREATED_ON`, `DISPLAY_NAME`, `NAME`,
`OBJ_VERSION`) VALUES (3,1,'2006-06-27
13:45:00','Member','member',0)
@@ -65,28 +96,31 @@
INSERT INTO `USER_ROLE` (`USER_ID`, `ROLE_ID`) VALUES (2,2)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`) VALUES
(1,1,'2006-09-23
13:45:00',NULL,'ROOT',0,0,'ROOT',1000,'',1,NULL,NULL)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`) VALUES
(1,1,'2006-09-23
13:45:00',NULL,'ROOT',0,0,'ROOT',1000,'',1,NULL,NULL,0)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`) VALUES
(2,2,'2006-09-23
13:45:00',NULL,'Start',0,0,'Start',0,false,1,NULL,1)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`) VALUES
(2,2,'2006-09-23
13:45:00',NULL,'Start',0,0,'Start',0,false,1,NULL,1,0)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`)
VALUES(3,2,'2006-09-23
13:45:00',NULL,'Welcome!',0,1,'Welcome',0,false,1,NULL,2)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`)
VALUES(3,2,'2006-09-23
13:45:00',NULL,'Welcome!',0,1,'Welcome',0,false,1,NULL,2,0)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`)
VALUES(4,4,'2006-09-23
13:45:00',NULL,'Members',0,0,'Members',1000,'',1,NULL,1)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`)
VALUES(4,4,'2006-09-23
13:45:00',NULL,'Members',0,0,'Members',1000,'',1,NULL,1,0)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`) VALUES
(5,5,'2006-09-23
13:45:00',NULL,'Help',0,0,'Help',1000,'',1,NULL,1)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`) VALUES
(5,5,'2006-09-23
13:45:00',NULL,'Help',0,0,'Help',1000,'',1,NULL,1,0)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`) VALUES
(6,5,'2006-09-23 13:45:00',NULL,'Working with
documents',0,0,'WorkingWithDocuments',1000,'',1,NULL,5)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`) VALUES
(6,5,'2006-09-23 13:45:00',NULL,'Working with
documents',0,0,'WorkingWithDocuments',1000,'',1,NULL,5,0)
-INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`) VALUES
(7,5,'2006-09-23 13:45:00',NULL,'Wiki Text
Markup',0,0,'WikiTextMarkup',1000,'',1,NULL,6)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`) VALUES
(7,5,'2006-09-23 13:45:00',NULL,'Wiki Text
Markup',0,0,'WikiTextMarkup',1000,'',1,NULL,6,0)
+INSERT INTO `WIKI_NODE` (`NODE_ID`, `AREA_NR`, `CREATED_ON`, `LAST_MODIFIED_ON`, `NAME`,
`READ_ACCESS_LEVEL`, `OBJ_VERSION`, `WIKINAME`, `WRITE_ACCESS_LEVEL`, `WRITE_PROTECTED`,
`CREATED_BY_USER_ID`, `LAST_MODIFIED_BY_USER_ID`, `PARENT_NODE_ID`, `RATING`) VALUES
(8,8,'2006-09-23
13:45:00',NULL,'Trash',0,0,'Trash',1000,'',1,NULL,1,0)
+
INSERT INTO `WIKI_FILE` (`NODE_ID`, `FILE_REVISION`) VALUES (3,0)
INSERT INTO `WIKI_FILE` (`NODE_ID`, `FILE_REVISION`) VALUES (7,0)
-INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (1,NULL,1,10,1,NULL)
-INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (2,NULL,2,3,1,3)
+INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (1,'Root Area',1,12,1,NULL)
+INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (2,'Start Area',2,3,1,3)
INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (4,'Default member area',8,9,1,NULL)
INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (5,'Help documents',4,7,1,NULL)
INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (6,'Creating and editing wiki
documents',5,6,1,NULL)
+INSERT INTO `WIKI_DIRECTORY` (`NODE_ID`, `DESCRIPTION`, `NS_LEFT`, `NS_RIGHT`,
`NS_THREAD`, `DEFAULT_FILE_ID`) VALUES (8,'Trash Area',10,11,1,NULL)
INSERT INTO `WIKI_DOCUMENT` (`NODE_ID`, `CONTENT`, `CONTENT_MACROS`,
`ENABLE_COMMENT_FORM`, `ENABLE_COMMENTS`, `ENABLE_COMMENTS_ON_FEEDS`, `FOOTER`,
`FOOTER_MACROS`, `HEADER`, `HEADER_MACROS`, `NAME_AS_TITLE`) VALUES (3,'Welcome to
LaceWiki.\n\nLogin with admin-admin and rebuild the search index in the administration
area.',NULL,true,true,true,NULL,NULL,NULL,NULL,true)
Modified: trunk/examples/wiki/src/etc/messages_en.properties
===================================================================
--- trunk/examples/wiki/src/etc/messages_en.properties 2008-01-25 00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/etc/messages_en.properties 2008-01-25 11:24:26 UTC (rev 7229)
@@ -282,6 +282,8 @@
lacewiki.button.commentForm.Post=Post
lacewiki.label.comment.FeedEntryTitlePrefix=[Comment]
lacewiki.msg.comment.FeedIntro=This is a comment written in reply to
+lacewiki.label.comment.RateThisPosting=Rate this posting
+lacewiki.label.comment.Rating=Rating
# User Control
@@ -430,6 +432,7 @@
lacewiki.label.userInfo.Name=Name
lacewiki.label.userInfo.JoinedOn=Joined
lacewiki.label.userInfo.LastLoginOn=Last Login
+lacewiki.label.userInfo.RatingPoints=Rating Points
lacewiki.button.userInfo.EditAccount=<u>E</u>dit Account
lacewiki.button.userInfo.EditAccount.accesskey=E
Added: trunk/examples/wiki/src/etc/messages_forumTopPosters_en.properties
===================================================================
--- trunk/examples/wiki/src/etc/messages_forumTopPosters_en.properties
(rev 0)
+++ trunk/examples/wiki/src/etc/messages_forumTopPosters_en.properties 2008-01-25 11:24:26
UTC (rev 7229)
@@ -0,0 +1,12 @@
+forumTopPosters.preferences.Name=Plugin: Forum Top Posters
+forumTopPosters.preferences.Title=Title of box
+forumTopPosters.preferences.NumberOfPosters=Number of posters in list
+forumTopPosters.preferences.ForumLink=Wiki link to forum start page (topic list)
+forumTopPosters.preferences.ExcludeRoles=Exclude users with role name (space separated)
+
+forumTopPosters.label.Position=Position
+forumTopPosters.label.User=User
+forumTopPosters.label.JoinedOn=Joined On
+forumTopPosters.label.RatingPoints=Rating Points
+
+forumTopPosters.label.NoPostersFound=No posters with rating points found.
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/CommentHome.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -257,6 +257,30 @@
return "redirectToDocument";
}
+ public void rate(Long commentId, int rating) {
+
+ // Only the owner of the document can rate comments of that document
+ if (
!currentUser.getId().equals(documentHome.getInstance().getCreatedBy().getId()) ) {
+ throw new AuthorizationException("You don't have permission for this
operation");
+ }
+
+ // Guest can't rate
+ if (currentUser.isGuest()) {
+ throw new IllegalStateException("Guests can't rate comments");
+ }
+
+ setId(commentId);
+ if (isManaged()) {
+
+ if (getInstance().getRating() != 0)
+ return; // Already rated
+ if (getInstance().getCreatedBy().getId() == currentUser.getId())
+ return; // Can't rate my own stuff
+
+ getInstance().setRating(rating);
+ }
+ }
+
public void cancel() {
endConversation();
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/NodeRemover.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/NodeRemover.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/NodeRemover.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -7,16 +7,15 @@
package org.jboss.seam.wiki.core.action;
import org.jboss.seam.ScopeType;
-import org.jboss.seam.log.Log;
import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.Log;
import org.jboss.seam.wiki.core.dao.UserDAO;
import org.jboss.seam.wiki.core.dao.WikiNodeDAO;
import org.jboss.seam.wiki.core.feeds.FeedDAO;
-import org.jboss.seam.wiki.core.model.WikiNode;
import org.jboss.seam.wiki.core.model.WikiDirectory;
+import org.jboss.seam.wiki.core.model.WikiNode;
import org.jboss.seam.wiki.util.WikiUtil;
import javax.persistence.EntityManager;
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserHome.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -406,6 +406,10 @@
passwordMatchesControl();
}
+ public long getRatingPoints() {
+ return userDAO.findRatingPoints(getInstance().getId());
+ }
+
// ####################### PREFERENCES ##################################
PreferenceEditor preferenceEditor;
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserSearch.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserSearch.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/UserSearch.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -40,7 +40,7 @@
exampleUser = new User();
orderByProperty = "username";
orderDescending = false;
- ignoreProperties = new String[]{"passwordHash", "activated",
"createdOn", "lastLoginOn" };
+ ignoreProperties = new String[]{"passwordHash", "activated",
"createdOn", "lastLoginOn", "ratingScore" };
}
public void find() {
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/UserDAO.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -64,6 +64,13 @@
return null;
}
+ public long findRatingPoints(Long userId) {
+ return (Long)entityManager
+ .createQuery("select sum(n.rating) from WikiNode n where
n.createdBy.id = :userId")
+ .setParameter("userId", userId)
+ .getSingleResult();
+ }
+
public void resetNodeCreatorToAdmin(User user) {
User adminUser = (User) Component.getInstance("adminUser");
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -285,6 +285,16 @@
<database-object>
<create>
+ create index IDX_WIKI_NODE_RATING on WIKI_NODE (RATING)
+ </create>
+ <drop>
+ drop index IDX_WIKI_NODE_RATING
+ </drop>
+ <dialect-scope
name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+ </database-object>
+
+ <database-object>
+ <create>
create index IDX_WIKI_NODE_READ_ACCESS_LEVEL on WIKI_NODE
(READ_ACCESS_LEVEL)
</create>
<drop>
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/User.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -102,6 +102,9 @@
@org.hibernate.annotations.ForeignKey(name = "FK_USER_USER_PROFILE_ID")
private UserProfile profile = new UserProfile();
+ @Transient
+ private long ratingPoints = 0;
+
public User() {}
public User(String firstname, String lastname,
@@ -163,6 +166,9 @@
public UserProfile getProfile() { return profile; }
public void setProfile(UserProfile profile) { this.profile = profile; }
+ public long getRatingPoints() { return ratingPoints; }
+ public void setRatingPoints(long ratingPoints) { this.ratingPoints = ratingPoints; }
+
// Misc methods
public boolean isGuest() {
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -116,7 +116,7 @@
public String[] getPropertiesForGroupingInQueries() {
return new String[]{
- "version", "parent",
+ "version", "parent", "rating",
"areaNumber", "name", "wikiname",
"createdBy", "createdOn",
"lastModifiedBy", "lastModifiedOn",
"readAccessLevel", "writeAccessLevel", "writeProtected",
"subject", "fromUserName", "fromUserEmail",
"fromUserHomepage", "useWikiText",
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDirectory.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -82,7 +82,7 @@
public String[] getPropertiesForGroupingInQueries() {
return new String[]{
- "version", "parent",
+ "version", "parent", "rating",
"areaNumber", "name", "wikiname",
"createdBy", "createdOn",
"lastModifiedBy", "lastModifiedOn",
"readAccessLevel", "writeAccessLevel", "writeProtected",
"defaultFile", "description"
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiNode.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -2,6 +2,7 @@
import org.hibernate.validator.Pattern;
import org.hibernate.validator.Length;
+import org.hibernate.validator.Range;
import org.jboss.seam.wiki.core.search.annotations.Searchable;
import org.jboss.seam.wiki.core.search.annotations.SearchableType;
import org.jboss.seam.wiki.core.search.PaddedIntegerBridge;
@@ -26,7 +27,7 @@
public abstract class WikiNode<N extends WikiNode> implements Comparable {
public static enum SortableProperty {
- name, createdOn, lastModifiedOn;
+ name, createdOn, lastModifiedOn, rating;
}
@Id
@@ -106,6 +107,10 @@
@org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.JOIN)
protected WikiNode parent;
+ @Range(min = 0l, max = 5)
+ @Column(name = "RATING", nullable = false)
+ private int rating = 0;
+
protected WikiNode() {}
protected WikiNode(String name) {
@@ -148,6 +153,9 @@
public WikiNode getParent() { return parent; }
public void setParent(WikiNode parent) { this.parent = parent; }
+ public int getRating() { return rating; }
+ public void setRating(int rating) { this.rating = rating; }
+
public WikiNode getArea() {
if (this.getParent() != null && this.getParent().getParent() == null)
return this; // This is an area
// Else, walk up the tree until we find the area
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -3,10 +3,8 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.wiki.core.model.WikiDirectory;
-import org.jboss.seam.wiki.core.model.WikiDocument;
-import org.jboss.seam.wiki.core.model.WikiComment;
-import org.jboss.seam.wiki.core.model.WikiMenuItem;
+import org.jboss.seam.wiki.core.model.*;
+import org.jboss.seam.Component;
import org.hibernate.Session;
import org.hibernate.ScrollableResults;
import org.hibernate.transform.ResultTransformer;
@@ -230,6 +228,34 @@
return topicInfoMap;
}
+ public List<User> findPostersAndRatingPoints(Long forumId, int maxResults,
List<String> excludeRoles) {
+
+ if (excludeRoles.size() == 0) {
+ excludeRoles.add("guest"); // By default, don't show guests,
query requires _some_ exclude
+ }
+
+ final List<User> postersAndRatingPoints = new ArrayList<User>();
+
+ getSession(true).getNamedQuery("forumPostersAndRatingPoints")
+ .setParameter("parentDirId", forumId)
+ .setParameterList("ignoreUserInRoles", excludeRoles )
+ .setMaxResults(maxResults)
+ .setComment("Retrieving forum posters and rating points")
+ .setCacheable(true)
+ .setResultTransformer(
+ new ResultTransformer() {
+ public Object transformTuple(Object[] result, String[] strings) {
+ ((User)result[0]).setRatingPoints((Long)result[1]);
+ postersAndRatingPoints.add((User)result[0]);
+ return null;
+ }
+ public List transformList(List list) { return list; }
+ }
+ )
+ .list();
+ return postersAndRatingPoints;
+ }
+
private Session getSession(boolean restricted) {
if (restricted) {
return ((Session)((org.jboss.seam.persistence.EntityManagerProxy)
restrictedEntityManager).getDelegate());
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -22,6 +22,7 @@
public Set<PreferenceEntity> getPreferenceEntities() {
return new HashSet<PreferenceEntity>() {{
add( createPreferenceEntity(ForumPreferences.class) );
+ add( createPreferenceEntity(ForumTopPostersPreferences.class) );
}};
}
}
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -149,6 +149,7 @@
select distinct
doc2.NODE_ID as NODE_ID,
doc2.OBJ_VERSION as OBJ_VERSION,
+ doc2.RATING as RATING,
doc2.AREA_NR as AREA_NR,
doc2.NAME as NAME,
doc2.WIKINAME as WIKINAME,
@@ -220,4 +221,45 @@
]]></query>
+ <!-- TODO: HQL doesn't support FROM clause subselect -->
+ <sql-query name="forumPostersAndRatingPoints">
+ <return class="org.jboss.seam.wiki.core.model.User"/>
+ <return-scalar column="RATING_POINTS" type="long"/>
+ <![CDATA[
+ select
+ ur.USER_ID, ur.ACTIVATED, ur.ACTIVATION_CODE, ur.CREATED_ON, ur.EMAIL,
ur.FIRSTNAME, ur.LAST_LOGIN_ON,
+ ur.LASTNAME, ur.MEMBER_HOME_WIKI_DIRECTORY_ID, ur.PASSWORDHASH,
ur.USER_PROFILE_ID, ur.USERNAME, ur.OBJ_VERSION,
+ sum(ur.RATING) as RATING_POINTS
+ from
+ (select distinct
+ user2.*,
+ com2.NODE_ID,
+ com2.RATING
+ from
+ WIKI_DOCUMENT doc0
+ inner join WIKI_FILE doc1 on doc0.NODE_ID=doc1.NODE_ID
+ inner join WIKI_NODE doc2 on doc0.NODE_ID=doc2.NODE_ID,
+ WIKI_COMMENT com1
+ inner join WIKI_NODE com2 on com1.NODE_ID=com2.NODE_ID
+ inner join USERS user2 on com2.CREATED_BY_USER_ID=user2.USER_ID
+ inner join USER_ROLE roles1 on user2.USER_ID=roles1.USER_ID
+ inner join ROLES roles2 on roles1.ROLE_ID=roles2.ROLE_ID
+ where
+ doc2.PARENT_NODE_ID=:parentDirId
+ and (com1.NS_THREAD in
+ (select com3.NS_THREAD from WIKI_COMMENT com3
+ inner join WIKI_NODE com4 on com3.NODE_ID=com4.NODE_ID
+ where com4.PARENT_NODE_ID=doc0.NODE_ID
+ )
+ )
+ and (roles2.NAME not in (:ignoreUserInRoles))
+ and com2.RATING<>0
+ ) as ur
+ group by
+ ur.USER_ID, ur.ACTIVATED, ur.ACTIVATION_CODE, ur.CREATED_ON, ur.EMAIL,
ur.FIRSTNAME, ur.LAST_LOGIN_ON,
+ ur.LASTNAME, ur.MEMBER_HOME_WIKI_DIRECTORY_ID, ur.PASSWORDHASH,
ur.USER_PROFILE_ID, ur.USERNAME,
+ ur.OBJ_VERSION
+ order by sum(ur.RATING) desc
+ ]]></sql-query>
+
</hibernate-mapping>
\ No newline at end of file
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQuery.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQuery.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumQuery.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -1,18 +1,20 @@
package org.jboss.seam.wiki.plugin.forum;
-import org.jboss.seam.wiki.core.model.WikiDirectory;
-import org.jboss.seam.wiki.core.model.User;
-import org.jboss.seam.wiki.core.action.Pager;
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.*;
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.web.RequestParameter;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.Component;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.log.Log;
+import org.jboss.seam.wiki.core.action.Pager;
+import org.jboss.seam.wiki.core.engine.WikiLink;
+import org.jboss.seam.wiki.core.engine.WikiLinkResolver;
+import org.jboss.seam.wiki.core.model.User;
+import org.jboss.seam.wiki.core.model.WikiDirectory;
+import java.io.Serializable;
import java.util.*;
-import java.io.Serializable;
@Name("forumQuery")
@Scope(ScopeType.CONVERSATION)
@@ -26,11 +28,14 @@
private Pager pager;
@In("#{preferences.get('Forum')}")
- ForumPreferences prefs;
+ ForumPreferences forumPrefs;
+ @In("#{preferences.get('ForumTopPosters', currentMacro)}")
+ ForumTopPostersPreferences forumTopPostersPrefs;
+
@RequestParameter
public void setPage(Integer page) {
- if (pager == null) pager = new Pager(prefs.getTopicsPerPage());
+ if (pager == null) pager = new Pager(forumPrefs.getTopicsPerPage());
pager.setPage(page);
Contexts.getSessionContext().set(TOPIC_PAGE, page);
}
@@ -128,4 +133,58 @@
topics.addAll(topicInfo.values());
}
+ /* ####################### POSTERS ########################## */
+
+ private Map<Long, List<User>> forumsTopPosters = new HashMap<Long,
List<User>>();
+
+ public List<User> getTopPosters() {
+ Long forumId = resolveForumId(forumTopPostersPrefs.getForumLink());
+ return forumId != null ? forumsTopPosters.get(forumId) : null;
+ }
+
+ @Observer(value = "Macro.render.forumTopPosters", create = true)
+ public void loadForumTopPosters() {
+ log.debug("loading top posters of forum: " +
forumTopPostersPrefs.getForumLink());
+
+ Long forumId = resolveForumId(forumTopPostersPrefs.getForumLink());
+ if (forumId == null) {
+ log.debug("could not resolve forum id for forum start page link: "
+ forumTopPostersPrefs.getForumLink());
+ return;
+ }
+
+ log.debug("resolved forum id: " + forumId);
+
+ List<String> excludeRoles = new ArrayList<String>();
+ if (forumTopPostersPrefs.getExcludeRoles() != null &&
+ forumTopPostersPrefs.getExcludeRoles().length() > 0) {
+ log.debug("excluding posters with roles: " +
forumTopPostersPrefs.getExcludeRoles());
+ excludeRoles =
Arrays.asList(forumTopPostersPrefs.getExcludeRoles().split(" "));
+ }
+
+ log.debug("loading top " + forumTopPostersPrefs.getNumberOfPosters() +
" posters of forum id: " + forumId);
+ List<User> topPosters =
+ forumDAO.findPostersAndRatingPoints(
+ forumId,
+ forumTopPostersPrefs.getNumberOfPosters().intValue(),
+ excludeRoles
+ );
+ log.debug("found top posters: " + topPosters.size());
+ forumsTopPosters.put(forumId, topPosters);
+ }
+
+ private Long resolveForumId(String forumLink) {
+ if (forumLink == null || forumLink.length() == 0) return null;
+ WikiLinkResolver resolver =
(WikiLinkResolver)Component.getInstance("wikiLinkResolver");
+ Map<String, WikiLink> resolvedLinks = new HashMap<String,
WikiLink>();
+ resolver.resolveLinkText(currentDirectory.getAreaNumber(), resolvedLinks,
forumLink);
+ WikiLink resolvedLink = resolvedLinks.get(forumLink);
+ if (resolvedLink.isBroken() || resolvedLink.getFile().getId() == null) {
+ return null;
+ } else {
+ // Parent of forum start page is the forum directory
+ return resolvedLink.getFile().getParent().getId();
+ }
+ }
+
+
}
Added:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumTopPostersPreferences.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumTopPostersPreferences.java
(rev 0)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumTopPostersPreferences.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at
gnu.org.
+ */
+package org.jboss.seam.wiki.plugin.forum;
+
+import org.jboss.seam.wiki.preferences.annotations.Preferences;
+import org.jboss.seam.wiki.preferences.annotations.PreferenceProperty;
+import org.jboss.seam.wiki.preferences.PreferenceVisibility;
+import org.hibernate.validator.Range;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Length;
+
+/**
+ * @author Christian Bauer
+ */
+@Preferences(name = "ForumTopPosters", description =
"#{messages['forumTopPosters.preferences.Name']}")
+public class ForumTopPostersPreferences {
+
+ @PreferenceProperty(
+ description =
"#{messages['forumTopPosters.preferences.Title']}",
+ visibility = {PreferenceVisibility.SYSTEM, PreferenceVisibility.INSTANCE},
+ editorIncludeName = "AdaptiveTextInput"
+ )
+ @Length(min = 0, max = 255)
+ @NotNull
+ private String title;
+
+ @PreferenceProperty(
+ description =
"#{messages['forumTopPosters.preferences.NumberOfPosters']}",
+ visibility = {PreferenceVisibility.SYSTEM, PreferenceVisibility.INSTANCE},
+ editorIncludeName = "NumberRange"
+ )
+ @Range(min = 3l, max = 100l)
+ @NotNull
+ private Long numberOfPosters;
+
+ @PreferenceProperty(
+ description =
"#{messages['forumTopPosters.preferences.ForumLink']}",
+ visibility = PreferenceVisibility.INSTANCE,
+ editorIncludeName = "AdaptiveTextInput"
+ )
+ @Length(min = 3, max = 255)
+ private String forumLink;
+
+ @PreferenceProperty(
+ description =
"#{messages['forumTopPosters.preferences.ExcludeRoles']}",
+ visibility = PreferenceVisibility.INSTANCE,
+ editorIncludeName = "AdaptiveTextInput"
+ )
+ @Length(min = 3, max = 255)
+ private String excludeRoles;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public Long getNumberOfPosters() {
+ return numberOfPosters;
+ }
+
+ public String getForumLink() {
+ return forumLink;
+ }
+
+ public String getExcludeRoles() {
+ return excludeRoles;
+ }
+}
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/FAQData.dbunit.xml
===================================================================
--- trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/FAQData.dbunit.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/FAQData.dbunit.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -4,7 +4,7 @@
<!-- FAQs directory -->
<WIKI_NODE
- NODE_ID="300" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="300" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="300" NAME="FAQs" WIKINAME="FAQs"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -15,7 +15,7 @@
<!-- FAQs directory start page, faq browser plugin -->
<WIKI_NODE
- NODE_ID="301" OBJ_VERSION="0" PARENT_NODE_ID="300"
+ NODE_ID="301" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="300"
AREA_NR="300" NAME="FAQ Browser"
WIKINAME="FAQBrowser"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -34,7 +34,7 @@
<!-- First FAQ category -->
<WIKI_NODE
- NODE_ID="302" OBJ_VERSION="0" PARENT_NODE_ID="300"
+ NODE_ID="302" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="300"
AREA_NR="300" NAME="Seam Product"
WIKINAME="SeamProduct"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -44,7 +44,7 @@
<!-- Second FAQ category -->
<WIKI_NODE
- NODE_ID="303" OBJ_VERSION="0"
PARENT_NODE_ID="302"
+ NODE_ID="303" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="302"
AREA_NR="300" NAME="Seam License"
WIKINAME="SeamLicense"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -54,7 +54,7 @@
<!-- Third FAQ category -->
<WIKI_NODE
- NODE_ID="304" OBJ_VERSION="0" PARENT_NODE_ID="300"
+ NODE_ID="304" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="300"
AREA_NR="300" NAME="Seam Core" WIKINAME="SeamCore"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -64,7 +64,7 @@
<!-- Fourth FAQ category -->
<WIKI_NODE
- NODE_ID="305" OBJ_VERSION="0"
PARENT_NODE_ID="304"
+ NODE_ID="305" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="304"
AREA_NR="300" NAME="Expression Language"
WIKINAME="ExpressionLanguage"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -74,7 +74,7 @@
<!-- Fifth FAQ category -->
<WIKI_NODE
- NODE_ID="306" OBJ_VERSION="0"
PARENT_NODE_ID="304"
+ NODE_ID="306" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="304"
AREA_NR="300" NAME="Component Design"
WIKINAME="ComponentDesign"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -86,7 +86,7 @@
<!-- FAQ questions -->
<WIKI_NODE
- NODE_ID="307" OBJ_VERSION="0" PARENT_NODE_ID="303"
+ NODE_ID="307" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="303"
AREA_NR="300" NAME="Can I use Seam in my proprietary
product?" WIKINAME="CanIUseSeamInMyProprietaryProduct"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="2006-09-23 13:45:00" LAST_MODIFIED_BY_USER_ID="3"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -103,7 +103,7 @@
NAME_AS_TITLE="false" ENABLE_COMMENTS="true"
ENABLE_COMMENT_FORM="true" ENABLE_COMMENTS_ON_FEEDS="false"/>
<WIKI_NODE
- NODE_ID="308" OBJ_VERSION="0" PARENT_NODE_ID="303"
+ NODE_ID="308" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="303"
AREA_NR="300" NAME="Do I have to pay to use Seam?"
WIKINAME="DoIHaveToPayToUseSeam"
CREATED_ON="2006-09-24 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -123,7 +123,7 @@
<!-- FAQ answers -->
<WIKI_NODE
- NODE_ID="309" OBJ_VERSION="0" PARENT_NODE_ID="308"
+ NODE_ID="309" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="308"
AREA_NR="3" NAME="Do I have to pay to use
Seam?.Comment11967298211844"
WIKINAME="DoIHaveToPayToUseSeamComment11967298211844"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="2"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/ForumData.dbunit.xml
===================================================================
--- trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/ForumData.dbunit.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/ForumData.dbunit.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -4,7 +4,7 @@
<!-- Forums directory -->
<WIKI_NODE
- NODE_ID="100" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="100" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="100" NAME="Forums" WIKINAME="Forums"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -23,7 +23,7 @@
<!-- Forums directory start page, forums list -->
<WIKI_NODE
- NODE_ID="101" OBJ_VERSION="0" PARENT_NODE_ID="100"
+ NODE_ID="101" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="100"
AREA_NR="100" NAME="Seam Forums"
WIKINAME="SeamForums"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -42,7 +42,7 @@
<!-- First forum directory -->
<WIKI_NODE
- NODE_ID="102" OBJ_VERSION="0" PARENT_NODE_ID="100"
+ NODE_ID="102" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="100"
AREA_NR="100" NAME="Seam Users"
WIKINAME="SeamUsers"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="true"/>
@@ -61,7 +61,7 @@
<!-- First form start page, topic list -->
<WIKI_NODE
- NODE_ID="103" OBJ_VERSION="0" PARENT_NODE_ID="102"
+ NODE_ID="103" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="102"
AREA_NR="100" NAME="Seam Users Forum"
WIKINAME="SeamUsersForum"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -80,7 +80,7 @@
<!-- First posting -->
<WIKI_NODE
- NODE_ID="104" OBJ_VERSION="0" PARENT_NODE_ID="102"
+ NODE_ID="104" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="102"
AREA_NR="100" NAME="The first posting"
WIKINAME="TheFirstPosting"
CREATED_ON="2007-04-01 13:02:03" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -98,7 +98,7 @@
<!-- Reply to first posting -->
<WIKI_NODE
- NODE_ID="105" OBJ_VERSION="0" PARENT_NODE_ID="104"
+ NODE_ID="105" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="104"
AREA_NR="100" NAME="The First Posting.Comment119672933218230"
WIKINAME="TheFirstPostingComment119672933218230"
CREATED_ON="2007-04-02 13:02:03" CREATED_BY_USER_ID="3"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -112,7 +112,7 @@
<!-- Reply to first posting -->
<WIKI_NODE
- NODE_ID="106" OBJ_VERSION="0" PARENT_NODE_ID="105"
+ NODE_ID="106" OBJ_VERSION="0" RATING="5"
PARENT_NODE_ID="105"
AREA_NR="100" NAME="The First Posting.Comment119672933218233"
WIKINAME="TheFirstPostingComment119672933218233"
CREATED_ON="2007-04-10 10:00:00" CREATED_BY_USER_ID="3"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -126,7 +126,7 @@
<!-- Second (sticky) posting -->
<WIKI_NODE
- NODE_ID="107" OBJ_VERSION="0" PARENT_NODE_ID="102"
+ NODE_ID="107" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="102"
AREA_NR="100" NAME="A second (sticky) posting with a longer
title" WIKINAME="ASecondStickyPostingWithALongerTitle"
CREATED_ON="2007-04-03 08:01:00" CREATED_BY_USER_ID="3"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -144,7 +144,7 @@
<!-- Reply to second posting -->
<WIKI_NODE
- NODE_ID="108" OBJ_VERSION="0" PARENT_NODE_ID="107"
+ NODE_ID="108" OBJ_VERSION="0" RATING="4"
PARENT_NODE_ID="107"
AREA_NR="100" NAME="A second (sticky) posting with a longer
title.Comment119672933211234"
WIKINAME="ASecondStickyPostingWithALongerTitle.Comment119672933211234"
CREATED_ON="2007-04-04 08:01:00" CREATED_BY_USER_ID="3"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -158,7 +158,7 @@
<!-- Third posting
<WIKI_NODE
- NODE_ID="112" OBJ_VERSION="0" PARENT_NODE_ID="102"
+ NODE_ID="112" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="102"
AREA_NR="100" NAME="The third posting"
WIKINAME="TheThirdPosting"
CREATED_ON="2007-04-25 13:02:03" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
@@ -178,7 +178,7 @@
<!-- Second forum directory -->
<WIKI_NODE
- NODE_ID="109" OBJ_VERSION="0" PARENT_NODE_ID="100"
+ NODE_ID="109" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="100"
AREA_NR="100" NAME="Seam Developers"
WIKINAME="SeamDevelopers"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="1" WRITE_ACCESS_LEVEL="1"
WRITE_PROTECTED="true"/>
@@ -197,7 +197,7 @@
<!-- Second forum start page, topic list -->
<WIKI_NODE
- NODE_ID="110" OBJ_VERSION="0" PARENT_NODE_ID="109"
+ NODE_ID="110" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="109"
AREA_NR="100" NAME="Seam Developers Forum"
WIKINAME="SeamDevelopersForum"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="1" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -215,7 +215,7 @@
<!-- Posting second forum -->
<WIKI_NODE
- NODE_ID="111" OBJ_VERSION="0" PARENT_NODE_ID="109"
+ NODE_ID="111" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="109"
AREA_NR="100" NAME="A third thread with no replies"
WIKINAME="AThirdThreadWithNoReplies"
CREATED_ON="2007-04-05 09:01:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="1" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="false"/>
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/HelpDocuments.dbunit.xml
===================================================================
---
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/HelpDocuments.dbunit.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/HelpDocuments.dbunit.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -3,7 +3,7 @@
<dataset>
<WIKI_NODE
- NODE_ID="20" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="20" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="20" NAME="Help" WIKINAME="Help"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -12,7 +12,7 @@
NS_LEFT="20" NS_RIGHT="29" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="21" OBJ_VERSION="0" PARENT_NODE_ID="20"
+ NODE_ID="21" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="20"
AREA_NR="20" NAME="Working with documents"
WIKINAME="WorkingWithDocuments"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -22,7 +22,7 @@
<WIKI_NODE
- NODE_ID="22" OBJ_VERSION="0" PARENT_NODE_ID="21"
+ NODE_ID="22" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="21"
AREA_NR="20" NAME="Wiki Text Markup"
WIKINAME="WikiTextMarkup"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="2006-09-26 13:45:00" LAST_MODIFIED_BY_USER_ID="1"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -37,7 +37,7 @@
<WIKI_NODE
- NODE_ID="23" OBJ_VERSION="0" PARENT_NODE_ID="20"
+ NODE_ID="23" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="20"
AREA_NR="20" NAME="Plugins" WIKINAME="Plugins"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -46,7 +46,7 @@
NS_LEFT="23" NS_RIGHT="28" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="24" OBJ_VERSION="0" PARENT_NODE_ID="23"
+ NODE_ID="24" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="23"
AREA_NR="20" NAME="Using Plugins"
WIKINAME="UsingPlugins"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -55,7 +55,7 @@
NS_LEFT="24" NS_RIGHT="25" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="25" OBJ_VERSION="0" PARENT_NODE_ID="23"
+ NODE_ID="25" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="23"
AREA_NR="20" NAME="Creating Plugins"
WIKINAME="CreatingPlugins"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/KnowledgeBase.dbunit.xml
===================================================================
---
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/KnowledgeBase.dbunit.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/KnowledgeBase.dbunit.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -3,7 +3,7 @@
<dataset>
<WIKI_NODE
- NODE_ID="200" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="200" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="200" NAME="Documentation"
WIKINAME="Documentation"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -13,7 +13,7 @@
<WIKI_MENU_ITEM DIRECTORY_ID="200" DISPLAY_POSITION="3"/>
<WIKI_NODE
- NODE_ID="201" OBJ_VERSION="0" PARENT_NODE_ID="200"
+ NODE_ID="201" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="200"
AREA_NR="200" NAME="Knowledge Base"
WIKINAME="KnowledgeBase"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -23,7 +23,7 @@
<WIKI_MENU_ITEM DIRECTORY_ID="201" DISPLAY_POSITION="0"/>
<WIKI_NODE
- NODE_ID="202" OBJ_VERSION="0" PARENT_NODE_ID="201"
+ NODE_ID="202" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="201"
AREA_NR="200" NAME="Knowledge Base Overview"
WIKINAME="KnowledgeBaseOverview"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -38,7 +38,7 @@
<WIKI_NODE
- NODE_ID="203" OBJ_VERSION="0" PARENT_NODE_ID="201"
+ NODE_ID="203" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="201"
AREA_NR="200" NAME="FAQs" WIKINAME="FAQs"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -48,7 +48,7 @@
<WIKI_MENU_ITEM DIRECTORY_ID="203" DISPLAY_POSITION="0"/>
<WIKI_NODE
- NODE_ID="204" OBJ_VERSION="0" PARENT_NODE_ID="201"
+ NODE_ID="204" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="201"
AREA_NR="200" NAME="Setup & Installation"
WIKINAME="SetupInstallation"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -58,7 +58,7 @@
<WIKI_MENU_ITEM DIRECTORY_ID="204" DISPLAY_POSITION="1"/>
<WIKI_NODE
- NODE_ID="205" OBJ_VERSION="0" PARENT_NODE_ID="201"
+ NODE_ID="205" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="201"
AREA_NR="200" NAME="Components & Services"
WIKINAME="ComponentsServices"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -68,7 +68,7 @@
<WIKI_MENU_ITEM DIRECTORY_ID="205" DISPLAY_POSITION="2"/>
<WIKI_NODE
- NODE_ID="206" OBJ_VERSION="0" PARENT_NODE_ID="201"
+ NODE_ID="206" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="201"
AREA_NR="200" NAME="User Interface"
WIKINAME="UserInterface"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/UploadData.dbunit.xml
===================================================================
--- trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/UploadData.dbunit.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/UploadData.dbunit.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -3,7 +3,7 @@
<dataset>
<WIKI_NODE
- NODE_ID="30" OBJ_VERSION="0" PARENT_NODE_ID="2"
+ NODE_ID="30" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="2"
AREA_NR="2" NAME="Test Image" WIKINAME="TestImage"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -18,7 +18,7 @@
THUMBNAIL_DATA="[BINARY_DIR]/testimage_thumbnail.jpg"/>
<WIKI_NODE
- NODE_ID="31" OBJ_VERSION="0" PARENT_NODE_ID="2"
+ NODE_ID="31" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="2"
AREA_NR="2" NAME="Test Upload"
WIKINAME="TestUpload"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml
===================================================================
---
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml 2008-01-25
11:24:26 UTC (rev 7229)
@@ -73,6 +73,9 @@
<PREFERENCE PREF_ID = "200" OBJ_VERSION = "0" USER_ID =
"[NULL]" ENTITY_NAME = "FeedAggregator" PROPERTY_NAME =
"title" STRING_VALUE = "Aggregated Feeds" LONG_VALUE =
"[NULL]" BOOLEAN_VALUE = "[NULL]"/>
<PREFERENCE PREF_ID = "201" OBJ_VERSION = "0" USER_ID =
"[NULL]" ENTITY_NAME = "FeedAggregator" PROPERTY_NAME =
"truncateDescription" STRING_VALUE = "[NULL]" LONG_VALUE =
"100" BOOLEAN_VALUE = "[NULL]"/>
+ <PREFERENCE PREF_ID = "210" OBJ_VERSION = "0" USER_ID =
"[NULL]" ENTITY_NAME = "ForumTopPosters" PROPERTY_NAME =
"title" STRING_VALUE = "Top Forum Posters" LONG_VALUE =
"[NULL]" BOOLEAN_VALUE = "[NULL]"/>
+ <PREFERENCE PREF_ID = "211" OBJ_VERSION = "0" USER_ID =
"[NULL]" ENTITY_NAME = "ForumTopPosters" PROPERTY_NAME =
"numberOfPosters" STRING_VALUE = "[NULL]" LONG_VALUE = "10"
BOOLEAN_VALUE = "[NULL]"/>
+
<!-- CONNECTORS -->
<PREFERENCE PREF_ID = "300" OBJ_VERSION = "0" USER_ID =
"[NULL]" ENTITY_NAME = "JiraConnector" PROPERTY_NAME =
"connectionTimeoutSeconds" STRING_VALUE = "[NULL]" LONG_VALUE =
"15" BOOLEAN_VALUE = "[NULL]"/>
@@ -173,7 +176,7 @@
<USER_ROLE USER_ID="3" ROLE_ID="3"/>
<WIKI_NODE
- NODE_ID="1" OBJ_VERSION="0"
PARENT_NODE_ID="[NULL]"
+ NODE_ID="1" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="[NULL]"
AREA_NR="1" NAME="AAA" WIKINAME="AAA"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="true"/>
@@ -182,7 +185,7 @@
NS_LEFT="1" NS_RIGHT="999" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="2" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="2" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="2" NAME="BBB" WIKINAME="BBB"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -191,7 +194,7 @@
NS_LEFT="2" NS_RIGHT="3" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="3" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="3" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="3" NAME="CCC" WIKINAME="CCC"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -200,7 +203,7 @@
NS_LEFT="4" NS_RIGHT="9" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="4" OBJ_VERSION="0" PARENT_NODE_ID="3"
+ NODE_ID="4" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="3"
AREA_NR="3" NAME="DDD" WIKINAME="DDD"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -209,7 +212,7 @@
NS_LEFT="5" NS_RIGHT="6" NS_THREAD="1"/>
<WIKI_NODE
- NODE_ID="5" OBJ_VERSION="0" PARENT_NODE_ID="3"
+ NODE_ID="5" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="3"
AREA_NR="3" NAME="EEE" WIKINAME="EEE"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -224,7 +227,7 @@
<WIKI_NODE
- NODE_ID="6" OBJ_VERSION="0" PARENT_NODE_ID="3"
+ NODE_ID="6" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="3"
AREA_NR="3" NAME="One" WIKINAME="One"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="3"
LAST_MODIFIED_ON="2006-09-26 13:45:00" LAST_MODIFIED_BY_USER_ID="1"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -239,7 +242,7 @@
<WIKI_TAG FILE_ID="6" TAG="Tag One"/>
<WIKI_NODE
- NODE_ID="7" OBJ_VERSION="0" PARENT_NODE_ID="3"
+ NODE_ID="7" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="3"
AREA_NR="3" NAME="Two" WIKINAME="Two"
CREATED_ON="2006-09-24 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="2006-09-25 13:45:00" LAST_MODIFIED_BY_USER_ID="1"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -256,7 +259,7 @@
<WIKI_FILE_LINK SOURCE_WIKI_FILE_ID="7"
TARGET_WIKI_FILE_ID="9"/>
<WIKI_NODE
- NODE_ID="8" OBJ_VERSION="0" PARENT_NODE_ID="4"
+ NODE_ID="8" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="4"
AREA_NR="3" NAME="Three" WIKINAME="Three"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -272,22 +275,22 @@
<WIKI_TAG FILE_ID="8" TAG="Tag Three"/>
<WIKI_NODE
- NODE_ID="9" OBJ_VERSION="0" PARENT_NODE_ID="2"
+ NODE_ID="9" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="2"
AREA_NR="2" NAME="Four" WIKINAME="Four"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
<WIKI_FILE
NODE_ID="9" FILE_REVISION="0"/>
<WIKI_DOCUMENT
- NODE_ID="9" CONTENT="Testdocument
Four

[<=jiraIssueList[url=http://jira.jboss.com/j...
+ NODE_ID="9" CONTENT="Testdocument
Four

[<=jiraIssueList[url=http://jira.jboss.com/j...
Users Forum]]
"
HEADER="[NULL]" FOOTER="[NULL]"
- HEADER_MACROS="[NULL]" CONTENT_MACROS="jiraIssueList"
FOOTER_MACROS="[NULL]"
+ HEADER_MACROS="[NULL]" CONTENT_MACROS="jiraIssueList
forumTopPosters" FOOTER_MACROS="[NULL]"
NAME_AS_TITLE="true" ENABLE_COMMENTS="true"
ENABLE_COMMENT_FORM="true" ENABLE_COMMENTS_ON_FEEDS="true"/>
<WIKI_NODE
- NODE_ID="10" OBJ_VERSION="0" PARENT_NODE_ID="6"
+ NODE_ID="10" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="6"
AREA_NR="3" NAME="One.Comment11967298211870"
WIKINAME="OneComment11967298211870"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="2"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -299,7 +302,7 @@
NS_LEFT="1" NS_RIGHT="8" NS_THREAD="10"/>
<WIKI_NODE
- NODE_ID="11" OBJ_VERSION="0" PARENT_NODE_ID="10"
+ NODE_ID="11" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="10"
AREA_NR="3" NAME="One.Comment1196729823870"
WIKINAME="OneComment1196729823870"
CREATED_ON="2006-09-24 13:45:00" CREATED_BY_USER_ID="3"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -310,7 +313,7 @@
NS_LEFT="2" NS_RIGHT="3" NS_THREAD="10"/>
<WIKI_NODE
- NODE_ID="12" OBJ_VERSION="0" PARENT_NODE_ID="10"
+ NODE_ID="12" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="10"
AREA_NR="3" NAME="One.Comment1196729874870"
WIKINAME="OneComment.1196729874870"
CREATED_ON="2006-09-25 13:45:00" CREATED_BY_USER_ID="2"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -321,7 +324,7 @@
NS_LEFT="4" NS_RIGHT="7" NS_THREAD="10"/>
<WIKI_NODE
- NODE_ID="13" OBJ_VERSION="0" PARENT_NODE_ID="12"
+ NODE_ID="13" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="12"
AREA_NR="3" NAME="One.Comment11967293211870"
WIKINAME="OneComment11967293211870"
CREATED_ON="2006-09-26 13:45:00" CREATED_BY_USER_ID="2"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -332,7 +335,7 @@
NS_LEFT="5" NS_RIGHT="6" NS_THREAD="10"/>
<WIKI_NODE
- NODE_ID="14" OBJ_VERSION="0" PARENT_NODE_ID="6"
+ NODE_ID="14" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="6"
AREA_NR="3" NAME="One.Comment11967293211830"
WIKINAME="OneComment11967293211830"
CREATED_ON="2006-09-27 13:45:00" CREATED_BY_USER_ID="2"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -343,7 +346,7 @@
NS_LEFT="1" NS_RIGHT="4" NS_THREAD="14"/>
<WIKI_NODE
- NODE_ID="15" OBJ_VERSION="0" PARENT_NODE_ID="14"
+ NODE_ID="15" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="14"
AREA_NR="3" NAME="One.Comment119672932118230"
WIKINAME="OneComment119672932118230"
CREATED_ON="2006-09-28 13:45:00" CREATED_BY_USER_ID="2"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="false"/>
@@ -389,7 +392,7 @@
<!-- Member Area -->
<WIKI_NODE
- NODE_ID="16" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="16" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="16" NAME="Members" WIKINAME="Members"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="1000"
WRITE_PROTECTED="true"/>
@@ -400,7 +403,7 @@
<!-- Trash Area -->
<WIKI_NODE
- NODE_ID="17" OBJ_VERSION="0" PARENT_NODE_ID="1"
+ NODE_ID="17" OBJ_VERSION="0" RATING="0"
PARENT_NODE_ID="1"
AREA_NR="17" NAME="Trash" WIKINAME="Trash"
CREATED_ON="2006-09-23 13:45:00" CREATED_BY_USER_ID="1"
LAST_MODIFIED_ON="[NULL]" LAST_MODIFIED_BY_USER_ID="[NULL]"
READ_ACCESS_LEVEL="0" WRITE_ACCESS_LEVEL="0"
WRITE_PROTECTED="true"/>
Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java
===================================================================
---
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java 2008-01-25
00:10:16 UTC (rev 7228)
+++
trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/editing/Commenting.java 2008-01-25
11:24:26 UTC (rev 7229)
@@ -115,6 +115,42 @@
}.run();
}
+ @Test
+ public void rateComment() throws Exception {
+
+ loginMember();
+
+ new FacesRequest("/docDisplay_d.xhtml") {
+
+ protected void beforeRequest() {
+ setParameter("documentId", "6");
+ }
+
+ protected void updateModelValues() throws Exception {
+ assert getValue("#{documentHome.instance.id}").equals(6l);
+ }
+
+ protected void invokeApplication() throws Exception {
+ invokeMethod("#{commentHome.rate(11, 4)}");
+ }
+
+ }.run();
+
+ new NonFacesRequest("/docDisplay_d.xhtml") {
+
+ protected void beforeRequest() {
+ setParameter("documentId", "6");
+ }
+
+ protected void renderResponse() throws Exception {
+ WikiNodeDAO dao = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
+ assert dao.findWikiNode(11l).getRating() == 4;
+ }
+
+ }.run();
+
+ }
+
private void loginAdmin() throws Exception {
new FacesRequest() {
protected void invokeApplication() throws Exception {
@@ -126,5 +162,15 @@
}.run();
}
+ private void loginMember() throws Exception {
+ new FacesRequest() {
+ protected void invokeApplication() throws Exception {
+ setValue("#{identity.username}", "member");
+ setValue("#{identity.password}", "member");
+ invokeAction("#{identity.login}");
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+ }.run();
+ }
}
\ No newline at end of file
Modified: trunk/examples/wiki/view/docDisplay_d.xhtml
===================================================================
--- trunk/examples/wiki/view/docDisplay_d.xhtml 2008-01-25 00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/view/docDisplay_d.xhtml 2008-01-25 11:24:26 UTC (rev 7229)
@@ -203,34 +203,39 @@
<ui:param name="titlePlural"
value="#{messages['lacewiki.label.commentsDisplay.Comments']}"/>
<ui:define name="controls">
- <s:fragment rendered="#{not commentHome.showForm and
s:hasPermission('Comment', 'create', documentHome.instance)}">
+ <h:panelGroup>
- <s:link tabindex="102"
- action="#{commentHome.replyTo()}"
- styleClass="buttonNonpersistent">
- <f:param name="parentCommentId"
value="#{c.id}"/>
- <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.ReplyTo']}"/>
- </s:link>
+ <s:fragment rendered="#{not commentHome.showForm and
s:hasPermission('Comment', 'create', documentHome.instance)}">
- <s:link tabindex="102"
- action="#{commentHome.quote()}"
- styleClass="buttonNonpersistent">
- <f:param name="parentCommentId"
value="#{c.id}"/>
- <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.Quote']}"/>
- </s:link>
+ <s:link tabindex="102"
+ action="#{commentHome.replyTo()}"
+ styleClass="buttonNonpersistent">
+ <f:param name="parentCommentId"
value="#{c.id}"/>
+ <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.ReplyTo']}"/>
+ </s:link>
- </s:fragment>
+ <s:link tabindex="102"
+ action="#{commentHome.quote()}"
+ styleClass="buttonNonpersistent">
+ <f:param name="parentCommentId"
value="#{c.id}"/>
+ <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.Quote']}"/>
+ </s:link>
- <s:fragment rendered="#{s:hasPermission('Comment',
'delete', currentDocument) and not commentHome.showForm}">
- <a:jsFunction name="deleteCommentId#{c.id}"
- reRender="commentDisplayForm"
-
action="#{commentHome.remove(c.id)}"/>
- <h:outputLink value="#"
-
onclick="deleteConfirmation('#{messages['lacewiki.label.commentsDisplay.CommentThread']}
\\'#{c.subject}\\'', 'deleteCommentId#{c.id}')"
- styleClass="button">
- <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.RemoveComment']}"/>
- </h:outputLink>
- </s:fragment>
+ </s:fragment>
+
+ <s:fragment
rendered="#{s:hasPermission('Comment', 'delete', currentDocument) and
not commentHome.showForm}">
+ <a:jsFunction name="deleteCommentId#{c.id}"
+ reRender="commentDisplayForm"
+
action="#{commentHome.remove(c.id)}"/>
+ <h:outputLink value="#"
+
onclick="deleteConfirmation('#{messages['lacewiki.label.commentsDisplay.CommentThread']}
\\'#{c.subject}\\'', 'deleteCommentId#{c.id}')"
+ styleClass="button">
+ <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.RemoveComment']}"/>
+ </h:outputLink>
+ </s:fragment>
+
+ </h:panelGroup>
+
</ui:define>
</ui:decorate>
<s:fragment rendered="#{s:hasPermission('Comment',
'create', documentHome.instance)}">
Modified: trunk/examples/wiki/view/includes/commentsDisplay.xhtml
===================================================================
--- trunk/examples/wiki/view/includes/commentsDisplay.xhtml 2008-01-25 00:10:16 UTC (rev
7228)
+++ trunk/examples/wiki/view/includes/commentsDisplay.xhtml 2008-01-25 11:24:26 UTC (rev
7229)
@@ -130,12 +130,10 @@
enablePlugins="false"/>
</s:div>
- <div align="right" class="commentControls">
+ <div class="commentControls">
<h:form>
- <h:panelGroup>
<ui:insert name="controls"/>
- </h:panelGroup>
</h:form>
</div>
Modified: trunk/examples/wiki/view/plugins/forumReplies/plugin.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/forumReplies/plugin.xhtml 2008-01-25 00:10:16 UTC
(rev 7228)
+++ trunk/examples/wiki/view/plugins/forumReplies/plugin.xhtml 2008-01-25 11:24:26 UTC
(rev 7229)
@@ -60,34 +60,92 @@
<ui:param name="titlePlural"
value="#{messages['forum.label.Replies']}"/>
<ui:define name="controls">
- <s:fragment rendered="#{not replyHome.showForm and
replyHome.hasReplyPermission()}">
+ <h:panelGrid columns="3"
styleClass="forumReplyControls"
+ columnClasses="forumReplyRating, forumReplyStatus,
forumReplyControl"
+ cellpadding="0" cellspacing="0"
border="0">
- <s:link tabindex="102"
- action="#{replyHome.replyTo()}"
- styleClass="buttonNonpersistent">
- <f:param name="parentCommentId"
value="#{c.id}"/>
- <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.ReplyTo']}"/>
- </s:link>
+ <s:fragment>
- <s:link tabindex="102"
- action="#{replyHome.quote()}"
- styleClass="buttonNonpersistent">
- <f:param name="parentCommentId"
value="#{c.id}"/>
- <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.Quote']}"/>
- </s:link>
+ <s:fragment rendered="#{not replyHome.showForm
+ and c.rating == 0
+ and not currentUser.guest
+ and c.createdBy.id != currentUser.id
+ and currentDocument.createdBy.id ==
currentUser.id}">
+
+ <h:panelGrid columns="7"
styleClass="commentRatingChooser"
+ columnClasses="label, star, star, star,
star, star, star"
+ border="0"
cellpadding="0" cellspacing="0">
+ <h:outputText styleClass="smallFont"
value="#{messages['lacewiki.label.comment.RateThisPosting']}: "/>
+ <c:forEach begin="1" var="r"
end="5">
+ <a:commandLink
action="#{replyHome.rate(c.id, r)}"
+ reRender="comments,
messageBoxContainer"
+
status="commentStatus#{c.id}">
+ <h:graphicImage
styleClass="item#{c.id}-rate#{r}"
+
onmouseover="highlightStars('#{c.id}', '5', '#{r}')"
+
onmouseout="highlightStars('#{c.id}', '5', '0')"
+
value="/themes/#{preferences.get('Wiki').themeName}/img/star_grey.gif"
+ alt="*"
+ width="16"
height="16"/>
+ </a:commandLink>
+ </c:forEach>
+ </h:panelGrid>
+ </s:fragment>
- </s:fragment>
+ <s:fragment rendered="#{c.rating > 0}">
+ <h:panelGrid columns="#{c.rating + 1}"
styleClass="commentRating"
+ columnClasses="label, star, star, star,
star, star, star"
+ border="0"
cellpadding="0" cellspacing="0">
+ <h:outputText styleClass="smallFont"
value="#{messages['lacewiki.label.comment.Rating']}: "/>
+ <c:forEach begin="1" var="r"
end="#{c.rating}">
+ <h:graphicImage
value="/themes/#{preferences.get('Wiki').themeName}/img/star.gif"
+ width="16"
height="16" alt="*"/>
+ </c:forEach>
+ </h:panelGrid>
+ </s:fragment>
- <s:fragment rendered="#{s:hasPermission('Comment',
'delete', currentDocument) and not replyHome.showForm}">
- <a:jsFunction name="deleteReplyId#{c.id}"
- reRender="forumRepliesContainer"
- action="#{replyHome.remove(c.id)}"/>
- <h:outputLink value="#"
-
onclick="deleteConfirmation('#{messages['lacewiki.label.commentsDisplay.CommentThread']}
\\'#{c.subject}\\'', 'deleteReplyId#{c.id}')"
- styleClass="button sessionEventTrigger">
- <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.RemoveComment']}"/>
- </h:outputLink>
- </s:fragment>
+ </s:fragment>
+
+ <s:fragment>
+ <ui:include
src="../../includes/statusIndicator.xhtml">
+ <ui:param name="statusId"
value="commentStatus#{c.id}"/>
+ </ui:include>
+ </s:fragment>
+
+ <s:fragment>
+
+ <s:fragment rendered="#{not replyHome.showForm and
replyHome.hasReplyPermission()}">
+
+ <s:link tabindex="102"
+ action="#{replyHome.replyTo()}"
+ styleClass="buttonNonpersistent">
+ <f:param name="parentCommentId"
value="#{c.id}"/>
+ <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.ReplyTo']}"/>
+ </s:link>
+
+ <s:link tabindex="102"
+ action="#{replyHome.quote()}"
+ styleClass="buttonNonpersistent">
+ <f:param name="parentCommentId"
value="#{c.id}"/>
+ <h:outputText styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.Quote']}"/>
+ </s:link>
+
+ </s:fragment>
+
+ <s:fragment
rendered="#{s:hasPermission('Comment', 'delete', currentDocument) and
not replyHome.showForm}">
+ <a:jsFunction name="deleteReplyId#{c.id}"
+ reRender="forumRepliesContainer"
+
action="#{replyHome.remove(c.id)}"/>
+ <h:outputLink value="#"
+
onclick="deleteConfirmation('#{messages['lacewiki.label.commentsDisplay.CommentThread']}
\\'#{c.subject}\\'', 'deleteReplyId#{c.id}')"
+ styleClass="button
sessionEventTrigger">
+ <h:outputText
styleClass="buttonLabel"
value="#{messages['lacewiki.button.commentsDisplay.RemoveComment']}"/>
+ </h:outputLink>
+ </s:fragment>
+
+ </s:fragment>
+
+ </h:panelGrid>
+
</ui:define>
</ui:decorate>
Added: trunk/examples/wiki/view/plugins/forumTopPosters/plugin.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/forumTopPosters/plugin.xhtml
(rev 0)
+++ trunk/examples/wiki/view/plugins/forumTopPosters/plugin.xhtml 2008-01-25 11:24:26 UTC
(rev 7229)
@@ -0,0 +1,78 @@
+<wiki:plugin
+
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:c="http://java.sun.com/jstl/core"
+
xmlns:wiki="http://jboss.com/products/seam/wiki"
+
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <s:div styleClass="forumTopPosters box">
+
+ <s:div styleClass="boxHeader">
+ <h:outputText value="#{preferences.get('ForumTopPosters',
currentMacro).title}"/>
+ </s:div>
+
+ <div class="boxContent">
+
+ <h:dataTable value="#{forumQuery.topPosters}" var="p"
+ rendered="#{not empty forumQuery.topPosters and
forumQuery.topPosters.size() > 0}"
+ styleClass="datatable forumTopPostersTable"
+ headerClass="alignCenter"
+ columnClasses="fifteenPercentColumn alignCenter
indexColumn,
+ defaultColumn alignCenter nameColumn,
+ twentyPercentColumn alignCenter joinedOnColumn,
+ twentyPercentColumn alignCenter
ratingPointsColumn"
+ rowClasses="rowOdd, rowEven"
+ cellpadding="0" cellspacing="0"
border="0">
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText
value="#{messages['forumTopPosters.label.Position']}"/>
+ </f:facet>
+ <h:outputText
value="#{forumQuery.topPosters.indexOf(p)+1}."/>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText
value="#{messages['forumTopPosters.label.User']}"/>
+ </f:facet>
+ <ui:include src="../../includes/userInfoLink.xhtml">
+ <ui:param name="user" value="#{p}"/>
+ </ui:include>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText
value="#{messages['forumTopPosters.label.JoinedOn']}"/>
+ </f:facet>
+ <h:outputText value="#{p.createdOn}">
+ <f:convertDateTime pattern="dd. MMM yyyy, HH:mm"
timeZone="#{preferences.get('Wiki').timeZone}"/>
+ </h:outputText>
+ <h:outputText
value=" #{preferences.get('Wiki').timeZone}"/>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText
value="#{messages['forumTopPosters.label.RatingPoints']}"/>
+ </f:facet>
+ <h:outputText value="#{p.ratingPoints}"/>
+ </h:column>
+
+ </h:dataTable>
+
+ </div>
+
+ <s:div styleClass="forumTopPostersEmpty"
+ rendered="#{empty forumQuery.topPosters or
forumQuery.topPosters.size() == 0}">
+ <h:outputText
value="#{messages['forumTopPosters.label.NoPostersFound']}"/>
+ </s:div>
+
+ <div class="boxFooter"/>
+
+ </s:div>
+
+</wiki:plugin>
+
+
Modified: trunk/examples/wiki/view/plugins/jiraIssueList/plugin.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/jiraIssueList/plugin.xhtml 2008-01-25 00:10:16 UTC
(rev 7228)
+++ trunk/examples/wiki/view/plugins/jiraIssueList/plugin.xhtml 2008-01-25 11:24:26 UTC
(rev 7229)
@@ -31,7 +31,7 @@
<h:column>
<h:outputLink
value="#{preferences.get('JiraIssueList',
currentMacro).url}/browse/#{i.key}">
<h:outputText
- value="#{wiki:truncateString(i.summary,
preferences.get('JiraIssueList', currentMacro).truncateSummary,
'...')}"/>
+ value="(#{i.key}) 
#{wiki:truncateString(i.summary, preferences.get('JiraIssueList',
currentMacro).truncateSummary, '...')}"/>
</h:outputLink>
</h:column>
Modified: trunk/examples/wiki/view/themes/default/css/forumReplies.css
===================================================================
--- trunk/examples/wiki/view/themes/default/css/forumReplies.css 2008-01-25 00:10:16 UTC
(rev 7228)
+++ trunk/examples/wiki/view/themes/default/css/forumReplies.css 2008-01-25 11:24:26 UTC
(rev 7229)
@@ -0,0 +1,16 @@
+.forumReplyControls {
+ width: 100%;
+}
+
+.forumReplyRating {
+ text-align: left;
+}
+
+.forumReplyStatus {
+ text-align: right;
+}
+
+.forumReplyControl {
+ text-align: right;
+ width: 200px;
+}
\ No newline at end of file
Modified: trunk/examples/wiki/view/themes/default/css/template.css
===================================================================
--- trunk/examples/wiki/view/themes/default/css/template.css 2008-01-25 00:10:16 UTC (rev
7228)
+++ trunk/examples/wiki/view/themes/default/css/template.css 2008-01-25 11:24:26 UTC (rev
7229)
@@ -940,9 +940,17 @@
}
.commentControls {
- margin-bottom: 10px;
+ margin-bottom: 5px;
}
+.commentRating, .commentRatingChooser {
+ font-weight: bold;
+}
+
+.commentRating .label, .commentRatingChooser .label {
+ vertical-align: bottom;
+}
+
.commentFirstLevel {
background: #fff url(../img/input.bg.gif) 0 0 no-repeat;
}
Added: trunk/examples/wiki/view/themes/default/img/star.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/default/img/star.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/default/img/star_grey.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/default/img/star_grey.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/examples/wiki/view/themes/default/template.xhtml
===================================================================
--- trunk/examples/wiki/view/themes/default/template.xhtml 2008-01-25 00:10:16 UTC (rev
7228)
+++ trunk/examples/wiki/view/themes/default/template.xhtml 2008-01-25 11:24:26 UTC (rev
7229)
@@ -234,6 +234,19 @@
// ###################### Design #################################
+ function highlightStars(item, range, end) {
+ for (i = 1; i <= range; i++) {
+ styleClass = ".item"+item+"-rate"+i;
+ jQuery(styleClass)
+ .attr("src", "#{themePath}/img/star_grey.gif");
+ }
+ for (i = 1; i <= end; i++) {
+ styleClass = ".item"+item+"-rate"+i;
+ jQuery(styleClass)
+ .attr("src", "#{themePath}/img/star.gif");
+ }
+ }
+
function pulsate(query) {
var blinkCount = 4*2;
do {
Modified: trunk/examples/wiki/view/themes/sfwkorg/css/forumReplies.css
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/css/forumReplies.css 2008-01-25 00:10:16 UTC
(rev 7228)
+++ trunk/examples/wiki/view/themes/sfwkorg/css/forumReplies.css 2008-01-25 11:24:26 UTC
(rev 7229)
@@ -0,0 +1,16 @@
+.forumReplyControls {
+ width: 100%;
+}
+
+.forumReplyRating {
+ text-align: left;
+}
+
+.forumReplyStatus {
+ text-align: right;
+}
+
+.forumReplyControl {
+ text-align: right;
+ width: 200px;
+}
\ No newline at end of file
Modified: trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css 2008-01-25 00:10:16 UTC (rev
7228)
+++ trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css 2008-01-25 11:24:26 UTC (rev
7229)
@@ -726,9 +726,17 @@
}
.commentControls {
- margin-bottom: 10px;
+ margin-bottom: 5px;
}
+.commentRating, .commentRatingChooser {
+ font-weight: bold;
+}
+
+.commentRating .label, .commentRatingChooser .label {
+ vertical-align: bottom;
+}
+
.commentFirstLevel {
background: #fff url(../img/input.bg.gif) 0 0 no-repeat;
}
Added: trunk/examples/wiki/view/themes/sfwkorg/img/star.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/star.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/wiki/view/themes/sfwkorg/img/star_grey.gif
===================================================================
(Binary files differ)
Property changes on: trunk/examples/wiki/view/themes/sfwkorg/img/star_grey.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/examples/wiki/view/themes/sfwkorg/template.xhtml
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/template.xhtml 2008-01-25 00:10:16 UTC (rev
7228)
+++ trunk/examples/wiki/view/themes/sfwkorg/template.xhtml 2008-01-25 11:24:26 UTC (rev
7229)
@@ -236,6 +236,17 @@
// ###################### Design #################################
+ function highlightStars(item, range, end) {
+ for (i = 1; i <= range; i++) {
+ styleClass = ".item"+item+"-rate"+i;
+ jQuery(styleClass).attr("src",
"#{themePath}/img/star_grey.gif");
+ }
+ for (i = 1; i <= end; i++) {
+ styleClass = ".item"+item+"-rate"+i;
+ jQuery(styleClass).attr("src",
"#{themePath}/img/star.gif");
+ }
+ }
+
function pulsate(query) {
var blinkCount = 2*2;
do {
Modified: trunk/examples/wiki/view/userInfo_d.xhtml
===================================================================
--- trunk/examples/wiki/view/userInfo_d.xhtml 2008-01-25 00:10:16 UTC (rev 7228)
+++ trunk/examples/wiki/view/userInfo_d.xhtml 2008-01-25 11:24:26 UTC (rev 7229)
@@ -66,6 +66,15 @@
</s:div>
</s:div>
+ <s:div styleClass="entry">
+ <s:div styleClass="label">
+ <h:outputText
value="#{messages['lacewiki.label.userInfo.RatingPoints']}:"/>
+ </s:div>
+ <s:div styleClass="output">
+ <h:outputText
value="#{userHome.ratingPoints}"/>
+ </s:div>
+ </s:div>
+
</s:div>
</s:div>