diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java index bc1e38df9e09c948e421559f408e4b71d85f7bf8..c0b4ee53fe9bf4e5bf855fbebd24d24a678fc254 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java @@ -1036,7 +1036,7 @@ public interface ICommonClientService extends IClientService /** * Schedules archiving of the specified datasets. */ - public ArchivingResult archiveDatasets(DisplayedOrSelectedDatasetCriteria criteria) + public ArchivingResult archiveDatasets(DisplayedOrSelectedDatasetCriteria criteria, boolean removeFromDataStore) throws UserFailureException; /** @@ -1049,7 +1049,7 @@ public interface ICommonClientService extends IClientService * Schedules archiving of the datasets connected to the specified experiments. */ public ArchivingResult archiveDatasets( - DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria) + DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria, boolean removeFromDataStore) throws UserFailureException; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java index 5680753b3f904e6238e54685e764117bec827fbf..2fa01d41886fa64266a39d68ffaad68b5da7cd37 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java @@ -922,9 +922,9 @@ public interface ICommonClientServiceAsync extends IClientServiceAsync DisplayedOrSelectedDatasetCriteria criteria, AsyncCallback<Void> callback); /** - * @see ICommonClientService#archiveDatasets(DisplayedOrSelectedDatasetCriteria) + * @see ICommonClientService#archiveDatasets(DisplayedOrSelectedDatasetCriteria, boolean) */ - public void archiveDatasets(DisplayedOrSelectedDatasetCriteria criteria, + public void archiveDatasets(DisplayedOrSelectedDatasetCriteria criteria, boolean removeFromDataStore, AsyncCallback<ArchivingResult> callback); /** @@ -934,10 +934,10 @@ public interface ICommonClientServiceAsync extends IClientServiceAsync AsyncCallback<ArchivingResult> callback); /** - * @see ICommonClientService#archiveDatasets(DisplayedCriteriaOrSelectedEntityHolder) + * @see ICommonClientService#archiveDatasets(DisplayedCriteriaOrSelectedEntityHolder, boolean) */ public void archiveDatasets( - DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria, + DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria, boolean removeFromDataStore, AsyncCallback<ArchivingResult> callback); /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetArchivingMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetArchivingMenu.java index 0fbe8383659c303be4f058cd4d631730db500e1a..58a016b759f546b8feef327bb31507b551d48b58 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetArchivingMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetArchivingMenu.java @@ -43,10 +43,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMess import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.TextToolItem; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ArchivingResult; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DisplayedOrSelectedDatasetCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ArchivingServiceKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivingStatus; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatastoreServiceDescription; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; /** * 'Archiving' menu for Data Sets. @@ -71,6 +71,7 @@ public class DataSetArchivingMenu extends TextToolItem this.selectedDataSetsGetter = selectedDataSetsGetter; Menu submenu = new Menu(); + addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_BACKUP); addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_ARCHIVE); addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_UNARCHIVE); addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_LOCK); @@ -81,6 +82,7 @@ public class DataSetArchivingMenu extends TextToolItem /** {@link ActionMenu} kind enum with names matching dictionary keys */ private static enum ArchivingActionMenuKind implements IActionMenuItem { + ARCHIVING_MENU_BACKUP(ArchivingServiceKind.BACKUP), ARCHIVING_MENU_ARCHIVE(ArchivingServiceKind.ARCHIVE), ARCHIVING_MENU_UNARCHIVE( ArchivingServiceKind.UNARCHIVE), ARCHIVING_MENU_LOCK(ArchivingServiceKind.LOCK), ARCHIVING_MENU_UNLOCK(ArchivingServiceKind.UNLOCK); @@ -192,9 +194,15 @@ public class DataSetArchivingMenu extends TextToolItem selectedAndDisplayedItems.createCriteria(computeOnSelected); switch (taskKind) { + case BACKUP: + viewContext.getService().archiveDatasets( + criteria, false, + createArchivingDisplayCallback(taskKind.getDescription(), + computeOnSelected)); + break; case ARCHIVE: viewContext.getService().archiveDatasets( - criteria, + criteria, true, createArchivingDisplayCallback(taskKind.getDescription(), computeOnSelected)); break; @@ -307,6 +315,8 @@ public class DataSetArchivingMenu extends TextToolItem { switch (taskKind) { + case BACKUP: + return DataSetArchivingStatus.AVAILABLE; case ARCHIVE: return DataSetArchivingStatus.AVAILABLE; case UNARCHIVE: diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentDataSetArchivingMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentDataSetArchivingMenu.java index 59627d5eb0bcd1a971033c1b1f9a9a4e7649aeab..7050ee85a0f112188ae19b7809c890ad1a455f22 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentDataSetArchivingMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentDataSetArchivingMenu.java @@ -53,8 +53,8 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; /** - * 'Archiving' menu for data sets connected to experiments. Here, experiments are the central - * entity, as opposed to {@link DataSetArchivingMenu}, where data sets are the central entity. + * 'Archiving' menu for data sets connected to experiments. Here, experiments are the central entity, as opposed to {@link DataSetArchivingMenu}, + * where data sets are the central entity. * * @author Piotr Buczek * @author Chandrasekhar Ramakrishnan @@ -77,6 +77,7 @@ public class ExperimentDataSetArchivingMenu extends TextToolItem this.selectedDataSetsGetter = selectedDataSetsGetter; Menu submenu = new Menu(); + addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_BACKUP); addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_ARCHIVE); addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_UNARCHIVE); addMenuItem(submenu, ArchivingActionMenuKind.ARCHIVING_MENU_LOCK); @@ -87,6 +88,7 @@ public class ExperimentDataSetArchivingMenu extends TextToolItem /** {@link ActionMenu} kind enum with names matching dictionary keys */ private static enum ArchivingActionMenuKind implements IActionMenuItem { + ARCHIVING_MENU_BACKUP(ArchivingServiceKind.BACKUP), ARCHIVING_MENU_ARCHIVE(ArchivingServiceKind.ARCHIVE), ARCHIVING_MENU_UNARCHIVE( ArchivingServiceKind.UNARCHIVE), ARCHIVING_MENU_LOCK(ArchivingServiceKind.LOCK), ARCHIVING_MENU_UNLOCK(ArchivingServiceKind.UNLOCK); @@ -199,13 +201,19 @@ public class ExperimentDataSetArchivingMenu extends TextToolItem @Override public void execute(DatastoreServiceDescription service, boolean computeOnSelected) { - DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria = + DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria = selectedAndDisplayedItems.createCriteria(computeOnSelected); switch (taskKind) { + case BACKUP: + viewContext.getService().archiveDatasets( + criteria, false, + createArchivingDisplayCallback(taskKind.getDescription(), + computeOnSelected)); + break; case ARCHIVE: viewContext.getService().archiveDatasets( - criteria, + criteria, true, createArchivingDisplayCallback(taskKind.getDescription(), computeOnSelected)); break; @@ -320,6 +328,8 @@ public class ExperimentDataSetArchivingMenu extends TextToolItem { switch (taskKind) { + case BACKUP: + return DataSetArchivingStatus.AVAILABLE; case ARCHIVE: return DataSetArchivingStatus.AVAILABLE; case UNARCHIVE: @@ -381,11 +391,11 @@ public class ExperimentDataSetArchivingMenu extends TextToolItem { this.displayedItemsConfig = displayedItemsConfig; this.selectedItems = selectedItems; -// this.selectedItems = new ArrayList<Experiment>(); -// for (TableModelRowWithObject<Experiment> row : selectedItems) -// { -// this.selectedItems.add(row.getObjectOrNull()); -// } + // this.selectedItems = new ArrayList<Experiment>(); + // for (TableModelRowWithObject<Experiment> row : selectedItems) + // { + // this.selectedItems.add(row.getObjectOrNull()); + // } this.displayedItemsCount = displayedItemsCount; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java index 7d91df593f36fc5c53258e30900ea250a5f2620b..b236076b2c7b4f356fa86efda8df09e319816829 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java @@ -2255,11 +2255,11 @@ public final class CommonClientService extends AbstractClientService implements @Override public ArchivingResult archiveDatasets( - DisplayedOrSelectedDatasetCriteria displayedOrSelectedDatasetCriteria) + DisplayedOrSelectedDatasetCriteria displayedOrSelectedDatasetCriteria, boolean removeFromDataStore) { final String sessionToken = getSessionToken(); List<String> datasetCodes = extractDatasetCodes(displayedOrSelectedDatasetCriteria); - int result = commonServer.archiveDatasets(sessionToken, datasetCodes, true); + int result = commonServer.archiveDatasets(sessionToken, datasetCodes, removeFromDataStore); return new ArchivingResult(datasetCodes.size(), result); } @@ -2580,11 +2580,11 @@ public final class CommonClientService extends AbstractClientService implements @Override public ArchivingResult archiveDatasets( - DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria) + DisplayedCriteriaOrSelectedEntityHolder<TableModelRowWithObject<Experiment>> criteria, boolean removeFromDataStore) { final String sessionToken = getSessionToken(); List<String> datasetCodes = extractDatasetCodes(criteria); - int result = commonServer.archiveDatasets(sessionToken, datasetCodes, true); + int result = commonServer.archiveDatasets(sessionToken, datasetCodes, removeFromDataStore); return new ArchivingResult(datasetCodes.size(), result); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ArchivingServiceKind.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ArchivingServiceKind.java index 7db6acf72b0d8daeed6189c9aff40f14b502ddfb..a9e840db6c7e964b846e3de2b981b5a1ac831cf7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ArchivingServiceKind.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ArchivingServiceKind.java @@ -23,7 +23,7 @@ import java.io.Serializable; */ public enum ArchivingServiceKind implements Serializable { - ARCHIVE("Archiving"), UNARCHIVE("Unarchiving"), LOCK("Disable Archiving"), UNLOCK( + BACKUP("Backup Archiving"), ARCHIVE("Archiving"), UNARCHIVE("Unarchiving"), LOCK("Disable Archiving"), UNLOCK( "Enable Archiving"); private final String description; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js index 786e51ca1496721ae1d265398e1881d8c7c9cb23..3c153d78214384b9eb0653f962fd891a51554af8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/common-dictionary.js @@ -532,6 +532,7 @@ var common = { menu_processing: "Actions", menu_archiving: "Archiving", + ARCHIVING_MENU_BACKUP: "Add to Archive", ARCHIVING_MENU_ARCHIVE: "Archive", ARCHIVING_MENU_UNARCHIVE: "Unarchive", ARCHIVING_MENU_LOCK: "Disable",