| | |
| | | import com.gitblit.extensions.GitblitWicketPlugin; |
| | | import com.gitblit.manager.IAuthenticationManager; |
| | | import com.gitblit.manager.IFederationManager; |
| | | import com.gitblit.manager.IFilestoreManager; |
| | | import com.gitblit.manager.IGitblit; |
| | | import com.gitblit.manager.INotificationManager; |
| | | import com.gitblit.manager.IPluginManager; |
| | | import com.gitblit.manager.IProjectManager; |
| | | import com.gitblit.manager.IRepositoryManager; |
| | | import com.gitblit.manager.IRuntimeManager; |
| | | import com.gitblit.manager.IServicesManager; |
| | | import com.gitblit.manager.IUserManager; |
| | | import com.gitblit.tickets.ITicketService; |
| | | import com.gitblit.transport.ssh.IPublicKeyManager; |
| | |
| | | import com.gitblit.wicket.pages.ComparePage; |
| | | import com.gitblit.wicket.pages.DocPage; |
| | | import com.gitblit.wicket.pages.DocsPage; |
| | | import com.gitblit.wicket.pages.EditFilePage; |
| | | import com.gitblit.wicket.pages.EditMilestonePage; |
| | | import com.gitblit.wicket.pages.EditRepositoryPage; |
| | | import com.gitblit.wicket.pages.EditTicketPage; |
| | | import com.gitblit.wicket.pages.ExportTicketPage; |
| | | import com.gitblit.wicket.pages.FederationRegistrationPage; |
| | | import com.gitblit.wicket.pages.FilestorePage; |
| | | import com.gitblit.wicket.pages.ForkPage; |
| | | import com.gitblit.wicket.pages.ForksPage; |
| | | import com.gitblit.wicket.pages.GitSearchPage; |
| | |
| | | import com.gitblit.wicket.pages.TreePage; |
| | | import com.gitblit.wicket.pages.UserPage; |
| | | import com.gitblit.wicket.pages.UsersPage; |
| | | import com.google.inject.Inject; |
| | | import com.google.inject.Provider; |
| | | import com.google.inject.Singleton; |
| | | |
| | | @Singleton |
| | | public class GitBlitWebApp extends WebApplication implements GitblitWicketApp { |
| | | |
| | | private final Class<? extends WebPage> homePageClass = MyDashboardPage.class; |
| | |
| | | private final Class<? extends WebPage> newRepositoryPageClass = NewRepositoryPage.class; |
| | | |
| | | private final Map<String, CacheControl> cacheablePages = new HashMap<String, CacheControl>(); |
| | | |
| | | private final Provider<IPublicKeyManager> publicKeyManagerProvider; |
| | | |
| | | private final Provider<ITicketService> ticketServiceProvider; |
| | | |
| | | private final IStoredSettings settings; |
| | | |
| | |
| | | |
| | | private final IAuthenticationManager authenticationManager; |
| | | |
| | | private final IPublicKeyManager publicKeyManager; |
| | | |
| | | private final IRepositoryManager repositoryManager; |
| | | |
| | | private final IProjectManager projectManager; |
| | |
| | | |
| | | private final IGitblit gitblit; |
| | | |
| | | private final IServicesManager services; |
| | | |
| | | private final IFilestoreManager filestoreManager; |
| | | |
| | | @Inject |
| | | public GitBlitWebApp( |
| | | Provider<IPublicKeyManager> publicKeyManagerProvider, |
| | | Provider<ITicketService> ticketServiceProvider, |
| | | IRuntimeManager runtimeManager, |
| | | IPluginManager pluginManager, |
| | | INotificationManager notificationManager, |
| | | IUserManager userManager, |
| | | IAuthenticationManager authenticationManager, |
| | | IPublicKeyManager publicKeyManager, |
| | | IRepositoryManager repositoryManager, |
| | | IProjectManager projectManager, |
| | | IFederationManager federationManager, |
| | | IGitblit gitblit) { |
| | | IGitblit gitblit, |
| | | IServicesManager services, |
| | | IFilestoreManager filestoreManager) { |
| | | |
| | | super(); |
| | | this.publicKeyManagerProvider = publicKeyManagerProvider; |
| | | this.ticketServiceProvider = ticketServiceProvider; |
| | | this.settings = runtimeManager.getSettings(); |
| | | this.xssFilter = runtimeManager.getXssFilter(); |
| | | this.runtimeManager = runtimeManager; |
| | |
| | | this.notificationManager = notificationManager; |
| | | this.userManager = userManager; |
| | | this.authenticationManager = authenticationManager; |
| | | this.publicKeyManager = publicKeyManager; |
| | | this.repositoryManager = repositoryManager; |
| | | this.projectManager = projectManager; |
| | | this.federationManager = federationManager; |
| | | this.gitblit = gitblit; |
| | | this.services = services; |
| | | this.filestoreManager = filestoreManager; |
| | | } |
| | | |
| | | @Override |
| | |
| | | // setup the markup document urls |
| | | mount("/docs", DocsPage.class, "r", "h"); |
| | | mount("/doc", DocPage.class, "r", "h", "f"); |
| | | mount("/editfile", EditFilePage.class, "r", "h", "f"); |
| | | |
| | | // federation urls |
| | | mount("/proposal", ReviewProposalPage.class, "t"); |
| | |
| | | mount("/user", UserPage.class, "user"); |
| | | mount("/forks", ForksPage.class, "r"); |
| | | mount("/fork", ForkPage.class, "r"); |
| | | |
| | | // filestore URL |
| | | mount("/filestore", FilestorePage.class); |
| | | |
| | | // allow started Wicket plugins to initialize |
| | | for (PluginWrapper pluginWrapper : pluginManager.getPlugins()) { |
| | |
| | | */ |
| | | @Override |
| | | public IPublicKeyManager keys() { |
| | | return publicKeyManager; |
| | | return publicKeyManagerProvider.get(); |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | | * @see com.gitblit.wicket.Webapp#services() |
| | | */ |
| | | @Override |
| | | public IServicesManager services() { |
| | | return services; |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | | * @see com.gitblit.wicket.Webapp#tickets() |
| | | */ |
| | | @Override |
| | | public ITicketService tickets() { |
| | | return gitblit.getTicketService(); |
| | | return ticketServiceProvider.get(); |
| | | } |
| | | |
| | | /* (non-Javadoc) |
| | |
| | | public static GitBlitWebApp get() { |
| | | return (GitBlitWebApp) WebApplication.get(); |
| | | } |
| | | |
| | | @Override |
| | | public IFilestoreManager filestore() { |
| | | return filestoreManager; |
| | | } |
| | | } |