annotate artifacts/src/main/java/org/dive4elements/river/collections/D4EArtifactCollection.java @ 6955:94cb1845c667

(issue1452) Coalesce to zero to avoid NaN arithmetic.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 30 Aug 2013 15:45:14 +0200
parents df1140486ba4
children 8bcc120e64ae
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
9 package org.dive4elements.river.collections;
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
11 import java.io.IOException;
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
12 import java.io.OutputStream;
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
13 import java.util.ArrayList;
638
9c565eb46f06 Fixed the process of creating and storing the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 412
diff changeset
14 import java.util.HashMap;
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
15 import java.util.List;
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
16 import java.util.Map;
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import javax.xml.xpath.XPathConstants;
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import org.apache.log4j.Logger;
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import org.w3c.dom.Document;
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import org.w3c.dom.Element;
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 import org.w3c.dom.Node;
293
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
24 import org.w3c.dom.NodeList;
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
26 import org.dive4elements.artifactdatabase.Backend;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
27 import org.dive4elements.artifactdatabase.Backend.PersistentArtifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
28 import org.dive4elements.artifactdatabase.DefaultArtifactCollection;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
29 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
30 import org.dive4elements.artifactdatabase.state.Output;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
31 import org.dive4elements.artifactdatabase.state.Settings;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
32 import org.dive4elements.artifactdatabase.state.StateEngine;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
33 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
34 import org.dive4elements.artifacts.ArtifactDatabase;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
35 import org.dive4elements.artifacts.ArtifactDatabaseException;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
36 import org.dive4elements.artifacts.ArtifactNamespaceContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
37 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
38 import org.dive4elements.artifacts.CallMeta;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
39 import org.dive4elements.artifacts.common.utils.XMLUtils;
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
40 import org.dive4elements.river.artifacts.D4EArtifact;
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
41 import org.dive4elements.river.artifacts.context.RiverContext;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
42 import org.dive4elements.river.exports.OutGenerator;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5046
diff changeset
43 import org.dive4elements.river.exports.OutputHelper;
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
44 import org.dive4elements.river.utils.RiverUtils;
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 /**
4966
86d825d1173f FLYSArtifactCollection: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4499
diff changeset
47 * Collection of artifacts, can do outs, describe.
86d825d1173f FLYSArtifactCollection: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4499
diff changeset
48 * Lots of stuff done in AttributeParser and AttributeWriter.
86d825d1173f FLYSArtifactCollection: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4499
diff changeset
49 * Critical out and facet merging.
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 */
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
52 public class D4EArtifactCollection extends DefaultArtifactCollection {
1013
73330e89b0af Minor cosmetics, (comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 971
diff changeset
53 /** The logger used in this class. */
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
54 private static Logger log = Logger.getLogger(D4EArtifactCollection.class);
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55
1013
73330e89b0af Minor cosmetics, (comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 971
diff changeset
56 /** Constant XPath that points to the outputmodes of an artifact. */
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 public static final String XPATH_ARTIFACT_OUTPUTMODES =
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 "/art:result/art:outputmodes";
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
1950
37a7b3841565 Include state data items in description document of collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
60 public static final String XPATH_ARTIFACT_STATE_DATA =
37a7b3841565 Include state data items in description document of collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
61 "/art:result/art:ui/art:static/art:state/art:data";
37a7b3841565 Include state data items in description document of collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
62
293
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
63 public static final String XPATH_COLLECTION_ITEMS =
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
64 "/art:result/art:artifact-collection/art:collection-item";
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
65
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
66 public static final String XPATH_OUT_NAME = "/art:action/@art:name";
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
67
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
68 public static final String XPATH_OUT_TYPE = "/art:action/@art:type";
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
69
1780
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
70 /** Xpath to master artifacts uuid. */
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
71 public static final String XPATH_MASTER_UUID =
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
72 "/art:artifact-collection/art:artifact/@art:uuid";
1744
62efd1288e34 Fix setting of masterartifact in flyscollections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1718
diff changeset
73
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
74 public static final String XPATH_LOADED_RECOMMENDATIONS =
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
75 "/art:attribute/art:loaded-recommendations";
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
76
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
77
1628
16c74ca3586e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1175
diff changeset
78 /**
4966
86d825d1173f FLYSArtifactCollection: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4499
diff changeset
79 * Create and return description Document for this collection.
1628
16c74ca3586e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1175
diff changeset
80 */
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 @Override
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 public Document describe(CallContext context) {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
83 log.debug("D4EArtifactCollection.describe: " + identifier);
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
85 CollectionDescriptionHelper helper = new CollectionDescriptionHelper(
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
86 getName(), identifier(), getCreationTime(), getTTL(),
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
87 context);
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88
346
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
89 ArtifactDatabase db = context.getDatabase();
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
90
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
91 Document oldAttrs = getAttribute();
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
92 AttributeParser parser = new AttributeParser(oldAttrs);
293
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
93
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
94 try {
3315
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
95 String[] aUUIDs = getArtifactUUIDs(context);
2585
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
96
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
97 oldAttrs = removeAttributes(oldAttrs, context);
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
98 parser = new AttributeParser(oldAttrs);
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
99
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
100 CollectionAttribute newAttr = mergeAttributes(
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
101 db, context, parser, aUUIDs);
638
9c565eb46f06 Fixed the process of creating and storing the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 412
diff changeset
102
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
103 if (checkOutputSettings(newAttr, context)) {
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
104 saveCollectionAttribute(db, context, newAttr);
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
105 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
106
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
107 helper.setAttribute(newAttr);
346
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
108
3315
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
109 if (aUUIDs != null) {
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
110 for (String uuid: aUUIDs) {
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
111 helper.addArtifact(uuid);
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
112 }
293
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
113 }
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
114 }
3419b1c8ca28 Removed the Backend reference from FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 156
diff changeset
115 catch (ArtifactDatabaseException ade) {
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
116 log.error("Error while merging attribute documents.", ade);
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
117
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
118 helper.setAttribute(parser.getCollectionAttribute());
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 }
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
121 return helper.toXML();
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 }
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
125 /**
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
126 * Merge the current art:outputs nodes with the the outputs provided by the
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
127 * artifacts in the Collection.
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
128 *
1709
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
129 * @param uuids Artifact uuids.
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
130 */
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
131 protected CollectionAttribute mergeAttributes(
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
132 ArtifactDatabase db,
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
133 CallContext context,
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
134 AttributeParser oldParser,
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
135 String[] uuids
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
136 ) {
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
137 CollectionAttribute cAttribute =
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
138 buildOutAttributes(db, context, oldParser, uuids);
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
139
3785
a5f65e8983be Merged revisions 5501-5502,5504-5508,5511-5513,5516-5519 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3608
diff changeset
140 if (cAttribute == null) {
a5f65e8983be Merged revisions 5501-5502,5504-5508,5511-5513,5516-5519 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3608
diff changeset
141 log.warn("mergeAttributes: cAttribute == null");
a5f65e8983be Merged revisions 5501-5502,5504-5508,5511-5513,5516-5519 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3608
diff changeset
142 return null;
a5f65e8983be Merged revisions 5501-5502,5504-5508,5511-5513,5516-5519 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3608
diff changeset
143 }
a5f65e8983be Merged revisions 5501-5502,5504-5508,5511-5513,5516-5519 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3608
diff changeset
144
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
145 cAttribute.setLoadedRecommendations(
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
146 getLoadedRecommendations(oldParser.getAttributeDocument()));
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
147
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
148 saveCollectionAttribute(db, context, cAttribute);
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
149
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
150 return cAttribute;
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
151 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
152
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
153
2585
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
154 protected Document removeAttributes(Document attrs, CallContext context) {
2594
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
155 Node outs = (Node) XMLUtils.xpath(
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
156 attrs,
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
157 "/art:attribute/art:outputs",
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
158 XPathConstants.NODE,
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
159 ArtifactNamespaceContext.INSTANCE);
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
160
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
161 NodeList nodes = (NodeList) XMLUtils.xpath(
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
162 attrs,
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
163 "/art:attribute/art:outputs/art:output",
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
164 XPathConstants.NODESET,
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
165 ArtifactNamespaceContext.INSTANCE);
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
166
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
167 if (nodes != null) {
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
168 for (int i = 0; i < nodes.getLength(); i++) {
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
169 Element e = (Element)nodes.item(i);
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
170 if(!outputExists(e.getAttribute("name"), context)) {
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
171 outs.removeChild(e);
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
172 }
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
173 }
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
174 }
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
175 return attrs;
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
176 }
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
177
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
178
2728
306b9d0f0fb3 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2594
diff changeset
179 /**
306b9d0f0fb3 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2594
diff changeset
180 * True if current MasterArtifact has given output.
306b9d0f0fb3 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2594
diff changeset
181 * @param name Name of the output of interest.
306b9d0f0fb3 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2594
diff changeset
182 * @param context current context
3081
26119b7b3154 Fixing output generator hacking
Christian Lins <christian.lins@intevation.de>
parents: 2737
diff changeset
183 * @return true if current master artifact has given output.
2728
306b9d0f0fb3 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2594
diff changeset
184 */
2594
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
185 protected boolean outputExists(String name, CallContext context) {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
186 D4EArtifact master = getMasterArtifact(context);
2585
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
187 List<Output> outList = master.getOutputs(context);
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
188
2594
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
189 for (Output o : outList) {
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
190 if (name.equals(o.getName())) {
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
191 return true;
2585
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
192 }
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
193 }
2594
226c360febae Remove unnecessary outputs from attributes instead of copying outs to
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2585
diff changeset
194 return false;
2585
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
195 }
a71fc8f2030c Issue 640.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2325
diff changeset
196
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
197 /**
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
198 * @param db The ArtifactDatabase which is required to save the attribute
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
199 * into.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
200 * @param attribute The CollectionAttribute that should be stored in the
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
201 * database.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
202 *
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
203 * @return true, if the transaction was successful, otherwise false.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
204 */
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
205 protected boolean saveCollectionAttribute(
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
206 ArtifactDatabase db,
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
207 CallContext context,
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
208 CollectionAttribute attribute
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
209 ) {
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
210 log.info("Save new CollectionAttribute into database.");
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
211
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
212 Document doc = attribute.toXML();
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
213
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
214 try {
1013
73330e89b0af Minor cosmetics, (comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 971
diff changeset
215 // Save the merged document into database.
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
216 db.setCollectionAttribute(identifier(), context.getMeta(), doc);
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
217
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
218 log.info("Saving CollectionAttribute was successful.");
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
219
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
220 return true;
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
221 }
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
222 catch (ArtifactDatabaseException adb) {
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
223 log.error(adb, adb);
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
224 }
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
225
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
226 return false;
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
227 }
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
228
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
229
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
230 /**
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
231 * Merge the recommendations which have already been loaded from the old
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
232 * attribute document into the new attribute document. This is necessary,
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
233 * because mergeAttributes() only merges the art:outputs nodes - all
3442
cd5eb8f5f6f1 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3422
diff changeset
234 * other nodes are skipped.
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
235 */
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
236 protected Node getLoadedRecommendations(Document oldAttrs) {
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
237 Element loadedRecoms = (Element) XMLUtils.xpath(
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
238 oldAttrs,
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
239 XPATH_LOADED_RECOMMENDATIONS,
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
240 XPathConstants.NODE,
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
241 ArtifactNamespaceContext.INSTANCE);
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
242
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
243 return loadedRecoms;
971
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
244 }
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
245
d0c9a5f32c30 Prepared the FLYSArtifactCollection to support the storage of already loaded recommendations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 945
diff changeset
246
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
247 /**
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
248 * Evaluates the Output settings. If an Output has no Settings set, the
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
249 * relevant OutGenerator is used to initialize a default Settings object.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
250 *
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
251 * @param attribute The CollectionAttribute.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
252 * @param cc The CallContext.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
253 *
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
254 * @return true, if the CollectionAttribute was modified, otherwise false.
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
255 */
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
256 protected boolean checkOutputSettings(
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
257 CollectionAttribute attribute,
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
258 CallContext cc
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
259 ) {
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
260 boolean modified = false;
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
261
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
262 Map<String, Output> outputMap = attribute != null
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
263 ? attribute.getOutputs()
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
264 : null;
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
265
3555
b1912514e0f5 s/container.size() == 0/container.isEmpty()/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3452
diff changeset
266 if (outputMap == null || outputMap.isEmpty()) {
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
267 log.debug("No Output Settings check necessary.");
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
268 return modified;
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
269 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
270
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
271
4050
975f608dd254 Cleaned up iterating over maps. Removed some dead code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4024
diff changeset
272 for (Map.Entry<String, Output> entry: outputMap.entrySet()) {
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
273 String outName = entry.getKey();
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
274 Output output = entry.getValue();
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
275
3295
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
276 if (outName.equals("sq_overview")) {
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
277 continue;
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
278 }
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
279 Settings settings = output.getSettings();
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
280
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
281 if (settings == null) {
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
282 log.debug("No Settings set for Output '" + outName + "'.");
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
283 output.setSettings(
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
284 createInitialOutputSettings(cc, attribute, outName));
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
285
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
286 modified = true;
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
287 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
288 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
289
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
290 return modified;
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
291 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
292
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
293
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
294 /**
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
295 * This method uses the the OutGenerator for the specified Output
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
296 * <i>out</i> to create an initial Settings object.
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
297 *
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
298 * @param cc The CallContext object.
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
299 * @param attr The CollectionAttribute.
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
300 * @param out The name of the output.
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
301 *
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
302 * @return a default Settings object for the specified Output.
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
303 */
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
304 protected Settings createInitialOutputSettings(
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
305 CallContext cc,
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
306 CollectionAttribute attr,
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
307 String out
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
308 ) {
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
309 OutGenerator outGen = RiverContext.getOutGenerator(cc, out, null);
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
310
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
311 if (outGen == null) {
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
312 return null;
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
313 }
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
314
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
315 // XXX NOTE: the outGen is not able to process its generate() operation,
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
316 // because it has no OutputStream set!
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
317 outGen.init(XMLUtils.newDocument(), null, cc);
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
318 prepareMasterArtifact(outGen, cc);
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
319
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
320 try {
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
321 Document outAttr = getAttribute(cc, attr, out);
3295
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
322 OutputHelper helper = new OutputHelper(identifier());
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
323 helper.doOut(outGen, out, out, outAttr, cc);
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
324 }
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
325 catch (ArtifactDatabaseException adbe) {
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
326 log.error(adbe, adbe);
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
327 }
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
328 catch (IOException ioe) {
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
329 log.error(ioe, ioe);
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
330 }
1979
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
331
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
332 return outGen.getSettings();
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
333 }
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
334
a7c437c9547e Added a getSettings() operation to OutGenerator - FLYSArtifactCollection will now evaluate all available Outputs and create initial Settings using OutGenerators if the Settings for an Output is missing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1976
diff changeset
335
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
336 @Override
646
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
337 public void out(
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
338 String type,
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
339 Document format,
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
340 OutputStream out,
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
341 CallContext context)
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
342 throws IOException
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
343 {
3315
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
344 boolean debug = log.isDebugEnabled();
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
345
1998
3862c50d1cf3 Added an INFO statement that displays the duration time for the out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1993
diff changeset
346 long reqBegin = System.currentTimeMillis();
3862c50d1cf3 Added an INFO statement that displays the duration time for the out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1993
diff changeset
347
3315
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
348 if (debug) {
4499
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
349 log.debug(XMLUtils.toString(format));
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
350 log.debug("D4EArtifactCollection.out");
3315
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
351 }
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
352
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
353 String name = XMLUtils.xpathString(
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
354 format, XPATH_OUT_NAME, ArtifactNamespaceContext.INSTANCE);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
355
646
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
356 String subtype = XMLUtils.xpathString(
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
357 format, XPATH_OUT_TYPE, ArtifactNamespaceContext.INSTANCE);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
358
3315
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
359 if (debug) {
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
360 log.debug("-> Output name = " + name);
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
361 log.debug("-> Output type = " + type);
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
362 log.debug("-> Output subtype = " + subtype);
e2d355da4bd6 FLYSArtifactCollection: Lowered log level.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3298
diff changeset
363 }
388
cc6840cbe503 Introduced an export output target on collection level that enables collections to be exported.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 372
diff changeset
364
646
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
365 OutGenerator generator = null;
1780
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
366 if (type != null
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
367 && type.length() > 0
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
368 && type.indexOf("chartinfo") > 0)
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
369 {
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
370 generator = RiverContext.getOutGenerator(context, type, subtype);
646
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
371 }
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
372 else {
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
373 generator = RiverContext.getOutGenerator(context, name, subtype);
646
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
374 }
d299e220d89c Added support for the 'type' parameter of the collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 641
diff changeset
375
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
376 if (generator == null) {
390
a67748ad4d61 Modified a confusing debug statement.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 388
diff changeset
377 log.error("There is no generator specified for output: " + name);
1013
73330e89b0af Minor cosmetics, (comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 971
diff changeset
378 // TODO Throw an exception.
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
379
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
380 return;
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
381 }
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
382
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
383 Document oldAttrs = getAttribute();
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
384 AttributeParser parser = new AttributeParser(oldAttrs);
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
385 CollectionAttribute cAttr = parser.getCollectionAttribute();
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
386
5046
ace7a56d8047 FLYSArtifactCollection: WSP cosmetic.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4966
diff changeset
387 Output output = cAttr.getOutput(name);
4024
62d99de39a8d Avoid NPE if no attribute outs are present
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3978
diff changeset
388 Settings settings = null;
62d99de39a8d Avoid NPE if no attribute outs are present
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3978
diff changeset
389 if (output != null) {
62d99de39a8d Avoid NPE if no attribute outs are present
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3978
diff changeset
390 settings = output.getSettings();
4499
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
391
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
392 if (debug) {
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
393 List<Facet> facets = output.getFacets();
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
394 for(Facet facet: facets) {
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
395 log.debug(" -- Facet " + facet.getName());
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
396 }
b74399bd0960 Improve debugging while merging outs and facets
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4050
diff changeset
397 }
4024
62d99de39a8d Avoid NPE if no attribute outs are present
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3978
diff changeset
398 }
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
399
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
400 generator.init(format, out, context);
2047
0318fa6f0844 Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2012
diff changeset
401 generator.setSettings(settings);
3422
118fe1cc8cc8 OutGenerators got a setCollection() method; analogous to setMasterArtifact(). Registered the SQOverviewGenerator as OutGenerator for 'sq_overview' Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3316
diff changeset
402 generator.setCollection(this);
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
403 prepareMasterArtifact(generator, context);
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
404
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
405 try {
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
406 Document attr = getAttribute(context, cAttr, name);
3295
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
407 OutputHelper helper = new OutputHelper(identifier());
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
408 if (name.equals("sq_overview")) {
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
409 helper.doOut(generator, name, subtype, format, context);
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
410 }
4fc442f1b4f6 Refactored FLYSArtifactCollection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3263
diff changeset
411 helper.doOut(generator, name, subtype, attr, context);
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
412 generator.generate();
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
413 }
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
414 catch (ArtifactDatabaseException adbe) {
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
415 log.error(adbe, adbe);
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
416 }
1998
3862c50d1cf3 Added an INFO statement that displays the duration time for the out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1993
diff changeset
417
3316
2495b24147ff Forget file to save.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3315
diff changeset
418 if (debug) {
2495b24147ff Forget file to save.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3315
diff changeset
419 long duration = System.currentTimeMillis() -reqBegin;
2495b24147ff Forget file to save.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3315
diff changeset
420 log.info("Processing out(" + name + ") took " + duration + " ms.");
2495b24147ff Forget file to save.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3315
diff changeset
421 }
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
422 }
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
423
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
424
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
425 /**
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
426 * Sets the master Artifact at the given <i>generator</i>.
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
427 *
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
428 * @param generator The generator that gets a master Artifact.
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
429 * @param cc The CallContext.
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
430 */
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
431 protected void prepareMasterArtifact(OutGenerator generator, CallContext cc
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
432 ) {
1744
62efd1288e34 Fix setting of masterartifact in flyscollections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1718
diff changeset
433 // Get master artifact.
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
434 D4EArtifact master = getMasterArtifact(cc);
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
435 if (master != null) {
1988
158b3aabda2c Prepare the OutGenerator during the describe() operation of the FLYS Collection to enable the OutGenerator to return an initial Settings object.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1979
diff changeset
436 log.debug("Set master Artifact to uuid: " + master.identifier());
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
437 generator.setMasterArtifact(master);
1780
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
438 }
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
439 else {
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
440 log.warn("Could not set master artifact.");
1744
62efd1288e34 Fix setting of masterartifact in flyscollections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1718
diff changeset
441 }
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
442 }
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
443
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
444
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
445 /**
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
446 * @return masterartifact or null if exception/not found.
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
447 */
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
448 protected D4EArtifact getMasterArtifact(CallContext context)
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
449 {
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
450 try {
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
451 ArtifactDatabase db = context.getDatabase();
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
452 CallMeta callMeta = context.getMeta();
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
453 Document document = db.getCollectionsMasterArtifact(
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
454 identifier(), callMeta);
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
455
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
456 String masterUUID = XMLUtils.xpathString(
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
457 document, XPATH_MASTER_UUID, ArtifactNamespaceContext.INSTANCE);
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
458 D4EArtifact masterArtifact =
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
459 (D4EArtifact) getArtifact(masterUUID, context);
1784
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
460 return masterArtifact;
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
461 }
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
462 catch (ArtifactDatabaseException ade) {
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
463 log.error(ade, ade);
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
464 }
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
465 return null;
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
466 }
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
467
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
468
0fe3c4849baa Cosmetics and refactoring in FLYSArtifactCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1780
diff changeset
469 /**
1628
16c74ca3586e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1175
diff changeset
470 * Return merged output document.
1709
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
471 * @param uuids List of artifact uuids.
1628
16c74ca3586e Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1175
diff changeset
472 */
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
473 protected CollectionAttribute buildOutAttributes(
346
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
474 ArtifactDatabase db,
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
475 CallContext context,
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
476 AttributeParser aParser,
1709
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
477 String[] uuids)
346
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
478 {
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
479 RiverContext flysContext = RiverUtils.getFlysContext(context);
1785
661dfad9910a Use compatibility matrix when creating collections output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1784
diff changeset
480 StateEngine engine = (StateEngine) flysContext.get(
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
481 RiverContext.STATE_ENGINE_KEY);
3608
53aa395a29e0 FLYSArtifactCollection: Prevent another NPE. Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3606
diff changeset
482
53aa395a29e0 FLYSArtifactCollection: Prevent another NPE. Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3606
diff changeset
483 if (engine == null) {
53aa395a29e0 FLYSArtifactCollection: Prevent another NPE. Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3606
diff changeset
484 log.error("buildOutAttributes: engine == null");
53aa395a29e0 FLYSArtifactCollection: Prevent another NPE. Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3606
diff changeset
485 return null;
53aa395a29e0 FLYSArtifactCollection: Prevent another NPE. Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3606
diff changeset
486 }
1785
661dfad9910a Use compatibility matrix when creating collections output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1784
diff changeset
487
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
488 D4EArtifact masterArtifact = getMasterArtifact(context);
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
489
3608
53aa395a29e0 FLYSArtifactCollection: Prevent another NPE. Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3606
diff changeset
490 if (masterArtifact == null) {
3606
2b308a5d5281 Fix for NPE
Christian Lins <christian.lins@intevation.de>
parents: 3555
diff changeset
491 log.debug("buildOutAttributes: masterArtifact == null");
2b308a5d5281 Fix for NPE
Christian Lins <christian.lins@intevation.de>
parents: 3555
diff changeset
492 return null;
2b308a5d5281 Fix for NPE
Christian Lins <christian.lins@intevation.de>
parents: 3555
diff changeset
493 }
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
494
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
495 OutputParser oParser = new OutputParser(db, context);
1972
3c3e81fca092 Added a CollectionDescriptionHelper that helps generating DESCRIBE documents for Collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1950
diff changeset
496
1709
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
497 if (uuids != null) {
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
498 for (String uuid: uuids) {
1175
e6b513495281 Prepared FLYSArtifactCollection to live without Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1060
diff changeset
499 try {
e6b513495281 Prepared FLYSArtifactCollection to live without Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1060
diff changeset
500 oParser.parse(uuid);
e6b513495281 Prepared FLYSArtifactCollection to live without Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1060
diff changeset
501 }
e6b513495281 Prepared FLYSArtifactCollection to live without Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1060
diff changeset
502 catch (ArtifactDatabaseException ade) {
e6b513495281 Prepared FLYSArtifactCollection to live without Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1060
diff changeset
503 log.warn(ade, ade);
e6b513495281 Prepared FLYSArtifactCollection to live without Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1060
diff changeset
504 }
346
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
505 }
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
506 }
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
507
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
508 aParser.parse();
1950
37a7b3841565 Include state data items in description document of collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
509
3606
2b308a5d5281 Fix for NPE
Christian Lins <christian.lins@intevation.de>
parents: 3555
diff changeset
510 AttributeWriter aWriter = new AttributeWriter(
1709
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
511 db,
1993
85132c9edd64 Make reuse of the old CollectionAttribute during the describe() operation of FLYSArtifactCollection - remove the old facets only.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1988
diff changeset
512 aParser.getCollectionAttribute(),
1709
f643ea084213 Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1684
diff changeset
513 aParser.getOuts(),
1785
661dfad9910a Use compatibility matrix when creating collections output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1784
diff changeset
514 aParser.getFacets(),
661dfad9910a Use compatibility matrix when creating collections output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1784
diff changeset
515 oParser.getOuts(),
661dfad9910a Use compatibility matrix when creating collections output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1784
diff changeset
516 oParser.getFacets(),
661dfad9910a Use compatibility matrix when creating collections output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1784
diff changeset
517 engine.getCompatibleFacets(masterArtifact.getStateHistoryIds())
3606
2b308a5d5281 Fix for NPE
Christian Lins <christian.lins@intevation.de>
parents: 3555
diff changeset
518 );
2b308a5d5281 Fix for NPE
Christian Lins <christian.lins@intevation.de>
parents: 3555
diff changeset
519 return aWriter.write();
346
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
520 }
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
521
16161de47662 The Attributes of a collection are written into its DESCRIBE now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
522
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
523 /**
1780
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
524 * Returns the "attribute" (part of description document) for a specific
b503d92dd709 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1772
diff changeset
525 * output type.
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
526 *
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
527 * @param context The CallContext object.
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
528 * @param cAttr The CollectionAttribute.
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
529 * @param output The name of the desired output type.
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
530 *
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
531 * @return the attribute for the desired output type.
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
532 */
1999
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
533 protected Document getAttribute(
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
534 CallContext context,
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
535 CollectionAttribute cAttr,
02ce03329ef5 Some optimizations during out() operation of FLYSArtifactCollection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1998
diff changeset
536 String output)
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
537 throws ArtifactDatabaseException
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
538 {
1976
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
539 Document attr = cAttr.toXML();
0b466bd4ab24 Introduced a CollectionAttribute class that stores the information provided by the Collection's attribute document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1972
diff changeset
540
3263
68320805566a Removed dynamic XPaths to pervent potential XPath injections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3245
diff changeset
541 Map<String, String> vars = new HashMap<String, String>();
68320805566a Removed dynamic XPaths to pervent potential XPath injections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3245
diff changeset
542 vars.put("output", output);
68320805566a Removed dynamic XPaths to pervent potential XPath injections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3245
diff changeset
543
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
544 Node out = (Node) XMLUtils.xpath(
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
545 attr,
3263
68320805566a Removed dynamic XPaths to pervent potential XPath injections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3245
diff changeset
546 "art:attribute/art:outputs/art:output[@name=$output]",
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
547 XPathConstants.NODE,
3263
68320805566a Removed dynamic XPaths to pervent potential XPath injections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3245
diff changeset
548 ArtifactNamespaceContext.INSTANCE,
68320805566a Removed dynamic XPaths to pervent potential XPath injections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3245
diff changeset
549 vars);
347
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
550
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
551
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
552 if (out != null) {
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
553 Document o = XMLUtils.newDocument();
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
554
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
555 o.appendChild(o.importNode(out, true));
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
556
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
557 return o;
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
558 }
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
559
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
560 return null;
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
561 }
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
562
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
563
a63d8bdb2d79 Improved the out() operation of a Collection - the OutGenerator gets to know about the facets and its theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 346
diff changeset
564 /**
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
565 * This method returns the list of artifact UUIDs that this collections
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
566 * contains.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
567 *
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
568 * @param context The CallContext that is necessary to get information about
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
569 * the ArtifactDatabase.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
570 *
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
571 * @return a list of uuids.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
572 */
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
573 protected String[] getArtifactUUIDs(CallContext context)
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
574 throws ArtifactDatabaseException
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
575 {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
576 log.debug("D4EArtifactCollection.getArtifactUUIDs");
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
577
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
578 ArtifactDatabase db = context.getDatabase();
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
579 CallMeta meta = context.getMeta();
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
580
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
581 Document itemList = db.listCollectionArtifacts(identifier(), meta);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
582 NodeList items = (NodeList) XMLUtils.xpath(
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
583 itemList,
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
584 XPATH_COLLECTION_ITEMS,
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
585 XPathConstants.NODESET,
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
586 ArtifactNamespaceContext.INSTANCE);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
587
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
588 if (items == null || items.getLength() == 0) {
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
589 log.debug("No artifacts found in this collection.");
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
590 return null;
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
591 }
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
592
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
593 int num = items.getLength();
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
594
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
595 List<String> uuids = new ArrayList<String>(num);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
596
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
597 for (int i = 0; i < num; i++) {
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
598 String uuid = XMLUtils.xpathString(
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
599 items.item(i),
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
600 "@art:uuid",
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
601 ArtifactNamespaceContext.INSTANCE);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
602
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
603 if (uuid != null && uuid.trim().length() != 0) {
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
604 uuids.add(uuid);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
605 }
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
606 }
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
607
3452
200e70f31f6f Removed some superfluous casts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3442
diff changeset
608 return uuids.toArray(new String[uuids.size()]);
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
609 }
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
610
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
611
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
612 /**
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
613 * Returns a concrete Artifact of this collection specified by its uuid.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
614 *
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
615 * @param uuid The Artifact's uuid.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
616 * @param context The CallContext.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
617 *
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
618 * @return an Artifact.
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
619 */
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
620 protected Artifact getArtifact(String uuid, CallContext context)
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
621 throws ArtifactDatabaseException
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
622 {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
623 log.debug("D4EArtifactCollection.getArtifact");
300
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
624
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
625 Backend backend = Backend.getInstance();
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
626 PersistentArtifact persistent = backend.getArtifact(uuid);
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
627
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
628 return persistent != null ? persistent.getArtifact() : null;
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
629 }
9a0e1289bab6 The FLYSArtifactCollection overrides out() and uses OutGenerators to create output for this operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 296
diff changeset
630
6600
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
631 /**
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
632 * Returns artifacts that name facetName.
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
633 *
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
634 * @param name The Artifact name to search
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
635 * @param context The CallContext
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
636 *
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
637 * @return a list of artifacts matching this name.
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
638 */
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
639 public List<Artifact> getArtifactsByName(String name, CallContext context)
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
640 {
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
641 log.debug("Searching for Artifacts: " + name);
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
642 List<Artifact> ret = new ArrayList<Artifact>();
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
643 try {
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
644 for (String uuid: getArtifactUUIDs(context)) {
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
645 D4EArtifact subArt = (D4EArtifact)getArtifact(uuid, context);
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
646 if (subArt.getName() != null && subArt.getName().equals(name)) {
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
647 ret.add(subArt);
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
648 }
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
649 }
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
650 } catch (ArtifactDatabaseException e) {
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
651 log.error("Unexpected Error!", e);
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
652 } finally {
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
653 return ret;
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
654 }
df1140486ba4 Add getArtifactsByName to collection
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
655 }
147
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
656 }
76cc1a66a05f Implemented a FLYSArtifactCollection that will be used in this application now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
657 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org