Class SubmitResource

java.lang.Object
org.ctan.site.resources.catalogue.api.SubmitResource

@Path("/submit") @Produces("application/json") @PermitAll public class SubmitResource extends Object
The class SubmitResource contains the controller for the submit resource.
  • Constructor Details

    • SubmitResource

      public SubmitResource(@NonNull @NonNull SubmitService service)
      This is the constructor for the class SubmitResource.
      Parameters:
      service - the underlying service
  • Method Details

    • fields

      @GET @Path("/fields") public SubmitService.Fields fields(@QueryParam("api") String api)
      The method fields provides means to retrieve the supported fields.
      Parameters:
      api - the API version
      Returns:
      a Map with the fields and their attributes
    • getVersions

      @GET @Path("/versions") public Map<String,List<String>> getVersions()
      The method getVersions provides means to retrieve the supported versions number of the API.
      Returns:
      a Map with version number mapped to a list of supported end- points.
    • upload

      @POST @Path("/upload") @Consumes({"application/x-www-form-urlencoded","multipart/form-data","application/json"}) @Produces("application/json") @UnitOfWork("siteDb") public jakarta.ws.rs.core.Response upload(org.glassfish.jersey.media.multipart.FormDataBodyPart content, org.glassfish.jersey.media.multipart.FormDataContentDisposition metaData, String announce, String announcement, String authors, String bugs, String caption, String confirm, String ctanPath, String description, String development, String email, String home, String licenses, String mailinglist, String name, String notes, String pkg, String repository, String support, String topics, String uploader, String update, String vers, @QueryParam("api") String api)
      The method upload provides means to upload a package to CTAN.
      Parameters:
      content - the uploaded file
      metaData - the meta data for the file
      announce - the announce parameter
      announcement - the announcement parameter
      authors - the authors parameter
      bugs - the bugs parameter
      caption - the caption parameter
      confirm - the confirm parameter
      ctanPath - the CTAN path parameter
      description - the description parameter
      development - the development channel parameter
      email - the uploader's email
      home - the home page
      licenses - the licenses parameter
      mailinglist - the mailing list
      name - the printable name of the package
      notes - the note for the upload managers
      pkg - the package name in lower-case
      repository - the repository
      support - the support channel
      topics - the topics parameter
      uploader - the name of the uploader
      update - the indicator for update vs. new
      vers - the version number
      api - the API version or null
      Returns:
      the list of messages
    • validate

      @POST @Path("/validate") @Consumes({"application/x-www-form-urlencoded","multipart/form-data","application/json"}) @Produces("application/json") @UnitOfWork("siteDb") public jakarta.ws.rs.core.Response validate(org.glassfish.jersey.media.multipart.FormDataBodyPart content, org.glassfish.jersey.media.multipart.FormDataContentDisposition metaData, String announce, String announcement, String authors, String bugs, String caption, String confirm, String ctanPath, String description, String development, String email, String home, String licenses, String mailinglist, String name, String notes, String pkg, String repository, String support, String topics, String uploader, String update, String vers, String api)
      The method validate provides means to upload a package to CTAN for validation.
      Parameters:
      content - the uploaded file
      metaData - the meta data for the file
      announce - the announce parameter
      announcement - the announcement parameter
      authors - the authors parameter
      bugs - the bugs parameter
      caption - the caption parameter
      confirm - the confirm parameter
      ctanPath - the CTAN path parameter
      description - the description parameter
      development - the development channel parameter
      email - the uploader's email
      home - the home page
      licenses - the licenses parameter
      mailinglist - the mailing list
      name - the printable name of the package
      notes - the note for the upload managers
      pkg - the package name in lower-case
      repository - the repository
      support - the support channel
      topics - the topics parameter
      uploader - the name of the uploader
      update - the indicator for update vs. new
      vers - the version number
      api - the API version
      Returns:
      the response
    • version

      @GET @Path("/version") public Map<String,String> version()
      The method version provides means to retrieve the version number of the API.
      Returns:
      a Map with a single attribute version containing the version number as String.