Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java @ 8203:238fc722f87a
sed 's/logger/log/g' src/**/*.java
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 13:19:22 +0200 |
parents | 350a7cf09fbc |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8202:e4606eae8ea5 | 8203:238fc722f87a |
---|---|
31 | 31 |
32 public class ModuleServiceImpl | 32 public class ModuleServiceImpl |
33 extends RemoteServiceServlet | 33 extends RemoteServiceServlet |
34 implements ModuleService | 34 implements ModuleService |
35 { | 35 { |
36 private static final Logger logger = | 36 private static final Logger log = |
37 Logger.getLogger(ModuleServiceImpl.class); | 37 Logger.getLogger(ModuleServiceImpl.class); |
38 | 38 |
39 public static final String XPATH_MODULES = "/art:modules/art:module"; | 39 public static final String XPATH_MODULES = "/art:modules/art:module"; |
40 | 40 |
41 public static final String ERROR_NO_MODULES_FOUND = | 41 public static final String ERROR_NO_MODULES_FOUND = |
43 | 43 |
44 @Override | 44 @Override |
45 public Module[] list(String locale) throws ServerException { | 45 public Module[] list(String locale) throws ServerException { |
46 User user = this.getUser(); | 46 User user = this.getUser(); |
47 | 47 |
48 logger.info("ModuleService.list"); | 48 log.info("ModuleService.list"); |
49 | 49 |
50 String url = getServletContext().getInitParameter("server-url"); | 50 String url = getServletContext().getInitParameter("server-url"); |
51 | 51 |
52 // create dummy xml | 52 // create dummy xml |
53 Document doc = XMLUtils.newDocument(); | 53 Document doc = XMLUtils.newDocument(); |
69 XPATH_MODULES, | 69 XPATH_MODULES, |
70 XPathConstants.NODESET, | 70 XPathConstants.NODESET, |
71 ArtifactNamespaceContext.INSTANCE); | 71 ArtifactNamespaceContext.INSTANCE); |
72 | 72 |
73 if (list == null) { | 73 if (list == null) { |
74 logger.warn("No modules found."); | 74 log.warn("No modules found."); |
75 | 75 |
76 throw new ServerException(ERROR_NO_MODULES_FOUND); | 76 throw new ServerException(ERROR_NO_MODULES_FOUND); |
77 } | 77 } |
78 | 78 |
79 int num = list.getLength(); | 79 int num = list.getLength(); |
93 List<String> riverUuids = new ArrayList<String>(); | 93 List<String> riverUuids = new ArrayList<String>(); |
94 for (int j = 0; j < rivers.getLength(); j++) { | 94 for (int j = 0; j < rivers.getLength(); j++) { |
95 Element re = (Element)rivers.item(j); | 95 Element re = (Element)rivers.item(j); |
96 riverUuids.add(re.getAttribute("uuid")); | 96 riverUuids.add(re.getAttribute("uuid")); |
97 } | 97 } |
98 logger.debug("Found module " + name + " " + localname); | 98 log.debug("Found module " + name + " " + localname); |
99 if (user == null || user.canUseFeature("module:" + name)) { | 99 if (user == null || user.canUseFeature("module:" + name)) { |
100 modules.add(new DefaultModule(name, localname, selected, riverUuids)); | 100 modules.add(new DefaultModule(name, localname, selected, riverUuids)); |
101 } | 101 } |
102 } | 102 } |
103 return modules.toArray(new Module[modules.size()]); | 103 return modules.toArray(new Module[modules.size()]); |
104 } | 104 } |
105 catch (ConnectionException ce) { | 105 catch (ConnectionException ce) { |
106 logger.error(ce, ce); | 106 log.error(ce, ce); |
107 } | 107 } |
108 | 108 |
109 throw new ServerException(ERROR_NO_MODULES_FOUND); | 109 throw new ServerException(ERROR_NO_MODULES_FOUND); |
110 } | 110 } |
111 } | 111 } |