com.arsdigita.formbuilder
Class PersistentDataQuery

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.formbuilder.PersistentDataQuery

public class PersistentDataQuery
extends ACSObject

This class is used to maintain the list of data queries available to the DataDrivenSelect class. All the queries are expected to return two attributes, id is some unique id for the row, and label is the human friendly label to display. eg

 query DataQueryPackages {
    BigDecimal id;
    String label;

     do {
        select package_id, pretty_name
        from apm_packages
        order by pretty_name asc
    } map {
        id = package_id;
        label = pretty_name;
   }
 }
 


Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String DESCRIPTION
           
static String NAME
           
static String TYPE_ID
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE, versionId
 
Constructor Summary
PersistentDataQuery()
          Constructor.
PersistentDataQuery(BigDecimal id)
          Constructor.
PersistentDataQuery(DataObject obj)
          Constructor.
PersistentDataQuery(ObjectType type)
          Constructor.
PersistentDataQuery(OID oid)
          Constructor.
PersistentDataQuery(String typeName)
          Constructor.
 
Method Summary
static PersistentDataQuery create(BebopObjectType type, String description, String name)
          Creates a new persitent data query, initialising the required attributes
static PersistentDataQuery findByName(BebopObjectType type, String name)
          Retrieves the persistent data query with the specified fully qualified pdl query name
 String getBaseDataObjectType()
          Returns the base data object type for this domain object class.
 String getDescription()
          Retrieves the pretty name of the query
 String getName()
          Retrieves the fully qualified pdl query name
static Collection getQueries(BebopObjectType type)
          Retrieves a collection of all the PersistentDataQuery objects in the data base
 BebopObjectType getType()
          Retrieves the package to which this meta object is scoped.
 BigDecimal getTypeId()
          Retrieves the id of the packge to whcih this meta object is scoped
 void setDescription(String description)
          Sets teh pretty name of the query
 void setName(String name)
          Sets the pdl query name
 void setType(BebopObjectType type)
          Sets the package to which this meta object is scoped.
 void setTypeId(BigDecimal pack)
          Sets the package to which this meta object is scoped
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

TYPE_ID

public static final String TYPE_ID
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

PersistentDataQuery

public PersistentDataQuery()
Constructor. Creates a new persistent data query


PersistentDataQuery

public PersistentDataQuery(String typeName)
Constructor. Used by subclasses to create a data query with a different base data object type

Parameters:
typeName - the base data object type

PersistentDataQuery

public PersistentDataQuery(ObjectType type)
Constructor. Used by subclasses to create a data query with a different base data object type.

Parameters:
type - the data object type

PersistentDataQuery

public PersistentDataQuery(DataObject obj)
Constructor. Instantiates a new persistent data query from a previously retrieved data object

Parameters:
obj - the data object

PersistentDataQuery

public PersistentDataQuery(BigDecimal id)
                    throws DataObjectNotFoundException
Constructor. Instantiates a new persistent data query by retrieving a data object with the specified id.

Parameters:
id - the id of the data object

PersistentDataQuery

public PersistentDataQuery(OID oid)
                    throws DataObjectNotFoundException
Constructor. Used by subclasses to retrieve a persistent data query with a specified oid.

Parameters:
oid - the oid of the data object
Method Detail

getBaseDataObjectType

public String getBaseDataObjectType()
Description copied from class: DomainObject
Returns the base data object type for this domain object class. Intended to be overrided by subclasses whenever the subclass will only work if their primary data object is of a certain base type.

Overrides:
getBaseDataObjectType in class ACSObject

getQueries

public static Collection getQueries(BebopObjectType type)
Retrieves a collection of all the PersistentDataQuery objects in the data base


findByName

public static PersistentDataQuery findByName(BebopObjectType type,
                                             String name)
                                      throws DataObjectNotFoundException
Retrieves the persistent data query with the specified fully qualified pdl query name

Throws:
DataObjectNotFoundException

create

public static PersistentDataQuery create(BebopObjectType type,
                                         String description,
                                         String name)
Creates a new persitent data query, initialising the required attributes

Parameters:
description - the pretty name for the query
name - the fully qualified pdl query name

setTypeId

public void setTypeId(BigDecimal pack)
Sets the package to which this meta object is scoped

Parameters:
pack - the id of the package

getTypeId

public BigDecimal getTypeId()
Retrieves the id of the packge to whcih this meta object is scoped


setType

public void setType(BebopObjectType type)
Sets the package to which this meta object is scoped.


getType

public BebopObjectType getType()
                        throws DataObjectNotFoundException
Retrieves the package to which this meta object is scoped.

Throws:
DataObjectNotFoundException

getDescription

public String getDescription()
Retrieves the pretty name of the query


setDescription

public void setDescription(String description)
Sets teh pretty name of the query

Parameters:
description - the new pretty name

getName

public String getName()
Retrieves the fully qualified pdl query name


setName

public void setName(String name)
Sets the pdl query name

Parameters:
name - the fully qualified pdl query name


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC