Content Manager OnDemand V7 WEK APIs

com.ibm.edms.od
Class ODFolder

java.lang.Object
  |
  +--com.ibm.edms.od.ODCallback
        |
        +--com.ibm.edms.od.ODFolder
All Implemented Interfaces:
java.io.Serializable

public class ODFolder
extends ODCallback
implements java.io.Serializable

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, 2003. All Rights Reserved

See Also:
Serialized Form

Constructor Summary
protected ODFolder(com.ibm.edms.od.ODServer server, java.lang.String name)
           
protected ODFolder(com.ibm.edms.od.ODServer server, java.lang.String name, java.lang.String desc)
           
 
Method Summary
 boolean addHit(java.lang.String id, char type, int hit_location, java.lang.String[] values)
          This method should be used to selectively add hits to the ODFolder's working set of hits.
 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 working set of hits.
 void close()
          This method will close the folder.
 boolean DataCallback(byte[] data)
          Not for public use.
protected  void done()
          Deprecated.  
 java.lang.Object[] getApplGroups()
          Get the application groups for this folder.
 java.util.Enumeration getCriteria()
          Get the search criteria for this folder.
 com.ibm.edms.od.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.ArrayList getFolderSortOrder()
          Get the sort 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 getNumApplGroups()
          Get the number of application groups for this folder.
 int getNumCriteria()
          Get the number of search criteria for this folder.
 java.lang.String getSearchMessage()
          Message returned from server during search operation.
 boolean getSortEnabled()
          Get the sort enablement for the open folder's criteria,true/false, true meaning sorting is enabled, false meaning sorting is disabled.
 boolean hasODCallback()
          Not for public use.
 boolean HitCallback(java.lang.String id, char type, int hit_location, java.lang.String[] values)
          Not for public use.
 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.
 boolean isSortEnabled()
          Get the sort enablement for the open folder's criteria, true/false.
 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(com.ibm.edms.od.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, com.ibm.edms.od.ODCallback odCallback)
          This method will retrieve the specified documents from this folder.
 void retrieve(java.util.Vector hits, com.ibm.edms.od.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(com.ibm.edms.od.ODCallback odCallback)
          This method will search the folder.
 java.util.Vector search(com.ibm.edms.od.ODCallback odCallback, boolean use_docloc_hit_callback)
          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, com.ibm.edms.od.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, com.ibm.edms.od.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, com.ibm.edms.od.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(com.ibm.edms.od.ODCallback odCallback)
          Deprecated.  
 void searchWithCallback(java.lang.String sql, com.ibm.edms.od.ODCallback cb)
          Deprecated.  
 void searchWithCallback(java.lang.String sql, java.lang.String date1, java.lang.String date2, com.ibm.edms.od.ODCallback odCallback)
          Deprecated.  
protected  void setDescription(java.lang.String desc)
           
protected  void setDisplayOrder(java.lang.String[] displayOrder)
           
protected  void setFolderSortOrder(java.lang.String[] critName, java.lang.String[] sortOrder, java.lang.String[] Ascending)
           
 void setSortEnabled(boolean sort)
          Set the sort enablement for the folder's criteria.
 
Methods inherited from class com.ibm.edms.od.ODCallback
cancel, isDone, setServer, setThread, waitForOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ODFolder

protected ODFolder(com.ibm.edms.od.ODServer server,
                   java.lang.String name)

ODFolder

protected ODFolder(com.ibm.edms.od.ODServer server,
                   java.lang.String name,
                   java.lang.String desc)
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(com.ibm.edms.od.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.

Throws:
java.lang.Exception
See Also:
search(ODCallback), getHits(), ODCallback

search

public java.util.Vector search(com.ibm.edms.od.ODCallback odCallback)
                        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:
ODCallback

search

public java.util.Vector search(com.ibm.edms.od.ODCallback odCallback,
                               boolean use_docloc_hit_callback)
                        throws java.lang.Exception
This method will search the folder. Before searching the folder the criteria should be set.

Parameters:
use_docloc_hit_callback - Indicates whether (true) or not (false) to return a parameter specifying the document location to the HitCallback method.
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,
                               com.ibm.edms.od.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,
                               com.ibm.edms.od.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,
                               com.ibm.edms.od.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.
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,
                               com.ibm.edms.od.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,
                               com.ibm.edms.od.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(com.ibm.edms.od.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,
                     com.ibm.edms.od.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,
                     com.ibm.edms.od.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.

setDescription

protected void setDescription(java.lang.String desc)

setFolderSortOrder

protected void setFolderSortOrder(java.lang.String[] critName,
                                  java.lang.String[] sortOrder,
                                  java.lang.String[] Ascending)
                           throws java.lang.Exception
java.lang.Exception

setDisplayOrder

protected void setDisplayOrder(java.lang.String[] displayOrder)
                        throws java.lang.Exception
java.lang.Exception

setSortEnabled

public void setSortEnabled(boolean sort)
                    throws java.lang.Exception
Set the sort enablement for the folder's criteria. true/false, true meaning use sorting, false meaning do not use sorting.

Returns:
void
java.lang.Exception

getSortEnabled

public boolean getSortEnabled()
                       throws java.lang.Exception
Get the sort enablement for the open folder's criteria,true/false, true meaning sorting is enabled, false meaning sorting is disabled.

Returns:
boolean
java.lang.Exception

isSortEnabled

public boolean isSortEnabled()
                      throws java.lang.Exception
Get the sort enablement for the open folder's criteria, true/false.

Returns:
boolean
java.lang.Exception

getFolderSortOrder

public java.util.ArrayList getFolderSortOrder()
Get the sort order for the folder's criteria. This order is set by the OnDemand administrator and via the user.

Returns:
Java ArrayList containing the ODCriteria objects which contain the sort order information for the current open 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.

getNumApplGroups

public int getNumApplGroups()
Get the number of application groups for this folder.

Returns:
Number of application groups.

getApplGroups

public java.lang.Object[] getApplGroups()
Get the application groups for this folder.

Returns:
Object array containing the application groups. Each element in the object array is a String containing the application group name.

getCriteria

public java.util.Enumeration getCriteria()
Get the search criteria for this folder.

Returns:
Enumeration of ODCriteria objects.
See Also:
ODCriteria

getCriteria

public com.ibm.edms.od.ODCriteria getCriteria(java.lang.String name)
Get criteria object for the specified criteria name.

Returns:
ODCriteria object
See Also:
ODCriteria

done

protected void done()
Deprecated.  

Overrides:
done in class ODCallback

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
Parameters:
id - Persistent document identifier.
type - Document type.
values - Hit field values.
Returns:
The search operation can be canceled by return false.

java.lang.Exception
See Also:
ODCallback.HitCallback(String, char, String[])

HitCallback

public boolean HitCallback(java.lang.String id,
                           char type,
                           int hit_location,
                           java.lang.String[] values)
                    throws java.lang.Exception
Not for public use.

Overrides:
HitCallback in class ODCallback
Parameters:
id - Persistent document identifier.
type - Document type.
hit_location - document location, cache, etc.
values - Hit field values.
Returns:
The search operation can be canceled by return false.

java.lang.Exception
See Also:
ODCallback.HitCallback(String, char, int, String[])

HitHandleCallback

public void HitHandleCallback(int hit,
                              int off,
                              int len)
Not for public use.

Overrides:
HitHandleCallback in class ODCallback
Parameters:
hit - The hit number.
off - Offset of the data to be returned.
len - Length of the data to be returned.

Note: The server will not continue processing the bulk retrieval request until this method returns. Therefore care should be taken to minimalize the amount of processing that occurs before returning.
See Also:
ODCallback.HitHandleCallback(int, int, int)

DataCallback

public boolean DataCallback(byte[] data)
Not for public use.

Overrides:
DataCallback in class ODCallback
Parameters:
data - Document data for the requested hit(s).
Returns:
Return true to continue processing, false otherwise.

Note: The server will not continue processing the bulk retrieval request until this method returns. Therefore care should be taken to minimize the amount of processing that occurs before returning.
See Also:
ODCallback.DataCallback(byte[])

hasODCallback

public boolean hasODCallback()
Not for public use.

See Also:
ODCallback

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 working 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.

java.lang.Exception
See Also:
retrieve(ODCallback), ODCallback.HitCallback(String, char, String[])

addHit

public boolean addHit(java.lang.String id,
                      char type,
                      int hit_location,
                      java.lang.String[] values)
               throws java.lang.Exception
This method should be used to selectively add hits to the ODFolder's working 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.

java.lang.Exception
See Also:
retrieve(ODCallback), ODCallback.HitCallback(String, char, int, String[])

CM OnDemand V7 WEK Java APIs

(c)Copyright International Business Machines Corporation 2001, 2003. IBM Corp. All rights reserved.