Sun, 10 May 2020 10:11:37 +0200
removes features that are not (and probably will not) used anyway
1.1 --- a/setup/postgres/psql_create_tables.sql Sun May 10 10:11:10 2020 +0200 1.2 +++ b/setup/postgres/psql_create_tables.sql Sun May 10 10:11:37 2020 +0200 1.3 @@ -1,28 +1,9 @@ 1.4 -- This script creates the module management tables 1.5 -- 1.6 1.7 -create table lpitcore_module ( 1.8 - modid serial primary key, 1.9 - classname varchar(100) not null unique, 1.10 - visible boolean not null default(true), 1.11 - priority integer not null default(1000) 1.12 -); 1.13 - 1.14 create table lpitcore_user ( 1.15 userid serial primary key, 1.16 username varchar(50) not null unique, 1.17 lastname varchar(50), 1.18 givenname varchar(50) 1.19 ); 1.20 - 1.21 -create table lpitcore_authorization ( 1.22 - modid integer not null references lpitcore_modules(modid) on delete cascade, 1.23 - userid integer not null references lpitcore_user(userid) on delete cascade, 1.24 - power integer not null check(power >= 0) 1.25 -); 1.26 - 1.27 -create table lpitcore_menu ( 1.28 - modid integer not null references lpitcore_modules(modid) on delete cascade, 1.29 - userid integer not null references lpitcore_user(userid) on delete cascade, 1.30 - seq integer not null 1.31 -);
2.1 --- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sun May 10 10:11:10 2020 +0200 2.2 +++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sun May 10 10:11:37 2020 +0200 2.3 @@ -52,14 +52,9 @@ 2.4 private static final String HTML_FULL_DISPATCHER = Functions.jspPath("html_full"); 2.5 2.6 /** 2.7 - * Store a reference to the annotation for quicker access. 2.8 - */ 2.9 - private LightPITModule moduleInfo = null; 2.10 - 2.11 - /** 2.12 * The EL proxy is necessary, because the EL resolver cannot handle annotation properties. 2.13 */ 2.14 - private LightPITModule.ELProxy moduleInfoELProxy = null; 2.15 + private LightPITModule.ELProxy moduleInfo = null; 2.16 2.17 2.18 @FunctionalInterface 2.19 @@ -88,15 +83,6 @@ 2.20 } 2.21 2.22 /** 2.23 - * Returns the annotated module information. 2.24 - * 2.25 - * @return the module annotation 2.26 - */ 2.27 - public final LightPITModule getModuleInfo() { 2.28 - return moduleInfo; 2.29 - } 2.30 - 2.31 - /** 2.32 * Gives implementing modules access to the {@link DatabaseFacade}. 2.33 * 2.34 * @return the database facade 2.35 @@ -118,8 +104,8 @@ 2.36 2.37 @Override 2.38 public void init() throws ServletException { 2.39 - moduleInfo = this.getClass().getAnnotation(LightPITModule.class); 2.40 - moduleInfoELProxy = moduleInfo == null ? null : LightPITModule.ELProxy.convert(moduleInfo); 2.41 + moduleInfo = Optional.ofNullable(this.getClass().getAnnotation(LightPITModule.class)) 2.42 + .map(LightPITModule.ELProxy::new).orElse(null); 2.43 2.44 if (moduleInfo != null) { 2.45 scanForRequestMappings(); 2.46 @@ -228,7 +214,7 @@ 2.47 private void forwardToFullView(HttpServletRequest req, HttpServletResponse resp) 2.48 throws IOException, ServletException { 2.49 2.50 - req.setAttribute(Constants.REQ_ATTR_MENU, getModuleManager().getMainMenu(getDatabaseFacade())); 2.51 + req.setAttribute(Constants.REQ_ATTR_MENU, getModuleManager().getMainMenu()); 2.52 req.getRequestDispatcher(HTML_FULL_DISPATCHER).forward(req, resp); 2.53 } 2.54 2.55 @@ -255,9 +241,6 @@ 2.56 private void doProcess(HttpMethod method, HttpServletRequest req, HttpServletResponse resp) 2.57 throws ServletException, IOException { 2.58 2.59 - // Synchronize module information with database 2.60 - getModuleManager().syncWithDatabase(getDatabaseFacade()); 2.61 - 2.62 // choose the requested language as session language (if available) or fall back to english, otherwise 2.63 HttpSession session = req.getSession(); 2.64 if (session.getAttribute(Constants.SESSION_ATTR_LANGUAGE) == null) { 2.65 @@ -275,7 +258,7 @@ 2.66 // set some internal request attributes 2.67 req.setAttribute(Constants.REQ_ATTR_PATH, Functions.fullPath(req)); 2.68 req.setAttribute(Constants.REQ_ATTR_MODULE_CLASSNAME, this.getClass().getName()); 2.69 - Optional.ofNullable(moduleInfoELProxy).ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy)); 2.70 + Optional.ofNullable(moduleInfo).ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy)); 2.71 2.72 2.73 // call the handler, if available, or send an HTTP 404 error
3.1 --- a/src/main/java/de/uapcore/lightpit/LightPITModule.java Sun May 10 10:11:10 2020 +0200 3.2 +++ b/src/main/java/de/uapcore/lightpit/LightPITModule.java Sun May 10 10:11:37 2020 +0200 3.3 @@ -128,24 +128,13 @@ 3.4 class ELProxy { 3.5 private final String bundleBaseName, modulePath, menuKey, titleKey, nameKey, descKey; 3.6 3.7 - public static ELProxy convert(LightPITModule annotation) { 3.8 - return new ELProxy( 3.9 - annotation.bundleBaseName(), 3.10 - annotation.modulePath(), 3.11 - annotation.menuKey(), 3.12 - annotation.titleKey(), 3.13 - annotation.nameKey(), 3.14 - annotation.descKey() 3.15 - ); 3.16 - } 3.17 - 3.18 - private ELProxy(String bundleBaseName, String modulePath, String menuKey, String titleKey, String nameKey, String descKey) { 3.19 - this.bundleBaseName = bundleBaseName; 3.20 - this.modulePath = modulePath; 3.21 - this.menuKey = menuKey; 3.22 - this.titleKey = titleKey; 3.23 - this.nameKey = nameKey; 3.24 - this.descKey = descKey; 3.25 + public ELProxy(LightPITModule annotation) { 3.26 + bundleBaseName = annotation.bundleBaseName(); 3.27 + modulePath = annotation.modulePath(); 3.28 + menuKey = annotation.menuKey(); 3.29 + titleKey = annotation.titleKey(); 3.30 + nameKey = annotation.nameKey(); 3.31 + descKey = annotation.descKey(); 3.32 } 3.33 3.34 public String getBundleBaseName() {
4.1 --- a/src/main/java/de/uapcore/lightpit/Menu.java Sun May 10 10:11:10 2020 +0200 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,98 +0,0 @@ 4.4 -/* 4.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4.6 - * 4.7 - * Copyright 2018 Mike Becker. All rights reserved. 4.8 - * 4.9 - * Redistribution and use in source and binary forms, with or without 4.10 - * modification, are permitted provided that the following conditions are met: 4.11 - * 4.12 - * 1. Redistributions of source code must retain the above copyright 4.13 - * notice, this list of conditions and the following disclaimer. 4.14 - * 4.15 - * 2. Redistributions in binary form must reproduce the above copyright 4.16 - * notice, this list of conditions and the following disclaimer in the 4.17 - * documentation and/or other materials provided with the distribution. 4.18 - * 4.19 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 4.20 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 4.21 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 4.22 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 4.23 - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 4.24 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 4.25 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 4.26 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 4.27 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 4.28 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4.29 - * POSSIBILITY OF SUCH DAMAGE. 4.30 - * 4.31 - */ 4.32 -package de.uapcore.lightpit; 4.33 - 4.34 -import java.util.ArrayList; 4.35 -import java.util.Collections; 4.36 -import java.util.List; 4.37 - 4.38 -/** 4.39 - * Maps a resource key for the menu label to the path name for the underlying 4.40 - * site. 4.41 - * <p> 4.42 - * Objects of this class are internally instantiated by the 4.43 - * {@link ModuleManager}. 4.44 - */ 4.45 -public class Menu extends MenuEntry { 4.46 - 4.47 - private final List<MenuEntry> entries = new ArrayList<>(); 4.48 - private final List<MenuEntry> immutableEntries = Collections.unmodifiableList(entries); 4.49 - 4.50 - /** 4.51 - * Class name of the module for which this menu is built. 4.52 - */ 4.53 - private String moduleClassName; 4.54 - 4.55 - 4.56 - public Menu() { 4.57 - super(); 4.58 - } 4.59 - 4.60 - public Menu(String moduleClassName, ResourceKey resourceKey, String pathName) { 4.61 - super(resourceKey, pathName); 4.62 - this.moduleClassName = moduleClassName; 4.63 - } 4.64 - 4.65 - public void setModuleClassName(String moduleClassName) { 4.66 - this.moduleClassName = moduleClassName; 4.67 - } 4.68 - 4.69 - public String getModuleClassName() { 4.70 - return moduleClassName; 4.71 - } 4.72 - 4.73 - /** 4.74 - * Sets a new list of menu entries for this menu. 4.75 - * 4.76 - * @param entries the list of new menu entries 4.77 - */ 4.78 - public void setEntries(List<MenuEntry> entries) { 4.79 - // in case the given list is immutable, we copy the contents 4.80 - this.entries.clear(); 4.81 - this.entries.addAll(entries); 4.82 - } 4.83 - 4.84 - /** 4.85 - * Retrieves an immutable list of menu entries for this menu. 4.86 - * 4.87 - * @return the list of menu entries 4.88 - */ 4.89 - public List<MenuEntry> getEntries() { 4.90 - return immutableEntries; 4.91 - } 4.92 - 4.93 - /** 4.94 - * Adds a new menu entry to this menu. 4.95 - * 4.96 - * @param entry the menu entry to add 4.97 - */ 4.98 - public void addMenuEntry(MenuEntry entry) { 4.99 - entries.add(entry); 4.100 - } 4.101 -}
5.1 --- a/src/main/java/de/uapcore/lightpit/MenuEntry.java Sun May 10 10:11:10 2020 +0200 5.2 +++ b/src/main/java/de/uapcore/lightpit/MenuEntry.java Sun May 10 10:11:37 2020 +0200 5.3 @@ -28,6 +28,8 @@ 5.4 */ 5.5 package de.uapcore.lightpit; 5.6 5.7 +import java.util.Objects; 5.8 + 5.9 /** 5.10 * Maps a resource key for the menu label to the path name for the underlying 5.11 * site. 5.12 @@ -35,40 +37,67 @@ 5.13 * Objects of this class are internally instantiated by the 5.14 * {@link ModuleManager}. 5.15 */ 5.16 -public class MenuEntry { 5.17 +public class MenuEntry implements Comparable<MenuEntry> { 5.18 + 5.19 + /** 5.20 + * Class name of the module for which this menu is built. 5.21 + */ 5.22 + private final String moduleClassName; 5.23 5.24 /** 5.25 * Resource key for the menu label. 5.26 */ 5.27 - private ResourceKey resourceKey; 5.28 + private final ResourceKey resourceKey; 5.29 5.30 /** 5.31 * Path name of the module, linked by this menu entry. 5.32 */ 5.33 - private String pathName; 5.34 + private final String pathName; 5.35 5.36 - public MenuEntry() { 5.37 + /** 5.38 + * Sequence number to determine the ordering of the menu. 5.39 + */ 5.40 + private final int sequence; 5.41 + 5.42 + public MenuEntry(String moduleClassName, ResourceKey resourceKey, String pathName, int sequence) { 5.43 + this.moduleClassName = moduleClassName; 5.44 + this.resourceKey = resourceKey; 5.45 + this.pathName = pathName; 5.46 + this.sequence = sequence; 5.47 } 5.48 5.49 - public MenuEntry(ResourceKey resourceKey, String pathName) { 5.50 - this.resourceKey = resourceKey; 5.51 - this.pathName = pathName; 5.52 - } 5.53 - 5.54 - public void setResourceKey(ResourceKey resourceKey) { 5.55 - this.resourceKey = resourceKey; 5.56 + public String getModuleClassName() { 5.57 + return moduleClassName; 5.58 } 5.59 5.60 public ResourceKey getResourceKey() { 5.61 return resourceKey; 5.62 } 5.63 5.64 - public void setPathName(String pathName) { 5.65 - this.pathName = pathName; 5.66 - } 5.67 - 5.68 public String getPathName() { 5.69 return pathName; 5.70 } 5.71 5.72 + public int getSequence() { 5.73 + return sequence; 5.74 + } 5.75 + 5.76 + @Override 5.77 + public boolean equals(Object o) { 5.78 + if (this == o) return true; 5.79 + if (o == null || getClass() != o.getClass()) return false; 5.80 + MenuEntry menuEntry = (MenuEntry) o; 5.81 + return resourceKey.equals(menuEntry.resourceKey) && 5.82 + pathName.equals(menuEntry.pathName); 5.83 + } 5.84 + 5.85 + @Override 5.86 + public int hashCode() { 5.87 + return Objects.hash(resourceKey, pathName); 5.88 + } 5.89 + 5.90 + @Override 5.91 + public int compareTo(MenuEntry menuEntry) { 5.92 + return Integer.compare(this.sequence, menuEntry.sequence); 5.93 + } 5.94 }
6.1 --- a/src/main/java/de/uapcore/lightpit/ModuleManager.java Sun May 10 10:11:10 2020 +0200 6.2 +++ b/src/main/java/de/uapcore/lightpit/ModuleManager.java Sun May 10 10:11:37 2020 +0200 6.3 @@ -28,7 +28,6 @@ 6.4 */ 6.5 package de.uapcore.lightpit; 6.6 6.7 -import de.uapcore.lightpit.entities.Module; 6.8 import org.slf4j.Logger; 6.9 import org.slf4j.LoggerFactory; 6.10 6.11 @@ -37,11 +36,7 @@ 6.12 import javax.servlet.ServletContextEvent; 6.13 import javax.servlet.ServletContextListener; 6.14 import javax.servlet.annotation.WebListener; 6.15 -import java.sql.Connection; 6.16 -import java.sql.SQLException; 6.17 import java.util.*; 6.18 -import java.util.concurrent.atomic.AtomicBoolean; 6.19 -import java.util.stream.Collectors; 6.20 6.21 /** 6.22 * Scans registered servlets for LightPIT modules. 6.23 @@ -63,9 +58,9 @@ 6.24 private final Map<String, LightPITModule> registeredModules = new HashMap<>(); 6.25 6.26 /** 6.27 - * This flag is true, when synchronization is needed. 6.28 + * Contains the menu entries for the loaded modules. 6.29 */ 6.30 - private final AtomicBoolean dirty = new AtomicBoolean(true); 6.31 + private final List<MenuEntry> mainMenu = new ArrayList<>(); 6.32 6.33 @Override 6.34 public void contextInitialized(ServletContextEvent sce) { 6.35 @@ -132,44 +127,12 @@ 6.36 public void reloadAll() { 6.37 registeredModules.clear(); 6.38 sc.getServletRegistrations().forEach(this::handleServletRegistration); 6.39 + createMainMenu(); 6.40 6.41 - // TODO: implement dependency resolver 6.42 - 6.43 - dirty.set(true); 6.44 LOG.info("Modules loaded."); 6.45 } 6.46 6.47 /** 6.48 - * Synchronizes module information with the database. 6.49 - * <p> 6.50 - * This must be called from the {@link AbstractLightPITServlet}. 6.51 - * Admittedly the call will perform the synchronization once after reload 6.52 - * and be a no-op, afterwards. 6.53 - * However, since the DatabaseFacade might be loaded after the module 6.54 - * manager, we must defer the synchronization to the first request 6.55 - * handled by the Servlet. 6.56 - * 6.57 - * @param db interface to the database 6.58 - */ 6.59 - public void syncWithDatabase(DatabaseFacade db) { 6.60 - if (dirty.compareAndSet(true, false)) { 6.61 - if (db.getDataSource().isPresent()) { 6.62 - try (Connection conn = db.getDataSource().get().getConnection()) { 6.63 - db.getDataAccessObjects() 6.64 - .getModuleDao() 6.65 - .syncRegisteredModuleClasses(conn, registeredModules.entrySet()); 6.66 - } catch (SQLException ex) { 6.67 - LOG.error("Unexpected SQL Exception", ex); 6.68 - } 6.69 - } else { 6.70 - LOG.error("No datasource present. Cannot sync module information with database."); 6.71 - } 6.72 - } else { 6.73 - LOG.trace("Module information clean - no synchronization required."); 6.74 - } 6.75 - } 6.76 - 6.77 - /** 6.78 * Unloads all found modules. 6.79 */ 6.80 public void unloadAll() { 6.81 @@ -178,46 +141,30 @@ 6.82 } 6.83 6.84 /** 6.85 - * Returns the main menu. 6.86 - * 6.87 - * @param db the interface to the database 6.88 - * @return a list of menus belonging to the main menu 6.89 + * Populates the main menu based on the registered modules. 6.90 */ 6.91 - public List<Menu> getMainMenu(DatabaseFacade db) { 6.92 - // TODO: user specific menu 6.93 - 6.94 - if (db.getDataSource().isPresent()) { 6.95 - try (Connection conn = db.getDataSource().get().getConnection()) { 6.96 - final List<Module> modules = db.getDataAccessObjects().getModuleDao().list(conn); 6.97 - 6.98 - return modules 6.99 - .stream() 6.100 - .filter(Module::isVisible) 6.101 - .sorted(new Module.PriorityComparator()) 6.102 - .map(mod -> new Menu( 6.103 - mod.getClassname(), 6.104 - new ResourceKey( 6.105 - registeredModules.get(mod.getClassname()).bundleBaseName(), 6.106 - registeredModules.get(mod.getClassname()).menuKey()), 6.107 - registeredModules.get(mod.getClassname()).modulePath())) 6.108 - .collect(Collectors.toList()); 6.109 - } catch (SQLException ex) { 6.110 - LOG.error("Unexpected SQLException when loading the main menu", ex); 6.111 - return Collections.emptyList(); 6.112 - } 6.113 - } else { 6.114 - return Collections.emptyList(); 6.115 - } 6.116 + private void createMainMenu() { 6.117 + mainMenu.clear(); 6.118 + registeredModules.entrySet() 6.119 + .stream() 6.120 + .filter(mod -> !mod.getValue().systemModule()) 6.121 + .map(mod -> new MenuEntry( 6.122 + mod.getKey(), 6.123 + new ResourceKey( 6.124 + mod.getValue().bundleBaseName(), 6.125 + mod.getValue().menuKey()), 6.126 + mod.getValue().modulePath(), 6.127 + mod.getValue().defaultPriority())) 6.128 + .sorted() 6.129 + .forEachOrdered(mainMenu::add); 6.130 } 6.131 6.132 /** 6.133 - * Returns an unmodifiable map of all registered modules. 6.134 - * <p> 6.135 - * The key is the classname of the module. 6.136 + * Returns the main menu. 6.137 * 6.138 - * @return the map of registered modules 6.139 + * @return a list of menu items 6.140 */ 6.141 - public Map<String, LightPITModule> getRegisteredModules() { 6.142 - return Collections.unmodifiableMap(registeredModules); 6.143 + public List<MenuEntry> getMainMenu() { 6.144 + return Collections.unmodifiableList(mainMenu); 6.145 } 6.146 }
7.1 --- a/src/main/java/de/uapcore/lightpit/dao/DataAccessObjects.java Sun May 10 10:11:10 2020 +0200 7.2 +++ b/src/main/java/de/uapcore/lightpit/dao/DataAccessObjects.java Sun May 10 10:11:37 2020 +0200 7.3 @@ -29,8 +29,5 @@ 7.4 package de.uapcore.lightpit.dao; 7.5 7.6 public interface DataAccessObjects { 7.7 - 7.8 - ModuleDao getModuleDao(); 7.9 - 7.10 UserDao getUserDao(); 7.11 }
8.1 --- a/src/main/java/de/uapcore/lightpit/dao/ModuleDao.java Sun May 10 10:11:10 2020 +0200 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,52 +0,0 @@ 8.4 -/* 8.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 8.6 - * 8.7 - * Copyright 2018 Mike Becker. All rights reserved. 8.8 - * 8.9 - * Redistribution and use in source and binary forms, with or without 8.10 - * modification, are permitted provided that the following conditions are met: 8.11 - * 8.12 - * 1. Redistributions of source code must retain the above copyright 8.13 - * notice, this list of conditions and the following disclaimer. 8.14 - * 8.15 - * 2. Redistributions in binary form must reproduce the above copyright 8.16 - * notice, this list of conditions and the following disclaimer in the 8.17 - * documentation and/or other materials provided with the distribution. 8.18 - * 8.19 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 8.20 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 8.21 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 8.22 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 8.23 - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 8.24 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 8.25 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 8.26 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 8.27 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 8.28 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 8.29 - * POSSIBILITY OF SUCH DAMAGE. 8.30 - * 8.31 - */ 8.32 -package de.uapcore.lightpit.dao; 8.33 - 8.34 -import de.uapcore.lightpit.LightPITModule; 8.35 -import de.uapcore.lightpit.entities.Module; 8.36 - 8.37 -import java.sql.Connection; 8.38 -import java.sql.SQLException; 8.39 -import java.util.Map; 8.40 -import java.util.Set; 8.41 - 8.42 -public interface ModuleDao extends GenericDao<Module> { 8.43 - 8.44 - /** 8.45 - * Synchronizes a set of registered module classes with the database. 8.46 - * <p> 8.47 - * Inserts module classes which are not known to the database and sets them to be visible by default. 8.48 - * Module classes known to the database, which are not in the given set, are ignored. 8.49 - * 8.50 - * @param conn the connection to use 8.51 - * @param moduleSet the module set to synchronize 8.52 - * @throws SQLException on any kind of SQL errors 8.53 - */ 8.54 - void syncRegisteredModuleClasses(Connection conn, Set<Map.Entry<String, LightPITModule>> moduleSet) throws SQLException; 8.55 -}
9.1 --- a/src/main/java/de/uapcore/lightpit/dao/postgres/PGDataAccessObjects.java Sun May 10 10:11:10 2020 +0200 9.2 +++ b/src/main/java/de/uapcore/lightpit/dao/postgres/PGDataAccessObjects.java Sun May 10 10:11:37 2020 +0200 9.3 @@ -29,20 +29,13 @@ 9.4 package de.uapcore.lightpit.dao.postgres; 9.5 9.6 import de.uapcore.lightpit.dao.DataAccessObjects; 9.7 -import de.uapcore.lightpit.dao.ModuleDao; 9.8 import de.uapcore.lightpit.dao.UserDao; 9.9 9.10 public class PGDataAccessObjects implements DataAccessObjects { 9.11 9.12 - private final ModuleDao moduleDao = new PGModuleDao(); 9.13 private final UserDao userDao = new PGUserDao(); 9.14 9.15 @Override 9.16 - public ModuleDao getModuleDao() { 9.17 - return moduleDao; 9.18 - } 9.19 - 9.20 - @Override 9.21 public UserDao getUserDao() { 9.22 return userDao; 9.23 }
10.1 --- a/src/main/java/de/uapcore/lightpit/dao/postgres/PGModuleDao.java Sun May 10 10:11:10 2020 +0200 10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 10.3 @@ -1,81 +0,0 @@ 10.4 -/* 10.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 10.6 - * 10.7 - * Copyright 2018 Mike Becker. All rights reserved. 10.8 - * 10.9 - * Redistribution and use in source and binary forms, with or without 10.10 - * modification, are permitted provided that the following conditions are met: 10.11 - * 10.12 - * 1. Redistributions of source code must retain the above copyright 10.13 - * notice, this list of conditions and the following disclaimer. 10.14 - * 10.15 - * 2. Redistributions in binary form must reproduce the above copyright 10.16 - * notice, this list of conditions and the following disclaimer in the 10.17 - * documentation and/or other materials provided with the distribution. 10.18 - * 10.19 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 10.20 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 10.21 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 10.22 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 10.23 - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 10.24 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 10.25 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 10.26 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 10.27 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 10.28 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 10.29 - * POSSIBILITY OF SUCH DAMAGE. 10.30 - * 10.31 - */ 10.32 -package de.uapcore.lightpit.dao.postgres; 10.33 - 10.34 -import de.uapcore.lightpit.LightPITModule; 10.35 -import de.uapcore.lightpit.dao.AbstractDao; 10.36 -import de.uapcore.lightpit.dao.ModuleDao; 10.37 -import de.uapcore.lightpit.entities.Module; 10.38 - 10.39 -import java.sql.Connection; 10.40 -import java.sql.PreparedStatement; 10.41 -import java.sql.ResultSet; 10.42 -import java.sql.SQLException; 10.43 -import java.util.Map; 10.44 -import java.util.Set; 10.45 - 10.46 -public final class PGModuleDao extends AbstractDao<Module> implements ModuleDao { 10.47 - 10.48 - @Override 10.49 - protected PreparedStatement listQuery(Connection connection) throws SQLException { 10.50 - return connection.prepareStatement("select * from lpitcore_module"); 10.51 - } 10.52 - 10.53 - @Override 10.54 - protected Module mapColumns(ResultSet result) throws SQLException { 10.55 - final var mod = new Module(); 10.56 - mod.setModID(result.getInt("modid")); 10.57 - mod.setClassname(result.getString("classname")); 10.58 - mod.setVisible(result.getBoolean("visible")); 10.59 - mod.setPriority(result.getInt("priority")); 10.60 - return mod; 10.61 - } 10.62 - 10.63 - @Override 10.64 - public void syncRegisteredModuleClasses(Connection conn, Set<Map.Entry<String, LightPITModule>> moduleSet) throws SQLException { 10.65 - 10.66 - var check = conn.prepareStatement("select visible from lpitcore_module where classname = ?"); 10.67 - var insert = conn.prepareStatement("insert into lpitcore_module (classname, visible, priority) values (?, ?, ?)"); 10.68 - insert.setBoolean(2, true); 10.69 - // update/delete not required, we do this in the module management UI 10.70 - 10.71 - for (Map.Entry<String, LightPITModule> modEntry : moduleSet) { 10.72 - if (modEntry.getValue().systemModule()) continue; 10.73 - 10.74 - check.setString(1, modEntry.getKey()); 10.75 - try (ResultSet r = check.executeQuery()) { 10.76 - if (!r.next()) { 10.77 - insert.setString(1, modEntry.getKey()); 10.78 - insert.setInt(3, modEntry.getValue().defaultPriority()); 10.79 - insert.executeUpdate(); 10.80 - } 10.81 - } 10.82 - } 10.83 - } 10.84 -}
11.1 --- a/src/main/java/de/uapcore/lightpit/entities/Module.java Sun May 10 10:11:10 2020 +0200 11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 11.3 @@ -1,114 +0,0 @@ 11.4 -/* 11.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 11.6 - * 11.7 - * Copyright 2018 Mike Becker. All rights reserved. 11.8 - * 11.9 - * Redistribution and use in source and binary forms, with or without 11.10 - * modification, are permitted provided that the following conditions are met: 11.11 - * 11.12 - * 1. Redistributions of source code must retain the above copyright 11.13 - * notice, this list of conditions and the following disclaimer. 11.14 - * 11.15 - * 2. Redistributions in binary form must reproduce the above copyright 11.16 - * notice, this list of conditions and the following disclaimer in the 11.17 - * documentation and/or other materials provided with the distribution. 11.18 - * 11.19 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 11.20 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 11.21 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 11.22 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 11.23 - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 11.24 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 11.25 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 11.26 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 11.27 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 11.28 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 11.29 - * POSSIBILITY OF SUCH DAMAGE. 11.30 - * 11.31 - */ 11.32 -package de.uapcore.lightpit.entities; 11.33 - 11.34 -import de.uapcore.lightpit.LightPITModule; 11.35 - 11.36 -import java.util.Comparator; 11.37 - 11.38 -public final class Module { 11.39 - private int modID; 11.40 - private String classname; 11.41 - private boolean visible; 11.42 - private int priority; 11.43 - 11.44 - private LightPITModule.ELProxy annotatedInfos; 11.45 - 11.46 - public int getModID() { 11.47 - return modID; 11.48 - } 11.49 - 11.50 - public void setModID(int modID) { 11.51 - this.modID = modID; 11.52 - } 11.53 - 11.54 - public String getClassname() { 11.55 - return classname; 11.56 - } 11.57 - 11.58 - public void setClassname(String classname) { 11.59 - this.classname = classname; 11.60 - } 11.61 - 11.62 - public boolean isVisible() { 11.63 - return visible; 11.64 - } 11.65 - 11.66 - public void setVisible(boolean visible) { 11.67 - this.visible = visible; 11.68 - } 11.69 - 11.70 - public int getPriority() { 11.71 - return priority; 11.72 - } 11.73 - 11.74 - public void setPriority(int priority) { 11.75 - this.priority = priority; 11.76 - } 11.77 - 11.78 - public LightPITModule.ELProxy getAnnotatedInfos() { 11.79 - return annotatedInfos; 11.80 - } 11.81 - 11.82 - public void setAnnotatedInfos(LightPITModule.ELProxy annotatedInfos) { 11.83 - this.annotatedInfos = annotatedInfos; 11.84 - } 11.85 - 11.86 - @Override 11.87 - public int hashCode() { 11.88 - int hash = 3; 11.89 - hash = 41 * hash + this.modID; 11.90 - return hash; 11.91 - } 11.92 - 11.93 - @Override 11.94 - public boolean equals(Object obj) { 11.95 - if (this == obj) { 11.96 - return true; 11.97 - } 11.98 - if (obj == null || getClass() != obj.getClass()) { 11.99 - return false; 11.100 - } else { 11.101 - return this.modID == ((Module) obj).modID; 11.102 - } 11.103 - } 11.104 - 11.105 - public static final class PriorityComparator implements Comparator<Module> { 11.106 - 11.107 - @Override 11.108 - public int compare(Module left, Module right) { 11.109 - return Integer.compare(left.priority, right.priority); 11.110 - } 11.111 - 11.112 - @Override 11.113 - public boolean equals(Object o) { 11.114 - return o instanceof PriorityComparator; 11.115 - } 11.116 - } 11.117 -}
12.1 --- a/src/main/java/de/uapcore/lightpit/modules/ModuleManagerModule.java Sun May 10 10:11:10 2020 +0200 12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 12.3 @@ -1,92 +0,0 @@ 12.4 -/* 12.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 12.6 - * 12.7 - * Copyright 2018 Mike Becker. All rights reserved. 12.8 - * 12.9 - * Redistribution and use in source and binary forms, with or without 12.10 - * modification, are permitted provided that the following conditions are met: 12.11 - * 12.12 - * 1. Redistributions of source code must retain the above copyright 12.13 - * notice, this list of conditions and the following disclaimer. 12.14 - * 12.15 - * 2. Redistributions in binary form must reproduce the above copyright 12.16 - * notice, this list of conditions and the following disclaimer in the 12.17 - * documentation and/or other materials provided with the distribution. 12.18 - * 12.19 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12.20 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 12.21 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 12.22 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 12.23 - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 12.24 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 12.25 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 12.26 - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 12.27 - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 12.28 - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 12.29 - * POSSIBILITY OF SUCH DAMAGE. 12.30 - * 12.31 - */ 12.32 -package de.uapcore.lightpit.modules; 12.33 - 12.34 -import de.uapcore.lightpit.*; 12.35 -import de.uapcore.lightpit.LightPITModule.ELProxy; 12.36 -import de.uapcore.lightpit.entities.Module; 12.37 -import org.slf4j.Logger; 12.38 -import org.slf4j.LoggerFactory; 12.39 - 12.40 -import javax.servlet.annotation.WebServlet; 12.41 -import javax.servlet.http.HttpServletRequest; 12.42 -import javax.servlet.http.HttpServletResponse; 12.43 -import javax.sql.DataSource; 12.44 -import java.io.IOException; 12.45 -import java.sql.Connection; 12.46 -import java.sql.SQLException; 12.47 -import java.util.List; 12.48 -import java.util.Map; 12.49 -import java.util.Optional; 12.50 - 12.51 -/** 12.52 - * Entry point for the application. 12.53 - */ 12.54 -@LightPITModule( 12.55 - bundleBaseName = "localization.modmgmt", 12.56 - modulePath = "modmgmt", 12.57 - defaultPriority = 21000 12.58 -) 12.59 -@WebServlet( 12.60 - name = "ModuleManagerModule", 12.61 - urlPatterns = "/modmgmt/*" 12.62 -) 12.63 -public final class ModuleManagerModule extends AbstractLightPITServlet { 12.64 - 12.65 - private static final Logger LOG = LoggerFactory.getLogger(ModuleManagerModule.class); 12.66 - 12.67 - private static final String REQ_ATTR_MODULES = "modules"; 12.68 - 12.69 - 12.70 - @RequestMapping(method = HttpMethod.GET) 12.71 - public ResponseType handle(HttpServletRequest req, HttpServletResponse resp) throws IOException { 12.72 - 12.73 - DatabaseFacade db = getDatabaseFacade(); 12.74 - Optional<DataSource> ds = db.getDataSource(); 12.75 - if (ds.isPresent()) { 12.76 - try (Connection conn = ds.get().getConnection()) { 12.77 - final List<Module> modules = db.getDataAccessObjects().getModuleDao().list(conn); 12.78 - 12.79 - final Map<String, LightPITModule> registeredModules = getModuleManager().getRegisteredModules(); 12.80 - modules.forEach((mod) -> mod.setAnnotatedInfos(ELProxy.convert(registeredModules.get(mod.getClassname())))); 12.81 - 12.82 - req.setAttribute(REQ_ATTR_MODULES, modules); 12.83 - setDynamicFragment(req, "modules"); 12.84 - return ResponseType.HTML_FULL; 12.85 - } catch (SQLException ex) { 12.86 - LOG.error("Unexpected SQL Exception", ex); 12.87 - resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 12.88 - return ResponseType.NONE; 12.89 - } 12.90 - } else { 12.91 - resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 12.92 - return ResponseType.NONE; 12.93 - } 12.94 - } 12.95 -}
13.1 --- a/src/main/java/de/uapcore/lightpit/modules/VersionsModule.java Sun May 10 10:11:10 2020 +0200 13.2 +++ b/src/main/java/de/uapcore/lightpit/modules/VersionsModule.java Sun May 10 10:11:37 2020 +0200 13.3 @@ -37,7 +37,8 @@ 13.4 13.5 @LightPITModule( 13.6 bundleBaseName = "localization.versions", 13.7 - modulePath = "versions" 13.8 + modulePath = "versions", 13.9 + defaultPriority = 50 13.10 ) 13.11 @WebServlet( 13.12 name = "VersionsModule",
14.1 --- a/src/main/resources/localization/modmgmt.properties Sun May 10 10:11:10 2020 +0200 14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 14.3 @@ -1,36 +0,0 @@ 14.4 -# Copyright 2018 Mike Becker. All rights reserved. 14.5 -# 14.6 -# Redistribution and use in source and binary forms, with or without 14.7 -# modification, are permitted provided that the following conditions are met: 14.8 -# 14.9 -# 1. Redistributions of source code must retain the above copyright 14.10 -# notice, this list of conditions and the following disclaimer. 14.11 -# 14.12 -# 2. Redistributions in binary form must reproduce the above copyright 14.13 -# notice, this list of conditions and the following disclaimer in the 14.14 -# documentation and/or other materials provided with the distribution. 14.15 -# 14.16 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14.17 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14.18 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 14.19 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 14.20 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 14.21 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 14.22 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 14.23 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 14.24 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14.25 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14.26 - 14.27 -name = Module Management 14.28 -description = Configure the visible LightPIT modules and the required access powers. 14.29 -menuLabel = Modules 14.30 - 14.31 -section.modlist.title = List of Modules 14.32 - 14.33 -caption.module = Module 14.34 -caption.path = Path 14.35 -caption.desc = Description 14.36 -caption.active = Active 14.37 -caption.class = Class 14.38 -caption.bundle = Resource Bundle 14.39 -
15.1 --- a/src/main/resources/localization/modmgmt_de.properties Sun May 10 10:11:10 2020 +0200 15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 15.3 @@ -1,35 +0,0 @@ 15.4 -# Copyright 2018 Mike Becker. All rights reserved. 15.5 -# 15.6 -# Redistribution and use in source and binary forms, with or without 15.7 -# modification, are permitted provided that the following conditions are met: 15.8 -# 15.9 -# 1. Redistributions of source code must retain the above copyright 15.10 -# notice, this list of conditions and the following disclaimer. 15.11 -# 15.12 -# 2. Redistributions in binary form must reproduce the above copyright 15.13 -# notice, this list of conditions and the following disclaimer in the 15.14 -# documentation and/or other materials provided with the distribution. 15.15 -# 15.16 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15.17 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.18 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 15.19 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 15.20 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 15.21 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 15.22 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 15.23 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 15.24 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15.25 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15.26 - 15.27 -name = Modulverwaltung 15.28 -description = Konfiguration der sichtbaren LightPIT Module und deren Zugriffsrechte. 15.29 -menuLabel = Module 15.30 - 15.31 -section.modlist.title = Liste der Module 15.32 - 15.33 -caption.module = Modul 15.34 -caption.path = Pfad 15.35 -caption.desc = Beschreibung 15.36 -caption.active = Aktiv 15.37 -caption.class = Klasse 15.38 -caption.bundle = Ressourcen-Datei
16.1 --- a/src/main/webapp/WEB-INF/dynamic_fragments/modules.jsp Sun May 10 10:11:10 2020 +0200 16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 16.3 @@ -1,54 +0,0 @@ 16.4 -<%-- 16.5 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 16.6 - 16.7 -Copyright 2018 Mike Becker. All rights reserved. 16.8 - 16.9 -Redistribution and use in source and binary forms, with or without 16.10 -modification, are permitted provided that the following conditions are met: 16.11 - 16.12 -1. Redistributions of source code must retain the above copyright 16.13 -notice, this list of conditions and the following disclaimer. 16.14 - 16.15 -2. Redistributions in binary form must reproduce the above copyright 16.16 -notice, this list of conditions and the following disclaimer in the 16.17 -documentation and/or other materials provided with the distribution. 16.18 - 16.19 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16.20 -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.21 -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16.22 -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 16.23 -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 16.24 -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 16.25 -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 16.26 -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 16.27 -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16.28 -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16.29 ---%> 16.30 -<%@page pageEncoding="UTF-8" session="true" %> 16.31 -<%@page import="de.uapcore.lightpit.Constants" %> 16.32 -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 16.33 -<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 16.34 - 16.35 -<h2><fmt:message key="section.modlist.title"/></h2> 16.36 -<table class="datatable"> 16.37 - <tr> 16.38 - <th class="hcenter"><fmt:message key="caption.active" /></th> 16.39 - <th><fmt:message key="caption.module" /></th> 16.40 - <th><fmt:message key="caption.path" /></th> 16.41 - <th><fmt:message key="caption.desc" /></th> 16.42 - <th><fmt:message key="caption.class" /></th> 16.43 - <th><fmt:message key="caption.bundle" /></th> 16.44 - </tr> 16.45 - <c:forEach items="${modules}" var="module"> 16.46 - <tr> 16.47 - <td class="hcenter">${module.visible}</td> 16.48 - <fmt:bundle basename="${module.annotatedInfos.bundleBaseName}"> 16.49 - <td class="nowrap"><fmt:message key="${module.annotatedInfos.nameKey}" /></td> 16.50 - <td>/${module.annotatedInfos.modulePath}</td> 16.51 - <td><fmt:message key="${module.annotatedInfos.descKey}" /></td> 16.52 - <td class="smalltext">${module.classname}</td> 16.53 - <td class="smalltext">${module.annotatedInfos.bundleBaseName}</td> 16.54 - </fmt:bundle> 16.55 - </tr> 16.56 - </c:forEach> 16.57 -</table> 16.58 \ No newline at end of file
17.1 --- a/src/main/webapp/language.css Sun May 10 10:11:10 2020 +0200 17.2 +++ b/src/main/webapp/language.css Sun May 10 10:11:37 2020 +0200 17.3 @@ -38,6 +38,7 @@ 17.4 margin: .5em; 17.5 } 17.6 17.7 +/* browser language not available */ 17.8 span.blNA { 17.9 margin: .5em; 17.10 color: red;