Class midcom_helper_datamanager2_controller_simple

Description

Datamanger 2 Data Manager simple controller class.

This is a very simple controller class intended for usage directly with a storage backend. It has no creation support whatsoever, but the multi-edit loop will work without problems. The form will only be synchronized with the datamanager if validation succeeds. (Naturally, types operating directly on blobs / parameters are exempt of this.)

You need to set both datamanager and (thus) schema database before initializing.

Located in /midcom.helper.datamanager2/controller/simple.php (line 22)

PEAR
   |
   --midcom_baseclasses_core_object
      |
      --midcom_baseclasses_components_purecode
         |
         --midcom_helper_datamanager2_controller
            |
            --midcom_helper_datamanager2_controller_simple
Method Summary
 bool initialize ()
 string process_form ()
Variables
Methods
initialize (line 29)

Empty default implementation, this calls won't do much.

  • return: Indicating success.
bool initialize ()

Redefinition of:
midcom_helper_datamanager2_controller::initialize()
Empty default implementation, this calls won't do much.
process_form (line 76)

This funciton wraps the form manager processing. Ifprocessing is successful, (that is, only 'save'). If editing was successful, the form is frozen in case you want to display it again (usually you want to redirect to the view target).

There are several possible return values:

  • save and the variants next and previous (for wizard usage) suggest successful form processing. The form has already been validated, synchronized with and saved to the data source.
  • cancel the user cancelled the form processing, no I/O has been done.
  • edit, previous, next indicates that the form is not yet successfully completed. This can mean many things, including validation errors, which the renderer already outlines in the Form output. No I/O processing has been done.
The form will be automatically validated for 'save' and 'next', but not for 'previous'. If you want to have save the data for example even during 'next', you need to call datamanager->save after this function returned the according return code.

Normally, all validation should be done during the Form processing, but sometimes this is not possible. These are the cases where type validation rules fail instead of form validation ones. At this time, the integration of type validation is rudimentary and will transparently return edit instead of validation.

  • return: One of 'save', 'cancel', 'next', 'previous', 'edit', depending on the schema configuration.
  • todo: Integrate type validation checks cleanly.
string process_form ()

Redefinition of:
midcom_helper_datamanager2_controller::process_form()
This function should process the form data sent to the server. Its behavoir is dependant on the controller used, see the individual class documentations for details.

Inherited Methods

Inherited From midcom_helper_datamanager2_controller

 midcom_helper_datamanager2_controller::midcom_helper_datamanager2_controller()
 midcom_helper_datamanager2_controller::create()
 midcom_helper_datamanager2_controller::display_form()
 midcom_helper_datamanager2_controller::initialize()
 midcom_helper_datamanager2_controller::load_schemadb()
 midcom_helper_datamanager2_controller::process_form()
 midcom_helper_datamanager2_controller::set_schemadb()
 midcom_helper_datamanager2_controller::set_storage()

Inherited From midcom_baseclasses_components_purecode

 midcom_baseclasses_components_purecode::midcom_baseclasses_components_purecode()
 midcom_baseclasses_components_purecode::_bind_to_request_data()
 midcom_baseclasses_components_purecode::_load_topic_configuration()

Inherited From midcom_baseclasses_core_object

 midcom_baseclasses_core_object::midcom_baseclasses_core_object()

Documentation generated on Tue, 15 Aug 2006 12:56:07 +0300 by phpDocumentor 1.3.0RC3