comparison artifacts/src/main/java/org/dive4elements/river/artifacts/MapArtifact.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents 8d5ca5175038
children 5e38e2924c07
comparison
equal deleted inserted replaced
8201:4b8c5a08de04 8202:e4606eae8ea5
32 import org.w3c.dom.Element; 32 import org.w3c.dom.Element;
33 33
34 34
35 public class MapArtifact extends D4EArtifact { 35 public class MapArtifact extends D4EArtifact {
36 36
37 private static final Logger logger = 37 private static final Logger log =
38 Logger.getLogger(MapArtifact.class); 38 Logger.getLogger(MapArtifact.class);
39 39
40 @Override 40 @Override
41 public void setup( 41 public void setup(
42 String identifier, 42 String identifier,
44 Object context, 44 Object context,
45 CallMeta callmeta, 45 CallMeta callmeta,
46 Document data, 46 Document data,
47 List<Class> loadFacets) 47 List<Class> loadFacets)
48 { 48 {
49 logger.debug("MapArtifact.setup"); 49 log.debug("MapArtifact.setup");
50 this.identifier = identifier; 50 this.identifier = identifier;
51 name = "new_map"; 51 name = "new_map";
52 52
53 List<State> states = getStates(context); 53 List<State> states = getStates(context);
54 54
91 RiverContext flysContext = RiverUtils.getFlysContext(context); 91 RiverContext flysContext = RiverUtils.getFlysContext(context);
92 StateEngine engine = (StateEngine) flysContext.get( 92 StateEngine engine = (StateEngine) flysContext.get(
93 RiverContext.STATE_ENGINE_KEY); 93 RiverContext.STATE_ENGINE_KEY);
94 94
95 for (String stateId: stateIds) { 95 for (String stateId: stateIds) {
96 logger.debug("Append output modes for state: " + stateId); 96 log.debug("Append output modes for state: " + stateId);
97 DefaultState state = (DefaultState) engine.getState(stateId); 97 DefaultState state = (DefaultState) engine.getState(stateId);
98 98
99 List<Output> list = state.getOutputs(); 99 List<Output> list = state.getOutputs();
100 if (list == null || list.isEmpty()) { 100 if (list == null || list.isEmpty()) {
101 logger.debug("-> No output modes for this state."); 101 log.debug("-> No output modes for this state.");
102 continue; 102 continue;
103 } 103 }
104 104
105 List<Facet> fs = getFacets(stateId); 105 List<Facet> fs = getFacets(stateId);
106 106
107 if (fs == null || fs.isEmpty()) { 107 if (fs == null || fs.isEmpty()) {
108 logger.debug("No facets for previous state found."); 108 log.debug("No facets for previous state found.");
109 continue; 109 continue;
110 } 110 }
111 111
112 logger.debug("Found " + fs.size() + " facets in previous states."); 112 log.debug("Found " + fs.size() + " facets in previous states.");
113 113
114 List<Output> generated = generateOutputs(list, fs); 114 List<Output> generated = generateOutputs(list, fs);
115 115
116 ProtocolUtils.appendOutputModes(doc, outs, generated); 116 ProtocolUtils.appendOutputModes(doc, outs, generated);
117 } 117 }
119 try { 119 try {
120 DefaultState cur = (DefaultState) getCurrentState(context); 120 DefaultState cur = (DefaultState) getCurrentState(context);
121 if (cur.validate(this)) { 121 if (cur.validate(this)) {
122 List<Output> list = cur.getOutputs(); 122 List<Output> list = cur.getOutputs();
123 if (list != null && list.size() > 0) { 123 if (list != null && list.size() > 0) {
124 logger.debug( 124 log.debug(
125 "Append output modes for current state: " + cur.getID()); 125 "Append output modes for current state: " + cur.getID());
126 126
127 List<Facet> fs = getFacets(cur.getID()); 127 List<Facet> fs = getFacets(cur.getID());
128 128
129 if (fs != null && fs.size() > 0) { 129 if (fs != null && fs.size() > 0) {
130 List<Output> generated = generateOutputs(list, fs); 130 List<Output> generated = generateOutputs(list, fs);
131 131
132 logger.debug("Found " + fs.size() + " current facets."); 132 log.debug("Found " + fs.size() + " current facets.");
133 if (!generated.isEmpty()) { 133 if (!generated.isEmpty()) {
134 ProtocolUtils.appendOutputModes( 134 ProtocolUtils.appendOutputModes(
135 doc, outs, generated); 135 doc, outs, generated);
136 } 136 }
137 } 137 }
138 else { 138 else {
139 logger.debug("No facets found for the current state."); 139 log.debug("No facets found for the current state.");
140 } 140 }
141 } 141 }
142 } 142 }
143 } 143 }
144 catch (IllegalArgumentException iae) { 144 catch (IllegalArgumentException iae) {
154 String hash, 154 String hash,
155 CallContext context, 155 CallContext context,
156 List<Facet> facets, 156 List<Facet> facets,
157 Object old) 157 Object old)
158 { 158 {
159 logger.debug("MapState.computeAdvance"); 159 log.debug("MapState.computeAdvance");
160 160
161 this.artifact = artifact; 161 this.artifact = artifact;
162 162
163 String type = getFacetType(); 163 String type = getFacetType();
164 164

http://dive4elements.wald.intevation.org