Class JsonAuthorResource
java.lang.Object
org.ctan.site.resources.catalogue.api.JsonAuthorResource
The class
JsonAuthorResource
contains the controller for the
author resource.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
The classAuthorSummaryTo
contains the transport object for the author resource in the summary list.protected static class
The classAuthorTo
contains the transport object for the author resource.protected static class
The classPkgSummaryTo
contains the transport object for the package of the author resource. -
Constructor Summary
ConstructorsConstructorDescriptionJsonAuthorResource
(@NonNull AuthorStore store) This is the constructor for the classJsonAuthorResource
. -
Method Summary
Modifier and TypeMethodDescriptiongetAuthorByKey
(@NonNull String vers, @NonNull String id, Boolean ref) The methodgetAuthorByKey
provides means to retrieve an author.getAuthors
(@NonNull String vers, String key) The methodgetAuthors
provides means to retrieve a list of authors starting with a given pattern.
-
Constructor Details
-
JsonAuthorResource
This is the constructor for the classJsonAuthorResource
.- 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 methodgetAuthorByKey
provides means to retrieve an author.- Parameters:
vers
- the versionid
- the key of the authorref
- 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 methodgetAuthors
provides means to retrieve a list of authors starting with a given pattern.- Parameters:
vers
- the version numberkey
- the key- Returns:
- a list of matching author summaries
-