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 Detail

      • isContentFromReader

        default 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

        default Reader getContentReader​(String reference)
        Get a reader for the supplied content resource
        Parameters:
        reference -
        Returns:
      • getTitle

        default String getTitle​(String reference)
        get the title for the content
        Parameters:
        reference -
        Returns:
      • getUrl

        default String getUrl​(String reference)
        Gets the url that displays the entity
        Parameters:
        reference -
        Returns:
      • getUrl

        default String getUrl​(String reference,
                              org.sakaiproject.entity.api.Entity.UrlType urlType)
        Gets the url that displays the entity. You can specify a UrlType depending on what kind of link you want.
        Parameters:
        reference -
        EntityUrlType -
        Returns:
        The url as a String
      • matches

        default boolean matches​(String reference)
        If the reference matches this EntityContentProducer return true
        Parameters:
        reference -
        Returns:
      • getAction

        default 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

        default boolean matches​(org.sakaiproject.event.api.Event event)
        Is the event owned by this EntityContentProducer
        Parameters:
        event -
        Returns:
      • getTool

        default String getTool()
        What is the name of the tool,
        Returns:
      • getSiteId

        default String getSiteId​(String reference)
        get the site ID from the resource Name
        Parameters:
        reference -
        Returns:
        the site ID or null if a site ID is not present or this provider does not manage site-specific content
      • getCreatorDisplayName

        default String getCreatorDisplayName​(String reference)
        Get the display name of the resource creator
        Parameters:
        reference -
        Returns:
        the display name or "" if this provider does not support it
      • getCreatorId

        default String getCreatorId​(String reference)
        Get the user id of the resource creator
        Parameters:
        reference -
        Returns:
        the user id or "" if this provider does not support it
      • getCreatorUserName

        default String getCreatorUserName​(String reference)
        Get the user name of the resource creator
        Parameters:
        reference -
        Returns:
        the user name or "" if this provider does not support it
      • getSiteContentIterator

        default Iterator<String> getSiteContentIterator​(String context)
        Get the site content as an iterator
        Parameters:
        context -
        Returns:
        an iterator over all content associted with the given site ID, or an empty iterator if this provider does not manage site-specific content
      • isForIndex

        default boolean isForIndex​(String reference)
        If the reference should be indexed, return true
        Parameters:
        reference -
        Returns:
      • canRead

        default boolean canRead​(String reference)
        returns true if the current user can view the search result
        Parameters:
        reference -
        Returns:
      • getCustomProperties

        default 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

        default 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:
      • getContainer

        default String getContainer​(String ref)