James Moger
2013-11-18 cacf8bff097fbb66a7be1bfe267b5da2605145f8
src/main/java/com/gitblit/wicket/GitBlitWebApp.java
@@ -28,9 +28,16 @@
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import com.gitblit.GitBlit;
import com.gitblit.IStoredSettings;
import com.gitblit.Keys;
import com.gitblit.manager.IFederationManager;
import com.gitblit.manager.IGitblitManager;
import com.gitblit.manager.INotificationManager;
import com.gitblit.manager.IProjectManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.manager.ISessionManager;
import com.gitblit.manager.IUserManager;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.pages.ActivityPage;
import com.gitblit.wicket.pages.BlamePage;
@@ -74,13 +81,49 @@
   private final Map<String, CacheControl> cacheablePages = new HashMap<String, CacheControl>();
   private IStoredSettings settings;
   private final IStoredSettings settings;
   private final IRuntimeManager runtimeManager;
   private final INotificationManager notificationManager;
   private final IUserManager userManager;
   private final ISessionManager sessionManager;
   private final IRepositoryManager repositoryManager;
   private final IProjectManager projectManager;
   private final IGitblitManager gitblitManager;
   private final IFederationManager federationManager;
   public GitBlitWebApp(
         IRuntimeManager runtimeManager,
         INotificationManager notificationManager,
         IUserManager userManager,
         ISessionManager sessionManager,
         IRepositoryManager repositoryManager,
         IProjectManager projectManager,
         IGitblitManager gitblitManager,
         IFederationManager federationManager) {
      super();
      this.settings = runtimeManager.getSettings();
      this.runtimeManager = runtimeManager;
      this.notificationManager = notificationManager;
      this.userManager = userManager;
      this.sessionManager = sessionManager;
      this.repositoryManager = repositoryManager;
      this.projectManager = projectManager;
      this.gitblitManager = gitblitManager;
      this.federationManager = federationManager;
   }
   @Override
   public void init() {
      super.init();
      settings = GitBlit.getSettings();
      // Setup page authorization mechanism
      boolean useAuthentication = settings.getBoolean(Keys.web.authenticateViewPages, false)
@@ -197,7 +240,7 @@
    * @return true if Gitblit is running in debug mode
    */
   public boolean isDebugMode() {
      return GitBlit.isDebugMode();
      return runtimeManager.isDebugMode();
   }
   /*
@@ -205,52 +248,52 @@
    * step towards modularization across multiple commits.
    */
   public Date getBootDate() {
      return GitBlit.getBootDate();
      return runtimeManager.getBootDate();
   }
   public Date getLastActivityDate() {
      return GitBlit.getLastActivityDate();
      return repositoryManager.getLastActivityDate();
   }
   public GitBlit runtime() {
      return GitBlit.self();
   public IRuntimeManager runtime() {
      return runtimeManager;
   }
   public GitBlit mail() {
      return GitBlit.self();
   public INotificationManager notifier() {
      return notificationManager;
   }
   public GitBlit users() {
      return GitBlit.self();
   public IUserManager users() {
      return userManager;
   }
   public GitBlit session() {
      return GitBlit.self();
   public ISessionManager session() {
      return sessionManager;
   }
   public GitBlit repositories() {
      return GitBlit.self();
   public IRepositoryManager repositories() {
      return repositoryManager;
   }
   public GitBlit projects() {
      return GitBlit.self();
   public IProjectManager projects() {
      return projectManager;
   }
   public GitBlit federation() {
      return GitBlit.self();
   public IFederationManager federation() {
      return federationManager;
   }
   public GitBlit gitblit() {
      return GitBlit.self();
   public IGitblitManager gitblit() {
      return gitblitManager;
   }
   public TimeZone getTimezone() {
      return GitBlit.getTimezone();
      return runtimeManager.getTimezone();
   }
   @Override
   public final String getConfigurationType() {
      if (isDebugMode()) {
      if (runtimeManager.isDebugMode()) {
         return Application.DEVELOPMENT;
      }
      return Application.DEPLOYMENT;