Class TdbFieldTemplate
- Direct Known Subclasses:
TdbRendition
-
Constructor Summary
ConstructorsConstructorDescriptionTdbFieldTemplate
(String name) Constructor, create a simple template fieldTdbFieldTemplate
(String name, boolean focusOrExtract, boolean summary, int hint) Deprecated.This method will removed in the next major release.TdbFieldTemplate
(String name, TdbFieldFetchType mode, int hint) Constructor, create a fully specified template field.TdbFieldTemplate
(String fieldName, String baseName) Constructor, create a simple template field -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset the template to a default stateRetrieve the string that is to be inserted after query hits when deserializing a record using the TdbRecord class.Retrieve the name of the base referenced by this templateRetrieve the string that is to be inserted before query hits when deserializing a record using the TdbRecord class.Return an indication of what to fetch from the field.boolean
Get whether the field's content should be retrieved.Returns the fetch option for the field.getName()
Retrieve the name of the field referenced by this templateint
Retrieve any size hint that has been established for the retrieval templateboolean
Deprecated.This method will removed in the next major release.boolean
Deprecated.This method will removed in the next major release.void
setAfterHits
(String after) Establish the suffix string that will be inserted after query hits when deserializing using the TdbRecord class.void
setBaseName
(String baseName) Set the name of the base to be referenced by this templatevoid
setBeforeHits
(String before) Establish the prefix string that will be inserted before query hits when deserializing using the TdbRecord class.void
Specify what to fetch from the field.void
setFieldContent
(boolean fetchContent) Set whether the field's content should be retrieved.void
Assign the fetch option for the field.void
setFocused
(boolean focus) Deprecated.This method will removed in the next major release.void
Set the name of the field to be referenced by this templatevoid
setSizeHint
(int hint) Set the size hint for the retrieval templatevoid
setSummarized
(boolean summ) Deprecated.This method will removed in the next major release.void
setSurroundHits
(String markup) Set the symmetric string that should be inserted both before and after query hits when retrieving field values from a query result.
-
Constructor Details
-
TdbFieldTemplate
Constructor, create a fully specified template field.- Parameters:
name
- Name of field to be retrievedmode
- Specifies what to fetch from the field. Only used for TEXT fields - ignored for all other field types.hint
- If mode specifies to summarize, extract or focus from a TEXT field, this is a size hint for how much information the application wishes to retrieve.
-
TdbFieldTemplate
Deprecated.This method will removed in the next major release.Constructor, create a fully specified template field.The focusOrExtract parameter controls the so-called Keyword-In-Context (KWIC) feature of TRIP. Similar to a TRIPclassic-style SHOW FOCUS, the KWIC will retrieve hits with some surrounding text. However, an important difference is that if a keyword-in-context extract is requested from a field without any hits, text will still be extracted from the field. In this case, up to approximately hint characters will be extracted from the first paragraph of the field.
- Parameters:
name
- Name of field to be retrievedfocusOrExtract
- Should the field be focused on search hits?summary
- Should the field be summarized?hint
- If summarized or focused, this is a size hint for how much information the application wishes to retrieve
-
TdbFieldTemplate
Constructor, create a simple template field- Parameters:
name
- Name of the field to retrieve
-
TdbFieldTemplate
Constructor, create a simple template field- Parameters:
fieldName
- Name of the field to retrievebaseName
- Name of the base where the field is defined
-
-
Method Details
-
getName
Retrieve the name of the field referenced by this template- Returns:
- The field name
-
setName
Set the name of the field to be referenced by this template- Parameters:
name
- The field name
-
getBaseName
Retrieve the name of the base referenced by this template- Returns:
- The base name
-
setBaseName
Set the name of the base to be referenced by this template- Parameters:
baseName
- The base name
-
getFetchType
Return an indication of what to fetch from the field. -
setFetchType
Specify what to fetch from the field.- Parameters:
mode
- Specifies what to fetch from the field. Only used for TEXT fields - ignored for all other field types.
-
isFocused
Deprecated.This method will removed in the next major release.Check if the field template requests a focused retrieval, ie hit terms in context.This controls the so-called Keyword-In-Context (KWIC) feature of TRIP. Similar to a TRIPclassic-style SHOW FOCUS, the KWIC will retrieve hits with some surrounding text. However, an important difference is that if a keyword-in-context extract is requested from a field without any hits, text will still be extracted from the field. In this case, up to approximately hint characters will be extracted from the first paragraph of the field.
- Returns:
- true if the field template requests focused retrieval
-
setFocused
Deprecated.This method will removed in the next major release.Establish the field template request as focused or not.This controls the so-called Keyword-In-Context (KWIC) feature of TRIP. Similar to a TRIPclassic-style SHOW FOCUS, the KWIC will retrieve hits with some surrounding text. However, an important difference is that if a keyword-in-context extract is requested from a field without any hits, text will still be extracted from the field. In this case, up to approximately hint characters will be extracted from the first paragraph of the field.
- Parameters:
focus
- If true, any retrieval requests made using this template will use hit term in context retrieval
-
isSummarized
Deprecated.This method will removed in the next major release.Check if the field template requests the field to be summarized- Returns:
- true if the field template requests the field to be summarized
-
setSummarized
Deprecated.This method will removed in the next major release.Establish the summarization parameter for the field template- Parameters:
summ
- If true, any retrieval requests made using this template will use summarization on the field's content
-
getSizeHint
public int getSizeHint()Retrieve any size hint that has been established for the retrieval template- Returns:
- If the field is either to be focused or summarized, the size hint is used by the server to establish a minimum number of characters to retrieve.
-
setSizeHint
public void setSizeHint(int hint) Set the size hint for the retrieval template- Parameters:
hint
- If the field is either to be focused or summarized, the size hint is used by the server to establish a minimum number of characters to retrieve.
-
getBeforeHits
Retrieve the string that is to be inserted before query hits when deserializing a record using the TdbRecord class.- Returns:
- Any hit prefix that has been established
-
setBeforeHits
Establish the prefix string that will be inserted before query hits when deserializing using the TdbRecord class.- Parameters:
before
- The prefix string
-
getAfterHits
Retrieve the string that is to be inserted after query hits when deserializing a record using the TdbRecord class.- Returns:
- Any hit suffix that has been established
-
setAfterHits
Establish the suffix string that will be inserted after query hits when deserializing using the TdbRecord class.- Parameters:
after
- The suffix string
-
setSurroundHits
Set the symmetric string that should be inserted both before and after query hits when retrieving field values from a query result.
This property assumes symmetric insertion, i.e. the same string inserted both before and after each hit point. If the calling application needs asymmetric insertion, i.e. different Strings before and after query hits, use the methods setBeforeHits() and setAfterHits() instead.- Parameters:
markup
- The string that will be used to both prefix and suffix query hits
-
getFieldContent
public boolean getFieldContent()Get whether the field's content should be retrieved. -
setFieldContent
public void setFieldContent(boolean fetchContent) Set whether the field's content should be retrieved.In order to only get the size of the data in the field, set this property to false. You will be able to access the size via the TdbField.getFieldSize() method, even if the TdbField object in question does not contain the actual value.
This property is ignored unless the TRIPsystem version used is 6.2-0 or later.
Setting this property to false also causes the any previously specified summary, focus (KWIC) or extract to be disabled. Assigning false to this property is equal to assigning TdbFieldFetchType.NoValue to the FetchType property (the setFetchType setter method).
- Parameters:
fetchContent
- Pass false to disable retrieval of field content.
-
getFieldFetchOption
Returns the fetch option for the field.- Returns:
- the TdbFieldFetchOption
-
setFieldFetchOption
Assign the fetch option for the field.- Parameters:
option
- The fetch option to set
-
clear
public void clear()Reset the template to a default state
-