refactor
This commit is contained in:
parent
40eb373fa7
commit
c5a3d8faee
|
@ -57,19 +57,19 @@ public class GeoportalCommon {
|
|||
if (item == null)
|
||||
throw new Exception("Bad request, the item is null");
|
||||
|
||||
if (item.getItemId() == null)
|
||||
throw new Exception("Bad request, the item id is null");
|
||||
if (item.getProjectID() == null)
|
||||
throw new Exception("Bad request, the ProjectID is null");
|
||||
|
||||
if (item.getItemType() == null)
|
||||
throw new Exception("Bad request, the item type is null");
|
||||
if (item.getProfileID() == null)
|
||||
throw new Exception("Bad request, the ProfileID is null");
|
||||
|
||||
if (this.geonaDataProfile == null)
|
||||
this.geonaDataProfile = readGNADataViewerConfig(GeoportalCommonConstants.GEOPORTAL_DATA_VIEWER_APP);
|
||||
|
||||
// Restricted Link
|
||||
String link = String.format("%s?%s=%s&%s=%s", geonaDataProfile.getRestrictedPortletURL(),
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_ID, item.getItemId(),
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_TYPE, item.getItemType());
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_ID, item.getProjectID(),
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_TYPE, item.getProfileID());
|
||||
|
||||
String shortUrl = link;
|
||||
try {
|
||||
|
@ -82,8 +82,8 @@ public class GeoportalCommon {
|
|||
|
||||
// Open Link
|
||||
link = String.format("%s?%s=%s&%s=%s", geonaDataProfile.getOpenPortletURL(),
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_ID, item.getItemId(),
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_TYPE, item.getItemType());
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_ID, item.getProjectID(),
|
||||
GeoportalCommonConstants.GET_GEONA_ITEM_TYPE, item.getProfileID());
|
||||
|
||||
shortUrl = link;
|
||||
try {
|
||||
|
|
|
@ -2,13 +2,12 @@ package org.gcube.application.geoportalcommon.shared;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* The Class GeoNaItemRef.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Jul 30, 2021
|
||||
* Jul 30, 2021
|
||||
*/
|
||||
public class GeoNaItemRef implements Serializable {
|
||||
|
||||
|
@ -18,13 +17,15 @@ public class GeoNaItemRef implements Serializable {
|
|||
private static final long serialVersionUID = -7021431511279022193L;
|
||||
|
||||
// this is the mongoID
|
||||
private String itemId;
|
||||
private String itemType; //this is the profileID
|
||||
private String projectID;
|
||||
private String profileID; // this is the profileID
|
||||
private String itemName;
|
||||
|
||||
private PublicLink restrictedLink;
|
||||
private PublicLink openLink;
|
||||
|
||||
private String layerObjectType;
|
||||
|
||||
/**
|
||||
* Instantiates a new geo na object.
|
||||
*/
|
||||
|
@ -33,51 +34,56 @@ public class GeoNaItemRef implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new geo na object.
|
||||
* Instantiates a new geo na item ref.
|
||||
*
|
||||
* @param itemId the item id
|
||||
* @param itemType the item type
|
||||
* @param projectID the project ID
|
||||
* @param profileID the profile ID
|
||||
*/
|
||||
public GeoNaItemRef(String itemId, String itemType) {
|
||||
public GeoNaItemRef(String projectID, String profileID) {
|
||||
super();
|
||||
this.itemId = itemId;
|
||||
this.itemType = itemType;
|
||||
this.projectID = projectID;
|
||||
this.profileID = profileID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item id.
|
||||
* Instantiates a new geo na item ref.
|
||||
*
|
||||
* @return the item id
|
||||
* @param projectID the project ID
|
||||
* @param profileID the profile ID
|
||||
* @param layerObjectType the layer object type
|
||||
*/
|
||||
public String getItemId() {
|
||||
return itemId;
|
||||
public GeoNaItemRef(String projectID, String profileID, String layerObjectType) {
|
||||
super();
|
||||
this.projectID = projectID;
|
||||
this.profileID = profileID;
|
||||
this.layerObjectType = layerObjectType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item id.
|
||||
* Gets the profile ID.
|
||||
*
|
||||
* @param itemId the new item id
|
||||
* @return the profile ID
|
||||
*/
|
||||
public void setItemId(String itemId) {
|
||||
this.itemId = itemId;
|
||||
public String getProfileID() {
|
||||
return profileID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item type.
|
||||
* Gets the project ID.
|
||||
*
|
||||
* @return the item type
|
||||
* @return the project ID
|
||||
*/
|
||||
public String getItemType() {
|
||||
return itemType;
|
||||
public String getProjectID() {
|
||||
return projectID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item type.
|
||||
* Gets the layer object type.
|
||||
*
|
||||
* @param itemType the new item type
|
||||
* @return the layer object type
|
||||
*/
|
||||
public void setItemType(String itemType) {
|
||||
this.itemType = itemType;
|
||||
public String getLayerObjectType() {
|
||||
return layerObjectType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -134,24 +140,21 @@ public class GeoNaItemRef implements Serializable {
|
|||
this.openLink = openLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("GeoNaItemRef [itemId=");
|
||||
builder.append(itemId);
|
||||
builder.append(", itemType=");
|
||||
builder.append(itemType);
|
||||
builder.append("GeoNaItemRef [projectID=");
|
||||
builder.append(projectID);
|
||||
builder.append(", profileID=");
|
||||
builder.append(profileID);
|
||||
builder.append(", itemName=");
|
||||
builder.append(itemName);
|
||||
builder.append(", restrictedLink=");
|
||||
builder.append(restrictedLink);
|
||||
builder.append(", openLink=");
|
||||
builder.append(openLink);
|
||||
builder.append(", layerObjectType=");
|
||||
builder.append(layerObjectType);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue