com.plumtree.portalpages.rest.dojo
Class AQueryStoreModel

java.lang.Object
  extended by com.plumtree.portalpages.rest.ARESTModel
      extended by com.plumtree.portalpages.rest.dojo.AQueryStoreModel
Direct Known Subclasses:
KDDocumentDataStoreModel

public abstract class AQueryStoreModel
extends ARESTModel

Abstract class for for QueryStoreModels A QueryStore is a dojo toolkit concept for potentially large dataset where smaller partial data chunks are lazily requested by the client. Dojo QueryStore models will requests for pieces of the data store per request. Besides the main query, requests will also sends parameters for: - number of results to return - index to start at - property to sort results by - specific query These parameters are set by the QueryStoreControl on the model with the accessors defined on this interface. USAGE: - QueryStoreControl or child control sets parameters parsed from the REST Request - DisplayPage calls GetQueryStoreResult IMPLEMENTING CHILD MODEL - Implement GetQueryStoreResult to perform search / query with the results - Add property name to property id mapping by adding a static block to initialize mapping entries to COLNAME_TO_PROPID_MAP

Author:
rozhang

Field Summary
static java.lang.String COL_CREATED
           
static java.lang.String COL_DESCRIPTION
           
static java.lang.String COL_LASTMODIFIED
           
static java.lang.String COL_NAME
           
static java.lang.String COL_OBJECTID
          Property names for the JSON object returned in the response, don't change without also updating client javascript
static java.lang.String COLNAME_PREFIX
           
protected static XPHashtable COLNAME_TO_PROPID_MAP
          Stores mapping between JSON object property name and search property ids
static java.lang.String CUSTOMPROP_TYPE_SESSIONMAP_NAME
           
static java.lang.String DATASTORE_PROP_IDENTIFIER
          datastore response property with the column/property name in each result entry that serves as the unqiue id
static java.lang.String DATASTORE_PROP_ITEMS
          datastore response property containing the result set
static java.lang.String DATASTORE_PROP_LABEL
          datastore response property with the column/property name in each result entry that serves as the label
static java.lang.String DATASTORE_PROP_TOTALRESULTS
          datastore response property for total result set (not just returned in the response
static int INVALID_PROPID
           
static int NO_PROPTYPE
           
static int PROP_GRIDTYPE_ICON
           
static int PROP_GRIDTYPE_URL
           
protected static XPHashtable PROPID_PROPTYPE_MAP
          Stores mapping of property ids and their types
protected static java.lang.Object PROPTYPE_LOCK
          Lock to synchronize the PROPID_PROPTYPE_MAP hashtable
 
Fields inherited from class com.plumtree.portalpages.rest.ARESTModel
m_error
 
Constructor Summary
AQueryStoreModel()
           
 
Method Summary
protected static void AddColNameToSearchPropIdMapping(java.lang.String colName, int searchPropId)
          Helper to add property name to property id mapping entry
protected  void AddDataStoreMetaData(XPHashtable dsData, IXPList dataItems, int totalRows)
          Helper to construct the DataStore response object
protected static void AddPropIdToPropTypeMapping(int propId, int propType)
          Helper to add property id to property type mapping entry
protected static int GetCustomPropType(int propId, AActivitySpace space)
          Custom properties are cached on the user session Only cache types for custom properties are stored since the default doc properties don't change
 int GetOrderById()
           
protected static int GetPropType(int propId, AActivitySpace space)
           
 java.lang.String GetQuery()
          Getters and setters for common properties
abstract  XPHashtable GetQueryStoreResult()
          Main method
 int GetResultSize()
           
 int GetSearchPropIdFromColumnName(java.lang.String colName)
          Helper method to lookup property id from property name
 int GetStartIndex()
           
 void SetOrderById(int orderByColId)
           
 void SetQuery(java.lang.String query)
           
 void SetResultSize(int resultSize)
           
 void SetStartIndex(int startIndex)
           
 
Methods inherited from class com.plumtree.portalpages.rest.ARESTModel
GetError, SetError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_PROPID

public static int INVALID_PROPID

NO_PROPTYPE

public static int NO_PROPTYPE

PROP_GRIDTYPE_ICON

public static final int PROP_GRIDTYPE_ICON
See Also:
Constant Field Values

PROP_GRIDTYPE_URL

public static final int PROP_GRIDTYPE_URL
See Also:
Constant Field Values

COLNAME_PREFIX

public static final java.lang.String COLNAME_PREFIX
See Also:
Constant Field Values

COL_OBJECTID

public static final java.lang.String COL_OBJECTID
Property names for the JSON object returned in the response, don't change without also updating client javascript


COL_NAME

public static final java.lang.String COL_NAME

COL_DESCRIPTION

public static final java.lang.String COL_DESCRIPTION

COL_CREATED

public static final java.lang.String COL_CREATED

COL_LASTMODIFIED

public static final java.lang.String COL_LASTMODIFIED

DATASTORE_PROP_ITEMS

public static java.lang.String DATASTORE_PROP_ITEMS
datastore response property containing the result set


DATASTORE_PROP_TOTALRESULTS

public static java.lang.String DATASTORE_PROP_TOTALRESULTS
datastore response property for total result set (not just returned in the response


DATASTORE_PROP_IDENTIFIER

public static java.lang.String DATASTORE_PROP_IDENTIFIER
datastore response property with the column/property name in each result entry that serves as the unqiue id


DATASTORE_PROP_LABEL

public static java.lang.String DATASTORE_PROP_LABEL
datastore response property with the column/property name in each result entry that serves as the label


COLNAME_TO_PROPID_MAP

protected static XPHashtable COLNAME_TO_PROPID_MAP
Stores mapping between JSON object property name and search property ids


PROPID_PROPTYPE_MAP

protected static XPHashtable PROPID_PROPTYPE_MAP
Stores mapping of property ids and their types


CUSTOMPROP_TYPE_SESSIONMAP_NAME

public static final java.lang.String CUSTOMPROP_TYPE_SESSIONMAP_NAME
See Also:
Constant Field Values

PROPTYPE_LOCK

protected static java.lang.Object PROPTYPE_LOCK
Lock to synchronize the PROPID_PROPTYPE_MAP hashtable

Constructor Detail

AQueryStoreModel

public AQueryStoreModel()
Method Detail

GetQueryStoreResult

public abstract XPHashtable GetQueryStoreResult()
Main method

Returns:

AddDataStoreMetaData

protected void AddDataStoreMetaData(XPHashtable dsData,
                                    IXPList dataItems,
                                    int totalRows)
Helper to construct the DataStore response object

Parameters:
dsData - The hashtable to set the properties on
dataItems -
totalRows -

GetSearchPropIdFromColumnName

public int GetSearchPropIdFromColumnName(java.lang.String colName)
Helper method to lookup property id from property name

Parameters:
colName -
Returns:
INVALID_PROPID (-1) if the column name was not found

AddColNameToSearchPropIdMapping

protected static void AddColNameToSearchPropIdMapping(java.lang.String colName,
                                                      int searchPropId)
Helper to add property name to property id mapping entry

Parameters:
colName -
searchPropId -
Throws:
XPIllegalStateException - if mapping already exists

AddPropIdToPropTypeMapping

protected static void AddPropIdToPropTypeMapping(int propId,
                                                 int propType)
Helper to add property id to property type mapping entry

Parameters:
propId -
propType -
Throws:
XPIllegalStateException - if mapping already exists

GetPropType

protected static int GetPropType(int propId,
                                 AActivitySpace space)

GetCustomPropType

protected static int GetCustomPropType(int propId,
                                       AActivitySpace space)
Custom properties are cached on the user session Only cache types for custom properties are stored since the default doc properties don't change

Parameters:
propId -
space -
Returns:

GetQuery

public java.lang.String GetQuery()
Getters and setters for common properties


SetQuery

public void SetQuery(java.lang.String query)

GetResultSize

public int GetResultSize()

SetResultSize

public void SetResultSize(int resultSize)

GetStartIndex

public int GetStartIndex()

SetStartIndex

public void SetStartIndex(int startIndex)

GetOrderById

public int GetOrderById()

SetOrderById

public void SetOrderById(int orderByColId)



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