comparison flys-client/src/main/java/de/intevation/flys/client/server/CreateCollectionServiceImpl.java @ 587:53ad6dd2cb2b

The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project. flys-client/trunk@2181 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 21 Jun 2011 16:22:39 +0000
parents 924da6695800
children ec5c75da5c7a
comparison
equal deleted inserted replaced
586:e3c8e045737b 587:53ad6dd2cb2b
31 { 31 {
32 /** XPath to figure out the uuid of the created collection.*/ 32 /** XPath to figure out the uuid of the created collection.*/
33 public static final String XPATH_COLLECTION_UUID = 33 public static final String XPATH_COLLECTION_UUID =
34 "/art:result/art:artifact-collection/@art:uuid"; 34 "/art:result/art:artifact-collection/@art:uuid";
35 35
36 /** XPath to figure out the ttl of the created collection.*/
37 public static final String XPATH_COLLECTION_TTL =
38 "/art:result/art:artifact-collection/@art:ttl";
39
36 /** Error message key that is thrown if an error occured while creating 40 /** Error message key that is thrown if an error occured while creating
37 * a new collection.*/ 41 * a new collection.*/
38 public static final String ERROR_CREATE_COLLECTION = 42 public static final String ERROR_CREATE_COLLECTION =
39 "error_create_collection"; 43 "error_create_collection";
40 44
53 create, ownerId, new DocumentResponseHandler()); 57 create, ownerId, new DocumentResponseHandler());
54 58
55 String uuid = XMLUtils.xpathString( 59 String uuid = XMLUtils.xpathString(
56 doc, XPATH_COLLECTION_UUID, ArtifactNamespaceContext.INSTANCE); 60 doc, XPATH_COLLECTION_UUID, ArtifactNamespaceContext.INSTANCE);
57 61
58 if (uuid == null || uuid.trim().length() == 0) { 62 String ttlStr = XMLUtils.xpathString(
63 doc, XPATH_COLLECTION_TTL, ArtifactNamespaceContext.INSTANCE);
64
65 if (uuid.trim().length() == 0 || ttlStr.length() == 0) {
59 throw new ServerException(ERROR_CREATE_COLLECTION); 66 throw new ServerException(ERROR_CREATE_COLLECTION);
60 } 67 }
61 68
62 return new DefaultCollection(uuid); 69 return new DefaultCollection(uuid, Long.valueOf(ttlStr));
63 } 70 }
64 catch (ConnectionException ce) { 71 catch (ConnectionException ce) {
65 System.err.println(ce.getLocalizedMessage()); 72 System.err.println(ce.getLocalizedMessage());
66 } 73 }
67 74

http://dive4elements.wald.intevation.org