Updated TRId

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widget-common-event@100928 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-23 16:17:59 +00:00
parent 7ee91c3131
commit 41508e7e88
2 changed files with 63 additions and 20 deletions

View File

@ -2,6 +2,8 @@ package org.gcube.portlets.user.td.widgetcommonevent.shared;
import java.io.Serializable; import java.io.Serializable;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
/** /**
* Tabular Resoure Identification * Tabular Resoure Identification
* *
@ -17,11 +19,17 @@ public class TRId implements Serializable {
* Tabular resource id * Tabular resource id
*/ */
private String id; private String id;
/**
* TabResourceType: Standard, Flow....
*/
private TabResourceType tabResourceType;
/** /**
* Tabular resource type * Tabular resource type: Generic, Codelist, Dataset...
*/ */
private String tabularResourceType; private String tableTypeName;
/** /**
* Last view id or table id of tabular resource * Last view id or table id of tabular resource
@ -29,7 +37,7 @@ public class TRId implements Serializable {
private String tableId; private String tableId;
/** /**
* Type of last table or view * Type of last Table or View
*/ */
private String tableType; private String tableType;
@ -50,7 +58,8 @@ public class TRId implements Serializable {
public TRId(String id) { public TRId(String id) {
this.id = id; this.id = id;
tabularResourceType = null; tabResourceType=null;
tableTypeName = null;
tableId = null; tableId = null;
tableType = null; tableType = null;
referenceTargetTableId = null; referenceTargetTableId = null;
@ -58,9 +67,10 @@ public class TRId implements Serializable {
} }
public TRId(String id, String tableId) { public TRId(String id, TabResourceType tabResourceType, String tableId) {
this.id = id; this.id = id;
tabularResourceType = null; tabResourceType=null;
tableTypeName = null;
this.tableId = tableId; this.tableId = tableId;
tableType = null; tableType = null;
referenceTargetTableId = null; referenceTargetTableId = null;
@ -68,20 +78,20 @@ public class TRId implements Serializable {
} }
public TRId(String id, String tabularResourceType, String tableId, public TRId(String id, TabResourceType tabResourceType, String tableTypeName,
String tableType) { String tableId, String tableType) {
this.id = id; this.id = id;
this.tabularResourceType = tabularResourceType; this.tableTypeName = tableTypeName;
this.tableId = tableId; this.tableId = tableId;
this.tableType = tableType; this.tableType = tableType;
referenceTargetTableId = null; referenceTargetTableId = null;
viewTable = false; viewTable = false;
} }
public TRId(String id, String tabularResourceType, String tableId, public TRId(String id, TabResourceType tabResourceType, String tableTypeName,
String tableType, String referenceTargetTableId, boolean viewTable) { String tableId, String tableType, String referenceTargetTableId, boolean viewTable) {
this.id = id; this.id = id;
this.tabularResourceType = tabularResourceType; this.tableTypeName = tableTypeName;
this.tableId = tableId; this.tableId = tableId;
this.tableType = tableType; this.tableType = tableType;
this.referenceTargetTableId = referenceTargetTableId; this.referenceTargetTableId = referenceTargetTableId;
@ -95,13 +105,22 @@ public class TRId implements Serializable {
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
public String getTabularResourceType() {
return tabularResourceType; public TabResourceType getTabResourceType() {
return tabResourceType;
} }
public void setTabularResourceType(String tabularResourceType) { public void setTabResourceType(TabResourceType tabResourceType) {
this.tabularResourceType = tabularResourceType; this.tabResourceType = tabResourceType;
}
public String getTableTypeName() {
return tableTypeName;
}
public void setTableTypeName(String tableTypeName) {
this.tableTypeName = tableTypeName;
} }
public String getTableId() { public String getTableId() {
@ -150,10 +169,13 @@ public class TRId implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "TRId [id=" + id + ", tabularResourceType=" return "TRId [id=" + id + ", tabResourceType=" + tabResourceType
+ tabularResourceType + ", tableId=" + tableId + ", tableType=" + ", tableTypeName=" + tableTypeName + ", tableId=" + tableId
+ tableType + ", referenceTargetTableId=" + ", tableType=" + tableType + ", referenceTargetTableId="
+ referenceTargetTableId + ", viewTable=" + viewTable + "]"; + referenceTargetTableId + ", viewTable=" + viewTable + "]";
} }
} }

View File

@ -0,0 +1,21 @@
package org.gcube.portlets.user.td.widgetcommonevent.shared.tr;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TabResourceTypeMap {
public static TabResourceType map(String tabResourceType){
if(tabResourceType.compareTo(TabResourceType.FLOW.toString())==0){
return TabResourceType.FLOW;
} else {
if(tabResourceType.compareTo(TabResourceType.STANDARD.toString())==0){
return TabResourceType.STANDARD;
} else {
return TabResourceType.UNKNOWN;
}
}
}
}