comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 110:ff3335057f11

Improved the WINFO artifact. Describe() returns the uuid and the hash of the artifact instead of just nothing. flys-artifacts/trunk@1296 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 04 Feb 2011 16:57:08 +0000
parents 9891d133f08d
children 0fab16cb4d44
comparison
equal deleted inserted replaced
109:9891d133f08d 110:ff3335057f11
1 package de.intevation.flys.artifacts; 1 package de.intevation.flys.artifacts;
2 2
3 import java.io.IOException;
4 import java.io.OutputStream;
5 import java.util.List; 3 import java.util.List;
6 4
7 import javax.xml.xpath.XPathConstants;
8
9 import org.w3c.dom.Document; 5 import org.w3c.dom.Document;
6 import org.w3c.dom.Element;
10 7
11 import org.apache.log4j.Logger; 8 import org.apache.log4j.Logger;
12 9
13 import de.intevation.artifacts.ArtifactFactory; 10 import de.intevation.artifacts.ArtifactFactory;
11 import de.intevation.artifacts.ArtifactNamespaceContext;
14 import de.intevation.artifacts.CallContext; 12 import de.intevation.artifacts.CallContext;
15 13
16 import de.intevation.artifacts.common.utils.XMLUtils;
17
18 import de.intevation.artifactdatabase.DefaultArtifact; 14 import de.intevation.artifactdatabase.DefaultArtifact;
15 import de.intevation.artifactdatabase.ProtocolUtils;
19 import de.intevation.artifactdatabase.state.State; 16 import de.intevation.artifactdatabase.state.State;
20 import de.intevation.artifactdatabase.state.StateEngine; 17 import de.intevation.artifactdatabase.state.StateEngine;
18
19 import de.intevation.artifacts.common.utils.XMLUtils;
21 20
22 import de.intevation.flys.artifacts.context.FLYSContext; 21 import de.intevation.flys.artifacts.context.FLYSContext;
23 22
24 23
25 /** 24 /**
44 43
45 /** 44 /**
46 * The default constructor. 45 * The default constructor.
47 */ 46 */
48 public WINFOArtifact() { 47 public WINFOArtifact() {
49 super();
50 } 48 }
51 49
52 50
53 /** 51 /**
54 * Set the current state of this artifact. 52 * Set the current state of this artifact.
97 * @param CallContext The CallContext. 95 * @param CallContext The CallContext.
98 * 96 *
99 * @return the description of this artifact. 97 * @return the description of this artifact.
100 */ 98 */
101 public Document describe(Document data, CallContext context) { 99 public Document describe(Document data, CallContext context) {
102 logger.debug("Describe the artifact."); 100 logger.debug("Describe: the current state is: " + currentState.getID());
103 logger.debug("The current state is: " + currentState.getID());
104 101
105 return super.describe(data, context); 102 Document description = XMLUtils.newDocument();
103
104 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
105 description,
106 ArtifactNamespaceContext.NAMESPACE_URI,
107 ArtifactNamespaceContext.NAMESPACE_PREFIX);
108
109 Element root = ProtocolUtils.createRootNode(creator);
110 ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash());
111
112 logger.warn("TODO: Implement the whole description!");
113
114 description.appendChild(root);
115
116 return description;
106 } 117 }
107 } 118 }
108 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 119 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org