Package com.tietoenator.trip.jxp.data

# Class TdbStringField

java.lang.Object
com.tietoenator.trip.jxp.data.TdbField
com.tietoenator.trip.jxp.data.TdbStringField

All Implemented Interfaces:
  `com.tietoenator.trip.jxp.internal.utils.DOMSink`

public class TdbStringField extends TdbField
Container for values in a STring field

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TdbStringField(TdbFieldTemplate tmpl)`
  Deprecated.
  Use TdbStringField(TdbRecord,TdbFieldTemplate) instead.
  `TdbStringField(TdbRecord parent, TdbFieldTemplate tmpl)`
  Constructor, creates a blank instance based on the template provided
  `TdbStringField(TdbRecord parent, String name)`
  Constructor, creates a blank instance based on the name provided
  `TdbStringField(String name)`
  Deprecated.
  Use TdbStringField(TdbRecord, String) instead.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `appendValue(String value)`
  Not supported for STring fields
  `void`
  `appendValues(Collection<String> value)`
  Not supported for STring fields
  `void`
  `clear()`
  Clear state from the field
  `void`
  `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 field
  `void`
  `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.
  `String`
  `getExtractionTarget()`
  Deprecated.
  Use the TextExtractionInfo class via the TdbTextField method getTextExtractionInfo() instead.
  `int`
  `getFieldSize()`
  Retrieve the size of the value in the field.
  `String`
  `getPropertyNameField()`
  Get the name of the field to retrieve property names during a text extraction operation on this STring field.
  `String`
  `getPropertyValueField()`
  Get the name of the field to retrieve property values during a text extraction operation on this STring field.
  `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
  `String`
  `getValue(int index)`
  Not supported for STring fields
  `int`
  `getValueCount()`
  Not supported for STring fields
  `void`
  `insertValue(int index, String value)`
  Not supported for STring fields
  `void`
  `insertValues(int index, Collection<String> value)`
  Not supported for STring fields
  `boolean`
  `isPartial()`
  Returns true if this field contains a partial value.
  `List<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(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`
  `setValue(int index, String value)`
  Not supported for STring fields
  `String`
  `toString()`
  Override
  `List<String>`
  `values()`
  Not supported for STring fields

  ### Methods inherited from class com.tietoenator.trip.jxp.data.TdbField

  `getName, getOwnerComponent, isChanged`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### TdbStringField

    @Deprecated public TdbStringField(TdbFieldTemplate tmpl)
    Deprecated.
    Use TdbStringField(TdbRecord,TdbFieldTemplate) instead.
    Constructor, creates a blank instance based on the template provided
    Parameters:
      `tmpl` - Field template

  - ### TdbStringField

    public TdbStringField(TdbRecord parent, TdbFieldTemplate tmpl)
    Constructor, creates a blank instance based on the template provided
    Parameters:
      `parent` - The TdbRecord instance associated with this STRING instance
      `tmpl` - Field template
    Since:
      TRIPjxp version 2.1-3

  - ### TdbStringField

    @Deprecated public TdbStringField(String name)
    Deprecated.
    Use TdbStringField(TdbRecord, String) instead.
    Constructor, creates a blank instance based on the name provided
    Parameters:
      `name` - Name of field

  - ### TdbStringField

    public TdbStringField(TdbRecord parent, String name)
    Constructor, creates a blank instance based on the name provided
    Parameters:
      `parent` - The TdbRecord instance associated with this STRING instance
      `name` - Name of field
    Since:
      TRIPjxp version 2.1-3

- ## Method Details

  - ### originalValues

    public List<String> originalValues() throws TdbException
    Not supported for STring fields
    Specified by:
      `originalValues` in class `TdbField`
    Returns:
      N/A
    Throws:
      `TdbException`

  - ### values

    public List<String> values() throws TdbException
    Not supported for STring fields
    Specified by:
      `values` in class `TdbField`
    Returns:
      N/A
    Throws:
      `TdbException`

  - ### getType

    public TdbFieldType getType()
    Retrieve field type
    Specified by:
      `getType` in class `TdbField`
    Returns:
      StringField

  - ### 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 class `TdbField`
    Returns:
      Total size of the contents of the field.
    See Also:
      - `TdbField.getFieldSize()`

  - ### isPartial

    public boolean isPartial()
    Returns true if this field contains a partial value.
    Specified by:
      `isPartial` in class `TdbField`
    Returns:
      True if the value is partial
    See Also:
      - `TdbField.isPartial()`

  - ### getBlob

    public byte[] getBlob() throws TdbException
    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

    public TdbRenditionType 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

    public String getRendition() throws TdbException
    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 public void setExtractionTarget(String name) throws TdbException
    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 public String 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

    public String 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

    public void setPropertyNameField(String propertyNameField)
    Set the name of the field to retrieve property names during a text extraction operation on this STring field.

  - ### getPropertyValueField

    public String 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

    public void setPropertyValueField(String propertyValueField)
    Set the name of the field to retrieve property values during a text extraction operation on this STring field.

  - ### getValue

    public String getValue(int index) throws TdbException
    Not supported for STring fields
    Specified by:
      `getValue` in class `TdbField`
    Parameters:
      `index` -
    Returns:
      N/A
    Throws:
      `TdbException`

  - ### setValue

    public void setValue(int index, String value) throws TdbException
    Not supported for STring fields
    Specified by:
      `setValue` in class `TdbField`
    Parameters:
      `index` -
      `value` -
    Throws:
      `TdbException`

  - ### appendValue

    public void appendValue(String value) throws TdbException
    Not supported for STring fields
    Specified by:
      `appendValue` in class `TdbField`
    Parameters:
      `value` -
    Throws:
      `TdbException`

  - ### appendValues

    public void appendValues(Collection<String> value) throws TdbException
    Not supported for STring fields
    Specified by:
      `appendValues` in class `TdbField`
    Parameters:
      `value` -
    Throws:
      `TdbException`

  - ### getValueCount

    public int getValueCount() throws TdbException
    Not supported for STring fields
    Specified by:
      `getValueCount` in class `TdbField`
    Returns:
      Number of subfields or paragraphs in the field.
    Throws:
      `TdbException`

  - ### insertValue

    public void insertValue(int index, String value) throws TdbException
    Not supported for STring fields
    Specified by:
      `insertValue` in class `TdbField`
    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

    public void insertValues(int index, Collection<String> value) throws TdbException
    Not supported for STring fields
    Specified by:
      `insertValues` in class `TdbField`
    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

    public void removeValue(int index) throws TdbException
    Not supported for STring fields
    Specified by:
      `removeValue` in class `TdbField`
    Parameters:
      `index` - Zero-based index from which to remove a subfield or paragraph.
    Throws:
      `TdbException`

  - ### clear

    public void clear()
    Clear state from the field
    Specified by:
      `clear` in class `TdbField`

  - ### 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 contents
      `originalFilename` - The name of the file stored in this string field
      `outputDirectory` - Directory in which to put the generated file(s)
      `outputFilename` - Name of file to which to write the field's content
      `preferredAdapter` - 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

    public void copyFromFile(String name) throws IOException, TdbException
    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

    public void copyToFile(String name) throws IOException
    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

    public String toString()
    Override
    Specified by:
      `toString` in class `TdbField`
    Returns:
      string representation