Kleinere Formatierungen und Doku

git-svn-id: https://svn.libreccm.org/ccm/trunk@535 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2010-09-19 21:39:52 +00:00
parent b7372848b3
commit e072ca1200
4 changed files with 41 additions and 17 deletions

View File

@ -43,7 +43,7 @@ import com.arsdigita.runtime.CompoundInitializer;
import com.arsdigita.runtime.ContextInitEvent; import com.arsdigita.runtime.ContextInitEvent;
import com.arsdigita.runtime.ContextCloseEvent; import com.arsdigita.runtime.ContextCloseEvent;
import com.arsdigita.runtime.DomainInitEvent; import com.arsdigita.runtime.DomainInitEvent;
import com.arsdigita.runtime.LegacyInitEvent; // import com.arsdigita.runtime.LegacyInitEvent;
import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.PDLInitializer;
import com.arsdigita.runtime.RuntimeConfig; import com.arsdigita.runtime.RuntimeConfig;
import com.arsdigita.search.MetadataProviderRegistry; import com.arsdigita.search.MetadataProviderRegistry;
@ -60,6 +60,9 @@ public class Initializer extends CompoundInitializer {
private static final Logger s_log = Logger.getLogger(Initializer.class); private static final Logger s_log = Logger.getLogger(Initializer.class);
/**
* Default Constructor, cares about the PDLInitializer for forum.
*/
public Initializer() { public Initializer() {
final String url = RuntimeConfig.getConfig().getJDBCURL(); final String url = RuntimeConfig.getConfig().getJDBCURL();
final int database = DbHelper.getDatabaseFromURL(url); final int database = DbHelper.getDatabaseFromURL(url);
@ -70,6 +73,10 @@ public class Initializer extends CompoundInitializer {
new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl")))); new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))));
} }
/**
*
* @param e
*/
public void init(DomainInitEvent e) { public void init(DomainInitEvent e) {
super.init(e); super.init(e);
@ -103,8 +110,8 @@ public class Initializer extends CompoundInitializer {
return new PostImageAttachment(dataObject); return new PostImageAttachment(dataObject);
} }
}); });
e.getFactory().registerInstantiator( e.getFactory().registerInstantiator( // OOPS: inbox commented out in
"com.arsdigita.forum.Inbox", "com.arsdigita.forum.Inbox", // Forum loader!
new ACSObjectInstantiator() { new ACSObjectInstantiator() {
public DomainObject doNewInstance(DataObject dataObject) { public DomainObject doNewInstance(DataObject dataObject) {
return new Forum(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); super.init(e);
if (RuntimeConfig.getConfig().runBackGroundTasks()) { if (RuntimeConfig.getConfig().runBackGroundTasks()) {
@ -220,7 +228,9 @@ public class Initializer extends CompoundInitializer {
public void close(ContextCloseEvent e) { public void close(ContextCloseEvent e) {
if (RuntimeConfig.getConfig().runBackGroundTasks()) { if (RuntimeConfig.getConfig().runBackGroundTasks()) {
RemoveUnattachedAssetsScheduler.startTimer(); // Should reyally be a typo!! TEST IT!
// RemoveUnattachedAssetsScheduler.startTimer();
RemoveUnattachedAssetsScheduler.stopTimer();
} }
} }

View File

@ -59,12 +59,14 @@ public class Loader extends PackageLoader {
new KernelExcursion() { new KernelExcursion() {
public void excurse() { public void excurse() {
setEffectiveParty(Kernel.getSystemParty()); setEffectiveParty(Kernel.getSystemParty());
setupPrivileges(); setupPrivileges();
setupForumAppType(); setupForumAppType();
//setupInboxAppType(); //setupInboxAppType();
setupRecentPostingsPortletType(); setupRecentPostingsPortletType();
setupMyForumsPortletType(); setupMyForumsPortletType();
setupDigestUser(); setupDigestUser();
SessionManager.getSession().flushAll(); SessionManager.getSession().flushAll();
} }
}.run(); }.run();
@ -84,6 +86,10 @@ public class Loader extends PackageLoader {
} }
/**
*
* @return
*/
private static ApplicationType setupInboxAppType() { private static ApplicationType setupInboxAppType() {
ApplicationType type = ApplicationType ApplicationType type = ApplicationType
.createApplicationType(Forum.PACKAGE_TYPE, .createApplicationType(Forum.PACKAGE_TYPE,
@ -93,6 +99,10 @@ public class Loader extends PackageLoader {
return type; return type;
} }
/**
*
* @return
*/
public static AppPortletType setupRecentPostingsPortletType() { public static AppPortletType setupRecentPostingsPortletType() {
AppPortletType type = AppPortletType AppPortletType type = AppPortletType
.createAppPortletType("Recent Forum Postings", .createAppPortletType("Recent Forum Postings",
@ -105,17 +115,21 @@ public class Loader extends PackageLoader {
return type; return type;
} }
public static PortletType setupMyForumsPortletType() { public static PortletType setupMyForumsPortletType() {
PortletType type = PortletType PortletType type = PortletType.createPortletType(
.createPortletType("My Forums", "My Forums",
PortletType.WIDE_PROFILE, PortletType.WIDE_PROFILE,
MyForumsPortlet.BASE_DATA_OBJECT_TYPE); MyForumsPortlet.BASE_DATA_OBJECT_TYPE);
type.setDescription("Lists forums that user has access to, with last posting date"); type.setDescription("Lists forums that user has access to, " + "" +
" with last posting date");
return type; return type;
} }
/**
*
*/
private static void setupDigestUser() { private static void setupDigestUser() {
s_log.debug("Setting up the digest user"); s_log.debug("Setting up the digest user");
@ -140,6 +154,9 @@ public class Loader extends PackageLoader {
} }
/**
*
*/
public static void setupPrivileges() { public static void setupPrivileges() {
PrivilegeDescriptor.createPrivilege( PrivilegeDescriptor.createPrivilege(
@ -158,9 +175,6 @@ public class Loader extends PackageLoader {
PrivilegeDescriptor.addChildPrivilege( PrivilegeDescriptor.addChildPrivilege(
Forum.RESPOND_TO_THREAD_PRIVILEGE, Forum.RESPOND_TO_THREAD_PRIVILEGE,
PrivilegeDescriptor.READ.getName()); PrivilegeDescriptor.READ.getName());
} }
} }

View File

@ -37,8 +37,8 @@ import com.arsdigita.util.UncheckedWrapperException;
* Scheduler thread to remove any files or images that are more than a day old * Scheduler thread to remove any files or images that are more than a day old
* and haven't been attached to a post. * and haven't been attached to a post.
* These posts arise if a user starts to create a post and closes their browser * These posts arise if a user starts to create a post and closes their browser
* before completing the post. This * before completing the post. This process gets rid of them on a daily basis
* process gets rid of them on a daily basis to keep them under control * to keep them under control
* *
* nb - We can't just delete all unattached assets, as some may be there because * nb - We can't just delete all unattached assets, as some may be there because
* the user is halfway through making a new post * the user is halfway through making a new post

View File

@ -3,7 +3,7 @@
<head> <head>
<title>com.arsdigita.bboard</title> <title>com.arsdigita.bboard</title>
</head> </head>
<body bgcolor="white"> <body>
<p> <p>