Class Author3Resource
java.lang.Object
org.ctan.site.resources.catalogue.Author3Resource
The class
Author3Resource
contains the controller for the author
resource.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
The classAuthorListTo
contains the transport object for the author list.protected 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. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The fieldGENDER_FEMALE
contains the String representation for the female gender.protected static final String
The fieldGENDER_MALE
contains the String representation for the male gender.protected static final String
The constantGENDER_ORG
contains the String representation for the gender x. -
Constructor Summary
ConstructorsConstructorDescriptionAuthor3Resource
(@NonNull CtanConfiguration.CtanConfig config, @NonNull AuthorStore store, @NonNull UserStore userStore) This is the constructor for the classAuthor3Resource
. -
Method Summary
Modifier and TypeMethodDescriptiongetAuthorByKey
(@NonNull String id, String lang) The methodgetAuthorByKey
provides means to retrieve an author.getAuthors
(String pattern, String lang) The methodgetAuthors
provides means to retrieve a list of authors starting with a given pattern.The methodgetAuthorsCount
provides means to retrieve the total number of authors.getAuthorsList
(String pattern) The methodgetAuthorsList
provides means to retrieve a list of authors starting with a given pattern.
-
Field Details
-
GENDER_ORG
The constantGENDER_ORG
contains the String representation for the gender x. This is used for groups or organisations.- See Also:
-
GENDER_MALE
The fieldGENDER_MALE
contains the String representation for the male gender.- See Also:
-
GENDER_FEMALE
The fieldGENDER_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 classAuthor3Resource
.- Parameters:
config
- the configurationstore
- the underlying storeuserStore
- 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 methodgetAuthorByKey
provides means to retrieve an author.- Parameters:
id
- the key of the authorlang
- 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 methodgetAuthors
provides means to retrieve a list of authors starting with a given pattern.- Parameters:
pattern
- the query string as part of the name -- case-insensitivelang
- the language code- Returns:
- a list of matching author summaries
-
getAuthorsCount
The methodgetAuthorsCount
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 methodgetAuthorsList
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
-