Class Author3Resource

java.lang.Object
org.ctan.site.resources.catalogue.Author3Resource

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

    • GENDER_ORG

      protected static final String GENDER_ORG
      The constant GENDER_ORG contains the String representation for the gender x. This is used for groups or organisations.
      See Also:
    • GENDER_MALE

      protected static final String GENDER_MALE
      The field GENDER_MALE contains the String representation for the male gender.
      See Also:
    • GENDER_FEMALE

      protected static final String GENDER_FEMALE
      The field GENDER_FEMALE contains the String representation for the female gender.
      See Also:
  • Constructor Details

    • Author3Resource

      public Author3Resource(@NonNull @NonNull CtanConfiguration.CtanConfig config, @NonNull @NonNull AuthorStore store, @NonNull @NonNull UserStore userStore)
      This is the constructor for the class Author3Resource.
      Parameters:
      config - the configuration
      store - the underlying store
      userStore - the underlying user store
  • Method Details

    • getAuthorByKey

      @GET @Path("/author/{id}") @PermitAll @UnitOfWork("siteDb") public Author3Resource.AuthorTo getAuthorByKey(@NonNull @PathParam("id") @NonNull String id, @QueryParam("lang") String lang)
      The method getAuthorByKey provides means to retrieve an author.
      Parameters:
      id - the key of the author
      lang - the language
      Returns:
      an author or null
    • getAuthors

      @GET @Path("/authors/list/{pattern}") @PermitAll @UnitOfWork("siteDb") public List<Author3Resource.AuthorSummaryTo> getAuthors(@PathParam("pattern") String pattern, @QueryParam("lang") String lang)
      The method getAuthors provides means to retrieve a list of authors starting with a given pattern.
      Parameters:
      pattern - the query string as part of the name -- case-insensitive
      lang - the language code
      Returns:
      a list of matching author summaries
    • getAuthorsCount

      @GET @Path("/authors/count") @PermitAll @UnitOfWork("siteDb") public Long getAuthorsCount()
      The method getAuthorsCount provides means to retrieve the total number of authors.
      Returns:
      the number of authors
    • getAuthorsList

      @GET @Path("/authors/lst") @PermitAll @UnitOfWork("siteDb") public List<Author3Resource.AuthorListTo> getAuthorsList(@QueryParam("pattern") String pattern)
      The method getAuthorsList provides means to retrieve a list of authors starting with a given pattern.
      Parameters:
      pattern - the initial string of the name
      Returns:
      a list of matching author summaries