org.apache.wink.common.model.opensearch
Class OpenSearchUrl

java.lang.Object
  extended by org.apache.wink.common.model.opensearch.OpenSearchUrl

public class OpenSearchUrl
extends java.lang.Object

The "Url" element per OpenSearch specification

 The "Url" element
     
     Describes an interface by which a search client can make search requests of the search engine.
     
     OpenSearch provides support for both index-based and page-based search engines. By default, both the first search result and the first page of search results are numbered "1". Search engines can use the "indexOffset" and "pageOffset" attributes to inform search clients of different starting values.
     
         Parent: OpenSearchDescription 
         Attributes:
     
             template - Contains the search URL template to be processed according to the OpenSearch URL template syntax.
     
                 Requirements: This attribute is required. 
     
             type - Contains the MIME type of the search result format.
     
                 Restrictions: The value must be a valid MIME type. 
                 Requirements: This attribute is required. 
     
             indexOffset - Contains the index number of the first search result.
     
                 Restrictions: The value must be an integer. 
                 Default: "1" 
                 Requirements: This attribute is optional. 
     
             pageOffset - Contains the page number of the first set of search results.
     
                 Restrictions: The value must be an integer. 
                 Default: "1". 
                 Requirements: This attribute is optional. 
     
         Requirements: This element must appear one or more times. 
     
     
     Example of a Url element describing the interface used to retrieve search results over RSS:
     
      <Url type="application/rss+xml"
           template="http://example.com/?q={searchTerms}&pw={startPage?}" />
     
     Example of a Url element describing the interface used to retrieve 0-based search results over XHTML:
     
      <Url type="application/xhtml+xml"
           indexOffset="0"
           template="http://example.com/search?q={searchTerms}&start={startIndex?}" />
 
 


Field Summary
protected  java.lang.String template
           
protected  java.lang.String type
           
 
Constructor Summary
OpenSearchUrl()
           
 
Method Summary
 void addOpenSearchParameter(OpenSearchParameter openSearchParameter)
          Add OpenSearch parameter to the list of Open Search Parameters
 java.lang.String generateOpenSearchUrlTemplate()
          Builds OpenSearchUrl template based on base URI and the list of Open Search openSearchParametersParameters
 java.lang.String getBaseUri()
          Get Search base URI
 java.util.List<OpenSearchParameter> getOpenSearchParameters()
          Gets the value of the openSearchParameters property.
 java.lang.String getTemplate()
          Gets the value of the template property.
 java.lang.String getType()
          Gets the value of the type property.
 void setBaseUri(java.lang.String baseUri)
          Set Search base URI
 void setTemplate(java.lang.String value)
          Sets the value of the template property.
 void setType(java.lang.String value)
          Sets the value of the type property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected java.lang.String type

template

protected java.lang.String template
Constructor Detail

OpenSearchUrl

public OpenSearchUrl()
Method Detail

getType

public java.lang.String getType()
Gets the value of the type property.

Returns:
possible object is String

setType

public void setType(java.lang.String value)
Sets the value of the type property.

Parameters:
value - allowed object is String

getTemplate

public java.lang.String getTemplate()
Gets the value of the template property.

Returns:
possible object is String

setTemplate

public void setTemplate(java.lang.String value)
Sets the value of the template property.

Parameters:
value - allowed object is String

addOpenSearchParameter

public void addOpenSearchParameter(OpenSearchParameter openSearchParameter)
Add OpenSearch parameter to the list of Open Search Parameters

Parameters:
openSearchParameter - allowed object is OpenSearchParameter

getOpenSearchParameters

public java.util.List<OpenSearchParameter> getOpenSearchParameters()
Gets the value of the openSearchParameters property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside openSearchParameters object.

For example, to add a new item, do as follows:

 getOpenSearchParameters().add(openSearchParameter);
 

Objects of the following type(s) are allowed in the list String


generateOpenSearchUrlTemplate

public java.lang.String generateOpenSearchUrlTemplate()
Builds OpenSearchUrl template based on base URI and the list of Open Search openSearchParametersParameters

Returns:
String OpenSearchUrl template

getBaseUri

public java.lang.String getBaseUri()
Get Search base URI

Returns:
String

setBaseUri

public void setBaseUri(java.lang.String baseUri)
Set Search base URI



Copyright © 2009 The Apache Software Foundation. All Rights Reserved.