Package org.ctan.site.resources.admin
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 Summary
ConstructorsConstructorDescriptionCrudAuthor3Resource(@NonNull AuthorStore store) This is the constructor for the classCrudAuthor3Resource. -
Method Summary
Modifier and TypeMethodDescriptionThe methodcreateprovides an end-point to create a author.The methodgetprovides means to retrieve a author.The methodlistprovides means to retrieve a page of authors.booleanThe methodremoveprovides an end-point to remove a author.booleanThe methodsetprovides means to set a single attribute of an author.
-
Constructor Details
-
CrudAuthor3Resource
This is the constructor for the classCrudAuthor3Resource.- Parameters:
store- the underlying store
-
-
Method Details
-
create
The methodcreateprovides 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 methodgetprovides means to retrieve a author.- Parameters:
key- the account- Returns:
trueiff 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 methodlistprovides means to retrieve a page of authors.- Parameters:
q- the name patternpage- the pagesize- the page sizeorderBy- the orderasc- 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 methodremoveprovides an end-point to remove a author.- Parameters:
key- the account- Returns:
trueiff 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 methodsetprovides means to set a single attribute of an author.- Parameters:
author- the authormap- the mapping containing key and value- Returns:
trueiff the setting has succeeded
-