com.ibm.edms.od
Class ODFolder

java.lang.Object
  |
  +--com.ibm.edms.od.ODCallback
        |
        +--com.ibm.edms.od.ODFolder

public class ODFolder
extends ODCallback

A class representing an OnDemand folder. This object is returned from a successful call to ODServer.openFolder(). It contains folder criteria information. These criteria objects are what need to be modified in order to narrow the query on the server.

(C) Copyright IBM Corp. 1993, 2002. All Rights Reserved


Method Summary
 boolean addHit(java.lang.String id, char type, java.lang.String[] values)
          This method should be used to selectively add hits to the ODFolder's workin set of hits.
 void close()
          This method will close the folder.
 boolean DataCallback(byte[] data)
          Not for public use.
 java.util.Enumeration getCriteria()
          Get the search criteria for this folder.
 ODCriteria getCriteria(java.lang.String name)
          Get criteria object for the specified criteria name.
 java.lang.String getDescription()
          The description of the folder.
 java.lang.String[] getDisplayOrder()
          Get the display order for the folder's criteria.
 java.util.Vector getHits()
          Return the hits obtained from the last search method call.
 java.lang.String getName()
          The name of the folder.
 int getNumCriteria()
          Get the number of search criteria for this folder.
 java.lang.String getSearchMessage()
          Message returned from server during search operation.
 boolean HitCallback(java.lang.String id, char type, java.lang.String[] values)
          Not for public use.
 void HitHandleCallback(int hit, int off, int len)
          Not for public use.
 void open()
          This method will open the folder.
 void printDocs(java.util.Vector hits, java.lang.String printer)
          Print the specified hits from this folder.
 void retrieve(ODCallback odCallback)
          This method will retrieve the current hits, i.e., those returned from the last successful search method call.
 void retrieve(java.lang.String[] ids, ODCallback odCallback)
          This method will retrieve the specified documents from this folder.
 void retrieve(java.util.Vector hits, ODCallback odCallback)
          This method will retrieve the specified hits from this folder.
 java.util.Vector search()
          This method will search the folder.
 java.util.Vector search(ODCallback odCallback)
          This method will search the folder.
 java.util.Vector search(java.lang.String sql)
          This method will search the folder.
 java.util.Vector search(java.lang.String sql, ODCallback cb)
          If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs.
 java.util.Vector search(java.lang.String sql, java.lang.String date1, java.lang.String date2)
          This method will search the folder.
 java.util.Vector search(java.lang.String sql, java.lang.String date1, java.lang.String date2, ODCallback cb)
          If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs.
 java.util.Vector search(java.lang.String sql, java.lang.String date1, java.lang.String date2, java.lang.String dateFmt)
          This method will search the folder.
 java.util.Vector search(java.lang.String sql, java.lang.String date1, java.lang.String date2, java.lang.String dateFmt, ODCallback odCallback)
          If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs.
 void searchWithCallback(ODCallback odCallback)
          Deprecated.  
 void searchWithCallback(java.lang.String sql, ODCallback cb)
          Deprecated.  
 void searchWithCallback(java.lang.String sql, java.lang.String date1, java.lang.String date2, ODCallback odCallback)
          Deprecated.  
 
Methods inherited from class com.ibm.edms.od.ODCallback
cancel, isDone, waitForOperation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

open

public void open()
          throws java.lang.Exception
This method will open the folder. This retrieves from the server the criteria information for the folder.
Throws:
java.lang.Exception -  

close

public void close()
This method will close the folder.

search

public java.util.Vector search()
                        throws java.lang.Exception
This method will search the folder. Before searching the folder the criteria should be set.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODHit

searchWithCallback

public void searchWithCallback(ODCallback odCallback)
                        throws java.lang.Exception
Deprecated.  

This method will search the folder. Before searching the folder the criteria should be set. This method is asynchronous.

Note: To obtain the hit results call getHits after the search is complete.
Parameters:
ODCallback - An instance of the ODCallback object. This object will allow the calling application to cancel/wait for the search to complete.
Throws:
java.lang.Exception -  
See Also:
search(ODCallback), getHits(), ODCallback

search

public java.util.Vector search(ODCallback odCallback)
                        throws java.lang.Exception
This method will search the folder. Before searching the folder the criteria should be set.
Parameters:
ODCallback - An instance of the ODCallback object. This object will allow the calling application to cancel the search.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODCallback

search

public java.util.Vector search(java.lang.String sql)
                        throws java.lang.Exception
This method will search the folder. If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.
Parameters:
sql - An sql string containing the search directive.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODHit

searchWithCallback

public void searchWithCallback(java.lang.String sql,
                               ODCallback cb)
                        throws java.lang.Exception
Deprecated.  

This method will search the folder asynchronously. If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.


Note: To obtain the hit results call getHits after the search is complete.
Parameters:
sql - An sql string containing the search directive.
cb - An instance of an ODCallback object.
Throws:
java.lang.Exception -  
See Also:
search(String, ODCallback), getHits(), ODCallback

search

public java.util.Vector search(java.lang.String sql,
                               ODCallback cb)
                        throws java.lang.Exception
If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.
Parameters:
sql - An sql string containing the search directive.
cb - An instance of an ODCallback object.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODCallback

search

public java.util.Vector search(java.lang.String sql,
                               java.lang.String date1,
                               java.lang.String date2)
                        throws java.lang.Exception
This method will search the folder. If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.
Parameters:
sql - An sql string containing the search directive.
date1 - Use to specify the beginning date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
date2 - Use to specify the ending date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODHit

search

public java.util.Vector search(java.lang.String sql,
                               java.lang.String date1,
                               java.lang.String date2,
                               java.lang.String dateFmt)
                        throws java.lang.Exception
This method will search the folder. If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.
Parameters:
sql - An sql string containing the search directive.
date1 - Use to specify the beginning date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
date2 - Use to specify the ending date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
dateFmt - Used to specify the format of the dates.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODHit

searchWithCallback

public void searchWithCallback(java.lang.String sql,
                               java.lang.String date1,
                               java.lang.String date2,
                               ODCallback odCallback)
                        throws java.lang.Exception
Deprecated.  

This method will search the folder asynchronously. If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.


Note: To obtain the hit results call getHits after the search is complete.
Parameters:
sql - An sql string containing the search directive.
date1 - Use to specify the beginning date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
date2 - Use to specify the ending date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
dateFmt - Used to specify the format of the dates.
odCallback - ODCallback object.
Throws:
java.lang.Exception -  
See Also:
search(String, String, String, ODCallback), getHits(), ODCallback

search

public java.util.Vector search(java.lang.String sql,
                               java.lang.String date1,
                               java.lang.String date2,
                               ODCallback cb)
                        throws java.lang.Exception
If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.
Parameters:
sql - An sql string containing the search directive.
date1 - Use to specify the beginning date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
date2 - Use to specify the ending date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
cb - An instance of an ODCallback object.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODCallback

search

public java.util.Vector search(java.lang.String sql,
                               java.lang.String date1,
                               java.lang.String date2,
                               java.lang.String dateFmt,
                               ODCallback odCallback)
                        throws java.lang.Exception
If you use this method the SQL query is used to search the folder rather than any folder field name/value pairs. OnDemand does not validate the sql string.
Parameters:
sql - An sql string containing the search directive.
date1 - Use to specify the beginning date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
date2 - Use to specify the ending date in a range of dates to search. The format of the date string that you specify must match the display format of the folder field.
dateFmt - Used to specify the format of the dates.
odCallback - ODCallback object.
Returns:
A vector containing ODHit objects.
Throws:
java.lang.Exception -  
See Also:
ODCallback

retrieve

public void retrieve(ODCallback odCallback)
              throws java.lang.Exception
This method will retrieve the current hits, i.e., those returned from the last successful search method call. This method uses document bulk retrieval to return the data to the caller.
Parameters:
odCallback - ODCallback object.
Throws:
java.lang.Exception -  
See Also:
ODCallback

retrieve

public void retrieve(java.util.Vector hits,
                     ODCallback odCallback)
              throws java.lang.Exception
This method will retrieve the specified hits from this folder. This method uses document bulk retrieval to return the data to the caller. See @ODCallback.
Parameters:
hits - A vector of ODHit objects to retrieve.
odCallback - ODCallback object.
Throws:
java.lang.Exception -  
See Also:
ODCallback

retrieve

public void retrieve(java.lang.String[] ids,
                     ODCallback odCallback)
              throws java.lang.Exception
This method will retrieve the specified documents from this folder. This method uses document bulk retrieval to return the data to the caller.
Parameters:
ids - An array of document ids.
odCallback - ODCallback object.
Throws:
java.lang.Exception -  
See Also:
ODCallback

printDocs

public void printDocs(java.util.Vector hits,
                      java.lang.String printer)
               throws java.lang.Exception
Print the specified hits from this folder. The specified hits must be a subset of the hits returned during the folder search operation.
Parameters:
hits - Subset of hits returned during the last search method.
printer - The name of a server printer defined within OnDemand.
Throws:
java.lang.Exception -  

getHits

public java.util.Vector getHits()
Return the hits obtained from the last search method call.
Returns:
A vector containing ODHit objects obtained from the last search method.
See Also:
ODHit

getSearchMessage

public java.lang.String getSearchMessage()
Message returned from server during search operation. This does not indicate failure, it is simply an informative message. An example would be:
Only 200 hits were returned by the server.
Returns:
The text of the message.

getName

public java.lang.String getName()
The name of the folder.
Returns:
String The name of the folder.

getDescription

public java.lang.String getDescription()
The description of the folder.
Returns:
The description of the folder.

getDisplayOrder

public java.lang.String[] getDisplayOrder()
Get the display order for the folder's criteria. This order is set by the OnDemand administrator.
Returns:
A string array containing the folder criteria names in their display order.

getNumCriteria

public int getNumCriteria()
Get the number of search criteria for this folder.
Returns:
Number of search criteria.

getCriteria

public java.util.Enumeration getCriteria()
Get the search criteria for this folder.
Returns:
Enumeration of ODCriteria objects.
See Also:
ODCriteria

getCriteria

public ODCriteria getCriteria(java.lang.String name)
Get criteria object for the specified criteria name.
Returns:
ODCriteria object
See Also:
ODCriteria

HitCallback

public boolean HitCallback(java.lang.String id,
                           char type,
                           java.lang.String[] values)
                    throws java.lang.Exception
Not for public use.
Overrides:
HitCallback in class ODCallback
See Also:
ODCallback.HitCallback(String, char, String[])

HitHandleCallback

public void HitHandleCallback(int hit,
                              int off,
                              int len)
Not for public use.
Overrides:
HitHandleCallback in class ODCallback
See Also:
ODCallback.HitHandleCallback(int, int, int)

DataCallback

public boolean DataCallback(byte[] data)
Not for public use.
Overrides:
DataCallback in class ODCallback
See Also:
ODCallback.DataCallback(byte[])

addHit

public boolean addHit(java.lang.String id,
                      char type,
                      java.lang.String[] values)
               throws java.lang.Exception
This method should be used to selectively add hits to the ODFolder's workin set of hits. When using an ODCallback object for searches the HitCallback method is is called for each hit matching the search criteria or sql query. In your callback you can either save off the document id's, to be used later during retrieval, or you can choose to call this method to add the hit to the folder objects working set of hits. In doing so you do not have to cache any of the hit information and can later use the retrieve method which doesn't require hit objects or document id's.
See Also:
retrieve(ODCallback), ODCallback.HitCallback(String, char, String[])