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 org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
/**
* Tabular Resoure Identification
*
@ -17,11 +19,17 @@ public class TRId implements Serializable {
* Tabular resource 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
@ -29,7 +37,7 @@ public class TRId implements Serializable {
private String tableId;
/**
* Type of last table or view
* Type of last Table or View
*/
private String tableType;
@ -50,7 +58,8 @@ public class TRId implements Serializable {
public TRId(String id) {
this.id = id;
tabularResourceType = null;
tabResourceType=null;
tableTypeName = null;
tableId = null;
tableType = 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;
tabularResourceType = null;
tabResourceType=null;
tableTypeName = null;
this.tableId = tableId;
tableType = null;
referenceTargetTableId = null;
@ -68,20 +78,20 @@ public class TRId implements Serializable {
}
public TRId(String id, String tabularResourceType, String tableId,
String tableType) {
public TRId(String id, TabResourceType tabResourceType, String tableTypeName,
String tableId, String tableType) {
this.id = id;
this.tabularResourceType = tabularResourceType;
this.tableTypeName = tableTypeName;
this.tableId = tableId;
this.tableType = tableType;
referenceTargetTableId = null;
viewTable = false;
}
public TRId(String id, String tabularResourceType, String tableId,
String tableType, String referenceTargetTableId, boolean viewTable) {
public TRId(String id, TabResourceType tabResourceType, String tableTypeName,
String tableId, String tableType, String referenceTargetTableId, boolean viewTable) {
this.id = id;
this.tabularResourceType = tabularResourceType;
this.tableTypeName = tableTypeName;
this.tableId = tableId;
this.tableType = tableType;
this.referenceTargetTableId = referenceTargetTableId;
@ -95,13 +105,22 @@ public class TRId implements Serializable {
public void setId(String id) {
this.id = id;
}
public String getTabularResourceType() {
return tabularResourceType;
public TabResourceType getTabResourceType() {
return tabResourceType;
}
public void setTabularResourceType(String tabularResourceType) {
this.tabularResourceType = tabularResourceType;
public void setTabResourceType(TabResourceType tabResourceType) {
this.tabResourceType = tabResourceType;
}
public String getTableTypeName() {
return tableTypeName;
}
public void setTableTypeName(String tableTypeName) {
this.tableTypeName = tableTypeName;
}
public String getTableId() {
@ -150,10 +169,13 @@ public class TRId implements Serializable {
@Override
public String toString() {
return "TRId [id=" + id + ", tabularResourceType="
+ tabularResourceType + ", tableId=" + tableId + ", tableType="
+ tableType + ", referenceTargetTableId="
return "TRId [id=" + id + ", tabResourceType=" + tabResourceType
+ ", tableTypeName=" + tableTypeName + ", tableId=" + tableId
+ ", tableType=" + tableType + ", referenceTargetTableId="
+ 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;
}
}
}
}