Class Topic3Resource

java.lang.Object
org.ctan.site.resources.catalogue.Topic3Resource

@Path("/3.0") @Produces({"application/json","application/xml"}) public class Topic3Resource extends Object
The class Topic3Resource contains the controller for the topic resource.
  • Constructor Details

    • Topic3Resource

      public Topic3Resource(@NonNull @NonNull CtanConfiguration.CtanConfig config, @NonNull @NonNull TopicStore store, @NonNull @NonNull ContentService contentService, @NonNull @NonNull VoteStore voteStore)
      This is the constructor for the class Topic3Resource.
      Parameters:
      config - the configuration
      store - the underlying store
      contentService - the content service
  • Method Details

    • getRandomTopics

      @GET @Path("/rnd/topics") @PermitAll @UnitOfWork("siteDb") public List<Topic3Resource.TopicInfoTo> getRandomTopics(@QueryParam("size") @DefaultValue("3") int count, @QueryParam("lang") @DefaultValue("en") String lang)
      The method getRandomTopics provides means to retrieve a random list of topics.
      Returns:
      the configuration
    • getTopicByKey

      @GET @Path("/topic/{id}") @PermitAll @UnitOfWork("siteDb") public Topic3Resource.TopicTo getTopicByKey(@NonNull @PathParam("id") @NonNull String id, @QueryParam("lang") String lang)
      The method getTopic provides means to retrieve a topic by its id.
      Parameters:
      id - the id
      lang - the language
      Returns:
      the topic or null
    • getTopics

      @GET @Path("/topics/{pattern}") @PermitAll @UnitOfWork("siteDb") public List<Topic3Resource.TopicSummaryTo> getTopics(@PathParam("pattern") String pattern, @QueryParam("lang") String lang, @DefaultValue("0") @QueryParam("page") long page, @DefaultValue("16") @QueryParam("size") long size)
      The method getTopics provides means to retrieve a list of authors starting with a given pattern.
      Parameters:
      pattern - the initial string of the name
      lang - the language code
      page - the page
      size - the page size
      Returns:
      a list of matching author summaries
    • getTopics0

      @GET @Path("/topics") @PermitAll @UnitOfWork("siteDb") public List<Topic3Resource.TopicSummaryTo> getTopics0(@QueryParam("lang") String lang)
      The method getTopics0 provides means to retrieve a list of topics starting with a given pattern.
      Parameters:
      lang - the language code
      Returns:
      a list of matching topics
    • getTopicsList

      @GET @Path("/topic/list") @PermitAll @UnitOfWork("siteDb") public List<Topic3Resource.TopicSummaryTo> getTopicsList(@QueryParam("lang") String lang)
      The method getTopicsList provides means to retrieve a list of topics starting with a given pattern.
      Parameters:
      lang - the language code
      Returns:
      a list of matching topics