diff flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.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 a13382876e5d
children 3acc631efdf0
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java	Tue Jun 21 16:14:10 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java	Tue Jun 21 16:22:39 2011 +0000
@@ -30,6 +30,8 @@
         setName(name != null && name.length() > 0
             ? name
             : collection.identifier());
+
+        setTTL(collection.getTTL());
     }
 
 
@@ -73,6 +75,21 @@
     }
 
 
+    public void setTTL(long ttl) {
+        if (ttl == 0) {
+            setAttribute("ttl", "star_gold");
+        }
+        else {
+            setAttribute("ttl", "star_silver");
+        }
+    }
+
+
+    public String getTTL() {
+        return getAttribute("ttl");
+    }
+
+
     /**
      * Returns the collection objects itself.
      *

http://dive4elements.wald.intevation.org