Class JsonTopicResource

java.lang.Object
org.ctan.site.resources.catalogue.api.JsonTopicResource

@Path("/") @Produces("application/json") public class JsonTopicResource extends Object
The class Topic3Resource contains the controller for the Topic resource.
  • Constructor Details

    • JsonTopicResource

      public JsonTopicResource(@NonNull @NonNull TopicStore store)
      This is the constructor for the class Topic3Resource.
      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 method getTopicByKey provides means to retrieve an Topic.
      Parameters:
      vers - the version
      id - the key of the topic
      ref - 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 method getTopics provides means to retrieve a list of topics starting with a given pattern.
      Parameters:
      vers - the version number
      key - the key
      Returns:
      a list of matching Topic summaries