com.arsdigita.formbuilder
Class PersistentFormSection

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.auditing.AuditedACSObject
                  extended bycom.arsdigita.formbuilder.PersistentComponent
                      extended bycom.arsdigita.formbuilder.PersistentFormSection
All Implemented Interfaces:
AttributeMetaDataProvider, Audited, CompoundComponent, PersistentComponentFactory, PersistentContainer
Direct Known Subclasses:
PersistentForm

public class PersistentFormSection
extends PersistentComponent
implements PersistentContainer, CompoundComponent

This domain object manages persistence of a Bebop FormSection.

Version:
$Id: //core-platform/dev/src/com/arsdigita/formbuilder/PersistentFormSection.java#14 $
Author:
Peter Marklund

Field Summary
static String BASE_DATA_OBJECT_TYPE
          BASE_DATA_OBJECT_TYPE represents the full name of the underlying DataObject of this class.
static String versionId
           
 
Fields inherited from class com.arsdigita.formbuilder.PersistentComponent
ATTRIBUTE_STRING
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
  PersistentFormSection()
          Constructor that creates a new form domain object that can be saved to the database later on.
  PersistentFormSection(BigDecimal id)
          Constructor that retrieves an existing form domain object from the database.
  PersistentFormSection(DataObject obj)
           
  PersistentFormSection(ObjectType type)
           
protected PersistentFormSection(OID oid)
          For sub classes to use.
  PersistentFormSection(String objectType)
          To be used by sub classes only.
 
Method Summary
 void addComponent(PersistentComponentFactory componentFactory)
          Add a component after the already added components (in the last position).
 void addComponent(PersistentComponentFactory componentFactory, int position)
          Add a child component of the form.
protected  void addComponents(FormSection formSection)
          Add all child components to the FormSection.
 void addProcessListener(PersistentProcessListener listener)
           
protected  void addProcessListeners(FormSection formSection)
          Instantiate a process listener with the persisted class name and add it to the Bebop Form.
 void clearComponents()
          Delete all component associations from this container
 void clearProcessListeners()
           
 Component createComponent()
          Create a Bebop FormSection using the persistent information in this form section domain object.
 void delete()
          I am overriding this method to delete all associations with components before the form is deleted.
 Collection getComponents()
          Return all children components represented by their PersistentComponentFactory objects.
 Container getFormContainer()
          Get the container that the persistent form will use (for example a ColumnPanel with a certain number of columns).
 Iterator getProcessListeners()
           
 void moveComponent(PersistentComponentFactory componentFactory, int toPosition)
          Move component to new position.
 void removeComponent(PersistentComponentFactory componentFactory)
          Remove a component from the form.
 void removeProcessListener(PersistentProcessListener listener)
           
 void setComponentAddObserver(ComponentAddObserver observer)
           
 void setFormContainer(Container container)
          Set the container that the persistent form will use (for example a ColumnPanel with a certain number of columns).
 
Methods inherited from class com.arsdigita.formbuilder.PersistentComponent
beforeSave, getAdminName, getAttributeMetaData, getComponentAttribute, getDescription, setAdminName, setComponentAttribute, setDescription, setDomainClass
 
Methods inherited from class com.arsdigita.auditing.AuditedACSObject
getCreationDate, getCreationIP, getCreationUser, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, initialize
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, 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, 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
 
Methods inherited from interface com.arsdigita.formbuilder.PersistentComponentFactory
getID, isNew, save
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
BASE_DATA_OBJECT_TYPE represents the full name of the underlying DataObject of this class.

See Also:
Constant Field Values
Constructor Detail

PersistentFormSection

public PersistentFormSection()
Constructor that creates a new form domain object that can be saved to the database later on.


PersistentFormSection

public PersistentFormSection(String objectType)
To be used by sub classes only.


PersistentFormSection

public PersistentFormSection(ObjectType type)

PersistentFormSection

public PersistentFormSection(DataObject obj)

PersistentFormSection

public PersistentFormSection(BigDecimal id)
                      throws DataObjectNotFoundException
Constructor that retrieves an existing form domain object from the database.

Parameters:
id - The object id of the form domain object to retrieve

PersistentFormSection

protected PersistentFormSection(OID oid)
                         throws DataObjectNotFoundException
For sub classes to use.

Method Detail

delete

public void delete()
I am overriding this method to delete all associations with components before the form is deleted. The components themselves are not deleted.

Specified by:
delete in interface PersistentComponentFactory
Overrides:
delete in class DomainObject
See Also:
DataObject.delete()

addComponent

public void addComponent(PersistentComponentFactory componentFactory)
Add a component after the already added components (in the last position). If this domain object has not been saved (with save()) before you invoke this method it will be saved by this method.

Specified by:
addComponent in interface PersistentContainer

addComponent

public void addComponent(PersistentComponentFactory componentFactory,
                         int position)
Add a child component of the form. If this domain object has not been saved (with save()) before you invoke this method it will be saved by this method.

Specified by:
addComponent in interface PersistentContainer
Parameters:
position - The count of this component starting with 1 (i.e. if it's the third component to be added to the form this value would be 3)

removeComponent

public void removeComponent(PersistentComponentFactory componentFactory)
Remove a component from the form. If this domain object has not been saved (with save()) before you invoke this method it will be saved by this method.

Specified by:
removeComponent in interface PersistentContainer

moveComponent

public void moveComponent(PersistentComponentFactory componentFactory,
                          int toPosition)
Move component to new position.

Specified by:
moveComponent in interface PersistentContainer
Parameters:
toPosition - The position to move the component to. Positions start with 1.

clearComponents

public void clearComponents()
Delete all component associations from this container

Specified by:
clearComponents in interface PersistentContainer

createComponent

public Component createComponent()
Create a Bebop FormSection using the persistent information in this form section domain object.

Specified by:
createComponent in interface PersistentComponentFactory
Specified by:
createComponent in class PersistentComponent

getComponents

public Collection getComponents()
Return all children components represented by their PersistentComponentFactory objects.


addProcessListeners

protected void addProcessListeners(FormSection formSection)
Instantiate a process listener with the persisted class name and add it to the Bebop Form.


addComponents

protected void addComponents(FormSection formSection)
Add all child components to the FormSection. Each persisted component has an associated PersistentComponentFactory that can be resurrected with the id of the component. The Bebop components are created with the createComponent() method of their factory.


setComponentAddObserver

public void setComponentAddObserver(ComponentAddObserver observer)
Specified by:
setComponentAddObserver in interface CompoundComponent

addProcessListener

public void addProcessListener(PersistentProcessListener listener)

removeProcessListener

public void removeProcessListener(PersistentProcessListener listener)

clearProcessListeners

public void clearProcessListeners()

getProcessListeners

public Iterator getProcessListeners()

setFormContainer

public void setFormContainer(Container container)
Set the container that the persistent form will use (for example a ColumnPanel with a certain number of columns). This property is not yet persisted.


getFormContainer

public Container getFormContainer()
Get the container that the persistent form will use (for example a ColumnPanel with a certain number of columns). This property is not yet persisted.



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