Added Resume UI state

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@100397 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-02 17:07:33 +00:00
parent 180e295d2e
commit b1f8bc624c
3 changed files with 47 additions and 11 deletions

View File

@ -213,6 +213,14 @@ public interface TDGWTService extends RemoteService {
public ColumnData getConnection(RefColumn refColumn)
throws TDGWTServiceException;
/**
* Close current tabular resource
*
* @param trId
* @throws TDGWTServiceException
*/
public void closeTabularResource() throws TDGWTServiceException;
// Task
/**
* Resubmit task

View File

@ -128,7 +128,9 @@ public interface TDGWTServiceAsync {
AsyncCallback<ColumnData> callback);
void getConnection(RefColumn refColumn, AsyncCallback<ColumnData> callback);
void closeTabularResource(AsyncCallback<Void> callback);
// Task
void startTaskResubmit(TaskResubmitSession taskResubmitSession,
AsyncCallback<String> callback);

View File

@ -321,22 +321,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
HttpSession session = this.getThreadLocalRequest().getSession();
SessionUtil.getAslSession(session);
TabResource currentTR = SessionUtil.getTabResource(session);
TRId trId = SessionUtil.getTRId(session);
logger.debug("getCurrentTRId()");
if (currentTR == null) {
if (trId == null) {
logger.error("Current Tabular Resource is null");
throw new TDGWTServiceException(
"Current Tabular Resource is null");
}
logger.debug("getCurrentTRId():" + currentTR.toString());
logger.debug("getCurrentTRId():" + trId);
if (currentTR.getTrId() == null) {
logger.error("Current Tabular Resource has TRId null");
throw new TDGWTServiceException(
"Current Tabular Resource has TRId null");
}
logger.debug("getCurrentTRId():" + currentTR.getTrId());
return currentTR.getTrId();
return trId;
} catch (TDGWTServiceException e) {
throw e;
@ -351,11 +345,41 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}
/**
*
* {@inheritDoc}
*/
@Override
public void closeTabularResource() throws TDGWTServiceException {
try {
HttpSession session = this.getThreadLocalRequest().getSession();
SessionUtil.getAslSession(session);
SessionUtil.setTabResource(session,null);
SessionUtil.setTRId(session, null);
return;
} catch (TDGWTServiceException e) {
throw e;
} catch (SecurityException e) {
e.printStackTrace();
throw new TDGWTServiceException(
"Security exception, you haven't rights!");
} catch (Throwable e) {
logger.error("getCurrentTRID(): " + e.getLocalizedMessage(), e);
throw new TDGWTServiceException("Error retrieving TR id: "
+ e.getLocalizedMessage());
}
}
/**
*
* {@inheritDoc}
*/
@Override
public TabResource getTabResourceInformation() throws TDGWTServiceException {
try {
HttpSession session = this.getThreadLocalRequest().getSession();
@ -6675,4 +6699,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}