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 methodcreate
provides an end-point to create a author.The methodget
provides means to retrieve a author.The methodlist
provides means to retrieve a page of authors.boolean
The methodremove
provides an end-point to remove a author.boolean
The methodset
provides 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 methodcreate
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 methodget
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 methodlist
provides 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 methodremove
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 methodset
provides means to set a single attribute of an author.- Parameters:
author
- the authormap
- the mapping containing key and value- Returns:
true
iff the setting has succeeded
-