com.arsdigita.formbuilder
Class MetaObject

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

public class MetaObject
extends ACSObject

The MetaObject class maintains the meta-information required by the formbuilder UI for creating and editing the attributes of persistent objects.


Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String CLASS_NAME
           
static String PRETTY_NAME
           
static String PRETTY_PLURAL
           
static String PROPERTIES_FORM
           
static String TYPE_ID
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE, versionId
 
Constructor Summary
MetaObject()
          Default constructor.
MetaObject(BigDecimal id)
          Constructor.
MetaObject(DataObject obj)
          Constructor.
MetaObject(ObjectType type)
          Constructor used by subclasses when creating a new meta object.
MetaObject(OID oid)
          Constructor.
MetaObject(String typeName)
          Constructor used by subclasses when creating a new meta object.
 
Method Summary
static MetaObject create(BebopObjectType type, String prettyName, String prettyPlural, String className, String propertiesForm)
          Creates a new meta object, initialising all the default attributes
static MetaObject findByClass(BebopObjectType type, Class name)
          Returns the meta object associated with a particular class.
static MetaObject findByClassName(BebopObjectType type, String name)
          Returns the meta object associated with a particular class.
 String getPrettyName()
          Gets the pretty name for the meta object
 String getPrettyPlural()
          Gets the pretty plural name for the meta object
 Class getPropertiesForm()
          Gets the class used to create and edit instances of the widget represented by this meta object.
 String getPropertiesFormName()
          Gets the class used to create and edit instances of the widget represented by this meta object.
 BebopObjectType getType()
          Retrieves teh object type for the meta object
 Class getWidgetClass()
          Gets the class represented by this meta object
 String getWidgetClassName()
          Gets the widget class name for the meta object
static MetaObjectCollection getWidgets(BebopObjectType type)
          Retrieves a collection of all the meta objects related to a particular object type
static MetaObjectCollection getWidgets(String app, Class type)
          Retrieves a collection of all the meta objects related to a particular object type
static MetaObjectCollection getWidgets(String app, String className)
          Retrieves a collection of all the meta objects related to a particular object type
static MetaObject retrieve(DataObject obj)
           
 void setPrettyName(String name)
          Sets the pretty name for the meta object
 void setPrettyPlural(String name)
          Sets the pretty plural name for the meta object
 void setPropertiesForm(Class type)
          Sets the class used to create and edit instances of the widget represented by this meta object.
 void setPropertiesFormName(String name)
          Sets the class name used to create and edit instances of the widget represented by this meta object.
 void setType(BebopObjectType type)
          Sets the object type for the meta object
protected  void setup(BebopObjectType type, String prettyName, String prettyPlural, String className, String propertiesForm)
          This method is intended to be called by static create methods to setup any required attributes when creating a new meta object.
 void setWidgetClass(Class type)
          Sets the widget class that this meta object represents
 void setWidgetClassName(String name)
          Sets the widget class name for the meta object
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, 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

PRETTY_NAME

public static final String PRETTY_NAME
See Also:
Constant Field Values

PRETTY_PLURAL

public static final String PRETTY_PLURAL
See Also:
Constant Field Values

CLASS_NAME

public static final String CLASS_NAME
See Also:
Constant Field Values

PROPERTIES_FORM

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

MetaObject

public MetaObject()
Default constructor. This creates a new meta object.


MetaObject

public MetaObject(String typeName)
Constructor used by subclasses when creating a new meta object.

Parameters:
typeName - the base data object type

MetaObject

public MetaObject(ObjectType type)
Constructor used by subclasses when creating a new meta object.

Parameters:
type - the base data object type

MetaObject

public MetaObject(DataObject obj)
Constructor. Used to instantiate a meta object from a previously retrieved data object.

Parameters:
obj - the data object

MetaObject

public MetaObject(BigDecimal id)
           throws DataObjectNotFoundException
Constructor. Used to retrieve a meta object from the data base.

Parameters:
id - the id of the object to retrieve

MetaObject

public MetaObject(OID oid)
           throws DataObjectNotFoundException
Constructor. Used by subclasses to retrieve a meta object with a different base data object type.

Method Detail

create

public static MetaObject create(BebopObjectType type,
                                String prettyName,
                                String prettyPlural,
                                String className,
                                String propertiesForm)
Creates a new meta object, initialising all the default attributes

Parameters:
type - the ObjectType related to the meta object
prettyName - the pretty name of the object
prettyPlural - the plural of the pretty name
className - the fully qualified java class name of the object whose meta information is being maintained
propertiesForm - the name of a subclass of PropertiesForm used to create and edit the object.

setup

protected void setup(BebopObjectType type,
                     String prettyName,
                     String prettyPlural,
                     String className,
                     String propertiesForm)
This method is intended to be called by static create methods to setup any required attributes when creating a new meta object.

Parameters:
type - the BebopObjectType related to the meta object
prettyName - the pretty name of the object
prettyPlural - the plural of the pretty name
className - the fully qualified java class name of the object whose meta information is being maintained
propertiesForm - the name of a subclass of PropertiesForm used to create and edit the object.

retrieve

public static MetaObject retrieve(DataObject obj)

findByClass

public static MetaObject findByClass(BebopObjectType type,
                                     Class name)
                              throws DataObjectNotFoundException
Returns the meta object associated with a particular class.

Parameters:
name - the class to find the meta object for
Throws:
com.arsdigita.domainDataObjectNotFoundException - if no meta object could be found for this specified class
DataObjectNotFoundException

findByClassName

public static MetaObject findByClassName(BebopObjectType type,
                                         String name)
                                  throws DataObjectNotFoundException
Returns the meta object associated with a particular class.

Parameters:
name - the name of the class to find the meta object for
Throws:
com.arsdigita.domainDataObjectNotFoundException - if no meta object could be found for this specified class
DataObjectNotFoundException

getWidgets

public static MetaObjectCollection getWidgets(String app,
                                              String className)
                                       throws DataObjectNotFoundException
Retrieves a collection of all the meta objects related to a particular object type

Parameters:
className - the name of the object type to retrieve objects for.
Throws:
DataObjectNotFoundException - if there is no object type matching the className parameter

getWidgets

public static MetaObjectCollection getWidgets(String app,
                                              Class type)
                                       throws DataObjectNotFoundException
Retrieves a collection of all the meta objects related to a particular object type

Throws:
DataObjectNotFoundException - if there is no object type matching the class parameter

getWidgets

public static MetaObjectCollection getWidgets(BebopObjectType type)
Retrieves a collection of all the meta objects related to a particular object type

Parameters:
type - the object type to retrieve objects for.

setType

public void setType(BebopObjectType type)
Sets the object type for the meta object

Parameters:
type - the new object type

getType

public BebopObjectType getType()
                        throws DataObjectNotFoundException
Retrieves teh object type for the meta object

Throws:
DataObjectNotFoundException - if the object type could not be retrieved

setPrettyName

public void setPrettyName(String name)
Sets the pretty name for the meta object

Parameters:
name - the new pretty name

getPrettyName

public String getPrettyName()
Gets the pretty name for the meta object

Returns:
the pretty name

setPrettyPlural

public void setPrettyPlural(String name)
Sets the pretty plural name for the meta object

Parameters:
name - the new pretyy plural name

getPrettyPlural

public String getPrettyPlural()
Gets the pretty plural name for the meta object


setWidgetClass

public void setWidgetClass(Class type)
Sets the widget class that this meta object represents

Parameters:
type - the class of the widget

getWidgetClass

public Class getWidgetClass()
                     throws ClassNotFoundException
Gets the class represented by this meta object

Throws:
ClassNotFoundException

setWidgetClassName

public void setWidgetClassName(String name)
Sets the widget class name for the meta object

Parameters:
name - the name of the widget class

getWidgetClassName

public String getWidgetClassName()
Gets the widget class name for the meta object


setPropertiesForm

public void setPropertiesForm(Class type)
Sets the class used to create and edit instances of the widget represented by this meta object. The class should be a subclass of PropertiesEditor or PropertiesForm

Parameters:
type - the class for the form

getPropertiesForm

public Class getPropertiesForm()
                        throws ClassNotFoundException
Gets the class used to create and edit instances of the widget represented by this meta object.

Throws:
ClassNotFoundException

setPropertiesFormName

public void setPropertiesFormName(String name)
Sets the class name used to create and edit instances of the widget represented by this meta object. The class should be a subclass of PropertiesEditor or PropertiesForm

Parameters:
name - the fully qualified class name

getPropertiesFormName

public String getPropertiesFormName()
Gets the class used to create and edit instances of the widget represented by this meta object.



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