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