コード例 #1
0
 def getFields(self):
     fields = []
     for schema_name, schema in self._getSchemas():
         for field_name, field in getFieldsInOrder(schema):
             if IChoice.providedBy(field):
                 fields.append(StringField(
                     schema_name + '.' + field.__name__,
                     required=field.required,
                     schemata='categorization',
                     widget=atapi.SelectionWidget(
                         label = field.title,
                         description = field.description,
                         ),
                     vocabulary = atapi.DisplayList([(t.value, t.title or t.token) for t in field.vocabulary]),
                     ))
             elif ISet.providedBy(field) and IChoice.providedBy(field.value_type): # XXX should be set
                 fields.append(LinesField(
                     schema_name + '.' + field.__name__,
                     required=field.required,
                     schemata='categorization',
                     widget=atapi.MultiSelectionWidget(
                         label = field.title,
                         description = field.description,
                         ),
                     vocabulary = atapi.DisplayList([(t.value, t.title or t.token) for t in field.value_type.vocabulary]),
                     ))
     return fields
コード例 #2
0
class ILORegions(grok.Adapter):

    # This applies to all AT Content Types, change this to
    # the specific content type interface you want to extend
    grok.context(IILORegionsEnabled)
    grok.name('ilo.extenders.ilo_regions')
    grok.implements(IOrderableSchemaExtender, IBrowserLayerAwareExtender)
    grok.provides(IOrderableSchemaExtender)

    layer = IProductSpecific

    fields = [
        # add your extension fields here
        ExtensionLinesField(
            name='ilo_regions',
            widget=atapi.MultiSelectionWidget(
                label="ILO Regions",
                description=
                "Select the related regions. Hold CTRL to make multiple selections.",
            ),
            vocabulary_factory='ilo.vocabulary.regions',
            multiValued=1,
        )
    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        return self.fields

    def getOrder(self, schematas):
        # you may reorder the fields in the schemata here
        return schematas
コード例 #3
0
    def __init__(self, oid, **kwargs):
        BaseFormField.__init__(self, oid, **kwargs)

        self.fgField = atapi.StringField('fg_multi_product_select_field',
            searchable=False,
            required=False,
            widget=atapi.MultiSelectionWidget(),
            vocabulary='_get_selection_vocabulary',
            enforceVocabulary=False,
            write_permission=View,
            )
コード例 #4
0
            widget=FtwCalendarWidget(
                label=_(u'task_label_end_date', default=u'End of Task'),
                description=_(u'task_help_end_date',
                              default=u'Enter the ending date and time, '
                              'or click the calendar icon and select it.'))),

        atapi.LinesField(
            name='responsibility',
            required=False,
            searchable=True,
            vocabulary_factory='ftw.task.users',

            widget=atapi.MultiSelectionWidget(
                size=4,
                format='checkbox',
                label=_(u'task_label_responsibility',
                        default=u'Responsibility'),
                description=_(u'task_help_responsibility',
                              default=u'Select the responsible person(s).'))),

        atapi.ReferenceField(
            name='related_items',
            relationship='relatesTo',
            multiValued=True,
            isMetadata=True,
            languageIndependent=False,
            index='KeywordIndex',
            schemata='default',

            widget=ATReferenceBrowserWidget.ReferenceBrowserWidget(
                allow_search=True,
コード例 #5
0
ファイル: pauta.py プロジェクト: lflrocha/ebc.pauta
    atapi.LinesField(
        name='tipos',
        widget=atapi.InAndOutWidget(
            label="Tipos",
            description="Selecione uma ou mais tipo de mídia.",
        ),
        enforceVocabulary=True,
        vocabulary=NamedVocabulary("""TipoMateria"""),
        required=True,
        searchable=True,
    ),

    atapi.LinesField(
        name='turno',
        widget=atapi.MultiSelectionWidget(
            label='Turno',
            format='checkbox',
        ),
        enforceVocabulary=True,
        vocabulary=['Manhã','Tarde','Noite'],
    ),

    atapi.BooleanField(
        name='nota',
        widget=atapi.BooleanWidget(
            label='Nota',
        ),
    ),


    atapi.BooleanField(
        name='monitorar',
コード例 #6
0
ファイル: client.py プロジェクト: udithap/Bika-LIMS
     '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=_(
コード例 #7
0
ファイル: doclegis.py プロジェクト: dbutaye/apl.doclegis
     storage=atapi.AnnotationStorage(),
     widget=atapi.CalendarWidget(
         label=_(u"Date de publication au moniteur si connue"),
         description=_(u"jj/mm/aaaa"),
         show_hm=False,
         starting_year=1789,
     ),
     validators=('isValidDate'),
 ),
 atapi.StringField(
     'institution',
     vocabulary=vocabulary.INSTITUTIONS,
     storage=atapi.AnnotationStorage(),
     widget=atapi.MultiSelectionWidget(
         label=_(u"Institution(s)"),
         description=_(u""),
         format='checkbox',
     ),
 ),
 atapi.StringField(
     'theme',
     vocabulary=vocabulary.THEMES,
     storage=atapi.AnnotationStorage(),
     widget=atapi.MultiSelectionWidget(
         label=_(u"Theme(s)"),
         description=_(u""),
         format='checkbox',
     ),
 ),
 atapi.StringField(
     'commune',
コード例 #8
0
     'admins',
     relationship='admin_of',
     multiValued=True,
     allowed_types=('Person', ),
     widget=ReferenceBrowserWidget(
         label='Administrators',
         allow_browse=1,
         startup_directory='/people',
     ),
 ),
 atapi.LinesField(
     'supported_os',
     searchable=True,
     multiValued=True,
     vocabulary='getOSVocab',
     widget=atapi.MultiSelectionWidget(format='checkbox'),
 ),
 atapi.IntegerField('committed_cores', schemata='resources'),
 atapi.IntegerField('committed_disk', schemata='resources', size=20),
 atapi.IntegerField('committed_tape', schemata='resources', size=20),
 atapi.IntegerField('used_disk', schemata='resources', size=20),
 atapi.IntegerField('used_tape', schemata='resources', size=20),
 atapi.ReferenceField(
     'communities_primary',
     relationship='primary_provider_for',
     multiValued=True,
     allowed_types=('Community', ),
     widget=ReferenceBrowserWidget(
         label='Primary provider for',
         allow_browse=1,
         startup_directory='/communities',
コード例 #9
0
     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."
         ),
コード例 #10
0
                      'thumb': (128, 128),
                      'tile': (64, 64),
                  },
                  widget=atapi.ImageWidget(
                      label="Homepage image (16:9)",
                      description="Dimensions: 268px x 150px",
                      show_content_type=False,
                  )),
 atapi.LinesField(
     'themes',
     vocabulary=site_themes,
     index='KeywordIndex',
     multiValued=True,
     widget=atapi.MultiSelectionWidget(
         label="Themes",
         format='checkbox',
         description="",
     ),
 ),
 atapi.LinesField(
     'regions',
     vocabulary=site_regions,
     index='KeywordIndex',
     multiValued=True,
     widget=atapi.MultiSelectionWidget(
         label="Regions",
         format='checkbox',
         description="",
     ),
 ),
 atapi.StringField(
コード例 #11
0
from AccessControl import ClassSecurityInfo
from Products.ATContentTypes.content import schemata
from Products.Archetypes import atapi
from Products.CMFCore.permissions import View
from Products.PloneFormGen.content.fieldsBase import BaseFormField, BaseFieldSchemaStringDefault
from jazkarta.shop.interfaces import IProduct
from .interfaces import IJazShopSelectStringField, IJazShopMultiSelectStringField
from .interfaces import IJazShopArbitraryPriceStringField
from .config import PROJECTNAME


JazShopSelectFieldSchema = BaseFieldSchemaStringDefault.copy() + atapi.Schema((
    atapi.StringField('availableProducts',
        searchable=False,
        required=False,
        widget=atapi.MultiSelectionWidget(),
        vocabulary_factory='jazkarta.pfg.jazshop.available_products',
        enforceVocabulary=False,
    ),
    atapi.StringField('selectionFormat',
        vocabulary=('select', 'radio'),
        enforceVocabulary=True,
        widget=atapi.SelectionWidget(format='radio'),
        required=True,
    ),
))

schemata.finalizeATCTSchema(JazShopSelectFieldSchema, moveDiscussion=False)


def get_available_products_vocab(context):
コード例 #12
0
ファイル: externalpage.py プロジェクト: artifex-it/art.mashup
         size=100,
     ),
 ),
 atapi.LinesField(
     name='options',
     required=False,
     searchable=False,
     vocabulary=[
         ('c_to_xhtml', _('c_to_xhtml_label', u'Convert HTML to XHTML')),
         ('use_ext_title',
          _('use_ext_title_label', u'Use external header title (<title>)')),
         ('hide_loc_title',
          _('hide_loc_title_label', u'Hide local content title (<h1>)')),
     ],
     widget=atapi.MultiSelectionWidget(
         label=_('option_label', u'Options'),
         format='checkbox',
     ),
 ),
 atapi.LinesField(
     name='substitutions',
     required=False,
     searchable=False,
     widget=atapi.LinesWidget(
         label=_('substitutions_label', u'String substitutions'),
         description=_(
             'substitutions_description',
             u'one substitution per line: |search text|=>|replacement text|'
         ),
         rows=5,
         cols=100,
     ),
コード例 #13
0
         label=u'Full Project Description',
         description=u'The complete project description.',
         i18n_domain="collective.TemplateUploadCenter",
         rows=25,
     ),
 ),
 atapi.LinesField(
     'categories',
     multiValued=1,
     required=1,
     vocabulary='getCategoriesVocab',
     enforceVocabulary=1,
     index='KeywordIndex:schema',
     widget=atapi.MultiSelectionWidget(
         label=u'Categories',
         description=u'Categories that this item should appear in.',
         i18n_domain="collective.TemplateUploadCenter",
     ),
 ),
 atapi.LinesField(
     'selfCertifiedCriteria',
     multiValued=1,
     required=0,
     vocabulary='getSelfCertificationCriteriaVocab',
     enforceVocabulary=1,
     index='KeywordIndex:schema',
     schemata="review",
     widget=atapi.MultiSelectionWidget(
         label=u'Self-Certification Checklist',
         description=u'Check which criteria this project fulfills.',
         i18n_domain="collective.TemplateUploadCenter",
コード例 #14
0
ファイル: scorganism.py プロジェクト: affinitic/istsida.site
                     description = "Noms, téléphones et emails de la ou des personnes de contact.",
                     rows = 5)
 ),
 atapi.TextField('mission',
     searchable = True,
     default_output_type = 'text/x-html-safe',
     widget = atapi.RichWidget(
                     label = "Missions",
                     description = "Brêve description des missions et des activités.",
                     rows = 5)
 ),
 atapi.LinesField('activity',
     required = True,
     vocabulary_factory = "istsida.vocabularies.activities",
     widget = atapi.MultiSelectionWidget(
         label="Activités",
         format = 'checkbox')
 ),
 atapi.LinesField('types',
     required = True,
     vocabulary_factory = "istsida.vocabularies.types",
     widget = atapi.MultiSelectionWidget(
         label="Type d'organisme",
         format = 'checkbox')
 ),
 atapi.LinesField('region',
     required = True,
     vocabulary_factory = "istsida.vocabularies.regions",
     widget = atapi.InAndOutWidget(
         label="Couverture géographique",
         size = 5)
コード例 #15
0
class FeedExtender(object):
    implements(ISchemaExtender, IBrowserLayerAwareExtender)
    adapts(IBaseContent)

    layer = IBrowserLayer

    fields = (
        LinesField(
            name="feeds",
            required=False,
            multivalued=1,
            schemata="settings",
            widget=atapi.MultiSelectionWidget(
                label=IFeedControl['feeds'].title,
                description=IFeedControl['feeds'].description,
                visible={ "view" : "invisible" },
                ),
            vocabulary_factory=IFeedControl['feeds'].value_type.vocabularyName,
            ),

        StringField(
            'feedCategory',
            schemata="settings",
            languageIndependent=True,
            required=False,
            default=None,
            widget=atapi.SelectionWidget(
                label=IFeedControl['feedCategory'].title,
                description=IFeedControl['feedCategory'].description,
                visible={ "view" : "invisible" },
                ),
            vocabulary_factory=IFeedControl['feedCategory'].vocabularyName,
            ),

        ScheduleField(
            'feedSchedule',
            schemata="settings",
            languageIndependent=True,
            required=False,
            default=None,
            write_permission=SCHEDULE_PERMISSION,
            widget=atapi.CalendarWidget(
                show_hm=False,
                starting_year=2012,
                ending_year=2015,
                label=IFeedControl['feedSchedule'].title,
                description=IFeedControl['feedSchedule'].description,
                visible={ "view" : "invisible" },
                ),
            ),

        ModerationField(
            'feedModerate',
            schemata="settings",
            default=False,
            enforceVocabulary=1,
            write_permission=MODERATE_PERMISSION,
            widget=atapi.BooleanWidget(
                label=IFeedControl['feedModerate'].title,
                description=IFeedControl['feedModerate'].description,
                visible={ "view" : "invisible" },
                ),
            ),
        )

    types = weakref.WeakKeyDictionary()

    def __init__(self, context):
        self.context = context

    def getFields(self):
        if IAcquirer.providedBy(self.context):
            base = aq_base(self.context)
        else:
            base = self.context

        cls = type(base)
        applicable = self.types.get(cls)
        if applicable is None:
            # Check that we can get a settings object for this
            # context.
            applicable = IFeedSettings(self.context, None) is not None

            if applicable:
                # If there's an overlap on field names, we do not extend
                # the content schema. Note that Archetypes allows
                # overriding a field which is why we need to perform this
                # check ourselves.
                names = set(field.__name__ for field in self.fields)
                existing = self.context.schema.keys()
                overlap = names & set(existing)
                applicable = not bool(overlap)

            self.types[cls] = applicable

            if not applicable:
                logging.getLogger('collective.chimpfeed').info(
                    "skipping %s." % cls.__name__
                    )

        if not applicable:
            return ()

        return self.fields
コード例 #16
0
         format='radio',
         label=u"Third License",
         description=
         u"Third License (if published under different licenses).",
         i18n_domain='collective.TemplateUploadCenter',
     ),
 ),
 atapi.LinesField(
     name='compatibility',
     required=1,
     searchable=1,
     index='KeywordIndex:schema',
     vocabulary='getCompatibilityVocab',
     widget=atapi.MultiSelectionWidget(
         label=u"Compatibility",
         description=u"Tested and working with the following versions:",
         i18n_domain='collective.TemplateUploadCenter',
     ),
 ),
 atapi.BooleanField(
     'acceptdisclaimer',
     required=1,
     widget=atapi.BooleanWidget(
         label=u"Accept the Legal Disclaimer and Limitations below:",
         description=
         u"<h3>Legal Disclaimers and Limitations</h3><p>The text for the disclaimer and limitations go here.</p>",
         i18n_domain="collective.TemplateUploadCenter",
     ),
 ),
 atapi.TextField(
     'contributors',
コード例 #17
0
from bika.lims.config import PROJECTNAME
from bika.lims.content.person import Person
from bika.lims.content.contact import Contact
from bika.lims.interfaces import ILabContact
from bika.lims import deprecated
from bika.lims import logger
from bika.lims import bikaMessageFactory as _
from bika.lims import deprecated

schema = Person.schema.copy() + atapi.Schema((
    atapi.LinesField('PublicationPreference',
                     vocabulary_factory=
                     'bika.lims.vocabularies.CustomPubPrefVocabularyFactory',
                     default='email',
                     schemata='Publication preference',
                     widget=atapi.MultiSelectionWidget(
                         label=_("Publication preference"), )),
    atapi.ImageField(
        'Signature',
        widget=atapi.ImageWidget(
            label=_("Signature"),
            description=_(
                "Upload a scanned signature to be used on printed analysis "
                "results reports. Ideal size is 250 pixels wide by 150 high"),
        )),
    atapi.ReferenceField(
        'Departments',
        required=0,
        vocabulary_display_path_bound=sys.maxint,
        allowed_types=('Department', ),
        relationship='LabContactDepartment',
        vocabulary='_departmentsVoc',
コード例 #18
0
                       schemata='default',
                       default=1000,
                       widget=atapi.IntegerWidget(
                           label=_(u"Maximum items"),
                           description=_(
                               u"Total maximum children items to be included "
                               u"while generating PDF for collection "
                               u"or folderish content-types."))),
    atapi.LinesField(
        'types',
        schemata='default',
        vocabulary_factory='plone.app.vocabularies.ReallyUserFriendlyTypes',
        multiValued=1,
        widget=atapi.MultiSelectionWidget(
            format='checkbox',
            label=_(u'Portal types'),
            description=_(
                u"Use this PDF Theme for the following Portal-Types."))),
    ImageField("image",
               schemata="default",
               sizes=None,
               widget=atapi.ImageWidget(
                   label=_(u"Preview"),
                   description=_(u"Upload a preview image for this theme"))),
))

THEME_SCHEMA = ATFolder.schema.copy() + EditSchema.copy()


def finalize_schema(schema=THEME_SCHEMA):
    """ Update schema
コード例 #19
0
                    newsletter, they get the letter anyway. Changing this \
                    setting does not affect already existing issues.'),
            i18n_domain='EasyNewsletter',
        )
    ),

    atapi.LinesField(
        'ploneReceiverMembers',
        vocabulary="get_plone_members",
        schemata='recipients',
        widget=atapi.MultiSelectionWidget(
            label=_(
                u"EasyNewsletter_label_ploneReceiverMembers",
                default=u"Plone Members to receive the newsletter"),
            description=_(
                u"EasyNewsletter_help_ploneReceiverMembers",
                default=u"Choose Plone Members which should receive \
                    the newsletter. Changing this setting does not affect \
                    already existing issues."),
            i18n_domain='EasyNewsletter',
            size=20,
        )
    ),

    atapi.LinesField(
        'ploneReceiverGroups',
        vocabulary="get_plone_groups",
        schemata='recipients',
        widget=atapi.MultiSelectionWidget(
            label=_(
                u"EasyNewsletter_label_ploneReceiverGroups",
                default=u"Plone Groups to receive the newsletter"),
コード例 #20
0
         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 '
コード例 #21
0
ファイル: common.py プロジェクト: EUDAT-DPMT/pcp.contenttypes
            label="Ticket ID",
            description="Once a ticket in EUDAT's Trouble Ticket "
            "System (TTS) has been created its ID can be entered "
            "here for easy reference.",
        ),
    ),
))

ConditionsFields = atapi.Schema((
    atapi.LinesField(
        'scopes',
        required=1,
        vocabulary=NamedVocabulary('scope_vocabulary'),
        widget=atapi.MultiSelectionWidget(
            description='Tick all that apply. '
            'If in doubt, select "EUDAT".',
            format='checkbox',
        ),
    ),
    ateapi.CommentField(
        'conditions',
        comment='Any constraints that need to be satisfied by the '
        'customer:',
    ),
    atapi.StringField(
        'regional_constraints',
        searchable=True,
        widget=atapi.StringWidget(label='Regional constraints'),
    ),
    atapi.StringField(
        'thematic_constraints',
コード例 #22
0
                 default=u'Send to all Plone members'),
         description=_(
             u'EasyNewsletter_ENLIssue_help_sendToAllPloneMembers',
             default=u'If checked, the newsletter/mailing is send to all \
                 plone members.'),
         i18n_domain='EasyNewsletter',
     )),
 atapi.LinesField(
     'ploneReceiverMembers',
     vocabulary='get_plone_members',
     default_method='get_ploneReceiverMembers_defaults',
     widget=atapi.MultiSelectionWidget(
         label=_(u'EasyNewsletter_label_ploneReceiverMembers',
                 default=u'Plone Members to receive the newsletter'),
         description=_(u'EasyNewsletter_ENLIssue_help_ploneReceiverMembers',
                       default=u'Choose Plone Members which should receive \
                     the newsletter.'),
         i18n_domain='EasyNewsletter',
         size=20,
     )),
 atapi.LinesField(
     'ploneReceiverGroups',
     vocabulary='get_plone_groups',
     default_method='get_ploneReceiverGroups_defaults',
     widget=atapi.MultiSelectionWidget(
         label=_(u'EasyNewsletter_label_ploneReceiverGroups',
                 default=u'Plone Groups to receive the newsletter'),
         description=_(u'EasyNewsletter_ENLIssue_help_ploneReceiverGroups',
                       default=u'Choose Plone Groups which members should \
                     receive the newsletter.'),
         i18n_domain='EasyNewsletter',
コード例 #23
0
ファイル: projectroom.py プロジェクト: tlyng/intranett
from zope.lifecycleevent.interfaces import IObjectRemovedEvent
from zope.schema.interfaces import IVocabularyFactory

from intranett.policy import IntranettMessageFactory as _
from intranett.policy.config import PROJECTNAME
from intranett.policy.interfaces import IProjectRoom

ProjectRoomSchema = ATFolder.schema.copy() + atapi.Schema((atapi.LinesField(
    'participants',
    required=False,
    multiValued=True,
    vocabulary='getParticipantsVocabulary',
    storage=atapi.AnnotationStorage(),
    widget=atapi.MultiSelectionWidget(
        label=_(u"Participants"),
        description=_(u"Users who have access to the project room."),
        format='checkbox',
    ),
), ))


class ProjectRoom(ATFolder):
    """A project room for groups of participants"""

    implements(IProjectRoom)
    schema = ProjectRoomSchema
    meta_type = "ProjectRoom"
    security = ClassSecurityInfo()

    participants = atapi.ATFieldProperty("participants")
コード例 #24
0
                        description=_('help_table_caption',
                                      default=u'Optional summary of table contents'),
                        size=50,
                        visible={'view': 'invisible', 'edit': 'visible'},
            ),
    ),

    atapi.LinesField('cssClasses',
              required=False,
              searchable=False,
              vocabulary='getCSSClassesVocabulary',
              default=["listing"],
              widget=atapi.MultiSelectionWidget(
                        label=_(u'CSS classes'),
                        description=_(u'CSS classes to be applied to the table.\n'
                                      u'This list is taken from available TinyMCE style for tables.'),
                        format="checkbox",
                        visible={'view': 'invisible', 'edit': 'visible'},
                        condition="object/getCSSClassesVocabulary",
            ),
    ),

    atapi.ComputedField('text',
        expression="object/getText",
        searchable=True,
        widget=atapi.ComputedWidget(
            label=ATDocumentSchema['text'].widget.label,
            description=ATDocumentSchema['text'].widget.description,
        )
    ),

    atapi.TextField('textAfter',
コード例 #25
0
 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,
     ),
コード例 #26
0
    ),
))

#this seems misnamed
KalturaMetadataSchema = atapi.Schema((
    atapi.LinesField(
        'categories',
        multiValued=True,
        searchable=0,
        required=False,
        vocabulary="getCategoryVocabulary",
        accessor="getCategories",
        mutator="setCategories",
        widget=atapi.MultiSelectionWidget(
            label="Categories",
            label_msgid="label_kvideofile_categories",
            description="Select video category(ies) this playlist will provide",
            description_msgid="desc_kvideofile_categories",
            i18n_domain="kaltura_video"),
    ),
    atapi.LinesField(
        'tags',
        multiValued=True,
        searchable=0,
        required=False,
        accessor="getTags",
        mutator="setTags",
        widget=atapi.LinesWidget(
            label="Tags",
            label_msgid="label_kvideofile_tags",
            description=
            "Add keyword tag(s) this playlist will provide (one per line)",
コード例 #27
0
                 default=u'Send to all Plone members'),
         description=_(
             u'help_sendToAllPloneMembers',
             default=u'If checked, the newsletter/mailing is send to all \
                 plone members. If there are subscribers inside the \
                 newsletter, they get the letter anyway.'),
         i18n_domain='EasyNewsletter',
     )),
 atapi.LinesField(
     'ploneReceiverMembers',
     vocabulary="get_plone_members",
     widget=atapi.MultiSelectionWidget(
         label=_(u"EasyNewsletter_label_ploneReceiverMembers",
                 default=u"Plone Members to receive the newsletter"),
         description=_(
             u"EasyNewsletter_help_ploneReceiverMembers",
             default=
             u"Choose Plone Members which should receive the newsletter."),
         i18n_domain='EasyNewsletter',
         size=20,
     )),
 atapi.LinesField(
     'ploneReceiverGroups',
     vocabulary="get_plone_groups",
     widget=atapi.MultiSelectionWidget(
         label=_(u"EasyNewsletter_label_ploneReceiverGroups",
                 default=u"Plone Groups to receive the newsletter"),
         description=_(
             u"EasyNewsletter_help_ploneReceiverGroups",
             default=
             u"Choose Plone Groups which members should receive the newsletter."
         ),
コード例 #28
0
            label_msgid='widget_required_title',
            description=('Select this if you want to make this relation '
                         'mandatory (action: edit)'),
            description_msgid='widget_required_description',
            i18n_domain="eea"
        )
    ),
    atapi.LinesField('required_for',
        schemata='default',
        vocabulary_factory='eea.relations.voc.workflowstates',
        widget=atapi.MultiSelectionWidget(
            format='checkbox',
            label='Required for',
            label_msgid='widget_required_for_title',
            description=('Select workflow states that will require this '
                         'relation before setup (action: change state). '
                         'You will also have to update workflow '
                         'transitions accordingly'),
            description_msgid='widget_required_for_description',
            i18n_domain="eea"
        )
    ),
))

EditSchema = ATFolder.schema.copy() + RelationSchema.copy()
EditSchema.moveField('title', after='to')
EditSchema.moveField('description', after='backward_label')

class EEAPossibleRelation(ATFolder):
    """ Relation
    """
コード例 #29
0

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'
コード例 #30
0
     'requires_existing_data',
     storage=atapi.AnnotationStorage(),
     widget=atapi.SelectionWidget(
         label=_(u"Do you need data from existing systems?"),
         format='radio',
     ),
     vocabulary=['Yes', 'No'],
     required=True,
 ),
 atapi.StringField(
     'existing_data_needed',
     storage=atapi.AnnotationStorage(),
     widget=atapi.MultiSelectionWidget(
         label=_(u"Please specify the data needed from existing systems."),
         description=
         _(u"If you answered \"Yes\" above, please indicate which of the following data is needed from the existing Student Information System (PeopleSoft) or other campus systems"
           ),
         format='checkbox',
     ),
     vocabulary=[
         'none needed', 'Student Demographic Data',
         'Student Academic Data (GPA, major, etc.)', 'Enrollment Data',
         'Course Catalog/Class Listing data',
         'Student Course Schedule data', 'Admissions data',
         'Financial Aid data', 'Student Account data', 'Employee data',
         'Student/Employee Login data', 'Other - please specify below'
     ],
     required=True,
 ),
 atapi.TextField(
     'existing_data_needed_comments',