ContentTemplate.Builder

public static class ContentTemplate.Builder extends Object

Public Constructor Summary

Public Method Summary

ContentTemplate
build()
Gets the generated HTML template based on the passed field data.
ContentTemplate.Builder
setHighContent(List<String> highFields)
Adds high priority content fields.
ContentTemplate.Builder
setIncludeFieldName(boolean include)
Determines whether to include the field name within the content for that field.
ContentTemplate.Builder
setLowContent(List<String> lowFields)
Adds low priority content fields.
ContentTemplate.Builder
setMediumContent(List<String> mediumFields)
Adds medium priority content fields.
ContentTemplate.Builder
setTitle(String title)
Sets the "title" of the HTML.
ContentTemplate.Builder
setUnmappedColumnMode(ContentTemplate.UnmappedColumnsMode mode)
Sets the mode (APPEND or IGNORE) for unmapped columns.

Inherited Method Summary

Public Constructors

public ContentTemplate.Builder ()

Public Methods

public ContentTemplate build ()

Gets the generated HTML template based on the passed field data.

After building the template, merge the content fields into a single array to simplify template substitution in apply(Map).

Returns
  • HTML template

public ContentTemplate.Builder setHighContent (List<String> highFields)

Adds high priority content fields.

Parameters
highFields the field names
Returns
  • builder

public ContentTemplate.Builder setIncludeFieldName (boolean include)

Determines whether to include the field name within the content for that field.

If set to true (default), the format in the content will be "field:value" instead of just "value". This may be desirable for search results, but may not be desired if the field name is different from the field's repository display name or is not descriptive to the user.

Parameters
include true to include field name in content.
Returns
  • builder

public ContentTemplate.Builder setLowContent (List<String> lowFields)

Adds low priority content fields.

Parameters
lowFields the field names
Returns
  • builder

public ContentTemplate.Builder setMediumContent (List<String> mediumFields)

Adds medium priority content fields.

Parameters
mediumFields the field names
Returns
  • builder

public ContentTemplate.Builder setTitle (String title)

Sets the "title" of the HTML. This will be the highest priority for indexing.

Parameters
title main HTML title
Returns
  • builder

public ContentTemplate.Builder setUnmappedColumnMode (ContentTemplate.UnmappedColumnsMode mode)

Sets the mode (APPEND or IGNORE) for unmapped columns.

Parameters
mode UnmappedColumnsMode
Returns
  • builder