diff --git a/ccm-forum/application.xml b/ccm-forum/application.xml index 3d1c1eee1..778729927 100755 --- a/ccm-forum/application.xml +++ b/ccm-forum/application.xml @@ -2,11 +2,12 @@ - - + + + diff --git a/ccm-forum/doc/new-features.txt b/ccm-forum/doc/new-features.txt new file mode 100644 index 000000000..a6b86d341 --- /dev/null +++ b/ccm-forum/doc/new-features.txt @@ -0,0 +1,86 @@ +Main new features included in this release are: + +Fine grained forum permissions +Allow file attachments and images in posts +Contents of posts are searchable +New portlet type lising links to all forums user has read access to +Allow automatic thread subscription for thread starter (useful for noticeboard type forums) +Forum admin can prevent posts with no topic +Expiry can be specified for all types of forum +Reply count calculation fixed +HTML Editor can be used for posts +Subscription emails can (and should) be sent as html emails) + +Other minor changes, fixes and configurable features are also included. +Check new config parameter descriptions in com.arsdigita.forum.ForumConfig_parameter.properties + +After deployment, to install new features, either get rid of existing forum app, and load new version, OR + +ccm upgrade ccm-forum --from-version 6.5.0 --to-version 6.5.1 +ccm upgrade ccm-forum --from-version 6.5.1 --to-version 6.5.2 +ccm-run com.arsdigita.london.search.Reindexer --object-type com.arsdigita.forum.Post + + + +When developing this, I tried to ensure that a basic deployment will not affect the XML +that is produced by the current forum application. + +I have tested the new implementation with Coventry's theme. There is one theme amendment required (because of a bug fix). +In current release, the drop down list for filtering threads by category has the same name as the drop down list for selecting a category when making a new post. This means that the selected value carries through . ie if you have filtered the threads then make a new post, the new post has the filter category selected as default. More importantly, if you make a post and assign a category, then the thread list is filtered after you complete the post. + +To fix the bug, I renamed the drop down list in the post form from topic to PostTopic. This means the category drop down is not visible until the two references to @name='topic' in the forum:postForm template are changed to @name='postTopic' + +Only other visible changes if the patch is applied without changing config +are: + +Reply count only includes posts that have been approved + +Posts are searchable from the main site search. This is a change from the current behaviour . if not desired then it could be made configurable. + +Moderation form and emails are formatted slightly differently + +recent forum postings portlet prevents users creating new forum application . +only site admin can do this. Also filters forums to those that the user has +read access on. + +New portlet . my forums. Lists links to forums that user has read access to. + +The other non-visble effect is that the wizard uses java session rather than +hidden fields. This approach makes it much easier to include links in form +steps (eg remove an uploaded file etc). The impact is that users in a load +balanced environment need to consider session affinity. In our production +environment, this is accomplished by the server that sprays requests to the +various back end servers. It identifies each browser session and routes all +their requests to the same back end server. Hence there is no replication of +session - the user is guaranteed to end up at the server that holds their java +session. As a result, when a backend server is stopped, there is a risk that a +user with session on that server in the middle of creating a post will lose +information entered up to that point. On our site we live with this small risk +but mitigate it by restarting servers at unsociable hours where possible. + +I have put examle theme files in +ccm-ldn-aplaws/web/__ccm__/themes/aplaws/forum-example: forum-index.xsl, +forum-index.css and the contents of images/forum + +To have a look at a forum using these files, copy the xsl and css to the top +level of your theme and make a new forum directory in images and copy the +images there. I.m afraid these files have continued the existing format of +putting all the templates in a single file, so they are not the most easily +maintained, and I make no guarantees about the content, but they do work. and +if required they may be used as a basis for your own look and feel. + + +There is a separate application - ccm-categorised-forum that adds category path and menu components to the front end, +and adds a categorisation tab for admin users. Load this application if you would like this functionality. + +When a forum is created, only site admin can access the admin tabs, +until you assign users/groups to the forum admin group under the permissions tab. + +Next things I plan to do are: + +list pending and reapprove posts under the moderation tab +create a user info page so users can write a bit about themselves +allow thread branching so administrators can split long threads or threads that have strayed from the point. +Allow different thread views - paginated full details, or tree of titles with one post visible (a la sourceforge) + +chris.gilbert@westsussex.gov.uk diff --git a/ccm-forum/etc/enterprise.init.in b/ccm-forum/etc/enterprise.init.in index 14d22c5ed..e69de29bb 100755 --- a/ccm-forum/etc/enterprise.init.in +++ b/ccm-forum/etc/enterprise.init.in @@ -1,25 +0,0 @@ -// Forum initialization file -// -// ::replyHostName:: -> example.com -// ::digestUserEmail:: -> digests -// ::adminCanEditPosts:: -> true -// ::authorCanEditPosts:: -> true -// ::forums:: -> {} - -init com.arsdigita.forum.LegacyInitializer { - // All outbound bboard message will have return address as the - // following format: forumID.bboard@hostname - replyHostName = "::replyHostName::"; - // The email address that daily digests come from - digestUserEmail = "::digests::"; - // whether administrators can edit posts - adminCanEditPosts = ::adminCanEditPosts::; - // whether the author of a post can edit it later - authorCanEditPosts = ::authorCanEditPosts::; - - forums = ::forums::; -} - -init com.arsdigita.domain.installer.DomainObjectTraversalInitializer { - adapters = { "/WEB-INF/resources/forum-adapters.xml" }; -} diff --git a/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl b/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl index b96e10436..9181a49cd 100755 --- a/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl +++ b/ccm-forum/pdl/com/arsdigita/forum/Forum.pdl @@ -32,8 +32,16 @@ object type Forum extends Application { Boolean [1..1] isModerated = forum_forums.is_moderated; Boolean [1..1] isNoticeboard = forum_forums.is_noticeboard; + component Group [0..1] adminGroup = + join forum_forums.admin_group_id to groups.group_id; component Group [0..1] moderationGroup = join forum_forums.mod_group_id to groups.group_id; + component Group [0..1] threadCreateGroup = + join forum_forums.create_group_id to groups.group_id; + component Group [0..1] threadRespondGroup = + join forum_forums.respond_group_id to groups.group_id; + component Group [0..1] readGroup = + join forum_forums.read_group_id to groups.group_id; component ForumSubscription[0..n] subscriptions = join forum_forums.forum_id to forum_subscriptions.forum_id; @@ -44,7 +52,12 @@ object type Forum extends Application { join forum_forums.lifecycle_definition_id to lifecycle_definitions.definition_id; BigDecimal [0..1] expireAfter = forum_forums.expire_after; - + Boolean [1..1] fileAttachmentsAllowed = forum_forums.file_attachments_allowed; + Boolean [1..1] imageUploadsAllowed = forum_forums.image_uploads_allowed; + Boolean [1..1] autoSubscribeThreadStarter = forum_forums.subscribe_thread_starter; + Boolean [1..1] noCategoryPostsAllowed = forum_forums.no_category_posts_allowed; + Boolean [1..1] anonymousPostsAllowed = forum_forums.anonymous_posts_allowed; + String [0..1] introduction = forum_forums.introduction VARCHAR(4000); reference key (forum_forums.forum_id); } diff --git a/ccm-forum/pdl/com/arsdigita/forum/MyForumsPortlet.pdl b/ccm-forum/pdl/com/arsdigita/forum/MyForumsPortlet.pdl new file mode 100644 index 000000000..e40f68632 --- /dev/null +++ b/ccm-forum/pdl/com/arsdigita/forum/MyForumsPortlet.pdl @@ -0,0 +1,30 @@ +// +// Copyright (C) 2007 Chris Gilbert. All Rights Reserved. +// +// This library 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 library 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 library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// $Id: RecentPostingsPortlet.pdl 285 2005-02-22 00:29:02Z sskracic $ +// $DateTime: 2004/08/17 23:26:27 $ +model com.arsdigita.forum; + +import com.arsdigita.portal.Portlet; + +// lists links to forums for which user has read access + +object type MyForumsPortlet extends Portlet { + +// no attributes for this one + +} diff --git a/ccm-forum/pdl/com/arsdigita/forum/Post.pdl b/ccm-forum/pdl/com/arsdigita/forum/Post.pdl index bd22571c1..f18fbde31 100755 --- a/ccm-forum/pdl/com/arsdigita/forum/Post.pdl +++ b/ccm-forum/pdl/com/arsdigita/forum/Post.pdl @@ -21,6 +21,9 @@ model com.arsdigita.forum; import com.arsdigita.messaging.ThreadedMessage; import com.arsdigita.kernel.Party; +import com.arsdigita.cms.FileAsset; +import com.arsdigita.cms.ImageAsset; + object type Post extends com.arsdigita.messaging.ThreadedMessage { @@ -29,6 +32,31 @@ object type Post extends com.arsdigita.messaging.ThreadedMessage { aggressive load(moderator.id); } +object type PostFileAttachment extends FileAsset { + Integer[0..1] fileOrder = forum_post_files.file_order INTEGER; + reference key (forum_post_files.file_id); +} + +object type PostImageAttachment extends ImageAsset { + Integer[0..1] imageOrder = forum_post_images.image_order INTEGER; + reference key (forum_post_images.image_id); +} + +association { + + composite Post[0..1] fileMessage = join forum_post_files.post_id to forum_posts.post_id; + component PostFileAttachment[0..n] files = join forum_posts.post_id to forum_post_files.post_id; + +} + +association { + + composite Post[0..1] imageMessage = join forum_post_images.post_id to forum_posts.post_id; + component PostImageAttachment[0..n] images = join forum_posts.post_id to forum_post_images.post_id; + +} + + association { Party [0..1] moderator = join forum_posts.moderator to parties.party_id; Post [0..1] moderatedMessage = join parties.party_id to forum_posts.moderator; @@ -53,3 +81,20 @@ query threadModerationStatus { id = message_threads.thread_id; } } + +// Subquery for filtering out threads where root post is of a +// particular status (eg unconfirmed) +// +//query threadStatus { + // BigDecimal id; +// + // do { + // select m.thread_id + // from forum_posts f, + // message_threads m + // where m.root_id = f.post_id + // and f.status <> :status2 + // } map { + // id = message_threads.thread_id; + // } +// } diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql new file mode 100644 index 000000000..2baf2087e --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql @@ -0,0 +1,3 @@ +alter table forum_forums add (anonymous_posts_allowed CHAR(1)); + +update forum_forums set anonymous_posts_allowed = 0; \ No newline at end of file diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_file_attachments.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_file_attachments.sql new file mode 100644 index 000000000..0437bca96 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_file_attachments.sql @@ -0,0 +1,21 @@ +create table forum_post_files + (post_id NUMBER, + file_id NUMBER not null, + file_order NUMBER); + + + +alter table forum_post_files add + constraint FORU_POS_FILES_FILE_ID_F_XBKED foreign key (file_id) + references cms_files(file_id); + +alter table forum_post_files add + constraint FORU_POS_FILES_POST_ID_F_K0XJQ foreign key (post_id) + references forum_posts(post_id); + +alter table forum_forums add (file_attachments_allowed CHAR(1)); + +update forum_forums set file_attachments_allowed = 0; + + + diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql new file mode 100644 index 000000000..2a6037d74 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql @@ -0,0 +1,2 @@ +ALTER TABLE FORUM_FORUMS ADD ( + INTRODUCTION VARCHAR2(4000) ); \ No newline at end of file diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql new file mode 100644 index 000000000..0b11148cb --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql @@ -0,0 +1,3 @@ +alter table forum_forums add (no_category_posts_allowed CHAR(1)); + +update forum_forums set no_category_posts_allowed = 1; diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_groups.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_groups.sql new file mode 100644 index 000000000..f05d54834 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_groups.sql @@ -0,0 +1,20 @@ +alter table forum_forums +add (admin_group_id NUMBER, + create_group_id NUMBER, + respond_group_id NUMBER, + read_group_id NUMBER); + + +alter table forum_forums add + constraint foru_foru_admi_grou_id_f_k0nw6 foreign key (admin_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_foru_crea_grou_id_f_f7x57 foreign key (create_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_foru_respo_gro_id_f_rnofz foreign key (respond_group_id) + references groups(group_id); +alter table forum_forums add + constraint foru_forum_rea_grou_id_f_itati foreign key (read_group_id) + references groups(group_id); + diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_image_uploads.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_image_uploads.sql new file mode 100644 index 000000000..da6af6394 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_image_uploads.sql @@ -0,0 +1,21 @@ +create table forum_post_images + (post_id NUMBER, + image_id NUMBER not null, + image_order NUMBER); + + + +alter table forum_post_images add + constraint FORU_POS_IMAGE_IMAG_ID_F_WYRXA foreign key (image_id) + references cms_images(image_id); + +alter table forum_post_images add + constraint FORU_POS_IMAGE_POST_ID_F_1HH02 foreign key (post_id) + references forum_posts(post_id); + +alter table forum_forums add (image_uploads_allowed CHAR(1)); + +update forum_forums set image_uploads_allowed = 0; + + + diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_privileges.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_privileges.sql new file mode 100644 index 000000000..499b270c5 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_privileges.sql @@ -0,0 +1,18 @@ +insert into acs_privileges (privilege) +values ('forum_read'); + +insert into acs_privileges (privilege) +values ('forum_create_thread'); + +insert into acs_privileges (privilege) +values ('forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_moderation', 'forum_create_thread'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_create_thread', 'forum_respond'); + +insert into acs_privilege_hierarchy (privilege, child_privilege) +values ('forum_respond', 'forum_read'); + diff --git a/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql new file mode 100644 index 000000000..51f326be1 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql @@ -0,0 +1,5 @@ +alter table forum_forums add (subscribe_thread_starter CHAR(1)); + +update forum_forums set subscribe_thread_starter = 0; + + diff --git a/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql b/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql new file mode 100644 index 000000000..4155005c2 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/upgrade/oracle-se-6.5.0-6.5.1.sql @@ -0,0 +1,8 @@ +@@ ../default/upgrade/6.5.0-6.5.1/add_privileges.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_groups.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_file_attachments.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_image_uploads.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql +@@ ../default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql diff --git a/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql b/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql new file mode 100644 index 000000000..1be788736 --- /dev/null +++ b/ccm-forum/sql/ccm-forum/upgrade/postgres-6.5.0-6.5.1.sql @@ -0,0 +1,10 @@ +\i ../default/upgrade/6.5.0-6.5.1/add_thread_subscriber.sql +\i ../default/upgrade/6.5.0-6.5.1/add_privileges.sql +\i ../default/upgrade/6.5.0-6.5.1/add_groups.sql +\i ../default/upgrade/6.5.0-6.5.1/add_privileges.sql +\i ../default/upgrade/6.5.0-6.5.1/add_file_attachments.sql +\i ../default/upgrade/6.5.0-6.5.1/add_forum_introduction.sql +\i ../default/upgrade/6.5.0-6.5.1/add_image_uploads.sql +\i ../default/upgrade/6.5.0-6.5.1/add_forum_no_category_posts.sql +\i ../default/upgrade/6.5.0-6.5.1/add_anonymous_option.sql + diff --git a/ccm-forum/src/WEB-INF/resources/forum-adapters.xml b/ccm-forum/src/WEB-INF/resources/forum-adapters.xml index 337d603a7..0951e26ab 100755 --- a/ccm-forum/src/WEB-INF/resources/forum-adapters.xml +++ b/ccm-forum/src/WEB-INF/resources/forum-adapters.xml @@ -79,6 +79,8 @@ + + @@ -132,4 +134,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ccm-forum/src/ccm-forum.upgrade b/ccm-forum/src/ccm-forum.upgrade index 9af6f4619..3fcacaaac 100755 --- a/ccm-forum/src/ccm-forum.upgrade +++ b/ccm-forum/src/ccm-forum.upgrade @@ -5,4 +5,11 @@