Products.MightyCal.EventType.DataTypes (version 1.23)
index
/home/zope/lib/python/Products/MightyCal/EventType/DataTypes.py

DataType definitions for the MightyCal product.
* DataType objects have the responsibility for maintaining the field entries in Event objects.  DataType
  objects know about the data type that should be stored in the field they track, so they are responsible
  for creating and maintaining the Zope Properties that carry field values in Events.
* DataTypes do not directly handle data validation or determining default values... they own private
  DataRangeProvider and DefaultValueProvider objects which do this for them.  The Administrator can
  (via the ZMI) change the type and setup of these subobjects, which in turn changes the behavior of the
  DataType as it manages Events.
* Even though DataTypes are not intended to be callable directly from the Web, their methods are still
  declared to be private using security.declarePrivate(), to prevent hackers from trying to modify
  backend data by cleverly constructed HTTP requests to objects that aren't accessible from the normal
  user interface.

 
Modules
            
Products.MightyCal.EventType.DataRangeProviders
Products.MightyCal.EventType.DataTypes
Dumper
re
string
sys
types

 
Classes
            
Products.ZCatalog.CatalogAwareness.CatalogAware
AbstractDataType(Products.MightyCal.SFolder.SFolder, Products.ZCatalog.CatalogAwareness.CatalogAware)
BooleanDataType
CalendarDataType
DateTimeDataType
IntegerDataType
MultiValueDataType
StringDataType
MemoDataType
UserDataType
exceptions.Exception
DataTypeException
Products.MightyCal.SFolder.SFolder(OFS.Folder.Folder, Acquisition.ExplicitAcquirer, Acquisition.Acquirer)
AbstractDataType(Products.MightyCal.SFolder.SFolder, Products.ZCatalog.CatalogAwareness.CatalogAware)
BooleanDataType
CalendarDataType
DateTimeDataType
IntegerDataType
MultiValueDataType
StringDataType
MemoDataType
UserDataType

 
class AbstractDataType
      AbstractDataType is the base class for all MightyCal DataType types
 
  
__init__(self, propId)
_destroy(self)
A cleanup routine called whenever a DataType needs to be gotten rid of
_index(self)
Record this object in the ZCatalog, and requests its children to do the same
asString(self, value, formatString=None)
Apply the given format string, which is assumed to be a C-style formatting string.  If we get an exception, we return a nice error value instead of passing the exception through. This is so that admins who don't know how to specify proper formatting conventions won't completely break the calendar.
getDataTypeEditor(self, parentType)
Return HTML snippet that will provide for editing an IntegerDataType
getDefaultValue(self)
Return the default value(s) for this data type
getSearchWidgetInfo(self)
Return a dictionary of info about the recommended search widget for this DataType.   The dictionary slots are:   WIDGET_TYPE: The recommended type of widget (e.g. SpecifiedValueWidgetImpl or KeywordSearchWidget)   WIDGET_FIELD_BINDING: The name of the field/property in Events that is being searched on.   WIDGET_VALUES: A list of valid possible values for a <SELECT>-type widget
getValidDataPoints(self)
Return the single value (or list of values) provided by the DataRangeProvider
populateEventSnapshot(self, snapshot, fieldTitle)
Create a slot for the current DataType's field in the Snapshot, and set the field to the field's current value (if we are populating a snapshot of an existing Event) or else to the value given by our DefaultValueProvider
setDataRangeProvider(self, provider)
Change our default value provider
setDefaultValueProvider(self, provider)
Tell the DataRangeProvider to change its default value provider
setPublic(self, propValue)
Set whether the field is to be visible to ordinary (i.e. non-administrative) users
setupIndexes(self, REQUEST)
Set whether the field is to be indexed in the overall EventCatalog (i.e. findable via queries)
updateInternalSpecification(self, specInfo, REQUEST)
validateDataEntryTransaction(self, trans)
First, convert the current DataEntryTransaction's field value into a Python/Zope native value (initially, the values come as Strings from the user agent's form submission). check the DataEntryTransaction to see if it the field is valid, and store an error message for each field that fails validation

 
class BooleanDataType
      Holds true/false values
 
  
_fromString(self, value)
asString(self, value, formatString=None)
The Boolean DataType uses a custom set of formatting instructions: '1' means to return a 1 for true, 0 for false.  'Y' means 'Yes' = true, 'No' = false.  'T' means 'True' = true and 'False' = false.

 
class CalendarDataType
      Holds a Calendar
 
  
_fromString(self, value)

 
class DataTypeException
      # Indicates that an attempt was made to store a value of an invalid type # in a DataType object
 
  
__init__(self, value)
__str__(self)

 
class DateTimeDataType
      Holds date/time values
 
  
_fromString(self, value)
asString(self, value, formatString=None)
Format the given DateTime object as a String, using the supplied (or default) formatting string

 
class IntegerDataType
      Holds integer values
 
  
_fromString(self, value)

 
class MemoDataType
      Holds a Memo, aka a long string
 
  

 
class MultiValueDataType
      Holds a list of distinct values
 
  
_fromString(self, value)

 
class StringDataType
      Holds a string
 
  
_fromString(self, value)

 
class UserDataType
      Holds a CalendarUser
 
  
_fromString(self, value)

 
Data
             ACTION_CONTENT_TYPE = 'ActionContentType'

ADD_EVENT_TYPE_METHOD = 'addEventType'

APPROVED_CALENDARS_FIELD = 'ApprovedCalendarField'

BASE_REGEXP_DATA_RANGE_PROVIDER = 'BaseRegexpDataRangeProvider'

BASIC_CONTENT_TYPE = 'BasicContentType'

BOOLEAN_DATA_TYPE = 'BooleanDataType'

BOOLEAN_PROPERTY_TYPE = 'int'

BOX_CHECKED = 'on'

CALENDAR_DATA_RANGE_PROVIDER = 'CalendarDataRangeProvider'

CALENDAR_DATA_TYPE = 'CalendarDataType'

CALENDAR_DEFAULT_VALUE_PROVIDER = 'CalendarDefaultValueProvider'

CALENDAR_OWNER = 'calendarOwner'

CONTENT_TYPES = 'ContentTypes'

CUSTOMIZABLE_REGEXP_DATA_RANGE_PROVIDER = 'CustomizableRegexpDataRangeProvider'

DATA_RANGE_PROVIDER = 'DataRangeProvider'

DATA_RANGE_PROVIDERS = 'DataRangeProviders'

DATA_TYPES = 'DataTypes'

DATE_PROPERTY_TYPE = 'date'

DATE_TIME_DATA_TYPE = 'DateTimeDataType'

DATE_WIDGET = 'DateWidget'

DEFAULT_BOOLEAN_FORMAT = 'T'

DEFAULT_DATE_FORMAT = '%m/%d/%y %I:%M %p'

DEFAULT_INTEGER_FORMAT = '%d'

DEFAULT_STRING_FORMAT = '%s'

DEFAULT_VALUE_PROVIDER = 'DefaultValueProvider'

DEFAULT_VALUE_PROVIDERS = 'DefaultValueProviders'

DESCRIPTION_FIELD = 'DescriptionField'

DESCRIPTION_PROPERTY = 'description'

EMPTY_LIST_DEFAULT_VALUE_PROVIDER = 'EmptyListDefaultValueProvider'

EVENT_CATALOG = 'EventCatalog'

EVENT_DETAIL_TEMPLATE = 'EventDetail'

EVENT_EDITOR_TEMPLATE = 'EventEditor'

EVENT_TIME_FIELD = 'EventTimeField'

EVENT_TYPE_OWNER = 'eventTypeOwner'

FALSE = 0

FIELD_COMMENT = 'fieldComment'

FIELD_INDEX = 'FieldIndex'

FIELD_TITLE = 'fieldTitle'

IMMUTABLE_FIELD = 'ImmutableField'

INDEXED_FIELD = 'IndexedField'

INFO = 0

INTEGER_DATA_TYPE = 'IntegerDataType'

INTEGER_PROPERTY_TYPE = 'int'

KEYWORD_INDEX = 'KeywordIndex'

LIST_PROPERTY_TYPE = 'lines'

LIST_WIDGET = 'ListWidget'

LOGGED_IN_USER_DEFAULT_VALUE_PROVIDER = 'LoggedInUserDefaultValueProvider'

MANDATORY_FIELD = 'MandatoryField'

MEMO_DATA_TYPE = 'MemoDataType'

MEMO_PROPERTY_TYPE = 'text'

MEMO_WIDGET = 'MemoWidget'

MULTI_VALUE_DATA_TYPE = 'MultiValueDataType'

NAME = 'name'

NOW_DATE_TIME_DEFAULT_VALUE_PROVIDER = 'NowDateTimeDefaultValueProvider'

NUMERIC_RANGE_DATA_RANGE_PROVIDER = 'NumericRangeDataRangeProvider'

OBJECT_CATALOG = 'ObjectCatalog'

ONE_LINE_DISPLAY_TEMPLATE = 'SingleLineDisplay'

PUBLIC_FIELD = 'PublicField'

RADIO_WIDGET = 'RadioWidget'

RANGE_LIST_CONTENTS = 'rangeListContents'

REQUESTED_CALENDARS_FIELD = 'RequestedCalendarField'

RESOURCE_CONTENT_TYPE = 'ResourceContentType'

SELECT_WIDGET = 'SelectWidget'

SIMPLE_BOOLEAN_DEFAULT_VALUE_PROVIDER = 'SimpleBooleanDefaultValueProvider'

SIMPLE_INTEGER_DEFAULT_VALUE_PROVIDER = 'SimpleIntegerDefaultValueProvider'

SIMPLE_LIST_DATA_RANGE_PROVIDER = 'SimpleListDataRangeProvider'

SIMPLE_LIST_DEFAULT_VALUE_PROVIDER = 'SimpleListDefaultValueProvider'

SIMPLE_STRING_DEFAULT_VALUE_PROVIDER = 'SimpleStringDefaultValueProvider'

SIMPLISTIC_DATA_RANGE_PROVIDER = 'SimplisticDataRangeProvider'

SIMPLISTIC_STRING_DATA_RANGE_PROVIDER = 'SimplisticStringDataRangeProvider'

SPECIFIED_DEFAULT_VALUED = 'specifiedDefaultValue'

STRING_DATA_TYPE = 'StringDataType'

STRING_PROPERTY_TYPE = 'string'

SUBMITTER_FIELD = 'SubmitterField'

TELEPHONE_NUMBER_DATA_RANGE_PROVIDER = 'TelephoneNumberDataRangeProvider'

TEXT_INDEX = 'TextIndex'

TEXT_WIDGET = 'TextWidget'

TITLE_FIELD = 'TitleField'

TITLE_ONLY_DISPLAY_TEMPLATE = 'TitleOnlyDisplay'

TRUE = 1

USER_DATA_RANGE_PROVIDER = 'UserDataRangeProvider'

USER_DATA_TYPE = 'UserDataType'

WIDGET_FIELD_BINDING = 'Widget Field Binding'

WIDGET_TYPE = 'Widget Type'

WIDGET_VALUES = 'Widget Values'

__file__ = '/home/zope/lib/python/Products/MightyCal/EventType/DataTypes.pyc'

__name__ = 'Products.MightyCal.EventType.DataTypes'

__version__ = '$Revision: 1.23 $'

permAddEvent = 'Add Events'