com.plumtree.portaluiinfrastructure.resultwrapper
Class PTObjectManagerQueryWrapper

java.lang.Object
  extended by com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper
      extended by com.plumtree.portaluiinfrastructure.resultwrapper.APTQueryWrapper
          extended by com.plumtree.portaluiinfrastructure.resultwrapper.PTObjectManagerQueryWrapper
All Implemented Interfaces:
IASQueryResult

public class PTObjectManagerQueryWrapper
extends APTQueryWrapper

PTObjectManagerQueryWrapper: The PTObjectManagerQueryWrapper class wraps the IPTTurboQueryResult Server object that's returned by the various Query methods of IPTObjectManager. This wrapper handles the details of retrieving a subset of the data, sorting on the client when necessary, etc.

Author:
Michael Smedberg

Field Summary
protected  int m_iFolderID
          MES- The Folder ID we're using, if we need to requery to resort
protected  int m_iPropIDMask
          MES- The Property ID mask we're using, if we need to requery to resort
protected  IPTObjectManager m_ObjectManager
          MES- The ObjectManager we're wrapping
protected  java.lang.Object[][] m_objQueryFilter
          MES- The Query Filter we're using, if we need to requery to resort
 
Fields inherited from class com.plumtree.portaluiinfrastructure.resultwrapper.APTQueryWrapper
m_iMaxRows, m_iMode, PTTQRW_DEFAULT_MAX_ROWS, PTTQRW_MODE_CLIENT, PTTQRW_MODE_TRUNCATED
 
Fields inherited from class com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper
m_arrData, m_arrSort, m_bSortOptimized, m_hashPropIDtoColumn, m_lstRowMapping, PTSAW_NEWITEMSINFO_INDEX, PTSAW_NEWITEMSINFO_NEWVALUE, PTSAW_NEWITEMSINFO_PROPERTYID, PTSAW_SORT_ASCENDING, PTSAW_SORT_DESCENDING, PTSAW_SORT_ROW_DIRECTION, PTSAW_SORT_ROW_PROPID
 
Constructor Summary
PTObjectManagerQueryWrapper(IPTObjectManager om)
          MES- The constructor is used by clients to attach this instance to an Object Manager
 
Method Summary
 void Initialize(int[] arrColumnIDs, java.lang.Object[][] arrData, int[][] arrSort, boolean bRequiresSort)
          MES- This version of Initialize masks the Initialize of our superclass- we want to make sure that clients don't call the wrong version of Initialize.
 boolean Query(int iPropIDMask, int iFolderID, int[][] arrSort, int iSkipRows, java.lang.Object[][] objQueryFilter)
          MES- Query wraps the ObjectManager call of the same name
 boolean Query(int iPropIDMask, int iFolderID, int[][] arrSort, java.lang.Object[][] objQueryFilter)
          MES- Query wraps the ObjectManager call of the same name
 boolean QuerySingleObject(int iObjectID)
          MES- QuerySingleObject wraps the ObjectManager call of the same name
 void SetMaxRows(int iMaxRows)
          MES- SetMaxRows allows clients to set the maximum number of rows that this wrapper will hold before entering PTTQRW_MODE_TRUNCATED mode.
 boolean SimpleQuery()
          MES- SimpleQuery wraps the ObjectManager call of the same name This function queries all folders, and orders by name.
 boolean SimpleQuery(int iFolderID)
          MES- SimpleQuery wraps the ObjectManager call of the same name.
 boolean SimpleQuery(int iFolderID, int iPropToOrderBy)
          MES- SimpleQuery wraps the ObjectManager call of the same name.
 boolean SimpleQuery(int iFolderID, int[][] arrSort)
          MES- SimpleQuery wraps the ObjectManager call of the same name.
 void Sort(int[][] arrSort)
          MES- Sort is used to resort the data.
 
Methods inherited from class com.plumtree.portaluiinfrastructure.resultwrapper.APTQueryWrapper
GetFields, IsComplete, MaxRows
 
Methods inherited from class com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper
ContainsPropID, GetCount, GetItem, GetSort, MapColumnIDs, SetItem, SetItems, SortInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.plumtree.portaluiinfrastructure.resultwrapper.IASQueryResult
GetCount
 

Field Detail

m_ObjectManager

protected IPTObjectManager m_ObjectManager
MES- The ObjectManager we're wrapping


m_objQueryFilter

protected java.lang.Object[][] m_objQueryFilter
MES- The Query Filter we're using, if we need to requery to resort


m_iFolderID

protected int m_iFolderID
MES- The Folder ID we're using, if we need to requery to resort


m_iPropIDMask

protected int m_iPropIDMask
MES- The Property ID mask we're using, if we need to requery to resort

Constructor Detail

PTObjectManagerQueryWrapper

public PTObjectManagerQueryWrapper(IPTObjectManager om)
MES- The constructor is used by clients to attach this instance to an Object Manager

Parameters:
om - is the Object Manager we should be querying
Method Detail

Initialize

public void Initialize(int[] arrColumnIDs,
                       java.lang.Object[][] arrData,
                       int[][] arrSort,
                       boolean bRequiresSort)
MES- This version of Initialize masks the Initialize of our superclass- we want to make sure that clients don't call the wrong version of Initialize.

Overrides:
Initialize in class PTSortedArrayWrapper
Parameters:
arrColumnIDs - is not used
arrData - is not used
arrSort - is not used
bRequiresSort - is not used
Throws:
XPException - is not used

Query

public boolean Query(int iPropIDMask,
                     int iFolderID,
                     int[][] arrSort,
                     java.lang.Object[][] objQueryFilter)
MES- Query wraps the ObjectManager call of the same name

Parameters:
iPropIDMask - is a bitmask of the properties to be returned as columns
iFolderID - is the FolderID to query in, or -1 for all folders
arrSort - is a 2D int array of PropertyIDs to sort by. It should contain a column for each sort. The first row holds the PropertyID, and the second row holds the sort direction, PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDING
objQueryFilter - is a Filter to include in the query, or null to skip filtering
Returns:
boolean indicating success or failure

Query

public boolean Query(int iPropIDMask,
                     int iFolderID,
                     int[][] arrSort,
                     int iSkipRows,
                     java.lang.Object[][] objQueryFilter)
MES- Query wraps the ObjectManager call of the same name

Parameters:
iPropIDMask - is a bitmask of the properties to be returned as columns
iFolderID - is the FolderID to query in, or -1 for all folders
arrSort - is a 2D int array of PropertyIDs to sort by. It should contain a column for each sort. The first row holds the PropertyID, and the second row holds the sort direction, PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDING
iSkipRows - is the index of the first row to start the query on
objQueryFilter - is a Filter to include in the query, or null to skip filtering
Returns:
boolean indicating success or failure

QuerySingleObject

public boolean QuerySingleObject(int iObjectID)
MES- QuerySingleObject wraps the ObjectManager call of the same name

Parameters:
iObjectID - is the ObjectID of the object to be queried
Returns:
boolean value indicating success or failure

SetMaxRows

public void SetMaxRows(int iMaxRows)
MES- SetMaxRows allows clients to set the maximum number of rows that this wrapper will hold before entering PTTQRW_MODE_TRUNCATED mode. Call this function BEFORE querying.

Overrides:
SetMaxRows in class APTQueryWrapper
Parameters:
iMaxRows - is the maximum number of rows desired, which must be > 0
Throws:
XPException

SimpleQuery

public boolean SimpleQuery()
MES- SimpleQuery wraps the ObjectManager call of the same name This function queries all folders, and orders by name.

Returns:
boolean indicating success or failure

SimpleQuery

public boolean SimpleQuery(int iFolderID)
MES- SimpleQuery wraps the ObjectManager call of the same name. This function orders results by name.

Parameters:
iFolderID - indicates a folder to be queried, or -1 for all folders
Returns:
boolean indicating success or failure

SimpleQuery

public boolean SimpleQuery(int iFolderID,
                           int iPropToOrderBy)
MES- SimpleQuery wraps the ObjectManager call of the same name.

Parameters:
iFolderID - indicates a folder to be queried, or -1 for all folders
iPropToOrderBy - indicates the PropertyID to sort by. The sort will be ascending.
Returns:
boolean indicating success or failure

SimpleQuery

public boolean SimpleQuery(int iFolderID,
                           int[][] arrSort)
MES- SimpleQuery wraps the ObjectManager call of the same name.

Parameters:
iFolderID - indicates a folder to be queried, or -1 for all folders
arrSort - is a 2D int array of PropertyIDs to sort by. It should contain a column for each sort. The first row holds the PropertyID, and the second row holds the sort direction, PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDING
Returns:
boolean indicating success or failure

Sort

public void Sort(int[][] arrSort)
MES- Sort is used to resort the data. Sort will do an in-memory sort, or will requery the server, as needed. If the server is re-queried, the skipped rows from the original query will be ignored.

Overrides:
Sort in class PTSortedArrayWrapper
Parameters:
arrSort - is a 2D int array of PropertyIDs to sort by. It should contain a column for each sort. The first row holds the PropertyID, and the second row holds the sort direction, PTSAW_SORT_ASCENDING or PTSAW_SORT_DESCENDING
Throws:
XPException



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.