Class ConvertToDataValueObjectModel


  • public class ConvertToDataValueObjectModel
    extends Object
    The Class ConvertToDataValueObjectModel.
    Author:
    Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Mar 4, 2022
    • Constructor Detail

      • ConvertToDataValueObjectModel

        public ConvertToDataValueObjectModel()
    • 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 ucd
        handlersIds - 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 declaration
        ucd - the ucd
        readConfigs - 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 definition
        roles - 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 project
        projectReader - 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​(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 DocumentDVDocumentDV 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 ID
        document - the document
        targetClass - the target class
        listDocumentKeys - the list document keys
        getFullMap - 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 document
        key - the key
        documentAsMap - 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 projects
        projectBuilder - 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.JSONException
        To timeline JSON model.
        Parameters:
        theProject - the the project
        sourceJsonTemplate - the source json template
        targetUCD - the target UCD
        targetProjectID - the target project ID
        relationName - 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 project
        timelineJSONObject - the timeline JSON object
        Returns:
        the temporal reference DV
        Throws:
        org.json.JSONException