Products.MightyCal.DataEntry.WidgetMakers (version 1.14)
index
/home/zope/lib/python/Products/MightyCal/DataEntry/WidgetMakers.py

Field edit widget definitions for the MightyCal product.  WidgetMaker objects are intended
to provide the ability to generate input/edit widgets for many different situations, as well
as isolating all widget construction logic from the modules that deal with data directly.
 
In addition to generating the HTML (or WML, or what have you) for the widget, the WidgetMaker
also has the ability to process the data returned from a submission event, and turn it back into
appropriate larger chunks.  For instance, date widgets may allow for several <select> widgets to
be created for entering each part of the date.  The WidgetMaker that creates those <select> boxes
needs to know how to combine the various return values from those boxes into a single date.

 
Modules
            
Dumper
os
re
string
types

 
Classes
            
Products.MightyCal.SItem.SItem(OFS.SimpleItem.Item, Acquisition.Acquirer, Acquisition.ExplicitAcquirer, OFS.PropertyManager.PropertyManager, Persistence.Persistent, AccessControl.Role.RoleManager)
AbstractWidgetMaker
CocoonHTMLWidgetMaker
ZopeWidgetMaker

 
class AbstractWidgetMaker
      Base class for all widget makers.  A WidgetMaker implements the following Zope interfaces:   * Acquisiton.Explicit: Gives the ability to lookup objects in the ZODB (Zope Database) * Persistent: Allows the object to be stored persistently in the ZODB * OFS.Item: Allows us to store WidgetManagers in a Zope Folder
 
  
_getClassParam(self, style)
If 'style' is defined, setup a 'class="error-widget"' attribute for the widget, so that the resulting widget can be colored red, or whatever the administrator chooses
_makeListWidget(self, name, value, valuePairs, style)
Generate a widget that provides for selecting multiple values from a long SELECT box
_makeMemoWidget(self, name, value, rows, cols, style)
Create a standard TEXTAREA widget for editing a long string
_makeRadioWidget(self, name, value, buttonValues, style)
Generate a single-row set of radio-buttons, with label/button pairs next to each other
_makeSelectWidget(self, name, value, valuePairs, style)
Generate a simple SELECT widget
_makeTextWidget(self, name, value, width, style)
Make a basic text box widget for editing shorter strings
parseFields(self, dataEntryTransaction, fieldId, requestParams)
Given a data type object and some user input, find all of the pieces of the Request that pertain to a particular data type's input, and reconstruct a single string that represents the user's complete input for that field

 
class CocoonHTMLWidgetMaker
      Widget maker that makes HTML widgets for the Cocoon frontend
 
  
__init__(self)
Initialize the methods that get called for various DataType objects
_constructDateWidget(self, datePieces, yearRange, styleBase, nameBase)
Put together a set of <select> controls for specifying a date
_generateForBooleanDataType(self, trans, fieldId, options)
Return an HTML table that provides an editor for setting values for a field of this ContentType
_generateForCalendarDataType(self, trans, fieldId, options)
Return HTML snippet that will provide for choosing Calendars
_generateForDateTimeDataType(self, trans, fieldId, options)
Generate a multi-part widget for selecting a date
_generateForIntegerDataType(self, trans, fieldId, options)
Generate a simple widget for editing an integer
_generateForMemoDataType(self, trans, fieldId, options)
Generate a simple widget for editing a string
_generateForMultiValueDataType(self, trans, fieldId, options)
Return HTML snippet that will provide for editing a MultiValue data type
_generateForStringDataType(self, trans, fieldId, options)
Generate a simple widget for editing a string
_generateForUserDataType(self, trans, fieldId, options)
Return HTML snippet that will provide for choosing Users
_processForBooleanDataType(self, trans, fieldId, requestParams)
_processForCalendarDataType(self, trans, fieldId, requestParams)
_processForDateTimeDataType(self, trans, fieldId, requestParams)
_processForIntegerDataType(self, trans, fieldId, requestParams)
_processForMemoDataType(self, trans, fieldId, requestParams)
_processForMultiValueDataType(self, trans, fieldId, requestParams)
_processForStringDataType(self, trans, fieldId, requestParams)
_processForUserDataType(self, trans, fieldId, requestParams)
_splitDate(self, dateString)
Chunks a date into its component pieces, and stores them in a hash, with the various pieces accessible by 'day', 'month', 'year', 'hour', 'minute', and 'ampm'
getWidget(self, dataEntryTransaction, fieldId)
Given a data type object, fetch an input widget customized for it

 
class ZopeWidgetMaker
      Widget makers for user interacting with the Zope backend administration interface
 
  
__init__(self)
Initialize the methods that get called for various DataType objects
_generateForBooleanDataType(self, trans, fieldId, style)
_generateForCalendarDataType(self, trans, fieldId, style)
_generateForDateTimeDataType(self, trans, fieldId, style)
_generateForIntegerDataType(self, trans, fieldId, style)
_generateForMemoDataType(self, trans, fieldId, style)
_generateForMultiValueDataType(self, trans, fieldId, style)
Return HTML snippet that will provide for editing a MultiValue data type
_generateForStringDataType(self, trans, fieldId, style)
_generateForUserDataType(self, trans, fieldId, style)
getWidget(self, dataEntryTransaction, fieldId)
Given a data type object, fetch an input widget customized for it
parseFields(self, dataEntryTransaction, fieldId, requestParams)
The ZopeWidgetMaker doesn't handle user input -- the Zope backend does it directly

 
Data
             CALENDAR_REGISTRY = 'CalendarRegistry'

CHECKBOX_WIDGET = 'CheckboxWidget'

COCOON_HTML_WIDGET_MAKER = 'CocoonHTMLWidgetMaker'

COMMAND_PARAM = 'command'

DATA_ENTRY_TRANSACTION = 'DataEntryTransaction'

DATE_WIDGET = 'DateWidget'

DEFAULT_POLICY = 'Default Security Policy'

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_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'

XML_START_TAG = '<?xml version="1.0" ?>'

ZOPE_WIDGET_MAKER = 'ZopeWidgetMaker'

__file__ = '/home/zope/lib/python/Products/MightyCal/DataEntry/WidgetMakers.pyc'

__name__ = 'Products.MightyCal.DataEntry.WidgetMakers'

__version__ = '$Revision: 1.14 $'

cAmPmPart = '_ampm'

cDayPart = '_day'

cHourPart = '_hour'

cMinutePart = '_minute'

cMonthPart = '_month'

cThreeNBSP = '&#160;&#160;&#160;'

cYearPart = '_year'