Class GeoportalExporter


  • @Path("geoportal")
    public class GeoportalExporter
    extends Object
    The Class GeoportalExporter. The Geoportal Exporter provides the facilities to export GIS projects stored in the Geoportal system provided via D4Science VREs.
    Author:
    Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Apr 16, 2024
    • Constructor Detail

      • GeoportalExporter

        public GeoportalExporter()
    • Method Detail

      • export

        @GET
        @Path("/export/{type}/{usecase_id}/{project_id}")
        @Produces({"text/html","text/plain","application/octet-stream"})
        public javax.ws.rs.core.Response export​(@Context
                                                javax.servlet.http.HttpServletRequest req,
                                                @PathParam("type")
                                                String export_type,
                                                @PathParam("usecase_id")
                                                String ucdID,
                                                @PathParam("project_id")
                                                String projectID,
                                                @QueryParam("as-url") @Nullable
                                                String asURL)
                                         throws javax.ws.rs.WebApplicationException
        Export.
        Parameters:
        req - the req
        export_type - the export type. Must be a value of the enum {#ACCEPTED_EXPORT_TYPE}
        ucdID - the ucd ID
        projectID - the project ID
        asURL - the as URL. If true returns the project exported as an URL in the response
        Returns:
        the response. Can be an URL or a Stream of the project exported.
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • healthcheck

        @GET
        @Path("/export/{type}/healthcheck")
        @Produces({"application/json","text/plain","text/html"})
        public javax.ws.rs.core.Response healthcheck​(@Context
                                                     javax.servlet.http.HttpServletRequest req,
                                                     @PathParam("type")
                                                     String export_type)
                                              throws javax.ws.rs.WebApplicationException
        Healthcheck. Checks if the export facility is configured in the context (i.e. the scope read from input token).
        Parameters:
        req - the req
        export_type - the export type
        Returns:
        an object of type {#GeoportalJsonResponse) that contains the response
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • viewJob

        @GET
        @Path("/view/{jobCode}")
        @Produces({"application/json","text/html","text/plain"})
        public javax.ws.rs.core.Response viewJob​(@Context
                                                 javax.servlet.http.HttpServletRequest req,
                                                 @PathParam("jobCode")
                                                 String jobCode)
                                          throws javax.ws.rs.WebApplicationException
        View job. Check the job export status.
        Parameters:
        req - the req
        jobCode - the job code. The job ID assigned by export facility that returns a waiting HTML page
        Returns:
        the response. It is a {#GeoportalJsonResponse} with the status of the job. An export job completed contains the URL of the project exported.
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • responseToString

        public String responseToString​(GeoportalJsonResponse jsonResponse)
                                throws org.gcube.com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        org.gcube.com.fasterxml.jackson.core.JsonProcessingException
      • checkPathParameterNotNull

        public void checkPathParameterNotNull​(javax.servlet.http.HttpServletRequest req,
                                              String parameter,
                                              String value)
                                       throws BadRequestException
        Check path parameter not null.
        Parameters:
        req - the req
        parameter - the parameter
        value - the value
        Throws:
        BadRequestException - the bad request exception
      • exportAsPDF

        public org.gcube.application.geoportaldatamapper.shared.FileReference exportAsPDF​(javax.servlet.http.HttpServletRequest req,
                                                                                          String profileID,
                                                                                          String projectID,
                                                                                          String profileTitle,
                                                                                          String context,
                                                                                          org.gcube.common.authorization.utils.user.User user)
                                                                                   throws javax.ws.rs.WebApplicationException
        Export as PDF.
        Parameters:
        req - the req
        profileID - the profile ID
        projectID - the project ID
        profileTitle - the profile title
        context - the context
        user - the user
        Returns:
        the file reference
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • getPublicLinksFor

        public org.gcube.application.geoportalcommon.shared.GeoportalItemReferences getPublicLinksFor​(org.gcube.application.geoportalcommon.shared.GeoportalItemReferences item,
                                                                                                      String context)
                                                                                               throws Exception
        Gets the public links for.
        Parameters:
        item - the item
        context - the context
        Returns:
        the public links for
        Throws:
        Exception - the exception