commit | author | age
|
99d0d4
|
1 |
/* |
JM |
2 |
* Copyright 2011 gitblit.com. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package com.gitblit.wicket; |
|
17 |
|
|
18 |
import java.util.Date; |
|
19 |
import java.util.HashMap; |
|
20 |
import java.util.Locale; |
|
21 |
import java.util.Map; |
|
22 |
import java.util.TimeZone; |
|
23 |
|
|
24 |
import org.apache.wicket.Application; |
|
25 |
import org.apache.wicket.Request; |
|
26 |
import org.apache.wicket.Response; |
|
27 |
import org.apache.wicket.Session; |
0ee804
|
28 |
import org.apache.wicket.application.IClassResolver; |
99d0d4
|
29 |
import org.apache.wicket.markup.html.WebPage; |
JM |
30 |
import org.apache.wicket.protocol.http.WebApplication; |
|
31 |
|
7a401a
|
32 |
import ro.fortsoft.pf4j.PluginState; |
JM |
33 |
import ro.fortsoft.pf4j.PluginWrapper; |
|
34 |
|
99d0d4
|
35 |
import com.gitblit.IStoredSettings; |
JM |
36 |
import com.gitblit.Keys; |
7a401a
|
37 |
import com.gitblit.extensions.GitblitWicketPlugin; |
3a9e76
|
38 |
import com.gitblit.manager.IAuthenticationManager; |
db4f6b
|
39 |
import com.gitblit.manager.IFederationManager; |
bd0e83
|
40 |
import com.gitblit.manager.IFilestoreManager; |
3a9e76
|
41 |
import com.gitblit.manager.IGitblit; |
db4f6b
|
42 |
import com.gitblit.manager.INotificationManager; |
a7af19
|
43 |
import com.gitblit.manager.IPluginManager; |
db4f6b
|
44 |
import com.gitblit.manager.IProjectManager; |
JM |
45 |
import com.gitblit.manager.IRepositoryManager; |
|
46 |
import com.gitblit.manager.IRuntimeManager; |
7d3a31
|
47 |
import com.gitblit.manager.IServicesManager; |
db4f6b
|
48 |
import com.gitblit.manager.IUserManager; |
5e3521
|
49 |
import com.gitblit.tickets.ITicketService; |
245836
|
50 |
import com.gitblit.transport.ssh.IPublicKeyManager; |
fc3a39
|
51 |
import com.gitblit.utils.XssFilter; |
99d0d4
|
52 |
import com.gitblit.wicket.pages.ActivityPage; |
JM |
53 |
import com.gitblit.wicket.pages.BlamePage; |
|
54 |
import com.gitblit.wicket.pages.BlobDiffPage; |
|
55 |
import com.gitblit.wicket.pages.BlobPage; |
|
56 |
import com.gitblit.wicket.pages.BranchesPage; |
|
57 |
import com.gitblit.wicket.pages.CommitDiffPage; |
|
58 |
import com.gitblit.wicket.pages.CommitPage; |
|
59 |
import com.gitblit.wicket.pages.ComparePage; |
|
60 |
import com.gitblit.wicket.pages.DocPage; |
|
61 |
import com.gitblit.wicket.pages.DocsPage; |
ce048e
|
62 |
import com.gitblit.wicket.pages.EditMilestonePage; |
0047fb
|
63 |
import com.gitblit.wicket.pages.EditRepositoryPage; |
5e3521
|
64 |
import com.gitblit.wicket.pages.EditTicketPage; |
JM |
65 |
import com.gitblit.wicket.pages.ExportTicketPage; |
99d0d4
|
66 |
import com.gitblit.wicket.pages.FederationRegistrationPage; |
bd0e83
|
67 |
import com.gitblit.wicket.pages.FilestorePage; |
99d0d4
|
68 |
import com.gitblit.wicket.pages.ForkPage; |
JM |
69 |
import com.gitblit.wicket.pages.ForksPage; |
|
70 |
import com.gitblit.wicket.pages.GitSearchPage; |
|
71 |
import com.gitblit.wicket.pages.HistoryPage; |
|
72 |
import com.gitblit.wicket.pages.LogPage; |
|
73 |
import com.gitblit.wicket.pages.LogoutPage; |
|
74 |
import com.gitblit.wicket.pages.LuceneSearchPage; |
|
75 |
import com.gitblit.wicket.pages.MetricsPage; |
|
76 |
import com.gitblit.wicket.pages.MyDashboardPage; |
ff17f7
|
77 |
import com.gitblit.wicket.pages.MyTicketsPage; |
ce048e
|
78 |
import com.gitblit.wicket.pages.NewMilestonePage; |
0047fb
|
79 |
import com.gitblit.wicket.pages.NewRepositoryPage; |
5e3521
|
80 |
import com.gitblit.wicket.pages.NewTicketPage; |
99d0d4
|
81 |
import com.gitblit.wicket.pages.OverviewPage; |
JM |
82 |
import com.gitblit.wicket.pages.PatchPage; |
|
83 |
import com.gitblit.wicket.pages.ProjectPage; |
|
84 |
import com.gitblit.wicket.pages.ProjectsPage; |
|
85 |
import com.gitblit.wicket.pages.ReflogPage; |
|
86 |
import com.gitblit.wicket.pages.RepositoriesPage; |
|
87 |
import com.gitblit.wicket.pages.ReviewProposalPage; |
|
88 |
import com.gitblit.wicket.pages.SummaryPage; |
|
89 |
import com.gitblit.wicket.pages.TagPage; |
|
90 |
import com.gitblit.wicket.pages.TagsPage; |
859deb
|
91 |
import com.gitblit.wicket.pages.TeamsPage; |
5e3521
|
92 |
import com.gitblit.wicket.pages.TicketsPage; |
99d0d4
|
93 |
import com.gitblit.wicket.pages.TreePage; |
JM |
94 |
import com.gitblit.wicket.pages.UserPage; |
|
95 |
import com.gitblit.wicket.pages.UsersPage; |
7d3a31
|
96 |
import com.google.inject.Inject; |
241f57
|
97 |
import com.google.inject.Provider; |
7d3a31
|
98 |
import com.google.inject.Singleton; |
99d0d4
|
99 |
|
1b34b0
|
100 |
@Singleton |
7a401a
|
101 |
public class GitBlitWebApp extends WebApplication implements GitblitWicketApp { |
99d0d4
|
102 |
|
JM |
103 |
private final Class<? extends WebPage> homePageClass = MyDashboardPage.class; |
0047fb
|
104 |
|
JM |
105 |
private final Class<? extends WebPage> newRepositoryPageClass = NewRepositoryPage.class; |
99d0d4
|
106 |
|
JM |
107 |
private final Map<String, CacheControl> cacheablePages = new HashMap<String, CacheControl>(); |
241f57
|
108 |
|
JM |
109 |
private final Provider<IPublicKeyManager> publicKeyManagerProvider; |
99d0d4
|
110 |
|
c42032
|
111 |
private final Provider<ITicketService> ticketServiceProvider; |
JM |
112 |
|
cacf8b
|
113 |
private final IStoredSettings settings; |
JM |
114 |
|
fc3a39
|
115 |
private final XssFilter xssFilter; |
JM |
116 |
|
cacf8b
|
117 |
private final IRuntimeManager runtimeManager; |
JM |
118 |
|
a7af19
|
119 |
private final IPluginManager pluginManager; |
JM |
120 |
|
cacf8b
|
121 |
private final INotificationManager notificationManager; |
JM |
122 |
|
|
123 |
private final IUserManager userManager; |
|
124 |
|
04a985
|
125 |
private final IAuthenticationManager authenticationManager; |
cacf8b
|
126 |
|
JM |
127 |
private final IRepositoryManager repositoryManager; |
|
128 |
|
|
129 |
private final IProjectManager projectManager; |
|
130 |
|
|
131 |
private final IFederationManager federationManager; |
3a9e76
|
132 |
|
JM |
133 |
private final IGitblit gitblit; |
cacf8b
|
134 |
|
7d3a31
|
135 |
private final IServicesManager services; |
bd0e83
|
136 |
|
PM |
137 |
private final IFilestoreManager filestoreManager; |
7d3a31
|
138 |
|
1b34b0
|
139 |
@Inject |
cacf8b
|
140 |
public GitBlitWebApp( |
241f57
|
141 |
Provider<IPublicKeyManager> publicKeyManagerProvider, |
c42032
|
142 |
Provider<ITicketService> ticketServiceProvider, |
cacf8b
|
143 |
IRuntimeManager runtimeManager, |
a7af19
|
144 |
IPluginManager pluginManager, |
cacf8b
|
145 |
INotificationManager notificationManager, |
JM |
146 |
IUserManager userManager, |
04a985
|
147 |
IAuthenticationManager authenticationManager, |
cacf8b
|
148 |
IRepositoryManager repositoryManager, |
JM |
149 |
IProjectManager projectManager, |
3a9e76
|
150 |
IFederationManager federationManager, |
7d3a31
|
151 |
IGitblit gitblit, |
bd0e83
|
152 |
IServicesManager services, |
PM |
153 |
IFilestoreManager filestoreManager) { |
cacf8b
|
154 |
|
JM |
155 |
super(); |
241f57
|
156 |
this.publicKeyManagerProvider = publicKeyManagerProvider; |
c42032
|
157 |
this.ticketServiceProvider = ticketServiceProvider; |
cacf8b
|
158 |
this.settings = runtimeManager.getSettings(); |
fc3a39
|
159 |
this.xssFilter = runtimeManager.getXssFilter(); |
cacf8b
|
160 |
this.runtimeManager = runtimeManager; |
a7af19
|
161 |
this.pluginManager = pluginManager; |
cacf8b
|
162 |
this.notificationManager = notificationManager; |
JM |
163 |
this.userManager = userManager; |
04a985
|
164 |
this.authenticationManager = authenticationManager; |
cacf8b
|
165 |
this.repositoryManager = repositoryManager; |
JM |
166 |
this.projectManager = projectManager; |
|
167 |
this.federationManager = federationManager; |
3a9e76
|
168 |
this.gitblit = gitblit; |
7d3a31
|
169 |
this.services = services; |
bd0e83
|
170 |
this.filestoreManager = filestoreManager; |
cacf8b
|
171 |
} |
99d0d4
|
172 |
|
JM |
173 |
@Override |
|
174 |
public void init() { |
|
175 |
super.init(); |
|
176 |
|
|
177 |
// Setup page authorization mechanism |
|
178 |
boolean useAuthentication = settings.getBoolean(Keys.web.authenticateViewPages, false) |
|
179 |
|| settings.getBoolean(Keys.web.authenticateAdminPages, false); |
|
180 |
if (useAuthentication) { |
|
181 |
AuthorizationStrategy authStrategy = new AuthorizationStrategy(settings, homePageClass); |
|
182 |
getSecuritySettings().setAuthorizationStrategy(authStrategy); |
|
183 |
getSecuritySettings().setUnauthorizedComponentInstantiationListener(authStrategy); |
|
184 |
} |
|
185 |
|
|
186 |
// Grab Browser info (like timezone, etc) |
|
187 |
if (settings.getBoolean(Keys.web.useClientTimezone, false)) { |
|
188 |
getRequestCycleSettings().setGatherExtendedBrowserInfo(true); |
|
189 |
} |
|
190 |
|
|
191 |
// configure the resource cache duration to 90 days for deployment |
|
192 |
if (!isDebugMode()) { |
|
193 |
getResourceSettings().setDefaultCacheDuration(90 * 86400); |
|
194 |
} |
|
195 |
|
|
196 |
// setup the standard gitweb-ish urls |
|
197 |
mount("/repositories", RepositoriesPage.class); |
5d5e55
|
198 |
mount("/overview", OverviewPage.class, "r"); |
99d0d4
|
199 |
mount("/summary", SummaryPage.class, "r"); |
5d5e55
|
200 |
mount("/reflog", ReflogPage.class, "r"); |
99d0d4
|
201 |
mount("/commits", LogPage.class, "r", "h"); |
JM |
202 |
mount("/log", LogPage.class, "r", "h"); |
|
203 |
mount("/tags", TagsPage.class, "r"); |
|
204 |
mount("/branches", BranchesPage.class, "r"); |
|
205 |
mount("/commit", CommitPage.class, "r", "h"); |
|
206 |
mount("/tag", TagPage.class, "r", "h"); |
|
207 |
mount("/tree", TreePage.class, "r", "h", "f"); |
|
208 |
mount("/blob", BlobPage.class, "r", "h", "f"); |
|
209 |
mount("/blobdiff", BlobDiffPage.class, "r", "h", "f"); |
|
210 |
mount("/commitdiff", CommitDiffPage.class, "r", "h"); |
|
211 |
mount("/compare", ComparePage.class, "r", "h"); |
|
212 |
mount("/patch", PatchPage.class, "r", "h", "f"); |
|
213 |
mount("/history", HistoryPage.class, "r", "h", "f"); |
|
214 |
mount("/search", GitSearchPage.class); |
|
215 |
mount("/metrics", MetricsPage.class, "r"); |
|
216 |
mount("/blame", BlamePage.class, "r", "h", "f"); |
|
217 |
mount("/users", UsersPage.class); |
859deb
|
218 |
mount("/teams", TeamsPage.class); |
99d0d4
|
219 |
mount("/logout", LogoutPage.class); |
5e3521
|
220 |
|
JM |
221 |
// setup ticket urls |
|
222 |
mount("/tickets", TicketsPage.class, "r", "h"); |
|
223 |
mount("/tickets/new", NewTicketPage.class, "r"); |
|
224 |
mount("/tickets/edit", EditTicketPage.class, "r", "h"); |
|
225 |
mount("/tickets/export", ExportTicketPage.class, "r", "h"); |
ce048e
|
226 |
mount("/milestones/new", NewMilestonePage.class, "r"); |
JM |
227 |
mount("/milestones/edit", EditMilestonePage.class, "r", "h"); |
338037
|
228 |
mount("/mytickets", MyTicketsPage.class, "r", "h"); |
99d0d4
|
229 |
|
JM |
230 |
// setup the markup document urls |
062519
|
231 |
mount("/docs", DocsPage.class, "r", "h"); |
99d0d4
|
232 |
mount("/doc", DocPage.class, "r", "h", "f"); |
JM |
233 |
|
|
234 |
// federation urls |
|
235 |
mount("/proposal", ReviewProposalPage.class, "t"); |
|
236 |
mount("/registration", FederationRegistrationPage.class, "u", "n"); |
|
237 |
|
0047fb
|
238 |
mount("/new", NewRepositoryPage.class); |
JM |
239 |
mount("/edit", EditRepositoryPage.class, "r"); |
99d0d4
|
240 |
mount("/activity", ActivityPage.class, "r", "h"); |
JM |
241 |
mount("/lucene", LuceneSearchPage.class); |
|
242 |
mount("/project", ProjectPage.class, "p"); |
|
243 |
mount("/projects", ProjectsPage.class); |
|
244 |
mount("/user", UserPage.class, "user"); |
|
245 |
mount("/forks", ForksPage.class, "r"); |
|
246 |
mount("/fork", ForkPage.class, "r"); |
bd0e83
|
247 |
|
PM |
248 |
// filestore URL |
|
249 |
mount("/filestore", FilestorePage.class); |
3a9e76
|
250 |
|
7a401a
|
251 |
// allow started Wicket plugins to initialize |
JM |
252 |
for (PluginWrapper pluginWrapper : pluginManager.getPlugins()) { |
|
253 |
if (PluginState.STARTED != pluginWrapper.getPluginState()) { |
|
254 |
continue; |
|
255 |
} |
|
256 |
if (pluginWrapper.getPlugin() instanceof GitblitWicketPlugin) { |
|
257 |
GitblitWicketPlugin wicketPlugin = (GitblitWicketPlugin) pluginWrapper.getPlugin(); |
|
258 |
wicketPlugin.init(this); |
|
259 |
} |
|
260 |
} |
|
261 |
|
|
262 |
// customize the Wicket class resolver to load from plugins |
0ee804
|
263 |
IClassResolver coreResolver = getApplicationSettings().getClassResolver(); |
JM |
264 |
PluginClassResolver classResolver = new PluginClassResolver(coreResolver, pluginManager); |
7a401a
|
265 |
getApplicationSettings().setClassResolver(classResolver); |
JM |
266 |
|
99d0d4
|
267 |
getMarkupSettings().setDefaultMarkupEncoding("UTF-8"); |
JM |
268 |
} |
|
269 |
|
7a401a
|
270 |
/* (non-Javadoc) |
JM |
271 |
* @see com.gitblit.wicket.Webapp#mount(java.lang.String, java.lang.Class, java.lang.String) |
|
272 |
*/ |
|
273 |
@Override |
|
274 |
public void mount(String location, Class<? extends WebPage> clazz, String... parameters) { |
99d0d4
|
275 |
if (parameters == null) { |
JM |
276 |
parameters = new String[] {}; |
|
277 |
} |
|
278 |
if (!settings.getBoolean(Keys.web.mountParameters, true)) { |
|
279 |
parameters = new String[] {}; |
|
280 |
} |
dfaf1f
|
281 |
mount(new GitblitParamUrlCodingStrategy(settings, xssFilter, location, clazz, parameters)); |
99d0d4
|
282 |
|
JM |
283 |
// map the mount point to the cache control definition |
|
284 |
if (clazz.isAnnotationPresent(CacheControl.class)) { |
|
285 |
CacheControl cacheControl = clazz.getAnnotation(CacheControl.class); |
|
286 |
cacheablePages.put(location.substring(1), cacheControl); |
|
287 |
} |
|
288 |
} |
|
289 |
|
7a401a
|
290 |
/* (non-Javadoc) |
JM |
291 |
* @see com.gitblit.wicket.Webapp#getHomePage() |
|
292 |
*/ |
99d0d4
|
293 |
@Override |
JM |
294 |
public Class<? extends WebPage> getHomePage() { |
|
295 |
return homePageClass; |
|
296 |
} |
|
297 |
|
0047fb
|
298 |
public Class<? extends WebPage> getNewRepositoryPage() { |
JM |
299 |
return newRepositoryPageClass; |
|
300 |
} |
|
301 |
|
7a401a
|
302 |
/* (non-Javadoc) |
JM |
303 |
* @see com.gitblit.wicket.Webapp#isCacheablePage(java.lang.String) |
|
304 |
*/ |
|
305 |
@Override |
99d0d4
|
306 |
public boolean isCacheablePage(String mountPoint) { |
JM |
307 |
return cacheablePages.containsKey(mountPoint); |
|
308 |
} |
|
309 |
|
7a401a
|
310 |
/* (non-Javadoc) |
JM |
311 |
* @see com.gitblit.wicket.Webapp#getCacheControl(java.lang.String) |
|
312 |
*/ |
|
313 |
@Override |
99d0d4
|
314 |
public CacheControl getCacheControl(String mountPoint) { |
JM |
315 |
return cacheablePages.get(mountPoint); |
|
316 |
} |
|
317 |
|
|
318 |
@Override |
|
319 |
public final Session newSession(Request request, Response response) { |
|
320 |
GitBlitWebSession gitBlitWebSession = new GitBlitWebSession(request); |
|
321 |
|
a8100b
|
322 |
Locale forcedLocale = runtime().getLocale(); |
JM |
323 |
if (forcedLocale != null) { |
|
324 |
gitBlitWebSession.setLocale(forcedLocale); |
99d0d4
|
325 |
} |
JM |
326 |
return gitBlitWebSession; |
|
327 |
} |
|
328 |
|
7a401a
|
329 |
/* (non-Javadoc) |
JM |
330 |
* @see com.gitblit.wicket.Webapp#settings() |
|
331 |
*/ |
|
332 |
@Override |
99d0d4
|
333 |
public IStoredSettings settings() { |
JM |
334 |
return settings; |
|
335 |
} |
|
336 |
|
7a401a
|
337 |
/* (non-Javadoc) |
fc3a39
|
338 |
* @see com.gitblit.wicket.Webapp#xssFilter() |
JM |
339 |
*/ |
|
340 |
@Override |
|
341 |
public XssFilter xssFilter() { |
|
342 |
return xssFilter; |
|
343 |
} |
|
344 |
|
|
345 |
/* (non-Javadoc) |
7a401a
|
346 |
* @see com.gitblit.wicket.Webapp#isDebugMode() |
99d0d4
|
347 |
*/ |
7a401a
|
348 |
@Override |
99d0d4
|
349 |
public boolean isDebugMode() { |
cacf8b
|
350 |
return runtimeManager.isDebugMode(); |
99d0d4
|
351 |
} |
JM |
352 |
|
|
353 |
/* |
|
354 |
* These methods look strange... and they are... but they are the first |
|
355 |
* step towards modularization across multiple commits. |
|
356 |
*/ |
7a401a
|
357 |
/* (non-Javadoc) |
JM |
358 |
* @see com.gitblit.wicket.Webapp#getBootDate() |
|
359 |
*/ |
|
360 |
@Override |
99d0d4
|
361 |
public Date getBootDate() { |
cacf8b
|
362 |
return runtimeManager.getBootDate(); |
99d0d4
|
363 |
} |
JM |
364 |
|
7a401a
|
365 |
/* (non-Javadoc) |
JM |
366 |
* @see com.gitblit.wicket.Webapp#getLastActivityDate() |
|
367 |
*/ |
|
368 |
@Override |
99d0d4
|
369 |
public Date getLastActivityDate() { |
cacf8b
|
370 |
return repositoryManager.getLastActivityDate(); |
99d0d4
|
371 |
} |
JM |
372 |
|
7a401a
|
373 |
/* (non-Javadoc) |
JM |
374 |
* @see com.gitblit.wicket.Webapp#runtime() |
|
375 |
*/ |
|
376 |
@Override |
db4f6b
|
377 |
public IRuntimeManager runtime() { |
cacf8b
|
378 |
return runtimeManager; |
99d0d4
|
379 |
} |
JM |
380 |
|
7a401a
|
381 |
/* (non-Javadoc) |
JM |
382 |
* @see com.gitblit.wicket.Webapp#plugins() |
|
383 |
*/ |
|
384 |
@Override |
a7af19
|
385 |
public IPluginManager plugins() { |
JM |
386 |
return pluginManager; |
|
387 |
} |
|
388 |
|
7a401a
|
389 |
/* (non-Javadoc) |
JM |
390 |
* @see com.gitblit.wicket.Webapp#notifier() |
|
391 |
*/ |
|
392 |
@Override |
db4f6b
|
393 |
public INotificationManager notifier() { |
cacf8b
|
394 |
return notificationManager; |
99d0d4
|
395 |
} |
JM |
396 |
|
7a401a
|
397 |
/* (non-Javadoc) |
JM |
398 |
* @see com.gitblit.wicket.Webapp#users() |
|
399 |
*/ |
|
400 |
@Override |
db4f6b
|
401 |
public IUserManager users() { |
cacf8b
|
402 |
return userManager; |
99d0d4
|
403 |
} |
JM |
404 |
|
7a401a
|
405 |
/* (non-Javadoc) |
JM |
406 |
* @see com.gitblit.wicket.Webapp#authentication() |
|
407 |
*/ |
|
408 |
@Override |
04a985
|
409 |
public IAuthenticationManager authentication() { |
JM |
410 |
return authenticationManager; |
99d0d4
|
411 |
} |
JM |
412 |
|
7a401a
|
413 |
/* (non-Javadoc) |
JM |
414 |
* @see com.gitblit.wicket.Webapp#keys() |
|
415 |
*/ |
|
416 |
@Override |
245836
|
417 |
public IPublicKeyManager keys() { |
241f57
|
418 |
return publicKeyManagerProvider.get(); |
245836
|
419 |
} |
JM |
420 |
|
7a401a
|
421 |
/* (non-Javadoc) |
JM |
422 |
* @see com.gitblit.wicket.Webapp#repositories() |
|
423 |
*/ |
|
424 |
@Override |
db4f6b
|
425 |
public IRepositoryManager repositories() { |
cacf8b
|
426 |
return repositoryManager; |
99d0d4
|
427 |
} |
JM |
428 |
|
7a401a
|
429 |
/* (non-Javadoc) |
JM |
430 |
* @see com.gitblit.wicket.Webapp#projects() |
|
431 |
*/ |
|
432 |
@Override |
db4f6b
|
433 |
public IProjectManager projects() { |
cacf8b
|
434 |
return projectManager; |
99d0d4
|
435 |
} |
JM |
436 |
|
7a401a
|
437 |
/* (non-Javadoc) |
JM |
438 |
* @see com.gitblit.wicket.Webapp#federation() |
|
439 |
*/ |
|
440 |
@Override |
db4f6b
|
441 |
public IFederationManager federation() { |
cacf8b
|
442 |
return federationManager; |
99d0d4
|
443 |
} |
JM |
444 |
|
7a401a
|
445 |
/* (non-Javadoc) |
JM |
446 |
* @see com.gitblit.wicket.Webapp#gitblit() |
|
447 |
*/ |
|
448 |
@Override |
3a9e76
|
449 |
public IGitblit gitblit() { |
JM |
450 |
return gitblit; |
99d0d4
|
451 |
} |
JM |
452 |
|
7a401a
|
453 |
/* (non-Javadoc) |
7d3a31
|
454 |
* @see com.gitblit.wicket.Webapp#services() |
JM |
455 |
*/ |
|
456 |
@Override |
|
457 |
public IServicesManager services() { |
|
458 |
return services; |
|
459 |
} |
|
460 |
|
|
461 |
/* (non-Javadoc) |
7a401a
|
462 |
* @see com.gitblit.wicket.Webapp#tickets() |
JM |
463 |
*/ |
|
464 |
@Override |
5e3521
|
465 |
public ITicketService tickets() { |
c42032
|
466 |
return ticketServiceProvider.get(); |
5e3521
|
467 |
} |
JM |
468 |
|
7a401a
|
469 |
/* (non-Javadoc) |
JM |
470 |
* @see com.gitblit.wicket.Webapp#getTimezone() |
|
471 |
*/ |
|
472 |
@Override |
99d0d4
|
473 |
public TimeZone getTimezone() { |
cacf8b
|
474 |
return runtimeManager.getTimezone(); |
99d0d4
|
475 |
} |
JM |
476 |
|
|
477 |
@Override |
|
478 |
public final String getConfigurationType() { |
cacf8b
|
479 |
if (runtimeManager.isDebugMode()) { |
99d0d4
|
480 |
return Application.DEVELOPMENT; |
JM |
481 |
} |
|
482 |
return Application.DEPLOYMENT; |
|
483 |
} |
|
484 |
|
|
485 |
public static GitBlitWebApp get() { |
|
486 |
return (GitBlitWebApp) WebApplication.get(); |
|
487 |
} |
bd0e83
|
488 |
|
PM |
489 |
@Override |
|
490 |
public IFilestoreManager filestore() { |
|
491 |
return filestoreManager; |
|
492 |
} |
99d0d4
|
493 |
} |