Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java @ 853:164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
gnv-artifacts/trunk@971 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 23 Apr 2010 10:12:43 +0000 |
parents | a645bd23c1c8 |
children | 3fbabd4803d7 |
rev | line source |
---|---|
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.utils; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.io.File; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.io.FileNotFoundException; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import java.io.FileOutputStream; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import java.io.IOException; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import java.io.OutputStream; |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
8 import java.util.Date; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.apache.log4j.Logger; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.Document; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import org.w3c.dom.Element; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
14 import de.intevation.artifactdatabase.XMLUtils; |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
15 import de.intevation.artifacts.ArtifactNamespaceContext; |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
16 import de.intevation.artifacts.CallContext; |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
17 import de.intevation.gnv.artifacts.context.GNVArtifactContext; |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
18 import de.intevation.gnv.wms.LayerInfo; |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
19 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 /** |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
21 * This class provides some methods to create files storing meta information |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
22 * about wms layers and a map service which serves these layers. |
807
a645bd23c1c8
Added more javadoc. Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
806
diff
changeset
|
23 * |
780
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 */ |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public class MetaWriter { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 private static Logger logger = Logger.getLogger(MetaWriter.class); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 public static final String NODE_MAPSERVER = "mapserver"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public static final String NODE_SERVER = "server"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public static final String NODE_MAP = "map"; |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
33 public static final String NODE_TTL = "ttl"; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public static final String META_FILE_NAME = "meta.xml"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 public static final String ISOLINES_NAME = "isolines.shp"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 public static final String POLYGON_NAME = "polygons.shp"; |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
38 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
40 public static final String CONTEXT_LAYER_TITLE = "wms.title"; |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
41 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
42 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
43 * Constructor. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
44 */ |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 private MetaWriter() { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
773
diff
changeset
|
47 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
48 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
49 * Writes a meta information file for product type 'Layer'. |
807
a645bd23c1c8
Added more javadoc. Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
806
diff
changeset
|
50 * |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
51 * @param context CallContext object. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
52 * @param uuid The UUID of the current artifact. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
53 * @param path The destination of the meta file. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
54 * @param paramType The parameter type. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
55 * @param layerType The layer type. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
56 * @return the meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
57 */ |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
58 public static Document writeLayerMeta(CallContext context, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
59 String uuid, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
60 String path, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
61 String paramType, |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
62 String layerType, |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
63 String shapefileName, |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
64 String title){ |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
65 Document meta = XMLUtils.newDocument(); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
66 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
67 meta, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
68 ArtifactNamespaceContext.NAMESPACE_URI, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
69 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
70 Element root = creator.create("meta"); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
71 meta.appendChild(root); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
773
diff
changeset
|
72 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
73 writeAbstractMeta(context, meta, root); |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
74 writeLayerMeta(context, meta, root, uuid, paramType,layerType,shapefileName,title); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
75 boolean success = writeMetaFile(path, meta); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
773
diff
changeset
|
76 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
77 if (success){ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
78 return meta; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
79 }else{ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
80 return null; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
81 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
82 } |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
84 |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
85 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
86 * Writes a meta information file for product type 'Horizontalschnitt'. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
87 * |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
88 * @param context The CallContext object. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
89 * @param uuid The UUID of the current artifact. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
90 * @param path The destination of the meta file. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
91 * @param paramType The parameter type. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
92 * @return the meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
93 */ |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 public static Document writeHorizontalcrosssectionMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 CallContext context, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 String uuid, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 String path, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 String paramType) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 Document meta = XMLUtils.newDocument(); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 meta, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 Element root = creator.create("meta"); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 meta.appendChild(root); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 writeAbstractMeta(context, meta, root); |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
110 writePolygonMeta(context, meta, root, uuid, paramType); |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
111 writeIsolineMeta(context, meta, root, uuid, paramType); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
113 boolean success = writeMetaFile(path, meta); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
114 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
115 if (success){ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
116 return meta; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
117 }else{ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
118 return null; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
119 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
120 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
121 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
122 /** |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
123 * Method to write the <i>meta</i> document down to a file. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
124 * |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
125 * @param path The destination of the file. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
126 * @param meta The xml document storing the meta information. |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
127 */ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
128 private static boolean writeMetaFile(String path, Document meta) { |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 try { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 File metaFile = new File(path, META_FILE_NAME); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
132 if (metaFile.exists()) { |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
133 logger.info("Delete old meta information file."); |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
134 metaFile.delete(); |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
135 } |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
136 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 if (!metaFile.createNewFile() || !metaFile.canWrite()) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 logger.error("Error while writing meta file: "+metaFile.toString()); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
139 return false; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 OutputStream out = null; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 boolean success = false; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 try { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 out = new FileOutputStream(metaFile); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 success = XMLUtils.toStream(meta, out); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 finally { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 if (out != null) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 try { out.close(); } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 catch (IOException ioe) {} |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 if (!success && metaFile.exists()) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 metaFile.delete(); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
159 return success; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 catch (FileNotFoundException fnfe) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 logger.error(fnfe); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
163 return false; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 catch (IOException ioe) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 logger.error(ioe, ioe); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
167 return false; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
172 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
173 * Append meta information about the mapservice itself. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
174 * |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
175 * @param callContext The CallContext object. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
176 * @param document The meta information document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
177 * @param meta The element where the new information need to be appended to. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
178 */ |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 public static void writeAbstractMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 CallContext callContext, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
181 Document document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 Element meta |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 ) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 GNVArtifactContext context = |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 (GNVArtifactContext) callContext.globalContext(); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 String server = (String) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 context.get(GNVArtifactContext.MAPSERVER_SERVER_PATH_KEY); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 String map = (String) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 context.get(GNVArtifactContext.MAPSERVER_MAP_PATH_KEY); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
198 if (logger.isDebugEnabled()) { |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
199 logger.debug("MAPSERVER PATH: " + server); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
200 logger.debug("MAP PATH: " + map); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
201 } |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 Element mapserver = creator.create(NODE_MAPSERVER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 Element serverPath = creator.create(NODE_SERVER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 Element mapPath = creator.create(NODE_MAP); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 mapPath.setTextContent(map); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 serverPath.setTextContent(server); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 mapserver.appendChild(serverPath); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 mapserver.appendChild(mapPath); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 meta.appendChild(mapserver); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
215 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
216 * Append layer information to the meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
217 * |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
218 * @param callContext The CallContext object. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
219 * @param document The meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
220 * @param meta The element where the new information need to be appended to. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
221 * @param uuid The UUID of the current artifact. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
222 * @param paramType The parameter type (e.g. salinity). |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
223 * @param layerType The layer type. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
224 */ |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
225 protected static void writeLayerMeta( |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
226 CallContext callContext, |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
227 Document document, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
228 Element meta, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
229 String uuid, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
230 String paramType, |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
231 String layerType, |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
232 String shapefileName, |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
233 String layerTitle |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
234 ) { |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
235 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
236 document, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
237 ArtifactNamespaceContext.NAMESPACE_URI, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
238 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
240 Long time = callContext.getTimeToLive(); |
773
5fb1ea68e19c
Avoid danger to get a NullPointerException if no time to live is served by CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
772
diff
changeset
|
241 time = time != null ? time + new Date().getTime() : null; |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
242 String ttl = time != null ? time.toString() : null; |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
243 |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
244 logger.debug("Artifacts time to live: " + ttl); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
245 |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
246 Element layer = creator.create(LayerInfo.LAYER); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
247 Element model = creator.create(LayerInfo.LAYER_MODEL); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
248 Element name = creator.create(LayerInfo.LAYER_NAME); |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
249 Element title = creator.create(LayerInfo.LAYER_TITLE); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
250 Element type = creator.create(LayerInfo.LAYER_TYPE); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
251 Element status = creator.create(LayerInfo.LAYER_STATUS); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
252 Element data = creator.create(LayerInfo.LAYER_DATA); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
253 Element timeToLive = creator.create(NODE_TTL); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
254 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
255 model.setTextContent(paramType); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
256 name.setTextContent(uuid); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
257 type.setTextContent(layerType); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
258 status.setTextContent("OFF"); |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
259 data.setTextContent(shapefileName); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
260 timeToLive.setTextContent(ttl); |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
261 |
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
262 title.setTextContent(layerTitle); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
263 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
264 layer.appendChild(model); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
265 layer.appendChild(name); |
853
164d102b0af5
Fixed Bug in renaming a Layer in Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
807
diff
changeset
|
266 layer.appendChild(title); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
267 layer.appendChild(type); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
268 layer.appendChild(status); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
269 layer.appendChild(data); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
270 layer.appendChild(timeToLive); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
271 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
272 meta.appendChild(layer); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
273 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
773
diff
changeset
|
274 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
773
diff
changeset
|
275 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
276 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
277 * Append polygon layer information to meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
278 * |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
279 * @param context |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
280 * @param document The meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
281 * @param meta The element where the new information need to be appended to. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
282 * @param uuid The UUID of the current artifact. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
283 * @param paramType The parameter type (e.g. salinity). |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
284 */ |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
285 public static void writePolygonMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
286 CallContext context, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
287 Document document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
288 Element meta, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
289 String uuid, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
290 String paramType |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
291 ) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
292 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
293 document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
294 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
295 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
296 |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
297 Long time = context.getTimeToLive(); |
773
5fb1ea68e19c
Avoid danger to get a NullPointerException if no time to live is served by CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
772
diff
changeset
|
298 time = time != null ? time + new Date().getTime() : null; |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
299 String ttl = time != null ? time.toString() : null; |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
300 |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
301 logger.debug("Artifacts time to live: " + ttl); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
302 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
303 Element layer = creator.create(LayerInfo.LAYER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
304 Element model = creator.create(LayerInfo.LAYER_MODEL); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
305 Element name = creator.create(LayerInfo.LAYER_NAME); |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
306 Element title = creator.create(LayerInfo.LAYER_TITLE); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
307 Element type = creator.create(LayerInfo.LAYER_TYPE); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
308 Element status = creator.create(LayerInfo.LAYER_STATUS); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
309 Element data = creator.create(LayerInfo.LAYER_DATA); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
310 Element timeToLive = creator.create(NODE_TTL); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
311 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
312 model.setTextContent(paramType); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
313 name.setTextContent(uuid); |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
314 title.setTextContent( |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
315 (String) context.getContextValue(CONTEXT_LAYER_TITLE)); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
316 type.setTextContent("POLYGON"); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
317 status.setTextContent("OFF"); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
318 data.setTextContent(POLYGON_NAME); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
319 timeToLive.setTextContent(ttl); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
320 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
321 layer.appendChild(model); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
322 layer.appendChild(name); |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
323 layer.appendChild(title); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
324 layer.appendChild(type); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
325 layer.appendChild(status); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
326 layer.appendChild(data); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
327 layer.appendChild(timeToLive); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
328 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
329 meta.appendChild(layer); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
330 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
331 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
332 |
806
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
333 /** |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
334 * Append isoline layer information to meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
335 * |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
336 * @param context |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
337 * @param document The meta document. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
338 * @param meta The element where the new information need to be appended to. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
339 * @param uuid The UUID of the current artifact. |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
340 * @param paramType The parameter type (e.g. salinity). |
2cea76f1112e
Added Javadoc in utils package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
341 */ |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
342 public static void writeIsolineMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
343 CallContext context, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
344 Document document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
345 Element meta, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
346 String uuid, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
347 String paramType |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
348 ) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
349 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
350 document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
351 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
352 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
353 |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
354 Long time = context.getTimeToLive(); |
773
5fb1ea68e19c
Avoid danger to get a NullPointerException if no time to live is served by CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
772
diff
changeset
|
355 time = time != null ? time + new Date().getTime() : null; |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
356 String ttl = time != null ? time.toString() : null; |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
357 |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
358 logger.debug("Artifacts time to live: " + ttl); |
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
359 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
360 Element layer = creator.create(LayerInfo.LAYER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
361 Element model = creator.create(LayerInfo.LAYER_MODEL); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
362 Element name = creator.create(LayerInfo.LAYER_NAME); |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
363 Element title = creator.create(LayerInfo.LAYER_TITLE); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
364 Element type = creator.create(LayerInfo.LAYER_TYPE); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
365 Element status = creator.create(LayerInfo.LAYER_STATUS); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
366 Element data = creator.create(LayerInfo.LAYER_DATA); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
367 Element timeToLive = creator.create(NODE_TTL); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
368 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
369 model.setTextContent(paramType+"_isolines"); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
370 name.setTextContent(uuid); |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
371 title.setTextContent( |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
372 (String) context.getContextValue(CONTEXT_LAYER_TITLE)); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
373 type.setTextContent("LINE"); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
374 status.setTextContent("OFF"); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
375 data.setTextContent(ISOLINES_NAME); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
376 timeToLive.setTextContent(ttl); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
377 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
378 layer.appendChild(model); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
379 layer.appendChild(name); |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
380 layer.appendChild(title); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
381 layer.appendChild(type); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
382 layer.appendChild(status); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
383 layer.appendChild(data); |
772
cd64ab8a46a7
Put time to live of an artifact into meta document which is created while wms publishing (issue197).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
730
diff
changeset
|
384 layer.appendChild(timeToLive); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
385 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
386 meta.appendChild(layer); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
387 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
388 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
389 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |