Products.MightyCal.DataEntry.DataEntryTransaction (version 1.17) | index /home/zope/lib/python/Products/MightyCal/DataEntry/DataEntryTransaction.py |
DataEntryTransaction object: A temporary holding spot for the data that a user enters in the process of creating an Event or updating a current one. A DataEntryTransaction object is created when the user requests the creation of a new Event, or requests to edit a current Event. The DataEntryTransaction is filled with slots for each of the DataTypes that its corresponding EventType needs, and these slots are filled with default data values (for a new Event) or the current values of the Event (for an edit). WidgetMakers use DataEntryTransactions to paint the widgets they create. Instead of doing directly to the DataType object that contains the current data, the current field value is looked up in the DataEntryTransaction object. In addition, in the case that a previous attempt to submit this data has failed, the field in the DataEntryTransaction will be marked with an error flag and message, and the WidgetMaker can style its resulting widget appropriate to indicate the erroneous value. When the user submits a form in a user agent, the form's values are reassembled into complete field values by means of the WidgetMaker that produced the edit widgets to begin with. These reassembled values are placed into the DataEntryTransaction, when is then submitted to the EventType for validation. Any invalid fields are marked as such, and also have the corresponding error message associated with them. If a DataEntryTransaction is found to be valid, an Event object is obtained (either the one that is to be updated, or a new empty one), and the Event and the DataEntryTransaction object are given to the EventType for setting the new values in the Event object. A success flag is then returned to the routine that handles interacting with the user agent, so that it can paint an appropriate Success screen. In addition, the DataEntryTransaction is marked as "terminated", so that it can eventually be deleted from the TempFolder that is resides in (a ZCron job handles doing this periodically). If a DataEntryTransaction is found to be invalid, a failure flag is sent back to the routine that communicates with the user agent. An appropriate failure screen can be printed, or else the user can be redirected back to the Edit screen, with the bad fields highlighted. The ID of the current DataEntryTransaction is embedded in the form values of this Edit screen, so that when the user re-submits the page, the DataEntryTransaction can be looked up and updated with the corrected values, and revalidated, as in the process described above.
Modules | ||||||
|
Classes | ||||||||||||||||||
|
Data | ||
CHECKBOX_WIDGET = 'CheckboxWidget' COCOON_HTML_WIDGET_MAKER = 'CocoonHTMLWidgetMaker' COMMAND_PARAM = 'command' DATA_ENTRY_TRANSACTION = 'DataEntryTransaction' DATE_WIDGET = 'DateWidget' EDITOR_SEPARATOR_CELL_CLASS = 'event-edit-separator-cell' EDITOR_TITLE_CELL_CLASS = 'event-edit-title-cell' EDITOR_VALUE_CELL_CLASS = 'event-edit-value-cell' EVENT_EDIT_DTML_METHOD = 'event_entry' EVENT_ID_PARAM = 'eventId' EVENT_OBJECT = 'Event' EVENT_TYPE_PARAM = 'eventType' FALSE = 0 FIELD_ID_PARAM = 'fieldId' FIELD_VALUE_PARAM = 'fieldValue' GET_FIELD_IDS_COMMAND = 'get-field-ids' GET_HIDDEN_INPUT_COMMAND = 'get-hidden-input' GET_TRANSACTION_COMMAND = 'get-transaction' GET_WIDGET_COMMAND = 'get-widget' INFO = 0 LABEL_FIELD = 'label' LIST_WIDGET = 'ListWidget' MEMO_WIDGET = 'MemoWidget' NEW_EVENT_ID = 'newEvent' PROP_EDITORS = 'PropEditors' RADIO_WIDGET = 'RadioWidget' RESULT_BAD_COMMAND_ERROR = '501' RESULT_INTERNAL_ERROR = '500' RESULT_OK = '200' RESULT_PERMISSION_ERROR = '300' RESULT_STATUS_SLOT = 'status' RESULT_VALIDATION_ERROR = '400' RESULT_VALUE_SLOT = 'return-value' SELECT_WIDGET = 'SelectWidget' STYLE_BASE = 'StyleBase' STYLE_FOR_ERROR = 'StyleForError' SUBMIT_TRANSACTION_COMMAND = 'submit' TEXT_WIDGET = 'TextWidget' TRANSACTION_ID_PARAM = 'transId' TRUE = 1 TR_TAG = 'tr' USER_AGENT_PARAM = 'user-agent' VALUE_FIELD = 'value' WIDGET_MAKER_BASE = 'WidgetMaker' WIDGET_MAKER_REGISTRY = 'WidgetMakerRegistry' ZOPE_WIDGET_MAKER = 'ZopeWidgetMaker' __file__ = '/home/zope/lib/python/Products/MightyCal/DataEntry/DataEntryTransaction.pyc' __name__ = 'Products.MightyCal.DataEntry.DataEntryTransaction' __version__ = '$Revision: 1.17 $' |