Class 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 class  FederatedSearch.ConfigParameter
      Configuration parameter used by this JAX-RS resource.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MULTIVALUE_SEPARATOR  
    • Constructor Summary

      Constructors 
      Constructor Description
      FederatedSearch()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String get​(java.lang.String template, javax.ws.rs.core.UriInfo info)
      Returns an open search descriptor describing the federated search / open search services.
      protected java.util.Properties getTemplateProperties​(java.lang.String template)
      Returns the Properties according to the given template.
      javax.ws.rs.core.Response searchAtom​(javax.ws.rs.core.UriInfo info, javax.servlet.http.HttpServletRequest request, java.lang.String template, java.lang.String query, int page, int count)
      Performs the federated search as specified by the request.
      javax.ws.rs.core.Response searchRSS​(javax.ws.rs.core.UriInfo info, javax.servlet.http.HttpServletRequest request, java.lang.String template, java.lang.String query, int page, int count)
      Performs the federated search as specified by the request.
      protected java.lang.String valueToString​(com.saperion.intf.SaPropertyValue values)
      Returns the value of the given SaPropertyValue as String.
      • Methods inherited from class java.lang.Object

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

      • MULTIVALUE_SEPARATOR

        public static final java.lang.String MULTIVALUE_SEPARATOR
        See Also:
        Constant Field Values
    • Constructor Detail

      • FederatedSearch

        public FederatedSearch()
    • Method Detail

      • get

        @GET
        @Path("/{template}.osdx")
        @Produces("application/opensearchdescription+xml")
        public java.lang.String get​(@PathParam("template")
                                    java.lang.String template,
                                    @Context
                                    javax.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 javax.ws.rs.core.Response searchRSS​(@Context
                                                   javax.ws.rs.core.UriInfo info,
                                                   @Context
                                                   javax.servlet.http.HttpServletRequest request,
                                                   @PathParam("template")
                                                   java.lang.String template,
                                                   @QueryParam("query")
                                                   java.lang.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 javax.ws.rs.core.Response searchAtom​(@Context
                                                    javax.ws.rs.core.UriInfo info,
                                                    @Context
                                                    javax.servlet.http.HttpServletRequest request,
                                                    @PathParam("template")
                                                    java.lang.String template,
                                                    @QueryParam("query")
                                                    java.lang.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 java.lang.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 java.util.Properties getTemplateProperties​(java.lang.String template)
        Returns the Properties according to the given template.
        Parameters:
        template - The template name.
        Returns:
        the Properties according to the given template.