public class TdbStringField extends TdbField
Constructor and Description |
---|
TdbStringField(java.lang.String name)
Deprecated.
Use TdbStringField(TdbRecord, String) instead.
|
TdbStringField(TdbFieldTemplate tmpl)
Deprecated.
Use TdbStringField(TdbRecord,TdbFieldTemplate) instead.
|
TdbStringField(TdbRecord parent,
java.lang.String name)
Constructor, creates a blank instance based on the name provided
|
TdbStringField(TdbRecord parent,
TdbFieldTemplate tmpl)
Constructor, creates a blank instance based on the template provided
|
Modifier and Type | Method and Description |
---|---|
void |
appendValue(java.lang.String value)
Not supported for STring fields
|
void |
appendValues(java.util.Collection<java.lang.String> value)
Not supported for STring fields
|
void |
clear()
Clear state from the field
|
void |
convert(TdbRenditionType rendition,
java.lang.String originalFilename,
java.lang.String outputDirectory,
java.lang.String outputFilename,
java.lang.String preferredAdapter,
TdbTextField highlightSourceField,
boolean refreshHitLocations)
Render the contents of the field to HTML and write it to a file.
|
void |
copyFromFile(java.lang.String name)
Copy the content of the specified file into this field
|
void |
copyToFile(java.lang.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.
|
java.lang.String |
getExtractionTarget()
Deprecated.
Use the TextExtractionInfo class via the TdbTextField method
getTextExtractionInfo() instead.
|
int |
getFieldSize()
Retrieve the size of the value in the field.
|
java.lang.String |
getPropertyNameField()
Get the name of the field to retrieve property names during a text
extraction operation on this STring field.
|
java.lang.String |
getPropertyValueField()
Get the name of the field to retrieve property values during a text
extraction operation on this STring field.
|
java.lang.String |
getRendition()
Retrieve the rendition of the field that was requested during the most
recent retrieval.
|
TdbRenditionType |
getRenditionType()
Retrieve the type of rendition that was requested for the field during
the latest retrieval.
|
TdbFieldType |
getType()
Retrieve field type
|
java.lang.String |
getValue(int index)
Not supported for STring fields
|
int |
getValueCount()
Not supported for STring fields
|
void |
insertValue(int index,
java.lang.String value)
Not supported for STring fields
|
void |
insertValues(int index,
java.util.Collection<java.lang.String> value)
Not supported for STring fields
|
boolean |
isPartial()
Returns true if this field contains a partial value.
|
java.util.List<java.lang.String> |
originalValues()
Not supported for STring fields
|
void |
removeValue(int index)
Not supported for STring fields
|
void |
setBlob(byte[] blob)
Establish (replace) the current value of the field
|
void |
setExtractionTarget(java.lang.String name)
Deprecated.
Use the TextExtractionInfo class via the TdbTextField method
getTextExtractionInfo() instead.
|
void |
setPropertyNameField(java.lang.String propertyNameField)
Set the name of the field to retrieve property names during a text
extraction operation on this STring field.
|
void |
setPropertyValueField(java.lang.String propertyValueField)
Set the name of the field to retrieve property values during a text
extraction operation on this STring field.
|
void |
setValue(int index,
java.lang.String value)
Not supported for STring fields
|
java.lang.String |
toString()
Override
|
java.util.List<java.lang.String> |
values()
Not supported for STring fields
|
getName, getOwnerComponent, isChanged
@Deprecated public TdbStringField(TdbFieldTemplate tmpl)
tmpl
- Field templatepublic TdbStringField(TdbRecord parent, TdbFieldTemplate tmpl)
parent
- The TdbRecord instance associated with this STRING instancetmpl
- Field template@Deprecated public TdbStringField(java.lang.String name)
name
- Name of fieldpublic TdbStringField(TdbRecord parent, java.lang.String name)
parent
- The TdbRecord instance associated with this STRING instancename
- Name of fieldpublic java.util.List<java.lang.String> originalValues() throws TdbException
originalValues
in class TdbField
TdbException
public java.util.List<java.lang.String> values() throws TdbException
values
in class TdbField
TdbException
public TdbFieldType getType()
public int getFieldSize()
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.
getFieldSize
in class TdbField
TdbField.getFieldSize()
public boolean isPartial()
isPartial
in class TdbField
TdbField.isPartial()
public byte[] getBlob() throws TdbException
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.
TdbException
- if the field is not in original (un-rendered) formatpublic void setBlob(byte[] blob)
blob
- The new value the field should containpublic TdbRenditionType getRenditionType()
public java.lang.String getRendition() throws TdbException
TdbException
- if the field is in original (un-rendered) format.@Deprecated public void setExtractionTarget(java.lang.String name) throws TdbException
name
- The name of a TExt field from the same databaseTdbException
- if the name provided is invalid@Deprecated public java.lang.String getExtractionTarget()
public java.lang.String getPropertyNameField()
public void setPropertyNameField(java.lang.String propertyNameField)
public java.lang.String getPropertyValueField()
public void setPropertyValueField(java.lang.String propertyValueField)
public java.lang.String getValue(int index) throws TdbException
getValue
in class TdbField
index
- TdbException
public void setValue(int index, java.lang.String value) throws TdbException
setValue
in class TdbField
index
- value
- TdbException
public void appendValue(java.lang.String value) throws TdbException
appendValue
in class TdbField
value
- TdbException
public void appendValues(java.util.Collection<java.lang.String> value) throws TdbException
appendValues
in class TdbField
value
- TdbException
public int getValueCount() throws TdbException
getValueCount
in class TdbField
TdbException
public void insertValue(int index, java.lang.String value) throws TdbException
insertValue
in class TdbField
index
- Zero-based index at which to insert the new subfield or paragraph.value
- The value to insert into the field.TdbException
public void insertValues(int index, java.util.Collection<java.lang.String> value) throws TdbException
insertValues
in class TdbField
index
- Zero-based index at which to insert the new subfields or paragraphs.value
- The value to insert into the field.TdbException
public void removeValue(int index) throws TdbException
removeValue
in class TdbField
index
- Zero-based index from which to remove a subfield or paragraph.TdbException
public void convert(TdbRenditionType rendition, java.lang.String originalFilename, java.lang.String outputDirectory, java.lang.String outputFilename, java.lang.String preferredAdapter, TdbTextField highlightSourceField, boolean refreshHitLocations) throws TdbException, java.io.IOException
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.
TdbException
java.io.IOException
public void copyFromFile(java.lang.String name) throws java.io.IOException, TdbException
name
- Name of file to readjava.io.IOException
TdbException
- if the file specified is invalidpublic void copyToFile(java.lang.String name) throws java.io.IOException
name
- Name of file into which to copy content of fieldjava.io.IOException