Class JsonAuthorResource

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

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

    • JsonAuthorResource

      public JsonAuthorResource(@NonNull @NonNull AuthorStore store)
      This is the constructor for the class JsonAuthorResource.
      Parameters:
      store - the underlying store
  • Method Details

    • getAuthorByKey

      @GET @Path("/json/{vers}/author/{id}") @PermitAll @UnitOfWork("siteDb") public JsonAuthorResource.AuthorTo getAuthorByKey(@NonNull @PathParam("vers") @NonNull String vers, @NonNull @PathParam("id") @NonNull String id, @QueryParam("ref") @DefaultValue("false") Boolean ref)
      The method getAuthorByKey provides means to retrieve an author.
      Parameters:
      vers - the version
      id - the key of the author
      ref - the indicator whether or not to return the references to the packages authored by the author
      Returns:
      an author or null
    • getAuthors

      @GET @Path("/json/{vers}/authors") @PermitAll @UnitOfWork("siteDb") public List<JsonAuthorResource.AuthorSummaryTo> getAuthors(@NonNull @PathParam("vers") @NonNull String vers, @QueryParam("key") String key)
      The method getAuthors provides means to retrieve a list of authors starting with a given pattern.
      Parameters:
      vers - the version number
      key - the key
      Returns:
      a list of matching author summaries