|
deegree 2.4 (2010/11/11 10:47 build-27-official) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.enterprise.control.AbstractListener
org.deegree.portal.standard.csw.control.SimpleSearchListener
public class SimpleSearchListener
A ${type_name} class.
This listener does more than just search for data. It searches for data *and* then searches if there are services
(WMS, WFS) available, which provide this data.
| Field Summary | |
|---|---|
protected CSWClientConfiguration |
config
|
static String |
HTML_FRAGMENT
used in jsp pages |
protected NamespaceContext |
nsContext
|
(package private) static String |
RESULT_SEARCH
|
(package private) static String |
RPC_CATALOG
|
(package private) static String |
RPC_FORMAT
|
(package private) static String |
SESSION_AVAILABLESERVICECATALOGS
|
(package private) static String |
SESSION_DATARECORDS
|
(package private) static String |
SESSION_REQUESTFORRESULTS
|
(package private) static String |
SESSION_RESULTFORHITS
|
| Constructor Summary | |
|---|---|
SimpleSearchListener()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(FormEvent event)
|
protected List<DataSessionRecord> |
createDataSessionRecords(HashMap results)
Created a list of DataSessionRecord from all the returned results |
protected String |
createRequest(RPCStruct rpcStruct,
String format,
String resultType)
This method creates a csw request with the RequestFactory of the passed format, using the paramter values passed in the rpcStruct. |
protected RPCStruct |
createRpcStructForServiceSearch(String template,
String identifier)
Creates an RPC request from the given template |
protected Map |
doServiceSearch(HashMap result,
String format,
String resultType)
Invokes a GetRecords request with type RESULT to get the actual records for all the metadata returned during the GetRecords request with type HIT |
protected List |
extractMetadata(Document doc)
Extracts all Metadata nodes from the passed csw:GetRecordsResponse Document. |
protected List |
extractRPCCatalogs(RPCWebEvent rpcEvent)
Extracts the catalog names from the first parameter of the params element within the passed rpcEvent. |
protected Object |
extractRPCMember(RPCStruct struct,
String member)
Extracts the member of the passed name from the passed struct. |
protected RPCParameter[] |
extractRPCParameters(RPCWebEvent rpcEvent)
Extracts the parameters from the method call element within the passed rpcEvent. |
protected RPCStruct |
extractRPCStruct(RPCWebEvent rpcEvent,
int index)
Extracts the RPCStruct from the indicated parameter in the params element of the passed
RPCWebEvent. |
protected String |
extractValue(Node node,
String xPath)
Extracts node value |
protected String |
getMetadataType(Element docElem)
Checks if the metadata is of series, dataset, application or service type |
protected String |
getXPathToId(Element docElem)
|
protected String |
getXPathToTitle(Element docElement)
|
protected void |
handleResult(Object resultHits,
Object resultResults,
String pathToXslFile)
Handles the result of the search requests and transforms the result to HTML using xslt, then saves the transformed result into the session |
protected boolean |
isKnownMetadataType(Element docElem)
Checks whether the metadata document is of a known type. |
protected HashMap |
performRequest(String protocol,
String request,
List catalogs)
Performs the CSW request and returns the result as a HashMap |
protected void |
validateRequest(RPCWebEvent rpcEvent)
Validates the rpc request and makes sure that all the needed parameters are included |
| Methods inherited from class org.deegree.enterprise.control.AbstractListener |
|---|
getAlternativeNextPage, getHomePath, getInitParameter, getInitParameterList, getNextPage, getRequest, getReturnValue, gotoErrorPage, handle, setAlternativeNextPage, setDefaultAlternativeNextPage, setDefaultNextPage, setNextPage, setReturnValue, toModel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String HTML_FRAGMENT
static final String RESULT_SEARCH
static final String RPC_CATALOG
static final String RPC_FORMAT
static final String SESSION_AVAILABLESERVICECATALOGS
static final String SESSION_DATARECORDS
static final String SESSION_REQUESTFORRESULTS
static final String SESSION_RESULTFORHITS
protected CSWClientConfiguration config
protected NamespaceContext nsContext
| Constructor Detail |
|---|
public SimpleSearchListener()
| Method Detail |
|---|
public void actionPerformed(FormEvent event)
actionPerformed in interface WebListeneractionPerformed in class AbstractListener
protected void validateRequest(RPCWebEvent rpcEvent)
throws CatalogClientException
rpcEvent -
CatalogClientException
protected String createRequest(RPCStruct rpcStruct,
String format,
String resultType)
throws CatalogClientException
rpcStruct - The struct contains parameter values to be used in the RequestFactory.format - The format determines the RequestFactory to be used.resultType - The type of desired result. Possible values are HITS or RESULTS or null.
String.
CatalogClientException
protected HashMap performRequest(String protocol,
String request,
List catalogs)
throws CatalogClientException
protocol - request - catalogs -
HashMap, which contains one key-value-pair for each catalogue, that has been
searched. The key is the name of the catalogue. The value is the doc Document, that contains the number
of matches (resultType="HITS"), or 1 to n metadata entries (resultType="RESULTS")
CatalogClientException
protected void handleResult(Object resultHits,
Object resultResults,
String pathToXslFile)
throws XMLParsingException,
CatalogClientException
resultHits - resultResults - pathToXslFile - e.g. file://$iGeoPortal_home$/WEB-INF/conf/igeoportal/metaList2html.xsl
XMLParsingException - if the documents contained in resultHits don't have the expected structure.
CatalogClientException
protected List<DataSessionRecord> createDataSessionRecords(HashMap results)
throws CatalogClientException
results -
CatalogClientException - if the identifier or the title of a metadata element could not be extracted.
protected List extractMetadata(Document doc)
throws CatalogClientException,
XMLParsingException
doc - The csw:GetRecordsResponse Document from which to extract the Metadata nodes.
CatalogClientException - if metadata nodes could not be extracted from the passed Document.
XMLParsingException
protected String extractValue(Node node,
String xPath)
throws CatalogClientException,
XMLParsingException
node - xPath -
CatalogClientException
XMLParsingException
protected Map doServiceSearch(HashMap result,
String format,
String resultType)
throws CatalogClientException
result - HashMap containing data catalog names (as keys) and GetRecordResponse Documents (as values).format - some service format like "ISO19119"resultType - either "HITS" or "RESULTS".
CatalogClientException
protected RPCStruct createRpcStructForServiceSearch(String template,
String identifier)
throws CatalogClientException,
RPCException
template - identifier -
CatalogClientException
RPCException
protected RPCParameter[] extractRPCParameters(RPCWebEvent rpcEvent)
throws CatalogClientException
rpcEvent -
RPCParameter.
CatalogClientException
protected List extractRPCCatalogs(RPCWebEvent rpcEvent)
throws CatalogClientException
rpcEvent -
String.
CatalogClientException
protected RPCStruct extractRPCStruct(RPCWebEvent rpcEvent,
int index)
throws CatalogClientException
RPCStruct from the indicated parameter in the params element of the passed
RPCWebEvent.
rpcEvent - The RPCWebEvent, that contains the RPCStruct to extract.index - The index of the parameter from which to extract the RPCStruct (starting with 0).
RPCStruct from the indicated params element.
CatalogClientException
protected Object extractRPCMember(RPCStruct struct,
String member)
throws CatalogClientException
struct - The rpcStruct to extract the passed member from.member - The Member to extract from the passed rpcStruct.
CatalogClientExceptionprotected String getMetadataType(Element docElem)
docElem -
protected boolean isKnownMetadataType(Element docElem)
docElem -
protected String getXPathToId(Element docElem)
docElem -
protected String getXPathToTitle(Element docElement)
docElement -
|
deegree 2.4 (2010/11/11 10:47 build-27-official) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org