Updated Flows

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@100978 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-24 15:51:58 +00:00
parent cafeb0d1b7
commit ea14059285
3 changed files with 22 additions and 6 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/tabular-data-gwt-service-2.4.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/tabular-data-gwt-service-2.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-gwt-service-2.4.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/tabular-data-gwt-service-2.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -33,5 +33,5 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/tabular-data-gwt-service-2.4.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/tabular-data-gwt-service-2.5.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1515,6 +1515,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
if (viewTable == null) { if (viewTable == null) {
logger.debug("ViewTable is null"); logger.debug("ViewTable is null");
newTRId = new TRId(trId.getId()); newTRId = new TRId(trId.getId());
newTRId.setTabResourceType(trId.getTabResourceType());
newTRId.setTableTypeName(trId.getTableTypeName()); newTRId.setTableTypeName(trId.getTableTypeName());
newTRId.setTableId(String.valueOf(table.getId().getValue())); newTRId.setTableId(String.valueOf(table.getId().getValue()));
newTRId.setTableType(table.getTableType().getName()); newTRId.setTableType(table.getTableType().getName());
@ -1576,6 +1577,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} else { } else {
logger.debug("ViewTable is not null"); logger.debug("ViewTable is not null");
newTRId = new TRId(trId.getId()); newTRId = new TRId(trId.getId());
newTRId.setTabResourceType(trId.getTabResourceType());
newTRId.setTableTypeName(trId.getTableTypeName()); newTRId.setTableTypeName(trId.getTableTypeName());
newTRId.setTableId(String.valueOf(viewTable.getId().getValue())); newTRId.setTableId(String.valueOf(viewTable.getId().getValue()));
newTRId.setTableType(viewTable.getTableType().getName()); newTRId.setTableType(viewTable.getTableType().getName());
@ -1689,6 +1691,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
if (viewTable == null) { if (viewTable == null) {
logger.debug("ViewTable is null"); logger.debug("ViewTable is null");
TRId newTRId = new TRId(trId.getId()); TRId newTRId = new TRId(trId.getId());
newTRId.setTabResourceType(trId.getTabResourceType());
newTRId.setTableTypeName(trId.getTableTypeName()); newTRId.setTableTypeName(trId.getTableTypeName());
newTRId.setTableId(String.valueOf(table.getId().getValue())); newTRId.setTableId(String.valueOf(table.getId().getValue()));
newTRId.setTableType(table.getTableType().getName()); newTRId.setTableType(table.getTableType().getName());
@ -1750,6 +1753,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} else { } else {
logger.debug("ViewTable is not null"); logger.debug("ViewTable is not null");
TRId newTRId = new TRId(trId.getId()); TRId newTRId = new TRId(trId.getId());
newTRId.setTabResourceType(trId.getTabResourceType());
newTRId.setTableTypeName(trId.getTableTypeName()); newTRId.setTableTypeName(trId.getTableTypeName());
newTRId.setTableId(String.valueOf(viewTable.getId().getValue())); newTRId.setTableId(String.valueOf(viewTable.getId().getValue()));
newTRId.setTableType(viewTable.getTableType().getName()); newTRId.setTableType(viewTable.getTableType().getName());
@ -1937,6 +1941,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
/** /**
* Retrieves the informations for a specific Tabular Resource from service * Retrieves the informations for a specific Tabular Resource from service
* without table id (fast)
* *
* @param tr * @param tr
* TabularResource on service * TabularResource on service
@ -1951,8 +1956,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
try { try {
TabResource t = new TabResource(); TabResource t = new TabResource();
TRId trId = new TRId(String.valueOf(tr.getId().getValue())); TRId trId = new TRId(String.valueOf(tr.getId().getValue()));
trId.setTabResourceType(TabularResourceTypeMap.map(tr.getTabularResourceType()));
trId.setTableTypeName(tr.getTableType()); trId.setTableTypeName(tr.getTableType());
t.setId(String.valueOf(i)); t.setId(String.valueOf(i));
t.setTrId(trId); t.setTrId(trId);
t.setValid(tr.isValid()); t.setValid(tr.isValid());
@ -2111,6 +2116,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} }
/** /**
* Retrieves codelists without table id (fast)
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@ -2544,7 +2550,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} }
/** /**
* * Retrieves tabular resource without table id (fast)
* *
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -2,6 +2,8 @@ package org.gcube.portlets.user.td.gwtservice.server.trservice;
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TabularResourceType; import org.gcube.data.analysis.tabulardata.commons.webservice.types.TabularResourceType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
@ -10,7 +12,15 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
* *
*/ */
public class TabularResourceTypeMap { public class TabularResourceTypeMap {
private static Logger logger = LoggerFactory
.getLogger(TabularResourceTypeMap.class);
public static TabResourceType map(TabularResourceType tabularResourceType) { public static TabResourceType map(TabularResourceType tabularResourceType) {
if(tabularResourceType==null){
logger.error("Tabular Resource Type is null");
return TabResourceType.UNKNOWN;
}
switch (tabularResourceType) { switch (tabularResourceType) {
case FLOW: case FLOW:
return TabResourceType.FLOW; return TabResourceType.FLOW;