changeset 830:3dde14f0bd98

Datacage: Added models better suited for creating artifact facet filters. flys-client/trunk@2538 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 23 Aug 2011 16:30:22 +0000
parents f14cefeed243
children 9101b4d64666
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/shared/model/ArtifactFilter.java flys-client/src/main/java/de/intevation/flys/client/shared/model/FacetFilter.java flys-client/src/main/java/de/intevation/flys/client/shared/model/OutFilter.java
diffstat 4 files changed, 139 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Aug 23 13:57:54 2011 +0000
+++ b/flys-client/ChangeLog	Tue Aug 23 16:30:22 2011 +0000
@@ -1,3 +1,11 @@
+2011-08-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de> 
+
+	* src/main/java/de/intevation/flys/client/shared/model/ArtifactFilter.java,
+	  src/main/java/de/intevation/flys/client/shared/model/FacetFilter.java,
+	  src/main/java/de/intevation/flys/client/shared/model/OutFilter.java:
+	  New. Models which are better suited for creating artifact facet filters.
+	  TODO: Re-factor ToLoad to create these models.
+
 2011-08-23  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/ArtifactFilter.java	Tue Aug 23 16:30:22 2011 +0000
@@ -0,0 +1,41 @@
+package de.intevation.flys.client.shared.model;
+
+import java.io.Serializable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ArtifactFilter
+implements   Serializable
+{
+    protected String factoryName;
+
+    protected Map<String, OutFilter> outFilters;
+
+    public ArtifactFilter() {
+        outFilters = new HashMap<String, OutFilter>();
+    }
+
+    public ArtifactFilter(String factoryName) {
+        this.factoryName = factoryName;
+    }
+
+    public String getFactoryName() {
+        return factoryName;
+    }
+
+    public void setFactoryName(String factoryName) {
+        this.factoryName = factoryName;
+    }
+
+    public void add(String out, String name, String num) {
+        OutFilter outFilter = outFilters.get(out);
+
+        if (outFilter == null) {
+            outFilter = new OutFilter(out);
+            outFilters.put(out, outFilter);
+        }
+        outFilter.add(name, num);
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/FacetFilter.java	Tue Aug 23 16:30:22 2011 +0000
@@ -0,0 +1,43 @@
+package de.intevation.flys.client.shared.model;
+
+import java.io.Serializable;
+
+public class FacetFilter
+implements   Serializable
+{
+    protected String name;
+    protected String num;
+
+    public FacetFilter() {
+    }
+
+    public FacetFilter(String name, String num) {
+        this.name = name;
+        this.num  = num;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public boolean equals(Object other) {
+        if (!(other instanceof FacetFilter)) {
+            return false;
+        }
+        FacetFilter o = (FacetFilter)other;
+        return o.name.equals(name) && o.num.equals(num);
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/OutFilter.java	Tue Aug 23 16:30:22 2011 +0000
@@ -0,0 +1,47 @@
+package de.intevation.flys.client.shared.model;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OutFilter
+implements   Serializable
+{
+    protected String out;
+
+    protected List<FacetFilter> facetFilters;
+
+    public OutFilter() {
+        facetFilters = new ArrayList<FacetFilter>();
+    }
+
+    public OutFilter(String out) {
+        this();
+        this.out = out;
+    }
+
+    public String getOut() {
+        return out;
+    }
+
+    public void setOut(String out) {
+        this.out = out;
+    }
+
+    public void add(String name, String num) {
+        FacetFilter facetFilter = new FacetFilter(name, num);
+        if (!facetFilters.contains(facetFilter)) {
+            facetFilters.add(facetFilter);
+        }
+    }
+
+    public List<FacetFilter> getFacetFilters() {
+        return facetFilters;
+    }
+
+    public void setFacetFilters(List<FacetFilter> facetFilters) {
+        this.facetFilters = facetFilters;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org