wt.index
Class IndexAccessorConnection.IndexAccessorInner

java.lang.Object
  extended bywt.index.IndexAccessorConnection.IndexAccessorInner
All Implemented Interfaces:
IndexAccessor
Enclosing class:
IndexAccessorConnection

class IndexAccessorConnection.IndexAccessorInner
extends Object
implements IndexAccessor


Field Summary
private  BufferedOutputStream data_out
           
private  String lastItem
           
private  PrintWriter pw_out
           
 
Constructor Summary
(package private) IndexAccessorConnection.IndexAccessorInner(OutputStream an_output_stream)
           
 
Method Summary
 boolean abortIndex()
          internal
*

Supported API: false
 void beginDocument()
          Mark the beginning of an individual document
Call this method immediately after calling writeHeader
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );


Supported API: true
 void beginIndex()
          Mark the beginning of the indexing stream
Call this method immediately after calling writeHeader
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );


Supported API: true
 void endDocument()
          Mark the end of an individual document
Call this method after you are through calling writeItem and writeLob



Supported API: true
 void endIndex()
          Mark the end of the indexing stream
Call this method after you have called the final endDocument



Supported API: true
private  BufferedOutputStream getFileStream(File lob_file)
           
 boolean writeField(String field_name, String value)
          Write the value to store in field field_name.
 boolean writeFile(String name)
          internal for testing
*

Supported API: false
 void writeHeader()
          Write out the header information to the indexing stream
Call this method immediately after getting the IndexAccessor from the
IndexAccessorConnection
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );


Supported API: true
 boolean writeItem(String name, String value)
          Write the text in value out to the indexing stream and map it to the
field and/or zone that corresponds to the value of name in your formats.cfg
file.
 String writeLob(InputStream lob_stream, String contentFileName, String appOID, long fileSize, boolean isZip)
          Write the text of the stream passed to a indexing stream.
 String writeLocalLob(InputStream lob_stream, String contentFileName, String appOID, boolean isZip)
           
 boolean writeMetaData(String data)
          Write the value to store in field field_name.
 String writeRemoteLob(InputStream lob_stream, String contentFileName, String appOID, long fileSize, boolean isZip)
           
 boolean writeTokenFormat(String line)
          internal
*

Supported API: false
 boolean writeType(String name)
          Write the type of the object out to the indexing stream.
private  void writeZipFile(BufferedOutputStream lob_output_stream, InputStream lob_stream, byte[] out_array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data_out

private BufferedOutputStream data_out

lastItem

private String lastItem

pw_out

private PrintWriter pw_out
Constructor Detail

IndexAccessorConnection.IndexAccessorInner

IndexAccessorConnection.IndexAccessorInner(OutputStream an_output_stream)
                                     throws UnsupportedEncodingException
Method Detail

writeType

public boolean writeType(String name)
Description copied from interface: IndexAccessor
Write the type of the object out to the indexing stream. This needs to be done
immediately after the IndexAccessor is initialized. Note that this
type must be defined in the formats.cfg file for your collections (see Application
Developer's Guide for more details on formats.cfg).
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );
iacc.writeType( "WindchillBusinessObject" ); // this maps to a type defined in formats.cfg


Supported API: true

Specified by:
writeType in interface IndexAccessor

writeFile

public boolean writeFile(String name)
Description copied from interface: IndexAccessor
internal for testing
*

Supported API: false

Specified by:
writeFile in interface IndexAccessor

writeField

public boolean writeField(String field_name,
                          String value)
Description copied from interface: IndexAccessor
Write the value to store in field field_name. This field must exist in the library that the object is being indexed to.

Supported API: true

Specified by:
writeField in interface IndexAccessor

writeMetaData

public boolean writeMetaData(String data)
Description copied from interface: IndexAccessor
Write the value to store in field field_name. This field must exist in the library that the object is being indexed to.

Supported API: true

Specified by:
writeMetaData in interface IndexAccessor

writeItem

public boolean writeItem(String name,
                         String value)
Description copied from interface: IndexAccessor
Write the text in value out to the indexing stream and map it to the
field and/or zone that corresponds to the value of name in your formats.cfg
file. This method can be called after the writeType method is called and
before endIndex is called

Example:
// note that the strings "identity" and "customerSite" need to map to an
// item or an alias in your formats.cfg file. see above.
iacc.writeItem( "identity", cr.getIdentity( ) );
iacc.writeItem( "customerSite", cr.getSite ( ).getDisplay( locale ) );

Note that if you write multiple times to the same name within a single
indexing stream you need to manually space the items or the search results will
respond as if all these items are strung together

Example:
iacc.writeItem( "MetaData", cr.getIdentity( ) );
iacc.writeItem( "MetaData", " " + cr.getSite ( ).getDisplay( locale ) );



Supported API: true

Specified by:
writeItem in interface IndexAccessor

writeLob

public String writeLob(InputStream lob_stream,
                       String contentFileName,
                       String appOID,
                       long fileSize,
                       boolean isZip)
Description copied from interface: IndexAccessor
Write the text of the stream passed to a indexing stream. You should first verify the
type is Indexable. It would only be relevant to use this method on those classes that
are ContentHolders. This method can be called after the writeType method is called and
before endIndex is called

Example:
// note that the strings "identity" and "customerSite" need to map to an
// item or an alias in your formats.cfg file. see above.
ApplicationData appData = null;
...
if ( ContentServerHelper.service.indexable( appData ) ) {
InputStream contentStream = ContentServerHelper.service.findContentStream( appData );
if ( ( contentStream != null ) && ( contentStream.available( ) != 0 ) )
iacc.writeLob( new DataInputStream( contentStream ) );
}



Supported API: true

Specified by:
writeLob in interface IndexAccessor
See Also:
ContentHolder, ApplicationData, ContentServiceSvr

writeRemoteLob

public String writeRemoteLob(InputStream lob_stream,
                             String contentFileName,
                             String appOID,
                             long fileSize,
                             boolean isZip)

writeLocalLob

public String writeLocalLob(InputStream lob_stream,
                            String contentFileName,
                            String appOID,
                            boolean isZip)

getFileStream

private BufferedOutputStream getFileStream(File lob_file)
                                    throws IOException
Throws:
IOException

writeHeader

public void writeHeader()
                 throws IndexingException
Description copied from interface: IndexAccessor
Write out the header information to the indexing stream
Call this method immediately after getting the IndexAccessor from the
IndexAccessorConnection
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );


Supported API: true

Specified by:
writeHeader in interface IndexAccessor
Throws:
IndexingException

writeTokenFormat

public boolean writeTokenFormat(String line)
Description copied from interface: IndexAccessor
internal
*

Supported API: false

Specified by:
writeTokenFormat in interface IndexAccessor

abortIndex

public boolean abortIndex()
Description copied from interface: IndexAccessor
internal
*

Supported API: false

Specified by:
abortIndex in interface IndexAccessor

beginIndex

public void beginIndex()
                throws IndexingException
Description copied from interface: IndexAccessor
Mark the beginning of the indexing stream
Call this method immediately after calling writeHeader
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );


Supported API: true

Specified by:
beginIndex in interface IndexAccessor
Throws:
IndexingException

endIndex

public void endIndex()
              throws IndexingException
Description copied from interface: IndexAccessor
Mark the end of the indexing stream
Call this method after you have called the final endDocument



Supported API: true

Specified by:
endIndex in interface IndexAccessor
Throws:
IndexingException

beginDocument

public void beginDocument()
                   throws IndexingException
Description copied from interface: IndexAccessor
Mark the beginning of an individual document
Call this method immediately after calling writeHeader
Example:
iacc = iaccConn.getIndexAccessor();
iacc.writeHeader( );
iacc.beginIndex( );


Supported API: true

Specified by:
beginDocument in interface IndexAccessor
Throws:
IndexingException

endDocument

public void endDocument()
                 throws IndexingException
Mark the end of an individual document
Call this method after you are through calling writeItem and writeLob



Supported API: true

Specified by:
endDocument in interface IndexAccessor
Throws:
IndexingException

writeZipFile

private void writeZipFile(BufferedOutputStream lob_output_stream,
                          InputStream lob_stream,
                          byte[] out_array)
                   throws IOException
Throws:
IOException