Mercurial > dive4elements > river
changeset 11:6aeb4072eeb4
Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
flys-client/trunk@1320 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 16 Feb 2011 15:40:17 +0000 |
parents | fc616c192902 |
children | fa0aad20af53 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java flys-client/src/main/webapp/WEB-INF/web.xml |
diffstat | 5 files changed, 101 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Wed Feb 16 15:35:17 2011 +0000 +++ b/flys-client/ChangeLog Wed Feb 16 15:40:17 2011 +0000 @@ -1,3 +1,17 @@ +2011-02-16 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java, + src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java, + src/main/java/de/intevation/flys/client/client/services/ArtifactService.java: + New. Interface descriptions and the server implementation of an artifact + service that provides basic methods for working with artifacts. + + NOTE: The implementation is currently just a stub. The artifact creation + needs to be implemented. + + * src/main/webapp/WEB-INF/web.xml: Added a servlet for the artifact + interface. + 2011-02-16 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/shared/model/Artifact.java:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java Wed Feb 16 15:40:17 2011 +0000 @@ -0,0 +1,26 @@ +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.model.Artifact; + +/** + * This interface provides artifact specific services as CREATE, DESCRIBE, FEED, + * ADVANCE and OUT. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +@RemoteServiceRelativePath("artifact") +public interface ArtifactService extends RemoteService { + + /** + * This method creates a new artifact based on the given <i>factory</i>. + * + * @param factory The factory that should be used for the artifact creation. + * + * @return the new artifact. + */ + public Artifact create(String factory); +} +// 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/ArtifactServiceAsync.java Wed Feb 16 15:40:17 2011 +0000 @@ -0,0 +1,18 @@ +package de.intevation.flys.client.client.services; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +import de.intevation.flys.client.shared.model.Artifact; + + +/** + * This interface provides artifact specific services as CREATE, DESCRIBE, FEED, + * ADVANCE and OUT. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public interface ArtifactServiceAsync { + + public void create(String factory, AsyncCallback<Artifact> 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/ArtifactServiceImpl.java Wed Feb 16 15:40:17 2011 +0000 @@ -0,0 +1,33 @@ +package de.intevation.flys.client.server; + +import org.w3c.dom.Document; + +import com.google.gwt.user.server.rpc.RemoteServiceServlet; + +import com.google.gwt.core.client.GWT; + +import de.intevation.artifacts.common.utils.ClientProtocolUtils; +import de.intevation.artifacts.common.utils.XMLUtils; + +import de.intevation.flys.client.shared.model.Artifact; +import de.intevation.flys.client.client.services.ArtifactService; + + +/** + * This interface provides artifact specific services as CREATE, DESCRIBE, FEED, + * ADVANCE and OUT. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class ArtifactServiceImpl +extends RemoteServiceServlet +implements ArtifactService +{ + public Artifact create(String factory) { + Document create = ClientProtocolUtils.newCreateDocument(factory); + + // TODO Implement the artifact creation. + return null; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/webapp/WEB-INF/web.xml Wed Feb 16 15:35:17 2011 +0000 +++ b/flys-client/src/main/webapp/WEB-INF/web.xml Wed Feb 16 15:40:17 2011 +0000 @@ -16,6 +16,16 @@ <url-pattern>/flys/user</url-pattern> </servlet-mapping> + <servlet> + <servlet-name>artifact</servlet-name> + <servlet-class>de.intevation.flys.client.server.ArtifactServiceImpl</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>artifact</servlet-name> + <url-pattern>/flys/artifact</url-pattern> + </servlet-mapping> + <!-- Default page to serve --> <welcome-file-list> <welcome-file>FLYS.html</welcome-file>