ui 
[ doc home ] [ class tree: ui ] [ index: ui ] [ all elements ]

Class: IsterUIFormConnector

Source Location: /IsterUIFormConnector.php

Class Overview

IsterObject
   |
   --IsterAttributeSet
      |
      --IsterFilterOwner
         |
         --IsterUIBase
            |
            --IsterUIComponent
               |
               --IsterUIFormConnector

This class represents a connection of a form object and a data object.


Author(s): Ingo Schramm   

Copyright: Copyright (c) 2005 Ister.ORG Ingo Schramm

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: IsterUIComponent

IsterUIComponent::IsterUIComponent()
Constructor
IsterUIComponent::applySecurityPolicies()
Apply the IsterHttpSecurityPolicies to the request and to pathinfo.
IsterUIComponent::defineSql()
Define a SQL function on the component's IsterSQLFunction object.
IsterUIComponent::isCheckable()
Test for a checkable attribute.
IsterUIComponent::run()
Execute this object.
IsterUIComponent::setCheckable()
IsterUIComponent::toString()
Return a string representation of this component.

Class: IsterUIBase

IsterUIBase::IsterUIBase()
Constructor
IsterUIBase::catString()
Concat $str parameter to $this->string property.
IsterUIBase::getApplication()
Get the objet's IsterAppMain object.
IsterUIBase::getFramework()
Get the objet's IsterUIFramework object.
IsterUIBase::getName()
Get the objet's name.
IsterUIBase::getRequired()
Returns bitmask of required objects.
IsterUIBase::getSqlFunction()
Get the objet's IsterSqlFunction object.
IsterUIBase::getTemplate()
Get the objet's IsterTemplate object.
IsterUIBase::hasTemplate()
IsterUIBase::setApplication()
Set the application object.
IsterUIBase::setDescription()
Set the description object.
IsterUIBase::setFramework()
Set the objet's IsterUIFramework object.
IsterUIBase::setName()
Set the object's name
IsterUIBase::setSqlFunction()
Set the objet's IsterSqlFunction object.
IsterUIBase::setTemplate()
Set the objet's IsterTemplate object.
IsterUIBase::test()
Test if some objects exist.
IsterUIBase::toString()
Return a string representation of this object.

Class: IsterFilterOwner

IsterFilterOwner::IsterFilterOwner()
Constructor
IsterFilterOwner::apply()
Apply all filters in order of definition.
IsterFilterOwner::deleteFilter()
Delete a filter.
IsterFilterOwner::getFilter()
Get a filter.
IsterFilterOwner::getFilterNames()
Get an array with all filter names.
IsterFilterOwner::hasFilters()
Return number of filters.
IsterFilterOwner::setFilter()
Add an IsterBufferFilter.

Class: IsterAttributeSet

IsterAttributeSet::IsterAttributeSet()
Constructor
IsterAttributeSet::addAttribute()
depricated
IsterAttributeSet::addAttributeReference()
depricated
IsterAttributeSet::addAttributesArray()
depricated
IsterAttributeSet::delete()
Delete all attributes.
IsterAttributeSet::deleteAttribute()
Delete an aAttribute.
IsterAttributeSet::getAttribute()
Get the value of an attribute.
IsterAttributeSet::getAttributeNames()
Return an array containing the names of all attributes.
IsterAttributeSet::getAttributeReference()
Get the reference value of an attribute.
IsterAttributeSet::getAttributesArray()
Get all attributes.
IsterAttributeSet::hasAttribute()
Check whether an attribute has been set.
IsterAttributeSet::setAttribute()
Set a new attribute or overwrite an already existing attribute.
IsterAttributeSet::setAttributeReference()
Set an attribute and store only a reference of the attribute.
IsterAttributeSet::setAttributesArray()
Set an array of key value pairs, each pair an attribute.

Class: IsterObject

IsterObject::IsterObject()
Constructor
IsterObject::abstractMethodError()
Report attempt to call an abstract method.
IsterObject::addLogger()
Add an IsterLogger to process log messages.
IsterObject::deleteLogger()
Delete an already registered IsterLogger.
IsterObject::getLoggerNames()
Fetch the names of all currently registered IsterLoggers.
IsterObject::getMem()
Return maximum amount of memory an application has allocated at this point.
IsterObject::log()
Trigger a log message.
IsterObject::passPHPmessage()
Catch PHP E_WARNING and E_NOTICE messages.
IsterObject::serialize()
Serialize the object.
IsterObject::setLogLocal()
Set logging local for the current object.
IsterObject::setupLogger()
Setup a logger.
IsterObject::triggerError()
Alias for log();
IsterObject::unserialize()
Unserialize the object.
IsterObject::__sleep()
Executed prior to serialize().
IsterObject::__wakeup()
Executed prior to unserialize().

Class Details

This class represents a connection of a form object and a data object.

The form object and the data object will be created by an XML description. If data are present in the request (either GET or POST), the data object will be updated by the form data and the requested action will be executed at the data object (select, update etc.). If no data has been sent, the form will be updated by the data object if an ID has been set to the object and the object could be found in the database. If no ID has been set, the data object's makeID() method will be called with the current IsterAppMain object to make an ID by the current session state or request. Finally, if a template has been set the template will be executed with the values of the form fields used as template variables.


copyright:  Copyright (c) 2005 Ister.ORG Ingo Schramm
author:  Ingo Schramm
see:  IsterUIForm, IsterSqlDataObject, IsterUIDescFactory
example:  example not found


[ Top ]


Class Methods


constructor IsterUIFormConnector

IsterUIFormConnector IsterUIFormConnector( )

Constructor

$this->required = $this->required | ISTER_UI_REQ_APPLICATION | ISTER_UI_REQ_TEMPLATE | ISTER_UI_REQ_SQL;


[ Top ]

method getDataObject

object IsterSqlDataObject &getDataObject( )

Get the data object by reference.

[ Top ]

method getForm

object IsterUIForm &getForm( )

Get the form object by reference.

[ Top ]

method newAction

boolean newAction( array $action)

Callback method called from IsterUIConDesc.

Parameters:

array   $action  

[ Top ]

method newField

boolean newField( array $descr)

Callback method called from IsterUIConDesc.

Parameters:

array   $descr  

[ Top ]

method newForm

boolean newForm( array $form)

Callback method called from IsterUIConDesc.

If no form object was set, this method tries to instantiate a new form object following the current description. Note that it is impossible for automatically created form objects to pass custom parameters to the constructor.


Parameters:

array   $form  

[ Top ]

method newGroup

boolean newGroup( string $descr, array $group)

Callback method called from IsterUIConDesc.

Parameters:

string   $descr  
array   $group  

[ Top ]

method newObject

boolean newObject( array $descr)

Callback method called from IsterUIConDesc.

If no data object was set, this method tries to instantiate a new data object following the current description. Also, the setFunctionNames() method of the data object is called due to the description. Note that it is impossible for automatically created data objects to pass custom parameters to the constructor.


Parameters:

array   $descr  

[ Top ]

method run

boolean run( )

Execute the current connector.

If no data are present in the current $request object, the form will be updated by the data object, otherwiese vice versa.


Overrides IsterUIComponent::run() (Execute this object.)

[ Top ]

method setApplication

boolean setApplication( object IsterAppMain &$app)

Set the application object.

This method automatically creates an IsterHttpSecurityPolicy for the current request but not for pathinfo (may change in the future).


Overrides IsterUIBase::setApplication() (Set the application object.)

Parameters:

object IsterAppMain   &$app  

[ Top ]

method setDataObject

boolean setDataObject( object IsterSqlDataObject &$object)

Set the data object.

Usually the data object will automatically be created by the connector.


Parameters:

object IsterSqlDataObject   &$object  

[ Top ]

method setForm

boolean setForm( object IsterUIForm &$form)

Set the form.

Usually, a form will automatically be created by the connector. If you set it yourself, you should not forget to set the form's request also to the connector using setApplication(). If you already set an IsterHttpSecurityPolicy to the form it will be overridden by the connector following the rules of the description.


Parameters:

object IsterUIForm   &$form  

[ Top ]

method setID

boolean setID( mixed $id)

Set the data object's unique identifier.

This will be used only if the data object is automatically created. The default object id is 0.


Parameters:

mixed   $id  

[ Top ]

method toString

string toString( )

Return a string representation of this object.

In the template you can access each form field by its name. Missing required form fields can be accessed by '<name>_MISSED'. The '*_MISSED' variables are only defined and set to 1 if the field is actually missing. The same holds true for '<name>_MARKED' variables indicating all fields marked by the current security policy.

Also the object's columns are added to the template, but form fields with the same name as a column overwrite the column in the template.

Note: the template will be destroyed by this method.


Overrides IsterUIComponent::toString() (Return a string representation of this component.)

[ Top ]

method updateDataObject

boolean updateDataObject( )

Update data object's properties by form field.

This will automatically apply the current security policy.


[ Top ]

method updateForm

boolean updateForm( )

Update form fields by data object's properties.

If a column for a given form field is not found, this field will be filled with its default value if defined in the description. If no id has been set for data object, the data object's makeID() method will be called which may set an ID.


[ Top ]


Documentation generated on Tue, 20 Dec 2005 11:21:31 +0100 by phpDocumentor 1.3.0RC4