com.plumtree.portaluiinfrastructure.resultwrapper
Class APTQueryWrapper

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

public class APTQueryWrapper
extends PTSortedArrayWrapper
implements IASQueryResult

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 Smedber

Field Summary
protected  int m_iMaxRows
          MES- The maximum number of rows we'll return
protected  int m_iMode
          MES- Our mode- we have to treat large result sets special.
static int PTTQRW_DEFAULT_MAX_ROWS
          MES- By default, we only show the first 1000 rows.
static int PTTQRW_MODE_CLIENT
          MES- In this mode, all the data is on the client, we can sort on the client.
static int PTTQRW_MODE_TRUNCATED
          MES- In this mode, the data we hold is truncated, we have to go to the Server for sorts.
 
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
APTQueryWrapper()
           
 
Method Summary
 java.lang.Object GetFields(int iRow, int iPropID)
          MES- GetFields emulates the IPTQueryResult call of the same name.
 boolean IsComplete()
          MES- IsComplete returns a boolean indicating if the rows we can return are the complete rowset (i.e.
 int MaxRows()
          MES- MaxRows returns the maximum number of rows an instance may contain before entering PTTQRW_MODE_TRUNCATED mode.
 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.
 
Methods inherited from class com.plumtree.uiinfrastructure.arraywrapper.PTSortedArrayWrapper
ContainsPropID, GetCount, GetItem, GetSort, Initialize, MapColumnIDs, SetItem, SetItems, Sort, 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

PTTQRW_DEFAULT_MAX_ROWS

public static final int PTTQRW_DEFAULT_MAX_ROWS
MES- By default, we only show the first 1000 rows.

See Also:
Constant Field Values

PTTQRW_MODE_CLIENT

public static final int PTTQRW_MODE_CLIENT
MES- In this mode, all the data is on the client, we can sort on the client.

See Also:
Constant Field Values

PTTQRW_MODE_TRUNCATED

public static final int PTTQRW_MODE_TRUNCATED
MES- In this mode, the data we hold is truncated, we have to go to the Server for sorts.

See Also:
Constant Field Values

m_iMaxRows

protected int m_iMaxRows
MES- The maximum number of rows we'll return


m_iMode

protected int m_iMode
MES- Our mode- we have to treat large result sets special. Value should be PTTQRW_MODE_CLIENT or PTTQRW_MODE_TRUNCATED

Constructor Detail

APTQueryWrapper

public APTQueryWrapper()
Method Detail

GetFields

public java.lang.Object GetFields(int iRow,
                                  int iPropID)
MES- GetFields emulates the IPTQueryResult call of the same name. It's just a tiny wrapper around PTSortedArrayWrapper::GetItem, but it offers the name expected by IPTQueryResult callers.

Specified by:
GetFields in interface IASQueryResult
Parameters:
iRow - is the row desired
iPropID - is the PT_PROPIDs id of the Property desired
Returns:
the object from the array

IsComplete

public boolean IsComplete()
MES- IsComplete returns a boolean indicating if the rows we can return are the complete rowset (i.e. have we truncated the rowset because it's too large to bring to the client.)

Specified by:
IsComplete in interface IASQueryResult
Returns:
A boolean indicating completeness.

MaxRows

public int MaxRows()
MES- MaxRows returns the maximum number of rows an instance may contain before entering PTTQRW_MODE_TRUNCATED mode.

Returns:
an int containing the maximum rows.

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.

Parameters:
iMaxRows - is the maximum number of rows desired, which must be > 0
Throws:
XPException



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