Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/collections/OutputParser.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 | af13ceeba52a |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
36 | 36 |
37 /** Constant XPath that points to the outputmodes of an artifact. */ | 37 /** Constant XPath that points to the outputmodes of an artifact. */ |
38 public static final String XPATH_ARTIFACT_OUTPUTMODES = | 38 public static final String XPATH_ARTIFACT_OUTPUTMODES = |
39 "/art:result/art:outputmodes/art:output"; | 39 "/art:result/art:outputmodes/art:output"; |
40 | 40 |
41 private static Logger logger = Logger.getLogger(OutputParser.class); | 41 private static Logger log = Logger.getLogger(OutputParser.class); |
42 | 42 |
43 protected ArtifactDatabase db; | 43 protected ArtifactDatabase db; |
44 protected CallMeta meta; | 44 protected CallMeta meta; |
45 protected CallContext context; | 45 protected CallContext context; |
46 | 46 |
69 * @param uuid uuid of artifact to load from database. | 69 * @param uuid uuid of artifact to load from database. |
70 */ | 70 */ |
71 public void parse(String uuid) | 71 public void parse(String uuid) |
72 throws ArtifactDatabaseException | 72 throws ArtifactDatabaseException |
73 { | 73 { |
74 logger.debug("OutputParser.parse: " + uuid); | 74 log.debug("OutputParser.parse: " + uuid); |
75 | 75 |
76 D4EArtifact flys = (D4EArtifact) db.getRawArtifact(uuid); | 76 D4EArtifact flys = (D4EArtifact) db.getRawArtifact(uuid); |
77 | 77 |
78 List<Output> outList = flys.getOutputs(context); | 78 List<Output> outList = flys.getOutputs(context); |
79 | 79 |
80 logger.debug(" has " + outList.size() + " Outputs."); | 80 log.debug(" has " + outList.size() + " Outputs."); |
81 | 81 |
82 for (Output out: outList) { | 82 for (Output out: outList) { |
83 String name = out.getName(); | 83 String name = out.getName(); |
84 logger.debug("Process Output '" + name + "'"); | 84 log.debug("Process Output '" + name + "'"); |
85 | 85 |
86 Output o = outs.get(name); | 86 Output o = outs.get(name); |
87 int pos = 1; | 87 int pos = 1; |
88 | 88 |
89 if (o == null) { | 89 if (o == null) { |
94 new ArrayList<Facet>(), | 94 new ArrayList<Facet>(), |
95 out.getType()); | 95 out.getType()); |
96 outs.put(name, o); | 96 outs.put(name, o); |
97 } | 97 } |
98 else { | 98 else { |
99 logger.debug("OutputParser.parse: Use 'old' Output"); | 99 log.debug("OutputParser.parse: Use 'old' Output"); |
100 pos = o.getFacets().size() + 1; | 100 pos = o.getFacets().size() + 1; |
101 } | 101 } |
102 | 102 |
103 List<Facet> mfacets = facet2ManagedFacet(uuid, out.getFacets(), pos); | 103 List<Facet> mfacets = facet2ManagedFacet(uuid, out.getFacets(), pos); |
104 o.addFacets(mfacets); | 104 o.addFacets(mfacets); |
133 List<Facet> old, | 133 List<Facet> old, |
134 int pos) | 134 int pos) |
135 { | 135 { |
136 List<Facet> newFacets = new ArrayList<Facet>(old.size()); | 136 List<Facet> newFacets = new ArrayList<Facet>(old.size()); |
137 | 137 |
138 logger.debug("There are " + old.size() + " Facets for this Output."); | 138 log.debug("There are " + old.size() + " Facets for this Output."); |
139 | 139 |
140 for (Facet f: old) { | 140 for (Facet f: old) { |
141 newFacets.add(new ManagedFacetAdapter(f, uuid, pos++, 1, 1)); | 141 newFacets.add(new ManagedFacetAdapter(f, uuid, pos++, 1, 1)); |
142 } | 142 } |
143 | 143 |