com.wm.app.tn.db
Class BizDocTypeStore

java.lang.Object
  extended by com.wm.app.tn.db.BizDocTypeStore

public class BizDocTypeStore
extends java.lang.Object

Type-based operations on the shared datastore. This class must be initialized with a call to fillCache. Subsequent calls to list or get will only refer to the in-memory cache. Insert, update and remove operations are write-through -- they will affect the cache and the database.


Constructor Summary
BizDocTypeStore()
           
 
Method Summary
static int delete(java.lang.String typeId, boolean delDocuments)
           
static boolean disable(java.lang.String id)
          For internal use only
static boolean documentsExist(java.lang.String typeId)
           
static boolean enable(java.lang.String id)
          For internal use only
static void fillCache(boolean includeDeleted)
          For internal use only
static BizDocType get(java.lang.String id)
          Get a type definition from the cache.
static BizDocType get(java.lang.String id, boolean returnDeleted)
          Get a (possibly deleted) type definition from the cache.
static BizDocType get(java.lang.String id, boolean returnDeleted, boolean returnHidden)
          For internal use only
static BizDocType getByName(java.lang.String name, boolean returnDeleted, boolean returnHidden)
          Get a type definition by name
static boolean insert(BizDocType t, java.lang.String s)
          For internal use only
static java.lang.String[] list(boolean includeDeleted)
          Returns a list of the IDs of all the items in the cache.
static java.lang.String[] list(boolean includeDeleted, boolean includeHidden)
          Returns a list of the IDs of all the items in the cache.
static SortedIDataList listByFilter(java.lang.String typeID, java.lang.String typeName, java.lang.String description, java.lang.String disabled, java.lang.String docDisplayType, java.lang.String startDate, java.lang.String endDate, java.lang.String searchCondition)
          List types in the cache.
static com.wm.data.IData queryTypes(BDTypeQuery query, int pageSize, int maxRowCount, int queryTimeout, int threshold, java.lang.String queryId)
          TODO describe this method
static java.lang.String[] queryTypes(java.lang.String searchStr)
          Returns a list of the IDs of all the items based on the queryString.
static java.lang.String[] queryTypes(java.lang.String searchStr, boolean includeDeleted)
          Returns a list of the IDs of all the items based on the queryString.
static java.lang.String[] queryTypesWithDLS(java.lang.String searchStr, boolean includeDeleted)
          Returns a list of the IDs of all the items based on the queryString.
static boolean update(BizDocType t)
          For internal use only
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BizDocTypeStore

public BizDocTypeStore()
Method Detail

fillCache

public static void fillCache(boolean includeDeleted)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

queryTypes

public static java.lang.String[] queryTypes(java.lang.String searchStr)
                                     throws DatastoreException
Returns a list of the IDs of all the items based on the queryString. This is a wrapper for existing queryTypes() service since the modified queryTypes() accepts includeDeleted flag along with searchStr. The function returns deleted documents as well.

Parameters:
searchString - defines the search criteria
Returns:
a list of all the IDs (null if there are none)
Throws:
DatastoreException

queryTypes

public static java.lang.String[] queryTypes(java.lang.String searchStr,
                                            boolean includeDeleted)
                                     throws DatastoreException
Returns a list of the IDs of all the items based on the queryString.

Parameters:
searchString - defines the search criteria
includeDeleted - specifies whether deleted documents need to be returned
Returns:
a list of all the IDs (null if there are none)
Throws:
DatastoreException

queryTypesWithDLS

public static java.lang.String[] queryTypesWithDLS(java.lang.String searchStr,
                                                   boolean includeDeleted)
                                            throws DatastoreException
Returns a list of the IDs of all the items based on the queryString. This service takes care of DLS for the current user.

Parameters:
searchString - defines the search criteria
includeDeleted - specifies whether deleted documents need to be returned
Returns:
a list of all the IDs (null if there are none)
Throws:
DatastoreException

list

public static java.lang.String[] list(boolean includeDeleted)
Returns a list of the IDs of all the items in the cache.

Parameters:
includeDeleted - should type definitions that are marked as deleted be included in the listing? (this is meaningless if such types were not fetched)
Returns:
a list of all the IDs (null if there are none)

list

public static java.lang.String[] list(boolean includeDeleted,
                                      boolean includeHidden)
Returns a list of the IDs of all the items in the cache.

Parameters:
includeDeleted - should type definitions that are marked as deleted be included in the listing? (this is meaningless if such types were not fetched)
Returns:
a list of all the IDs (null if there are none)

get

public static BizDocType get(java.lang.String id)
Get a type definition from the cache.

Parameters:
id - the ID of the type definition to fetch
Returns:
the type in question (null if there's no such type, or if the specified type is marked as deleted)

get

public static BizDocType get(java.lang.String id,
                             boolean returnDeleted)
Get a (possibly deleted) type definition from the cache.

Parameters:
id - the ID of the type definition to fetch
returnDeleted - if the type in question is marked as deleted, should we return it anyway?
Returns:
the type in question (null if there's no such type, or if the specified type is marked as deleted and returnDeleted is not set)

get

public static BizDocType get(java.lang.String id,
                             boolean returnDeleted,
                             boolean returnHidden)
For internal use only


getByName

public static BizDocType getByName(java.lang.String name,
                                   boolean returnDeleted,
                                   boolean returnHidden)
Get a type definition by name

Parameters:
name - the name of the type to fetch
returnDeleted - if the type in question exists but is deleted, should it be returned anyway? (meaningless if deleted types were not initially fetched)
Returns:
the type in question (null if there's no such type)

insert

public static boolean insert(BizDocType t,
                             java.lang.String s)
                      throws DatastoreException,
                             RestrictedFeatureException
For internal use only

Throws:
DatastoreException
RestrictedFeatureException

update

public static boolean update(BizDocType t)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

delete

public static int delete(java.lang.String typeId,
                         boolean delDocuments)
                  throws DatastoreException
Throws:
DatastoreException

listByFilter

public static SortedIDataList listByFilter(java.lang.String typeID,
                                           java.lang.String typeName,
                                           java.lang.String description,
                                           java.lang.String disabled,
                                           java.lang.String docDisplayType,
                                           java.lang.String startDate,
                                           java.lang.String endDate,
                                           java.lang.String searchCondition)
List types in the cache.

Parameters:
includeDeleted - should attribute definitions that are marked as deleted be included in the listing? (this is meaningless if such attributes were not fetched)
Returns:
an SortedIDataList list of BizDoctypesummary

documentsExist

public static boolean documentsExist(java.lang.String typeId)
                              throws DatastoreException
Throws:
DatastoreException

disable

public static boolean disable(java.lang.String id)
                       throws DatastoreException
For internal use only

Throws:
DatastoreException

enable

public static boolean enable(java.lang.String id)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

queryTypes

public static com.wm.data.IData queryTypes(BDTypeQuery query,
                                           int pageSize,
                                           int maxRowCount,
                                           int queryTimeout,
                                           int threshold,
                                           java.lang.String queryId)
                                    throws DatastoreException,
                                           java.io.IOException,
                                           com.wm.app.repo.RepositoryException,
                                           com.wm.app.b2b.server.ServiceException
TODO describe this method

Parameters:
query -
pageSize -
maxRowCount -
queryTimeout -
threshold -
queryId -
Returns:
Throws:
DatastoreException
java.io.IOException
com.wm.app.repo.RepositoryException
com.wm.app.b2b.server.ServiceException