Esri Geoportal Server
1.0

com.esri.gpt.framework.search
Class SearchXslProfile<C extends Criteria,RD extends Record,RS extends Records<RD>,QR extends QueryResult<RS>>

java.lang.Object
  extended by com.esri.gpt.framework.search.SearchXslProfile<C,RD,RS,QR>
Type Parameters:
C - criteria type
RD - record type
RS - collection of records type
QR - query result type
Direct Known Subclasses:
CswProfile, SearchGptXslProfile

public abstract class SearchXslProfile<C extends Criteria,RD extends Record,RS extends Records<RD>,QR extends QueryResult<RS>>
extends Object

Search profile.


Nested Class Summary
static class SearchXslProfile.FORMAT_SEARCH_TO_XSL
           
 
Constructor Summary
SearchXslProfile()
          Instantiates a new csw profile.
SearchXslProfile(String sid, String sname, String sdescription)
          The Constructor.
SearchXslProfile(String id, String name, String description, String kvp, String requestxslt, String responsexslt, String metadataxslt, boolean livedatamap, boolean extentsearch)
          The Constructor.
 
Method Summary
 String generateGetRecordsRequest(SearchCriteria criteria, Map<String,String> xslParams, boolean hitsOnly)
          Generate get records request.
 String getDescription()
           
 TransformerFactory getFactory()
          Gets the transformer factory.
 SearchXslProfile.FORMAT_SEARCH_TO_XSL getFormatRequestToXsl()
          Gets the format request to xsl.
 String getId()
          Gets the id.
 String getKvp()
          Gets the kvp.
 String getMetadataxslt()
          Gets the metadataxslt.
 XsltTemplate getMetadataxsltobj()
          Gets the metadataxsltobj.
 XsltTemplate getMetadataXsltObj()
          Gets the response XSLT object.
 String getName()
          Gets the name.
 SearchXslRecord getRecordById(String responseStr, String uuid, String requestUrl)
          Gets the record by id.
 String getRequestxslt()
          Gets the requestxslt.
 XsltTemplate getRequestxsltobj()
          Gets the requestxsltobj.
 String getResponsexslt()
          Gets the responsexslt.
 XsltTemplate getResponsexsltobj()
          Gets the response XSLT object.
 boolean isFilter_extentsearch()
          Checks if is filter_extentsearch.
 boolean isFilter_livedatamap()
          Checks if is filter_livedatamap.
 boolean isHarvestable()
          Checks if is harvestable.
 boolean isSupportsContentTypeQuery()
          Checks if is supports content type query.
 boolean isSupportsFullMetadataAtSearch()
          Checks if is supports full metadata at search.
 boolean isSupportsSpatialBoundary()
          Checks if is supports spatial boundary.
 boolean isSupportsSpatialQuery()
          Checks if is supports spatial query.
abstract  void readGetMetadataByIDResponse(String response, RD record)
          Read get metadata by id response.
 void readGetRecordsResponse(String responseString, QueryResult<RS> searchResult)
          Read get records response.
protected  void readIntermidiateGetRecordById(String response, SearchXslRecord record)
          Read intermidiate get record by id.
 void setDescription(String description)
          Sets the description.
 void setFilter_extentsearch(boolean filter_extentsearch)
          Sets the filter_extentsearch.
 void setFilter_livedatamap(boolean filter_livedatamap)
          Sets the filter_livedatamap.
 void setFormatRequestToXsl(SearchXslProfile.FORMAT_SEARCH_TO_XSL formatRequestToXsl)
          Sets the format request to xsl.
 void setHarvestable(boolean harvestable)
          Sets the harvestable.
 void setId(String id)
          Sets the id.
 void setKvp(String kvp)
          Sets the kvp.
 void setMetadataxslt(String metadataxslt)
          Sets the metadataxslt.
 void setMetadataxsltobj(XsltTemplate metadataxsltobj)
          Sets the metadataxsltobj.
 void setName(String name)
          Sets the name.
 void setRequestxslt(String requestxslt)
          Sets the requestxslt.
 void setRequestxsltobj(XsltTemplate requestxsltobj)
          Sets the requestxsltobj.
 void setResponsexslt(String responsexslt)
          Sets the response XSLT.
 void setResponsexsltobj(XsltTemplate responsexsltobj)
          Sets the response XSLT Object.
 void setSupportsContentTypeQuery(boolean supportsContentTypeQuery)
          Sets the supports content type query.
 void setSupportsFullMetadataAtSearch(boolean supportsFullMetadataAtSearch)
          Sets the supports full metadata at search.
 void setSupportsSpatialBoundary(boolean supportsSpatialBoundary)
          Sets the supports spatial boundary.
 void setSupportsSpatialQuery(boolean supportsSpatialQuery)
          Sets the supports spatial query.
 boolean SupportContentTypeQuery()
          Support content type query.
 boolean SupportSpatialBoundary()
           
 boolean SupportSpatialQuery()
          Support spatial query.
protected  String transform(String xml, Transformer transformer)
          Transformer convinient method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchXslProfile

public SearchXslProfile()
Instantiates a new csw profile.


SearchXslProfile

public SearchXslProfile(String sid,
                        String sname,
                        String sdescription)
The Constructor.

Parameters:
sid - the sid
sname - the sname
sdescription - the sdescription

SearchXslProfile

public SearchXslProfile(String id,
                        String name,
                        String description,
                        String kvp,
                        String requestxslt,
                        String responsexslt,
                        String metadataxslt,
                        boolean livedatamap,
                        boolean extentsearch)
The Constructor.

Parameters:
livedatamap - the livedatamap
extentsearch - the extentsearch
id - the id
name - the name
description - the description
kvp - the kvp
requestxslt - the requestxslt
responsexslt - the responsexslt
metadataxslt - the metadataxslt
Method Detail

isSupportsFullMetadataAtSearch

public boolean isSupportsFullMetadataAtSearch()
Checks if is supports full metadata at search.

Returns:
true, if is supports full metadata at search

isHarvestable

public boolean isHarvestable()
Checks if is harvestable.

Returns:
true, if is harvestable

setHarvestable

public void setHarvestable(boolean harvestable)
Sets the harvestable.

Parameters:
harvestable - the new harvestable

setSupportsFullMetadataAtSearch

public void setSupportsFullMetadataAtSearch(boolean supportsFullMetadataAtSearch)
Sets the supports full metadata at search.

Parameters:
supportsFullMetadataAtSearch - the new supports full metadata at search

isSupportsSpatialQuery

public boolean isSupportsSpatialQuery()
Checks if is supports spatial query.

Returns:
true, if is supports spatial query

setSupportsSpatialQuery

public void setSupportsSpatialQuery(boolean supportsSpatialQuery)
Sets the supports spatial query.

Parameters:
supportsSpatialQuery - the new supports spatial query

isSupportsContentTypeQuery

public boolean isSupportsContentTypeQuery()
Checks if is supports content type query.

Returns:
true, if is supports content type query

setSupportsContentTypeQuery

public void setSupportsContentTypeQuery(boolean supportsContentTypeQuery)
Sets the supports content type query.

Parameters:
supportsContentTypeQuery - the new supports content type query

isSupportsSpatialBoundary

public boolean isSupportsSpatialBoundary()
Checks if is supports spatial boundary.

Returns:
true, if is supports spatial boundary

setSupportsSpatialBoundary

public void setSupportsSpatialBoundary(boolean supportsSpatialBoundary)
Sets the supports spatial boundary.

Parameters:
supportsSpatialBoundary - the new supports spatial boundary

readGetMetadataByIDResponse

public abstract void readGetMetadataByIDResponse(String response,
                                                 RD record)
                                          throws TransformerException
Read get metadata by id response.

Parameters:
response - the response
record - the record
Throws:
TransformerException - the transformer exception

readGetRecordsResponse

public void readGetRecordsResponse(String responseString,
                                   QueryResult<RS> searchResult)
                            throws TransformerException,
                                   ParserConfigurationException,
                                   SAXException,
                                   IOException,
                                   XPathExpressionException
Read get records response. Puts SearchXslRecord into search Result param.

Parameters:
responseString - the response string
searchResult - the search results (will be filled with SearchXslRecords)
Throws:
TransformerException - the transformer exception
ParserConfigurationException - the parser configuration exception
SAXException - the sAX exception
IOException - Signals that an I/O exception has occurred.
XPathExpressionException - the x path expression exception

SupportContentTypeQuery

public boolean SupportContentTypeQuery()
Support content type query.

Returns:
true, if successful

SupportSpatialBoundary

public boolean SupportSpatialBoundary()

SupportSpatialQuery

public boolean SupportSpatialQuery()
Support spatial query.

Returns:
true, if successful

getDescription

public String getDescription()

setDescription

public void setDescription(String description)
Sets the description.

Parameters:
description - the new description

isFilter_extentsearch

public boolean isFilter_extentsearch()
Checks if is filter_extentsearch.

Returns:
true, if is filter_extentsearch

setFilter_extentsearch

public void setFilter_extentsearch(boolean filter_extentsearch)
Sets the filter_extentsearch.

Parameters:
filter_extentsearch - the new filter_extentsearch

isFilter_livedatamap

public boolean isFilter_livedatamap()
Checks if is filter_livedatamap.

Returns:
true, if is filter_livedatamap

setFilter_livedatamap

public void setFilter_livedatamap(boolean filter_livedatamap)
Sets the filter_livedatamap.

Parameters:
filter_livedatamap - the new filter_livedatamap

getId

public String getId()
Gets the id.

Returns:
the id

setId

public void setId(String id)
Sets the id.

Parameters:
id - the new id

getKvp

public String getKvp()
Gets the kvp.

Returns:
the kvp

setKvp

public void setKvp(String kvp)
Sets the kvp.

Parameters:
kvp - the new kvp

getMetadataxslt

public String getMetadataxslt()
Gets the metadataxslt.

Returns:
the metadataxslt

setMetadataxslt

public void setMetadataxslt(String metadataxslt)
Sets the metadataxslt.

Parameters:
metadataxslt - the new metadataxslt

getMetadataxsltobj

public XsltTemplate getMetadataxsltobj()
Gets the metadataxsltobj.

Returns:
the metadataxsltobj

setMetadataxsltobj

public void setMetadataxsltobj(XsltTemplate metadataxsltobj)
Sets the metadataxsltobj.

Parameters:
metadataxsltobj - the new metadataxsltobj

getName

public String getName()
Gets the name.

Returns:
the name

setName

public void setName(String name)
Sets the name.

Parameters:
name - the new name

getRequestxslt

public String getRequestxslt()
Gets the requestxslt.

Returns:
the requestxslt

setRequestxslt

public void setRequestxslt(String requestxslt)
Sets the requestxslt.

Parameters:
requestxslt - the new requestxslt

getRequestxsltobj

public XsltTemplate getRequestxsltobj()
                               throws TransformerConfigurationException,
                                      IOException
Gets the requestxsltobj.

Returns:
the requestxsltobj
Throws:
TransformerConfigurationException - on xslt template creation error
IOException - Signals that an I/O exception has occurred.

setRequestxsltobj

public void setRequestxsltobj(XsltTemplate requestxsltobj)
Sets the requestxsltobj.

Parameters:
requestxsltobj - the new requestxsltobj

getResponsexslt

public String getResponsexslt()
Gets the responsexslt.

Returns:
the responsexslt

setResponsexslt

public void setResponsexslt(String responsexslt)
Sets the response XSLT.

Parameters:
responsexslt - the new response XSLT

getResponsexsltobj

public XsltTemplate getResponsexsltobj()
                                throws TransformerConfigurationException,
                                       IOException
Gets the response XSLT object.

Returns:
the response XSLT object
Throws:
CSWException
TransformerConfigurationException
IOException

getMetadataXsltObj

public XsltTemplate getMetadataXsltObj()
                                throws TransformerConfigurationException
Gets the response XSLT object.

Returns:
the response XSLT object
Throws:
CSWException
TransformerConfigurationException

setResponsexsltobj

public void setResponsexsltobj(XsltTemplate responsexsltobj)
Sets the response XSLT Object.

Parameters:
responsexsltobj - the new response XSLT Object

getFactory

public TransformerFactory getFactory()
Gets the transformer factory.

Returns:
the factory

transform

protected String transform(String xml,
                           Transformer transformer)
                    throws TransformerException
Transformer convinient method.

Parameters:
xml - the xml
transformer - the transformer
Returns:
the string
Throws:
TransformerException - the transformer exception

readIntermidiateGetRecordById

protected void readIntermidiateGetRecordById(String response,
                                             SearchXslRecord record)
                                      throws TransformerConfigurationException,
                                             TransformerException
Read intermidiate get record by id. GetRecords does only uses the getMetadata xslt to get an intermidiate reference to the actual xml

Parameters:
response - the response
record - the record
Throws:
TransformerConfigurationException - the transformer configuration exception
TransformerException - the transformer exception

getRecordById

public SearchXslRecord getRecordById(String responseStr,
                                     String uuid,
                                     String requestUrl)
                              throws IOException,
                                     TransformerException,
                                     NullReferenceException,
                                     InvalidOperationException,
                                     SearchException
Gets the record by id.

getFormatRequestToXsl

public SearchXslProfile.FORMAT_SEARCH_TO_XSL getFormatRequestToXsl()
Gets the format request to xsl.

Returns:
the format request to xsl (never null, default MINIMAL_LEGACY)

setFormatRequestToXsl

public void setFormatRequestToXsl(SearchXslProfile.FORMAT_SEARCH_TO_XSL formatRequestToXsl)
Sets the format request to xsl.

Parameters:
formatRequestToXsl - the new format request to xsl

generateGetRecordsRequest

public String generateGetRecordsRequest(SearchCriteria criteria,
                                        Map<String,String> xslParams,
                                        boolean hitsOnly)
                                 throws TransformerException,
                                        ParserConfigurationException,
                                        SAXException,
                                        IOException,
                                        SearchException,
                                        XPathExpressionException
Generate get records request.

Parameters:
criteria - the criteria
xslParams - the xsl params
hitsOnly - Indicates whether this is a hits only request
Returns:
the string
Throws:
TransformerException - the transformer exception
ParserConfigurationException - the parser configuration exception
SAXException - the sAX exception
IOException - Signals that an I/O exception has occurred.
SearchException - the search exception
XPathExpressionException - the x path expression exception

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.