diff flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java @ 67:74257b95567b

Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems. flys-client/trunk@1567 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 25 Mar 2011 09:19:29 +0000
parents
children c8cd1b918901
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java	Fri Mar 25 09:19:29 2011 +0000
@@ -0,0 +1,61 @@
+package de.intevation.flys.client.shared.model;
+
+import java.util.List;
+
+
+/**
+ * The default implementation of a CollectionItem.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class DefaultCollectionItem implements CollectionItem {
+
+    /** The identifier that specifies the artifact related to this item.*/
+    protected String identifier;
+
+    /** The list of output modes supported by the artifact of this item.*/
+    protected List<OutputMode> outputModes;
+
+
+    /**
+     * An empty constructor.
+     */
+    public DefaultCollectionItem() {
+    }
+
+
+    /**
+     * The default constructor to create a new CollectionItem related to an
+     * artifact with output modes.
+     *
+     * @param identifier The identifier of an artifact.
+     * @param outputModes The output modes supported by this item.
+     */
+    public DefaultCollectionItem(String identifier, List<OutputMode> modes) {
+        this.identifier  = identifier;
+        this.outputModes = modes;
+    }
+
+
+    public String identifier() {
+        return identifier;
+    }
+
+
+    public List<OutputMode> getOutputModes() {
+        return outputModes;
+    }
+
+
+    public List<Facet> getFacets(String outputmode) {
+        for (OutputMode mode: outputModes) {
+            if (outputmode.equals(mode.getName())) {
+                // TODO Return facets, but facets are not implemented for
+                // OutputModes yet!
+            }
+        }
+
+        return null;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org