Example #1
0
from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata

from Products.ATVocabularyManager import NamedVocabulary

# -*- Message Factory Imported Here -*-
from bungenicms.repository import repositoryMessageFactory as _

from bungenicms.repository.interfaces import IRepositoryCollection, IRepositoryItemBrowser
from bungenicms.repository.config import PROJECTNAME

from Products.ATVocabularyManager import NamedVocabulary
from collective.dynatree.atwidget import DynatreeWidget

RepositoryCollectionSchema = folder.ATFolderSchema.copy() + atapi.Schema(())

# Set storage on fields copied from ATFolderSchema, making sure
# they work well with the python bridge properties.

RepositoryCollectionSchema['title'].storage = atapi.AnnotationStorage()
RepositoryCollectionSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(RepositoryCollectionSchema,
                            folderish=True,
                            moveDiscussion=False)


class RepositoryCollection(folder.ATFolder):
    """Repository Collection"""
    implements(IRepositoryCollection, IRepositoryItemBrowser)
QuerySchema = CollectionSchema.copy() + atapi.Schema((
    QueryField(
        name='query',
        registry_prefix='bika.lims.analysisrequestquery',
        catalog_name='bika_catalog',
        widget=BCQueryWidget(
            label=_(u"Search terms"),
            description=_(u"Define the search terms for the items you want to "
                          u"list by choosing what to match on. "
                          u"The list of results will be dynamically updated."),
            registry_prefix='bika.lims.analysisrequestquery',
            catalog_name='bika_catalog',
        ),
        validators=('javascriptDisabled', )
    ),

    StringField(
        name='sort_on',
        required=False,
        mode='rw',
        default='sortable_title',
        widget=StringWidget(
            label=_(u'Sort the collection on this index'),
            description='',
            visible=False,
        ),
    ),

    BooleanField(
        name='sort_reversed',
        required=False,
        mode='rw',
        default=False,
        widget=BooleanWidget(
            label=_(u'Sort the results in reversed order'),
            description='',
            visible=False,
        ),
    ),

    IntegerField(
        name='limit',
        required=False,
        mode='rw',
        default=1000,
        widget=IntegerWidget(
            label=_(u'Limit Search Results'),
            description=_(u"Specify the maximum number of items to show.")
        ),
    ),

    LinesField('customViewFields',
               required=False,
               mode='rw',
               default=('Title', 'Creator', 'Type', 'ModificationDate'),
               vocabulary='listMetaDataFields',
               enforceVocabulary=True,
               write_permission=ModifyPortalContent,
               widget=InAndOutWidget(
                   label=_(u'Table Columns'),
                   description=_(
                       u"Select which fields to display when "
                       u"'Tabular view' is selected in the display menu.")
               ),
               ),
))
Example #3
0
schema = Organisation.schema.copy() + atapi.Schema((
    atapi.StringField(
        'ClientID',
        searchable=True,
        widget=atapi.StringWidget(label=_("Client ID"), ),
    ),
    atapi.BooleanField(
        'MemberDiscountApplies',
        default=False,
        write_permission=ManageClients,
        widget=atapi.BooleanWidget(label=_("Member discount applies"), ),
    ),
    atapi.StringField(
        'ClientType',
        required=1,
        default='noncorporate',
        write_permission=ManageClients,
        vocabulary=CLIENT_TYPES,
        widget=atapi.SelectionWidget(label=_("Client Type"), ),
    ),
    atapi.LinesField(
        'EmailSubject',
        schemata=PMF('Preferences'),
        default=[
            'ar',
        ],
        vocabulary=EMAIL_SUBJECT_OPTIONS,
        widget=atapi.MultiSelectionWidget(
            description=_('Items to be included in email subject lines'),
            label=_("Email subject line"),
        ),
    ),
    atapi.ReferenceField(
        'DefaultCategories',
        schemata=PMF('Preferences'),
        required=0,
        multiValued=1,
        vocabulary='getAnalysisCategories',
        vocabulary_display_path_bound=sys.maxint,
        allowed_types=('AnalysisCategory', ),
        relationship='ClientDefaultCategories',
        widget=atapi.ReferenceWidget(
            checkbox_bound=1,
            label=_("Default categories"),
            description=_(
                "Always expand the selected categories in client views"),
        ),
    ),
    atapi.ReferenceField(
        'RestrictedCategories',
        schemata=PMF('Preferences'),
        required=0,
        multiValued=1,
        vocabulary='getAnalysisCategories',
        validators=('restrictedcategoriesvalidator', ),
        vocabulary_display_path_bound=sys.maxint,
        allowed_types=('AnalysisCategory', ),
        relationship='ClientRestrictedCategories',
        widget=atapi.ReferenceWidget(
            checkbox_bound=1,
            label=_("Restrict categories"),
            description=_("Show only selected categories in client views"),
        ),
    ),
))
servicesSchema = atapi.BaseSchema + atapi.Schema((
    atapi.StringField(
        'description',
        accessor='Description',
        widget=atapi.TextAreaWidget(
            label=_(u"label_psc_description", default=u"Description"),
            description=_(u"help_psc_description", default=u""),
            i18n_domain='ploneservicescenter',
        ),
        required=1,
        searchable=1,
    ),
    atapi.StringField(
        'country',
        vocabulary=country.vocab,
        validateVocabulary=True,
        countries=country.countries,
        widget=atapi.SelectionWidget(
            label=_(u"label_psc_country_cat", default=u"Country"),
            description=_(u"help_services_country",
                          default=u"Select a country"),
            i18n_domain='ploneservicescenter',
            macro_edit="country_widget"),
        required=0,
        index=('KeywordIndex:schema', ),
    ),
    atapi.LinesField(
        'industry',
        validators=IndustriesValidator('validateIndustries'),
        widget=atapi.MultiSelectionWidget(
            label=_(u"label_psc_industry_cat", default=u"Industry"),
            description=_(u"help_services_industry",
                          default=u"Select a industry from the below list."),
            i18n_domain='ploneservicescenter',
        ),
        required=0,
        vocabulary='getIndustryVocabulary',
        index=('KeywordIndex:schema', ),
    ),
    public.LinkField(
        'url',
        widget=public.LinkWidget(
            label=_(u"label_services_url", default=u"URL"),
            description=_(
                u"help_services_url",
                default=
                u"Enter the web address (URL). You can copy & paste this from a browser window."
            ),
            i18n_domain='ploneservicescenter',
        ),
        required=1,
    ),
    atapi.IntegerField(
        'rating',
        widget=atapi.SelectionWidget(
            label=_(u"label_services_rating", default=u"Rating"),
            description=_(
                u"help_services_rating",
                default=
                u"Select a value of options from the below list by rating."),
            format='select',
            i18n_domain='ploneservicescenter',
        ),
        required=1,
        default=2,
        vocabulary=atapi.IntDisplayList([(i, i) for i in range(1, 4)]),
        write_permission='Manage portal',
        index=('FieldIndex:schema', ),
    ),
    atapi.StringField(
        'contactName',
        widget=atapi.StringWidget(
            label=_(u"label_services_contactname", default=u"Contact Name"),
            description=_(u"help_services_contactname",
                          default=u"Enter the contact name."),
            i18n_domain='ploneservicescenter',
        ),
        required=0,
        searchable=1,
        index=('KeywordIndex:schema', ),
    ),
    public.EmailField(
        'contactEmail',
        widget=public.EmailWidget(
            label=_(u"label_services_email", default=u"Email"),
            description=_(u"help_services_email",
                          default=u"Enter the email for contacts."),
            i18n_domain='ploneservicescenter',
        ),
        required=0,
        searchable=1,
        index=('KeywordIndex:schema', ),
    ),
    atapi.ComputedField(
        'sortExpression',
        expression='''\
str(context.getRating()) + " " + str(context.Title()).lower()''',
        mode='r',
        index=('FieldIndex', ),
        widget=atapi.StringWidget(
            label=_(u"", default=u"Sort Expression"),
            #            description=_(u"", default=u""),
            visible={
                'edit': 'invisible',
                'view': 'invisible'
            },
        ),
    ),
))
Example #5
0
schema = atapi.BaseSchema + atapi.Schema((
    atapi.TextField('teaser',
              searchable=1,
              widget=atapi.TextAreaWidget(description="""A short lead-in to the
              article so that we might get people to read the body""",
                                    label="Teaser",
                                    rows=3)),

    # Using a bare ObjetField doesn't make sense ...
    #ObjectField('author'),
    atapi.StringField('author'),

    atapi.TextField('body',
              required=1,
              primary=1,
              searchable=1,
              default_output_type='text/html',
              allowable_content_types=('text/restructured',
                                       'text/plain',
                                       'text/html',
                                       'application/msword'),
              widget=atapi.RichWidget(),
              ),

    atapi.IntegerField("number",
                 index="FieldIndex",
                 default=42,
                 validators=('isInt',),
                 ),

    atapi.ImageField('image',
               default_output_type='image/jpeg',
               allowable_content_types=('image/*',),
               widget=atapi.ImageWidget()),

    atapi.ReferenceField('related',
                   relationship='related',
                   multiValued=True,
                   widget=atapi.ReferenceWidget(),
                   keepReferencesOnCopy=True),

    atapi.ReferenceField('rel2',
                   relationship='rel2',
                   multiValued=True,
                   widget=atapi.ReferenceWidget(),
                   keepReferencesOnCopy=True),
    ),

    marshall=PrimaryFieldMarshaller()) + TemplateMixin.schema
SCHEMA = atapi.Schema((
            atapi.TextField(
                schemata='default',
                name='story_titles',
                languageIndependent=False,
                searchable=True,
                required_for_published=False,
                required=True,
                allowable_content_types=('text/plain',),
                default_content_type='text/plain',
                default_output_type='text/plain',
                widget=atapi.TextAreaWidget(
                    label='Story titles',
                    description=('Story titles, one per line.'),
                    label_msgid='EEAContentTypes_label_embed',
                    i18n_domain='eea',),
            ),
            atapi.TextField(
                schemata='default',
                name='full_story_description',
                languageIndependent=False,
                searchable=True,
                required_for_published=False,
                required=False,
                allowable_content_types=('text/html',),
                default_content_type='text/html',
                default_output_type='text/x-html-safe',
                widget=atapi.RichWidget(
                    label='Full story description',
                    description=('Full story description should be added here.'),
                    label_msgid='EEAContentTypes_label_full_story_description',
                    i18n_domain='eea',
                    rows=10,),
            ),
            EEAReferenceField('relatedItems',
                schemata='categorization',
                relationship='relatesTo',
                multiValued=True,
                languageIndependent=True,
                keepReferencesOnCopy=True,
                validators = (('maxRelatedItems', V_REQUIRED),),
                widget=EEAReferenceBrowserWidget(
                    label='Related items',
                    description='Specify relations to other content within Plone.')
            ),
         ))
MULTIPLEFIELD_LIST = atapi.DisplayList(
    (
    ('1', _(u'Option 1 : printemps')),
    ('2', unicode('Option 2 : \xc3\xa9t\xc3\xa9', 'utf-8')),  # e-acute t e-acute
    ('3', u'Option 3 : automne'),
    ('4', _(u'option3', default=u'Option 3 : hiver')),
    ))

schema = atapi.BaseSchema + atapi.Schema((
    atapi.LinesField(
        'MULTIPLEFIELD',
        searchable=1,
        vocabulary=MULTIPLEFIELD_LIST,
        widget=atapi.MultiSelectionWidget(
            i18n_domain='plone',
            ),
        ),
    atapi.TextField(
        'TEXTFIELD',
        primary=True,
        ),
))


class Dummy(atapi.BaseContent):

    portal_discussion = DummyDiscussionTool()

    def getCharset(self):
        return 'utf-8'
"""Definition of the ReferringProviderFolder content type
"""

from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-

from wres.archetypes.interfaces import IReferringProviderFolder
from wres.archetypes.config import PROJECTNAME

ReferringProviderFolderSchema = folder.ATFolderSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
))

schemata.finalizeATCTSchema(ReferringProviderFolderSchema,
                            folderish=True,
                            moveDiscussion=False)


class ReferringProviderFolder(folder.ATFolder):
    """Folder of Referring Providers"""
    implements(IReferringProviderFolder)

    meta_type = "ReferringProviderFolder"
    schema = ReferringProviderFolderSchema

    # -*- Your ATSchema to Python Property Bridges Here ... -*-
Example #9
0
profileSchema = folder.ATFolderSchema.copy() + atapi.Schema((

    atapi.ImageField(
        name='Image',
        sizes=None,
        widget=atapi.ImageWidget(
            label=u'Profile Image',
            label_msgid='isaw.facultycv_label_ProfileImage',
            il8n_domain='isaw.facultycv',
        ),
        required=False,
        searchable=True,
        accessor='profileImage',
    ),

    atapi.ReferenceField(
        name = 'ProfileRef',

        widget = atapi.ReferenceWidget(
            label = u'Profile reference',
        ),
        relationship = 'owned_profile',
        multiValued=False,
    ),

    atapi.TextField(
        name = 'Titles',
        default_output_type='text/x-html-safe',
        widget = atapi.RichWidget(
            label=u'Faculty Titles',
            label_msgid='isaw.facultycv_label_Titles',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
        searchable = True
    ),

    atapi.StringField(
        name = 'Phone',
        default_output_type='text/x-html-safe',
        widget = atapi.StringWidget(
            label=u'Phone',
            label_msgid='isaw.facultycv_label_Phone',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
        searchable = True

    ),

    atapi.StringField(
        name = 'Email',
        default_output_type='text/x-html-safe',
        widget = atapi.StringWidget(
            label=u'Email',
            label_msgid='isaw.facultycv_label_Email',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
        searchable = True

    ),

    atapi.StringField(
        name = 'Address',
        default_output_type='text/x-html-safe',
        widget = atapi.StringWidget(
            label=u'Address Information',
            label_msgid='isaw.facultycv_label_Address',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
        searchable = True

    ),

    atapi.TextField(
        name = 'Profile Blurb',
        default_output_type='text/x-html-safe',
        widget = atapi.RichWidget(
            label=u'Profile Blurb',
            label_msgid='isaw.facultycv_label_Profile',
            il8n_domain='isaw.facultycv',
            ),

        required = False,
        searchable = True
    )

))
Example #10
0
schema = atapi.Schema(
    tuple(field_instances) + (
        atapi.LinesField(
            'selectionlinesfield1',
            vocabulary='_get_selection_vocab',
            enforceVocabulary=1,
            widget=atapi.SelectionWidget(label='Selection'),
        ),
        atapi.LinesField(
            'selectionlinesfield2',
            vocabulary='_get_selection_vocab',
            widget=atapi.SelectionWidget(label='Selection',
                                         i18n_domain="attesti18n"),
        ),
        atapi.LinesField(
            'selectionlinesfield3',
            vocabulary='_get_selection_vocab2',
            widget=atapi.MultiSelectionWidget(label='MultiSelection',
                                              i18n_domain="attesti18n"),
        ),
        atapi.TextField(
            'textarea_appendonly',
            widget=atapi.TextAreaWidget(
                label='TextArea',
                append_only=1,
            ),
        ),
        atapi.TextField(
            'textarea_appendonly_timestamp',
            widget=atapi.TextAreaWidget(
                label='TextArea',
                append_only=1,
                timestamp=1,
            ),
        ),
        atapi.TextField(
            'textarea_maxlength',
            widget=atapi.TextAreaWidget(
                label='TextArea',
                maxlength=20,
            ),
        ),
        atapi.TextField(
            'richtextfield',
            allowable_content_types=('text/plain', 'text/structured',
                                     'text/restructured', 'text/html',
                                     'application/msword'),
            widget=atapi.RichWidget(label='rich'),
        ),
        atapi.ReferenceField(
            'referencefield',
            relationship='complextype',
            widget=atapi.ReferenceWidget(addable=1),
            allowed_types=('ComplexType', ),
            multiValued=1,
        ),
    )) + atapi.ExtensibleMetadata.schema
Example #11
0
SparqlBaseSchema = atapi.Schema((
    StringField(name='endpoint_url',
                widget=StringWidget(label="Sparql endpoint URL", ),
                validators=('isURL', ),
                required=1),
    IntegerField(name='timeout',
                 widget=SelectionWidget(label="Timeout (seconds)", ),
                 default=10,
                 required=1,
                 vocabulary=['10', '20', '30', '40', '50', '60', '300', '600'],
                 accessor='getTimeout',
                 edit_accessor='getTimeout',
                 mutator='setTimeout'),
    DataGridField(
        name='arg_spec',
        widget=DataGridWidget(
            label="Arguments",
            description="""Provide names, types and queries for the arguments.
                    Names and types are mandatory, but you can leave the
                    query field empty.
                    Details and a full tutorial on how to work with
                    arguments <a
                    href="++resource++eea.sparql.documentation/api/index.html"
                    title="tutorial">here.</a>
                        """,
            auto_insert=False,
            i18n_domain='eea',
            columns={
                'name': Column("Name"),
                'query': LinesColumn("Query")
            },
            helper_js=(
                '++resource++eea.sparql.datasource.js',
                'datagridwidget.js',
            ),
            helper_css=('++resource++eea.sparql.datasource.css',
                        'datagridwidget.css')),
        columns=("name", "query")),
    TextField(name='sparql_query',
              default_content_type='text/plain',
              allowable_content_types=('text/plain', ),
              widget=TextAreaWidget(
                  macro="sparql_textfield_with_preview",
                  helper_js=("sparql_textfield_with_preview.js", ),
                  helper_css=("sparql_textfield_with_preview.css", ),
                  label="Query",
              ),
              required=1,
              validators=('isSparqlOverLimit', )),
    BooleanField(name='sparql_static',
                 widget=BooleanWidget(
                     label='Static query',
                     description='The data will be fetched only once',
                     visible={
                         'edit': 'invisible',
                         'view': 'invisible'
                     }),
                 default=False,
                 required=0),
    TextField(
        name='sparql_results',
        widget=TextAreaWidget(label="Results",
                              visible={
                                  'edit': 'invisible',
                                  'view': 'invisible'
                              }),
        required=0,
    ),
    BlobField(
        name='sparql_results_cached',
        widget=TextAreaWidget(label="Results",
                              visible={
                                  'edit': 'invisible',
                                  'view': 'invisible'
                              }),
        required=0,
    ),
    BlobField(
        name='sparql_results_cached_json',
        widget=TextAreaWidget(label="Results",
                              visible={
                                  'edit': 'invisible',
                                  'view': 'invisible'
                              }),
        required=0,
    ),
    BlobField(
        name='sparql_results_cached_xml',
        widget=TextAreaWidget(label="Results",
                              visible={
                                  'edit': 'invisible',
                                  'view': 'invisible'
                              }),
        required=0,
    ),
    BlobField(
        name='sparql_results_cached_xmlschema',
        widget=TextAreaWidget(label="Results",
                              visible={
                                  'edit': 'invisible',
                                  'view': 'invisible'
                              }),
        required=0,
    ),
    StringField(
        name='refresh_rate',
        widget=SelectionWidget(label="Refresh the results", ),
        default='Weekly',
        required=1,
        vocabulary=['Once', 'Hourly', 'Daily', 'Weekly'],
    ),
))
Example #12
0

@indexer(IGroup)
def members(obj):
    return len(obj.persons)


GroupSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ReferenceField(
        name='persons',
        storage=atapi.AnnotationStorage(),
        required=False,
        widget=ReferenceBrowserWidget(
            label=_(u"Persons"),
            description=_(u"The persons that belong to this group"),
            restrict_browsing_to_startup_directory=True,
        ),
        searchable=1,
        relationship='group_person',
        allowed_types=('Person', ),
        multiValued=True,
    ), ))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

GroupSchema['title'].storage = atapi.AnnotationStorage()
GroupSchema['description'].storage = atapi.AnnotationStorage()
Example #13
0
SignupSheetSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.BooleanField(
        'allowSignupForMultipleSlots',
        storage=atapi.AnnotationStorage(),
        widget=atapi.BooleanWidget(
            label=_(u'Allow Signup For Multiple Slots'),
            description=_(
                u'Allow the user to signup for more than one slot.'))),
    atapi.StringField(
        'showSlotNames',
        storage=atapi.AnnotationStorage(),
        widget=atapi.BooleanWidget(
            label=_(u'Show Individual Time Slot Names'),
            description=_(u'Whether or not to show individual slot names.'))),
    atapi.LinesField(
        'extraFields',
        storage=atapi.AnnotationStorage(),
        vocabulary="getExtraFieldsVocabulary",
        widget=atapi.MultiSelectionWidget(
            label=_(u'Extra Fields'),
            description=_(u'Information you want to collect from users besides'
                          ' just name and email.'),
            format='checkbox')),
    atapi.LinesField(
        'contactInfo',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Contact Information'),
            description=_(u'Contact information for the manager of the signup'
                          ' sheet.'))),
    atapi.LinesField(
        'extraEmailContent',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Extra Email Content'),
            description=_(u'Any additional information that you want included '
                          'in the notification emails. Note: Contact info., '
                          'sheet, day, time, and a url are included by '
                          'default.'))),
))
Example #14
0
SponsoredSchema = general.GeneralSchema.copy() + atapi.Schema((

    ###################
    # SPONSOR
    ###################
    atapi.StringField(
    schemata='sponsor',
    name='event_Sponsor_Name',
    widget=atapi.StringWidget(
        label=u'Event Sponsor Name',
        label_msgid='ISAW_Event_Sponsor_Name',
        il8n_domain='ISAW_Event',
        maxlength=255,
        size=50,
        ),
        
    required=False,
    searchable=True),
    
    atapi.StringField(
    schemata='sponsor',
    name='event_Sponsor_Url',
    validators = ('isURL'),
    widget=atapi.StringWidget(
        label=u'Event Sponsor Url',
        label_msgid='ISAW_Event_Sponsor_Url',
        il8n_domain='ISAW_Event',
        maxlength=255,
        size=50,
        ),
        
    required=False,
    searchable=True),
    
    atapi.ImageField(
    schemata='sponsor',
    name='event_Sponsor_Logo',
    widget=atapi.ImageWidget(
        label=u'Event Sponsor Logo',
        label_msgid='ISAW_Event_Sponsor_Logo',
        il8n_domain='ISAW_Event',
        ),
        
    required=False,
    searchable=True),


))
Example #15
0
from Products.CMFCore.permissions import View
from Products.CMFCore.permissions import ModifyPortalContent
from AccessControl import ClassSecurityInfo

from iservices.rssdocument import RSSDocumentMessageFactory as _
from iservices.rssdocument.interfaces import IRSSDocument
from iservices.rssdocument import config

RSSDocumentSchema = ATContentTypeSchema.copy() + atapi.Schema((
    atapi.StringField(
        'RSSLink',
        required=True,
        widget=atapi.StringWidget(label=_(u'RSS URL'),
                                  description=_(u'The URL of the RSS Feed')),
    ),
    atapi.IntegerField(
        'max_entries',
        required=True,
        widget=atapi.IntegerWidget(
            label=_(u'Max Entries'),
            description=_(u'Maximum Number of entries to show')),
    ),
))
finalizeATCTSchema(RSSDocumentSchema)


class RSSDocument(base.ATCTContent):
    """A Plone document that embedds a RSS feed with JQuery"""

    implements(IRSSDocument)
    schema = RSSDocumentSchema
""" Definition of the Infographic content type
"""
from AccessControl import ClassSecurityInfo
from Products.Archetypes.ArchetypeTool import registerType
from Products.Archetypes import atapi
from Products.ATContentTypes.content import image
from Products.EEAContentTypes.config import EEAMessageFactory as _, PROJECTNAME
from Products.EEAContentTypes.content.interfaces import IInfographic
from zope.interface import implements
from plone.app.blob import field

SCHEMA = atapi.Schema((field.ImageField(name="image",
                                        schemata="default",
                                        sizes=None,
                                        required=True,
                                        primary=True,
                                        widget=field.ImageWidget(
                                            label=_("Infographic"),
                                            description=_("Infographic image"),
                                            i18n_domain='eea',
                                        )), ))


class Infographic(image.ATImage):
    """ Infographic """

    implements(IInfographic)

    meta_type = "Infographic"
    portal_type = "Infographic"
    archetypes_name = "Infographic"
Example #17
0
schema = BikaSchema.copy() + atapi.Schema((
    atapi.StringField('DocumentID',
                      required=1,
                      validators=('uniquefieldvalidator', ),
                      widget=atapi.StringWidget(label=_("Document ID"), )),
    atapi.FileField('File',
                    required=1,
                    widget=atapi.FileWidget(
                        label=_("Document"),
                        description=_("File upload "),
                    )),
    atapi.StringField('DocumentVersion',
                      widget=atapi.StringWidget(
                          label=_("Document Version"), )),
    atapi.StringField(
        'DocumentLocation',
        widget=atapi.StringWidget(
            label=_("Document Location"),
            description=_("Location where the document set is shelved"),
        )),
    atapi.StringField(
        'DocumentType',
        required=1,
        widget=atapi.StringWidget(
            label=_("Document Type"),
            description=
            _("Type of document (e.g. user manual, instrument specifications, image, ...)"
              ),
        )),
))
OrganizationSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.StringField(
        'address',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Address"),
            description=_(u"Organization's address"),
        ),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'country',
        storage=atapi.AnnotationStorage(),
        widget=atapi.SelectionWidget(
            label=_(u"Country"),
            description=_(u"Organization's country"),
        ),
        vocabulary_factory='contacts.countries',
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'state',
        storage=atapi.AnnotationStorage(),
        widget=atapi.SelectionWidget(
            label=_(u"State"),
            description=_(u"Organization's state"),
        ),
        vocabulary_factory='contacts.states',
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'city',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"City"),
            description=_(u"Organization's city"),
        ),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'zip',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"ZIP"),
            description=_(u"Organization's ZIP"),
        ),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'extraAddress',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Extra Address Info"),
            description=_(u"Organization's extra address information."),
        ),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'phone',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Phone Number"),
            description=_(u"Organization's phone number"),
        ),
        searchable=1,
    ),
    atapi.StringField(
        'phoneInternal',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Internal Phone Number"),
            description=_(u"Organization's internal phone number"),
        ),
        searchable=1,
    ),
    atapi.StringField(
        'fax',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Fax number"),
            description=_(u"Organization's fax number"),
        ),
        searchable=1,
    ),
    atapi.StringField(
        'email',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"E-mail address"),
            description=_(u"Organization's e-mail address"),
        ),
        validators=('isEmail'),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'email2',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"2nd E-mail address"),
            description=_(u"Organization's 2nd e-mail address"),
        ),
        validators=('isEmail'),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'email3',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"3rd E-mail address"),
            description=_(u"Organization's 3rd e-mail address"),
        ),
        validators=('isEmail'),
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'web',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Web"),
            description=_(u"Organization's web page or blog. Example: "
                          "http://www.google.com"),
        ),
        required=False,
        searchable=1,
        validators=('isURL'),
    ),
    atapi.StringField(
        'sector',
        storage=atapi.AnnotationStorage(),
        widget=atapi.SelectionWidget(
            label=_(u"Sector"),
            description=_(u"Organization's sector"),
            format='select',
        ),
        vocabulary_factory='contacts.sectors',
        required=False,
        searchable=1,
    ),
    atapi.StringField(
        'sub_sector',
        storage=atapi.AnnotationStorage(),
        widget=atapi.SelectionWidget(
            label=_(u"Sub sector"),
            description=_(u"Organization's sub sector"),
            format='select',
        ),
        vocabulary_factory='contacts.sub_sectors',
        required=False,
        searchable=1,
    ),
    atapi.TextField(
        'text',
        storage=atapi.AnnotationStorage(),
        widget=atapi.RichWidget(label=_(u"Text"), ),
        required=False,
        searchable=1,
        default_content_type='text/html',
        default_output_type='text/x-html-safe',
    ),
))
Example #19
0
 atapi.Schema(
     (atapi.ReferenceField('playlistVideos',
                           relationship = 'playlist_videos',
                           allowed_types=('KalturaVideo',),
                           multiValued = True,
                           isMetadata = False,
                           accessor = 'getPlaylistVideos',
                           mutator = 'setPlaylistVideos',
                           required=False,
                           default=(),
                           widget = ReferenceBrowserWidget(
                               addable = False,
                               destination = [],
                               allow_search = True,
                               allow_browse = True,
                               allow_sorting = True,
                               show_indexes = False,
                               force_close_on_insert = True,
                               label = "Videos (Add Manually)",
                               label_msgid = "label_kvideos_msgid",
                               description = "Choose manually which videos are "
                               "included in this playlist",
                               description_msgid = "desc_kvideos_msgid",
                               i18n_domain = "kaltura_video",
                               visible = {'edit' : 'visible',
                                          'view' : 'visible',
                                          }
                               ),
                           ),
      )
 )
Example #20
0
SharePointAdapterSchema = FormAdapterSchema.copy() + atapi.Schema((
    atapi.StringField('sharepoint_tenant',
                      required=True,
                      write_permission=ModifyPortalContent,
                      read_permission=ModifyPortalContent,
                      vocabulary_factory="collective.pfgsharepoint.vocabularies.SharepointTenants",
                      widget=atapi.SelectionWidget(
                          label=u'SharePoint Tenant',
                      )),
    atapi.StringField('sharepoint_site',
                      required=False,
                      write_permission=ModifyPortalContent,
                      read_permission=ModifyPortalContent,
                      vocabulary='getSites',
                      widget=atapi.SelectionWidget(
                          label=u'SharePoint Site ID',
                      )),
    atapi.StringField('sharepoint_list',
                      required=False,
                      write_permission=ModifyPortalContent,
                      read_permission=ModifyPortalContent,
                      vocabulary='getLists',
                      widget=atapi.SelectionWidget(
                          label=u'SharePoint List ID',
                      )),
    atapi.StringField('sharepoint_drive',
                      required=False,
                      write_permission=ModifyPortalContent,
                      read_permission=ModifyPortalContent,
                      vocabulary='getDrives',
                      widget=atapi.SelectionWidget(
                          label=u'SharePoint Document Library AKA Drive ID',
                          description=u'This is where any attachments will be uploaded.',
                      )),
    atapi.StringField('upload_field',
                      required=False,
                      write_permission=ModifyPortalContent,
                      read_permission=ModifyPortalContent,
                      vocabulary='fgFieldsDisplayList',
                      widget=atapi.SelectionWidget(
                          label=u'File Upload Field',
                          description=u'This must be a datagrid field with a file upload field.',
                      )),
    atapi.StringField('filename_string',
                      required=False,
                      write_permission=ModifyPortalContent,
                      read_permission=ModifyPortalContent,
                      widget=atapi.StringWidget(
                          label=u'Filename Format String',
                          description=u'The name the xml fromt template will be uploaded as. \
                                        The form fields are available using the python string format e.g. {field-id} \
                                        Use {now} for the submission datetime.',
                      )),
    TALESString('formatScript',
        schemata='overrides',
        searchable=0,
        required=0,
        validators=('talesvalidator', ),
        write_permission=EDIT_TALES_PERMISSION,
        default='',
        isMetadata=True,
        languageIndependent=1,
        widget=atapi.StringWidget(label=_(u'label_BeforeAdapterOverride_text',
                                    default=u"Before Adapter Script"),
            description=_(u'help_BeforeAdapterOverride_text', default=\
                u"A TALES expression that will be called before this adapter runs. "
                "Form input will be in the request.form dictionary. "
                "Leave empty if unneeded. "
                "The most common use of this field is to call a python script "
                "to clean up form input. "
                "If the return value is None then the adapter will use request.form "
                "If the return value is a dictionary then the adapter will use the "
                "returned dictionary. "
                "PLEASE NOTE: errors in the evaluation of this expression will "
                "cause an error on form display."),
            size=70,
            ),
        ),
    DataGridField(
        name='field_map',
        widget=DataGridWidget(
            label=u'Field Map',
            description=u"Map the PFG field to the Sharepoint list column.",
            columns={
                'pfg_field': SelectColumn(u'PFG Field',
                                          vocabulary='fgFieldsDisplayList',),
                'sharepoint_column': SelectColumn(u'Sharepoint Column',
                                                  vocabulary='getColumnsVocab'),
                },
            ),
        allow_empty_rows=False,
        required=False,
        columns=('pfg_field', 'sharepoint_column'),
    ),

    #DataGridField(
    #    name='upload_field_map',
    #    widget=DataGridWidget(
    #        label=u'Field Map',
    #        description=u"Map the PFG field to the Sharepoint list column.",
    #        columns={
    #            'pfg_field': SelectColumn(u'PFG Field',
    #                                      vocabulary='fgFieldsDisplayList',),
    #            'sharepoint_column': SelectColumn(u'Sharepoint Column',
    #                                              vocabulary='getDriveColumns'),
    #            },
    #        ),
    #    allow_empty_rows=False,
    #    required=False,
    #    columns=('pfg_field', 'sharepoint_column'),
    #),

))
Example #21
0
from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-

from isaw.events.content import general
from isaw.events.interfaces import IExhibition
from isaw.events.config import PROJECTNAME

ExhibitionSchema = general.GeneralSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

))

# Set storage on fields copied from ATFolderSchema, making sure
# they work well with the python bridge properties.

ExhibitionSchema['title'].storage = atapi.AnnotationStorage()
ExhibitionSchema['description'].storage = atapi.AnnotationStorage()

#override finalizeATCTSchema
def finalizeATCTSchema(schema, folderish=False, moveDiscussion=True):
    """Finalizes an ATCT type schema to alter some fields
       for the event type. This had to be overrided - cwarner
    """
    schema.moveField('relatedItems', pos='bottom')
Example #22
0
schema = Organisation.schema.copy() + atapi.Schema((
    atapi.StringField(
        'ClientID',
        required=1,
        searchable=True,
        validators=('uniquefieldvalidator', 'standard_id_validator'),
        widget=atapi.StringWidget(label=_("Client ID"), ),
    ),
    atapi.BooleanField(
        'BulkDiscount',
        default=False,
        write_permission=ManageClients,
        widget=atapi.BooleanWidget(label=_("Bulk discount applies"), ),
    ),
    atapi.BooleanField(
        'MemberDiscountApplies',
        default=False,
        write_permission=ManageClients,
        widget=atapi.BooleanWidget(label=_("Member discount applies"), ),
    ),
    atapi.LinesField(
        'EmailSubject',
        schemata='Preferences',
        default=[
            'ar',
        ],
        vocabulary=EMAIL_SUBJECT_OPTIONS,
        widget=atapi.MultiSelectionWidget(
            description=_("Items to be included in email subject lines"),
            label=_("Email subject line"),
        ),
    ),
    atapi.ReferenceField(
        'DefaultCategories',
        schemata='Preferences',
        required=0,
        multiValued=1,
        vocabulary='getAnalysisCategories',
        vocabulary_display_path_bound=sys.maxint,
        allowed_types=('AnalysisCategory', ),
        relationship='ClientDefaultCategories',
        widget=atapi.ReferenceWidget(
            checkbox_bound=0,
            label=_("Default categories"),
            description=_(
                "Always expand the selected categories in client views"),
        ),
    ),
    atapi.ReferenceField(
        'RestrictedCategories',
        schemata='Preferences',
        required=0,
        multiValued=1,
        vocabulary='getAnalysisCategories',
        validators=('restrictedcategoriesvalidator', ),
        vocabulary_display_path_bound=sys.maxint,
        allowed_types=('AnalysisCategory', ),
        relationship='ClientRestrictedCategories',
        widget=atapi.ReferenceWidget(
            checkbox_bound=0,
            label=_("Restrict categories"),
            description=_("Show only selected categories in client views"),
        ),
    ),
    atapi.StringField('DefaultARSpecs',
                      schemata="Preferences",
                      default='ar_specs',
                      vocabulary=DEFAULT_AR_SPECS,
                      widget=atapi.SelectionWidget(
                          label=_("Default AR Specifications"),
                          description=_("DefaultARSpecs_description"),
                          format='select',
                      )),
    atapi.BooleanField(
        'DefaultDecimalMark',
        schemata="Preferences",
        default=True,
        widget=atapi.BooleanWidget(
            label=_("Default decimal mark"),
            description=_(
                "The decimal mark selected in Bika Setup will be used."),
        )),
    atapi.StringField(
        'DecimalMark',
        schemata="Preferences",
        vocabulary=DECIMAL_MARKS,
        default=".",
        widget=atapi.SelectionWidget(
            label=_("Custom decimal mark"),
            description=_(
                "Decimal mark to use in the reports from this Client."),
            format='select',
        )),
))
Example #23
0
SCALDSSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ReferenceField(
        'template',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            label=_(u"SCALDS Spreadsheet"),
            description=_(
                u"A SCALDS spreadsheet that will be used as a template."),
            startup_directory='/luc/impacts/scalds',
            allow_browse=True,
            allow_search=True,
        ),
        required=True,
        relationship='scalds_template',
        allowed_types=('File', 'Document'),
        multiValued=False,
    ),
    atapi.ReferenceField(
        'scenario',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            label=_(u"LUC Scenario"),
            description=
            _(u"The LUC scenario that will provide spatialized inputs to the SCALDS model."
              ),
            startup_directory='/luc/scenarios',
        ),
        required=True,
        relationship='scalds_scenario',
        allowed_types=('LUC Scenario'),
        multiValued=False,
    ),
    atapi.ReferenceField(
        'vmt',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            label=_(u"VMT Map"),
            description=
            _(u"A vector map with the daily average VMT per household/employee per area."
              ),
            startup_directory='/luc/impacts/scalds/vmt',
        ),
        required=True,
        relationship='scalds_vmt',
        allowed_types=('SimMap'),
        multiValued=False,
    ),
    atapi.ReferenceField(
        'water',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            label=_(u"Water and Sewer Costs"),
            description=
            _(u"A vector map providing costs associated with households/employees by area."
              ),
            startup_directory='/luc/impacts/scalds/water',
        ),
        relationship='scalds_water',
        allowed_types=('SimMap'),
        multiValued=False,
    ),
    atapi.DateTimeField(
        'end_time',
        storage=atapi.AnnotationStorage(),
        widget=atapi.CalendarWidget(
            label=_(u"Model End Time"),
            description=_(u"Logs when model ends execution."),
            visible={
                'view': 'hidden',
                'edit': 'hidden'
            },
        ),
        validators=('isValidDate'),
    ),
    atapi.DateTimeField(
        'start_time',
        storage=atapi.AnnotationStorage(),
        widget=atapi.CalendarWidget(
            label=_(u"Model Start Time"),
            description=_(u"Logs when the model begins execution."),
            visible={
                'view': 'hidden',
                'edit': 'hidden'
            },
        ),
        validators=('isValidDate'),
    ),
    atapi.StringField(
        'runstatus',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Model Run Status"),
            description=_(u"Maintain the state of the job."),
            visible={
                'view': 'hidden',
                'edit': 'hidden'
            },
        ),
        required=True,
        default=_(u"queued"),
    ),
))
Example #24
0
from bika.lims.utils import isActive
from bika.lims.interfaces import IContact, IClient
from bika.lims.content.person import Person
from bika.lims.config import PROJECTNAME
from bika.lims.config import ManageClients
from bika.lims import logger
from bika.lims import bikaMessageFactory as _

ACTIVE_STATES = ["active"]

schema = Person.schema.copy() + atapi.Schema(
    (atapi.ReferenceField('CCContact',
                          schemata='Publication preference',
                          vocabulary='getContacts',
                          multiValued=1,
                          allowed_types=('Contact', ),
                          relationship='ContactContact',
                          widget=atapi.ReferenceWidget(
                              checkbox_bound=0,
                              label=_("Contacts to CC"),
                          )), ))

schema['JobTitle'].schemata = 'default'
schema['Department'].schemata = 'default'
# Don't make title required - it will be computed from the Person's Fullname
schema['title'].required = 0
schema['title'].widget.visible = False


class Contact(Person):
    """A Contact of a Client which can be linked to a System User
Example #25
0
""" Book """

from Products.Archetypes import atapi
from Products.ATContentTypes.content.document import ATDocument

SCHEMA = ATDocument.schema.copy() + atapi.Schema((
    atapi.StringField('isbn',
                      schemata='book',
                      widget=atapi.StringWidget(label=u'ISBN',
                                                description=u'ISBN')),
    atapi.StringField('link',
                      schemata='book',
                      widget=atapi.StringWidget(label=u'Link',
                                                description=u'Book details')),
    atapi.StringField('publisher',
                      schemata='book',
                      widget=atapi.StringWidget(
                          label=u'Publisher', description=u'Book publisher')),
    atapi.IntegerField('rating',
                       schemata='book',
                       widget=atapi.IntegerWidget(label=u'Rating',
                                                  description=u'Book rating')),
))


class Book(ATDocument):
    """ Demo Book
    """
    archetypes_name = meta_type = portal_type = 'Book'
    _at_rename_after_creation = True
    schema = SCHEMA
Example #26
0
from Products.CMFCore import permissions
from Products.Archetypes import atapi
from Products.ATContentTypes.content import schemata
from Products.ATContentTypes.content.link import ATLink, ATLinkSchema
from Products.ATContentTypes.content.image import ATImageSchema
from Products.ATContentTypes.lib.imagetransform import ATCTImageTransform

from redturtle.video import videoMessageFactory as _
from redturtle.video.interfaces import IRTRemoteVideo
from redturtle.video.config import PROJECTNAME
from redturtle.video.content.default import DefaultVideo
from redturtle.video.content.video_schema import VIDEO_SCHEMA

RTRemoteVideoSchema = ATLinkSchema.copy() + VIDEO_SCHEMA.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

RTRemoteVideoSchema['title'].storage = atapi.AnnotationStorage()
RTRemoteVideoSchema['description'].storage = atapi.AnnotationStorage()

imageField = ATImageSchema['image'].copy()
imageField.required = False
imageField.primary = False
imageField.widget.description = _(u'help_video_image',
                                  default = u'Can be used to provide splash image when needed')
imageField.validators = None
Example #27
0
ElectionPersonSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    StringField(name='firstName',
                widget=StringWidget(label=_(u"First Name",
                                            default=u"First Name"), ),
                required=True,
                searchable=True),
    StringField(name='lastName',
                widget=StringWidget(label=_(u"Last Name",
                                            default=u"Last Name"), ),
                required=True,
                searchable=True),
    StringField(name='email',
                user_property=True,
                widget=StringWidget(label=_(u"Email", default=u"Email"), ),
                searchable=True,
                validators=('isEmail', )),
    StringField(
        name='gender',
        widget=SelectionWidget(label=_(u"Person Gender",
                                       default=u"Person Gender"), ),
        vocabulary=('Male', 'Female'),
        required=True,
    ),
    StringField(
        name='id',
        widget=StringWidget(
            label=_(u"Access Account ID", default=u"Access Account ID"),
            description=_(u"Example: abc123", default=u"Example: abc123"),
        ),
        required=True,
        user_property=True,
    ),
    ComputedField(name='title',
                  widget=ComputedField._properties['widget'](
                      label=_(u"Full Name", default=u"Full Name"),
                      visible={
                          'edit': 'invisible',
                          'view': 'visible'
                      },
                  ),
                  accessor="Title",
                  user_property='fullname',
                  searchable=True),
    StringField(
        'password',
        languageIndependent=True,
        required=False,
        mode='w',
        write_permission=SetOwnPassword,
        widget=PasswordWidget(
            label=_(u"Password", default=u"Password"),
            description=
            _(u"Password for this person (Leave blank if you don't want to change the password.)",
              default=
              u"Password for this person (Leave blank if you don't want to change the password.)"
              ),
        ),
    ),
))
"""Definition of the RegisteredService content type
"""

from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-

from pcp.contenttypes.interfaces import IRegisteredService
from pcp.contenttypes.config import PROJECTNAME

RegisteredServiceSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
))

schemata.finalizeATCTSchema(RegisteredServiceSchema, moveDiscussion=False)


class RegisteredService(base.ATCTContent):
    """A CDI admin registers a new service"""
    implements(IRegisteredService)

    meta_type = "RegisteredService"
    schema = RegisteredServiceSchema


atapi.registerType(RegisteredService, PROJECTNAME)
) + atapi.Schema((
    atapi.StringField(
        'Project',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Component"),
            description=_(u"Component name or label"),
        ),
        default=_(''),
    ),
    atapi.TextField(
        'questions',
        storage=atapi.AnnotationStorage(),
        widget=atapi.RichWidget(
            label=_(u"Function"),
            description=_(u"Describe the function of the component"),
            rows=10,
        ),
        default='',
    ),

    # run instructions need to be implemented
    atapi.TextField(
        'questions',
        storage=atapi.AnnotationStorage(),
        widget=atapi.RichWidget(
            label=_(u"Additional Information"),
            description=
            _(u"ex: Information for the system is in the document: _SystemInfo.doc"
              ),
            rows=20,
        ),
        default='',
    ),
))
Example #30
0
EditSchema = ATFolder.schema.copy() + atapi.Schema((
    atapi.StringField(
        'ct_type',
        schemata="default",
        vocabulary_factory='eea.relations.voc.PortalTypesVocabulary',
        validators=('eea.relations.contenttype', ),
        widget=atapi.SelectionWidget(
            label='Portal type',
            label_msgid='widget_portal_type_title',
            description='Select portal type',
            description_msgid='widget_portal_type_description',
            i18n_domain="eea")),
    atapi.StringField('ct_interface',
                      schemata="default",
                      vocabulary_factory='eea.relations.voc.ObjectProvides',
                      validators=('eea.relations.contenttype', ),
                      widget=atapi.SelectionWidget(
                          label='Interface',
                          label_msgid='widget_interface_title',
                          description='Select interface',
                          description_msgid='widget_interface_description',
                          i18n_domain="eea")),
    TALESString(
        'ct_default_location',
        schemata="default",
        default="python:None",
        widget=atapi.StringWidget(
            label='Default location expression',
            label_msgid='widget_portal_type_title',
            description=('Enter a TALES expression that resolves the default '
                         'location for this content type'),
            description_msgid='widget_ct_default_location',
            i18n_domain="eea")),
))