Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java @ 803:653ae84533e7
Read/create recommended Artifacts and add them to the current Collection.
flys-client/trunk@2350 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 18 Jul 2011 09:52:16 +0000 |
parents | 924da6695800 |
children | 6f65e70fa11d |
comparison
equal
deleted
inserted
replaced
802:d45ad7fd3027 | 803:653ae84533e7 |
---|---|
28 /** The error message key that is thrown if an error occured while artifact | 28 /** The error message key that is thrown if an error occured while artifact |
29 * creation.*/ | 29 * creation.*/ |
30 public static final String ERROR_CREATE_ARTIFACT = "error_create_artifact"; | 30 public static final String ERROR_CREATE_ARTIFACT = "error_create_artifact"; |
31 | 31 |
32 | 32 |
33 public Artifact create(String serverUrl, String locale, String factory) | 33 public Artifact create( |
34 String serverUrl, | |
35 String locale, | |
36 String factory, | |
37 String uuid) | |
34 throws ServerException | 38 throws ServerException |
35 { | 39 { |
36 System.out.println("ArtifactServiceImpl.create"); | 40 System.out.println("ArtifactServiceImpl.create"); |
37 | 41 |
38 Document create = ClientProtocolUtils.newCreateDocument(factory); | 42 Document create = null; |
43 | |
44 if (uuid != null && uuid.length() > 0) { | |
45 create = ClientProtocolUtils.newCreateDocument(factory, uuid); | |
46 } | |
47 else { | |
48 create = ClientProtocolUtils.newCreateDocument(factory); | |
49 } | |
50 | |
39 HttpClient client = new HttpClientImpl(serverUrl, locale); | 51 HttpClient client = new HttpClientImpl(serverUrl, locale); |
40 | 52 |
41 try { | 53 try { |
42 return (Artifact) client.create(create, new FLYSArtifactCreator()); | 54 return (Artifact) client.create(create, new FLYSArtifactCreator()); |
43 } | 55 } |