Mercurial > dive4elements > framework
comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 293:a367a0d011af
Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
artifacts/trunk@2331 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 14 Jul 2011 14:22:23 +0000 |
parents | f5a0f90bcc6f |
children | 0035e2511342 |
comparison
equal
deleted
inserted
replaced
292:39c0ff00d188 | 293:a367a0d011af |
---|---|
69 * This method creates a new CREATE document. | 69 * This method creates a new CREATE document. |
70 * | 70 * |
71 * @return the CREATE document. | 71 * @return the CREATE document. |
72 */ | 72 */ |
73 public static Document newCreateDocument(String factory) { | 73 public static Document newCreateDocument(String factory) { |
74 return newCreateDocument(factory, null); | |
75 } | |
76 | |
77 | |
78 /** | |
79 * This method creates a new CREATE document. | |
80 * | |
81 * @return the CREATE document. | |
82 */ | |
83 public static Document newCreateDocument(String factory, String uuid) { | |
74 Document doc = XMLUtils.newDocument(); | 84 Document doc = XMLUtils.newDocument(); |
75 | 85 |
76 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator( | 86 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator( |
77 doc, | 87 doc, |
78 ArtifactNamespaceContext.NAMESPACE_URI, | 88 ArtifactNamespaceContext.NAMESPACE_URI, |
85 type.setAttribute("name", "create"); | 95 type.setAttribute("name", "create"); |
86 fac.setAttribute("name", factory); | 96 fac.setAttribute("name", factory); |
87 | 97 |
88 action.appendChild(type); | 98 action.appendChild(type); |
89 action.appendChild(fac); | 99 action.appendChild(fac); |
100 | |
101 if (uuid != null) { | |
102 Element templ = cr.create("template"); | |
103 templ.setAttribute("uuid", uuid); | |
104 action.appendChild(templ); | |
105 } | |
106 | |
107 | |
90 | 108 |
91 doc.appendChild(action); | 109 doc.appendChild(action); |
92 | 110 |
93 return doc; | 111 return doc; |
94 } | 112 } |