How To
Documentation
    Learn More

      Webservice Search

      The Webservice search platform can be used to connect to any RESTful web service that returns a list of objects. Each object in the web service response is mapped to a search result document, which can then be rendered using standard Appkit UI components.

      Setup

      To add the Webservice search platform to a Maven project, you must add this dependency to your project’s pom.xml file:

      <dependency>
          <groupId>twigkit</groupId>
          <artifactId>twigkit.webservice-search</artifactId>
          <version>${project.parent.version}</version>
      </dependency>

      Usage

      You can define the search endpoint through a configuration node (say conf/platforms/webservice.conf). For this you must include name: twigkit.search.webservice.WebServiceSearch, as shown here:

      name: twigkit.search.webservice.WebServiceSearch
      url: http://mydomain.com/rest/search
      type: json

      Required attributes

      var (java.lang.String)
      Variable name to reference this Platform instance. Although this is optional, it is always good practice to name this explicitly for clarity.
      Default: platform
      Applied in: JSP tag

      url (java.lang.String)
      URL of the web service that is invoked.

      Optional attributes

      path (java.lang.String)
      Path expression to indicate which nodes in the response tree should be handled as result documents. For example, 'response/employees/employee'. Node names are separated by a '/' character.

      proxy (java.lang.String)
      The URL of a proxy to connect through.

      type (java.lang.String)
      Response type; 'xml' or 'json' are currently supported.
      Default: 'xml'

      user (java.lang.String)
      User name for basic authentication to the web service.

      password (java.lang.String)
      Password for basic authentication to the web service.

      Attributes shared across platforms

      scope (java.lang.String)
      Which scope to place the variable in (available values are default and request.
      Applied in: JSP tag

      name (java.lang.String)
      The display name of this Platform instance. Used for identifying different platforms in the user interface.
      Applied in: configuration

      defaultQuery (java.lang.String)
      Default query to use when none is specified.
      Applied in: configuration