public abstract class AbstractSearch extends AbstractDSpaceTransformer implements org.apache.cocoon.caching.CacheableProcessingComponent
See the SimpleSearch implementation.
| Modifier and Type | Field and Description |
|---|---|
protected CollectionService |
collectionService |
protected CommunityService |
communityService |
protected HandleService |
handleService |
protected ItemService |
itemService |
protected MetadataExposureService |
metadataExposureService |
protected MetadataFieldService |
metadataFieldService |
protected DiscoverQuery |
queryArgs
Cached query arguments
|
protected DiscoverResult |
queryResults
Cached query results
|
context, contextPath, eperson, knot, objectModel, parameters, servletPath, sitemapURI, url| Constructor and Description |
|---|
AbstractSearch() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addBody(Body body)
Build the resulting search DRI document.
|
protected String |
addFilterQueriesToUrl(String pageURLMask) |
protected void |
addMetadataField(DiscoverResult.DSpaceObjectHighlightResult highlightedResults,
String metadataKey,
List metadataFieldList,
String value)
Add the current value to the wing list
|
protected void |
addMetadataField(List metadataFieldList,
String value)
Add our metadata value.
|
protected void |
buildMainForm(Division searchDiv)
Build the main form that should be the only form that the user interface requires
This form will be used for all discovery queries, filters, ....
|
protected void |
buildScopeList(Select scope)
Add options to the search scope field.
|
protected void |
buildSearchControls(Division div) |
protected void |
buildSearchResultsDivision(Division search)
Attach a division to the given search division named "search-results"
which contains results for this search query.
|
protected abstract String |
generateURL(Map<String,String> parameters)
Generate a URL to the given search implementation with the associated
parameters included.
|
protected abstract String |
getBasicUrl() |
protected String[] |
getFacetsList() |
protected String[] |
getFilterQueries()
Returns all the filter queries for use by solr
This method returns more expanded filter queries then the getParameterFilterQueries
|
Serializable |
getKey()
Generate the unique caching key.
|
protected int |
getParameterEtAl() |
protected Map<String,String[]> |
getParameterFilterQueries()
Returns a list of the filter queries for use in rendering pages, creating page more urls, ....
|
protected String |
getParameterGroup() |
protected String |
getParameterOrder() |
protected int |
getParameterPage() |
protected int |
getParameterRpp() |
protected String |
getParameterScope() |
protected String |
getParameterSortBy() |
protected abstract String |
getQuery()
Extract the query string.
|
protected DSpaceObject |
getScope()
Determine the current scope.
|
org.apache.excalibur.source.SourceValidity |
getValidity()
Generate the cache validity object.
|
protected void |
logSearch() |
void |
performSearch(DSpaceObject scope)
Query DSpace for a list of all items / collections / or communities that
match the given search query.
|
DiscoverQuery |
prepareQuery(DSpaceObject scope,
String query,
String[] fqs)
Prepare DiscoverQuery given the current scope and query string
|
void |
recycle()
Recycle.
|
protected void |
renderCollection(Collection collection,
DiscoverResult.DSpaceObjectHighlightResult highlightedResults,
List collectionMetadata)
Render the given collection, all collection metadata is added to the list
|
protected void |
renderCommunity(Community community,
DiscoverResult.DSpaceObjectHighlightResult highlightedResults,
List communityMetadata)
Render the given collection, all collection metadata is added to the list
|
protected void |
renderItem(List dspaceObjectsList,
Item item,
DiscoverResult.DSpaceObjectHighlightResult highlightedResults)
Render the given item, all metadata is added to the given list, which metadata will be rendered where depends on the xsl
|
protected boolean |
variableScope()
Determine if the scope of the search should fixed or is changeable by the
user.
|
addOptions, addPageMeta, addUserMeta, decodeFromURL, dispose, encodeForURL, generateURL, getComponentName, getObjectManager, handleException, setupcreateWingDocument, endDocument, endElement, endPrefixMapping, getDefaultMessageCatalogue, message, message, setupWing, startDocument, startElement, startPrefixMappingcharacters, comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntitysetConsumer, setContentHandler, setLexicalHandlerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcharacters, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntitycomment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntityprotected DiscoverResult queryResults
protected DiscoverQuery queryArgs
protected CommunityService communityService
protected CollectionService collectionService
protected ItemService itemService
protected MetadataFieldService metadataFieldService
protected MetadataExposureService metadataExposureService
protected HandleService handleService
public Serializable getKey()
getKey in interface org.apache.cocoon.caching.CacheableProcessingComponentpublic org.apache.excalibur.source.SourceValidity getValidity()
This validity object should never "over cache" because it will perform the search, and serialize the results using the DSpaceValidity object.
getValidity in interface org.apache.cocoon.caching.CacheableProcessingComponentpublic abstract void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException
addBody in interface DSpaceTransformeraddBody in interface WingTransformeraddBody in class AbstractDSpaceTransformerbody - to be added.SAXException - whenever.WingException - whenever.UIException - whenever.SQLException - whenever.IOException - whenever.AuthorizeException - whenever.protected void buildMainForm(Division searchDiv) throws WingException, SQLException
searchDiv - the division to add the form toWingException - passed through.SQLException - passed through.protected abstract String getBasicUrl() throws SQLException
SQLExceptionprotected void buildSearchResultsDivision(Division search) throws IOException, SQLException, WingException, SearchServiceException
search - The search division to contain the search-results division.IOException - passed through.SQLException - passed through.WingException - passed through.SearchServiceException - passed through.protected String addFilterQueriesToUrl(String pageURLMask) throws UIException
UIExceptionprotected void renderItem(List dspaceObjectsList, Item item, DiscoverResult.DSpaceObjectHighlightResult highlightedResults) throws WingException, SQLException
dspaceObjectsList - a list of DSpace objectsitem - the DSpace item to be renderedhighlightedResults - the highlighted resultsWingException - passed through.SQLException - Database failure in services this callsprotected void renderCollection(Collection collection, DiscoverResult.DSpaceObjectHighlightResult highlightedResults, List collectionMetadata) throws WingException
collection - the collection to be renderedhighlightedResults - the highlighted resultscollectionMetadata - list of metadata values.WingException - passed through.protected void renderCommunity(Community community, DiscoverResult.DSpaceObjectHighlightResult highlightedResults, List communityMetadata) throws WingException
community - the community to be renderedhighlightedResults - the highlighted resultscommunityMetadata - list of metadata values.WingException - passed through.protected void addMetadataField(DiscoverResult.DSpaceObjectHighlightResult highlightedResults, String metadataKey, List metadataFieldList, String value) throws WingException
highlightedResults - the highlighted resultsmetadataKey - the metadata key {schema}.{element}.{qualifier}metadataFieldList - the wing list we need to add the metadata value tovalue - the metadata valueWingException - passed through.protected void addMetadataField(List metadataFieldList, String value) throws WingException
<em></em>") tags. These will be removed and rendered as highlight WING fields.metadataFieldList - the metadata list we need to add the value to.value - the metadata value to be renderedWingException - passed through.protected void buildScopeList(Select scope) throws SQLException, WingException
The scope list will depend upon the current search scope. There are three cases:
scope - The current scope field.SQLException - passed through.WingException - passed through.public DiscoverQuery prepareQuery(DSpaceObject scope, String query, String[] fqs) throws UIException, SearchServiceException
scope - the dspace object parentquery - the query.fqs - the filter queries.UIException - passed through.SearchServiceException - passed through.public void performSearch(DSpaceObject scope) throws UIException, SearchServiceException
scope - the dspace object parentUIException - passed through.SearchServiceException - passed through.protected Map<String,String[]> getParameterFilterQueries()
protected String[] getFilterQueries()
protected String[] getFacetsList()
protected int getParameterPage()
protected int getParameterRpp()
protected String getParameterSortBy()
protected String getParameterGroup()
protected String getParameterOrder()
protected String getParameterScope()
protected int getParameterEtAl()
protected boolean variableScope()
throws SQLException
The search scope when performed by URL, i.e. they are at the URL handle/xxxx/xx/search then it is fixed. However at the global level the search is variable.
SQLException - passed through.protected abstract String getQuery() throws UIException
UIException - whenever.protected abstract String generateURL(Map<String,String> parameters) throws UIException
parameters - URL query parameters.UIException - whenever.public void recycle()
AbstractWingTransformerrecycle in interface org.apache.avalon.excalibur.pool.Recyclablerecycle in class AbstractDSpaceTransformerprotected void buildSearchControls(Division div) throws WingException, SQLException
WingExceptionSQLExceptionprotected DSpaceObject getScope() throws SQLException
SQLException - passed through.protected void logSearch()
Copyright © 2016 DuraSpace. All rights reserved.