Class TdbStringField
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Use TdbStringField(TdbRecord,TdbFieldTemplate) instead.TdbStringField
(TdbRecord parent, TdbFieldTemplate tmpl) Constructor, creates a blank instance based on the template providedTdbStringField
(TdbRecord parent, String name) Constructor, creates a blank instance based on the name providedTdbStringField
(String name) Deprecated.Use TdbStringField(TdbRecord, String) instead. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendValue
(String value) Not supported for STring fieldsvoid
appendValues
(Collection<String> value) Not supported for STring fieldsvoid
clear()
Clear state from the fieldvoid
convert
(TdbRenditionType rendition, String originalFilename, String outputDirectory, String outputFilename, String preferredAdapter, TdbTextField highlightSourceField, boolean refreshHitLocations) Render the contents of the field to HTML and write it to a file.void
copyFromFile
(String name) Copy the content of the specified file into this fieldvoid
copyToFile
(String name) Copy the current content of the field (whether rendered or not) into the named file.byte[]
getBlob()
Retrieve the current value (in total) of the field.Deprecated.Use the TextExtractionInfo class via the TdbTextField method getTextExtractionInfo() instead.int
Retrieve the size of the value in the field.Get the name of the field to retrieve property names during a text extraction operation on this STring field.Get the name of the field to retrieve property values during a text extraction operation on this STring field.Retrieve the rendition of the field that was requested during the most recent retrieval.Retrieve the type of rendition that was requested for the field during the latest retrieval.getType()
Retrieve field typegetValue
(int index) Not supported for STring fieldsint
Not supported for STring fieldsvoid
insertValue
(int index, String value) Not supported for STring fieldsvoid
insertValues
(int index, Collection<String> value) Not supported for STring fieldsboolean
Returns true if this field contains a partial value.Not supported for STring fieldsvoid
removeValue
(int index) Not supported for STring fieldsvoid
setBlob
(byte[] blob) Establish (replace) the current value of the fieldvoid
setExtractionTarget
(String name) Deprecated.Use the TextExtractionInfo class via the TdbTextField method getTextExtractionInfo() instead.void
setPropertyNameField
(String propertyNameField) Set the name of the field to retrieve property names during a text extraction operation on this STring field.void
setPropertyValueField
(String propertyValueField) Set the name of the field to retrieve property values during a text extraction operation on this STring field.void
Not supported for STring fieldstoString()
Overridevalues()
Not supported for STring fieldsMethods inherited from class com.tietoenator.trip.jxp.data.TdbField
getName, getOwnerComponent, isChanged
-
Constructor Details
-
TdbStringField
Deprecated.Use TdbStringField(TdbRecord,TdbFieldTemplate) instead.Constructor, creates a blank instance based on the template provided- Parameters:
tmpl
- Field template
-
TdbStringField
Constructor, creates a blank instance based on the template provided- Parameters:
parent
- The TdbRecord instance associated with this STRING instancetmpl
- Field template- Since:
- TRIPjxp version 2.1-3
-
TdbStringField
Deprecated.Use TdbStringField(TdbRecord, String) instead.Constructor, creates a blank instance based on the name provided- Parameters:
name
- Name of field
-
TdbStringField
Constructor, creates a blank instance based on the name provided- Parameters:
parent
- The TdbRecord instance associated with this STRING instancename
- Name of field- Since:
- TRIPjxp version 2.1-3
-
-
Method Details
-
originalValues
Not supported for STring fields- Specified by:
originalValues
in classTdbField
- Returns:
- N/A
- Throws:
TdbException
-
values
Not supported for STring fields- Specified by:
values
in classTdbField
- Returns:
- N/A
- Throws:
TdbException
-
getType
Retrieve field type -
getFieldSize
public int getFieldSize()Retrieve the size of the value in the field.This method causes network I/O if connected to TRIP version 6.2-9:7 or later and the string field value has not yet been accessed.
- Specified by:
getFieldSize
in classTdbField
- Returns:
- Total size of the contents of the field.
- See Also:
-
isPartial
public boolean isPartial()Returns true if this field contains a partial value. -
getBlob
Retrieve the current value (in total) of the field.From TRIPsystem version 6.2-9:7, STRING values are transferred on demand only. The benefit is that records can be quickly retrieved even if they hold over 100 MB of binary data. When this property is accessed, the field data is requested from the server and transported to the client in 2MB chunks. This lowers the overall resource consumption requirements on both server and client and reduces the total transfer time for the record data.
- Returns:
- The current field's value
- Throws:
TdbException
- if the field is not in original (un-rendered) format
-
setBlob
public void setBlob(byte[] blob) Establish (replace) the current value of the field- Parameters:
blob
- The new value the field should contain
-
getRenditionType
Retrieve the type of rendition that was requested for the field during the latest retrieval. If the field has been modified using setBlob(), the rendition will be reset to DefaultRendition regardless of what rendition, if any, was requested during the latest fetch operation.- Returns:
- A rendition type (can be DefaultRendition)
-
getRendition
Retrieve the rendition of the field that was requested during the most recent retrieval. If no such rendition was requested, use getBlob() to retrieve the field's content.- Returns:
- The rendition of the field that was performed during the most recent retrieval request.
- Throws:
TdbException
- if the field is in original (un-rendered) format.
-
setExtractionTarget
Deprecated.Use the TextExtractionInfo class via the TdbTextField method getTextExtractionInfo() instead.Establish the name of the TExt field with which any text extraction operations on this STring field are to be associated.- Parameters:
name
- The name of a TExt field from the same database- Throws:
TdbException
- if the name provided is invalid
-
getExtractionTarget
Deprecated.Use the TextExtractionInfo class via the TdbTextField method getTextExtractionInfo() instead.Retrieve the name of any TExt field that has been established as the target for any extraction operations performed on this field's content.- Returns:
- The name of the associated text field, if any.
-
getPropertyNameField
Get the name of the field to retrieve property names during a text extraction operation on this STring field.- Returns:
- The name of the associated phrase field, if any.
-
setPropertyNameField
Set the name of the field to retrieve property names during a text extraction operation on this STring field. -
getPropertyValueField
Get the name of the field to retrieve property values during a text extraction operation on this STring field.- Returns:
- The name of the associated phrase field, if any.
-
setPropertyValueField
Set the name of the field to retrieve property values during a text extraction operation on this STring field. -
getValue
Not supported for STring fields- Specified by:
getValue
in classTdbField
- Parameters:
index
-- Returns:
- N/A
- Throws:
TdbException
-
setValue
Not supported for STring fields- Specified by:
setValue
in classTdbField
- Parameters:
index
-value
-- Throws:
TdbException
-
appendValue
Not supported for STring fields- Specified by:
appendValue
in classTdbField
- Parameters:
value
-- Throws:
TdbException
-
appendValues
Not supported for STring fields- Specified by:
appendValues
in classTdbField
- Parameters:
value
-- Throws:
TdbException
-
getValueCount
Not supported for STring fields- Specified by:
getValueCount
in classTdbField
- Returns:
- Number of subfields or paragraphs in the field.
- Throws:
TdbException
-
insertValue
Not supported for STring fields- Specified by:
insertValue
in classTdbField
- Parameters:
index
- Zero-based index at which to insert the new subfield or paragraph.value
- The value to insert into the field.- Throws:
TdbException
-
insertValues
Not supported for STring fields- Specified by:
insertValues
in classTdbField
- Parameters:
index
- Zero-based index at which to insert the new subfields or paragraphs.value
- The value to insert into the field.- Throws:
TdbException
-
removeValue
Not supported for STring fields- Specified by:
removeValue
in classTdbField
- Parameters:
index
- Zero-based index from which to remove a subfield or paragraph.- Throws:
TdbException
-
clear
public void clear()Clear state from the field -
convert
public void convert(TdbRenditionType rendition, String originalFilename, String outputDirectory, String outputFilename, String preferredAdapter, TdbTextField highlightSourceField, boolean refreshHitLocations) throws TdbException, IOException Render the contents of the field to HTML and write it to a file.- Parameters:
rendition
- How to render the string field contentsoriginalFilename
- The name of the file stored in this string fieldoutputDirectory
- Directory in which to put the generated file(s)outputFilename
- Name of file to which to write the field's contentpreferredAdapter
- OPTIONAL name of the TRIPcof file filter adapter to use (not used with TRIPview-C)highlightSourceField
- OPTIONAL field object for the text field from which to get hit highlighting (pass null for no hit highlighting).refreshHitLocations
- Pass true (strongly recommended) in order to refresh the hit locations prior to performing the HTML conversion (pass null or empty string to let TRIPcof/TRIPview-C decide which adapter to use).The use of this method requires a local installation of TRIPcof or TRIPview-C.
If TRIPcof is used, its installation directory must be specified as either a system property with the name TRIPCOF_HOME, or an environment variable with the name TRIPCOF_HOME.
If TRIPview-C is used, its installation directory must be specified as either a system property with the name TRIPVIEW_HOME, or an environment variable with the name TRIPVIEW_HOME.
This method performs client-side HTML conversion. This requires that the string field value has been fetched from the server without a rendition specification (use a normal TdbFieldTemplate or a TdbRendition with DefaultRendition as the rendition type). When the string value has been fetched, call this method with a HTML-specific rendition type - either BasicHTML or MimeEncodedHtml.
Note that the rendition type BasicHTML may generate any number of graphic files for the images in the document. These files will be put in the same directory with the generated HTML file. Be sure to specify the filename argument so that it is easy to clean up these files when they are no longer needed.
Hit highlighting is supported when the associated search set has been created by a FIND or FUZZ CCL order with either the TdbCclCommand class or the TdbSearch class. The TdbRecordSet class is only supported if a pre-existing search order is supplied to it. Using the query capability of the TdbRecordSet class itself is not supported because such search sets are automatically deleted before the data is returned to the client.
In order to generate an HTML file where search hits are highlighted, supply the text field object to the highlightSourceField parameter. This text field must contain the extracted document text. If TRIPview-C is used, the document should have been processed with TRIPview-C for text extraction. Doing otherwise may result in hit highlighting at invalid or incorrect locations in the text.
The refreshHitLocations parameter should be set to true when you are using HTML conversion with hit highlighting together with TRIPview-C. Assigning this parameter to false may result in incorrect offset values to hit words. This is because fill characters produced during text extraction may differ from version to version. Setting this parameter to true results in extra network I/O. This parameter must be set to false if TRIPcof is used.
To produce an HTML document without hit highlighting, pass null to the highlightSourceField parameter.
For server-side conversion, add a TdbRendition or TdbHighlightRendition instance as field template to the retrieval template instead of a normal TdbFieldTemplate. Then use the file CopyToFile to store the rendered data to a local file, or access it using the Rendition property.
If TRIPcof is used and logging is enabled in the fifiase.conf configuration file, the directory specified by the AseLogDirectory property in that file must be writable by the operating system user who runs the TRIPjxp application. If the directory is not writable, no log file will be produced by TRIPcof.
Requesting an HTML conversion with hit highlighting results in network I/O.
- Throws:
TdbException
IOException
-
copyFromFile
Copy the content of the specified file into this field- Parameters:
name
- Name of file to read- Throws:
IOException
TdbException
- if the file specified is invalid
-
copyToFile
Copy the current content of the field (whether rendered or not) into the named file. If the field currently contains rendered content, that rendition will be written using the UTF-8 character set.- Parameters:
name
- Name of file into which to copy content of field- Throws:
IOException
-
toString
Override
-