Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@96060 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fc80353b97
commit
f6fb6f6f8f
|
@ -16,7 +16,6 @@ import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource;
|
|||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.file.FileUploadSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TRTasksManager;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
|
@ -78,15 +77,15 @@ public class SessionUtil {
|
|||
ASLSession session;
|
||||
if (username == null) {
|
||||
logger.warn("no user found in session, using test one");
|
||||
/*throw new TDGWTSessionExpiredException("Session Expired!");*/
|
||||
|
||||
throw new TDGWTSessionExpiredException("Session Expired!");
|
||||
/*
|
||||
username = Constants.DEFAULT_USER;
|
||||
String scope = Constants.DEFAULT_SCOPE;
|
||||
|
||||
httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, username);
|
||||
session = SessionManager.getInstance().getASLSession(
|
||||
httpSession.getId(), username);
|
||||
session.setScope(scope);
|
||||
session.setScope(scope);*/
|
||||
|
||||
} else {
|
||||
session = SessionManager.getInstance().getASLSession(
|
||||
|
|
|
@ -366,9 +366,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
public TabResource getTabResourceInformation(TRId trId)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
// ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
if (trId == null) {
|
||||
logger.error("GetTabularREsourceInformation TRId is null");
|
||||
throw new TDGWTServiceException(
|
||||
|
@ -382,8 +382,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
ArrayList<TRMetadata> trMetadatas = getTRMetadata(currentTR
|
||||
.getTrId());
|
||||
updateTabResourceInformation(currentTR, trMetadatas);
|
||||
currentTR.setDate(getTRCreationDate(trId));
|
||||
currentTR.setValid(isTabularResourceValid(trId));
|
||||
|
||||
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
aslSession.getUsername()));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
||||
TabularResource tr = service
|
||||
.getTabularResource(new TabularResourceId(Long
|
||||
.valueOf(currentTR.getTrId().getId())));
|
||||
|
||||
currentTR.setDate(sdf.format(tr.getCreationDate().getTime()));
|
||||
currentTR.setValid(tr.isValid());
|
||||
currentTR.setFinalized(tr.isFinalized());
|
||||
|
||||
logger.debug("GetTabResourceInformation() updated information:"
|
||||
+ currentTR.toString());
|
||||
|
@ -1427,6 +1438,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
t.setId(String.valueOf(i));
|
||||
t.setTrId(trId);
|
||||
t.setValid(tr.isValid());
|
||||
t.setFinalized(tr.isFinalized());
|
||||
if (tr.contains(NameMetadata.class)) {
|
||||
NameMetadata nameMeta = tr.getMetadata(NameMetadata.class);
|
||||
if (nameMeta != null && nameMeta.getValue() != null) {
|
||||
|
@ -2085,6 +2097,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
.getValue()), table.getTableType().getName());
|
||||
tabResource.setTrId(trId);
|
||||
tabResource.setValid(serviceTR.isValid());
|
||||
tabResource.setFinalized(serviceTR.isFinalized());
|
||||
return tabResource;
|
||||
|
||||
} catch (TDGWTSessionExpiredException e) {
|
||||
|
|
Loading…
Reference in New Issue