...
This is a proposal to enable simple multi-domain support in Roller. It is based on code that I have in production, which enables me to run http://rollerweblogger.org and http://photophys.com via of the very same Roller instance.
The code will be attached to Jira ROL-1670
Requirements
- Allow one Roller instance to specify different URLs for different weblogs
- Ensure that each weblog is only accessed by one root URL
...
Code Block |
---|
package org.rollerweblogger.roller; import org.apache.roller.weblogger.business.jpa.*; import com.google.inject.Binder; import com.google.inject.Module; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.roller.weblogger.business.BookmarkManager; import org.apache.roller.weblogger.business.FileManager; import org.apache.roller.weblogger.business.FileManagerImpl; import org.apache.roller.weblogger.business.PropertiesManager; import org.apache.roller.weblogger.business.URLStrategy; import org.apache.roller.weblogger.business.Weblogger; import org.apache.roller.weblogger.business.UserManager; import org.apache.roller.weblogger.business.WeblogManager; import org.apache.roller.weblogger.business.pings.AutoPingManager; import org.apache.roller.weblogger.business.pings.PingQueueManager; import org.apache.roller.weblogger.business.pings.PingTargetManager; import org.apache.roller.weblogger.business.plugins.PluginManager; import org.apache.roller.weblogger.business.plugins.PluginManagerImpl; import org.apache.roller.weblogger.business.referrers.RefererManager; import org.apache.roller.weblogger.business.referrers.ReferrerQueueManager; import org.apache.roller.weblogger.business.referrers.ReferrerQueueManagerImpl; import org.apache.roller.weblogger.business.runnable.ThreadManager; import org.apache.roller.weblogger.business.search.IndexManager; import org.apache.roller.weblogger.business.search.IndexManagerImpl; import org.apache.roller.weblogger.business.themes.ThemeManager; import org.apache.roller.weblogger.business.themes.ThemeManagerImpl; /** * Guice module for configuring JPA as Weblogger-backend. */ public class JPAWebloggerModule implements Module { private static final Log logger = LogFactory.getLog(JPAWebloggerModule.class); public void configure(Binder binder) { logger.info("Configuring Blogging Roller Module with multi-domain support"); binder.bind(Weblogger.class).to(JPAWebloggerImpl.class); binder.bind(JPAPersistenceStrategy.class); binder.bind(org.apache.roller.weblogger.planet.business.jpa.JPARollerPlanetPersistenceStrategy.class); binder.bind(AutoPingManager.class).to( JPAAutoPingManagerImpl.class); binder.bind(BookmarkManager.class).to( JPABookmarkManagerImpl.class); binder.bind(PingQueueManager.class).to( JPAPingQueueManagerImpl.class); binder.bind(PingTargetManager.class).to( JPAPingTargetManagerImpl.class); binder.bind(PropertiesManager.class).to( JPAPropertiesManagerImpl.class); binder.bind(RefererManager.class).to( JPARefererManagerImpl.class); binder.bind(ThreadManager.class).to( JPAThreadManagerImpl.class); binder.bind(UserManager.class).to( JPAUserManagerImpl.class); binder.bind(WeblogManager.class).to( JPAWeblogManagerImpl.class); binder.bind(ReferrerQueueManager.class).to(ReferrerQueueManagerImpl.class); binder.bind(FileManager.class).to( FileManagerImpl.class); binder.bind(IndexManager.class).to( IndexManagerImpl.class); binder.bind(PluginManager.class).to( PluginManagerImpl.class); binder.bind(ThemeManager.class).to( ThemeManagerImpl.class); binder.bind(URLStrategy.class).to( MultiDomainURLStrategy.class); } } |
Patch for JIRA Issue
(Since JIRA seems to have a problem, I'll enter the JIRA text here, temporarily...
Issue Type
Improvement
Summary
Patch for Simple Multi-Domain support using roller-custom.properties
Description
A patch that will enable multii-domain support by configuring an entry for each weblog in roller-custom.properties, like this example:
weblog.absoluteurl.photophys=http://photophys.com
...
Comments
Please comment on the Roller dev mailing list.