in progress on migration

This commit is contained in:
Francesco Mangiacrapa 2022-03-16 18:10:17 +01:00
parent 608039a4d5
commit f1cec8071a
40 changed files with 1295 additions and 507 deletions

View File

@ -3,24 +3,30 @@ package org.gcube.application.geoportalcommon;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.Project;
import org.gcube.application.geoportal.common.model.document.Relationship;
import org.gcube.application.geoportal.common.model.document.temporal.TemporalReference;
import org.gcube.application.geoportalcommon.geoportal.config.Configuration;
import org.gcube.application.geoportalcommon.geoportal.config.DocumentConfig;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import org.gcube.application.geoportalcommon.geoportal.config.FilePath;
import org.gcube.application.geoportalcommon.geoportal.config.GcubeProfile;
import org.gcube.application.geoportalcommon.geoportal.config.ItemField;
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_CONFIGURATION_TYPE;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.RelationshipDV;
import org.gcube.application.geoportalcommon.shared.geoportal.TemporalReferenceDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ConfigurationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.DocumentConfigDV;
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -36,46 +42,258 @@ public class ConvertToDataValueObjectModel {
private static Logger LOG = LoggerFactory.getLogger(ConvertToDataValueObjectModel.class);
/**
* To document config DV.
* The Enum GEOPORTAL_CONFIGURATION_TYPE.
*
* @param dc the dc
* @return the document config DV
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Mar 16, 2022
*/
public static DocumentConfigDV toDocumentConfigDV(DocumentConfig dc) {
LOG.trace("toDocumentConfigDV called");
if (dc == null) {
LOG.warn(DocumentConfig.class.getSimpleName() + " is null");
// /**
// * To document config DV.
// *
// * @param dc the dc
// * @return the document config DV
// */
// public static DocumentConfigDV toDocumentConfigDV(DocumentConfig dc) {
// LOG.trace("toDocumentConfigDV called");
//
// if (dc == null) {
// LOG.warn(DocumentConfig.class.getSimpleName() + " is null");
// return null;
// }
//
// DocumentConfigDV dcDV = new DocumentConfigDV();
// dcDV.setId(dc.getId());
// dcDV.setType(dc.getType());
// dcDV.setItemType(dc.getItem_type());
//
// Configuration config = dc.getConfiguration();
// if (config == null) {
// LOG.warn(Configuration.class.getSimpleName() + " is null");
// return null;
// }
//
// List<GcubeProfile> gCubeProfiles = config.getGcubeProfiles();
// if (gCubeProfiles == null) {
// LOG.warn("List of " + GcubeProfile.class.getSimpleName() + " is null");
// return null;
// }
//
// ConfigGcubeProfileDV configGcubeProfile = new ConfigGcubeProfileDV();
// List<GcubeProfileDV> gCubeProfilesVO = new ArrayList<GcubeProfileDV>(gCubeProfiles.size());
// for (GcubeProfile gCubeProfile : gCubeProfiles) {
// gCubeProfilesVO.add(toGcubeProfileDV(gCubeProfile));
// }
// configGcubeProfile.setGcubeProfiles(gCubeProfilesVO);
// dcDV.setConfiguration(configGcubeProfile);
//
// LOG.debug("returning: " + dcDV);
// return dcDV;
// }
// /**
// * To document DV.
// *
// * @param <T> the generic type
// * @param config the config
// * @param type the type
// * @return the document DV
// */
// public static <T> DocumentDV<T> toDocumentDV(Configuration<T> config, Class<T> type) {
// LOG.trace("toDocumentConfigDV called");
//
// if (config == null) {
// LOG.warn(Configuration.class.getSimpleName() + " is null");
// return null;
// }
//
// List<T> listConfigs = config.getListConfigs();
// if (listConfigs == null) {
// LOG.warn("List of Configs is null");
// return null;
// }
//
// DocumentDV<T> doc = null;
// if (type == ConfigGcubeProfileDV.class) {
// doc = (DocumentDV<T>) new DocumentDV<ConfigGcubeProfileDV>();
// ConfigGcubeProfileDV configVO = new ConfigGcubeProfileDV();
// List<GcubeProfileDV> listConfigsDV = new ArrayList<GcubeProfileDV>(listConfigs.size());
// for (GcubeProfile gCubeProfile : listConfigsDV) {
// gCubeProfilesVO.add(toGcubeProfileDV(gCubeProfile));
// }
// configVO.setGcubeProfiles(gCubeProfilesVO);
// doc.setConfiguration(configVO);
// }
// LOG.debug("returning: " + doc);
// return doc;
// }
/**
* To use case descriptor DV.
*
* @param ucd the ucd
* @param handlersIds the handlers ids. If not null only returns (so filtering
* for) handler ids. Otherwise returns all handlers
* @return the document config DV
* @throws Exception the exception
*/
public static UseCaseDescriptorDV toUseCaseDescriptorDV(UseCaseDescriptor ucd, String... handlersIds)
throws Exception {
LOG.trace("toUseCaseDescriptorDV called");
if (ucd == null) {
LOG.warn(UseCaseDescriptor.class.getSimpleName() + " is null");
return null;
}
DocumentConfigDV dcVO = new DocumentConfigDV();
dcVO.setId(dc.getId());
dcVO.setType(dc.getType());
dcVO.setItemType(dc.getItem_type());
UseCaseDescriptorDV ucdVO = new UseCaseDescriptorDV();
ucdVO.setId(ucd.getId());
ucdVO.setName(ucd.getName());
ucdVO.setDescription(ucd.getDescription());
ucdVO.setVersion(ucd.getVersion() != null ? ucd.getVersion().toString() : "");
Configuration config = dc.getConfiguration();
if (config == null) {
LOG.warn(Configuration.class.getSimpleName() + " is null");
List<HandlerDeclarationDV> listHandlersDV = new ArrayList<HandlerDeclarationDV>();
if (handlersIds != null) {
Map<String, List<HandlerDeclaration>> handlersMapByID = ucd.getHandlersMapByID();
if (handlersMapByID != null) {
for (String handlersId : handlersIds) {
List<HandlerDeclaration> listHandlerDeclaration = handlersMapByID.get(handlersId);
for (HandlerDeclaration handlerDeclaration : listHandlerDeclaration) {
LOG.debug("converting handler {}", handlerDeclaration);
HandlerDeclarationDV hdDV = toHandlerDeclarationDV(handlerDeclaration);
LOG.debug("handler converted to {}", hdDV);
listHandlersDV.add(hdDV);
}
}
}
} else {
List<HandlerDeclaration> listHandlerDeclaration = ucd.getHandlers();
for (HandlerDeclaration handlerDeclaration : listHandlerDeclaration) {
LOG.debug("converting handler {}", handlerDeclaration);
HandlerDeclarationDV hdDV = toHandlerDeclarationDV(handlerDeclaration);
LOG.debug("handler converted to {}", hdDV);
listHandlersDV.add(hdDV);
}
}
ucdVO.setHandlers(listHandlersDV);
LOG.info("returning {}", ucdVO);
return ucdVO;
}
public static GEOPORTAL_DATA_HANDLER to_GEOPORTAL_DATA_HANDLER(String id) {
if (id == null)
return null;
for (GEOPORTAL_DATA_HANDLER gdh : GEOPORTAL_DATA_HANDLER.values()) {
if (gdh.getId().equals(id)) {
return gdh;
}
}
return null;
}
/**
* To handler declaration DV.
*
* @param handlerDeclaration the handler declaration
* @return the handler declaration DV
* @throws Exception the exception
*/
public static HandlerDeclarationDV toHandlerDeclarationDV(HandlerDeclaration handlerDeclaration) throws Exception {
if (handlerDeclaration == null) {
LOG.warn(HandlerDeclaration.class.getSimpleName() + " is null");
return null;
}
List<GcubeProfile> gCubeProfiles = config.getGcubeProfiles();
if (gCubeProfiles == null) {
LOG.warn("List of " + GcubeProfile.class.getSimpleName() + " is null");
Document configuration = handlerDeclaration.getConfiguration();
HandlerDeclarationDV hdDV = new HandlerDeclarationDV();
hdDV.setId(handlerDeclaration.getId());
hdDV.setType(handlerDeclaration.getType());
hdDV.setHandlerType(to_GEOPORTAL_DATA_HANDLER(handlerDeclaration.getId()));
if (configuration == null) {
LOG.warn("Configuration is null");
return null;
}
ConfigurationDV configVO = new ConfigurationDV();
List<GcubeProfileDV> gCubeProfilesVO = new ArrayList<GcubeProfileDV>(gCubeProfiles.size());
for (GcubeProfile gCubeProfile : gCubeProfiles) {
gCubeProfilesVO.add(toGcubeProfileDV(gCubeProfile));
}
configVO.setGcubeProfiles(gCubeProfilesVO);
dcVO.setConfiguration(configVO);
try {
GEOPORTAL_CONFIGURATION_TYPE foundConfig = null;
ArrayList<String> configurations = null;
for (GEOPORTAL_CONFIGURATION_TYPE configManaged : GEOPORTAL_CONFIGURATION_TYPE.values()) {
try {
configurations = configuration.get(configManaged.getId(), ArrayList.class);
foundConfig = configManaged;
break;
} catch (Exception e) {
LOG.info(configManaged.getId() + "not found in the handler");
}
}
if (configurations == null) {
String error = "No managed configurations as '" + GEOPORTAL_CONFIGURATION_TYPE.values()
+ "' found in the handler";
LOG.warn(error);
throw new Exception(error);
}
switch (foundConfig) {
case gcube_profiles: {
List<GcubeProfileDV> listGcubeProfiles = new ArrayList<GcubeProfileDV>(configurations.size());
int i = 0;
for (String gCubeProfile : configurations) {
LOG.debug(i++ + ") the gCubeProfile is: " + gCubeProfile);
GcubeProfile profile = org.gcube.application.geoportal.client.utils.Serialization.read(gCubeProfile,
GcubeProfile.class);
listGcubeProfiles.add(toGcubeProfileDV(profile));
}
ConfigurationDV<List<GcubeProfileDV>> dDV = new ConfigurationDV<List<GcubeProfileDV>>(
listGcubeProfiles);
dDV.setConfiguration(listGcubeProfiles);
dDV.setConfigurationType(GEOPORTAL_CONFIGURATION_TYPE.gcube_profiles);
hdDV.setConfiguration(dDV);
LOG.info("returning {}", hdDV);
return hdDV;
}
case item_fields: {
List<ItemFieldDV> listItemFields = new ArrayList<ItemFieldDV>(configurations.size());
int i = 0;
for (String itemField : configurations) {
LOG.debug(i++ + ") the itemField is: " + itemField);
ItemField profile = org.gcube.application.geoportal.client.utils.Serialization.read(itemField,
ItemField.class);
listItemFields.add(toItemFieldDV(profile));
}
ConfigurationDV<List<ItemFieldDV>> dDV = new ConfigurationDV<List<ItemFieldDV>>(listItemFields);
dDV.setConfiguration(listItemFields);
dDV.setConfigurationType(GEOPORTAL_CONFIGURATION_TYPE.item_fields);
hdDV.setConfiguration(dDV);
LOG.info("returning {}", hdDV);
return hdDV;
}
default:
break;
}
} catch (Exception e) {
LOG.error("Error on getting " + HandlerDeclaration.class.getSimpleName(), e);
throw e;
}
return null;
LOG.debug("returning: " + dcVO);
return dcVO;
}
/**
@ -116,6 +334,32 @@ public class ConvertToDataValueObjectModel {
return gpVO;
}
/**
* To item field DV.
*
* @param itemField the item field
* @return the item field DV
*/
public static ItemFieldDV toItemFieldDV(ItemField itemField) {
LOG.trace("toItemFieldDV called");
if (itemField == null) {
LOG.warn(GcubeProfile.class.getSimpleName() + " is null");
return null;
}
ItemFieldDV ifDV = new ItemFieldDV();
ifDV.setDisplayAsResult(itemField.isAsResult());
ifDV.setDisplayName(itemField.getLabel());
ifDV.setJsonFields(itemField.getPaths());
ifDV.setOperator(itemField.getOperator());
ifDV.setSearchable(itemField.isSearchable());
ifDV.setSortable(itemField.isSortable());
LOG.info("returning: " + ifDV);
return ifDV;
}
/**
* To file path DV.
*
@ -138,6 +382,14 @@ public class ConvertToDataValueObjectModel {
return fpVO;
}
/**
* To project DV.
*
* @param project the project
* @param projectReader the project reader
* @return the project DV
* @throws Exception the exception
*/
public static ProjectDV toProjectDV(Project project, ProjectDVBuilder projectReader) throws Exception {
LOG.info("toProjectDV called");
@ -196,18 +448,36 @@ public class ConvertToDataValueObjectModel {
}
/**
* To temporal reference DV.
*
* @param temporalReference the temporal reference
* @param listDocumentKeys the list document keys
* @param getFullMap the get full map
* @return the temporal reference DV
*/
public static TemporalReferenceDV toTemporalReferenceDV(TemporalReference temporalReference,
List<String> listDocumentKeys, boolean getFullMap) {
if (temporalReference == null)
return null;
TemporalReferenceDV trDV = toDocumentDV(temporalReference, TemporalReferenceDV.class, listDocumentKeys,
getFullMap);
TemporalReferenceDV trDV = (TemporalReferenceDV) toDocumentDV(temporalReference, TemporalReferenceDV.class,
listDocumentKeys, getFullMap);
trDV.setField(temporalReference.getField());
return trDV;
}
public static <T extends DocumentDV> T toDocumentDV(Document document, Class<T> toType,
/**
* To document DV.
*
* @param <T> the generic type
* @param document the document
* @param toType the to type
* @param listDocumentKeys the list document keys
* @param getFullMap the get full map
* @return the t
*/
public static <T extends DocumentDV> DocumentDV toDocumentDV(Document document, Class<T> toType,
List<String> listDocumentKeys, boolean getFullMap) {
if (document == null)
return null;
@ -241,6 +511,12 @@ public class ConvertToDataValueObjectModel {
return documentDV;
}
/**
* To relationship DV.
*
* @param relationship the relationship
* @return the relationship DV
*/
public static RelationshipDV toRelationshipDV(Relationship relationship) {
if (relationship == null)

View File

@ -9,8 +9,8 @@ import org.gcube.application.geoportalcommon.config.CSVFile;
import org.gcube.application.geoportalcommon.config.CSVReader;
import org.gcube.application.geoportalcommon.config.CSVRow;
import org.gcube.application.geoportalcommon.config.FileUtil;
import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.exception.GNAConfigException;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -35,11 +35,11 @@ public class GNAConfigsConverter {
* @return the list
* @throws GNAConfigException the GNA user rights config exception
*/
public List<ItemField> readListItemsConfig(String contentValue) throws GNAConfigException {
public List<ItemFieldDV> readListItemsConfig(String contentValue) throws GNAConfigException {
LOG.debug("readListItemsConfig called");
File configurationFile = null;
List<ItemField> listItemFields = new ArrayList<ItemField>();
List<ItemFieldDV> listItemFields = new ArrayList<ItemFieldDV>();
try {
configurationFile = FileUtil.inputStreamToTempFile(contentValue, "GNA_ListItems_Configs"+new Random().nextInt());
@ -57,7 +57,7 @@ public class GNAConfigsConverter {
// Starting from index 1 (means the second row in the CSV)
for (int i = 0; i < rows.size(); i++) {
LOG.trace(i + " row");
ItemField itemField = new ItemField();
ItemFieldDV itemField = new ItemFieldDV();
CSVRow row = rows.get(i);
// mapping to ItemFiel

View File

@ -18,13 +18,13 @@ import org.gcube.application.geoportalcommon.config.CSVReader;
import org.gcube.application.geoportalcommon.config.CSVRow;
import org.gcube.application.geoportalcommon.config.FileUtil;
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM;
import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole;
import org.gcube.application.geoportalcommon.shared.config.RoleRights;
import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE;
import org.gcube.application.geoportalcommon.shared.exception.ApplicationProfileNotFoundException;
import org.gcube.application.geoportalcommon.shared.exception.GNAConfigException;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.common.resources.gcore.utils.XPathHelper;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
@ -129,7 +129,7 @@ public class GNADataEntryConfigProfileReader {
LOG.debug(PATH_TO_ITEM_FIELDS_CONFIG + " with new lines: " + value_with_new_lines);
GNAConfigsConverter gnc = new GNAConfigsConverter();
List<ItemField> listItemFieldsConfig = gnc.readListItemsConfig(value_with_new_lines);
List<ItemFieldDV> listItemFieldsConfig = gnc.readListItemsConfig(value_with_new_lines);
gnDEC.setListItemFields(listItemFieldsConfig);
LOG.info("returning: " + gnDEC);

View File

@ -15,9 +15,9 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.LayerItem;
import org.gcube.application.geoportalcommon.shared.exception.ApplicationProfileNotFoundException;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.common.resources.gcore.utils.XPathHelper;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
@ -150,7 +150,7 @@ public class GNADataViewerConfigProfileReader {
LOG.debug(PATH_TO_ITEM_FIELDS_CONFIG + " with new lines: " + value_with_new_lines);
GNAConfigsConverter gnc = new GNAConfigsConverter();
List<ItemField> listItemFieldsConfig = gnc.readListItemsConfig(value_with_new_lines);
List<ItemFieldDV> listItemFieldsConfig = gnc.readListItemsConfig(value_with_new_lines);
profile.setListItemFields(listItemFieldsConfig);
LOG.info("returning: " + profile);

View File

@ -14,5 +14,4 @@ public class GeoportalCommonConstants {
public static final String GEOPORTAL_DATA_VIEWER_APP = "geoportal-data-viewer-app";
}

View File

@ -1,73 +1,70 @@
package org.gcube.application.geoportalcommon;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import org.gcube.application.geoportalcommon.geoportal.config.DocumentConfig;
import org.gcube.application.geoportalcommon.shared.geoportal.config.DocumentConfigDV;
import com.fasterxml.jackson.core.JsonProcessingException;
public class MockDocumentConfigurationReader {
private List<DocumentConfigDV> listDocumentConfigsDV = new ArrayList<DocumentConfigDV>();
public MockDocumentConfigurationReader() {
try {
loadDocumentConfiguration();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//THIS IS A MOCK
private void loadDocumentConfiguration() throws Exception {
System.out.println("loadDocumentConfiguration called");
String filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config.json";
DocumentConfigDV dc = getDocumentConfigVO(filePath);
listDocumentConfigsDV.add(dc);
filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config2.json";
dc = getDocumentConfigVO(filePath);
listDocumentConfigsDV.add(dc);
filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config3.json";
dc = getDocumentConfigVO(filePath);
listDocumentConfigsDV.add(dc);
filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config4.json";
dc = getDocumentConfigVO(filePath);
listDocumentConfigsDV.add(dc);
}
private DocumentConfigDV getDocumentConfigVO(String filePath) throws JsonProcessingException, IOException {
String theFile = readFile(filePath);
System.out.println("the file is: " + theFile);
DocumentConfig dc = org.gcube.application.geoportal.client.utils.Serialization.read(theFile,
DocumentConfig.class);
System.out.println(dc);
return ConvertToDataValueObjectModel.toDocumentConfigDV(dc);
}
private static String readFile(String filePath) {
String content = "";
try {
content = new String(Files.readAllBytes(Paths.get(filePath)));
} catch (IOException e) {
e.printStackTrace();
}
return content;
}
public List<DocumentConfigDV> getListDocumentConfig() {
return listDocumentConfigsDV;
}
}
//package org.gcube.application.geoportalcommon;
//
//import java.io.IOException;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.util.ArrayList;
//import java.util.List;
//
//import org.gcube.application.geoportalcommon.shared.geoportal.config.DocumentConfigDV;
//
//public class MockDocumentConfigurationReader {
//
// private List<DocumentConfigDV> listDocumentConfigsDV = new ArrayList<DocumentConfigDV>();
//
// public MockDocumentConfigurationReader() {
// try {
// //loadDocumentConfiguration();
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
//
//// //THIS IS A MOCK
//// private void loadDocumentConfiguration() throws Exception {
//// System.out.println("loadDocumentConfiguration called");
//// String filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config.json";
////
//// DocumentConfigDV dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
////
//// filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config2.json";
//// dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
////
//// filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config3.json";
//// dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
////
//// filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config4.json";
//// dc = getDocumentConfigVO(filePath);
//// listDocumentConfigsDV.add(dc);
//// }
////
//// private DocumentConfigDV getDocumentConfigVO(String filePath) throws JsonProcessingException, IOException {
//// String theFile = readFile(filePath);
//// System.out.println("the file is: " + theFile);
//// DocumentConfig dc = org.gcube.application.geoportal.client.utils.Serialization.read(theFile,
//// DocumentConfig.class);
//// System.out.println(dc);
////
//// return ConvertToDataValueObjectModel.toDocumentConfigDV(dc);
//// }
//
// public static String readFile(String filePath) {
// String content = "";
//
// try {
// content = new String(Files.readAllBytes(Paths.get(filePath)));
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// return content;
// }
//
// public List<DocumentConfigDV> getListDocumentConfig() {
// return listDocumentConfigsDV;
// }
//}

View File

@ -15,7 +15,7 @@
//import org.gcube.application.geoportal.common.model.rest.QueryRequest.OrderedRequest.Direction;
//import org.gcube.application.geoportal.common.model.rest.QueryRequest.PagedRequest;
//import org.gcube.application.geoportal.common.rest.MongoConcessioni;
//import org.gcube.application.geoportalcommon.shared.ItemField;
//import org.gcube.application.geoportalcommon.shared.ItemFieldDV;
//import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
//import org.gcube.application.geoportalcommon.shared.SearchingFilter;
//import org.gcube.application.geoportalcommon.shared.SearchingFilter.LOGICAL_OP;

View File

@ -24,13 +24,13 @@ import org.gcube.application.geoportal.common.utils.FileSets;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
import org.gcube.application.geoportalcommon.ProjectDVBuilder;
import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.SearchingFilter.LOGICAL_OP;
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
import org.gcube.application.geoportalcommon.shared.WhereClause;
import org.gcube.application.geoportalcommon.shared.geoportal.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -44,7 +44,7 @@ public class ProjectsCaller {
private static Logger LOG = LoggerFactory.getLogger(GeoportalClientCaller.class);
public Projects<Project> getClient(String profileID) {
LOG.info("getProjectsClient called for profileID={}", profileID);
LOG.info("getClient called for profileID={}", profileID);
return projects(profileID).build();
}
@ -74,7 +74,7 @@ public class ProjectsCaller {
}
public List<Project> getListForProfileID(String profileID) throws Exception {
LOG.info("getlistOfProjectsForProfileID called for profileID: {}", profileID);
LOG.info("getListForProfileID called for profileID: {}", profileID);
Projects<Project> client = (Projects<Project>) getClient(profileID);
List<Project> listProjects = new ArrayList<Project>();
@ -108,6 +108,7 @@ public class ProjectsCaller {
*/
public ResultSetPaginatedData queryOnMongo(String profileID, Integer totalItems, Integer offset, Integer limit,
SearchingFilter filter, String recordType, ProjectDVBuilder projectDVBuilder) throws Exception {
LOG.info("queryOnMongo called");
try {
@ -158,19 +159,19 @@ public class ProjectsCaller {
break;
}
List<ItemField> orderByFields = filter.getOrderByFields();
List<ItemFieldDV> orderByFields = filter.getOrderByFields();
if (orderByFields == null) {
orderByFields = new ArrayList<ItemField>();
orderByFields = new ArrayList<ItemFieldDV>();
}
if (orderByFields.isEmpty()) {
ItemField orderD = new ItemField("", Arrays.asList("name"), false, false, false);
ItemFieldDV orderD = new ItemFieldDV("", Arrays.asList("name"), null, false, false, false);
LOG.info("Order by is null, adding default: " + orderD);
orderByFields.add(orderD);
}
for (ItemField itemField : orderByFields) {
for (ItemFieldDV itemField : orderByFields) {
if (itemField.getJsonFields() != null) {
for (String field : itemField.getJsonFields()) {
orderingFields.add(field);

View File

@ -13,6 +13,7 @@ import org.gcube.application.geoportal.common.rest.UseCaseDescriptorsI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject;
public class UseCaseDescriptorCaller {
@ -25,7 +26,7 @@ public class UseCaseDescriptorCaller {
}
public List<UseCaseDescriptor> getList() throws Exception {
LOG.info("getlistOfUseCaseDescriptors called");
LOG.info("getList called");
UseCaseDescriptorsI client = useCaseDescriptorsClient();
List<UseCaseDescriptor> listUCD = new ArrayList<UseCaseDescriptor>();
Iterator<UseCaseDescriptor> useCaseDescrs = client.query(new QueryRequest());
@ -38,17 +39,68 @@ public class UseCaseDescriptorCaller {
return listUCD;
}
public UseCaseDescriptor geUCDForId(String profileID) throws Exception {
LOG.info("getUseCaseDescriptorForId called for profileID: {}", profileID);
public List<UseCaseDescriptor> getListForHandlerIds(List<String> listHandlersIds) throws Exception {
LOG.info("getListForHandlerId called");
return getListForJSONPath("_handlers._id", listHandlersIds);
}
public List<UseCaseDescriptor> getListForJSONPath(String jsonPath, List<String> listValues) throws Exception {
LOG.info("getListForJSONPath called for jsonPath: {}, with listValues: {}", jsonPath, listValues);
UseCaseDescriptorsI client = useCaseDescriptorsClient();
List<UseCaseDescriptor> listUCD = new ArrayList<UseCaseDescriptor>();
// BasicDBObjectBuilder builder = BasicDBObjectBuilder.start();
// for (String key : listHandlersIds) {
// // using regex and case-insensitive
// BasicDBObject bs = new BasicDBObject();
// bs.append(jsonPath, key);
// builder.append(key, bs);
//
// }
// Building list of Document in OR clause
BasicDBList list = new BasicDBList();
for (String value : listValues) {
Document doc = new Document(jsonPath, value);
list.add(doc);
}
QueryRequest queryRequest = new QueryRequest();
Document queryDoc = new Document();
queryDoc.put("$eq", list);
LOG.debug("Performing query: {}", queryDoc.toJson());
queryRequest.setFilter(queryDoc);
// QueryRequest queryRequest = new QueryRequest();
// Document queryDoc = new Document();
// BasicDBObject bs = new BasicDBObject();
// bs.append("$eq", hasValue);
// queryDoc.put(jsonPath, bs);
// LOG.debug("Performing query: {}", queryDoc.toJson());
// queryRequest.setFilter(queryDoc);
Iterator<UseCaseDescriptor> useCaseDescrs = client.query(queryRequest);
for (Iterator<UseCaseDescriptor> iterator = useCaseDescrs; useCaseDescrs.hasNext();) {
UseCaseDescriptor prg = (UseCaseDescriptor) iterator.next();
listUCD.add(prg);
}
LOG.info("returning %d {}", listUCD.size(), UseCaseDescriptor.class.getName());
return listUCD;
}
public UseCaseDescriptor getUCDForId(String profileID) throws Exception {
LOG.info("getUCDForId called for profileID: {}", profileID);
UseCaseDescriptorsI client = useCaseDescriptorsClient();
QueryRequest queryRequest = new QueryRequest();
Document queryDoc = new Document();
BasicDBObject bs = new BasicDBObject();
bs.append("$eq", profileID);
queryDoc.put("_id", bs);
LOG.debug("Performing query: {}", queryDoc.toJson());
queryRequest.setFilter(queryDoc);
Iterator<UseCaseDescriptor> useCaseDescrs = client.query(queryRequest);
UseCaseDescriptor ucd = null;

View File

@ -1,17 +1,17 @@
package org.gcube.application.geoportalcommon.geoportal.config;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Data
@XmlRootElement(name = "configuration")
@Slf4j
public class Configuration{
private List<GcubeProfile> gcubeProfiles;
}
//package org.gcube.application.geoportalcommon.geoportal.config;
//
//import java.util.List;
//
//import javax.xml.bind.annotation.XmlRootElement;
//
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//
//@Data
//@XmlRootElement(name = "_configuration")
//@Slf4j
//public class Configuration<T>{
//
// private List<T> listConfigs;
//
//}

View File

@ -0,0 +1,19 @@
//package org.gcube.application.geoportalcommon.geoportal.config;
//
//import java.util.List;
//
//import javax.xml.bind.annotation.XmlRootElement;
//
//import com.fasterxml.jackson.annotation.JsonProperty;
//
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//
//@Data
//@XmlRootElement(name = "_configuration")
//@Slf4j
//public class ConfigurationGCubeProfile {
//
// @JsonProperty(value = "gcubeProfiles")
// private List<GcubeProfile> listConfigs;
//}

View File

@ -1,27 +1,27 @@
package org.gcube.application.geoportalcommon.geoportal.config;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Data
@XmlRootElement
@Slf4j
public class DocumentConfig {
@JsonProperty
private String id;
@JsonProperty
private String type;
@JsonProperty
private String item_type;
@JsonProperty
private Configuration configuration;
}
//package org.gcube.application.geoportalcommon.geoportal.config;
//
//import javax.xml.bind.annotation.XmlRootElement;
//
//import com.fasterxml.jackson.annotation.JsonProperty;
//
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//
//@Data
//@XmlRootElement
//@Slf4j
//public class DocumentConfig<T> {
//
// @JsonProperty
// private String _id;
//
// @JsonProperty
// private String _type;
//
// @JsonProperty
// private String _item_type;
//
// @JsonProperty
// private Configuration<T> _configuration;
//
//}

View File

@ -18,8 +18,6 @@ public class GcubeProfile {
public static final int MIN_MAX_NOT_SPECIFIED = -1;
public GcubeProfile() {}
@JsonProperty
private String gcubeSecondaryType;
@ -53,6 +51,8 @@ public class GcubeProfile {
@JsonProperty(FILE_PATHS)
private List<FilePath> filePaths;
public GcubeProfile() {}
}

View File

@ -0,0 +1,27 @@
//package org.gcube.application.geoportalcommon.geoportal.config;
//
//import javax.xml.bind.annotation.XmlRootElement;
//
//import com.fasterxml.jackson.annotation.JsonProperty;
//
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//
//@Data
//@XmlRootElement
//@Slf4j
//public class HandlerGcubeProfile {
//
// @JsonProperty
// private String _id;
//
// @JsonProperty
// private String _type;
//
// @JsonProperty
// private String _item_type;
//
// @JsonProperty
// private ConfigurationGCubeProfile _configuration;
//
//}

View File

@ -0,0 +1,33 @@
package org.gcube.application.geoportalcommon.geoportal.config;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Data
@XmlRootElement(name = "itemFields")
@Slf4j
public class ItemField {
@JsonProperty
private String label;
@JsonProperty
private List<String> paths;
@JsonProperty
private String operator;
@JsonProperty
private boolean searchable;
@JsonProperty
private boolean sortable;
@JsonProperty
private boolean asResult;
public ItemField() {
}
}

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.config.RoleRights;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
/**
* The Class GNADataEntryConfigProfile.
@ -18,7 +19,7 @@ public class GNADataEntryConfigProfile implements Serializable {
*
*/
private static final long serialVersionUID = 5152380669677928785L;
private List<ItemField> listItemFields;
private List<ItemFieldDV> listItemFields;
private List<RoleRights> permissionsForRole;
/**
@ -34,7 +35,7 @@ public class GNADataEntryConfigProfile implements Serializable {
* @param listItemFields the list item fields
* @param permissionsForRole the permissions for role
*/
public GNADataEntryConfigProfile(List<ItemField> listItemFields, List<RoleRights> permissionsForRole) {
public GNADataEntryConfigProfile(List<ItemFieldDV> listItemFields, List<RoleRights> permissionsForRole) {
super();
this.listItemFields = listItemFields;
this.permissionsForRole = permissionsForRole;
@ -45,7 +46,7 @@ public class GNADataEntryConfigProfile implements Serializable {
*
* @return the list item fields
*/
public List<ItemField> getListItemFields() {
public List<ItemFieldDV> getListItemFields() {
return listItemFields;
}
@ -54,7 +55,7 @@ public class GNADataEntryConfigProfile implements Serializable {
*
* @param listItemFields the new list item fields
*/
public void setListItemFields(List<ItemField> listItemFields) {
public void setListItemFields(List<ItemFieldDV> listItemFields) {
this.listItemFields = listItemFields;
}

View File

@ -4,6 +4,8 @@ import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
/**
* The Class GNADataViewerConfigProfile.
*
@ -21,7 +23,7 @@ public class GNADataViewerConfigProfile implements Serializable {
private String openPortletURL;
// the key is the layer type
private Map<String, LayerItem> mapLayers;
private List<ItemField> listItemFields;
private List<ItemFieldDV> listItemFields;
/**
* Instantiates a new geo na data viewer profile.
@ -89,7 +91,7 @@ public class GNADataViewerConfigProfile implements Serializable {
*
* @return the list item fields
*/
public List<ItemField> getListItemFields() {
public List<ItemFieldDV> getListItemFields() {
return listItemFields;
}
@ -98,7 +100,7 @@ public class GNADataViewerConfigProfile implements Serializable {
*
* @param listItemFields the new list item fields
*/
public void setListItemFields(List<ItemField> listItemFields) {
public void setListItemFields(List<ItemFieldDV> listItemFields) {
this.listItemFields = listItemFields;
}

View File

@ -3,6 +3,8 @@ package org.gcube.application.geoportalcommon.shared;
import java.io.Serializable;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
/**
* The Class SearchingFilter.
*
@ -79,7 +81,7 @@ public class SearchingFilter implements Serializable {
*/
private static final long serialVersionUID = -4004094263090373626L;
private List<ItemField> orderByFields;
private List<ItemFieldDV> orderByFields;
private ORDER order = ORDER.ASC;
@ -98,7 +100,7 @@ public class SearchingFilter implements Serializable {
* @param orderByFields the order by fields
* @param order the order
*/
public SearchingFilter(List<ItemField> orderByFields, ORDER order) {
public SearchingFilter(List<ItemFieldDV> orderByFields, ORDER order) {
this.orderByFields = orderByFields;
this.order = order;
}
@ -110,7 +112,7 @@ public class SearchingFilter implements Serializable {
* @param order the order
* @param searchInto the search into
*/
public SearchingFilter(List<ItemField> orderByFields, ORDER order, List<WhereClause> conditions) {
public SearchingFilter(List<ItemFieldDV> orderByFields, ORDER order, List<WhereClause> conditions) {
this.orderByFields = orderByFields;
this.order = order;
this.conditions = conditions;
@ -129,7 +131,7 @@ public class SearchingFilter implements Serializable {
*
* @return the order by fields
*/
public List<ItemField> getOrderByFields() {
public List<ItemFieldDV> getOrderByFields() {
return orderByFields;
}
@ -147,7 +149,7 @@ public class SearchingFilter implements Serializable {
*
* @param orderByFields the new order by fields
*/
public void setOrderByFields(List<ItemField> orderByFields) {
public void setOrderByFields(List<ItemFieldDV> orderByFields) {
this.orderByFields = orderByFields;
}

View File

@ -0,0 +1,54 @@
package org.gcube.application.geoportalcommon.shared.geoportal;
import java.io.Serializable;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GeoportalConfigurationID;
public class ConfigurationDV<T extends List<? extends GeoportalConfigurationID>> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 4836713840177636940L;
private T configuration;
private GEOPORTAL_CONFIGURATION_TYPE configurationType;
public ConfigurationDV() {
}
public ConfigurationDV(T configuration) {
this.configuration = configuration;
}
public GEOPORTAL_CONFIGURATION_TYPE getConfigurationType() {
return configurationType;
}
public void setConfigurationType(GEOPORTAL_CONFIGURATION_TYPE configurationType) {
this.configurationType = configurationType;
}
public T getConfiguration() {
return configuration;
}
public void setConfiguration(T config) {
this.configuration = config;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ConfigurationDV [configuration=");
builder.append(configuration);
builder.append(", configurationType=");
builder.append(configurationType);
builder.append("]");
return builder.toString();
}
}

View File

@ -11,16 +11,11 @@ public class DocumentDV implements Serializable {
private static final long serialVersionUID = 4978517506036855883L;
private LinkedHashMap<String, Object> documentAsMap;
private String documentAsJSON;
private ConfigurationDV<?> configuration;
public DocumentDV() {
}
public DocumentDV(LinkedHashMap<String, Object> documentAsMap, String documentAsJSON) {
super();
this.documentAsMap = documentAsMap;
this.documentAsJSON = documentAsJSON;
}
public LinkedHashMap<String, Object> getDocumentAsMap() {
return documentAsMap;
}
@ -37,6 +32,14 @@ public class DocumentDV implements Serializable {
this.documentAsJSON = documentAsJSON;
}
public ConfigurationDV<?> getConfiguration() {
return configuration;
}
public void setConfiguration(ConfigurationDV<?> configuration) {
this.configuration = configuration;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
@ -44,6 +47,8 @@ public class DocumentDV implements Serializable {
builder.append(documentAsMap);
builder.append(", documentAsJSON=");
builder.append(documentAsJSON);
builder.append(", configuration=");
builder.append(configuration);
builder.append("]");
return builder.toString();
}

View File

@ -0,0 +1,36 @@
package org.gcube.application.geoportalcommon.shared.geoportal;
public enum GEOPORTAL_CONFIGURATION_TYPE {
item_fields("itemFields"), gcube_profiles("gcubeProfiles");
String id;
/**
* Instantiates a new gna config managed.
*
* @param id the id
*/
GEOPORTAL_CONFIGURATION_TYPE(String id) {
this.id = id;
}
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
return id;
}
}

View File

@ -0,0 +1,23 @@
package org.gcube.application.geoportalcommon.shared.geoportal;
public enum GEOPORTAL_DATA_HANDLER {
geoportal_data_list("org.gcube.portlets.user.geoportal-data-list", "DATA_LIST_GUI"),
geoportal_data_entry("org.gcube.portlets.user.geoportal-data-entry-app", "DATA_ENTRY_GUI");
String id;
String type;
GEOPORTAL_DATA_HANDLER(String id, String type) {
this.id = id;
this.type = type;
}
public String getId() {
return id;
}
public String getType() {
return type;
}
}

View File

@ -10,16 +10,18 @@ public class HandlerDeclarationDV implements Serializable {
private static final long serialVersionUID = 9095207023666383038L;
private String id;
private String type;
private DocumentDV configuration;
private ConfigurationDV<?> configuration;
private GEOPORTAL_DATA_HANDLER dataHandlerType;
HandlerDeclarationDV() {
public HandlerDeclarationDV() {
}
public HandlerDeclarationDV(String id, String type, DocumentDV configuration) {
super();
public HandlerDeclarationDV(String id, String type, ConfigurationDV<?> configuration,
GEOPORTAL_DATA_HANDLER dataHandlerType) {
this.id = id;
this.type = type;
this.configuration = configuration;
this.dataHandlerType = dataHandlerType;
}
public String getId() {
@ -30,7 +32,7 @@ public class HandlerDeclarationDV implements Serializable {
return type;
}
public DocumentDV getConfiguration() {
public ConfigurationDV<?> getConfiguration() {
return configuration;
}
@ -42,10 +44,19 @@ public class HandlerDeclarationDV implements Serializable {
this.type = type;
}
public void setConfiguration(DocumentDV configuration) {
public void setConfiguration(ConfigurationDV<?> configuration) {
this.configuration = configuration;
}
public void setHandlerType(GEOPORTAL_DATA_HANDLER dataHandlerType) {
this.dataHandlerType = dataHandlerType;
}
public GEOPORTAL_DATA_HANDLER getDataHandlerType() {
return dataHandlerType;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
@ -55,6 +66,8 @@ public class HandlerDeclarationDV implements Serializable {
builder.append(type);
builder.append(", configuration=");
builder.append(configuration);
builder.append(", dataHandlerType=");
builder.append(dataHandlerType);
builder.append("]");
return builder.toString();
}

View File

@ -6,6 +6,7 @@ package org.gcube.application.geoportalcommon.shared.geoportal;
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Mar 10, 2022
* @param <T>
*/
public class TemporalReferenceDV extends DocumentDV {

View File

@ -14,24 +14,17 @@ public class UseCaseDescriptorDV implements Serializable {
private String name;
private String description;
private String fieldType;
private String fieldLabel;
private List<HandlerDeclarationDV> handlers;
UseCaseDescriptorDV() {
public UseCaseDescriptorDV() {
}
public UseCaseDescriptorDV(String id, String version, String name, String description, String fieldType,
String fieldLabel, List<HandlerDeclarationDV> handlers) {
public UseCaseDescriptorDV(String id, String version, String name, String description) {
super();
this.id = id;
this.version = version;
this.name = name;
this.description = description;
this.fieldType = fieldType;
this.fieldLabel = fieldLabel;
this.handlers = handlers;
}
public String getId() {
@ -50,14 +43,6 @@ public class UseCaseDescriptorDV implements Serializable {
return description;
}
public String getFieldType() {
return fieldType;
}
public String getFieldLabel() {
return fieldLabel;
}
public List<HandlerDeclarationDV> getHandlers() {
return handlers;
}
@ -78,14 +63,6 @@ public class UseCaseDescriptorDV implements Serializable {
this.description = description;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
public void setFieldLabel(String fieldLabel) {
this.fieldLabel = fieldLabel;
}
public void setHandlers(List<HandlerDeclarationDV> handlers) {
this.handlers = handlers;
}
@ -101,10 +78,6 @@ public class UseCaseDescriptorDV implements Serializable {
builder.append(name);
builder.append(", description=");
builder.append(description);
builder.append(", fieldType=");
builder.append(fieldType);
builder.append(", fieldLabel=");
builder.append(fieldLabel);
builder.append(", handlers=");
builder.append(handlers);
builder.append("]");

View File

@ -0,0 +1,35 @@
//package org.gcube.application.geoportalcommon.shared.geoportal.config;
//
//import java.io.Serializable;
//import java.util.List;
//
//public class ConfigGcubeProfileDV implements Serializable {
//
// /**
// *
// */
// private static final long serialVersionUID = 372838411789432170L;
//
// private List<GcubeProfileDV> gcubeProfiles;
//
// public ConfigGcubeProfileDV() {
// }
//
// public List<GcubeProfileDV> getGcubeProfiles() {
// return gcubeProfiles;
// }
//
// public void setGcubeProfiles(List<GcubeProfileDV> gcubeProfiles) {
// this.gcubeProfiles = gcubeProfiles;
// }
//
// @Override
// public String toString() {
// StringBuilder builder = new StringBuilder();
// builder.append("ConfigGcubeProfileDV [gcubeProfiles=");
// builder.append(gcubeProfiles);
// builder.append("]");
// return builder.toString();
// }
//
//}

View File

@ -1,35 +0,0 @@
package org.gcube.application.geoportalcommon.shared.geoportal.config;
import java.io.Serializable;
import java.util.List;
public class ConfigurationDV implements Serializable {
/**
*
*/
private static final long serialVersionUID = 372838411789432170L;
private List<GcubeProfileDV> gcubeProfiles;
public ConfigurationDV() {
}
public List<GcubeProfileDV> getGcubeProfiles() {
return gcubeProfiles;
}
public void setGcubeProfiles(List<GcubeProfileDV> gcubeProfiles) {
this.gcubeProfiles = gcubeProfiles;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ConfigurationDV [gcubeProfiles=");
builder.append(gcubeProfiles);
builder.append("]");
return builder.toString();
}
}

View File

@ -1,66 +1,66 @@
package org.gcube.application.geoportalcommon.shared.geoportal.config;
import java.io.Serializable;
public class DocumentConfigDV implements Serializable {
/**
*
*/
private static final long serialVersionUID = 7538079431272352662L;
private String id;
private String type;
private String itemType;
private ConfigurationDV configuration;
public DocumentConfigDV() {
}
public String getId() {
return id;
}
public String getType() {
return type;
}
public ConfigurationDV getConfiguration() {
return configuration;
}
public void setId(String id) {
this.id = id;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public void setType(String type) {
this.type = type;
}
public void setConfiguration(ConfigurationDV configuration) {
this.configuration = configuration;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("DocumentConfigDV [id=");
builder.append(id);
builder.append(", type=");
builder.append(type);
builder.append(", itemType=");
builder.append(itemType);
builder.append(", configuration=");
builder.append(configuration);
builder.append("]");
return builder.toString();
}
}
//package org.gcube.application.geoportalcommon.shared.geoportal.config;
//
//import java.io.Serializable;
//
//public class DocumentConfigDV implements Serializable {
//
// /**
// *
// */
// private static final long serialVersionUID = 7538079431272352662L;
// private String id;
// private String type;
// private String itemType;
// private ConfigGcubeProfileDV configuration;
//
// public DocumentConfigDV() {
// }
//
// public String getId() {
// return id;
// }
//
// public String getType() {
// return type;
// }
//
// public ConfigGcubeProfileDV getConfiguration() {
// return configuration;
// }
//
// public void setId(String id) {
// this.id = id;
// }
//
// public String getItemType() {
// return itemType;
// }
//
// public void setItemType(String itemType) {
// this.itemType = itemType;
// }
//
// public void setType(String type) {
// this.type = type;
// }
//
// public void setConfiguration(ConfigGcubeProfileDV configuration) {
// this.configuration = configuration;
// }
//
// @Override
// public String toString() {
// StringBuilder builder = new StringBuilder();
// builder.append("DocumentConfigDV [id=");
// builder.append(id);
// builder.append(", type=");
// builder.append(type);
// builder.append(", itemType=");
// builder.append(itemType);
// builder.append(", configuration=");
// builder.append(configuration);
// builder.append("]");
// return builder.toString();
// }
//
//}

View File

@ -10,7 +10,7 @@ import java.util.List;
*
* Mar 7, 2022
*/
public class GcubeProfileDV implements Serializable {
public class GcubeProfileDV implements GeoportalConfigurationID, Serializable {
/**
*
@ -19,6 +19,8 @@ public class GcubeProfileDV implements Serializable {
public static final int MIN_MAX_NOT_SPECIFIED = -1;
private String configID;
private String gcubeSecondaryType;
private String gcubeName;
private String sectionName;
@ -40,12 +42,25 @@ public class GcubeProfileDV implements Serializable {
private List<FilePathDV> filePaths;
/**
* Instantiates a new gcube profile DV.
*/
public GcubeProfileDV() {
}
@Override
public String getID() {
return configID;
}
@Override
public void setID(String configID) {
this.configID = configID;
}
/**
* Gets the gcube secondary type.
*

View File

@ -0,0 +1,8 @@
package org.gcube.application.geoportalcommon.shared.geoportal.config;
public interface GeoportalConfigurationID {
String getID();
void setID(String configID);
}

View File

@ -1,54 +1,69 @@
package org.gcube.application.geoportalcommon.shared;
package org.gcube.application.geoportalcommon.shared.geoportal.config;
import java.io.Serializable;
import java.util.List;
/**
* The Class ItemField.
* The Class ItemFieldDV.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Dec 21, 2021
* Mar 16, 2022
*/
public class ItemField implements Serializable {
public class ItemFieldDV implements GeoportalConfigurationID, Serializable {
/**
*
*/
private static final long serialVersionUID = 1856714668390438433L;
private static final long serialVersionUID = -1489912649531434470L;
private String displayName;
private List<String> jsonFields;
private String operator;
private boolean displayAsResult;
private boolean sortable;
private boolean searchable;
private boolean displayAsResult;
private String configID;
/**
* Instantiates a new item field.
*/
public ItemField() {
public ItemFieldDV() {
}
/**
* Instantiates a new item field.
* Instantiates a new item field DV.
*
* @param displayName the display name
* @param jsonFields the json fields
* @param operator the operator
* @param displayAsResult the display as result
* @param sortable the sortable
* @param searchable the searchable
*/
public ItemField(String displayName, List<String> jsonFields, boolean displayAsResult, boolean sortable,
boolean searchable) {
public ItemFieldDV(String displayName, List<String> jsonFields, String operator, boolean displayAsResult,
boolean sortable, boolean searchable) {
super();
this.displayName = displayName;
this.jsonFields = jsonFields;
this.operator = operator;
this.displayAsResult = displayAsResult;
this.sortable = sortable;
this.searchable = searchable;
}
@Override
public String getID() {
return configID;
}
@Override
public void setID(String configID) {
this.configID = configID;
}
/**
* Gets the display name.
*
@ -67,6 +82,42 @@ public class ItemField implements Serializable {
return jsonFields;
}
/**
* Gets the operator.
*
* @return the operator
*/
public String getOperator() {
return operator;
}
/**
* Checks if is display as result.
*
* @return true, if is display as result
*/
public boolean isDisplayAsResult() {
return displayAsResult;
}
/**
* Checks if is sortable.
*
* @return true, if is sortable
*/
public boolean isSortable() {
return sortable;
}
/**
* Checks if is searchable.
*
* @return true, if is searchable
*/
public boolean isSearchable() {
return searchable;
}
/**
* Sets the display name.
*
@ -86,48 +137,12 @@ public class ItemField implements Serializable {
}
/**
* Checks if is sortable.
* Sets the operator.
*
* @return true, if is sortable
* @param operator the new operator
*/
public boolean isSortable() {
return sortable;
}
/**
* Sets the sortable.
*
* @param sortable the new sortable
*/
public void setSortable(boolean sortable) {
this.sortable = sortable;
}
/**
* Checks if is searchable.
*
* @return true, if is searchable
*/
public boolean isSearchable() {
return searchable;
}
/**
* Sets the searchable.
*
* @param searchable the new searchable
*/
public void setSearchable(boolean searchable) {
this.searchable = searchable;
}
/**
* Checks if is display as result.
*
* @return true, if is display as result
*/
public boolean isDisplayAsResult() {
return displayAsResult;
public void setOperator(String operator) {
this.operator = operator;
}
/**
@ -139,6 +154,24 @@ public class ItemField implements Serializable {
this.displayAsResult = displayAsResult;
}
/**
* Sets the sortable.
*
* @param sortable the new sortable
*/
public void setSortable(boolean sortable) {
this.sortable = sortable;
}
/**
* Sets the searchable.
*
* @param searchable the new searchable
*/
public void setSearchable(boolean searchable) {
this.searchable = searchable;
}
/**
* To string.
*
@ -147,16 +180,18 @@ public class ItemField implements Serializable {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ItemField [displayName=");
builder.append("ItemFieldDV [displayName=");
builder.append(displayName);
builder.append(", jsonFields=");
builder.append(jsonFields);
builder.append(", operator=");
builder.append(operator);
builder.append(", displayAsResult=");
builder.append(displayAsResult);
builder.append(", sortable=");
builder.append(sortable);
builder.append(", searchable=");
builder.append(searchable);
builder.append(", displayAsResult=");
builder.append(displayAsResult);
builder.append("]");
return builder.toString();
}

View File

@ -1,42 +1,129 @@
package org.gcube.application;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.gcube.application.geoportalcommon.MockDocumentConfigurationReader;
import org.gcube.application.geoportalcommon.geoportal.config.DocumentConfig;
import org.gcube.common.scope.api.ScopeProvider;
import org.junit.Test;
public class LoadDocumentConfiguration {
private static String TOKEN = "";
private static String CONTEXT = "/gcube/devsec/devVRE";
private static String USERNAME = "francesco.mangiacrapa";
// @Before
public void init() {
ScopeProvider.instance.set(CONTEXT);
}
@Test
public void loadDocumentConfiguration() throws Exception {
MockDocumentConfigurationReader mock = new MockDocumentConfigurationReader();
System.out.println(mock.getListDocumentConfig());
}
private static String readFile(String filePath) {
String content = "";
try {
content = new String(Files.readAllBytes(Paths.get(filePath)));
} catch (IOException e) {
e.printStackTrace();
}
return content;
}
}
//package org.gcube.application;
//
//import java.io.IOException;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.util.ArrayList;
//import java.util.LinkedHashMap;
//import java.util.List;
//
//import org.bson.Document;
//import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
//import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
//import org.gcube.application.geoportalcommon.geoportal.config.GcubeProfile;
//import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
//import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
//import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
//import org.gcube.common.scope.api.ScopeProvider;
//import org.junit.Test;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//public class LoadDocumentConfiguration {
//
// private static String TOKEN = "";
// private static String CONTEXT = "/gcube/devsec/devVRE";
// private static String USERNAME = "francesco.mangiacrapa";
// private static Logger LOG = LoggerFactory.getLogger(LoadDocumentConfiguration.class);
//
// // @Before
// public void init() {
// ScopeProvider.instance.set(CONTEXT);
// }
//
// @Test
// public void loadDocumentConfiguration() throws Exception {
//
//// MockDocumentConfigurationReader mock = new MockDocumentConfigurationReader();
//// System.out.println(mock.getListDocumentConfig());
//
// toHandlerDeclarationDV(null);
// }
//
// private static String readFile(String filePath) {
// String content = "";
//
// try {
// content = new String(Files.readAllBytes(Paths.get(filePath)));
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// return content;
// }
//
// /**
// * To handler declaration DV.
// *
// * @param <T> the generic type
// * @param handlerDeclaration the handler declaration
// * @return the handler declaration DV
// * @throws Exception
// */
// public static HandlerDeclarationDV toHandlerDeclarationDV(HandlerDeclaration handlerDeclaration) throws Exception {
//
//// if (handlerDeclaration == null) {
//// LOG.warn(HandlerDeclaration.class.getSimpleName() + " is null");
//// return null;
//// }
//
//// Document configuration = handlerDeclaration.getConfiguration();
////
//// if (configuration == null) {
//// LOG.warn("Configuration is null");
//// return null;
//// }
//
// String jsonConfig = readFile(
// "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config5.json");
//
// LOG.debug("File as JSON: " + jsonConfig);
//
// Document document = org.gcube.application.geoportal.client.utils.Serialization.read(jsonConfig, Document.class);
//
// LinkedHashMap<String, String> configuration = (LinkedHashMap<String, String>) document.get("_configuration");
//
// try {
// List<String> gcubeProfiles = null;
// try {
// gcubeProfiles = configuration.get("gcubeProfiles", ArrayList.class);
// } catch (Exception e) {
// LOG.info("gcubeProfiles not found in the handler");
// return null;
// }
//
// // HANDLER OF "gcubeProfiles" configuration
// if (gcubeProfiles != null) {
//
// List<GcubeProfileDV> listGcubeProfiles = new ArrayList<GcubeProfileDV>(gcubeProfiles.size());
//
// int i = 0;
// for (String gCubeProfile : gcubeProfiles) {
// LOG.debug(i++ + ") the gCubeProfile is: " + gCubeProfile);
// GcubeProfile profile = org.gcube.application.geoportal.client.utils.Serialization.read(gCubeProfile,
// GcubeProfile.class);
// listGcubeProfiles.add(ConvertToDataValueObjectModel.toGcubeProfileDV(profile));
// }
//
// HandlerDeclarationDV hdDV = new HandlerDeclarationDV();
// hdDV.setId(handlerDeclaration.getId());
// hdDV.setType(handlerDeclaration.getType());
//
// ConfigurationDV<List<GcubeProfileDV>> dDV = new ConfigurationDV<List<GcubeProfileDV>>(
// listGcubeProfiles);
// dDV.setConfiguration(listGcubeProfiles);
// hdDV.setConfiguration(dDV);
//
// LOG.info("returning {}", hdDV);
// return hdDV;
// }
// } catch (Exception e) {
// LOG.error("Error on getting " + HandlerDeclaration.class.getSimpleName(), e);
// throw e;
// }
//
// return null;
//
// }
//
//}

View File

@ -4,8 +4,8 @@ import org.gcube.application.geoportalcommon.GeoportalCommon;
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
import org.gcube.application.geoportalcommon.shared.ItemField;
import org.gcube.application.geoportalcommon.shared.config.RoleRights;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
@ -112,7 +112,7 @@ public class TestGNACommon {
System.out.println("Item Fields are:");
i = 0;
for (ItemField item : configurations.getListItemFields()) {
for (ItemFieldDV item : configurations.getListItemFields()) {
System.out.println(++i + " " + item);
}
} catch (Exception e) {
@ -132,7 +132,7 @@ public class TestGNACommon {
System.out.println(configurations.getMapLayers());
System.out.println("Item Fields are:");
int i = 0;
for (ItemField item : configurations.getListItemFields()) {
for (ItemFieldDV item : configurations.getListItemFields()) {
System.out.println(++i + " " + item);
}
} catch (Exception e) {

View File

@ -3,6 +3,7 @@ package org.gcube.application;
import java.util.List;
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
@ -18,7 +19,7 @@ public class UCD_Tests {
// private static String TOKEN = ""; //preVRE
private static String CONTEXT = "/gcube/devsec/devVRE";
private static String TOKEN = ""; // devVRE
private static String TOKEN = "8e74a17c-92f1-405a-b591-3a6090066248-98187548"; // devVRE
private static String PROFILE_ID = "profiledConcessioni";
@ -30,7 +31,7 @@ public class UCD_Tests {
client = GeoportalClientCaller.useCaseDescriptors();
}
// @Test
//@Test
public void getList() throws Exception {
ScopeProvider.instance.set(CONTEXT);
SecurityTokenProvider.instance.set(TOKEN);
@ -42,12 +43,27 @@ public class UCD_Tests {
}
}
@Test
//@Test
public void getItemByID() throws Exception {
ScopeProvider.instance.set(CONTEXT);
SecurityTokenProvider.instance.set(TOKEN);
UseCaseDescriptor ucd = client.geUCDForId(PROFILE_ID);
UseCaseDescriptor ucd = client.getUCDForId(PROFILE_ID);
System.out.println(ucd);
}
@Test
public void convertToDVObject() throws Exception {
ScopeProvider.instance.set(CONTEXT);
SecurityTokenProvider.instance.set(TOKEN);
List<UseCaseDescriptor> listOfUCD = client.getList();
int i = 0;
for (UseCaseDescriptor useCaseDescriptor : listOfUCD) {
System.out.println(++i + ") " + useCaseDescriptor);
ConvertToDataValueObjectModel.toUseCaseDescriptorDV(useCaseDescriptor, null);
}
}
}

View File

@ -1,89 +1,38 @@
{
"id": "geoportal-data-entry-app",
"type": "DATA_ENTRY_GUI",
"item_type": "Concessione",
"configuration": {
"_id": "org.gcube.geoportal-data-entry-portlet",
"_type": "DATA_ENTRY_GUI",
"_configuration": {
"gcubeProfiles": [
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Informazioni_di_progetto",
"sectionName": "$.",
"sectionTitle": "Informazioni di Progetto"
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Abstract_Relazione_di_Scavo",
"sectionName": "abstractRelazione",
"sectionTitle": "Abstract Relazione Scavo",
"parentName": "$.",
"gcubeCategory": "1",
"gcubeName": "1",
"order": "",
"sectionName": "",
"sectionTitle": "",
"cardinality": "",
"parentName": "",
"filePaths": [
{
"fieldDefinition": "Carica Abstract Ita (in PDF)",
"fieldName": "filesetIta"
},
{
"fieldDefinition": "Carica Abstract Ita (in PDF)",
"fieldName": "filesetEng"
"field": "field id from XML gcube Profile",
"path": "$.abstract.associatedFiles"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Relazione_di_Scavo",
"sectionName": "relazioneScavo",
"sectionTitle": "Relazione di Scavo",
"parentName": "$.",
"gcubeCategory": "2",
"gcubeName": "2",
"order": "",
"sectionName": "",
"sectionTitle": "",
"cardinality": "",
"parentName": "",
"filePaths": [
{
"fieldDefinition": "Relazione di fine scavo (in PDF)",
"fieldName": "fileset"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Immagine_Rappresentativa_di_Scavo",
"sectionName": "immagini",
"sectionTitle": "Immagini Rappresentative",
"minOccurs": 3,
"maxOccurs": 8,
"parentName": "$.",
"filePaths": [
{
"fieldDefinition": "Immagine",
"fieldName": "fileset"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Posizionamento_dell_area_di_indagine",
"sectionName": "posizionamentoScavo",
"sectionTitle": "Posizionamento dell'Area di Indagine",
"parentName": "$.",
"filePaths": [
{
"fieldDefinition": "File",
"fieldName": "fileset"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Pianta_di_fine_Scavo",
"sectionName": "pianteFineScavo",
"sectionTitle": "Piante di fine Scavo",
"parentName": "$.",
"minOccurs": 0,
"maxOccurs": 0,
"filePaths": [
{
"fieldDefinition": "File",
"fieldName": "fileset"
"field": "field id from XML gcube Profile",
"path": "$.abstract.associatedFiles"
}
]
}
],
"saveStep": "SUBMIT-FOR-REVIEW"
]
}
}

View File

@ -1,5 +1,5 @@
{
"id": "geoportal-data-entry-app",
"id": "org.gcube.portlets.user.geoportal-data-entry-app",
"type": "DATA_ENTRY_GUI",
"item_type": "Archeologia Preventiva",
"configuration": {

View File

@ -1,5 +1,5 @@
{
"id": "geoportal-data-entry-app",
"id": "org.gcube.portlets.user.geoportal-data-entry-app",
"type": "DATA_ENTRY_GUI",
"item_type": "Deliverable",
"configuration": {

View File

@ -1,5 +1,5 @@
{
"id": "geoportal-data-entry-app",
"id": "org.gcube.portlets.user.geoportal-data-entry-app",
"type": "DATA_ENTRY_GUI",
"item_type": "Dataset",
"configuration": {

View File

@ -0,0 +1,89 @@
{
"_id": "org.gcube.portlets.user.geoportal-data-entry-app",
"_type": "DATA_ENTRY_GUI",
"_item_type": "Concessione",
"_configuration": {
"gcubeProfiles": [
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Informazioni_di_progetto",
"sectionName": "$.",
"sectionTitle": "Informazioni di Progetto"
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Abstract_Relazione_di_Scavo",
"sectionName": "abstractRelazione",
"sectionTitle": "Abstract Relazione Scavo",
"parentName": "$.",
"filePaths": [
{
"fieldDefinition": "Carica Abstract Ita (in PDF)",
"fieldName": "filesetIta"
},
{
"fieldDefinition": "Carica Abstract Ita (in PDF)",
"fieldName": "filesetEng"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Relazione_di_Scavo",
"sectionName": "relazioneScavo",
"sectionTitle": "Relazione di Scavo",
"parentName": "$.",
"filePaths": [
{
"fieldDefinition": "Relazione di fine scavo (in PDF)",
"fieldName": "fileset"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Immagine_Rappresentativa_di_Scavo",
"sectionName": "immagini",
"sectionTitle": "Immagini Rappresentative",
"minOccurs": 1,
"maxOccurs": 8,
"parentName": "$.",
"filePaths": [
{
"fieldDefinition": "Immagine",
"fieldName": "fileset"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Posizionamento_dell_area_di_indagine",
"sectionName": "posizionamentoScavo",
"sectionTitle": "Posizionamento dell'Area di Indagine",
"parentName": "$.",
"filePaths": [
{
"fieldDefinition": "File",
"fieldName": "fileset"
}
]
},
{
"gcubeSecondaryType": "GeoNaMetadata",
"gcubeName": "Pianta_di_fine_Scavo",
"sectionName": "pianteFineScavo",
"sectionTitle": "Piante di fine Scavo",
"parentName": "$.",
"minOccurs": 0,
"maxOccurs": 0,
"filePaths": [
{
"fieldDefinition": "File",
"fieldName": "fileset"
}
]
}
],
"saveStep": "SUBMIT-FOR-REVIEW"
}
}

View File

@ -0,0 +1,75 @@
{
"_id": "org.gcube.geoportal-data-list",
"_type": "DATA_LIST_GUI",
"case": "FullList",
"_configuration": {
"projection": "{\"nome\" : 1, \"lifecycleInformation.phase\" : 1}",
"itemFields": [
{
"label": "Name",
"paths": [
"Nome del progetto"
],
"operator": "$and",
"searchable": true,
"sortable": true,
"asResult": true
},
{
"label": "Introduction",
"paths": [
"Introduzione"
],
"operator": "$and",
"searchable": true,
"sortable": false,
"asResult": true
},
{
"label": "Author/s",
"paths": [
"Nome Autore, Email, Ruolo"
],
"operator": "$and",
"searchable": false,
"sortable": true,
"asResult": true
},
{
"label": "Project Start",
"paths": [
"Data inizio Progetto"
],
"operator": "$and",
"searchable": false,
"sortable": true,
"asResult": true
},
{
"label": "Director/Staff",
"paths": [
"Nome Autore, Email, Ruolo",
"Contributore",
"Titolare dei dati",
"Editore",
"Responsabile"
],
"operator": "$or",
"searchable": true,
"sortable": false,
"asResult": true
},
{
"label": "Keywords",
"paths": [
"Parola chiave a scelta libera",
"Parola chiave relativa alla cronologia"
],
"operator": "$or",
"searchable": true,
"sortable": false,
"asResult": true
}
]
}
}