diff --git a/ui/src/main/java/org/open4goods/ui/controllers/ui/AbstractUiController.java b/ui/src/main/java/org/open4goods/ui/controllers/ui/AbstractUiController.java index 5e524a7bd..a4385441c 100644 --- a/ui/src/main/java/org/open4goods/ui/controllers/ui/AbstractUiController.java +++ b/ui/src/main/java/org/open4goods/ui/controllers/ui/AbstractUiController.java @@ -1,6 +1,5 @@ package org.open4goods.ui.controllers.ui; -import java.io.File; import java.io.IOException; import java.util.Locale; import java.util.Random; @@ -14,6 +13,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; +import org.springframework.core.env.Profiles; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.ResourcePatternResolver; @@ -35,6 +35,7 @@ public class AbstractUiController { private @Autowired UiConfig config; private @Autowired XwikiService xwikiService; + // Used to load Datasource configurations from classpath @@ -42,7 +43,7 @@ public class AbstractUiController { private static final ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(cl); private int maxImg; - // TODO : in a service (hot, controllers are multiply ionstanciated) + // TODO : in a service (hot, controllers are multiply instanciated) @PostConstruct public void init() { try { @@ -53,12 +54,10 @@ public void init() { } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - - - + } } + /** * Instanciates a ModelAndView and prefills pageNumber conf and pageNumber httpRequest * with :
@@ -92,13 +91,9 @@ protected ModelAndView defaultModelAndView(final String tpl, final HttpServletRe ret.addObject("config",config); - ret.addObject("dev", env.acceptsProfiles("dev","devsec")); + ret.addObject("dev", env.acceptsProfiles(Profiles.of("dev","devsec"))); ret.addObject("url",request.getRequestURL().toString() ); - - ret.addObject("loaderImg",loaderImage() ); - - ret.addObject("baseUrl",config.getBaseUrl(request.getLocale())); @@ -131,7 +126,6 @@ protected ModelAndView defaultModelAndView(final String tpl, final HttpServletRe return ret; } - public String loaderImage() { Random random = new Random(); int nb; @@ -139,5 +133,4 @@ public String loaderImage() { return "/assets/img/loader/"+nb+".jpg"; } - -} +} \ No newline at end of file