Class JsonTopicResource
java.lang.Object
org.ctan.site.resources.catalogue.api.JsonTopicResource
The class
Topic3Resource
contains the controller for the Topic
resource.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
The classTopicTo
contains the transport object for the Topic resource in the summary list. -
Constructor Summary
ConstructorsConstructorDescriptionJsonTopicResource
(@NonNull TopicStore store) This is the constructor for the classTopic3Resource
. -
Method Summary
Modifier and TypeMethodDescriptiongetTopicByKey
(@NonNull String vers, @NonNull String id, Boolean ref) The methodgetTopicByKey
provides means to retrieve an Topic.The methodgetTopics
provides means to retrieve a list of topics starting with a given pattern.
-
Constructor Details
-
JsonTopicResource
This is the constructor for the classTopic3Resource
.- Parameters:
store
- the underlying store
-
-
Method Details
-
getTopicByKey
@GET @Path("/json/{vers}/topic/{id}") @PermitAll @UnitOfWork("siteDb") public JsonTopicResource.TopicTo getTopicByKey(@NonNull @PathParam("vers") @NonNull String vers, @NonNull @PathParam("id") @NonNull String id, @QueryParam("ref") Boolean ref) The methodgetTopicByKey
provides means to retrieve an Topic.- Parameters:
vers
- the versionid
- the key of the topicref
- the indicator whether or not to return the references to the packages tagged with the topic- Returns:
- a topic or
null
-
getTopics
@GET @Path("/json/{vers}/topics") @PermitAll @UnitOfWork("siteDb") public List<JsonTopicResource.TopicTo> getTopics(@NonNull @PathParam("vers") @NonNull String vers, @QueryParam("key") String key) The methodgetTopics
provides means to retrieve a list of topics starting with a given pattern.- Parameters:
vers
- the version numberkey
- the key- Returns:
- a list of matching Topic summaries
-