Minor update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@100930 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
67621940f4
commit
6c44669117
|
@ -141,6 +141,7 @@ import org.gcube.portlets.user.td.gwtservice.server.trservice.LicenceMap;
|
|||
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.QueryService;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TDTypeValueMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TaskStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.OperationsId;
|
||||
|
@ -618,7 +619,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
Contacts owner = new Contacts("", tr.getOwner(), false);
|
||||
currentTR.setOwner(owner);
|
||||
currentTR.setContacts(retrieveShareInfo(tr));
|
||||
|
||||
|
||||
|
||||
SessionUtil.setTabResource(session, currentTR);
|
||||
logger.debug("GetTabResourceInformation() updated information:"
|
||||
+ currentTR.toString());
|
||||
|
@ -680,7 +682,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
Contacts owner = new Contacts("", tr.getOwner(), false);
|
||||
currentTR.setOwner(owner);
|
||||
currentTR.setContacts(retrieveShareInfo(tr));
|
||||
|
||||
|
||||
|
||||
logger.debug("GetTabResourceInformation() updated information:"
|
||||
+ currentTR);
|
||||
return currentTR;
|
||||
|
@ -1512,7 +1515,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
if (viewTable == null) {
|
||||
logger.debug("ViewTable is null");
|
||||
newTRId = new TRId(trId.getId());
|
||||
newTRId.setTabularResourceType(trId.getTabularResourceType());
|
||||
newTRId.setTableTypeName(trId.getTableTypeName());
|
||||
newTRId.setTableId(String.valueOf(table.getId().getValue()));
|
||||
newTRId.setTableType(table.getTableType().getName());
|
||||
newTRId.setViewTable(false);
|
||||
|
@ -1573,7 +1576,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("ViewTable is not null");
|
||||
newTRId = new TRId(trId.getId());
|
||||
newTRId.setTabularResourceType(trId.getTabularResourceType());
|
||||
newTRId.setTableTypeName(trId.getTableTypeName());
|
||||
newTRId.setTableId(String.valueOf(viewTable.getId().getValue()));
|
||||
newTRId.setTableType(viewTable.getTableType().getName());
|
||||
newTRId.setReferenceTargetTableId(String.valueOf(table.getId()
|
||||
|
@ -1686,7 +1689,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
if (viewTable == null) {
|
||||
logger.debug("ViewTable is null");
|
||||
TRId newTRId = new TRId(trId.getId());
|
||||
newTRId.setTabularResourceType(trId.getTabularResourceType());
|
||||
newTRId.setTableTypeName(trId.getTableTypeName());
|
||||
newTRId.setTableId(String.valueOf(table.getId().getValue()));
|
||||
newTRId.setTableType(table.getTableType().getName());
|
||||
newTRId.setViewTable(false);
|
||||
|
@ -1747,7 +1750,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("ViewTable is not null");
|
||||
TRId newTRId = new TRId(trId.getId());
|
||||
newTRId.setTabularResourceType(trId.getTabularResourceType());
|
||||
newTRId.setTableTypeName(trId.getTableTypeName());
|
||||
newTRId.setTableId(String.valueOf(viewTable.getId().getValue()));
|
||||
newTRId.setTableType(viewTable.getTableType().getName());
|
||||
newTRId.setReferenceTargetTableId(String.valueOf(table.getId()
|
||||
|
@ -1948,7 +1951,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
try {
|
||||
TabResource t = new TabResource();
|
||||
TRId trId = new TRId(String.valueOf(tr.getId().getValue()));
|
||||
trId.setTabularResourceType(tr.getTableType());
|
||||
trId.setTableTypeName(tr.getTableType());
|
||||
|
||||
t.setId(String.valueOf(i));
|
||||
t.setTrId(trId);
|
||||
t.setValid(tr.isValid());
|
||||
|
@ -1956,7 +1960,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
t.setLocked(tr.isLocked());
|
||||
Contacts owner = new Contacts("", tr.getOwner(), false);
|
||||
t.setOwner(owner);
|
||||
|
||||
|
||||
if (tr.contains(NameMetadata.class)) {
|
||||
NameMetadata nameMeta = tr.getMetadata(NameMetadata.class);
|
||||
if (nameMeta != null && nameMeta.getValue() != null) {
|
||||
|
@ -2084,13 +2088,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
if (viewTable == null) {
|
||||
trId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(tableId
|
||||
.getValue()), table.getTableType()
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(tableId
|
||||
.getValue()), table.getTableType()
|
||||
.getName());
|
||||
} else {
|
||||
trId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
.getName(), String.valueOf(tableId
|
||||
.getValue()), true);
|
||||
|
||||
|
@ -2674,8 +2678,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
syncTRMetaData(serviceTR, tabResource);
|
||||
|
||||
TRId trId = new TRId(String.valueOf(serviceTR.getId().getValue()),
|
||||
serviceTR.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
TabularResourceTypeMap.map(serviceTR.getTabularResourceType()), serviceTR.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
tabResource.setTrId(trId);
|
||||
|
||||
return tabResource;
|
||||
|
@ -2877,13 +2881,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
TRId newTRId;
|
||||
if (viewTable == null) {
|
||||
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
|
||||
} else {
|
||||
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
.getName(), String.valueOf(table.getId()
|
||||
.getValue()), true);
|
||||
|
||||
|
@ -3321,6 +3325,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getTRCreationDate(TRId trId) throws TDGWTServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
|
@ -3355,6 +3360,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @return
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
@Override
|
||||
public Boolean isTabularResourceValid(TRId trId)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
@ -4205,12 +4211,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
// TODO UpThis Monitor not updated
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String startChangeColumnType(
|
||||
ChangeColumnTypeSession changeColumnTypeSession)
|
||||
throws TDGWTServiceException {
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.server.trservice;
|
||||
|
||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TabularResourceType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TabularResourceTypeMap {
|
||||
public static TabResourceType map(TabularResourceType tabularResourceType) {
|
||||
switch (tabularResourceType) {
|
||||
case FLOW:
|
||||
return TabResourceType.FLOW;
|
||||
case STANDARD:
|
||||
return TabResourceType.STANDARD;
|
||||
default:
|
||||
return TabResourceType.UNKNOWN;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource;
|
|||
import org.gcube.data.analysis.tabulardata.service.tabular.TabularResourceId;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.storage.FilesStorage;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TaskStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.WorkerStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||
|
@ -307,13 +308,13 @@ public class BackgroundOperationMonitorCreator {
|
|||
TRId newTRId;
|
||||
if (viewTable == null) {
|
||||
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
|
||||
} else {
|
||||
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
.getName(), String.valueOf(table.getId()
|
||||
.getValue()), true);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource;
|
|||
import org.gcube.data.analysis.tabulardata.service.tabular.TabularResourceId;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.storage.FilesStorage;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TaskStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.WorkerStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||
|
@ -338,13 +339,13 @@ public class OperationMonitorCreator {
|
|||
TRId newTRId;
|
||||
if (viewTable == null) {
|
||||
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(table.getId()
|
||||
.getValue()), table.getTableType().getName());
|
||||
|
||||
} else {
|
||||
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
|
||||
tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(viewTable.getId()
|
||||
.getValue()), viewTable.getTableType()
|
||||
.getName(), String.valueOf(table.getId()
|
||||
.getValue()), true);
|
||||
|
||||
|
|
|
@ -97,10 +97,10 @@ public class TabResource implements Serializable {
|
|||
this.trId = trId;
|
||||
}
|
||||
|
||||
public String getTabularResourceType() {
|
||||
public String getTableTypeName() {
|
||||
String t = "";
|
||||
if (trId != null && trId.getTabularResourceType() != null) {
|
||||
t = trId.getTabularResourceType();
|
||||
if (trId != null && trId.getTableTypeName() != null) {
|
||||
t = trId.getTableTypeName();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
@ -197,5 +197,6 @@ public class TabResource implements Serializable {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue