src/java/de/uapcore/lightpit/ModuleManager.java

changeset 18
a94b172c3a93
parent 11
737ab27e37b3
child 20
bd1a76c91d5b
--- a/src/java/de/uapcore/lightpit/ModuleManager.java	Sat Dec 30 20:41:55 2017 +0100
+++ b/src/java/de/uapcore/lightpit/ModuleManager.java	Sun Dec 31 17:43:39 2017 +0100
@@ -31,6 +31,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import java.util.Optional;
 import javax.servlet.Registration;
 import javax.servlet.ServletContext;
@@ -118,10 +119,12 @@
     
     private void handleServletRegistration(String name, Registration reg) {
         final Optional<LightPITModule> moduleInfo = getModuleInfo(reg);
-        if (moduleInfo.isPresent()) {
+        if (moduleInfo.isPresent()) {            
+            // TODO: implement dependency resolver
             
-            // TODO: remove this call and add the module to some dependency resolver, first
-            addModuleToMenu(reg.getClassName(), moduleInfo.get());
+            if (!moduleInfo.get().menuKey().isEmpty()) {
+                addModuleToMenu(reg.getClassName(), moduleInfo.get());
+            }
             
             LOG.info("Module detected: {}", name);
         } else {

mercurial