Passed to the geoportal-data-mapper component [#24978]
parent
2d4bfbee38
commit
9d059ca4e9
@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.3.1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.4.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,66 +0,0 @@
|
||||
//package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice;
|
||||
//
|
||||
//import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
|
||||
//
|
||||
//import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
|
||||
//import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * The Class ConcessioniMongoService.
|
||||
// *
|
||||
// * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
// *
|
||||
// * Sep 23, 2021
|
||||
// */
|
||||
//public class ConcessioniMongoService {
|
||||
//
|
||||
// private static final Logger LOG = LoggerFactory.getLogger(ConcessioniMongoService.class);
|
||||
//
|
||||
// /**
|
||||
// * Instantiates a new concessioni mongo service.
|
||||
// */
|
||||
// protected ConcessioniMongoService() {
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Gets the item by id.
|
||||
// *
|
||||
// * @param mongoItemId the mongo item id
|
||||
// * @return the item by id
|
||||
// * @throws Exception the exception
|
||||
// */
|
||||
// protected Concessione getItemById(String mongoItemId) throws Exception {
|
||||
// LOG.info("called getItemById: " + mongoItemId);
|
||||
// ConcessioniManagerI concessioniManager = statefulMongoConcessioni().build();
|
||||
// // Returning item by Id
|
||||
// return concessioniManager.getById(mongoItemId);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * To concessione.
|
||||
// *
|
||||
// * @param jsonString the json string
|
||||
// * @return the concessione
|
||||
// */
|
||||
// protected Concessione toConcessione(String jsonString) {
|
||||
// LOG.info("toConcessione called");
|
||||
// try {
|
||||
// return org.gcube.application.geoportal.client.utils.Serialization.read(jsonString, Concessione.class);
|
||||
// } catch (Exception e) {
|
||||
// LOG.warn("Error on serializing: ", e);
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /*
|
||||
// * For testing public Concessione iamClientGetItemBy(HttpServletRequest request,
|
||||
// * String mongoItemId, String clientId, String secret) throws Exception { String
|
||||
// * scope = SessionUtil.getCurrentContext(request, true); return
|
||||
// * iamClientGetItemBy(scope, mongoItemId, clientId, secret); }
|
||||
// */
|
||||
//
|
||||
//}
|
@ -1,93 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accesspolicy;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Class GeoNACheckAccessPolicy.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 9, 2021
|
||||
*/
|
||||
public class GeoNACheckAccessPolicy {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GeoNACheckAccessPolicy.class);
|
||||
/**
|
||||
* The Enum ACCESS_POLICY.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Sep 8, 2021
|
||||
*/
|
||||
public static enum ACCESS_POLICY {
|
||||
OPEN, RESTICTED
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is open access.
|
||||
*
|
||||
* @param policy the policy
|
||||
* @return true, if is open access
|
||||
*/
|
||||
private static boolean isOpenAccess(String policy) {
|
||||
if (policy == null || policy.equalsIgnoreCase(ACCESS_POLICY.OPEN.name())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is restricted access.
|
||||
*
|
||||
* @param policy the policy
|
||||
* @return true, if is restricted access
|
||||
*/
|
||||
private static boolean isRestrictedAccess(String policy) {
|
||||
if (policy == null || policy.equalsIgnoreCase(ACCESS_POLICY.RESTICTED.name())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is accessible accoding to access policies
|
||||
*
|
||||
* @param policy the policy
|
||||
* @param myLogin the my login
|
||||
* @return true, if is accessible
|
||||
*/
|
||||
public static boolean isAccessible(String policy, String myLogin) {
|
||||
|
||||
boolean bool = isOpenAccess(policy);
|
||||
|
||||
if (bool) {
|
||||
// is open access
|
||||
return true;
|
||||
}
|
||||
|
||||
//From here managing is NOT OPEN access
|
||||
|
||||
if (myLogin == null || myLogin.isEmpty()) {
|
||||
// here is not open and the user is not authenticated
|
||||
return false;
|
||||
}
|
||||
|
||||
// Here the login is not null, so checking if the access to item is RESTICTED
|
||||
bool = isRestrictedAccess(policy);
|
||||
|
||||
if (bool) {
|
||||
// is restricted access
|
||||
return true;
|
||||
}
|
||||
|
||||
// Here the user is authenticated, but the policy is not managed, so returning
|
||||
// true
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.CategoryWrapper;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
||||
|
||||
/**
|
||||
* The Class MetaDataProfileBeanExt.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Nov 23, 2022
|
||||
*/
|
||||
public class MetaDataProfileBeanExt extends MetaDataProfileBean implements Cloneable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2518128223147908835L;
|
||||
private List<FilesetDV> listFileset = null;
|
||||
|
||||
/**
|
||||
* Instantiates a new meta data profile bean ext.
|
||||
*/
|
||||
public MetaDataProfileBeanExt() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new meta data profile bean ext.
|
||||
*
|
||||
* @param type the type
|
||||
* @param title the title
|
||||
* @param metadataFields the metadata fields
|
||||
* @param categories the categories
|
||||
*/
|
||||
public MetaDataProfileBeanExt(String type, String title, List<MetadataFieldWrapper> metadataFields,
|
||||
List<CategoryWrapper> categories) {
|
||||
super(type, title, metadataFields, categories);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list fileset.
|
||||
*
|
||||
* @return the list fileset
|
||||
*/
|
||||
public List<FilesetDV> getListFileset() {
|
||||
if (listFileset == null)
|
||||
listFileset = new ArrayList<FilesetDV>();
|
||||
return listFileset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list fileset.
|
||||
*
|
||||
* @param listFileset the new list fileset
|
||||
*/
|
||||
public void setListFileset(List<FilesetDV> listFileset) {
|
||||
this.listFileset = listFileset;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MetaDataProfileBeanExt clone() throws CloneNotSupportedException {
|
||||
|
||||
MetaDataProfileBeanExt clonedMDPBE = new MetaDataProfileBeanExt();
|
||||
clonedMDPBE.setTitle(this.getTitle());
|
||||
clonedMDPBE.setType(this.getType());
|
||||
ArrayList<FilesetDV> newListFileset = new ArrayList<FilesetDV>();
|
||||
for (FilesetDV filesetDV : this.getListFileset()) {
|
||||
FilesetDV newFileset = new FilesetDV();
|
||||
for (PayloadDV payloadDV : filesetDV.getListPayload()) {
|
||||
PayloadDV newPayloadDV = new PayloadDV();
|
||||
newPayloadDV.setLink(payloadDV.getLink());
|
||||
newPayloadDV.setMimetype(payloadDV.getMimetype());
|
||||
newPayloadDV.setName(payloadDV.getName());
|
||||
newPayloadDV.setStorageID(payloadDV.getStorageID());
|
||||
newFileset.addPayloadDV(newPayloadDV);
|
||||
}
|
||||
|
||||
newListFileset.add(newFileset);
|
||||
}
|
||||
clonedMDPBE.setListFileset(newListFileset);
|
||||
|
||||
ArrayList<MetadataFieldWrapper> newListMetadataFieldWrapper = new ArrayList<MetadataFieldWrapper>();
|
||||
|
||||
for (MetadataFieldWrapper mfw : this.getMetadataFields()) {
|
||||
MetadataFieldWrapper newMfw = new MetadataFieldWrapper();
|
||||
newMfw.setAsGroup(mfw.getAsGroup());
|
||||
newMfw.setAsTag(mfw.getAsTag());
|
||||
newMfw.setCurrentValue(mfw.getCurrentValue());
|
||||
newMfw.setDefaultValue(mfw.getDefaultValue());
|
||||
newMfw.setFieldId(mfw.getFieldId());
|
||||
newMfw.setFieldName(mfw.getFieldName());
|
||||
newMfw.setFieldNameFromCategory(mfw.getFieldNameFromCategory());
|
||||
newMfw.setMandatory(mfw.getMandatory());
|
||||
newMfw.setMaxOccurs(mfw.getMaxOccurs());
|
||||
newMfw.setMultiSelection(mfw.isMultiSelection());
|
||||
newMfw.setNote(mfw.getNote());
|
||||
newMfw.setOwnerCategory(mfw.getOwnerCategory());
|
||||
newMfw.setType(mfw.getType());
|
||||
newMfw.setValidator(mfw.getValidator());
|
||||
newMfw.setVocabulary(mfw.getVocabulary());
|
||||
|
||||
newListMetadataFieldWrapper.add(newMfw);
|
||||
|
||||
}
|
||||
|
||||
clonedMDPBE.setMetadataFields(newListMetadataFieldWrapper);
|
||||
|
||||
return clonedMDPBE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("MetaDataProfileBeanExt [getType()=");
|
||||
builder.append(getType());
|
||||
builder.append(", getTitle()=");
|
||||
builder.append(getTitle());
|
||||
builder.append(", getMetadataFields()=");
|
||||
builder.append(getMetadataFields());
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
|
||||
public class ProjectEdit implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2885327516680245601L;
|
||||
|
||||
private ProjectDV theProjectDV;
|
||||
|
||||
private List<MetaDataProfileBeanExt> theProfileBeans;
|
||||
|
||||
public ProjectEdit() {
|
||||
|
||||
}
|
||||
|
||||
public ProjectDV getTheProjectDV() {
|
||||
return theProjectDV;
|
||||
}
|
||||
|
||||
public List<MetaDataProfileBeanExt> getTheProfileBeans() {
|
||||
return theProfileBeans;
|
||||
}
|
||||
|
||||
public void setTheProjectDV(ProjectDV theProjectDV) {
|
||||
this.theProjectDV = theProjectDV;
|
||||
}
|
||||
|
||||
public void setTheProfileBeans(List<MetaDataProfileBeanExt> theProfileBeans) {
|
||||
this.theProfileBeans = theProfileBeans;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("ProjectEdit [theProjectDV=");
|
||||
builder.append(theProjectDV);
|
||||
builder.append(", theProfileBeans=");
|
||||
builder.append(theProfileBeans);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue