class ICategorization(model.Schema): # categorization fieldset model.fieldset( 'categorization', label=_PMF(u'label_schema_categorization', default=u'Categorization'), fields=['subjects', 'language'], ) subjects = schema.Tuple( title=_PMF(u'label_tags', default=u'Tags'), description=_PMF( u'help_tags', default= u'Tags are commonly used for ad-hoc organization of content.'), value_type=schema.TextLine(), required=False, missing_value=(), ) form.widget(subjects=TextLinesFieldWidget) language = schema.Choice( title=_PMF(u'label_language', default=u'Language'), vocabulary='plone.app.vocabularies.AvailableContentLanguages', required=False, missing_value='', ) form.omitted('subjects', 'language') form.no_omit(IEditForm, 'subjects', 'language') form.no_omit(IAddForm, 'subjects', 'language')
class IOwnership(model.Schema): # ownership fieldset model.fieldset( 'ownership', label=_( 'label_schema_ownership', default=u'Ownership' ), fields=['creators', 'contributors', 'rights'], ) creators = schema.Tuple( title=_(u'label_creators', u'Creators'), description=_( u'help_creators', default=u'Persons responsible for creating the content of ' u'this item. Please enter a list of user names, one ' u'per line. The principal creator should come first.' ), value_type=schema.TextLine(), required=False, missing_value=(), ) directives.widget( 'creators', AjaxSelectFieldWidget, vocabulary='plone.app.vocabularies.Users' ) contributors = schema.Tuple( title=_(u'contributors', u'Contributors'), description=_( u'help_contributors', default=u'The names of people that have contributed ' u'to this item. Each contributor should ' u'be on a separate line.'), value_type=schema.TextLine(), required=False, missing_value=(), ) directives.widget( 'contributors', AjaxSelectFieldWidget, vocabulary='plone.app.vocabularies.Users' ) rights = schema.Text( title=_(u'label_copyrights', default=u'Rights'), description=_( u'help_copyrights', default=u'Copyright statement or other rights information on this ' u'item.' ), required=False, ) directives.omitted('creators', 'contributors', 'rights') directives.no_omit(IEditForm, 'creators', 'contributors', 'rights') directives.no_omit(IAddForm, 'creators', 'contributors', 'rights')
class IPublication(model.Schema): # dates fieldset model.fieldset( 'dates', label=_PMF(u'label_schema_dates', default=u'Dates'), fields=['effective', 'expires'], ) effective = schema.Datetime( title=_PMF(u'label_effective_date', u'Publishing Date'), description=_PMF( u'help_effective_date', default=u"If this date is in the future, the content will " "not show up in listings and searches until this date."), required=False) expires = schema.Datetime( title=_PMF(u'label_expiration_date', u'Expiration Date'), description=_PMF( u'help_expiration_date', default=u"When this date is reached, the content will no" "longer be visible in listings and searches."), required=False) form.omitted('effective', 'expires') form.no_omit(IEditForm, 'effective', 'expires') form.no_omit(IAddForm, 'effective', 'expires')
class IRootNavigationPortlet(model.Schema): model.fieldset( 'navigation', label=_(u"Navigation"), fields=['portlet_nav_root', 'portlet_nav_root_title', 'portlet_nav_topLevel', ] ) portlet_nav_root = schema.Bool( title=_( u'label_portlet_nav_root', default=u'Navigation root' ), description=_( u"help_portlet_nav_root", default=u"Use as root of the navigation tree" ), required=False, ) portlet_nav_root_title = schema.TextLine( title=_( u'label_portlet_nav_root_title', default=u'Navigation root title' ), description=_( u"help_portlet_nav_root_title", default=u"if selected, use this as title " "of the navigation root, instead of content title" ), required=False, ) portlet_nav_topLevel = schema.Int( title=_navigation(u"label_navigation_startlevel", default=u"Start level"), description=_navigation(u"help_navigation_start_level", default=u"An integer value that specifies the number of folder " "levels below the site root that must be exceeded " "before the navigation tree will display. 0 means " "that the navigation tree should be displayed " "everywhere including pages in the root of the site. " "1 means the tree only shows up inside folders " "located in the root and downwards, never showing " "at the top level."), required=False, ) directives.omitted( 'portlet_nav_root', 'portlet_nav_root_title', 'portlet_nav_topLevel' ) directives.no_omit( IEditForm, 'portlet_nav_root', 'portlet_nav_root_title', 'portlet_nav_topLevel' ) directives.no_omit( IEditForm, 'portlet_nav_root', 'portlet_nav_root_title', 'portlet_nav_topLevel' )
class IBasic(model.Schema): # default fieldset title = schema.TextLine( title=_PMF(u'label_title', default=u'Title'), required=True ) description = schema.Text( title=_PMF(u'label_description', default=u'Summary'), description=_PMF( u'help_description', default=u'Used in item listings and search results.' ), min_length=5, max_length=100, required=True, missing_value=u'', ) directives.order_before(description='*') directives.order_before(title='*') directives.omitted('title', 'description') directives.no_omit(IEditForm, 'title', 'description') directives.no_omit(IAddForm, 'title', 'description')
class IVersionable(model.Schema): """ Behavior for enabling CMFEditions's versioning for dexterity content types. Be shure to enable versioning in the plone types control-panel for your content type. """ model.fieldset('settings', label=_(u'Settings'), fields=['versioning_enabled']) changeNote = schema.TextLine( title=_(u'label_change_note', default=u'Change Note'), description=_( u'help_change_note', default=u'Enter a comment that describes the changes you made. ' u'If versioning is manual, you must set a change note ' u'to create the new version.'), required=False) versioning_enabled = schema.Bool( title=_(u'label_versioning_enabled', default=u'Versioning enabled'), description=_(u'help_versioning_enabled', default=u'Enable/disable versioning for this document.'), default=True, required=False) form.order_after(changeNote='*') form.omitted('changeNote') form.no_omit(IEditForm, 'changeNote') form.no_omit(IAddForm, 'changeNote')
class IExcludeFromNavigation(model.Schema): """Behavior interface to exclude items from navigation. """ model.fieldset( 'settings', label=_(u"Settings"), fields=['exclude_from_nav'] ) exclude_from_nav = schema.Bool( title=_( u'label_exclude_from_nav', default=u'Exclude from navigation' ), description=_( u'help_exclude_from_nav', default=u'If selected, this item will not appear in the ' + u'navigation tree' ), default=False ) form.omitted('exclude_from_nav') form.no_omit(IEditForm, 'exclude_from_nav') form.no_omit(IAddForm, 'exclude_from_nav')
class IDocument(IProjectContent): """ emc project document content type """ # self-defined title and description # title = schema.TextLine( # title=_(u'label_title', default=u'Title'), # required=True # ) title = schema.Choice( title=_p(u'label_title'), source=DocTitle, required=True, ) description = schema.Text( title=_p(u'label_description', default=u'Summary'), description=_p( u'help_description', default=u'Used in item listings and search results.' ), required=False, missing_value=u'', ) directives.order_before(description='*') directives.order_before(title='*') directives.omitted('title', 'description') directives.no_omit(IEditForm, 'description') directives.no_omit(IAddForm, 'title', 'description')
class ICategorization(model.Schema): # categorization fieldset model.fieldset( 'categorization', label=_(u'label_schema_categorization', default=u'Categorization'), fields=['subjects', 'language'], ) subjects = schema.Tuple( title=_(u'label_tags', default=u'Tags'), description=_( u'help_tags', default=u'Tags are commonly used for ad-hoc organization of ' + u'content.'), value_type=schema.TextLine(), required=False, missing_value=(), ) directives.widget('subjects', AjaxSelectFieldWidget, vocabulary='plone.app.vocabularies.Keywords') language = schema.Choice( title=_(u'label_language', default=u'Language'), vocabulary='plone.app.vocabularies.SupportedContentLanguages', required=False, missing_value='', defaultFactory=default_language, ) directives.widget('language', SelectFieldWidget) directives.omitted('subjects', 'language') directives.no_omit(IEditForm, 'subjects', 'language') directives.no_omit(IAddForm, 'subjects', 'language')
class IWFEffectiveRange(metadata.IPublication): """Workflow based publication and expiration """ model.fieldset( 'dates', label=_(u'label_schema_dates', default=u'Dates'), fields=['effective_transition', 'expires_transition'], ) # form.order_after(effective_transition='IPublication.effective') effective_transition = schema.Choice( title=_(u'Publication Transition'), description=_(u'Required if a publishing date is set'), source=EffectiveTransitionSource(), required=False, default=None, ) # form.order_after(expires_transition='IPublication.expires') expires_transition = schema.Choice( title=_(u'Expiration Transition'), description=_(u'Required if a expiration date is set'), source=ExpiresTransitionSource(), required=False, default=None, ) form.omitted('effective_transition', 'expires_transition') form.no_omit(IEditForm, 'effective_transition', 'expires_transition') form.no_omit(IAddForm, 'effective_transition', 'expires_transition')
class IPublication(model.Schema): # dates fieldset model.fieldset( 'dates', label=_(u'label_schema_dates', default=u'Dates'), fields=['effective', 'expires'], ) effective = schema.Datetime( title=_(u'label_effective_date', u'Publishing Date'), description=_( u'help_effective_date', default=u"If this date is in the future, the content will " u"not show up in listings and searches until this date."), required=False) directives.widget('effective', DatetimeFieldWidget) expires = schema.Datetime( title=_(u'label_expiration_date', u'Expiration Date'), description=_(u'help_expiration_date', default=u"When this date is reached, the content will no" u"longer be visible in listings and searches."), required=False) directives.widget('expires', DatetimeFieldWidget) @invariant def validate_start_end(data): if data.effective and data.expires and data.effective > data.expires: raise EffectiveAfterExpires( _("error_expiration_must_be_after_effective_date", default=u"Expiration date must be after publishing date.")) directives.omitted('effective', 'expires') directives.no_omit(IEditForm, 'effective', 'expires') directives.no_omit(IAddForm, 'effective', 'expires')
class IPublicationOffer(model.Schema): form.widget('fieldset_opt', FieldsetFieldWidget) fieldset_opt = schema.Text( default=_(u'Dates'), required=False, ) effective = schema.Datetime( title=_PMF(u'label_effective_date', u'Publishing Date'), description=_( u'help_effective_date', default=u"The date the item will be published."), required=False ) expired = schema.Datetime( title=_PMF(u'label_expiration_date', u'Expiration Date'), description=_( u'help_expiration_date', default=u"The date that the item will expire."), required=False, defaultFactory=expiresDefaultValue, ) form.omitted('effective') form.no_omit(IEditForm, 'expired') form.no_omit(IAddForm, 'expired')
class IQuoteTile(INITFTile): """A tile that shows an article quote.""" form.omitted('quote_color') form.no_omit(ITileEditForm, 'quote_color') quote_color = Choice( title=_(u'Quote color'), vocabulary=SimpleVocabulary([ SimpleTerm(value=u'blue', title=_(u'Blue')), SimpleTerm(value=u'green', title=_(u'Green')), ]), required=True, default=u'blue', ) form.omitted('quote') form.no_omit(ITileEditForm, 'quote') quote = schema.Text( title=_(u'Quote'), required=False, ) form.omitted('quote_rights') form.no_omit(ITileEditForm, 'quote_rights') quote_rights = schema.TextLine( title=_(u'Quote Rights'), required=False, )
class IBasicTile(IPersistentCoverTile): title = schema.TextLine( title=_(u'Title'), required=False, ) description = schema.Text( title=_(u'Description'), required=False, ) image = NamedImage( title=_(u'Image'), required=False, ) form.no_omit('image_description') form.omitted(IDefaultConfigureForm, 'image_description') image_description = schema.TextLine( title=_(u'ALT'), required=False, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, readonly=False, ) form.omitted('subjects') form.no_omit(IDefaultConfigureForm, 'subjects') form.widget(subjects='z3c.form.browser.textarea.TextAreaFieldWidget') subjects = schema.Tuple( title=_(u'label_categories', default=u'Categories'), required=False, value_type=schema.TextLine(), missing_value=(), ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, ) form.no_omit('variacao_titulo') form.omitted(IDefaultConfigureForm, 'variacao_titulo') variacao_titulo = schema.Choice( title=_b(u'Title Change'), values=(u'Normal', u'Grande', u'Gigante'), default=u'Normal', required=True, )
class IRatingBehavior(Schema): """ Allows enabling/disabling rating on individual items """ fieldset('settings', label=_(u"Settings"), fields=['allow_ratings']) allow_ratings = Bool(title=_(u'Enable Ratings'), description=_(u'Enable ratings on this content item'), default=True) omitted('allow_ratings') no_omit(IEditForm, 'allow_ratings') no_omit(IAddForm, 'allow_ratings')
class IPhotoGalleryTile(IListTile): """A tile that shows an photo gallery.""" tile_description = schema.Text(title=_(u'Tile Description'), required=False) form.omitted('tile_description') form.no_omit(ITileEditForm, 'tile_description') form.no_omit(ITileEditForm, 'uuids') form.widget(uuids=TextLinesSortableFieldWidget)
class IGroupCarouselTile(ICarouselTile): """Display a carousel of items.""" tile_description = schema.Text(title=_(u'Tile Description'), required=False) form.omitted('tile_description') form.no_omit(ITileEditForm, 'tile_description') switch_text = schema.TextLine(title=_(u'Switch Text'), required=False) form.omitted('switch_text') form.no_omit(ITileEditForm, 'switch_text') form.omitted('autoplay')
class IBasicTile(IPersistentCoverTile): title = schema.TextLine( title=_(u'Title'), required=False, ) description = schema.Text( title=_(u'Description'), required=False, ) image = NamedImage( title=_(u'Image'), required=False, ) form.omitted(IDefaultConfigureForm, 'alt_text') alt_text = schema.TextLine( title=_( u'label_alt_text', default=u'Alternative Text'), description=_( u'help_alt_text', default=u'Provides a textual alternative to non-text content in web pages.'), # noqa E501 required=False, ) form.omitted('date') form.no_omit(IDefaultConfigureForm, 'date') date = schema.Datetime( title=_(u'Date'), required=False, readonly=False, ) form.omitted('subjects') form.no_omit(IDefaultConfigureForm, 'subjects') form.widget(subjects='z3c.form.browser.textarea.TextAreaFieldWidget') subjects = schema.Tuple( title=_(u'label_categories', default=u'Categories'), required=False, value_type=schema.TextLine(), missing_value=(), ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, )
class IVideoCarouselTile(IListTile): """A tile that shows a carousel of videos.""" tile_description = schema.Text(title=_(u'Tile Description'), required=False) form.omitted('tile_description') form.no_omit(ITileEditForm, 'tile_description') switch_text = schema.TextLine(title=_(u'Switch Text'), required=False) form.omitted('switch_text') form.no_omit(ITileEditForm, 'switch_text') form.no_omit(ITileEditForm, 'uuids') form.widget(uuids=TextLinesSortableFieldWidget)
class ISetTitleOnly(model.Schema): """ Marker/Form interface for SetTitleOnly """ # -*- Your Zope schema definitions here ... -*- title = schema.TextLine(title=_(u'label_title', default=u'Title'), required=True) form.order_before(title='*') form.omitted('title') form.no_omit(IEditForm, 'title') form.no_omit(IAddForm, 'title')
class IOwnership(model.Schema): # ownership fieldset model.fieldset( 'ownership', label=_PMF( 'label_schema_ownership', default=u'Ownership' ), fields=['creators', 'contributors', 'rights'], ) creators = schema.Tuple( title=_PMF(u'label_creators', u'Creators'), description=_PMF( u'help_creators', default=u"Persons responsible for creating the content of " u"this item. Please enter a list of user names, one " u"per line. The principal creator should come first." ), value_type=schema.TextLine(), required=False, missing_value=(), ) contributors = schema.Tuple( title=_PMF(u'label_contributors', u'Contributors'), description=_PMF( u'help_contributors', default=u"The names of people that have contributed " u"to this item. Each contributor should " u"be on a separate line."), value_type=schema.TextLine(), required=False, missing_value=(), ) rights = schema.Text( title=_PMF(u'label_copyrights', default=u'Rights'), description=_PMF( u'help_copyrights', default=u'Copyright statement or other rights information on this ' u'item.' ), required=False, ) form.omitted('creators', 'contributors', 'rights') form.no_omit(IEditForm, 'creators', 'contributors', 'rights') form.no_omit(IAddForm, 'creators', 'contributors', 'rights')
class IGeolocationBehavior(model.Schema): """Form field for geolocation behavior""" geolocation = GeolocationField( title=u"Geolocation", description= u"Enter a latitude and longitude in signed decimal degrees. Geodetic model is assumed to be WGS-1984.", required=False) pleiades_url = schema.URI(title=u"Fetch coordinates from Pleiades URL", required=False) directives.omitted('geolocation') directives.no_omit(IEditForm, 'geolocation') directives.no_omit(IAddForm, 'geolocation') fieldset('geolocation', label=u'Geolocation', fields=['geolocation', 'pleiades_url'])
class ISubscriber(IEmail): """ Marker interface and Dexterity Python Schema for Player """ pseudo = schema.TextLine( title=_(u'your pseudo'), description=_(u'pseudo_description'), required=True, ) first_name = schema.TextLine( title=_(u'First Name'), required=True, ) last_name = schema.TextLine( title=_(u'Last Name'), required=True, ) directives.omitted('register_date') directives.no_omit( IEditForm, 'register_date', ) register_date = schema.Datetime( title=_(u'registring date'), required=False, # defaultFactory=registerDate )
class IVersionable(model.Schema): """ Behavior for enabling CMFEditions's versioning for dexterity content types. Be shure to enable versioning in the plone types control-panel for your content type. """ changeNote = schema.TextLine( title=_(u'label_change_note', default=u'Change Note'), description=_(u'help_change_note', default=u'Enter a comment that describes the changes ' 'you made.'), required=False) form.omitted('changeNote') form.no_omit(IEditForm, 'changeNote') form.no_omit(IAddForm, 'changeNote')
class IBibliographicItem(model.Schema): title = schema.TextLine( title=_(u"Short Title"), description=_(u"The short title of the bibliographic reference."), ) description = schema.Text( title=_(u'Summary'), description=_(u'Used in item listings and search results.'), required=False, missing_value=u'', ) citation_detail = schema.TextLine( title=_(u"Citation Detail"), required=False, ) formatted_citation = schema.TextLine( title=_(u"Formatted Citation"), required=False, ) bibliographic_uri = schema.URI( title=_(u"Bibliographic URI"), description=_(u"This is a URI to an online bibliographic reference " u"(e.g. zotero, worldcat, openlibrary, ...)."), required=False, ) access_uri = schema.URI( title=_(u"Access URI"), description=_(u"This is a URI to access the identified resource."), required=False, ) alternate_uri = schema.URI( title=_(u"Alternate URI"), description=_(u"This is an alternate URL for the identified " u"resource."), required=False, ) form.omitted('description') form.no_omit(IEditForm, 'description') form.no_omit(IAddForm, 'description')
class IBluechurchmembraneprofile(IMember): """ Artist or Event Manager """ # TODO: make membrane fields searchable dexteritytextindexer.searchable('first_name') dexteritytextindexer.searchable('last_name') dexteritytextindexer.searchable('bio') website = URI_bluechurch( title=_(u"Website"), description=_(u"e.g. www.abcjazzz.com"), required=False, ) widget(profile_type='z3c.form.browser.checkbox.CheckBoxFieldWidget') profile_type = schema.Set( title=_(u"Profile Type"), value_type=schema.Choice(vocabulary=profile_types), required=True, ) directives.widget( bluechurchtags='z3c.form.browser.checkbox.CheckBoxFieldWidget') bluechurchtags = schema.Set( title=_(u'Bluechurch Tags'), value_type=schema.Choice( vocabulary='rohberg.bluechurch.BluchurchTags'), required=False, ) zip_code = schema.TextLine(title=_(u'label_zip_code', default=u'Zip Code'), description=_(u'help_zip_code', default=u''), required=True) city = schema.TextLine(title=_(u'label_city', default=u'City'), description=_(u'help_city', default=u''), required=True) country = schema.Choice(title=_(u'label_country', default=u'Country'), description=_( u'help_country', default=u'Select the country from the list.'), required=True, vocabulary='collective.address.CountryVocabulary') bluechurchcaptcha = schema.Int( title=_(u"bluechurchcaptcha"), description=_(u"Prevent spam by typing in the result of 13 + 4."), min=17, max=17) directives.omitted('bluechurchcaptcha') directives.no_omit(IAddForm, 'bluechurchcaptcha') model.fieldset('categorization', label=_(u'Relations')) # directives.omitted('relatedItems') # directives.no_omit(IEditForm, 'relatedItems') model.load('bluechurchmembraneprofile.xml')
class IVideoGalleryTile(IListTile): """A droppable tile that shows a gallery of videos with descriptions and links. """ tile_title = schema.TextLine( title=_(u'Header'), required=False, ) form.omitted('title') form.no_omit(IDefaultConfigureForm, 'title') title = schema.TextLine( title=_(u'Title'), required=False, readonly=True, ) subtitle = schema.TextLine( title=_(u'Subtitle'), required=False, readonly=False, ) footer_text = schema.TextLine( title=_(u'Footer Link'), required=False, readonly=False, ) form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, readonly=True, ) form.omitted('uuids') form.no_omit(IDefaultConfigureForm, 'uuids') uuids = schema.List( title=_(u'Videos'), value_type=schema.TextLine(), required=False, )
class IPersistentCoverTile(Interface): """ Base interface for tiles that go into the cover object """ css_class = Choice( title=_(u'CSS Class'), vocabulary='collective.cover.TileStyles', required=False, ) form.omitted('css_class') form.no_omit(IDefaultConfigureForm, 'css_class') form.widget(css_class='collective.cover.tiles.configuration_widgets.cssclasswidget.CSSClassFieldWidget') def populate_with_object(obj): """ This method will take a CT object as parameter, and it will store the content into the tile. Each tile should implement its own method. """ def delete(): """ Remove the persistent data associated with the tile and notify the cover object was modified. """ def accepted_ct(): """ Return a list of content types accepted by the tile or None if all types are accepted. """ def get_tile_configuration(): """ A method that will return the configuration options for this tile """ def get_configured_fields(): """ This method will return all fields that should be rendered and it will include specific configuration if any. Bear in mind, that in some specific cases, a visibility value can be off, and in that case, fields will not be included in the returned dictionary from this method """ def setAllowedGroupsForEdit(groups): """ This method assigns the groups that have edit permission to the tile """ def getAllowedGroupsForEdit(): """ This method will return a list of groups that are allowed to edit the contents of this tile """ def isAllowedToEdit(user): """
class IHighlightsCarousel(ICarouselTile): """Display a carousel of items.""" tile_description = schema.Text(title=_(u'Tile Description'), required=False) form.omitted('tile_description') form.no_omit(ITileEditForm, 'tile_description') form.omitted('autoplay')
class ICarrosselAutomaticoTile(IPersistentCoverTile): form.omitted('image') form.no_omit(IDefaultConfigureForm, 'image') image = NamedImage( title=_(u'Image'), required=False, ) # FIXME: this field should be named 'count' form.omitted('number_to_show') form.no_omit(IDefaultConfigureForm, 'number_to_show') number_to_show = schema.List( title=_(u'Number of items to display'), value_type=schema.TextLine(), required=False, ) form.omitted('offset') form.no_omit(IDefaultConfigureForm, 'offset') offset = schema.Int( title=_(u'Start at item'), required=False, default=0, ) form.omitted(IDefaultConfigureForm, 'random') random = schema.Bool( title=_(u"Select random items"), required=False, default=False ) autoplay = schema.Bool( title=_(u'Auto play'), required=False, default=True, ) uuid = schema.TextLine( title=_(u'UUID'), required=False, readonly=True, )