comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 981:799c7108ea6d

datacage: prepared access to outs of artifacts. flys-artifacts/trunk@2409 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 27 Jul 2011 11:01:55 +0000
parents 79251b1d47da
children eccf966fb677
comparison
equal deleted inserted replaced
980:f9a6a9cd918e 981:799c7108ea6d
1129 StateEngine engine = (StateEngine) flysContext.get( 1129 StateEngine engine = (StateEngine) flysContext.get(
1130 FLYSContext.STATE_ENGINE_KEY); 1130 FLYSContext.STATE_ENGINE_KEY);
1131 1131
1132 for (String stateId: stateIds) { 1132 for (String stateId: stateIds) {
1133 DefaultState state = (DefaultState) engine.getState(stateId); 1133 DefaultState state = (DefaultState) engine.getState(stateId);
1134 generated.addAll(getOutputForState(context, state)); 1134 generated.addAll(getOutputForState(state));
1135 } 1135 }
1136 1136
1137 generated.addAll(getCurrentOutputs(context)); 1137 generated.addAll(getCurrentOutputs(context));
1138 1138
1139 return generated; 1139 return generated;
1143 public List<Output> getCurrentOutputs(CallContext context) { 1143 public List<Output> getCurrentOutputs(CallContext context) {
1144 DefaultState cur = (DefaultState) getCurrentState(context); 1144 DefaultState cur = (DefaultState) getCurrentState(context);
1145 1145
1146 try { 1146 try {
1147 if (cur.validate(this, context)) { 1147 if (cur.validate(this, context)) {
1148 return getOutputForState(context, cur); 1148 return getOutputForState(cur);
1149 } 1149 }
1150 } 1150 }
1151 catch (IllegalArgumentException iae) { } 1151 catch (IllegalArgumentException iae) { }
1152 1152
1153 return new ArrayList<Output>(); 1153 return new ArrayList<Output>();
1154 } 1154 }
1155 1155
1156 1156 public List<Output> getCurrentOutputs(Object context) {
1157 protected List<Output> getOutputForState( 1157 return getOutputForState((DefaultState)getCurrentState(context));
1158 CallContext context, 1158 }
1159 DefaultState state) 1159
1160 { 1160 protected List<Output> getOutputForState(DefaultState state) {
1161 List<Output> list = state.getOutputs(); 1161 List<Output> list = state.getOutputs();
1162 if (list == null || list.size() == 0) { 1162 if (list == null || list.size() == 0) {
1163 logger.debug("-> No output modes for this state."); 1163 logger.debug("-> No output modes for this state.");
1164 return new ArrayList<Output>(); 1164 return new ArrayList<Output>();
1165 } 1165 }

http://dive4elements.wald.intevation.org