Products.MightyCal.EventType.FieldSpec (version 1.28)
index
/home/zope/lib/python/Products/MightyCal/EventType/FieldSpec.py

FieldSpec object.  FieldSpec provides the description for how a particular field is structured & operates.
It is designed around the Composite design pattern.  Actually, the FieldSpec is the Facade, and
the FieldSpec's ContentType is the actual composite.
 
FieldSpec objects are intended to be highly malleable, so that they can represent and manage many kinds
of field data, from simple String field to Action 'fields' that actually require numerous Zope Properties
to be present in the Event objects which carry the Action info.
 
Field Specs are structured as follows:  They contain a field called _content, which holds an instance
of a ContentType object (See ContentTypes.py for a list of available types).  ContentTypes hold a
DataType object, which specifies whether the field holds a String, an integer, a boolean, etc.  The
DataType in turn holds a DataRangeProvider (which determines which values are valid for that field) and
a DefaultValueProvider, which can be queried for an appropriate default value.  ContentTypes can be told
(via their updateInternalSpecification() method) to restructure themselves, thereby taking on different
DataType objects as their children.  The FieldSpec's manage_main method provides an interface for telling
the different pieces of the FieldSpec composite how to change or restructure themselves.
 
FieldSpecs are also a TemplateCollection owner, which makes it possible for administrators to customize
how a particular field is going to be presented to the end user.
 
Finally, FieldSpecs cooperate in handling Event objects.  They have the responsibility for adding and
removing Zope Properties from Events (since it is these Properties that actually hold the Event information),
and for setting these Zope Properties based on input from the user.  The idea is that since Events
are Flyweights, they shouldn't need to know anything about the data they carry.  FieldSpecs, on the
other hand, know all about the structure of the information they need to store, so they are the logical
managers of the information contained in Events.

 
Modules
            
Products.MightyCal.EventType.ContentTypes
Dumper
os
re
types

 
Classes
            
Products.ZCatalog.CatalogAwareness.CatalogAware
FieldSpec(Products.MightyCal.SFolder.SFolder, Products.ZCatalog.CatalogAwareness.CatalogAware)
Products.MightyCal.SFolder.SFolder(OFS.Folder.Folder, Acquisition.ExplicitAcquirer, Acquisition.Acquirer)
FieldSpec(Products.MightyCal.SFolder.SFolder, Products.ZCatalog.CatalogAwareness.CatalogAware)

 
class FieldSpec
      Facade class for managing field structure of various kinds
 
  
__call__(arg)
This __call__ routine is needed because occasionally a name collision will cause a ZCatalog to try to index a FieldSpec.  We simply return a useless value so that the ZCatalog entry is useless
__init__(self, parent, dataType=None, title='', propId=None, id=None)
Construct a new instance of a FieldSpec. A new instance always has a BasicContent type, and a StringDataType
_asString(self, value, formatString=None)
Stringify the value according the given format string, or if the format string is not supplied, by the default format string for the DataType of the value.
_destroy(self)
backToEventType(self, REQUEST='')
Return the user to the containing EventType
getDefinitionEditor(self, REQUEST='')
Get the definition editor defined by the particular configuration of the current field
getFieldSpecDescriptorAsXML(self, DOM)
Return a DOM fragment describing the attributes of this FieldSpec, suitable for consumption by Cocoon
getFieldSpecTitle(self)
getSearchWidgetInfo(self)
Return a dictionary of info about the recommended search widget for this FieldSpec.
manage_update(self, REQUEST)
Update the field as requested by the user
populateEventSnapshot(self, snapshot)
Given an EventSnapshot (or DataEntryTransaction), add field slots for each piece of information that will need to eventually be stored in the Event object.
setAdminProperties(self, properties, REQUEST=None)
Set the various administrative properties of this FieldSpec.  The following values are possible: * Immutable: Can the administrator change these administrative properties via the ZMI? * MandatoryField: Is this field required or not * PublicField: Should this field be visible to nonadministrative users? * IndexedField: Is this field to be indexed in the ZODB?
setupTemplates(self)
Add a TemplateCollection and feed it our default templates.  This routine has to be called after the FieldSpec has already been added to the EventType, so that acquisition can work.
updateInternalSpecification(self, specInfo)
Takes information from the REQUEST and re-sets up our FieldSpec structure
validateDataEntryTransaction(self, trans)
For each field managed by the ContentType, check the DataEntryTransaction to see if it is field is valid, and set a flag for each field indicating its validation status.  Also stores a validation message if a field fails validation

 
Functions
            
manage_addField(container, id)
manage_addFieldForm()

 
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'

COCOON_HTML_WIDGET_MAKER = 'CocoonHTMLWidgetMaker'

CONTENT_TYPES = 'ContentTypes'

CUSTOMIZABLE_REGEXP_DATA_RANGE_PROVIDER = 'CustomizableRegexpDataRangeProvider'

DATA_RANGE_PROVIDER = 'DataRangeProvider'

DATA_RANGE_PROVIDERS = 'DataRangeProviders'

DATA_TYPES = 'DataTypes'

DATE_TIME_DATA_TYPE = 'DateTimeDataType'

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'

DISPLAY_TEMPLATE = 'StandardDisplay'

DTML_DIR = 'dtml'

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_NAME_TAG = 'field-name'

FIELD_SPEC = 'FieldSpec'

FIELD_SPEC_DESCRIPTOR_TAG = 'fieldspec-descriptor'

FIELD_SPEC_TAG = 'field-spec'

FIELD_TITLE = 'fieldTitle'

FIELD_VALUE_TAG = 'field-value'

ID_ATTRIBUTE = 'id'

IMMUTABLE_FIELD = 'ImmutableField'

INDEXED_FIELD = 'IndexedField'

INFO = 0

INTEGER_DATA_TYPE = 'IntegerDataType'

LOGGED_IN_USER_DEFAULT_VALUE_PROVIDER = 'LoggedInUserDefaultValueProvider'

MANDATORY_FIELD = 'MandatoryField'

MEMO_DATA_TYPE = 'MemoDataType'

MULTI_VALUE_DATA_TYPE = 'MultiValueDataType'

MessageDialog = <HTML instance at 82c28f8>

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'

RANGE_LIST_CONTENTS = 'rangeListContents'

REQUESTED_CALENDARS_FIELD = 'RequestedCalendarField'

RESOURCE_CONTENT_TYPE = 'ResourceContentType'

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'

STYLE_BASE = 'StyleBase'

STYLE_FOR_ERROR = 'StyleForError'

SUBMITTER_FIELD = 'SubmitterField'

TELEPHONE_NUMBER_DATA_RANGE_PROVIDER = 'TelephoneNumberDataRangeProvider'

TEMPLATE_COLLECTION = 'TemplateCollection'

TEMPLATE_TITLE = 'title'

TITLE_FIELD = 'TitleField'

TITLE_ONLY_DISPLAY_TEMPLATE = 'TitleOnlyDisplay'

TRUE = 1

USELESS_VALUE = 'abracadabra'

USER_DATA_RANGE_PROVIDER = 'UserDataRangeProvider'

USER_DATA_TYPE = 'UserDataType'

WIDGET_MAKER_REGISTRY = 'WidgetMakerRegistry'

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

ZOPE_WIDGET_MAKER = 'ZopeWidgetMaker'

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

__name__ = 'Products.MightyCal.EventType.FieldSpec'

__version__ = '$Revision: 1.28 $'

permViewMgmtScreen = 'View management screens'