org.sakaiproject.search.api
Interface EntityContentProducer


public interface EntityContentProducer

This is a special class than handles ContentResources for the purposes of search. This must be implemented in a thread safe way. The aim is to map the content handler to the mime type

Author:
ieb

Method Summary
 boolean canRead(String reference)
          returns true if the current user can view the search result
 Integer getAction(org.sakaiproject.event.api.Event event)
          Get the search builder action associated with the event.
 String getContainer(String ref)
           
 String getContent(String reference)
          Get the content as a string
 Reader getContentReader(String reference)
          Get a reader for the supplied content resource
 Map<String,?> getCustomProperties(String ref)
          Gets a map of custom document properties.
 String getCustomRDF(String ref)
          At the moment this is a placeholder, but eventually It will return a block of Custom RDF, that the EntityContentProducer wants the search index to index.
 String getId(String ref)
           
 Iterator<String> getSiteContentIterator(String context)
          Get the site content as an iterator
 String getSiteId(String reference)
          get the site ID from the resource Name
 String getSubType(String ref)
           
 String getTitle(String reference)
          get the title for the content
 String getTool()
          What is the name of the tool,
 String getType(String ref)
           
 String getUrl(String reference)
          Gets the url that displays the entity
 boolean isContentFromReader(String reference)
          Should the consumer use the reader or is it OK to use a memory copy of the content
 boolean isForIndex(String reference)
          If the reference should be indexed, return true
 boolean matches(org.sakaiproject.event.api.Event event)
          Is the event owned by this EntityContentProducer
 boolean matches(String reference)
          If the reference matches this EntityContentProducer return true
 

Method Detail

isContentFromReader

boolean isContentFromReader(String reference)
Should the consumer use the reader or is it OK to use a memory copy of the content

Parameters:
reference -
Returns:

getContentReader

Reader getContentReader(String reference)
Get a reader for the supplied content resource

Parameters:
reference -
Returns:

getContent

String getContent(String reference)
Get the content as a string

Parameters:
reference -
Returns:
See Also:
SearchUtils.appendCleanString(String, StringBuilder)

getTitle

String getTitle(String reference)
get the title for the content

Parameters:
reference -
Returns:

getUrl

String getUrl(String reference)
Gets the url that displays the entity

Parameters:
reference -
Returns:

matches

boolean matches(String reference)
If the reference matches this EntityContentProducer return true

Parameters:
reference -
Returns:

getAction

Integer getAction(org.sakaiproject.event.api.Event event)
Get the search builder action associated with the event.

Parameters:
event -
Returns:
One of the SearchBuilderItem constants.
See Also:
SearchBuilderItem

matches

boolean matches(org.sakaiproject.event.api.Event event)
Is the event owned by this EntityContentProducer

Parameters:
event -
Returns:

getTool

String getTool()
What is the name of the tool,

Returns:

getSiteId

String getSiteId(String reference)
get the site ID from the resource Name

Parameters:
reference -
Returns:

getSiteContentIterator

Iterator<String> getSiteContentIterator(String context)
Get the site content as an iterator

Parameters:
context -
Returns:

isForIndex

boolean isForIndex(String reference)
If the reference should be indexed, return true

Parameters:
reference -
Returns:

canRead

boolean canRead(String reference)
returns true if the current user can view the search result

Parameters:
reference -
Returns:

getCustomProperties

Map<String,?> getCustomProperties(String ref)
Gets a map of custom document properties. The names of the map map will contain the index name to which the value is added. The value is expected to be a String or String[], containing the value, values to be added. Before using this method in your entity producer, be certain that the value is not already in the index. ( See SearchService for list of Fields) If the key starts with a "T" then the index will be tokenized and the T removed to form the index name

Returns:

getCustomRDF

String getCustomRDF(String ref)
At the moment this is a placeholder, but eventually It will return a block of Custom RDF, that the EntityContentProducer wants the search index to index. This is ontop of any RDF that the search index is already processing.

Returns:

getId

String getId(String ref)
Parameters:
ref -
Returns:

getType

String getType(String ref)
Parameters:
ref -
Returns:

getSubType

String getSubType(String ref)
Parameters:
ref -
Returns:

getContainer

String getContainer(String ref)
Parameters:
ref -
Returns:


Copyright © 2003-2013 Sakai Project. All Rights Reserved.