Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java @ 735:d47901df0a14
Integrated the handling of AutoResumeStates into the initialization Process of an Artifact.
gnv-artifacts/trunk@773 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 15 Mar 2010 12:50:08 +0000 |
parents | 452fad121560 |
children | cd64ab8a46a7 |
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; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import org.apache.log4j.Logger; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.w3c.dom.Document; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.Element; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
13 import de.intevation.artifactdatabase.XMLUtils; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
14 import de.intevation.artifacts.ArtifactNamespaceContext; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
15 import de.intevation.artifacts.CallContext; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
16 import de.intevation.gnv.artifacts.context.GNVArtifactContext; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
17 import de.intevation.gnv.wms.LayerInfo; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
18 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 /** |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 */ |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 public class MetaWriter { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 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
|
25 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public static final String NODE_MAPSERVER = "mapserver"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 public static final String NODE_SERVER = "server"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 public static final String NODE_MAP = "map"; |
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 META_FILE_NAME = "meta.xml"; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 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
|
32 public static final String POLYGON_NAME = "polygons.shp"; |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
33 public static final String LAYER_DATA_NAME = "data.shp"; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
35 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
|
36 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 private MetaWriter() { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 } |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
39 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
40 public static Document writeLayerMeta(CallContext context, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
41 String uuid, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
42 String path, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
43 String paramType, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
44 String layerType){ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
45 Document meta = XMLUtils.newDocument(); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
46 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
47 meta, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
48 ArtifactNamespaceContext.NAMESPACE_URI, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
49 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
50 Element root = creator.create("meta"); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
51 meta.appendChild(root); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
52 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
53 writeAbstractMeta(context, meta, root); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
54 writeLayerMeta(context, meta, root, uuid, paramType,layerType); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
55 boolean success = writeMetaFile(path, meta); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
56 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
57 if (success){ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
58 return meta; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
59 }else{ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
60 return null; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
61 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
62 } |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 public static Document writeHorizontalcrosssectionMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 CallContext context, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 String uuid, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 String path, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 String paramType) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 Document meta = XMLUtils.newDocument(); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 meta, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 Element root = creator.create("meta"); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 meta.appendChild(root); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 writeAbstractMeta(context, meta, root); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 writePolygonMeta(context, meta, root, uuid, path, paramType); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 writeIsolineMeta(context, meta, root, uuid, path, paramType); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
83 boolean success = writeMetaFile(path, meta); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
84 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
85 if (success){ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
86 return meta; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
87 }else{ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
88 return null; |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
89 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
90 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
91 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
92 /** |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
93 * @param path |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
94 * @param meta |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
95 */ |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
96 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
|
97 try { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 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
|
99 |
730
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
100 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
|
101 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
|
102 metaFile.delete(); |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
103 } |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
104 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 if (!metaFile.createNewFile() || !metaFile.canWrite()) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 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
|
107 return false; |
647
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 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 OutputStream out = null; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 boolean success = false; |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 try { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 out = new FileOutputStream(metaFile); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 success = XMLUtils.toStream(meta, out); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 finally { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 if (out != null) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 try { out.close(); } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 catch (IOException ioe) {} |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 if (!success && metaFile.exists()) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 metaFile.delete(); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
127 return success; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 catch (FileNotFoundException fnfe) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 logger.error(fnfe); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
131 return false; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 catch (IOException ioe) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 logger.error(ioe, ioe); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
135 return false; |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 public static void writeAbstractMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 CallContext callContext, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 Document document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 Element meta |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 ) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 GNVArtifactContext context = |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 (GNVArtifactContext) callContext.globalContext(); |
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 String server = (String) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 context.get(GNVArtifactContext.MAPSERVER_SERVER_PATH_KEY); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 String map = (String) |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 context.get(GNVArtifactContext.MAPSERVER_MAP_PATH_KEY); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 logger.debug("MAPSERVER PATH: " + server); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 logger.debug("MAP PATH: " + map); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 Element mapserver = creator.create(NODE_MAPSERVER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 Element serverPath = creator.create(NODE_SERVER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 Element mapPath = creator.create(NODE_MAP); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 mapPath.setTextContent(map); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 serverPath.setTextContent(server); |
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 mapserver.appendChild(serverPath); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 mapserver.appendChild(mapPath); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 meta.appendChild(mapserver); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
174 protected static void writeLayerMeta( |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
175 CallContext context, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
176 Document document, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
177 Element meta, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
178 String uuid, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
179 String paramType, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
180 String layerType |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
181 ) { |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
182 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
183 document, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
184 ArtifactNamespaceContext.NAMESPACE_URI, |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
185 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
187 Element layer = creator.create(LayerInfo.LAYER); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
188 Element model = creator.create(LayerInfo.LAYER_MODEL); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
189 Element name = creator.create(LayerInfo.LAYER_NAME); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
190 Element type = creator.create(LayerInfo.LAYER_TYPE); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
191 Element status = creator.create(LayerInfo.LAYER_STATUS); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
192 Element data = creator.create(LayerInfo.LAYER_DATA); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
193 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
194 model.setTextContent(paramType); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
195 name.setTextContent(uuid); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
196 type.setTextContent(layerType); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
197 status.setTextContent("OFF"); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
198 data.setTextContent(LAYER_DATA_NAME); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
199 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
200 layer.appendChild(model); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
201 layer.appendChild(name); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
202 layer.appendChild(type); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
203 layer.appendChild(status); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
204 layer.appendChild(data); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
205 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
206 meta.appendChild(layer); |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
207 } |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
208 |
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
209 |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 public static void writePolygonMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 CallContext context, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 Document document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 Element meta, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 String uuid, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 String path, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 String paramType |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 ) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 Element layer = creator.create(LayerInfo.LAYER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 Element model = creator.create(LayerInfo.LAYER_MODEL); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 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
|
226 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
|
227 Element type = creator.create(LayerInfo.LAYER_TYPE); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
228 Element status = creator.create(LayerInfo.LAYER_STATUS); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 Element data = creator.create(LayerInfo.LAYER_DATA); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 model.setTextContent(paramType); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 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
|
233 title.setTextContent( |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
234 (String) context.getContextValue(CONTEXT_LAYER_TITLE)); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 type.setTextContent("POLYGON"); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
236 status.setTextContent("OFF"); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 data.setTextContent(POLYGON_NAME); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 layer.appendChild(model); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 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
|
241 layer.appendChild(title); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 layer.appendChild(type); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 layer.appendChild(status); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 layer.appendChild(data); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 meta.appendChild(layer); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 public static void writeIsolineMeta( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 CallContext context, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 Document document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 Element meta, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 String uuid, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
255 String path, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 String paramType |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 ) { |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 document, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 ArtifactNamespaceContext.NAMESPACE_URI, |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 Element layer = creator.create(LayerInfo.LAYER); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
264 Element model = creator.create(LayerInfo.LAYER_MODEL); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
265 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
|
266 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
|
267 Element type = creator.create(LayerInfo.LAYER_TYPE); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
268 Element status = creator.create(LayerInfo.LAYER_STATUS); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
269 Element data = creator.create(LayerInfo.LAYER_DATA); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
270 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 model.setTextContent(paramType+"_isolines"); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 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
|
273 title.setTextContent( |
452fad121560
Implemented code for changing the title of a wms layer (issue198).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
655
diff
changeset
|
274 (String) context.getContextValue(CONTEXT_LAYER_TITLE)); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 type.setTextContent("LINE"); |
655
6eccb68a8b99
Added WMS-Publishing to Product Layer
Tim Englich <tim.englich@intevation.de>
parents:
647
diff
changeset
|
276 status.setTextContent("OFF"); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
277 data.setTextContent(ISOLINES_NAME); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
278 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 layer.appendChild(model); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 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
|
281 layer.appendChild(title); |
647
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
282 layer.appendChild(type); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
283 layer.appendChild(status); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
284 layer.appendChild(data); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
285 |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
286 meta.appendChild(layer); |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
287 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
288 } |
bb0aa1f81280
Added missing class MetaWriter from last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
289 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |