|
|
|
@ -33,6 +33,7 @@ import org.gcube.common.storagehubwrapper.shared.tohl.items.URLItem;
|
|
|
|
|
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
|
|
|
|
|
import org.gcube.portal.wssynclibrary.shared.WorkspaceFolderLocked;
|
|
|
|
|
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
|
|
|
|
|
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
|
|
|
|
|
import org.gcube.portal.wssynclibrary.thredds.WorkspaceThreddsSynchronize;
|
|
|
|
|
import org.gcube.portlets.user.urlshortener.UrlShortener;
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
|
|
|
@ -77,6 +78,7 @@ import org.gcube.portlets.widgets.workspacesharingwidget.server.notifications.No
|
|
|
|
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.InfoContactModel;
|
|
|
|
|
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
|
|
|
|
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
|
|
|
|
import org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.GroupManager;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
|
|
|
@ -228,24 +230,35 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|
|
|
|
/**
|
|
|
|
|
* Checks if is item under sync.
|
|
|
|
|
*
|
|
|
|
|
* @param itemId
|
|
|
|
|
* the item id
|
|
|
|
|
* @param itemId the item id
|
|
|
|
|
* @return true, if is item under sync
|
|
|
|
|
* @throws Exception
|
|
|
|
|
* the exception
|
|
|
|
|
* @throws Exception the exception
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean isItemUnderSync(String itemId) throws Exception {
|
|
|
|
|
|
|
|
|
|
ThSyncFolderDescriptor theConfig = null;
|
|
|
|
|
try {
|
|
|
|
|
GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
Sync_Status status = WorkspaceThreddsSynchronize.getInstance().getSynchedStatusFromItemProperty(itemId,
|
|
|
|
|
user.getUsername());
|
|
|
|
|
theConfig = WorkspaceThreddsSynchronize.getInstance().getConfiguration(itemId);
|
|
|
|
|
} catch (WorkspaceNotSynchedException e) {
|
|
|
|
|
workspaceLogger
|
|
|
|
|
.debug("WorkspaceNotSynchedException catched, the item with id: " + itemId + " is not synched");
|
|
|
|
|
return false;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
workspaceLogger.debug("Error on getting configuration for the item id: " + itemId
|
|
|
|
|
+ ", returning null (means not synched)");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (theConfig == null) {
|
|
|
|
|
workspaceLogger.debug(
|
|
|
|
|
"No ws-thredds config found the item with id:" + itemId + ", returning item is not synched");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// HERE THE ITEM IS SYNCHED SO CHECK IF IT IS LOCKED
|
|
|
|
|
|
|
|
|
|
// HERE THE ITEM IS SYNCHED SO CHECKING IF IT IS LOCKED
|
|
|
|
|
checkItemLocked(itemId);
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|