Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/collections/OutputParser.java @ 4303:d65cf8e40230
WaterlevelFacet: Deal with ExtremeResult if it is embedded in CalculationResult (instead of WQKms).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 29 Oct 2012 13:47:34 +0100 |
parents | 1203e12c97a6 |
children |
rev | line source |
---|---|
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.collections; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
3 import java.util.ArrayList; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.HashMap; |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
5 import java.util.List; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import java.util.Map; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.apache.log4j.Logger; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.ArtifactDatabase; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.ArtifactDatabaseException; |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
12 import de.intevation.artifacts.CallContext; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.CallMeta; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifactdatabase.state.DefaultOutput; |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
16 import de.intevation.artifactdatabase.state.Facet; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifactdatabase.state.Output; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
19 import de.intevation.flys.artifacts.FLYSArtifact; |
945
59ae2a823e73
Use the Facet.toXML() method to write facet elements into the DESCRIBE document of the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
944
diff
changeset
|
20 import de.intevation.flys.artifacts.model.ManagedFacetAdapter; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
3149
1203e12c97a6
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2094
diff
changeset
|
23 /** |
1203e12c97a6
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2094
diff
changeset
|
24 * The OutputParsers task is to pull Artifacts from database and put |
1203e12c97a6
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2094
diff
changeset
|
25 * its outputs and facets into some structures. |
1203e12c97a6
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2094
diff
changeset
|
26 */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 public class OutputParser { |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
29 /** Constant XPath that points to the outputmodes of an artifact. */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 public static final String XPATH_ARTIFACT_OUTPUTMODES = |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 "/art:result/art:outputmodes/art:output"; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 private static Logger logger = Logger.getLogger(OutputParser.class); |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 protected ArtifactDatabase db; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 protected CallMeta meta; |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
37 protected CallContext context; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
39 /** Map outputs name to Output. */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 protected Map<String, Output> outs; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
42 /** Map facets name to list of Facets. */ |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
43 protected List<Facet> facets; |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
44 |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
46 /** |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
47 * @param db Database used to fetch artifacts, outputs and facets. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
48 */ |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
49 public OutputParser(ArtifactDatabase db, CallContext context) { |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
50 this.db = db; |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
51 this.meta = context.getMeta(); |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
52 this.context = context; |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
53 this.outs = new HashMap<String, Output>(); |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
54 this.facets = new ArrayList<Facet>(); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
58 /** |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
59 * Gets raw artifact with given id and sorts outputs in mapping. |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
60 * Converts Facets to ManagedFacets on the way. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
61 * @param uuid uuid of artifact to load from database. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
62 */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 public void parse(String uuid) |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 throws ArtifactDatabaseException |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 { |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 logger.debug("OutputParser.parse: " + uuid); |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
68 FLYSArtifact flys = (FLYSArtifact) db.getRawArtifact(uuid); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
70 List<Output> outList = flys.getOutputs(context); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
2094
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
72 logger.debug(" has " + outList.size() + " Outputs."); |
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
73 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
74 for (Output out: outList) { |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
75 String name = out.getName(); |
2094
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
76 logger.debug("Process Output '" + name + "'"); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
78 Output o = outs.get(name); |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
79 int pos = 1; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
81 if (o == null) { |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
82 o = new DefaultOutput( |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
83 out.getName(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
84 out.getDescription(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
85 out.getMimeType(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
86 new ArrayList<Facet>(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
87 out.getType()); |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
88 outs.put(name, o); |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
89 } |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
90 else { |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
91 logger.debug("OutputParser.parse: Use 'old' Output"); |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
92 pos = o.getFacets().size() + 1; |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
93 } |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
94 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
95 List<Facet> mfacets = facet2ManagedFacet(uuid, out.getFacets(), pos); |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
96 o.addFacets(mfacets); |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
97 this.facets.addAll(mfacets); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
102 /** |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
103 * Access mapping of Outputname to Output. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
104 */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 public Map<String, Output> getOuts() { |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 return outs; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
110 /** |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
111 * Access all facets. |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
112 */ |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
113 public List<Facet> getFacets() { |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
114 return this.facets; |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
115 } |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
116 |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
117 |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
118 /** |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
119 * Creates a list of ManagedFacets from list of Facets. |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
120 * @param pos Position of first facet (for each other the positions |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
121 * will be increased). |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
122 */ |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
123 protected List<Facet> facet2ManagedFacet( |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
124 String uuid, |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
125 List<Facet> old, |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
126 int pos) |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
127 { |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
128 List<Facet> newFacets = new ArrayList<Facet>(old.size()); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 |
2094
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
130 logger.debug("There are " + old.size() + " Facets for this Output."); |
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
131 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
132 for (Facet f: old) { |
1715
a70e0cbc5e02
Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
945
diff
changeset
|
133 newFacets.add(new ManagedFacetAdapter(f, uuid, pos++, 1, 1)); |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
136 return newFacets; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |