Class ConvertToDataValueObjectModel
- java.lang.Object
-
- org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel
-
public class ConvertToDataValueObjectModel extends Object
The Class ConvertToDataValueObjectModel.- Author:
- Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Mar 4, 2022
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classConvertToDataValueObjectModel.LocalDateDeserializerThe Class LocalDateDeserializer.static classConvertToDataValueObjectModel.MyLocalDateDeserializerThe Class MyLocalDateDeserializer.static classConvertToDataValueObjectModel.MyLocalDateSerializerThe Class MyLocalDateSerializer.static classConvertToDataValueObjectModel.ParseDeserializerThe Class ParseDeserializer.
-
Field Summary
Fields Modifier and Type Field Description static int_MAX_LENGHT_STRING_AT_INFOstatic StringDATE_FORMATstatic java.time.format.DateTimeFormatterFULL_FORMATTERstatic StringHOURS_MINUTES_SEPARATORstatic List<String>KEYSET_POSSIBLE_DATEstatic StringLICENSE_IDstatic StringPOLICYstatic StringTIME_FORMAT
-
Constructor Summary
Constructors Constructor Description ConvertToDataValueObjectModel()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IndexLayerDVconvert(org.gcube.application.geoportal.common.model.configuration.Index toConvert)Convert.static LinkedHashMap<String,Object>fillMapValue(org.bson.Document document, String key, LinkedHashMap<String,Object> documentAsMap)Fill map.static StringinstantToDateFormatString(String instantString)Instant to date format string.static GEOPORTAL_DATA_HANDLERto_GEOPORTAL_DATA_HANDLER(String id)To GEOPORTA L DAT A HANDLER.static ActionDefinitionDVtoActionDefinition(ActionDefinition actionDefinition, Set<String> roles)To action definition.static StringtoDateFormatString(java.time.LocalDateTime dateTime)To date format string.static FilePathDVtoFilePathDV(FilePath filePath)To file path DV.static GcubeProfileDVtoGcubeProfileDV(GcubeProfile gCubeProfile)To gcube profile DV.static <T extends DocumentDV>
DocumentDVtoGenericDocumentDV(String projectID, org.bson.Document document, Class<T> targetClass, List<String> listDocumentKeys, boolean getFullMap)To generic document DV.static HandlerDeclarationDVtoHandlerDeclarationDV(org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration handlerDeclaration, org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor ucd, GEOPORTAL_CONFIGURATION_TYPE... readConfigs)To handler declaration DV.static ItemFieldDVtoItemFieldDV(ItemField itemField)To item field DV.static StringtoJSON(Object theObj)To JSON.static LifecycleInformationDVtoLifecycleInformationDV(org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation li)To validation report.static BasicLifecycleInformationDV.StatustoLifecycleInformationDVStatus(org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation.Status status)To lifecycle information DV status.static List<ProjectDV>toListProject(Iterator<org.gcube.application.geoportal.common.model.document.Project> projects, ProjectDVBuilder projectBuilder)To list project.static List<ResultDocumentDV>toListResultDocument(Iterator<org.gcube.application.geoportal.common.model.document.Project> projects)To list result document.static PayloadDVtoPayloadDV(Payload payload)To payload DV.static ProjectDVtoProjectDV(org.gcube.application.geoportal.common.model.document.Project project, ProjectDVBuilder projectReader)To project DV.static RelationshipDefinitionDVtoRelationshipDefinition(org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition relationshipDefinition)To relationship definition.static RelationshipDVtoRelationshipDV(org.gcube.application.geoportal.common.model.document.relationships.Relationship relationship)To relationship DV.static ResultDocumentDVtoResultDocumentDV(org.gcube.application.geoportal.common.model.document.Project project)To result document DV.static GeoJSONtoSpatialReference(String geoJSONObject)To spatial reference.static TemporalReferenceDVtoTemporalReferenceDV(org.gcube.application.geoportal.common.model.document.Project theProject, org.json.JSONObject timelineJSONObject)To temporal reference DV.static org.json.JSONObjecttoTimelineJSONModel(org.gcube.application.geoportal.common.model.document.Project theProject, org.json.JSONObject sourceJsonTemplate, String targetUCD, String targetProjectID, String relationName)To timeline JSON model.static UseCaseDescriptorDVtoUseCaseDescriptorDV(org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor ucd, String... handlersIds)To use case descriptor DV.
-
-
-
Field Detail
-
_MAX_LENGHT_STRING_AT_INFO
public static final int _MAX_LENGHT_STRING_AT_INFO
- See Also:
- Constant Field Values
-
DATE_FORMAT
public static final String DATE_FORMAT
- See Also:
- Constant Field Values
-
HOURS_MINUTES_SEPARATOR
public static final String HOURS_MINUTES_SEPARATOR
- See Also:
- Constant Field Values
-
TIME_FORMAT
public static final String TIME_FORMAT
- See Also:
- Constant Field Values
-
LICENSE_ID
public static String LICENSE_ID
-
POLICY
public static String POLICY
-
FULL_FORMATTER
public static final java.time.format.DateTimeFormatter FULL_FORMATTER
-
-
Method Detail
-
toUseCaseDescriptorDV
public static UseCaseDescriptorDV toUseCaseDescriptorDV(org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor ucd, String... handlersIds) throws Exception
To use case descriptor DV.- Parameters:
ucd- the ucdhandlersIds- the handlers ids. If not null only returns (so filtering for) the handler ids. Otherwise returns all handlers- Returns:
- the document config DV
- Throws:
Exception- the exception
-
to_GEOPORTAL_DATA_HANDLER
public static GEOPORTAL_DATA_HANDLER to_GEOPORTAL_DATA_HANDLER(String id)
To GEOPORTA L DAT A HANDLER.- Parameters:
id- the id- Returns:
- the geoportal data handler
-
toHandlerDeclarationDV
public static HandlerDeclarationDV toHandlerDeclarationDV(org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration handlerDeclaration, org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor ucd, GEOPORTAL_CONFIGURATION_TYPE... readConfigs) throws Exception
To handler declaration DV.- Parameters:
handlerDeclaration- the handler declarationucd- the ucdreadConfigs- the read configs- Returns:
- the handler declaration DV
- Throws:
Exception- the exception
-
toGcubeProfileDV
public static GcubeProfileDV toGcubeProfileDV(GcubeProfile gCubeProfile)
To gcube profile DV.- Parameters:
gCubeProfile- the g cube profile- Returns:
- the gcube profile DV
-
toItemFieldDV
public static ItemFieldDV toItemFieldDV(ItemField itemField)
To item field DV.- Parameters:
itemField- the item field- Returns:
- the item field DV
-
toActionDefinition
public static ActionDefinitionDV toActionDefinition(ActionDefinition actionDefinition, Set<String> roles)
To action definition.- Parameters:
actionDefinition- the action definitionroles- the roles required to perform the callable STEPS- Returns:
- the action definition DV
-
toFilePathDV
public static FilePathDV toFilePathDV(FilePath filePath)
To file path DV.- Parameters:
filePath- the file path- Returns:
- the file path DV
-
toProjectDV
public static ProjectDV toProjectDV(org.gcube.application.geoportal.common.model.document.Project project, ProjectDVBuilder projectReader)
To project DV.- Parameters:
project- the projectprojectReader- the project reader- Returns:
- the project DV
-
toSpatialReference
public static GeoJSON toSpatialReference(String geoJSONObject)
To spatial reference.- Parameters:
geoJSONObject- the geo JSON object- Returns:
- the geo JSON
-
toResultDocumentDV
public static ResultDocumentDV toResultDocumentDV(org.gcube.application.geoportal.common.model.document.Project project)
To result document DV.- Parameters:
project- the project- Returns:
- the result document DV
-
toDateFormatString
public static String toDateFormatString(java.time.LocalDateTime dateTime)
To date format string.- Parameters:
dateTime- the date time- Returns:
- the string
-
instantToDateFormatString
public static String instantToDateFormatString(String instantString)
Instant to date format string. format dd-MM-yyyyT00:00:00.00Z to DateFormat.format- Parameters:
instantString- the instant string- Returns:
- the string
-
toGenericDocumentDV
public static <T extends DocumentDV> DocumentDV toGenericDocumentDV(String projectID, org.bson.Document document, Class<T> targetClass, List<String> listDocumentKeys, boolean getFullMap)
To generic document DV.- Type Parameters:
T- the generic type- Parameters:
projectID- the project IDdocument- the documenttargetClass- the target classlistDocumentKeys- the list document keysgetFullMap- the get full map- Returns:
- the document DV
-
fillMapValue
public static LinkedHashMap<String,Object> fillMapValue(org.bson.Document document, String key, LinkedHashMap<String,Object> documentAsMap)
Fill map.- Parameters:
document- the documentkey- the keydocumentAsMap- the document as map- Returns:
- the linked hash map
-
toRelationshipDV
public static RelationshipDV toRelationshipDV(org.gcube.application.geoportal.common.model.document.relationships.Relationship relationship)
To relationship DV.- Parameters:
relationship- the relationship- Returns:
- the relationship DV
-
toLifecycleInformationDV
public static LifecycleInformationDV toLifecycleInformationDV(org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation li) throws Exception
To validation report.- Parameters:
li- the li- Returns:
- the validation report DV
- Throws:
Exception- the exception
-
toLifecycleInformationDVStatus
public static BasicLifecycleInformationDV.Status toLifecycleInformationDVStatus(org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation.Status status)
To lifecycle information DV status.- Parameters:
status- the status- Returns:
- the lifecycle information D v. status
-
toListProject
public static List<ProjectDV> toListProject(Iterator<org.gcube.application.geoportal.common.model.document.Project> projects, ProjectDVBuilder projectBuilder)
To list project.- Parameters:
projects- the projectsprojectBuilder- the project builder- Returns:
- the list
-
toListResultDocument
public static List<ResultDocumentDV> toListResultDocument(Iterator<org.gcube.application.geoportal.common.model.document.Project> projects)
To list result document.- Parameters:
projects- the projects- Returns:
- the list
-
toJSON
public static String toJSON(Object theObj)
To JSON.- Parameters:
theObj- the the obj- Returns:
- the string
-
toRelationshipDefinition
public static RelationshipDefinitionDV toRelationshipDefinition(org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition relationshipDefinition)
To relationship definition.- Parameters:
relationshipDefinition- the relationship definition- Returns:
- the relationship definition DV
-
toPayloadDV
public static PayloadDV toPayloadDV(Payload payload)
To payload DV.- Parameters:
payload- the payload- Returns:
- the payload DV
-
convert
public static IndexLayerDV convert(org.gcube.application.geoportal.common.model.configuration.Index toConvert) throws InvalidObjectException
Convert.- Parameters:
toConvert- the to convert- Returns:
- the index layer DV
- Throws:
InvalidObjectException- the invalid object exception
-
toTimelineJSONModel
public static org.json.JSONObject toTimelineJSONModel(org.gcube.application.geoportal.common.model.document.Project theProject, org.json.JSONObject sourceJsonTemplate, String targetUCD, String targetProjectID, String relationName) throws org.json.JSONExceptionTo timeline JSON model.- Parameters:
theProject- the the projectsourceJsonTemplate- the source json templatetargetUCD- the target UCDtargetProjectID- the target project IDrelationName- the relation name- Returns:
- the JSON object
- Throws:
org.json.JSONException
-
toTemporalReferenceDV
public static TemporalReferenceDV toTemporalReferenceDV(org.gcube.application.geoportal.common.model.document.Project theProject, org.json.JSONObject timelineJSONObject) throws org.json.JSONException
To temporal reference DV.- Parameters:
theProject- the the projecttimelineJSONObject- the timeline JSON object- Returns:
- the temporal reference DV
- Throws:
org.json.JSONException
-
-