# HG changeset patch # User Felix Wolfsteller # Date 1318508901 0 # Node ID 6ba17b628552998e57f1b6d38d85c8303d1bd978 # Parent ecd0243bc09e33bf201cff208d9e35b473fe846e Added RemoveArtifactService. flys-client/trunk@2960 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r ecd0243bc09e -r 6ba17b628552 flys-client/ChangeLog --- 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 + + 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 * src/main/java/de/intevation/flys/client/server/CollectionHelper.java, diff -r ecd0243bc09e -r 6ba17b628552 flys-client/src/main/java/de/intevation/flys/client/client/services/RemoveArtifactService.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 : diff -r ecd0243bc09e -r 6ba17b628552 flys-client/src/main/java/de/intevation/flys/client/client/services/RemoveArtifactServiceAsync.java --- /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 callback); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r ecd0243bc09e -r 6ba17b628552 flys-client/src/main/java/de/intevation/flys/client/server/RemoveArtifactServiceImpl.java --- /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 : diff -r ecd0243bc09e -r 6ba17b628552 flys-client/src/main/webapp/WEB-INF/web.xml --- 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 @@ /flys/describe + + remove-artifact + de.intevation.flys.client.server.RemoveArtifactServiceImpl + + + + remove-artifact + /flys/remove-artifact + + FLYS.html