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