Exemplo n.º 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
Exemplo n.º 2
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
Exemplo n.º 3
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
Exemplo n.º 4
0
def update_meeting_schema(baseSchema):

    specificSchema = Schema((
        TextField(
            name='assemblyPolice',
            allowable_content_types="text/plain",
            optional=True,
            widget=TextAreaWidget(
                condition=
                "python: 'assemblyPolice' in here.shownAssemblyFields()",
                label='Assemblypolice',
                label_msgid='meeting_assemblyPolice',
                i18n_domain='PloneMeeting',
            ),
            default_output_type="text/html",
            default_method="getDefaultAssemblyPolice",
            default_content_type="text/plain",
        ),
        TextField(
            name='assemblyPrivacySecretAbsents',
            allowable_content_types="text/plain",
            optional=True,
            widget=TextAreaWidget(
                condition=
                "python: 'assemblyPrivacySecretAbsents' in here.shownAssemblyFields()",
                label='Assemblyprivacysecretabsents',
                label_msgid='PloneMeeting_label_assemblyPrivacySecretAbsents',
                i18n_domain='PloneMeeting',
            ),
            default_output_type="text/html",
            default_content_type="text/plain",
        ),
    ), )

    completeMeetingSchema = baseSchema + specificSchema.copy()
    return completeMeetingSchema
Exemplo n.º 5
0
def update_config_schema(baseSchema):

    specificSchema = Schema((TextField(
        name='assemblyPolice',
        allowable_content_types=('text/plain', ),
        widget=TextAreaWidget(
            description="AssemblyPolice",
            description_msgid="assembly_police_descr",
            label='AssemblyPolice',
            label_msgid='PloneMeeting_label_assemblyPolice',
            i18n_domain='PloneMeeting',
        ),
        default_content_type='text/plain',
        schemata="assembly_and_signatures",
        write_permission="PloneMeeting: Write harmless config",
    ), ), )

    completeConfigSchema = baseSchema + specificSchema.copy()
    completeConfigSchema.moveField('assemblyPolice', after='assemblyStaves')
    return completeConfigSchema
Exemplo n.º 6
0
                "'floor([Ca] + [Mg])'. "
            ),
            allowDelete=True,
        ),
    ),

    TextField(
        'Formula',
        validators=('formulavalidator',),
        default_content_type='text/plain',
        allowable_content_types=('text/plain',),
        widget=TextAreaWidget(
            label=_("Calculation Formula"),
            description=_(
                "<p>The formula you type here will be dynamically calculated "
                "when an analysis using this calculation is displayed.</p>"
                "<p>To enter a Calculation, use standard maths operators,  "
                "+ - * / ( ), and all keywords available, both from other "
                "Analysis Services and the Interim Fields specified here, "
                "as variables. Enclose them in square brackets [ ].</p>"
                "<p>E.g, the calculation for Total Hardness, the total of "
                "Calcium (ppm) and Magnesium (ppm) ions in water, is entered "
                "as [Ca] + [Mg], where Ca and MG are the keywords for those "
                "two Analysis Services.</p>"),
        )
    ),

    RecordsField(
        'TestParameters',
        required=False,
        subfields=('keyword', 'value'),
        subfield_labels={'keyword': _('Keyword'), 'value': _('Value')},
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"),
            ),
            StringField(
                "line",
                required=False,
                searchable=True,
                widget=StringWidget(description="", label=u"Text Line"),
            ),
Exemplo n.º 8
0
from Products.ATContentTypes.content.link import ATLink
from Products.EEAContentTypes.config import PROJECTNAME
from Products.EEAContentTypes.content.interfaces import IInteractiveDashboard
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",
Exemplo n.º 9
0
               required=True,
               searchable=False,
               accessor='end',
               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,
Exemplo n.º 10
0
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##########################################################################

import sys

from ZPublisher.HTTPRequest import HTTPRequest

from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import mkDummyInContext
from Products.Archetypes.atapi import TextField, BaseSchema, Schema, BaseContent

from Products.Archetypes.ArchetypeTool import registerType

textfield1 = TextField('TEXTFIELD1', required=True, default='A')

textfield1b = TextField('TEXTFIELD1', required=False, default='A')

textfield2 = TextField('TEXTFIELD2', default='B')

schema1 = BaseSchema + Schema((
    textfield1,
))

schema2 = BaseSchema + Schema((
    textfield1b,
    textfield2,
))

Exemplo n.º 11
0
 def test_mimetype(self):
     dummy = self.makeDummy()
     field = TextField('test', default_content_type='text/html')
     dummy.test = ''
     mimetype = field.getContentType(dummy)
     self.assertEqual('text/html', mimetype)
Exemplo n.º 12
0
schema = ATCTOrderedFolder.schema.copy() + ConstrainTypesMixinSchema + Schema((
    StringField('description',
                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.
    """
Exemplo n.º 13
0
     default=5,
     widget=IntegerWidget(
         label=_("Maximum columns per results email"),
         description=_(
             "Set the maximum number of analysis requests per results email. "
             "Too many columns per email are difficult to read for some clients "
             "who prefer fewer results per email"),
     )
 ),
 TextField(
     'ResultFooter',
     schemata="Results Reports",
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     default="",
     widget=TextAreaWidget(
         label=_("Result Footer"),
         description=_("This text will be appended to results reports."),
         append_only=False,
     ),
 ),
 # IntegerField('BatchFax',
 #     schemata = "Results Reports",
 #     required = 1,
 #     default = 4,
 #     widget = IntegerWidget(
 #         label=_("Maximum columns per results fax"),
 #         description = "Too many AR columns per fax will see the font size minimised and could "
 #                         "render faxes illegible. 4 ARs maximum per page is recommended",
 #     )
Exemplo n.º 14
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
Exemplo n.º 15
0
from Products.Archetypes.atapi import RichWidget
from Products.Archetypes.atapi import Schema
from Products.Archetypes.atapi import SelectionWidget
from Products.Archetypes.atapi import TextField

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',
Exemplo n.º 16
0
     required_for_published=True,
     widget=StringField._properties['widget'](
         label='Title',
         label_msgid='indicators_label_title',
         i18n_domain='indicators',
     ),
     required=True,
     accessor="Title",
 ),
 TextField(
     name='description',
     required_for_published=True,
     widget=TextAreaWidget(
         label='Description',
         label_msgid='indicators_label_description',
         i18n_domain='indicators',
     ),
     description="True",
     searchable=True,
     required=True,
     accessor="getDescription",
 ),
 BlobField('file',
           required=False,
           primary=True,
           validators=(('isNonEmptyFile', V_REQUIRED),
                       ('checkFileMaxSize', V_REQUIRED)),
           widget=FileWidget(
               description="Select the file to be added by "
               "clicking the 'Browse' button.",
               description_msgid="help_file",
Exemplo n.º 17
0
        widget=MultiOrganisationsWidget(
            label="Processor",
            description="The technical producer or processor of the resource.",
            label_msgid='dataservice_label_processor',
            description_msgid='dataservice_help_processor',
            i18n_domain='eea',
        )
    ),

    TextField(
        name='contact',
        languageIndependent=True,
        required=True,
        widget=TextAreaWidget(
            label="Contact person(s) for EEA",
            description=("Outside person to be contacted by EEA if questions "
                         "regarding the data resource arise at a later date, "
                         "responsible project manager at EEA."),
            label_msgid='dataservice_label_dataset_contact',
            description_msgid='dataservice_help_dataset_contact',
            i18n_domain='eea',
        )
    ),

    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(
Exemplo n.º 18
0
            label=_("De-activate until next calibration test"),
            description=
            _("If checked, the instrument will be unavailable until the next valid "
              "calibration was performed. This checkbox will automatically be unchecked."
              ),
        ),
    ),

    # Procedures
    TextField(
        'InlabCalibrationProcedure',
        schemata='Procedures',
        default_content_type='text/plain',
        allowed_content_types=('text/plain', ),
        default_output_type="text/plain",
        widget=TextAreaWidget(
            label=_("In-lab calibration procedure"),
            description=
            _("Instructions for in-lab regular calibration routines intended for analysts"
              ),
        ),
    ),
    TextField(
        'PreventiveMaintenanceProcedure',
        schemata='Procedures',
        default_content_type='text/plain',
        allowed_content_types=('text/plain', ),
        default_output_type="text/plain",
        widget=TextAreaWidget(
            label=_("Preventive maintenance procedure"),
            description=
Exemplo n.º 19
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
Exemplo n.º 20
0
                'width': '20',
                'label': _('Job Title')
            }, {
                'columnName': 'Title',
                'width': '80',
                'label': _('Name')
            }],
        ),
    ),
    BlobFileField('Document',
                  widget=FileWidget(
                      label=_("Report upload"),
                      description=_("Load the certificate document here"),
                  )),
    TextField("Remarks",
              allowable_content_types=("text/plain", ),
              widget=TextAreaWidget(label=_("Remarks"), )),
))

schema['title'].widget.label = _("Certificate Code")


class InstrumentCertification(BaseFolder):
    """Issued certification from an instrument calibration
    """
    implements(IInstrumentCertification)
    security = ClassSecurityInfo()
    schema = schema
    displayContentsTab = False
    _at_rename_after_creation = True
Exemplo n.º 21
0
         i18n_domain='indicators',
     ),
     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',
Exemplo n.º 22
0
             'name': Column("Name"),
             'query': LinesColumn("Query")
         },
         helper_js=(
             '++resource++eea.sparql.datasource.js',
             'datagridwidget.js',
         ),
         helper_css=('++resource++eea.sparql.datasource.css',
                     'datagridwidget.css')),
     columns=("name", "query")),
 TextField(name='sparql_query',
           default_content_type='text/plain',
           allowable_content_types=('text/plain', ),
           widget=TextAreaWidget(
               macro="sparql_textfield_with_preview",
               helper_js=("sparql_textfield_with_preview.js", ),
               helper_css=("sparql_textfield_with_preview.css", ),
               label="Query",
           ),
           required=1,
           validators=('isSparqlOverLimit', )),
 BooleanField(name='sparql_static',
              widget=BooleanWidget(
                  label='Static query',
                  description='The data will be fetched only once',
                  visible={
                      'edit': 'invisible',
                      'view': 'invisible'
                  }),
              default=False,
              required=0),
Exemplo n.º 23
0
            i18n_domain = config.I18N_DOMAIN,
            label = 'Reference to assignment',
            label_msgid = 'label_assignment_reference',
            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', 
Exemplo n.º 24
0
 def test_mimetype(self):
     dummy = self.makeDummy()
     field = TextField('test', default_content_type='text/html')
     dummy.test = ''
     mimetype = field.getContentType(dummy)
     self.assertEqual('text/html', mimetype)
Exemplo n.º 25
0
    'allowedRolesAndUsers',
    'getId',
    'in_reply_to',
    'meta_type',
    # 'portal_type' # portal type and Type might differ!
]

ATTopicSchema = 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',
        write_permission=ChangeTopics,
        widget=RichWidget(
            description='',
            label=_(u'label_body_text', default=u'Body Text'),
            rows=25,
            allow_file_upload=zconf.ATDocument.allow_document_upload),
    ),
    BooleanField(
        'acquireCriteria',
        required=False,
        mode="rw",
        default=False,
        write_permission=ChangeTopics,
        widget=BooleanWidget(
            label=_(u'label_inherit_criteria', default=u'Inherit Criteria'),
Exemplo n.º 26
0
 StringField(
     name='title',
     widget=StringField._properties['widget'](
         label="Title",
         label_msgid='indicators_label_title',
         i18n_domain='indicators',
     ),
     schemata="default",
     searchable=True,
     required=True,
     accessor="Title",
 ),
 TextField(
     name='description',
     widget=TextAreaWidget(
         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',
                           ('imageMinSize', V_REQUIRED)),
               widget=ImageWidget(
                   description='High-res preview image'
                               ' (at least 1024px width)',
                   label='Preview image',
                   show_content_type=False, )
               ),

    TextField(
        name='body',
        allowable_content_types=('text/html',),
        widget=RichWidget(
            label="More information",
            description=("Description of methodology "
                         "and calculations behind this."),
            label_msgid='EEAContentTypes_label_body',
            i18n_domain='eea',
            ),
        default_content_type="text/html",
        searchable=True,
        default_output_type="text/x-html-safe",
        required_for_published=False,
        required=False,
        ),

))

GIS_schema = getattr(ATLink, 'schema', Schema(())).copy() + schema

# Schema overwrites

GIS_schema['description'].required = True  # required to increase findability.
Exemplo n.º 28
0
         ('Policy-making/ public participation (incl. international '
          'institutions and NGO)'),
         'Research (incl. university assignments)', 'N/A'
     ]),
 StringField(name='title',
             widget=StringWidget(
                 label="Subject",
                 label_msgid='EEAEnquiry_label_title',
                 i18n_domain='EEAEnquiry',
             ),
             required=True,
             accessor="Title"),
 TextField(name='description',
           widget=TextAreaWidget(
               label="Enquiry",
               label_msgid='EEAEnquiry_label_description',
               i18n_domain='EEAEnquiry',
           ),
           required=True,
           accessor="Description"),
 StringField(name='email',
             widget=StringWidget(
                 label="Email address",
                 label_msgid='EEAEnquiry_label_email',
                 i18n_domain='EEAEnquiry',
             ),
             required=1,
             validators=('isEmail', )),
 ReferenceField(name='enquiryRequestor',
                widget=ReferenceWidget(
                    label='Enquiryrequestor',
                    label_msgid='EEAEnquiry_label_enquiryRequestor',
Exemplo n.º 29
0
     default=5,
     widget=IntegerWidget(
         label=_("Maximum columns per results email"),
         description=_(
             "Set the maximum number of analysis requests per results email. "
             "Too many columns per email are difficult to read for some clients "
             "who prefer fewer results per email"),
     )
 ),
 TextField(
     'ResultFooter',
     schemata="Results Reports",
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     default="",
     widget=TextAreaWidget(
         label=_("Result Footer"),
         description=_("This text will be appended to results reports."),
         append_only=False,
     ),
 ),
 BooleanField(
     'CategoriseAnalysisServices',
     schemata="Analyses",
     default=False,
     widget=BooleanWidget(
         label=_("Categorise analysis services"),
         description=_("Group analysis services by category in the LIMS tables, helpful when the list is long")
     ),
 ),
Exemplo n.º 30
0
     with_date=1,
     widget=DateTimeWidget(
         label=_("To"),
         description=_("Date until the instrument will not be available"),
     ),
 ),
 StringField('Validator',
             widget=StringWidget(
                 label=_("Validator"),
                 description=_("The analyst responsible of the validation"),
             )),
 TextField(
     'Considerations',
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     widget=TextAreaWidget(
         label=_("Considerations"),
         description=_("Remarks to take into account before validation"),
     ),
 ),
 TextField(
     'WorkPerformed',
     default_content_type='text/plain',
     allowed_content_types=('text/plain', ),
     default_output_type="text/plain",
     widget=TextAreaWidget(
         label=_("Work Performed"),
         description=_(
             "Description of the actions made during the validation"),
     ),
 ),
Exemplo n.º 31
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',
     ),