diff --git a/ccm-forum/src/com/arsdigita/forum/Initializer.java b/ccm-forum/src/com/arsdigita/forum/Initializer.java index b5bc03ade..5089f53f2 100755 --- a/ccm-forum/src/com/arsdigita/forum/Initializer.java +++ b/ccm-forum/src/com/arsdigita/forum/Initializer.java @@ -43,7 +43,7 @@ import com.arsdigita.runtime.CompoundInitializer; import com.arsdigita.runtime.ContextInitEvent; import com.arsdigita.runtime.ContextCloseEvent; import com.arsdigita.runtime.DomainInitEvent; -import com.arsdigita.runtime.LegacyInitEvent; +// import com.arsdigita.runtime.LegacyInitEvent; import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; import com.arsdigita.search.MetadataProviderRegistry; @@ -60,6 +60,9 @@ public class Initializer extends CompoundInitializer { private static final Logger s_log = Logger.getLogger(Initializer.class); + /** + * Default Constructor, cares about the PDLInitializer for forum. + */ public Initializer() { final String url = RuntimeConfig.getConfig().getJDBCURL(); final int database = DbHelper.getDatabaseFromURL(url); @@ -70,6 +73,10 @@ public class Initializer extends CompoundInitializer { new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); } + /** + * + * @param e + */ public void init(DomainInitEvent e) { super.init(e); @@ -103,8 +110,8 @@ public class Initializer extends CompoundInitializer { return new PostImageAttachment(dataObject); } }); - e.getFactory().registerInstantiator( - "com.arsdigita.forum.Inbox", + e.getFactory().registerInstantiator( // OOPS: inbox commented out in + "com.arsdigita.forum.Inbox", // Forum loader! new ACSObjectInstantiator() { public DomainObject doNewInstance(DataObject dataObject) { return new Forum(dataObject); @@ -208,7 +215,8 @@ public class Initializer extends CompoundInitializer { } - public void init(LegacyInitEvent e) { + // public void init(LegacyInitEvent e) { + public void init(ContextInitEvent e) { super.init(e); if (RuntimeConfig.getConfig().runBackGroundTasks()) { @@ -220,7 +228,9 @@ public class Initializer extends CompoundInitializer { public void close(ContextCloseEvent e) { if (RuntimeConfig.getConfig().runBackGroundTasks()) { - RemoveUnattachedAssetsScheduler.startTimer(); + // Should reyally be a typo!! TEST IT! + // RemoveUnattachedAssetsScheduler.startTimer(); + RemoveUnattachedAssetsScheduler.stopTimer(); } } diff --git a/ccm-forum/src/com/arsdigita/forum/Loader.java b/ccm-forum/src/com/arsdigita/forum/Loader.java index 5f81d1019..ef503bf64 100755 --- a/ccm-forum/src/com/arsdigita/forum/Loader.java +++ b/ccm-forum/src/com/arsdigita/forum/Loader.java @@ -59,12 +59,14 @@ public class Loader extends PackageLoader { new KernelExcursion() { public void excurse() { setEffectiveParty(Kernel.getSystemParty()); + setupPrivileges(); setupForumAppType(); //setupInboxAppType(); setupRecentPostingsPortletType(); setupMyForumsPortletType(); setupDigestUser(); + SessionManager.getSession().flushAll(); } }.run(); @@ -84,6 +86,10 @@ public class Loader extends PackageLoader { } + /** + * + * @return + */ private static ApplicationType setupInboxAppType() { ApplicationType type = ApplicationType .createApplicationType(Forum.PACKAGE_TYPE, @@ -93,6 +99,10 @@ public class Loader extends PackageLoader { return type; } + /** + * + * @return + */ public static AppPortletType setupRecentPostingsPortletType() { AppPortletType type = AppPortletType .createAppPortletType("Recent Forum Postings", @@ -105,17 +115,21 @@ public class Loader extends PackageLoader { return type; } - public static PortletType setupMyForumsPortletType() { + public static PortletType setupMyForumsPortletType() { - PortletType type = PortletType - .createPortletType("My Forums", - PortletType.WIDE_PROFILE, - MyForumsPortlet.BASE_DATA_OBJECT_TYPE); - type.setDescription("Lists forums that user has access to, with last posting date"); + PortletType type = PortletType.createPortletType( + "My Forums", + PortletType.WIDE_PROFILE, + MyForumsPortlet.BASE_DATA_OBJECT_TYPE); + type.setDescription("Lists forums that user has access to, " + "" + + " with last posting date"); return type; } + /** + * + */ private static void setupDigestUser() { s_log.debug("Setting up the digest user"); @@ -140,6 +154,9 @@ public class Loader extends PackageLoader { } + /** + * + */ public static void setupPrivileges() { PrivilegeDescriptor.createPrivilege( @@ -158,9 +175,6 @@ public class Loader extends PackageLoader { PrivilegeDescriptor.addChildPrivilege( Forum.RESPOND_TO_THREAD_PRIVILEGE, PrivilegeDescriptor.READ.getName()); - - - } } diff --git a/ccm-forum/src/com/arsdigita/forum/RemoveUnattachedAssetsScheduler.java b/ccm-forum/src/com/arsdigita/forum/RemoveUnattachedAssetsScheduler.java index 303b44929..103f2cc08 100644 --- a/ccm-forum/src/com/arsdigita/forum/RemoveUnattachedAssetsScheduler.java +++ b/ccm-forum/src/com/arsdigita/forum/RemoveUnattachedAssetsScheduler.java @@ -37,8 +37,8 @@ import com.arsdigita.util.UncheckedWrapperException; * Scheduler thread to remove any files or images that are more than a day old * and haven't been attached to a post. * These posts arise if a user starts to create a post and closes their browser - * before completing the post. This - * process gets rid of them on a daily basis to keep them under control + * before completing the post. This process gets rid of them on a daily basis + * to keep them under control * * nb - We can't just delete all unattached assets, as some may be there because * the user is halfway through making a new post diff --git a/ccm-forum/src/com/arsdigita/forum/package.html b/ccm-forum/src/com/arsdigita/forum/package.html index fbdac0570..152f90de4 100755 --- a/ccm-forum/src/com/arsdigita/forum/package.html +++ b/ccm-forum/src/com/arsdigita/forum/package.html @@ -3,7 +3,7 @@