|
|
|
@ -20,6 +20,7 @@ import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
|
|
|
|
|
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScopeType;
|
|
|
|
|
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
|
|
|
|
|
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
|
|
|
|
|
import org.gcube.usecases.ws.thredds.SyncEngine;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.GroupManager;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
|
|
|
|
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
|
|
|
@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
|
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil;
|
|
|
|
|
|
|
|
|
|
// TODO: Auto-generated Javadoc
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The server side implementation of the RPC service.
|
|
|
|
|
*
|
|
|
|
@ -112,24 +113,28 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
|
|
|
|
// UPDATED
|
|
|
|
|
@Override
|
|
|
|
|
public WsThreddsSynchFolderDescriptor getConfiguration(String folderId) throws WorkspaceFolderLocked, Exception {
|
|
|
|
|
public WsThreddsSynchFolderDescriptor getConfiguration(String folderId, boolean loadStatus)
|
|
|
|
|
throws WorkspaceFolderLocked, Exception {
|
|
|
|
|
logger.debug("called isItemSynched for folderId: " + folderId);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest());
|
|
|
|
|
String wsScope = PortalContext.getConfiguration().getCurrentScope(this.getThreadLocalRequest());
|
|
|
|
|
String wsUserToken = PortalContext.getConfiguration().getCurrentUserToken(wsScope, user.getUsername());
|
|
|
|
|
|
|
|
|
|
ThSyncFolderDescriptor theConfig = getSyncService().getConfiguration(folderId,wsScope,wsUserToken);
|
|
|
|
|
|
|
|
|
|
ThSyncFolderDescriptor theConfig = getSyncService().getConfiguration(folderId, loadStatus, wsScope,
|
|
|
|
|
wsUserToken);
|
|
|
|
|
|
|
|
|
|
if (theConfig != null) {
|
|
|
|
|
logger.info("Folder id: " + folderId + " is synched");
|
|
|
|
@ -205,7 +210,7 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
|
|
|
|
|
GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest());
|
|
|
|
|
String wsScope = PortalContext.getConfiguration().getCurrentScope(this.getThreadLocalRequest());
|
|
|
|
|
String wsUserToken = PortalContext.getConfiguration().getCurrentUserToken(wsScope, user.getUsername());
|
|
|
|
|
ThSyncFolderDescriptor foldeDesr = getSyncService().getConfiguration(folderId,wsScope,wsUserToken);
|
|
|
|
|
ThSyncFolderDescriptor foldeDesr = getSyncService().getConfiguration(folderId, false, wsScope, wsUserToken);
|
|
|
|
|
return getSyncService().doUnSync(folderId, true, foldeDesr.getConfiguration(), this.getThreadLocalRequest(),
|
|
|
|
|
user);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|