Class FederatedSearch

java.lang.Object
com.saperion.rs.RestService
com.saperion.rs.federatedsearch.FederatedSearch

@Singleton @Path("/federatedsearch") public class FederatedSearch extends RestService
This JAX-RS resource represents the federated search service. URL: /federatedsearch.
Author:
sts
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Configuration parameter used by this JAX-RS resource.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String template, jakarta.ws.rs.core.UriInfo info)
    Returns an open search descriptor describing the federated search / open search services.
    protected Properties
    Returns the Properties according to the given template.
    jakarta.ws.rs.core.Response
    searchAtom(jakarta.ws.rs.core.UriInfo info, jakarta.servlet.http.HttpServletRequest request, String template, String query, int page, int count)
    Performs the federated search as specified by the request.
    jakarta.ws.rs.core.Response
    searchRSS(jakarta.ws.rs.core.UriInfo info, jakarta.servlet.http.HttpServletRequest request, String template, String query, int page, int count)
    Performs the federated search as specified by the request.
    protected String
    valueToString(com.saperion.intf.SaPropertyValue values)
    Returns the value of the given SaPropertyValue as String.

    Methods inherited from class com.saperion.rs.RestService

    checkConnection, getConnection

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • FederatedSearch

      public FederatedSearch()
  • Method Details

    • get

      @GET @Path("/{template}.osdx") @Produces("application/opensearchdescription+xml") public String get(@PathParam("template") String template, @Context jakarta.ws.rs.core.UriInfo info)
      Returns an open search descriptor describing the federated search / open search services.
      Parameters:
      template - The open search template to be used by this request.
      info - The injected UriInfo.
      Returns:
      The osdx definition of this search service.
    • searchRSS

      @GET @Path("/{template}.rss") public jakarta.ws.rs.core.Response searchRSS(@Context jakarta.ws.rs.core.UriInfo info, @Context jakarta.servlet.http.HttpServletRequest request, @PathParam("template") String template, @QueryParam("query") String query, @DefaultValue("1") @QueryParam("page") int page, @DefaultValue("25") @QueryParam("cnt") int count) throws com.sun.syndication.io.FeedException
      Performs the federated search as specified by the request.
      Parameters:
      info - injected UriInfo.
      request - injected HttpServletRequest.
      template - the federated search template to use.
      query - the user entered query term.
      page - the expected query result page number
      count - the expected maximum query results
      Returns:
      The corresponding RSS feed.
      Throws:
      com.sun.syndication.io.FeedException - if an error occurs.
    • searchAtom

      @GET @Path("/{template}.atom") public jakarta.ws.rs.core.Response searchAtom(@Context jakarta.ws.rs.core.UriInfo info, @Context jakarta.servlet.http.HttpServletRequest request, @PathParam("template") String template, @QueryParam("query") String query, @DefaultValue("1") @QueryParam("page") int page, @DefaultValue("25") @QueryParam("cnt") int count) throws com.sun.syndication.io.FeedException
      Performs the federated search as specified by the request.
      Parameters:
      info - injected UriInfo.
      request - injected HttpServletRequest.
      template - the federated search template to use.
      query - the user entered query term.
      page - the expected query result page number
      count - the expected maximum query results
      Returns:
      The corresponding ATOM feed.
      Throws:
      com.sun.syndication.io.FeedException - if an error occurs.
    • valueToString

      protected String valueToString(com.saperion.intf.SaPropertyValue values)
      Returns the value of the given SaPropertyValue as String.
      Parameters:
      values - The SaPropertyValue to get the string value form.
      Returns:
      a String representing the value of the given SaPropertyValue
    • getTemplateProperties

      protected Properties getTemplateProperties(String template)
      Returns the Properties according to the given template.
      Parameters:
      template - The template name.
      Returns:
      the Properties according to the given template.