src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java

changeset 79
f64255a88d66
parent 78
bb4c52bf3439
child 80
27a25f32048e
     1.1 --- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java	Sat May 23 13:52:04 2020 +0200
     1.2 +++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java	Sat May 23 14:13:09 2020 +0200
     1.3 @@ -50,7 +50,7 @@
     1.4  
     1.5  /**
     1.6   * A special implementation of a HTTPServlet which is focused on implementing
     1.7 - * the necessary functionality for {@link LightPITModule}s.
     1.8 + * the necessary functionality for LightPIT pages.
     1.9   */
    1.10  public abstract class AbstractLightPITServlet extends HttpServlet {
    1.11  
    1.12 @@ -90,15 +90,6 @@
    1.13      private final Map<HttpMethod, Map<String, Method>> mappings = new HashMap<>();
    1.14  
    1.15      /**
    1.16 -     * Gives implementing modules access to the {@link ModuleManager}.
    1.17 -     *
    1.18 -     * @return the module manager
    1.19 -     */
    1.20 -    protected final ModuleManager getModuleManager() {
    1.21 -        return (ModuleManager) getServletContext().getAttribute(ModuleManager.SC_ATTR_NAME);
    1.22 -    }
    1.23 -
    1.24 -    /**
    1.25       * Returns the name of the resource bundle associated with this servlet.
    1.26       * @return the resource bundle base name
    1.27       */
    1.28 @@ -332,7 +323,12 @@
    1.29      private void forwardToFullView(HttpServletRequest req, HttpServletResponse resp)
    1.30              throws IOException, ServletException {
    1.31  
    1.32 -        final var mainMenu = new ArrayList<MenuEntry>(getModuleManager().getMainMenu());
    1.33 +        final String lightpitBundle = "localization.lightpit";
    1.34 +        final var mainMenu = List.of(
    1.35 +                new MenuEntry(new ResourceKey(lightpitBundle, "menu.projects"), "projects/"),
    1.36 +                new MenuEntry(new ResourceKey(lightpitBundle, "menu.users"), "teams/"),
    1.37 +                new MenuEntry(new ResourceKey(lightpitBundle, "menu.languages"), "language/")
    1.38 +        );
    1.39          for (var entry : mainMenu) {
    1.40              if (Functions.fullPath(req).startsWith("/" + entry.getPathName())) {
    1.41                  entry.setActive(true);

mercurial