From ecd6cfb4b1941b1780285bbd4c1b14d8b13222b0 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Mon, 29 Nov 2010 12:58:06 +0000
Subject: [PATCH] LMS-1897 Extended interface for the GUI to invoke methods
 that perform batch experiment update.

SVN: 18919
---
 .../web/client/IGenericClientService.java     |  9 ++++++++
 .../client/IGenericClientServiceAsync.java    |  7 +++++++
 .../web/server/GenericClientService.java      | 21 +++++++++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java
index c8837dde7d6..0b4c4125f90 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientService.java
@@ -98,6 +98,15 @@ public interface IGenericClientService extends IClientService
     public List<BatchRegistrationResult> updateSamples(final SampleType sampleType,
             final String sessionKey, String defaultGroupIdentifier) throws UserFailureException;
 
+    /**
+     * Updates experiments from files which have been previously uploaded.
+     * <p>
+     * Uploaded files can be found as session attribute under given <var>sessionKey</var>.
+     * </p>
+     */
+    public List<BatchRegistrationResult> updateExperiments(final ExperimentType experimentType,
+            final String sessionKey) throws UserFailureException;
+
     /**
      * For given {@link TechId} returns corresponding {@link Material}.
      */
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java
index dc481130f99..382b42a679b 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/IGenericClientServiceAsync.java
@@ -83,6 +83,13 @@ public interface IGenericClientServiceAsync extends IClientServiceAsync
             final AsyncCallback<List<BatchRegistrationResult>> asyncCallback)
             throws UserFailureException;
 
+    /**
+     * @see IGenericClientService#updateExperiments(ExperimentType, String)
+     */
+    public void updateExperiments(final ExperimentType experimentType, final String sessionKey,
+            final AsyncCallback<List<BatchRegistrationResult>> asyncCallback)
+            throws UserFailureException;
+
     /**
      * @see IGenericClientService#getMaterialInfo(TechId)
      */
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java
index 450869f4ae5..2b8d7910c64 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/GenericClientService.java
@@ -572,4 +572,25 @@ public class GenericClientService extends AbstractClientService implements IGene
             cleanUploadedFiles(sessionKey, session, uploadedFiles);
         }
     }
+
+    public List<BatchRegistrationResult> updateExperiments(ExperimentType experimentType,
+            String sessionKey)
+            throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException
+    {
+
+        // BatchSamplesOperation info =
+        // parseSamples(sampleType, sessionKey, defaultGroupIdentifier, false, true,
+        // BatchOperationKind.UPDATE);
+        // try
+        // {
+        // final String sessionToken = getSessionToken();
+        // genericServer.updateSamples(sessionToken, info.getSamples());
+        // return info.getResultList();
+        // } catch (final ch.systemsx.cisd.common.exceptions.UserFailureException e)
+        // {
+        // throw UserFailureExceptionTranslator.translate(e);
+        // }
+
+        return new ArrayList<BatchRegistrationResult>();
+    }
 }
-- 
GitLab