diff --git a/CHANGELOG.md b/CHANGELOG.md
index c458be6..7ee7a17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.4.0-SNAPSHOT] - 2021-05-10
+
+#### Enhancements
+
+[#21379] Moved to new ws-synchronized-module-library (based on w-thredds 1.x) and performed UMA tokens "context switches"
+[#21444] Moved to maven-portal-bom >= 3.6.2-SNAPSHOT
+
## [v1.3.0] - 2021-03-17
[#20847] Support the roles of THREDDS Admin and THREDDS Publisher
diff --git a/pom.xml b/pom.xml
index 0914765..008063e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.gcube.portlets.widgets
ws-thredds-sync-widget
jar
- 1.3.0
+ 1.4.0-SNAPSHOT
ws-thredds-sync-widget
gCube ws-thredds-sync-widget is a widget to use and interact with ws-thredds facility in order to syncronize the Workspace folders with Thredds Reporitory folders
@@ -42,7 +42,7 @@
org.gcube.distribution
maven-portal-bom
- 3.6.0
+ 3.6.2-SNAPSHOT
pom
import
@@ -62,19 +62,6 @@
gwt-bootstrap
-
-
- org.gcube.common.portal
- portal-manager
- provided
-
-
-
- com.liferay.portal
- portal-service
- provided
-
-
org.gcube.dvos
@@ -88,34 +75,34 @@
[1.0.0, 2.0.0-SNAPSHOT)
-
-
-
-
-
-
-
- org.gcube.common
- authorization-client
- [2.0.0, 3-0-0-SNAPSHOT)
+ org.gcube.portal
+ oidc-library-portal
+
+
+
+
+ org.gcube.common.portal
+ portal-manager
+ provided
- org.gcube.common
- storagehub-client-wrapper
- [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)
+ com.liferay.portal
+ portal-service
+ provided
-
org.slf4j
- slf4j-log4j12
+ slf4j-api
+ provided
org.slf4j
- slf4j-api
+ slf4j-log4j12
+ provided
diff --git a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java
index 64c17a8..45bb2a4 100644
--- a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java
+++ b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java
@@ -37,7 +37,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HorizontalPanel;
-// TODO: Auto-generated Javadoc
/**
* The Class WsThreddsWidget.
*
@@ -148,6 +147,7 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
}
final Modal box = new Modal(true);
+ box.setWidth(600);
box.setTitle("Checking authorizations and configurations...");
final HorizontalPanel hpLoader = new HorizontalPanel();
LoaderIcon loader = new LoaderIcon("Checking authorizations and folder configurations...");
@@ -176,7 +176,7 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
//at least one THREDDS rights is assigned
GWT.log("Performing isItemSynched: "+folder.getFolderId());
- WsThreddsWidget.wsThreddsSyncService.isItemSynched(folder.getFolderId(), new AsyncCallback() {
+ WsThreddsWidget.wsThreddsSyncService.getConfiguration(folder.getFolderId(), true, new AsyncCallback() {
@Override
public void onSuccess(WsThreddsSynchFolderDescriptor result) {
@@ -196,7 +196,12 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
@Override
public void onFailure(Throwable caught) {
- box.hide();
+ try {
+ hpLoader.clear();
+ hpLoader.setVisible(false);
+ }catch (Exception e) {
+ //Silent
+ }
if(caught instanceof WorkspaceFolderLocked){
viewManager.showMonitorSyncToFolder(folder,syncEventsListeners);
@@ -204,7 +209,10 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
}
viewManager.cancelMonitor(folder);
- Window.alert(caught.getMessage());
+ Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
+ alert.setClose(false);
+ box.add(alert);
+ //Window.alert(caught.getMessage());
}
});
}
@@ -275,21 +283,29 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
* @param config the config
*/
private void performFolderSync(final WsFolder folder, WsThreddsSynchFolderConfiguration config) {
- GWT.log("Performing doSyncFolder on: "+folder);
+ GWT.log("Performing doSyncFolder on: "+folder+" and config: "+config);
final Modal box = new Modal(true);
box.setTitle("Starting synchronization...");
box.hide(false);
- LoaderIcon loader = new LoaderIcon("Inizializiting synchronization to the folder: "+folder.getFoderName());
+ final LoaderIcon loader = new LoaderIcon("Inizializiting synchronization to the folder: "+folder.getFoderName());
box.add(loader);
wsThreddsSyncService.doSyncFolder(folder.getFolderId(), config, new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
- Window.alert(caught.getMessage());
+ //Window.alert(caught.getMessage());
viewManager.cancelMonitor(folder);
- if(box!=null)
- box.hide();
+ if(box!=null) {
+ try {
+ box.remove(loader);
+ }catch (Exception e) {
+
+ }
+ Alert alertError = new Alert(caught.getMessage(), AlertType.ERROR);
+ alertError.setClose(false);
+ box.add(alertError);
+ }
}
diff --git a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncService.java b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncService.java
index 4c20452..59d1e16 100644
--- a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncService.java
+++ b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncService.java
@@ -11,11 +11,13 @@ import org.gcube.portlets.widgets.wsthreddssync.shared.GatewayRolesThredds;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
+import org.gcube.usecases.ws.thredds.SyncEngine;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+// TODO: Auto-generated Javadoc
/**
* The Interface ThreddsWorkspaceSyncService.
*
@@ -25,15 +27,20 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@RemoteServiceRelativePath("wsthreddssync")
public interface ThreddsWorkspaceSyncService extends RemoteService {
+
/**
- * Checks if is item synched.
+ * Gets the configuration.
*
- * @param folderId the folder id
+ * @param folderId the folder id
+ * @param loadStatus the load status. If true it loads the status by calling the
+ * {@link SyncEngine#check(String, boolean)} but it is time
+ * consuming. No otherwise.
* @return the ws thredds synch folder descriptor
* @throws WorkspaceFolderLocked the workspace folder locked
- * @throws Exception the exception
+ * @throws Exception the exception
*/
- WsThreddsSynchFolderDescriptor isItemSynched(String folderId) throws WorkspaceFolderLocked, Exception;
+ WsThreddsSynchFolderDescriptor getConfiguration(String folderId, boolean loadStatus)
+ throws WorkspaceFolderLocked, Exception;
/**
* Do sync folder.
@@ -85,9 +92,10 @@ public interface ThreddsWorkspaceSyncService extends RemoteService {
/**
* Gets the list of Scopes (Root-VO, VOs and VREs) for user and the Thredds roles that user has in them.
*
- * @param user the user
* @return the VREs and Thredds roles for a given user
- * @throws Exception
+ * @throws Exception the exception
*/
Map getScopesWithThreddsRolesForLoggedUser() throws Exception;
+
+
}
diff --git a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncServiceAsync.java b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncServiceAsync.java
index 0372091..4e6bb34 100644
--- a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncServiceAsync.java
+++ b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/rpc/ThreddsWorkspaceSyncServiceAsync.java
@@ -13,68 +13,61 @@ import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescr
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
-
+// TODO: Auto-generated Javadoc
/**
* The Interface ThreddsWorkspaceSyncServiceAsync.
*
- * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
- * Mar 8, 2018
+ * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Mar 8, 2018
*/
-public interface ThreddsWorkspaceSyncServiceAsync
-{
-
- /**
- * Utility class to get the RPC Async interface from client-side code.
- *
- * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
- * Mar 8, 2018
- */
- public static final class Util
- {
- private static ThreddsWorkspaceSyncServiceAsync instance;
-
- /**
- * Gets the single instance of Util.
- *
- * @return single instance of Util
- */
- public static final ThreddsWorkspaceSyncServiceAsync getInstance()
- {
- if ( instance == null )
- {
- instance = (ThreddsWorkspaceSyncServiceAsync) GWT.create( ThreddsWorkspaceSyncService.class );
- }
- return instance;
- }
-
- /**
- * Instantiates a new util.
- */
- private Util()
- {
- // Utility class should not be instantiated
- }
- }
-
+public interface ThreddsWorkspaceSyncServiceAsync {
/**
- * Checks if is item synched.
+ * Utility class to get the RPC Async interface from client-side code.
+ *
+ * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Mar 8, 2018
+ */
+ public static final class Util {
+ private static ThreddsWorkspaceSyncServiceAsync instance;
+
+ /**
+ * Gets the single instance of Util.
+ *
+ * @return single instance of Util
+ */
+ public static final ThreddsWorkspaceSyncServiceAsync getInstance() {
+ if (instance == null) {
+ instance = (ThreddsWorkspaceSyncServiceAsync) GWT.create(ThreddsWorkspaceSyncService.class);
+ }
+ return instance;
+ }
+
+ /**
+ * Instantiates a new util.
+ */
+ private Util() {
+ // Utility class should not be instantiated
+ }
+ }
+
+ /**
+ * Gets the configuration.
*
* @param folderId the folder id
+ * @param loadStatus the load status
* @param callback the callback
+ * @return the configuration
*/
- void isItemSynched(String folderId, AsyncCallback callback);
-
+ void getConfiguration(String folderId, boolean loadStatus, AsyncCallback callback);
/**
* Do sync folder.
*
- * @param folderId the folder id
+ * @param folderId the folder id
* @param clientConfig the client config
- * @param callback the callback
+ * @param callback the callback
*/
- void doSyncFolder(String folderId, WsThreddsSynchFolderConfiguration clientConfig, AsyncCallback callback);
-
+ void doSyncFolder(String folderId, WsThreddsSynchFolderConfiguration clientConfig,
+ AsyncCallback callback);
/**
* Monitor sync status.
@@ -84,8 +77,6 @@ public interface ThreddsWorkspaceSyncServiceAsync
*/
void monitorSyncStatus(String folderId, AsyncCallback callback);
-
-
/**
* Gets the list of scopes for logged user.
*
@@ -97,13 +88,12 @@ public interface ThreddsWorkspaceSyncServiceAsync
/**
* Gets the available catalogues for scope.
*
- * @param scope the scope
+ * @param scope the scope
* @param callback the callback
* @return the available catalogues for scope
*/
void getAvailableCataloguesForScope(String scope, AsyncCallback> callback);
-
/**
* Do un sync folder.
*
@@ -112,6 +102,11 @@ public interface ThreddsWorkspaceSyncServiceAsync
*/
void doUnSyncFolder(String folderId, AsyncCallback callback);
-
+ /**
+ * Gets the scopes with thredds roles for logged user.
+ *
+ * @param callback the callback
+ * @return the scopes with thredds roles for logged user
+ */
void getScopesWithThreddsRolesForLoggedUser(AsyncCallback