Beispiel #1
0
def update_item_schema(baseSchema):

    specificSchema = Schema((TextField(
        name='bourgmestreObservations',
        widget=RichWidget(
            label_msgid="PloneMeeting_bourgmestreObservations",
            description_msgid="bourgmestre_observations_descr",
            condition="python: here.attributeIsUsed('bourgmestreObservations')",
            rows=20,
            label='BourgmestreObservations',
            i18n_domain='PloneMeeting',
        ),
        default_content_type="text/html",
        read_permission=
        "PloneMeeting: Write item MeetingManager reserved fields",
        searchable=False,
        allowable_content_types=('text/html', ),
        default_output_type="text/x-html-safe",
        optional=True,
        write_permission=
        "PloneMeeting: Write item MeetingManager reserved fields",
    ), ), )

    completeItemSchema = baseSchema + specificSchema.copy()
    return completeItemSchema
Beispiel #2
0
class DescriptionFieldExtender(object):

    adapts(IATFolder)
    implements(ISchemaExtender)

    _fields = [
        ExtensionTextField(
            'long_description',
            required=False,
            schemata='default',
            searchable=True,
            primary=False,
            default_output_type='text/x-html-safe',
            widget=RichWidget(
                description='',
                label='Body Text',
                rows=25,
            ),
        ),
    ]

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

    def getFields(self):
        if "Folderish" in self.context.portal_type:
            return []
        return self._fields
Beispiel #3
0
def update_meeting_schema(baseSchema):
    specificSchema = Schema((
        IntegerField(
            name='meetingNumberInParliamentaryTerm',
            default=-1,
            widget=IntegerField._properties['widget'](
                label='Meetingnumberinparliamentaryterm',
                label_msgid=
                'MeetingAndenne_label_meetingNumberInParliamentaryTerm',
                i18n_domain='PloneMeeting',
            ),
            write_permission="Manage portal",
        ),
        TextField(
            name='postObservations',
            allowable_content_types=('text/html', ),
            widget=RichWidget(
                condition="python: here.showObs('postObservations')",
                rows=15,
                label='Postobservations',
                label_msgid='MeetingAndenne_label_postObservations',
                i18n_domain='PloneMeeting',
            ),
            default_content_type="text/html",
            default_output_type="text/x-html-safe",
            optional=True,
        ),
    ), )

    completeMeetingSchema = baseSchema + specificSchema.copy()
    completeMeetingSchema.moveField('postObservations', after='observations')

    return completeMeetingSchema
Beispiel #4
0
 def __init__(self, context, request):
     BaseField.__init__(self, context, request)
     self.rows = 5
     self.widget = RichWidget(description='',
                              label=_('Html'),
                              filter_buttons=(
                                  'tablecontrols',
                                  'code',
                                  'fullscreen',
                                  'attribs',
                              ),
                              rows=25,
                              allow_file_upload=False)
Beispiel #5
0
def update_item_schema(baseSchema):
    specificSchema = Schema((
        TextField(
            name='internalCommunication',
            widget=RichWidget(
                condition="python: here.portal_plonemeeting.isManager(here)",
                description="InternalCommunication",
                description_msgid="item_internalCommunication_descr",
                label='InternalCommunication',
                label_msgid='PloneMeeting_label_internalCommunication',
                i18n_domain='PloneMeeting',
            ),
            optional=True,
            default_content_type="text/html",
            allowable_content_types=('text/html', ),
            default_output_type="text/x-html-safe",
        ),
        ReferenceField(
            name='strategicAxis',
            keepReferencesOnCopy=True,
            widget=ReferenceBrowserWidget(
                description="StrategicAxis",
                description_msgid="item_strategicAxis_descr",
                condition="python: here.attributeIsUsed('strategicAxis')",
                allow_search=True,
                allow_browse=False,
                startup_directory_method="classifierStartupDirectory",
                force_close_on_insert=False,
                restrict_browsing_to_startup_directory=True,
                base_query="classifierBaseQuery",
                show_results_without_query=True,
                label='StrategicAxis',
                label_msgid='PloneMeeting_label_strategicAxis',
                i18n_domain='PloneMeeting',
            ),
            multiValued=True,
            relationship="ItemStrategicAxis",
            allowed_types=('MeetingCategory', ),
            optional=True,
        ),
    ))

    baseSchema[
        'detailedDescription'].widget.description = "DetailedDescriptionMethode"
    baseSchema[
        'detailedDescription'].widget.description_msgid = "detailedDescription_item_descr"
    completeItemSchema = baseSchema + specificSchema.copy()
    completeItemSchema.moveField('strategicAxis', after='detailedDescription')
    return completeItemSchema
Beispiel #6
0
from Products.eXtremeManagement.interfaces import IXMTask
from Products.eXtremeManagement.content.schemata import quarter_vocabulary

schema = Schema((
    TextField(
        name='mainText',
        allowable_content_types=(
            'text/plain',
            'text/structured',
            'text/html',
            'application/msword',
        ),
        default_output_type='text/html',
        widget=RichWidget(label='Main text',
                          label_msgid='eXtremeManagement_label_mainText',
                          i18n_domain='eXtremeManagement'),
    ),
    IntegerField(
        name='hours',
        default="0",
        label="Estimated hours",
        validators=('isInt', ),
        widget=IntegerWidget(
            description="Enter the estimated time (in hours).",
            label='Hours',
            label_msgid='eXtremeManagement_label_hours',
            description_msgid='eXtremeManagement_help_hours',
            i18n_domain='eXtremeManagement'),
    ),
    IntegerField(
Beispiel #7
0
def update_item_schema(baseSchema):

    specificSchema = Schema(
        (
            # specific field for council added for MeetingManagers to transcribe interventions
            TextField(
                name='interventions',
                widget=RichWidget(
                    rows=15,
                    condition=
                    "python: here.portal_type in ('MeetingItemCouncil', 'MeetingItemZCouncil') \
                and (here.portal_plonemeeting.isManager(here) or here.portal_plonemeeting.userIsAmong('powerobservers')\
                or here.portal_plonemeeting.userIsAmong('restrictedpowerobservers'))",
                    label='Interventions',
                    label_msgid='MeetingSeraing_label_interventions',
                    description='Transcription of interventions',
                    description_msgid='MeetingSeraing_descr_interventions',
                    i18n_domain='PloneMeeting',
                ),
                default_content_type="text/html",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
                optional=True,
            ),
            # specific field for mark if this item must be printing in meeting
            BooleanField(
                name='isToPrintInMeeting',
                default=False,
                widget=BooleanField._properties['widget'](
                    description="IsToPrintInMeeting",
                    description_msgid="item_print_in_meeting_descr",
                    label='IsToPrintInMeeting',
                    label_msgid='PloneMeeting_label_item_print_in_meeting',
                    i18n_domain='PloneMeeting',
                ),
            ),
            # specific field for mark pv note
            TextField(
                name='pvNote',
                widget=RichWidget(
                    rows=15,
                    label='PvNote',
                    label_msgid='MeetingSeraing_label_pvNote',
                    description='PV Note',
                    description_msgid='MeetingSeraing_descr_pvNote',
                    i18n_domain='PloneMeeting',
                ),
                default_content_type="text/html",
                default="",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
                write_permission=
                "PloneMeeting: Write item MeetingManager reserved fields",
                read_permission="PloneMeeting: Read item observations",
                optional=True,
            ),
            # specific field for mark dg note
            TextField(
                name='dgNote',
                widget=RichWidget(
                    rows=15,
                    condition=
                    "python: here.portal_plonemeeting.isManager(here)",
                    label='dgnote',
                    label_msgid='MeetingSeraing_label_dgnote',
                    description='DG Note',
                    description_msgid='MeetingSeraing_descr_dgnote',
                    i18n_domain='PloneMeeting',
                ),
                default_content_type="text/html",
                default="",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
                optional=True,
            ),
        ), )

    baseSchema[
        'motivation'].widget.description_msgid = "MeetingSeraing_descr_motivation"

    completeItemSchema = baseSchema + specificSchema.copy()
    return completeItemSchema
Beispiel #8
0
        )
    ),

    TextField(
        name='dataSource',
        languageIndependent=True,
        required=True,
        allowable_content_types=('text/html', 'text/plain',),
        default_content_type='text/html',
        default_output_type='text/x-html-safe',
        widget=RichWidget(
            label="Source",
            description=("A reference to a resource from which the present "
                         "resource is derived. Details such exact body "
                         "or department, date of delivery, original database, "
                         "table or GIS layer, scientific literature ..."),
            label_msgid="dataservice_label_source",
            description_msgid="dataservice_help_source",
            i18n_domain="eea",
            rows=5,
        ),
    ),

    TextField(
        name='moreInfo',
        searchable=True,
        languageIndependent=False,
        allowable_content_types=('text/html',),
        default_content_type='text/html',
        default_output_type='text/x-html-safe',
        widget=RichWidget(
Beispiel #9
0
def update_item_schema(baseSchema):

    specificSchema = Schema(
        (
            # specific field for council added for MeetingManagers to transcribe interventions
            TextField(
                name='interventions',
                widget=RichWidget(
                    rows=15,
                    condition=
                    "python: here.portal_type == 'MeetingItemCouncil' and here.portal_plonemeeting.isManager(here)",
                    label='Interventions',
                    label_msgid='MeetingLalouviere_label_interventions',
                    description='Transcription of interventions',
                    description_msgid='MeetingLalouviere_descr_interventions',
                    i18n_domain='PloneMeeting',
                ),
                optional=True,
                default_content_type="text/html",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
            ),
            # specific field for council added for MeetingManagers to transcribe interventions
            TextField(
                name='commissionTranscript',
                widget=RichWidget(
                    rows=15,
                    condition=
                    "python: here.portal_type == 'MeetingItemCouncil' and "
                    "here.attributeIsUsed('commissionTranscript')",
                    label='CommissionTranscript',
                    label_msgid='MeetingLalouviere_label_commissionTranscript',
                    description='Transcription of commission',
                    description_msgid=
                    'MeetingLalouviere_descr_commissionTranscript',
                    i18n_domain='PloneMeeting',
                ),
                optional=True,
                default_content_type="text/html",
                default="<p>N&eacute;ant</p>",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
                write_permission=
                "MeetingLalouviere: Write commission transcript",
                read_permission="MeetingLalouviere: Read commission transcript",
            ),
            #here above are 3 specific fields for managing item follow-up
            StringField(
                name='followUp',
                default="follow_up_no",
                widget=SelectionWidget(
                    condition=
                    "python: here.attributeIsUsed('neededFollowUp') and here.adapted().showFollowUp()",
                    description="A follow up is needed : no, yes, provided?",
                    description_msgid="MeetingLalouviere_descr_followUp",
                    label='FollowUp',
                    label_msgid='MeetingLalouviere_label_followUp',
                    i18n_domain='PloneMeeting',
                ),
                vocabulary_factory=
                'Products.MeetingLalouviere.vocabularies.listFollowUps',
                write_permission="MeetingLalouviere: Write followUp",
                read_permission="MeetingLalouviere: Read followUp",
            ),
            TextField(
                name='neededFollowUp',
                optional=True,
                widget=RichWidget(
                    rows=15,
                    condition=
                    "python: here.attributeIsUsed('neededFollowUp') and here.adapted().showFollowUp()",
                    label='NeededFollowUp',
                    label_msgid='MeetingLalouviere_label_neededFollowUp',
                    description='Follow-up needed for this item',
                    description_msgid='MeetingLalouviere_descr_neededFollowUp',
                    i18n_domain='PloneMeeting',
                ),
                default_content_type="text/html",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
                write_permission="MeetingLalouviere: Write neededFollowUp",
                read_permission="MeetingLalouviere: Read neededFollowUp",
            ),
            TextField(
                name='providedFollowUp',
                optional=True,
                widget=RichWidget(
                    rows=15,
                    condition=
                    "python: here.attributeIsUsed('providedFollowUp') and here.adapted().showFollowUp()",
                    label='ProvidedFollowUp',
                    label_msgid='MeetingLalouviere_label_providedFollowUp',
                    description='Follow-up provided for this item',
                    description_msgid=
                    'MeetingLalouviere_descr_providedFollowUp',
                    i18n_domain='PloneMeeting',
                ),
                default_content_type="text/html",
                default="<p>N&eacute;ant</p>",
                searchable=True,
                allowable_content_types=('text/html', ),
                default_output_type="text/html",
                write_permission="MeetingLalouviere: Write providedFollowUp",
                read_permission="MeetingLalouviere: Read providedFollowUp",
            ),
        ), )

    # Don't forget the label override in skins/meetinglalouviere_templates/meetingitem_view.pt
    baseSchema['description'].widget.label_method = "getLabelDescription"

    baseSchema['privacy'].widget.condition = "python: here.attributeIsUsed('privacy') and " \
                                             "portal.portal_plonemeeting.isManager(here)"

    baseSchema['observations'].write_permission = ModifyPortalContent

    completeItemSchema = baseSchema + specificSchema.copy()
    return completeItemSchema
            size=6,
            )
        ),
    TextField('text',
        accessor='getBodyText',
        required=True,
        searchable=True,
        primary=True,
        validators=('isTidyHtmlWithCleanup',),
        default_content_type='text/html',
        default_output_type='text/x-html-safe',
        allowable_content_types=('text/html',
                                 'text/plain',),
        widget=RichWidget(
            label=_("label_body_text", default=u"Body Text"),
            description=_("help_body_text",
                          default=u"Text for front page of signup",),
            rows=25,
           ),
        ),
))

SignupSheetSchema.moveField('eventsize', after='description')
SignupSheetSchema.moveField('waitlist_size', after='eventsize')
SignupSheetSchema.moveField('display_size_left', after='waitlist_size')
SignupSheetSchema.moveField('startDate', after='display_size_left')
SignupSheetSchema.moveField('endDate', after='startDate')
SignupSheetSchema.moveField('earlyBirdDate', after='endDate')
SignupSheetSchema.moveField('registrationDeadline', after='earlyBirdDate')
SignupSheetSchema.moveField('text', after='registrationDeadline')

Beispiel #11
0
     default="(UNASSIGNED)",
     widget=SelectionWidget(
         label=_(u'Poi_label_release', default=u"Version"),
         description=_(
             u'Poi_help_release',
             default=(u"Select the version the issue was found in.")),
         condition="object/isUsingReleases",
     ),
     required=True,
     vocabulary='getReleasesVocab'),
 TextField(name='details',
           allowable_content_types=ISSUE_MIME_TYPES,
           widget=RichWidget(
               label=_(u'Poi_label_details', default=u"Details"),
               description=_(u'Poi_help_details',
                             default=u"Please provide further details"),
               rows=15,
               allow_file_upload=False,
           ),
           required=True,
           default_content_type=DEFAULT_ISSUE_MIME_TYPE,
           searchable=True,
           default_output_type="text/html"),
 TextField(
     name='steps',
     allowable_content_types=ISSUE_MIME_TYPES,
     widget=RichWidget(
         label=_(u'Poi_label_steps', default=u"Steps to reproduce"),
         description=_(
             u'Poi_help_steps',
             default=(u"If applicable, please provide the steps to "
Beispiel #12
0
def update_item_schema(baseSchema):
    specificSchema = Schema((
        StringField(
            name='refdoc',
            default_method="getDocReference",
            widget=StringWidget(
                size=100,
                label='Refdoc',
                label_msgid='MeetingAndenne_label_refDoc',
                i18n_domain='PloneMeeting',
            ),
            searchable=True,
        ),
        StringField(
            name='verifUser',
            default_method="Creator",
            widget=StringWidget(
                visible=False,
                format="select",
                label='Verifuser',
                label_msgid='MeetingAndenne_label_verifUser',
                i18n_domain='PloneMeeting',
            ),
            searchable=True,
        ),
        StringField(name='yourrefdoc',
                    widget=StringWidget(
                        size=100,
                        label='yourRefdoc',
                        label_msgid='MeetingAndenne_label_yourrefDoc',
                        i18n_domain='PloneMeeting',
                    ),
                    searchable=True),
        StringField(
            name='treatUser',
            default_method="Creator",
            widget=SelectionWidget(
                format="select",
                label='Treatuser',
                label_msgid='MeetingAndenne_label_treatUser',
                i18n_domain='PloneMeeting',
            ),
            vocabulary='listTreatUsers',
            searchable=True,
        ),
        TextField(name='projetpv',
                  widget=RichWidget(
                      rows=15,
                      label='Projetpv',
                      label_msgid='MeetingAndenne_label_projetpv',
                      i18n_domain='PloneMeeting',
                  ),
                  read_permission="PloneMeeting: Read decision",
                  default_content_type="text/html",
                  searchable=True,
                  write_permission="PloneMeeting: Write decision",
                  allowable_content_types=('text/html', ),
                  default_output_type="text/html"),
        TextField(name='pv',
                  widget=RichWidget(
                      rows=15,
                      label='Pv',
                      label_msgid='MeetingAndenne_label_pv',
                      i18n_domain='PloneMeeting',
                  ),
                  read_permission="MeetingAndenne: Read pv",
                  default_content_type="text/html",
                  searchable=True,
                  write_permission="MeetingAndenne: Write pv",
                  allowable_content_types=('text/html', ),
                  default_output_type="text/html"),
        TextField(name='textpv',
                  widget=RichWidget(
                      rows=15,
                      label='Textpv',
                      label_msgid='MeetingAndenne_label_textpv',
                      i18n_domain='PloneMeeting',
                  ),
                  read_permission="MeetingAndenne: Read pv",
                  default_content_type="text/html",
                  searchable=True,
                  write_permission="MeetingAndenne: Write pv",
                  allowable_content_types=('text/html', ),
                  default_output_type="text/html"),
        BooleanField(name='isconfidential',
                     widget=BooleanWidget(
                         label='IsConfidential',
                         label_msgid='MeetingAndenne_label_isConfidential',
                         i18n_domain='PloneMeeting',
                     ),
                     searchable=True,
                     default=False),
        LinesField(
            name='itemPresents',
            widget=MultiSelectionWidget(
                visible=False,
                format="checkbox",
                label='Itempresents',
                label_msgid='MeetingAndenne_label_itemPresents',
                i18n_domain='PloneMeeting',
            ),
            multiValued=1,
        ),
    ), )

    completeItemSchema = baseSchema + specificSchema.copy()
    completeItemSchema[
        'title'].widget.condition = "python: not hasattr(here, 'template') or not here.queryState()=='itemcreated' or here.portal_membership.getAuthenticatedMember().has_role('Manager')"

    completeItemSchema[
        'copyGroups'].write_permission = "MeetingAndenne: Write copygroup"
    completeItemSchema[
        'description'].widget.label_method = 'getLabelForDescription'
    completeItemSchema['budgetInfos'].widget.rows = 12
    completeItemSchema['itemSignatories'].optional = True
    completeItemSchema[
        'proposingGroup'].default_method = "getDefaultProposingGroup"
    completeItemSchema[
        'notes'].read_permission = "PloneMeeting: Read item observations"
    completeItemSchema[
        'notes'].write_permission = "PloneMeeting: Write item observations"
    completeItemSchema['votesAreSecret'].default = True

    completeItemSchema['category'].widget = DynatreeWidget(
        condition="python: here.showCategory()",
        description="Category",
        description_msgid="item_category_descr",
        label='Category',
        label_msgid='PloneMeeting_label_category',
        i18n_domain='PloneMeeting',
        leafsOnly=True,
        rootVisible=True,
        selectMode=1,
        sparse=False,
    )
    completeItemSchema['category'].vocabulary = SubCategoriesVocabulary()

    completeItemSchema.moveField('refdoc', pos='top')
    completeItemSchema.moveField('yourrefdoc', pos=2)
    completeItemSchema.moveField('treatUser', pos=8)
    completeItemSchema.moveField('projetpv', pos=25)
    completeItemSchema.moveField('pv', pos=25)
    completeItemSchema.moveField('textpv', pos=24)
    completeItemSchema.moveField('isconfidential', pos='top')

    return completeItemSchema
Beispiel #13
0
         description="Name by which the cited resource is known",
         i18n_domain='eea',
     ),
     default="",
     searchable=True,
     schemata="metadata",
 ),
 TextField(
     name='dataResourceAbstract',
     allowable_content_types=('text/plain', 'text/structured', 'text/html',
                              'application/msword',),
     widget=RichWidget(
         label="Resource abstract",
         description=(
             "Brief narrative summary of the content of the "
             "resource(s) with coverage, main attributes, data sources, "
             "important of the work, etc."),
         label_msgid='eea_data_resource_abstract',
         i18n_domain='eea',
     ),
     default_content_type="text/html",
     searchable=True,
     schemata="metadata",
     default_output_type="text/x-html-safe",
 ),
 StringField(
     name='dataResourceType',
     widget=StringWidget(
         label="Resource type",
         description="Scope to which metadata applies.",
         i18n_domain='eea',
Beispiel #14
0
) + ConstrainTypesMixinSchema + Schema((
    TextField(
        'body',
        searchable=1,
        required=0,
        schemata="Introduction",
        default_content_type='text/html',
        default_output_type='text/html',
        allowable_content_types=(
            'text/plain',
            'text/structured',
            'text/html',
        ),
        widget=RichWidget(
            label=_('label_introduction', default=u"Introduction"),
            description=_('help_introduction',
                          default=u"Enter an introduction for the survey."),
            rows=5,
        ),
    ),
    TextField(
        'thankYouMessage',
        required=0,
        searchable=0,
        default_method="translateThankYouMessage",
        widget=TextAreaWidget(
            label=_("label_thank", default="'Thank you' message text"),
            description=_(
                'help_thankyou',
                default=u"This is the message that will be displayed to "
                u"the user when they complete the survey."),
        ),
from Products.Archetypes.atapi import registerType
from Products.Archetypes.atapi import RichWidget
from Products.Archetypes.atapi import Schema
from Products.Archetypes.atapi import TextAreaWidget
from Products.Archetypes.atapi import TextField
from Products.CMFCore.utils import ContentInit
from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

PROJECTNAME = 'collective.searchandreplace'

SampleTypeSchema = BaseSchema.copy() + MetadataSchema(()) + Schema((
    TextField('rich',
              required=False,
              searchable=True,
              default_output_type='text/x-html-safe',
              widget=RichWidget(description='', label=u'Rich Text')),
    TextField('plain',
              required=False,
              searchable=True,
              widget=TextAreaWidget(description='', label=u'Plain Text')),
    LinesField('line',
               required=False,
               searchable=True,
               widget=LinesWidget(description='', label=u'Text Line')),
    TextField('unsearchable',
              required=False,
              searchable=False,
              default_output_type='text/x-html-safe',
              widget=RichWidget(description='', label=u'Unsearchable Text')),
))
from Products.ECAssignmentBox.content import validators
from Products.ECAssignmentBox import config
from Products.ECAssignmentBox import LOG

schema = Schema((
    TextField(
        'directions',
        allowable_content_types=config.ALLOWED_CONTENT_TYPES,
        default_content_type=config.DEFAULT_CONTENT_TYPE,
        default_output_type=config.DEFAULT_OUTPUT_TYPE,
        widget=RichWidget(
            label='Directions',
            label_msgid='label_directions',
            description=
            'Instructions/directions that all assignment boxes in this folder refer to',
            description_msgid='help_directions',
            i18n_domain=config.I18N_DOMAIN,
            allow_file_upload=False,
            rows=8,
        ),
    ),
    LinesField(
        'completedStates',
        searchable=False,
        vocabulary='getCompletedStatesVocab',
        multiValued=True,
        widget=MultiSelectionWidget(
            label="Completed States",
            label_msgid="label_completed_states",
            description="States considered as completed",
            description_msgid="help_completed_states",
 StringField(
     name='title',
     widget=StringField._properties['widget'](
         label='Title',
         label_msgid='indicators_label_title',
         i18n_domain='indicators',
     ),
     required=True,
     accessor="Title",
     required_for_published=True,
 ),
 TextField(
     name='description',
     widget=RichWidget(
         label='Description',
         label_msgid='indicators_label_description',
         i18n_domain='indicators',
     ),
     default_content_type="text/html",
     description="True",
     searchable=True,
     required=True,
     required_for_published=True,
     allowable_content_types=(
         'text/plain',
         'text/structured',
         'text/html',
         'application/msword',
     ),
     default_output_type="text/x-html-safe",
     accessor="getDescription",
Beispiel #18
0
def update_item_schema(baseSchema):
    specificSchema = Schema(
        (
            StringField(
                name='grpBudgetInfos',
                widget=MultiSelectionWidget(
                    description="GrpBudgetInfos",
                    description_msgid="MeetingNamur_descr_grpBudgetInfos",
                    size=10,
                    label='GrpBudgetInfos',
                    label_msgid='MeetingNamur_label_grpBudgetInfos',
                    i18n_domain='PloneMeeting',
                ),
                vocabulary='listGrpBudgetInfosAdviser',
                multiValued=1,
                enforceVocabulary=False,
            ),

            # field used to define specific certified signatures for a MeetingItem
            TextField(
                name='itemCertifiedSignatures',
                widget=TextAreaWidget(
                    label='Signatures',
                    label_msgid='PloneMeeting_label_certifiedSignatures',
                    description=
                    'Leave empty to use the certified signatures defined on the meeting or MeetingGroup',
                    description_msgid='MeetingNamur_descr_certified_signatures',
                    i18n_domain='PloneMeeting',
                ),
                write_permission='MeetingNamur: Write certified signatures',
                allowable_content_types=('text/plain', ),
                default_output_type='text/plain',
                default_content_type='text/plain',
            ),

            # field use to specify if this item is privacy (in this case, it's not visible in public pv)
            BooleanField(
                name='isConfidentialItem',
                default=False,
                widget=BooleanField._properties['widget'](
                    condition=
                    "python: here.portal_plonemeeting.isManager(here)",
                    label='IsConfidentialItem',
                    label_msgid='MeetingNamur_isConfidentialItem',
                    i18n_domain='PloneMeeting',
                ),
                optional=True,
            ),
            TextField(
                name='vote',
                widget=RichWidget(
                    condition="python: here.attributeIsUsed('vote')",
                    description="Vote",
                    description_msgid="item_vote_descr",
                    label='Vote',
                    label_msgid='MeetingNamur_vote',
                    i18n_domain='PloneMeeting',
                ),
                optional=True,
                write_permission=
                "PloneMeeting: Write item MeetingManager reserved fields",
                default_content_type="text/html",
                allowable_content_types=('text/html', ),
                default_output_type="text/x-html-safe",
            ),
        ), )

    baseSchema[
        'description'].write_permission = "MeetingNamur: Write description"
    baseSchema['description'].widget.label = "projectOfDecision"
    baseSchema['description'].widget.label_msgid = "projectOfDecision_label"

    completeSchema = baseSchema + specificSchema.copy()
    return completeSchema
Beispiel #19
0
     required=True,
     searchable=True,
     required_for_published="True",
 ),
 TextField(
     name='dataset_path',
     allowable_content_types=(
         'text/plain',
         'text/structured',
         'text/html',
         'application/msword',
     ),
     widget=RichWidget(
         label="Dataset path",
         description="Further information and details needed to "
         "get the dataset.",
         label_msgid='indicators_label_dataset_path',
         i18n_domain='indicators',
     ),
     required=False,
     default_content_type="text/html",
     default_output_type="text/x-html-safe",
 ),
 TextField(
     name='timeliness',
     allowable_content_types=(
         'text/plain',
         'text/structured',
         'text/html',
         'application/msword',
     ),
                     maxsize=zconf.ATNewsItem.max_file_size))

ATNewsItemSchema = ATContentTypeSchema.copy() + Schema(
    (
        TextField(
            'text',
            required=False,
            searchable=True,
            primary=True,
            storage=AnnotationStorage(migrate=True),
            validators=('isTidyHtmlWithCleanup', ),
            #validators = ('isTidyHtml',),
            default_output_type='text/x-html-safe',
            widget=RichWidget(
                description='',
                label=_(u'label_body_text', u'Body Text'),
                rows=25,
                allow_file_upload=zconf.ATDocument.allow_document_upload)),
        ImageField(
            'image',
            required=False,
            storage=AnnotationStorage(migrate=True),
            languageIndependent=True,
            max_size=zconf.ATNewsItem.max_image_dimension,
            sizes={
                'large': (768, 768),
                'preview': (400, 400),
                'mini': (200, 200),
                'thumb': (128, 128),
                'tile': (64, 64),
                'icon': (32, 32),
Beispiel #21
0
            allow_search = True,
            show_indexes = False,
        ),
    ),
    TextField(
        'assignment_text',
        required = False,
        searchable = True,
        allowable_content_types = config.ALLOWED_CONTENT_TYPES, 
        default_content_type = config.DEFAULT_CONTENT_TYPE, 
        default_output_type = config.DEFAULT_OUTPUT_TYPE,
        widget=RichWidget(
            label = 'Assignment text',
            label_msgid = 'label_assignment_text',
            description = 'Enter text and hints for the assignment',
            description_msgid = 'help_assignment_text',
            i18n_domain = config.I18N_DOMAIN,
            rows = 10,
            allow_file_upload = True,
        ),
    ),

    #PlainTextField('answerTemplate',
    TextField(
        'answerTemplate',
        searchable = True,
        allowable_content_types = ('text/plain',), #('text/x-web-intelligent',), 
        default_content_type = 'text/plain', 
        default_output_type = 'text/plain',
        widget = TextAreaWidget(
            label = 'Answer template',
               write_permission=ModifyPortalContent,
               default_method=DateTime,
               languageIndependent=True,
               widget=CalendarWidget(description='',
                                     label=_(u'label_event_end',
                                             default=u'Event Ends'))),
 TextField('text',
           required=False,
           searchable=True,
           primary=True,
           storage=AnnotationStorage(migrate=True),
           validators=('isTidyHtmlWithCleanup', ),
           default_output_type='text/x-html-safe',
           widget=RichWidget(
               description='',
               label=_(u'label_event_announcement',
                       default=u'Event body text'),
               rows=25,
               allow_file_upload=zconf.ATDocument.allow_document_upload)),
 LinesField('attendees',
            languageIndependent=True,
            searchable=True,
            write_permission=ModifyPortalContent,
            widget=LinesWidget(description='',
                               label=_(u'label_event_attendees',
                                       default=u'Attendees'))),
 StringField('eventUrl',
             required=False,
             searchable=True,
             accessor='event_url',
             write_permission=ModifyPortalContent,
             validators=('isURL', ),
Beispiel #23
0
        default=(),
        widget=LinesWidget(
            label=_('label_glossary_variants', default="Variants"),
            description=_(
                'help_glossary_variants',
                default="Enter the variants of the term, one per line."),
            visible={'view': 'invisible'}),
    ),
    TextField(
        'definition',
        required=True,
        searchable=True,
        default_content_type=zconf.ATDocument.default_content_type,
        default_output_type='text/x-html-safe',
        allowable_content_types=zconf.ATDocument.allowed_content_types,
        widget=RichWidget(
            label=_('label_glossary_definition_text', default="Body text"),
            description=_('help_glossary_definition_text',
                          default="Enter the body text."),
            rows=25),
    ),

))

del PloneGlossaryDefinitionSchema['description']
finalizeATCTSchema(PloneGlossaryDefinitionSchema)

# Hide description. It is generated dynamically
# PloneGlossaryDefinitionSchema['description'].widget.visible = {'view' : '
# visible', 'edit' : 'invisible'}
Beispiel #24
0
     required_for_published=True,
     validators=('validate_codes', ),
     #allow_empty_rows=True,
 ),
 TextField(
     name='more_updates_on',
     allowable_content_types=(
         'text/plain',
         'text/structured',
         'text/html',
         'application/msword',
     ),
     widget=RichWidget(
         label="Message info on updates",
         description=("This information is used to display warning "
                      "messages to the users on top of the indicator "
                      "page."),
         label_msgid='indicators_label_more_updates_on',
         i18n_domain='indicators',
     ),
     default_content_type="text/html",
     searchable=True,
     schemata="default",
     default_output_type="text/x-html-safe",
 ),
 StringField(
     name='dpsir',
     widget=SelectionWidget(
         label="Position in DPSIR framework",
         description=("The work of the EEA is built around a conceptual "
                      "framework known as the DPSIR assessment framework. "
                      "DPSIR stands for ‘driving forces, pressures, "
Beispiel #25
0
                isMetadata=1,
                accessor='Description',
                searchable=1,                
                widget=TextAreaWidget(label='Description', description='Give a short description for this template.'),),
    BooleanField('showUsage',
                 default = False,
                 widget=BooleanWidget(label='Show template description and instructions', 
                                      description='When checked, a page with instructions for this template will be displayed before the actual template items are created.')),                
    TextField('usage',
                searchable=1,
                required=0,
                primary=1,
                default_output_type = 'text/x-html-safe',
                allowable_content_types=('text/html',),
                widget=RichWidget(allow_file_upload=0, label='Instructions for the user', 
                                  allow_format_edit=0,
                                  description="")),
        ))

finalizeATCTSchema(schema)

class Template(ATCTOrderedFolder):
    """A Template is a container that can hold any kind of content. After
the Template is registered in a folder (or any other template-aware
folderish item), a user can instantiate whatever is inside the
Template container by using the templates drop-down menu next to the
add item menu.
    """
    meta_type = 'Template'
    schema = schema
    _at_rename_after_creation = True    
Beispiel #26
0

# make the description field of NewsItems render HTML
description = TextField('description',
              required=False,
              searchable=True,
              accessor="Description",
              mutator='setDescription',
              edit_accessor="getRawDescription",
              isMetadata=True,
              storage=MetadataStorage(),
              generateMode="mVc",
              validators=('isTidyHtmlWithCleanup', ),
              default_output_type='text/x-html-safe',
              allowable_content_type=('text/html', 'text/x-html-safe'),
              schemata='default',
              widget=RichWidget(
                    label=_(u'label_description', default=u'Description'),
                    description=_(u'help_description',
                        default=u'A short summary of the content.'),
                    rows=25,
                    allow_file_upload=zconf.ATDocument.allow_document_upload)
              )


del ATNewsItemSchema['description']
ATNewsItemSchema.addField(description)
ATNewsItemSchema.moveField('description', after='title')

finalizeATCTSchema(ATNewsItemSchema)
Beispiel #27
0
         label="Description",
         label_msgid='indicators_label_description',
         i18n_domain='indicators',
     ),
 ),
 TextField(
     name='assessment',
     allowable_content_types=(
         'text/plain',
         'text/structured',
         'text/html',
         'application/msword',
     ),
     widget=RichWidget(
         label="Assessment",
         label_msgid='indicators_label_assessment',
         i18n_domain='indicators',
     ),
     default_output_type='text/html',
     searchable=True,
 ),
 StringField(
     name='policy_question',
     searchable=True,
     widget=StringField._properties['widget'](
         label="Policy Question",
         label_msgid='indicators_label_policy_question',
         i18n_domain='indicators',
     ),
 ),
 StringField(
Beispiel #28
0
           storage=AnnotationStorage(migrate=True),
           default_content_type='text/plain',
           validators=('videoCloudUrlValidator', ),
           allowable_content_types=('text/plain', ),
           default_output_type='text/plain',
           widget=TextAreaWidget(
               description='The embedding code for the video from'
               ' external sites eg. Vimeo or Youtube',
               description_msgid="EEAContentTypes_help_quotationtext",
               label="Cloud Url",
               label_msgid="EEAContentTypes_label_cloud_url")),
 TextField(
     name='text',
     widget=RichWidget(
         label="Rich Text Description",
         label_msgid="EEAContentTypes_label_rich_description",
         i18n_domain="eea",
         rows=10,
     ),
 ),
 ManagementPlanField(
     name='eeaManagementPlan',
     languageIndependent=True,
     required=True,
     default=(datetime.now().year, ''),
     validators=('management_plan_code_validator', ),
     vocabulary_factory="Temporal coverage",
     storage=AnnotationStorage(migrate=True),
     widget=ManagementPlanWidget(
         format="select",
         label="EEA Management Plan",
         description=("EEA Management plan code."),
from Products.validation import V_REQUIRED
from zope.interface import implements


schema = Schema((
    TextField(
        name='introduction',
        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=RichWidget(
            label="Introduction",
            description="Introduction of GIS Map Application",
            label_msgid='EEAContentTypes_label_introduction',
            i18n_domain='eea',
        ),
    ),
    TextField(
        name='embed',
        languageIndependent=True,
        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=TextAreaWidget(
            label="Embed code",
            description=("Tableau embed code should be pasted here."),
from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin


PROJECTNAME = "collective.searchandreplace"

SampleTypeSchema = (
    BaseSchema.copy()
    + MetadataSchema(())
    + Schema(
        (
            TextField(
                "rich",
                required=False,
                searchable=True,
                default_output_type="text/x-html-safe",
                widget=RichWidget(description="", label=u"Rich Text"),
            ),
            TextField(
                "plain",
                required=False,
                searchable=True,
                widget=TextAreaWidget(description="", label=u"Plain Text"),
            ),
            StringField(
                "line",
                required=False,
                searchable=True,
                widget=StringWidget(description="", label=u"Text Line"),
            ),
            TextField(
                "unsearchable",