Class CrudAuthor3Resource

java.lang.Object
org.ctan.site.resources.admin.CrudAuthor3Resource

@Path("/3.0/admin") @Produces("application/json") @RolesAllowed("ADMIN") public class CrudAuthor3Resource extends Object
The class CrudAuthor3Resource contains the CRUD controller for the author resource.
  • Constructor Details

    • CrudAuthor3Resource

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

    • create

      @POST @Path("/author") @UnitOfWork("siteDb") public Author create(@NonNull @NonNull Author author)
      The method create provides an end-point to create a author.
      Parameters:
      author - the author object to store
      Returns:
      the updated entity
    • get

      @GET @Path("/author/{key}") @UnitOfWork("siteDb") public Author get(@NonNull @PathParam("key") @NonNull String key)
      The method get provides means to retrieve a author.
      Parameters:
      key - the account
      Returns:
      true iff the author exists
    • list

      @GET @Path("/authors") @UnitOfWork("siteDb") public GeneralPage list(@QueryParam("q") String q, @QueryParam("page") @DefaultValue("1") int page, @QueryParam("size") @DefaultValue("256") int size, @QueryParam("order") String orderBy, @QueryParam("asc") boolean asc)
      The method list provides means to retrieve a page of authors.
      Parameters:
      q - the name pattern
      page - the page
      size - the page size
      orderBy - the order
      asc - the indicator for ascending
      Returns:
      the page for the author or null
    • remove

      @DELETE @Path("/author/{key}") @UnitOfWork("siteDb") public boolean remove(@NonNull @PathParam("key") @NonNull String key)
      The method remove provides an end-point to remove a author.
      Parameters:
      key - the account
      Returns:
      true iff the author has existed
    • set

      @PUT @Path("/author/{author}") @UnitOfWork("siteDb") public boolean set(@NonNull @PathParam("author") @NonNull String author, @NonNull @NonNull Map<String,String> map)
      The method set provides means to set a single attribute of an author.
      Parameters:
      author - the author
      map - the mapping containing key and value
      Returns:
      true iff the setting has succeeded