Products.MightyCal.Search.SearchWidgets (version 1.6)
index
/home/zope/lib/python/Products/MightyCal/Search/SearchWidgets.py

SearchWidget object:  An SearchWidget Object defines a set of search criteria that
are given a name.  This makes it easy to refer to complex criteria in HTTP requests, e.g.
by requesting 'Next30Days' instead of some ugly combination of request parameters.

 
Modules
            
Acquisition
Dumper
Products.MightyCal.Search.SearchWidgets
os
sys

 
Classes
            
Products.MightyCal.SFolder.SFolder(OFS.Folder.Folder, Acquisition.ExplicitAcquirer, Acquisition.Acquirer)
SearchWidget
Products.MightyCal.SItem.SItem(OFS.SimpleItem.Item, Acquisition.Acquirer, Acquisition.ExplicitAcquirer, OFS.PropertyManager.PropertyManager, App.PersistentExtra.Persistent, AccessControl.Role.RoleManager)
AbstractWidgetImpl
KeywordWidgetImpl
ListFieldWidgetImpl
SpecifiedCriteriaWidgetImpl

 
class AbstractWidgetImpl
      Implementation for a widget that draws its info from a ListField
 
  
__init__(self, eventFieldBinding, criteria=[])
getValues(self, REQUEST=None)
Return a list of (name, search value) tuples for this widget
manage_update(self, REQUEST=None)
Set up the WidgetImpl object based on values provided by the user

 
class KeywordWidgetImpl
      Implementation for a widget allows the user to enter search keywords
 
  

 
class ListFieldWidgetImpl
      Implementation for a widget that draws its info from a ListField
 
  
getValues(self, REQUEST=None)
Return a list of (name, search value) tuples for this widget

 
class SearchWidget
      The base class for SearchWidget classes
 
  
__init__(self, id, title, eventTypeId, fieldSpecId, widgetInfoDict=None, criteria=[])
Construct a new instance of a SearchWidget.
createNamedCriterion(self, id, title, criterionType, REQUEST=None)
Tell the Calendar's CriteriaSet to add a new NamedCriterion object
draw_widget_panel(self, REQUEST=None)
Return the DTML method defined by the WidgetImpl subobject
getCriteriaTypes(self, REQUEST=None)
Return a list of (criteria id, criteria name) tuples for the available Criterion types
getLinkedField(self, REQUEST=None)
Returns the name of the field linked to the Search Widget
getWidgetAsXML(self)
Return an XML document containing a specification of the search widget, including its label, its criterion ids, and its criterion titles
getWidgetType(self, REQUEST=None)
Returns the type of the SearchWidget
getWidgetTypeEditor(self, REQUEST=None)
Returns an HTML widget for changing the widget type used for this SearchWidget, if possible
getWidgetValues(self, REQUEST=None)
Return a list of (id, publicTitle) tuples for the search values defines by this SearchWidget
manage_update(self, label, REQUEST=None)
Update the configuration of the SearchWidget

 
class SpecifiedCriteriaWidgetImpl
      Implementation for a widget that allows the Admin to specify specific criteria that the user can search for, e.g. a widget that allows searching for numeric values within a small set of defined integer ranges, or a date search based on a set of date ranges.
 
  
addCriterion(self, id)
Append a new criterion id to our list of criteria
addCriterionURL(self, REQUEST=None)
Return the URL for adding a new criterion to a SpecifiedCriterionWidget
getValues(self, REQUEST=None)
Return a list of information dictionaries about the criteria comprising this widget

 
Functions
            
WidgetImplFactory(widgetInfoDict, criteria)
A factory method that generates a WidgetImpl object based on the FieldSpec provided.   Parameters:   acquisitionProvider: Required reference to an object that is already in the ZODB, and     which therefore provides the aq_acquire() method.  We need this object reference,     because Python method definitions in modules are *not* in the ZODB, and therefore     do not naturally provide acquisition facilities.   fieldSpecId: The ID of the FieldSpec upon which the new WidgetImpl is to be based.  The     WidgetImplFactory method investigates the FieldSpec object in order to figure out what     kind of WidgetImpl object to build, and the WidgetImpl itself queries the FieldSpec     to figure out how to configure itself. Returns:  A WidgetImpl object.

 
Data
             COMMON_FIELD_SPECS = ['TitleField', 'EventTimeField', 'DescriptionField', 'SubmitterField']

COMMON_FIELD_TITLE = 'Common Field'

CRITERIA_POLICY = 'Policy for NamedCriterion and related objects'

CRITERIA_SET = 'CriteriaSet'

DATE_RANGE_BEGINNING = 'rangeBeginning'

DATE_RANGE_CRITERIA_SET = 'DateRangeCriteriaSet'

DATE_RANGE_CRITERIA_SET_DESCRIPTION = 'Searches for Events within a range of dates'

DATE_RANGE_END = 'rangeEnd'

DATE_RANGE_NAMED_CRITERION = 'DateRangeNamedCriterion'

DATE_RANGE_SEARCH_WIDGET = 'DateRangeWidget'

DATE_RANGE_SEARCH_WIDGET_TITLE = 'Date Range Search Widget'

DATE_RANGE_USAGE_SPECIFIER = 'range:min:max'

DESCRIPTION_FIELD = 'DescriptionField'

DIALOG_BOX = 'dialogBox'

DTML_DIR = 'dtml'

EDIT_URL = 'editURL'

EVENT_TIME_FIELD = 'EventTimeField'

EVENT_TYPE_ID = 'eventTypeId'

EVENT_TYPE_REGISTRY = 'EventTypeRegistry'

EVENT_TYPE_TITLE = 'eventTypeTitle'

FIELD_SPECS = 'fieldSpecs'

FIELD_SPEC_ID = 'fieldSpecId'

FIELD_SPEC_TITLE = 'fieldSpecTitle'

ID_ATTRIBUTE = 'id'

INFO = 0

KEYWORD_SEARCH_WIDGET = 'KeywordWidgetImpl'

KEYWORD_SEARCH_WIDGET_NAME = 'Keyword Search Widget'

LABEL_ATTRIBUTE = 'label'

LIST_FIELD_SEARCH_WIDGET = 'ListFieldWidgetImpl'

LIST_FIELD_SEARCH_WIDGET_NAME = 'List Field Search Widget'

PACKAGE_NAME = 'Search'

RANGE_SUFFIX = '_ranges'

SEARCH_WIDGET_OBJECT = 'SearchWidget'

SIMPLE_CRITERIA_SET = 'SimpleCriteriaSet'

SIMPLE_CRITERIA_SET_DESCRIPTION = 'Performs a match against a single field'

SIMPLE_NAMED_CRITERION_OBJECT = 'SimpleNamedCriterion'

SPECIFIED_CRITERIA_SEARCH_WIDGET = 'SpecifiedCriteriaWidgetImpl'

SPECIFIED_CRITERIA_SEARCH_WIDGET_NAME = 'Specified Criteria Search Widget'

SUBMITTER_FIELD = 'SubmitterField'

THIS_CALENDAR_CRITERION_TITLE = 'Selects Events Approved for this Calendar'

THIS_MONTH_CRITERION_ID = 'ThisMonth'

THIS_MONTH_CRITERION_TITLE = "Selects This Month's Events"

THIS_WEEK_CRITERION_ID = 'ThisWeek'

THIS_WEEK_CRITERION_TITLE = "Selects This Week's Events"

TITLE_FIELD = 'TitleField'

TODAY_CRITERION_ID = 'Today'

TODAY_CRITERION_TITLE = "Selects only Today's Events"

UNAPPROVED_EVENTS_CRITERION_ID = 'UnapprovedEvents'

UNAPPROVED_EVENTS_CRITERION_TITLE = 'Selects Unapproved Events for this Calendar'

UPCOMING_EVENTS_CRITERION_ID = 'UpcomingEvents'

UPCOMING_EVENTS_CRITERION_TITLE = 'Selects All Upcoming Events'

USAGE_SUFFIX = '_usage'

WIDGET_DEFINITION_TAG = 'search-widget-definition'

WIDGET_FIELD_BINDING = 'Widget Field Binding'

WIDGET_ID = 'widgetId'

WIDGET_ID_TAG = 'widget-id'

WIDGET_ITEMS_TAG = 'widget-items'

WIDGET_ITEM_TAG = 'widget-item'

WIDGET_LABEL = 'widgetLabel'

WIDGET_LABEL_TAG = 'widget-label'

WIDGET_TYPE = 'Widget Type'

WIDGET_TYPES_INFO = {'KeywordWidgetImpl': 'Keyword Search Widget', 'ListFieldWidgetImpl': 'List Field Search Widget', 'SpecifiedCriteriaWidgetImpl': 'Specified Criteria Search Widget'}

WIDGET_VALUES = 'Widget Values'

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

__file__ = '/home/zope/lib/python/Products/MightyCal/Search/SearchWidgets.pyc'

__name__ = 'Products.MightyCal.Search.SearchWidgets'

__version__ = '$Revision: 1.6 $'

cWidgetImpl = 'widgetImpl'

permAdministerCalendar = 'Administer Calendar'