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.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||||
import org.gcube.portlets.user.td.gwtservice.server.file.FileUploadSession;
|
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.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.CSVExportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
|
@ -78,15 +77,15 @@ public class SessionUtil {
|
||||||
ASLSession session;
|
ASLSession session;
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
logger.warn("no user found in session, using test one");
|
logger.warn("no user found in session, using test one");
|
||||||
/*throw new TDGWTSessionExpiredException("Session Expired!");*/
|
throw new TDGWTSessionExpiredException("Session Expired!");
|
||||||
|
/*
|
||||||
username = Constants.DEFAULT_USER;
|
username = Constants.DEFAULT_USER;
|
||||||
String scope = Constants.DEFAULT_SCOPE;
|
String scope = Constants.DEFAULT_SCOPE;
|
||||||
|
|
||||||
httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, username);
|
httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, username);
|
||||||
session = SessionManager.getInstance().getASLSession(
|
session = SessionManager.getInstance().getASLSession(
|
||||||
httpSession.getId(), username);
|
httpSession.getId(), username);
|
||||||
session.setScope(scope);
|
session.setScope(scope);*/
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
session = SessionManager.getInstance().getASLSession(
|
session = SessionManager.getInstance().getASLSession(
|
||||||
|
|
|
@ -366,9 +366,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
public TabResource getTabResourceInformation(TRId trId)
|
public TabResource getTabResourceInformation(TRId trId)
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
try {
|
try {
|
||||||
@SuppressWarnings("unused")
|
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
// ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
if (trId == null) {
|
if (trId == null) {
|
||||||
logger.error("GetTabularREsourceInformation TRId is null");
|
logger.error("GetTabularREsourceInformation TRId is null");
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
|
@ -382,8 +382,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
ArrayList<TRMetadata> trMetadatas = getTRMetadata(currentTR
|
ArrayList<TRMetadata> trMetadatas = getTRMetadata(currentTR
|
||||||
.getTrId());
|
.getTrId());
|
||||||
updateTabResourceInformation(currentTR, trMetadatas);
|
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:"
|
logger.debug("GetTabResourceInformation() updated information:"
|
||||||
+ currentTR.toString());
|
+ currentTR.toString());
|
||||||
|
@ -1427,6 +1438,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
t.setId(String.valueOf(i));
|
t.setId(String.valueOf(i));
|
||||||
t.setTrId(trId);
|
t.setTrId(trId);
|
||||||
t.setValid(tr.isValid());
|
t.setValid(tr.isValid());
|
||||||
|
t.setFinalized(tr.isFinalized());
|
||||||
if (tr.contains(NameMetadata.class)) {
|
if (tr.contains(NameMetadata.class)) {
|
||||||
NameMetadata nameMeta = tr.getMetadata(NameMetadata.class);
|
NameMetadata nameMeta = tr.getMetadata(NameMetadata.class);
|
||||||
if (nameMeta != null && nameMeta.getValue() != null) {
|
if (nameMeta != null && nameMeta.getValue() != null) {
|
||||||
|
@ -2085,6 +2097,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
.getValue()), table.getTableType().getName());
|
.getValue()), table.getTableType().getName());
|
||||||
tabResource.setTrId(trId);
|
tabResource.setTrId(trId);
|
||||||
tabResource.setValid(serviceTR.isValid());
|
tabResource.setValid(serviceTR.isValid());
|
||||||
|
tabResource.setFinalized(serviceTR.isFinalized());
|
||||||
return tabResource;
|
return tabResource;
|
||||||
|
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
|
|
Loading…
Reference in New Issue