changeset 1319:6ba17b628552

Added RemoveArtifactService. flys-client/trunk@2960 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 13 Oct 2011 12:28:21 +0000 (2011-10-13)
parents ecd0243bc09e
children 5733c05ce24c
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/services/RemoveArtifactService.java flys-client/src/main/java/de/intevation/flys/client/client/services/RemoveArtifactServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/server/RemoveArtifactServiceImpl.java flys-client/src/main/webapp/WEB-INF/web.xml
diffstat 5 files changed, 103 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Oct 13 12:25:07 2011 +0000
+++ b/flys-client/ChangeLog	Thu Oct 13 12:28:21 2011 +0000
@@ -1,3 +1,14 @@
+2011-10-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Added implementation and configuration of RemoveArtifactService.
+
+	* src/main/java/de/intevation/flys/client/server/RemoveArtifactServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/client/services/RemoveArtifactServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/RemoveArtifactService.java:
+	  New files with implementation of RemoveArtifactService.
+
+	* src/main/webapp/WEB-INF/web.xml: Register new servlet/service.
+
 2011-10-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/CollectionHelper.java,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/RemoveArtifactService.java	Thu Oct 13 12:28:21 2011 +0000
@@ -0,0 +1,35 @@
+package de.intevation.flys.client.client.services;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+import de.intevation.flys.client.shared.exceptions.ServerException;
+import de.intevation.flys.client.shared.model.Collection;
+
+
+/**
+ * This interface describes the service to remove an existing artifact to an
+ * existing collection.
+ *
+ */
+@RemoteServiceRelativePath("remove-artifact")
+public interface RemoveArtifactService extends RemoteService {
+
+    /**
+     * Removes an artifact from a collection.
+     *
+     * @param collection The Collection that should be modified.
+     * @param artifactId The artifact that should be removed.
+     * @param url        The url of the artifact server.
+     * @param locale     locae to use (for localized responses).
+     *
+     * @return the Collection after the operation.
+     */
+    Collection remove(
+        Collection collection,
+        String     artifactId,
+        String     url,
+        String     locale)
+    throws ServerException;
+}
+// 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/client/services/RemoveArtifactServiceAsync.java	Thu Oct 13 12:28:21 2011 +0000
@@ -0,0 +1,20 @@
+package de.intevation.flys.client.client.services;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import de.intevation.flys.client.shared.model.Artifact;
+import de.intevation.flys.client.shared.model.Collection;
+
+/**
+ * @see RemoveArtifactService, RemoveArtifactServiceImpl
+ */
+public interface RemoveArtifactServiceAsync {
+
+    public void remove(
+        Collection collection,
+        String     artifactId,
+        String     url,
+        String     locale,
+        AsyncCallback<Collection> callback);
+}
+// 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/server/RemoveArtifactServiceImpl.java	Thu Oct 13 12:28:21 2011 +0000
@@ -0,0 +1,27 @@
+package de.intevation.flys.client.server;
+
+import de.intevation.flys.client.shared.exceptions.ServerException;
+import de.intevation.flys.client.shared.model.Collection;
+import de.intevation.flys.client.client.services.RemoveArtifactService;
+
+
+/**
+ * Implementation of RemoveArtifactService .
+ */
+public class RemoveArtifactServiceImpl
+extends      DescribeCollectionServiceImpl
+implements   RemoveArtifactService
+{
+    public Collection remove(
+        Collection collection,
+        String     artifactId,
+        String     url,
+        String     locale)
+    throws ServerException
+    {
+        System.out.println("RemoveArtifactServiceImpl.remove");
+
+        return CollectionHelper.removeArtifact(collection, artifactId, url, locale);
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/webapp/WEB-INF/web.xml	Thu Oct 13 12:25:07 2011 +0000
+++ b/flys-client/src/main/webapp/WEB-INF/web.xml	Thu Oct 13 12:28:21 2011 +0000
@@ -287,6 +287,16 @@
     <url-pattern>/flys/describe</url-pattern>
   </servlet-mapping>
 
+  <servlet>
+    <servlet-name>remove-artifact</servlet-name>
+    <servlet-class>de.intevation.flys.client.server.RemoveArtifactServiceImpl</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>remove-artifact</servlet-name>
+    <url-pattern>/flys/remove-artifact</url-pattern>
+  </servlet-mapping>
+
   <!-- Default page to serve -->
   <welcome-file-list>
     <welcome-file>FLYS.html</welcome-file>

http://dive4elements.wald.intevation.org