Esempio n. 1
0
class IRisiko(model.Schema):
    """ Marker interface and Dexterity Python Schema for Risiko
    """
    directives.widget("focus", CheckBoxFieldWidget)
    focus = schema.List(title="Auswahl der Gewährleistungsziele, die durch das Risiko kompromittiert werden", constraint=checkbox_constraint, value_type=schema.Choice(vocabulary=ziele))

    directives.widget("asset_choice", CheckBoxFieldWidget)
    asset_choice = schema.List(title=u"Art des Vermögensgegenstands", constraint=checkbox_constraint, value_type=schema.Choice(vocabulary=asset))

    asset = schema.Text(title=u"Optional: Nähere Erläuterung / Anmerkung zum Vermögensgegenstand", required=False)

    quelle = schema.Choice(title=u"Art der Bedrohung bzw. Quelle des Risikos", description=u"Treffen Sie eine Auswahl.", default="intern_employee", 
            vocabulary=threat)

    szenario = schema.Text(title=u"Optional: Nähere Erläuterung zur Bedrohung bzw. zur Quelle des Risikos", required=False)

    schwachstelle_choice = schema.Choice(title=u"Art der Schwachstelle (Vulnerability)", description=u"Treffen Sie eine Auswahl.", vocabulary=vulnerability)

    schwachstelle = schema.Text(title=u"Optional: Nähere Erläuterung zur Schwachstelle (Vulnerability)", required=False)

    schwachstelle_link = schema.URI(title=u"Optional: Link auf eine Quelle in der die Schwachstelle (Vulnerability) beschrieben bzw. dokumentiert wird",
                               description=u"Beispiel: Link auf Datenbank von Heise Online", required=False)

    directives.widget("grad_wahrscheinlichkeit", RadioFieldWidget)
    grad_wahrscheinlichkeit = schema.Choice(title=u"Grad der Eintrittswahrscheinlichkeit", vocabulary=grad, required=True)

    wahrscheinlichkeit = schema.Text(title=u"Erläuterung zur Eintrittswahrscheinlichkeit", required=False)

    directives.widget("grad_schwere", RadioFieldWidget)
    grad_schwere = schema.Choice(title=u"Grad der Schwere des Schadens", vocabulary=grad, required=True)

    schwere = schema.Text(title=u"Erläuterung zur Schwere des Schaden", required=False)

    massnahmen = RelationList(title=u"Maßnahmen zur Minimierung oder Vermeidung des Risikos",
                              value_type=RelationChoice(vocabulary='plone.app.vocabularies.Catalog'),
                              required=False)

    erlaeuterung = schema.Text(title=u"Erläuterungen zu den Maßnahmen", required=False)

    bewertung = schema.Choice(title=u"Risikobewertung nach Umsetzung der aufgeführten Maßnahmen", vocabulary=ampel, default='light')

    directives.widget(
        "massnahmen",
        RelatedItemsFieldWidget,
        pattern_options={
            "selectableTypes": ["Massnahme"],
            "basePath": make_relation_root_path,
        },
    )
Esempio n. 2
0
class ISliderBase(Schema):
    """Basic Image Tile Schema."""

    form.widget('use_query', UseQueryFieldWidget)
    use_query = schema.Bool(
        default=False,
        title=_(u'Use dynamic query'),
    )

    form.widget('images', RelatedItemsFieldWidget)
    images = schema.List(
        description=_(
            u'Select images or folders of images to display in slider', ),
        required=False,
        title=_(u'Images'),
        value_type=schema.Choice(
            vocabulary='plone.app.vocabularies.Catalog', ),
    )

    form.widget('query', QueryStringFieldWidget)
    query = schema.List(
        description=_(
            u'Define the search terms for the images you want to use. '
            u'The list of results will be dynamically updated', ),
        required=False,
        title=_(u'Search terms'),
        value_type=schema.Dict(
            value_type=schema.Field(),
            key_type=schema.TextLine(),
        ),
    )

    sort_on = schema.TextLine(
        description=_(u'Sort on this index'),
        required=False,
        title=_(u'Sort on'),
    )

    sort_reversed = schema.Bool(
        description=_(u'Sort the results in reversed order'),
        required=False,
        title=_(u'Reversed order'),
    )

    image_scale = schema.Choice(
        default='large',
        title=_(u'Image Scale'),
        source=image_scales,
    )
Esempio n. 3
0
class IExistingTileSchema(IContentTileSchema):

    form.order_before(title='use_query')
    title = schema.TextLine(title=u'Title heading',
                            description=u'Will be omitted if blank',
                            required=False,
                            default=u'')

    form.widget('display_fields', CheckBoxFieldWidget)
    display_fields = schema.Tuple(
        title=u'Display fields',
        description=u'Fields that should show from the content',
        default=('title', 'image', 'description'),
        value_type=schema.Choice(vocabulary=SimpleVocabulary([
            SimpleTerm('title', 'title', u'Title'),
            SimpleTerm('image', 'image', u'Image'),
            SimpleTerm('description', 'description', u'Overview/Summary'),
            SimpleTerm('date', 'date', u'Date'),
        ])))

    truncate_count = schema.Int(
        title=u'Overview/Summary Truncate',
        description=u'Number of words to truncate the overview/summary to',
        required=False,
        default=18)

    image_display_type = schema.Choice(
        title=u'Image display type',
        description=u'Does not apply to all display types',
        required=True,
        default=defaults.get('existing_tile_image_displaytype', u'landscape'),
        vocabulary=SimpleVocabulary([
            SimpleTerm('landscape', 'landscape', u'Landscape'),
            SimpleTerm('portrait', 'portrait', u'Portrait'),
            SimpleTerm('square', 'square', u'Square')
        ]))

    form.widget('display_type',
                PreviewSelectFieldWidget,
                tile_name=DISPLAY_TYPE_KEY)
    display_type = schema.Choice(title=u"Display Type",
                                 source=TileViewsSource(DISPLAY_TYPE_KEY),
                                 default=defaults.get(
                                     'existing_tile_displaytype', u'default'))

    form.widget(override_focal_point=FocalPointSelectFieldWidget)
    override_focal_point = schema.Text(title=u'Override Focal point',
                                       default=u'',
                                       required=False)
class ISortableContentListingTile(contentlisting.IContentListingTile):

    form.widget('query',
                SortableQueryStringFieldWidget,
                wrapper_css_class='sortableCollection-query')

    form.widget('sorting', wrapper_css_class='sortableCollection-sorting')
    sorting = schema.List(
        title=_(u'Sorting'),
        description=_(u'Widget specific sorting of the search results'),
        default=[],
        missing_value=[],
        value_type=schema.TextLine(),
        required=False,
    )
Esempio n. 5
0
class IDirectoryContactDetails(IContactDetails):

    form.widget(phone=multiline_field_widget)
    phone = schema.List(
        title=_(u'Phones'),
        required=False,
        constraint=validate_phones,
    )

    form.widget(cell_phone=multiline_field_widget)
    cell_phone = schema.List(
        title=CCMF(u'Cell phone'),
        required=False,
        constraint=validate_phones,
    )
Esempio n. 6
0
class ICalendarTileSchema(Interface):

    form.widget(query=QueryFieldWidget)
    query = schema.List(
        title=u'Base query',
        description=u"This query can be customized base on user selection",
        value_type=schema.Dict(value_type=schema.Field(),
                               key_type=schema.TextLine()),
        required=False,
        default=[{
            u'i': u'portal_type',
            u'v': [u'Event'],
            u'o': u'plone.app.querystring.operation.selection.any'
        }])

    sort_on = schema.TextLine(
        title=u'Sort on',
        description=u"Sort on this index",
        required=False,
    )

    sort_reversed = schema.Bool(
        title=u'Reversed order',
        description=u'Sort the results in reversed order',
        required=False,
    )

    limit = schema.Int(
        title=u'Limit',
        description=u'Limit Search Results',
        required=False,
        default=250,
        min=1,
    )
Esempio n. 7
0
class IStory(model.Schema):

    text = schema.Text(title=_(u"Text"), required=False)

    form.widget('estimate',
                TimeFieldWidget,
                show_min=False,
                hour_free_input=True)
    estimate = schema.Decimal(title=_(u"Estimate (man hours)"),
                              default=Decimal('0.00'))

    assigned_to = Select2MultiField(
        title=_(u"Assignees"),
        description=_(u"The user IDs of the people "
                      u"that are responsible to act on this story"),
        # value_type=schema.TextLine(),
        value_type=schema.Choice(
            title=_(u"User ID"),
            source="collective.simplemanagement.resources"),
        required=False,
        search_view=lambda x: '{}/select2-users-search'.format(x))

    epic = RelationChoice(title=_(u"Epic"),
                          description=_(u"The epic the story belongs to"),
                          source=ObjPathSourceBinder(object_provides=[
                              IEpic.__identifier__,
                          ]),
                          required=False)

    milestone = schema.Choice(title=_(u"Milestone"),
                              required=False,
                              source="collective.simplemanagement.milestones")
Esempio n. 8
0
class IExpert(model.Schema):
    """
    """

    dexteritytextindexer.searchable('competence')
    # dexteritytextindexer.searchable('region') # extra index for filtering by region
    dexteritytextindexer.searchable('organisation')

    competence = schema.TextLine(
        title=_(u'Competence'),
        required=False,
    )
    region = schema.TextLine(
        title=_(u'Region'),
        required=False
    )
    organisation = schema.TextLine(
        title=_(u'Organisation'),
        required=False,
    )
    widget(is_expert=RadioFieldWidget)
    is_expert = schema.Bool(
        title=_(u'Ist Experte. In Expertensuche aufnehmen.'),
        default=True,
        required=False,
    )

    order_after(is_expert='last_name')
    order_after(organisation='last_name')
    order_after(region='last_name')
    order_after(competence='last_name')
Esempio n. 9
0
class ISendEmailSubscribersForm(model.Schema):
    subject = schema.ASCIILine(title=u'Subject')

    directives.widget('send_to_categories', SelectFieldWidget)
    send_to_categories = schema.List(
        title=u'Send to categories',
        required=False,
        value_type=schema.Choice(
            vocabulary='castle.cms.vocabularies.EmailCategories'))

    send_from = schema.TextLine(
        title=u'Custom FROM address',
        required=False,
    )

    body = RichText(
        title=u'Body',
        description=u'Message body',
        default_mime_type='text/html',
        output_mime_type='text/html',
        allowed_mime_types=('text/html', ),
        required=True,
        default=RichTextValue(
            u'<p></p><p></p>'
            u'<p><a href="{{change_url}}">Change your subscription settings</a></p>'
            u'<p><a href="{{unsubscribe_url}}">Unsubscribe from these messages</a></p>',
            'text/html', 'text/html'))
Esempio n. 10
0
class IDatasetCorrelati(model.Schema):

    dataset_correlati = RelationList(
        title=_("dataset_correlati_label", default="Dataset correlati"),
        description=_(
            "dataset_correlati_help",
            default="Seleziona una lista di schede dataset collegate a questo"
            " contenuto.",
        ),
        default=[],
        value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
        required=False,
    )
    form.widget(
        "dataset_correlati",
        RelatedItemsFieldWidget,
        vocabulary="plone.app.vocabularies.Catalog",
        pattern_options={
            "selectableTypes": ["Dataset"],
            "maximumSelectionSize": 50,
        },
    )

    model.fieldset(
        "correlati",
        label=_("correlati_label", default="Contenuti collegati"),
        fields=["dataset_correlati"],
    )
Esempio n. 11
0
class INewsletter(model.Schema):

    form.widget(value=DataGridFieldFactory)

    target = RelationChoice(
        title=_(u"Target Collection"),
        source=CatalogSource(object_provides=ICollection.__identifier__),
        required=False,
    )

    show_summary = schema.Choice(
        title=_(u"Enabled"),
        required=False,
        values=['yes', 'no', 'auto'],
        default='auto',
    )

    limit = schema.Choice(
        title=_(u"Months to Limit"),
        required=False,
        values=[1, 3, 6, 9, 12],
        default=1,
    )

    value = schema.List(title=u"News Items",
                        value_type=DictRow(title=u"News Item",
                                           schema=INewsletterItemsRowSchema),
                        required=False)

    listserv_email = schema.TextLine(
        title=_(u"Listserv Email"),
        description=_(u"[Listserv Name]@lists.psu.edu"),
        required=False,
    )
Esempio n. 12
0
 class IConsentForm(Interface):
     lang = api.portal.get_current_language()
     for reason_id, reason in sorted(reasons.items()):
         reason_match = (validated_user and validated_user[0]
                         == reason.identifier_factory.__name__)
         if reason_match:
             if (reason.identifier_factory.getIdentifierForUser(
                     validated_user[1]) is None):
                 continue
         elif (reason.identifier_factory.getIdentifierForCurrentRequest(
                 self.request) is None):
             continue
         reason_id = reason_id.encode("ascii", "replace")
         directives.widget(safe_fieldname(reason_id), RadioFieldWidget)
         if not reason.can_object:
             directives.mode(**{safe_fieldname(reason_id): "display"})
         translated_title = translate(_(reason.Title),
                                      target_language=lang)
         locals()[safe_fieldname(reason_id)] = schema.Choice(
             title=translated_title,
             description=reason.html_description,
             vocabulary=consent_values,
             required=True,
             default="Allowed" if reason.isProcessingAllowed(
                 self.request,
                 identifier=validated_user[1] if reason_match else None,
             ) else "Blocked",
         )
     del lang
     del translated_title
     del reason_id
     del reason_match
     del reason
Esempio n. 13
0
class IDashboardPODTemplate(IConfigurablePODTemplate):
    """
    DashboardPODTemplate dexterity schema.
    """

    use_objects = schema.Bool(
        title=_(u'Use objects as generation context'),
        description=_(
            u'If selelected, receive awoken objects wrapped into their '
            u' helper view rather than brains as generation context'),
        default=False,
        required=False,
    )

    form.widget('dashboard_collections',
                CheckBoxFieldWidget,
                multiple='multiple',
                size=15)
    dashboard_collections = schema.List(
        title=_(u'Allowed dashboard collections'),
        description=
        _(u'Select for which dashboard collections the template will be available. '
          u'If nothing is selected, the template will be available on every dashboards.'
          ),
        value_type=schema.Choice(
            source='imio.dashboard.collectionsvocabulary'),
        required=True,
    )
    form.omitted('pod_portal_types')
Esempio n. 14
0
class ITaggedValuesSchema(model.Schema):

    form.mode(field_mode_hidden='hidden')
    field_mode_hidden = schema.TextLine(
        title=u"ModeHidden",
        description=u"",
    )

    form.mode(field_mode_display='display')
    field_mode_display = schema.TextLine(
        title=u"ModeDisplay",
        description=u"",
    )

    form.mode(field_mode_input='input')
    field_mode_input = schema.TextLine(
        title=u"ModeInput",
        description=u"",
    )

    field_mode_default = schema.TextLine(
        title=u"ModeInput",
        description=u"",
    )

    another_field = schema.TextLine(title=u"Tagged Values widget params")
    form.widget('another_field', a_param='some_value')
Esempio n. 15
0
class IMember(IEmail):
    """
    Member
    """

    first_name = schema.TextLine(
        title=_(u"First Name"),
        required=True,
    )

    last_name = schema.TextLine(
        title=_(u"Last Name"),
        required=True,
    )

    homepage = schema.TextLine(
        # url format
        title=_(u"External Homepage"),
        required=False,
        constraint=is_url,
    )

    directives.widget(bio="plone.app.z3cform.wysiwyg.WysiwygFieldWidget")
    bio = schema.Text(
        title=_(u"Biography"),
        required=False,
    )
Esempio n. 16
0
class IBirthday(model.Schema):

    form.widget(birthday=DateFieldWidget)
    birthday = schema.Date(
        title=_("Birthday"),
        required=False,
    )
class ICalltoactionSchema(Interface):
    """Call to action.

    internal link, external link, sharing
    """

    ctalabel = schema.TextLine(
        title=_(u'Label'),
        required=False,
        default=u'',
        missing_value=u'call to action',
    )
    widget('ctaurl', LinkFieldWidget)
    ctaurl = schema.TextLine(
        title=_(u'Target of call to action'),
        required=False,
        default=u'',
        missing_value=u'',
    )
    ctasharing = schema.Bool(
        title=_(u'Sharing'),
        required=False,
        default=False,
        missing_value=False,
    )
    ctacategory = schema.Choice(
        title=_(u'Category'),
        required=True,
        vocabulary='collective.multiplecalltoactions.CtoCategoryVocabulary')
Esempio n. 18
0
class IGalleryTileSchema(IImagesTileSchema):

    form.widget('display_type', PreviewSelectFieldWidget, tile_name='gallery')
    display_type = schema.Choice(title=u"Display Type",
                                 source=TileViewsSource('gallery'),
                                 default=defaults.get(
                                     'gallery_tile_displaytype', u'default'))
Esempio n. 19
0
class IAudio(model.Schema):

    # main file will always be converted to mp4
    form.widget(audio_file=StreamNamedFileFieldWidget)
    model.primary('audio_file')
    audio_file = namedfile.NamedBlobFile(
        title=_(u"Audio File"),
        description=u"",
        required=True,
        constraint=valid_audio
    )

    form.omitted('metadata')
    metadata = schema.Text(
        required=False
    )

    transcript = RichText(
        title=_(u"Transcript"),
        default_mime_type='text/html',
        output_mime_type='text/html',
        allowed_mime_types=('text/html', 'text/plain'),
        default=u"",
        required=False
    )
class IAddress(Interface):
    address_type = schema.Choice(title=u'Address Type',
                                 required=True,
                                 values=[u'Work', u'Home'])
    # A Relation field within a datagrid is a tricky one to get
    # working.  Uncomment if you want to try this.
    # link = RelationChoice(
    #         title=u"Link to content",
    #         source=ObjPathSourceBinder(),
    #         required=True)
    line1 = schema.TextLine(title=u'Line 1', required=True)
    line2 = schema.TextLine(title=u'Line 2', required=False)
    city = schema.TextLine(title=u'City / Town', required=True)
    country = schema.TextLine(title=u'Country', required=True)
    frozenField = schema.TextLine(title=u'Don\'t change',
                                  readonly=True,
                                  required=True)

    # A sample integer field
    personCount = schema.Int(title=u'Persons', required=False, min=0, max=15)

    # A sample datetime field
    if widget_datetime is not None:
        widget(dateAdded=DataGridFieldDatetimeFieldWidget)
    dateAdded = schema.Datetime(title=u"Date added")

    # A sample checkbox
    billed = schema.Bool(title=u"Billed")
Esempio n. 21
0
class IServiceNavigationSchema(model.Schema):
    directives.widget('links', DataGridFieldFactory, allow_reorder=True)
    links = schema.List(
        title=_(u'label_service_links', default=u'Service links'),
        value_type=schema.Object(
            title=u'link',
            schema=IServiceNavigationSchemaGrid
        ),
        required=False,
        missing_value=[],
    )

    disable = schema.Bool(
        title=_(u'label_disable_service_links',
                default=u'Disable service links'),
        required=False,
        missing_value=False,
    )

    directives.mode(modified='hidden')
    modified = schema.Bool(
        title=u'modified_marker',
        required=False,
        default=True,
        missing_value=True,
    )

    @invariant
    def link_validator(data):
        for link in data.links:
            if link.get('internal_link', None) and link.get('external_url', None):
                raise Invalid(_('error_link_validator',
                                u'Choose between an external or an internal link.'))
class IDocumentGeneratorSearchReplacePanelSchema(interface.Interface):
    """
    Schema for DocumentGeneratorSearchReplacePanel
    """

    selected_templates = schema.List(
        title=_(u"heading_selected_templates", default=u"Selected templates"),
        description=_(u"description_selected_templates", default=u""),
        required=False,
        default=[],
        missing_value=[],
        value_type=schema.Choice(
            source="collective.documentgenerator.AllPODTemplateWithFile"),
    )
    directives.widget("replacements", DataGridFieldFactory)
    replacements = schema.List(
        title=_(u"Replacements"),
        description=_("The replacements that will be made."),
        required=False,
        value_type=DictRow(schema=IReplacementRowSchema, required=True),
    )

    @invariant
    def has_valid_regexes(data):
        if hasattr(data, 'replacements'):
            for i, row in enumerate(data.replacements):
                if row["is_regex"]:
                    try:
                        re.compile(row["search_expr"])
                    except re.error:
                        raise Invalid(
                            _(u"Incorrect regex at row #{0} : \"{1}\"").format(
                                i + 1, row["search_expr"]))
Esempio n. 23
0
class IComunicatoStampa(model.Schema):
    arguments = schema.Tuple(
        title=_("arguments_label", default=u"Arguments"),
        description=_("arguments_help", default="Select one or more values."),
        value_type=schema.TextLine(),
        required=True,
        missing_value=(),
    )

    directives.widget(
        "arguments",
        AjaxSelectFieldWidget,
        vocabulary="rer.ufficiostampa.vocabularies.arguments",
        pattern_options={"allowNewItems": "false"},
    )

    legislature = schema.TextLine(
        title=_(u"label_legislature", default=u"Legislature"),
        description=u"",
        required=True,
        defaultFactory=defaultLegislature,
    )
    directives.mode(legislature="display")

    message_sent = schema.Bool(
        title=_(u"label_sent", default=u"Sent"),
        description=u"",
        required=False,
        default=False,
    )
    comunicato_number = schema.TextLine(title=u"",
                                        description=u"",
                                        required=False)
    directives.omitted("message_sent")
    directives.omitted("comunicato_number")
Esempio n. 24
0
class IConnector(model.Schema):

    connector_url = schema.TextLine(title=_(u'(optional) connection URL of storage'),
                                    description=_(
                                        u'WebDAV: webdav://host:port/path/to/webdav, '
                                        'local filesystem: file://path/to/directory, '
                                        'AWS S3: s3://bucketname, ', 'SFTP sftp://host/path'),
                                    required=False)

    connector_username = schema.TextLine(title=_(u'(optional) username overriding the system settings'), required=False)

    connector_password = schema.Password(title=_(u'(optional) password overriding the system settings'), required=False)

    connector_subpath = schema.TextLine(title=_(u'Subdirectory relative to the global connection URL'),
                                        description=_(u'Use this value for configuring a more specific subpath'),
                                        required=False)

    connector_readonly = schema.Bool(title=_(u'Readonly access'), default=False, required=False)

    form.widget("connector_reference", SelectWidget)
    connector_reference = schema.Choice(
        title=_("Reference to other connector "),
        required=False,
        source=get_connector_references,
        default=None,
    )
Esempio n. 25
0
class INewsTile(Schema):
    """A tile that displays a listing of content items"""

    title = schema.TextLine(
        title=_(u'Title'),
        required=False,
    )

    uid = schema.Choice(
        title=_(u"Select an existing content"),
        required=True,
        vocabulary='plone.app.vocabularies.Catalog',
    )
    directives.widget(
        'uid',
        RelatedItemsFieldWidget,
        pattern_options={'selectableTypes': ['Collection', 'Folder']},
    )

    limit = schema.Int(
        title=_(u'Limit'),
        description=_(u'Limit Search Results'),
        required=False,
        default=8,
        min=1,
    )

    limit_slider = schema.Int(
        title=_(u'Limit slider'),
        description=_(u'Number of element in slider'),
        required=False,
        default=4,
        min=1,
    )
class IAddress(Interface):
    address_type = schema.Choice(title=u'Address Type',
                                 required=True,
                                 values=[u'Work', u'Home'])
    # Uncomment, if you want to try the relationfield
    #    link = RelationChoice(
    #        title=u"Link to content",
    #        source=CatalogSource(portal_type=['Document']),
    #        required=True
    #    )
    line1 = schema.TextLine(title=u'Line 1', required=True)
    line2 = schema.TextLine(title=u'Line 2', required=False)
    city = schema.TextLine(title=u'City / Town', required=True)
    country = schema.TextLine(title=u'Country', required=True)
    frozenField = schema.TextLine(title=u'Don\'t change',
                                  readonly=True,
                                  required=True)

    # A sample integer field
    personCount = schema.Int(
        title=u'Persons',
        description=u'Enter number of persons (min 0 and max 15)',
        required=False,
        min=0,
        max=15)

    # A sample datetime field
    if widget_datetime is not None:
        widget(dateAdded=DataGridFieldDatetimeFieldWidget)
    dateAdded = schema.Datetime(title=u"Date added")

    # A sample checkbox
    billed = schema.Bool(title=u"Billed")
Esempio n. 27
0
class IPerson(model.Schema, IContactContent):
    """Interface for Person content type"""

    is_created = Attribute(u"Marker to know if the object is already created")

    lastname = schema.TextLine(
        title=_("Lastname"),
        required=True
        )
    firstname = schema.TextLine(
        title=_("Firstname"),
        required=False,
        )
    gender = schema.Choice(
        title=_("Gender"),
        vocabulary="Genders",
        required=False,
        )
    form.widget(gender=RadioFieldWidget)
    person_title = schema.TextLine(
        title=_("Person title"),
        required=False,
        )
    photo = NamedImage(
        title=_("Photo"),
        required=False,
        )

    def get_held_positions(self):
        """Returns held positions of this person
Esempio n. 28
0
class UserTriggerSchema(Interface):
    '''
        Define schema for add rule form
        '''

    ifttt_event_name = schema.TextLine(
        title=_(u'IFTTT event name'),
        description=_(
            u'Give the name of the IFTTT event which you want to trigger. '
            u'This will be part of the IFTTT webhook URL so should '
            u'not contain'
            u' white space or special characters - for '
            u'example mysite_modified.'),
        required=True,
        constraint=validate_ifttt_event_name,
    )

    forms.widget('content_types', SelectFieldWidget)
    content_types = schema.Tuple(
        title=_(u'Content Types'),
        description=_(u'Select the content types to restrict this event to'),
        required=True,
        missing_value=None,
        default=(),
        value_type=schema.Choice(
            vocabulary='plone.app.vocabularies.ReallyUserFriendlyTypes'))
Esempio n. 29
0
class ICategorization(model.Schema):
    # categorization fieldset
    model.fieldset(
        'categorization',
        label=_PMF(u'label_schema_categorization', default=u'Categorization'),
        fields=['subjects', 'language'],
    )

    subjects = schema.Tuple(
        title=_PMF(u'label_tags', default=u'Tags'),
        description=_PMF(
            u'help_tags',
            default=
            u'Tags are commonly used for ad-hoc organization of content.'),
        value_type=schema.TextLine(),
        required=False,
        missing_value=(),
    )
    form.widget(subjects=TextLinesFieldWidget)

    language = schema.Choice(
        title=_PMF(u'label_language', default=u'Language'),
        vocabulary='plone.app.vocabularies.AvailableContentLanguages',
        required=False,
        missing_value='',
    )

    form.omitted('subjects', 'language')
    form.no_omit(IEditForm, 'subjects', 'language')
    form.no_omit(IAddForm, 'subjects', 'language')
Esempio n. 30
0
class IEmail(Interface):
    """ Email """
    sender = Email(
        title=_(u"From"),
        required=True,
    )

    receiver = schema.Set(
        title=u'Recipients',
        value_type=schema.Choice(
            vocabulary='eea.meeting.vocabularies.RecipientsVocabulary'))

    cc = schema.Text(
        title=_(u"CC"),
        description=_(u'Add CC addresses one per line, no separator'),
        constraint=cc_constraint,
        required=False,
    )

    subject = schema.TextLine(
        title=_(u"Subject"),
        required=True,
    )

    body = RichText(
        title=_(u"Body"),
        required=True,
        output_mime_type='text/plain',
        allowed_mime_types=('text/html', 'text/structured', 'text/plain'),
    )

    directives.widget('sender', TextFieldWidget, klass=u'mail_widget')
        source=ObjPathSourceBinder(object_provides=IImage.__identifier__),
        required=False,
    )
    supphotos = RelationList(
        title=u"Gallery",
        default=[],
        value_type=RelationChoice(
            title=_(u"Related"),
            source=ObjPathSourceBinder(
                object_provides=IImage.__identifier__)
            ),
        required=False,
    )
    # approved is done by workflow

directives.widget('primephoto', AutocompleteFieldWidget)
directives.widget('supphotos', AutocompleteFieldWidget)


class ICaseStudy(IAceMeasure):
    """ Case study
    """
    # location - a clickable map, not provided if is "Adaptation option" type

    location_lat = Decimal(title=_(u"Location latitude"), required=True)
    location_lon = Decimal(title=_(u"Location longitude"), required=True)


class IAdaptationOption(IAceMeasure):
    """ Adaptation Option
    """