Class ProjectsCaller


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

      • ProjectsCaller

        public ProjectsCaller()
    • Method Detail

      • getClient

        public org.gcube.application.geoportal.common.rest.Projects<org.gcube.application.geoportal.common.model.document.Project> getClient​(String profileID)
        Gets the client.
        Parameters:
        profileID - the profile ID
        Returns:
        the client
      • createNew

        public org.gcube.application.geoportal.common.model.document.Project createNew​(String profileID,
                                                                                       String jsonDocument)
                                                                                throws RemoteException
        Creates the new.
        Parameters:
        profileID - the profile ID
        jsonDocument - the json document
        Returns:
        the project
        Throws:
        RemoteException - the remote exception
      • registerFileSet

        public org.gcube.application.geoportal.common.model.document.Project registerFileSet​(String profileID,
                                                                                             org.gcube.application.geoportal.common.model.document.Project project,
                                                                                             File theFile,
                                                                                             String parentPath,
                                                                                             String fieldName,
                                                                                             String fieldDefinition)
                                                                                      throws RemoteException,
                                                                                             FileNotFoundException,
                                                                                             com.fasterxml.jackson.core.JsonProcessingException,
                                                                                             org.gcube.application.geoportal.common.faults.InvalidRequestException
        Register file set.
        Parameters:
        profileID - the profile ID
        project - the project
        theFile - the the file
        parentPath - the parent path
        fieldName - the field name
        fieldDefinition - the field definition
        Returns:
        the project
        Throws:
        RemoteException - the remote exception
        FileNotFoundException - the file not found exception
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        org.gcube.application.geoportal.common.faults.InvalidRequestException - the invalid request exception
      • getListForProfileID

        public List<org.gcube.application.geoportal.common.model.document.Project> getListForProfileID​(String profileID)
                                                                                                throws Exception
        Gets the list for profile ID.
        Parameters:
        profileID - the profile ID
        Returns:
        the list for profile ID
        Throws:
        Exception - the exception
      • getProjectByID

        public org.gcube.application.geoportal.common.model.document.Project getProjectByID​(String profileID,
                                                                                            String projectID)
                                                                                     throws Exception
        Gets the project by ID.
        Parameters:
        profileID - the profile ID
        projectID - the project ID
        Returns:
        the project by ID
        Throws:
        Exception - the exception
      • getRelationshipChain

        public Iterator<org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject> getRelationshipChain​(String profileID,
                                                                                                                                               String projectID,
                                                                                                                                               String relationID,
                                                                                                                                               Boolean deep)
                                                                                                                                        throws Exception
        Gets the relationship chain.
        Parameters:
        profileID - the profile ID
        projectID - the project ID
        relationID - the relation ID
        deep - the deep
        Returns:
        the relationship chain
        Throws:
        Exception - the exception
      • getConfiguration

        public org.gcube.application.geoportal.common.model.configuration.Configuration getConfiguration​(String profileID)
                                                                                                  throws Exception
        Gets the configuration.
        Parameters:
        profileID - the profile ID
        Returns:
        the configuration
        Throws:
        Exception - the exception
      • getTotalDocument

        public Integer getTotalDocument​(String profileID)
                                 throws Exception
        Gets the total document.
        Parameters:
        profileID - the profile ID
        Returns:
        the total document
        Throws:
        Exception - the exception
      • getIDsPhases

        public List<String> getIDsPhases​(String profileID)
                                  throws Exception
        Gets the total document.
        Parameters:
        profileID - the profile ID
        Returns:
        the total document
        Throws:
        Exception - the exception
      • getPhasesIntoDocumentStoreCollection

        public PhaseDV[] getPhasesIntoDocumentStoreCollection​(String profileID)
                                                       throws Exception
        Gets the phases into document store collection.
        Parameters:
        profileID - the profile ID
        Returns:
        the phases into document store collection
        Throws:
        Exception - the exception
      • performStep

        public org.gcube.application.geoportal.common.model.document.Project performStep​(String profileID,
                                                                                         String projectID,
                                                                                         String stepID,
                                                                                         String optionalMessage,
                                                                                         org.bson.Document options)
                                                                                  throws Exception
        Perform step.
        Parameters:
        profileID - the profile ID
        projectID - the project ID
        stepID - the step ID
        optionalMessage - the optional message
        options - the options
        Returns:
        the project
        Throws:
        Exception - the exception
      • deleteProject

        public void deleteProject​(String profileID,
                                  String projectID,
                                  boolean force)
                           throws RemoteException
        Delete project.
        Parameters:
        profileID - the profile ID
        projectID - the project ID
        force - the force
        Throws:
        RemoteException - the remote exception
      • updateProject

        public org.gcube.application.geoportal.common.model.document.Project updateProject​(String profileID,
                                                                                           String projectID,
                                                                                           org.bson.Document updatedDocument)
                                                                                    throws RemoteException
        Update project.
        Parameters:
        profileID - the profile ID
        projectID - the project ID
        updatedDocument - the updated document
        Returns:
        the project
        Throws:
        RemoteException - the remote exception
      • createRelationship

        public void createRelationship​(String fromProfileID,
                                       String fromProjectID,
                                       String relationshipId,
                                       String toProfileID,
                                       String toProjectID)
                                throws RemoteException
        Creates the relationship.
        Parameters:
        fromProfileID - the from profile ID
        fromProjectID - the from project ID
        relationshipId - the relationship id
        toProfileID - the to profile ID
        toProjectID - the to project ID
        Throws:
        RemoteException - the remote exception
      • deleteRelationship

        public void deleteRelationship​(String fromProfileID,
                                       String fromProjectID,
                                       String relationshipId,
                                       String toProfileID,
                                       String toProjectID)
                                throws RemoteException
        Delete relationship.
        Parameters:
        fromProfileID - the from profile ID
        fromProjectID - the from project ID
        relationshipId - the relationship id
        toProfileID - the to profile ID
        toProjectID - the to project ID
        Throws:
        RemoteException - the remote exception
      • deleteFileset

        public org.gcube.application.geoportal.common.model.document.Project deleteFileset​(String profileID,
                                                                                           String projectID,
                                                                                           String jsonPathToFileset,
                                                                                           Boolean force,
                                                                                           Boolean ignoreErrors)
                                                                                    throws RemoteException
        Delete fileset.
        Parameters:
        profileID - the profile ID
        projectID - the project ID
        jsonPathToFileset - the json path to fileset
        force - the force
        ignoreErrors - the ignore errors
        Returns:
        the project
        Throws:
        RemoteException - the remote exception
      • simpleQuery

        public Iterator<org.gcube.application.geoportal.common.model.document.Project> simpleQuery​(String profileID,
                                                                                                   org.bson.Document filter)
                                                                                            throws Exception
        Simple query.
        Parameters:
        profileID - the profile ID
        filter - the filter
        Returns:
        the iterator
        Throws:
        Exception - the exception
      • queryOnMongo

        public Iterator<org.gcube.application.geoportal.common.model.document.Project> queryOnMongo​(String profileID,
                                                                                                    Integer totalItems,
                                                                                                    Integer offset,
                                                                                                    Integer limit,
                                                                                                    SearchingFilter filter)
                                                                                             throws Exception
        Query on mongo.
        Parameters:
        profileID - the profile ID
        totalItems - the total items
        offset - the offset
        limit - the limit
        filter - the filter
        Returns:
        the iterator
        Throws:
        Exception - the exception