org.fao.fi.services.factsheet.client
Class FactsheetWebServiceClient

java.lang.Object
  extended by org.fao.fi.services.factsheet.client.FactsheetWebServiceClient

public class FactsheetWebServiceClient
extends java.lang.Object

FactsheetWebServiceClient in order to use the REST webservices offered at http://www.fao.org/figis/ws/factsheets/

Usage Example:
FactsheetWebServiceClient c = new FactsheetWebServiceClient();
DomainList dl = c.retrieveDomainList();

Author:
Erik van Ingen

Constructor Summary
FactsheetWebServiceClient()
          Default constructor.
FactsheetWebServiceClient(java.lang.String restWebserverUrl)
          The webservice endpoint might have been moved, use this constructor to explicitly point to a certain webservice endpoint.
 
Method Summary
 org.w3c.dom.Document pickNodeListWithXpath(java.lang.String xpath)
          Given the name of an element, this operation returns whatever element including its descendants.
 org.w3c.dom.Document pickNodeWithXpath(java.lang.String xpath)
          The xpath result given the xpath expression, factsheet, domain, and language.
 org.fao.fi.factsheetwebservice.domain.DomainList retrieveDomainList()
          Lists all the available domains
 org.w3c.dom.Document retrieveFactsheet(java.lang.String factsheet, org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain, org.fao.fi.factsheetwebservice.domain.FactsheetLanguage language)
          The actual factsheet URL, given the factsheet, domain and language.
 org.fao.fi.factsheetwebservice.domain.FactsheetList retrieveFactsheetListPerDomain(org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain)
          List of the available languages for that factsheet, given the domain.
 org.fao.fi.factsheetwebservice.domain.FactsheetList retrieveFactsheetListPerDomainAndLanguage(org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain, org.fao.fi.factsheetwebservice.domain.FactsheetLanguage language)
          List of the factsheets in all languages for the given domain and language.
 org.fao.fi.factsheetwebservice.domain.LanguageList retrieveLanguageListInDomain4ThisFactsheet(org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain, java.lang.String factsheet)
          List of the available languages for that factsheet, given the domain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactsheetWebServiceClient

public FactsheetWebServiceClient()
Default constructor. It is recommended to use this one.


FactsheetWebServiceClient

public FactsheetWebServiceClient(java.lang.String restWebserverUrl)
The webservice endpoint might have been moved, use this constructor to explicitly point to a certain webservice endpoint.

Parameters:
restWebserverUrl -
Method Detail

retrieveDomainList

public org.fao.fi.factsheetwebservice.domain.DomainList retrieveDomainList()
Lists all the available domains


retrieveFactsheetListPerDomain

public org.fao.fi.factsheetwebservice.domain.FactsheetList retrieveFactsheetListPerDomain(org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain)
List of the available languages for that factsheet, given the domain.


retrieveFactsheetListPerDomainAndLanguage

public org.fao.fi.factsheetwebservice.domain.FactsheetList retrieveFactsheetListPerDomainAndLanguage(org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain,
                                                                                                     org.fao.fi.factsheetwebservice.domain.FactsheetLanguage language)
List of the factsheets in all languages for the given domain and language.


retrieveLanguageListInDomain4ThisFactsheet

public org.fao.fi.factsheetwebservice.domain.LanguageList retrieveLanguageListInDomain4ThisFactsheet(org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain,
                                                                                                     java.lang.String factsheet)
List of the available languages for that factsheet, given the domain.


retrieveFactsheet

public org.w3c.dom.Document retrieveFactsheet(java.lang.String factsheet,
                                              org.fao.fi.factsheetwebservice.domain.FactsheetDomain domain,
                                              org.fao.fi.factsheetwebservice.domain.FactsheetLanguage language)
The actual factsheet URL, given the factsheet, domain and language.

Parameters:
request -
Returns:

pickNodeWithXpath

public org.w3c.dom.Document pickNodeWithXpath(java.lang.String xpath)
The xpath result given the xpath expression, factsheet, domain, and language. The xpath expression can go up to 5 levels deep.


pickNodeListWithXpath

public org.w3c.dom.Document pickNodeListWithXpath(java.lang.String xpath)
Given the name of an element, this operation returns whatever element including its descendants.



Copyright © 2010. All Rights Reserved.