Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/collections/OutputParser.java @ 2204:45f7762767e2
Bugfix: use correct order of parameters to call DefaultStateData constructor.
flys-artifacts/trunk@3828 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 30 Jan 2012 13:23:40 +0000 |
parents | 22732713c54d |
children | 1203e12c97a6 |
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 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 public class OutputParser { |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
25 /** 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
|
26 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
|
27 "/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
|
28 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 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
|
30 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 protected ArtifactDatabase db; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 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
|
33 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
|
34 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
35 /** 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
|
36 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
|
37 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
38 /** 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
|
39 protected List<Facet> facets; |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
40 |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
42 /** |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
43 * @param db Database used to fetch artifacts, outputs and facets. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
44 */ |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
45 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
|
46 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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
54 /** |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
55 * 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
|
56 * Converts Facets to ManagedFacets on the way. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
57 * @param uuid uuid of artifact to load from database. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
58 */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 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
|
60 throws ArtifactDatabaseException |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 { |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 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
|
63 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
64 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
|
65 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
66 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
|
67 |
2094
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
68 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
|
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 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
|
71 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
|
72 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
|
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 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
|
75 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
|
76 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
77 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
|
78 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
|
79 out.getName(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
80 out.getDescription(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
81 out.getMimeType(), |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
82 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
|
83 out.getType()); |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
84 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
|
85 } |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
86 else { |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
87 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
|
88 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
|
89 } |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
90 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
91 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
|
92 o.addFacets(mfacets); |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
93 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
|
94 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
1770
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
98 /** |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
99 * Access mapping of Outputname to Output. |
e8a98eee816d
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1715
diff
changeset
|
100 */ |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 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
|
102 return outs; |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
1779
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
106 /** |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
107 * Access all facets. |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
108 */ |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
109 public List<Facet> getFacets() { |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
110 return this.facets; |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
111 } |
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 |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
114 /** |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
115 * 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
|
116 * @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
|
117 * will be increased). |
2fe270661b20
Let Output and Attribute Parsers collect Facets during processing.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1770
diff
changeset
|
118 */ |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
119 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
|
120 String uuid, |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
121 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
|
122 int pos) |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
123 { |
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
124 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
|
125 |
2094
22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1779
diff
changeset
|
126 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
|
127 |
944
c256061287d7
Simplified the code to read all provided Outputs of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
932
diff
changeset
|
128 for (Facet f: old) { |
1715
a70e0cbc5e02
Added support for removing themes from output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
945
diff
changeset
|
129 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
|
130 } |
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
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 return newFacets; |
346
16161de47662
The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 } |
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |