u'Pick a page contained in the form that you wish to show '
                 'when the form submission has been confirmed. '
                 '(If none are available, add one.) '
                 'Choose none to display the standard thanks page '
                 'of the form.'),
         ),
     ),
     schemata='confirmation',
 ),
 atapi.IntegerField(
     'expiration_time',
     required=False,
     default=7,
     widget=atapi.IntegerWidget(
         label=_(u'label_expiration_time', default=u'Expiration time'),
         description=_(
             u'label_help_expiration_time',
             default=(
                 u'Maximum number of days allowed to confirm the form.'),
         ),
     ),
     schemata='confirmation',
 ),
 atapi.BooleanField(
     'send_standard_mail',
     required=0,
     searchable=0,
     default='1',
     languageIndependent=1,
     widget=atapi.BooleanWidget(
         label=_(u'label_send_standard_mail',
                 default=u'Send standard mail after confirmation'),
示例#2
0
from iservices.rssdocument import RSSDocumentMessageFactory as _
from iservices.rssdocument.interfaces import IRSSDocument
from iservices.rssdocument import config

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


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

    implements(IRSSDocument)
    schema = RSSDocumentSchema
    security = ClassSecurityInfo()

    security.declareProtected(ModifyPortalContent, 'setRSSLink')
示例#3
0
    atapi.TextField('body',
              required=1,
              primary=1,
              searchable=1,
              default_output_type='text/html',
              allowable_content_types=('text/restructured',
                                       'text/plain',
                                       'text/html',
                                       'application/msword'),
              widget=atapi.RichWidget(),
              ),

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

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

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

    atapi.ReferenceField('rel2',
示例#4
0
from Products.ATContentTypes.content.document import ATDocumentSchema
from Products.CMFCore import permissions

try:
    from Products.CMFPlone.factory import _IMREALLYPLONE5  # noqa
except ImportError:
    from archetypes.querywidget.field import QueryField
else:
    from plone.app.collection.field import QueryField

PROJECTNAME = "plone.restapi.tests"

ATTestDocumentSchema = ATDocumentSchema.copy() + atapi.Schema((
    atapi.StringField("testStringField"),
    atapi.BooleanField("testBooleanField"),
    atapi.IntegerField("testIntegerField"),
    atapi.FloatField("testFloatField"),
    atapi.FixedPointField("testFixedPointField"),
    atapi.DateTimeField("testDateTimeField"),
    atapi.LinesField("testLinesField"),
    atapi.FileField("testFileField"),
    atapi.TextField("testTextField"),
    atapi.ImageField("testImageField"),
    atapi.ReferenceField("testReferenceField", relationship="testrelation"),
    atapi.ReferenceField(
        "testMVReferenceField", relationship="testrelation", multiValued=True),
    BlobField("testBlobField"),
    FileField("testBlobFileField"),
    ImageField("testBlobImageField"),
    QueryField("testQueryField"),
    atapi.StringField("testRequiredField", required=True),
示例#5
0
    atapi.TextField(
        'texto',
        storage=atapi.AnnotationStorage(),
        widget=atapi.TextAreaWidget(
            label=_(u"Texto"),
        ),
        required=True,
    ),


    atapi.IntegerField(
        'tempo',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Tempo"),
            description=_(u"Field description"),
        ),
        validators=('isInt'),
    ),


))

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

TextoSchema['title'].storage = atapi.AnnotationStorage()
TextoSchema['description'].storage = atapi.AnnotationStorage()
TextoSchema['description'].widget.visible = {"edit": "invisible", "view": "invisible"}
TextoSchema['location'].widget.visible = {"edit": "invisible", "view": "invisible"}
示例#6
0
from plone.app.blob.field import ImageField
from plone.app.folder.folder import ATFolder
from plone.app.folder.folder import ATFolderSchema
try:
    from Products.CMFPlone.factory import _IMREALLYPLONE5  # noqa
except ImportError:
    from archetypes.querywidget.field import QueryField
else:
    from plone.app.collection.field import QueryField

PROJECTNAME = 'plone.restapi.tests'

ATTestDocumentSchema = ATDocumentSchema.copy() + atapi.Schema((
    atapi.StringField('testStringField'),
    atapi.BooleanField('testBooleanField'),
    atapi.IntegerField('testIntegerField'),
    atapi.FloatField('testFloatField'),
    atapi.FixedPointField('testFixedPointField'),
    atapi.DateTimeField('testDateTimeField'),
    atapi.LinesField('testLinesField'),
    atapi.FileField('testFileField'),
    atapi.TextField('testTextField'),
    atapi.ImageField('testImageField'),
    atapi.ReferenceField('testReferenceField', relationship='testrelation'),
    atapi.ReferenceField(
        'testMVReferenceField', relationship='testrelation', multiValued=True),
    BlobField('testBlobField'),
    FileField('testBlobFileField'),
    ImageField('testBlobImageField'),
    QueryField('testQueryField'),
    atapi.StringField('testRequiredField', required=True),
示例#7
0
        widget=ReferenceBrowserWidget(
            label=_(u"Private doc"),
            description=_(u"Choose the private item you are going to share"),
            startup_directory_method='startupDirectoryMethod',
        ),
        required=True,
        relationship='tokenrolemaileradapter_private_doc',
        allowed_types=(),  # specify portal type names here ('Example Type',)
        multiValued=False,
    ),
    atapi.IntegerField(
        'minutes',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Validity (minutes)"),
            description=_(u"Type the token validity in minutes"),
        ),
        required=True,
        default=60,
        validators=('isInt'),
    ),
))

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

TokenRoleMailerAdapterSchema['title'].storage = atapi.AnnotationStorage()
TokenRoleMailerAdapterSchema['description'].storage = atapi.AnnotationStorage()
TokenRoleMailerAdapterSchema['recipient_name'].widget.visible = {
    'edit': 'invisible',
    'view': 'invisible'
示例#8
0
 atapi.StringField(
     name='showMoreText',
     widget=atapi.StringField._properties['widget'](
         label=_("'Show more' text"),
         description=_("The text for the 'Show more' link."),
         label_msgid='Doormat_label_showMoreText',
         description_msgid='Doormat_help_showMoreText',
         i18n_domain='Doormat',
     ),
 ),
 atapi.IntegerField(
     name='limit',
     widget=atapi.IntegerField._properties['widget'](
         label=_("Limit number of items"),
         description=_(
             "Maximum number of items to be shown, leave blank for "
             "all items."),
         label_msgid='Doormat_label_limit',
         description_msgid='Doormat_help_limit',
         i18n_domain='Doormat',
     ),
 ),
 atapi.BooleanField(
     name='showTime',
     widget=atapi.BooleanField._properties['widget'](
         label=_("Show time"),
         description=_("Show the item's last modification time"),
         label_msgid='Doormat_label_showTime',
         description_msgid='Doormat_help_showTime',
         i18n_domain='Doormat',
     ),
 ),
示例#9
0
        widget=atapi.ComputedWidget(label='Registered objects'),
    ),
    atapi.ComputedField(
        'allocated',
        expression='here.renderMemoryValue(here.getAllocatedMemory())',
        widget=atapi.ComputedWidget(label='Allocated storage'),
    ),
    atapi.ComputedField(
        'storage_class',
        expression='here.getStorageClass()',
        widget=atapi.ComputedWidget(label='Storage class'),
    ),
    atapi.IntegerField(
        'max_objects',
        widget=atapi.IntegerWidget(
            label='Max. Objects',
            description='Allocated (maximum) number of objects',
        ),
    ),
    atapi.FloatField('cost_factor'),
    atapi.DateTimeField(
        'preserve_until',
        widget=atapi.CalendarWidget(
            label='Preserve until',
            description='Until when does this resource need '
            'to be allocated?',
            show_hm=False),
    ),
)) + ResourceContextFields.copy() + CommonFields.copy()

schemata.finalizeATCTSchema(RegisteredStorageResourceSchema,
示例#10
0
     widget=atapi.CalendarWidget(
         label=_(u'Data fine validità'),
         description=_(
             "aData_help",
             default=
             u"Leave empty, and this Booking Folder will never expire"),
         show_hm=False,
     ),
     required=False,
 ),
 atapi.IntegerField(
     'durata',
     storage=atapi.AnnotationStorage(),
     vocabulary="vocDurataIncontro",
     widget=atapi.SelectionWidget(
         label=_(u"Durata incontro"),
         description=_(u"Specificare la durata in minuti"),
     ),
     required=True,
     validators=('isInt'),
 ),
 DataGridField(
     'settimana_tipo',
     storage=atapi.AnnotationStorage(),
     columns=('giorno', 'inizio_m', 'num_m', 'inizio_p', 'num_p'),
     fixed_rows="vocGiorniSettimana",
     allow_delete=False,
     allow_insert=False,
     allow_reorder=False,
     widget=DataGridWidget(
         label=_(u"Settimana Tipo"),
                  u"You will find data from the form "
                  u"in the `options` var (es: options/comments)")),
            rows=20,
            visible={
                'edit': 'visible',
                'view': 'invisible'
            },
        ),
        validators=('zptvalidator', ),
    ),
    atapi.IntegerField(
        'download_timeout',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Download Timeout"),
            description=_(u"How many seconds should pass "
                          u"before downloading the PDF?"),
        ),
        validators=('isInt'),
        default=5,
    ),
))

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

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

schemata.finalizeATCTSchema(FormToPDFAdapterSchema, moveDiscussion=False)
示例#12
0
        ),
   
    required=False,
    searchable=True),
 
    # After about 10 minutes deliberation
    # instead of making this an Annotation i've added it to the object itself
    # the reason being is all data should be stored/managed in the object if it's small enough
    
    atapi.IntegerField(
    name='event_BlogId',
    widget=atapi.IntegerWidget(
        label=u'Event Blog id',
        label_msgid='ISAW_Event_blogid',
        il8n_domain='ISAW_Event',
        size=10,
        visible={'view': 'visible', 
                'edit': 'hidden'},
        ),
    
    # Does isMetadata work anymore?
    isMetadata=True,
    required=False),
    

    atapi.BooleanField(
    schemata='options',
    name='event_Twitter',
    widget=atapi.BooleanWidget(
        description=_(u'event_twitter', default=u'If selected, this event will appear on Twitter @ http://twitter.com/isawnyu'),
        label=u'Post this event on Twitter?',
        label_msgid='ISAW_Event_twitter',
示例#13
0
            description='', label=_(u'Service description text'), rows=25),
    ),
    atapi.ReferenceField(
        'los_categories',
        multiValued=True,
        allowed_types=('LOSCategory', ),
        relationship='sd_los',
        vocabulary='losCategoriesVocab',
        widget=atapi.ReferenceWidget(label=_(u"LOS categories"), ),
        languageIndependent=True,
        required=False,
    ),
    atapi.IntegerField(
        'serviceId',
        required=False,
        searchable=False,
        storage=AnnotationStorage(migrate=True),
        validators=('isInt', ),
        widget=atapi.IntegerWidget(description='', label=_(u'Service Id')),
    ),
    atapi.ReferenceField(
        'contacts',
        multiValued=True,
        allowed_types=('Person', ),
        relationship='contacts_cfp_person',
        widget=atapi.ReferenceWidget(label=_(u"Contact persons"), ),
        vocabulary='listContacts',
        languageIndependent=True,
        required=False,
    ),
))
示例#14
0
         'LEXUS', 'LIFAN', 'LOBINI', 'LOTUS', 'MAHINDRA', 'MASERATI',
         'MATRA', 'MAZDA', 'MCLAREN', 'MERCEDES-BENZ', 'MERCURY', 'MG',
         'MINI', 'MITSUBISHI', 'MIURA', 'NISSAN', 'PEUGEOT', 'PLYMOUTH',
         'PONTIAC', 'PORSCHE', 'RAM', 'RELY', 'RENAULT', 'ROLLS-ROYCE',
         'ROVER', 'SAAB', 'SATURN', 'SEAT', 'SHINERAY', 'SMART',
         'SSANGYONG', 'SUBARU', 'SUZUKI', 'TAC', 'TOYOTA', 'TROLLER',
         'VOLVO', 'VW - VOLKSWAGEN', 'WAKE', 'WALK'
     ],
     widget=atapi.SelectionWidget(
         label=_(u'label_marca', u'Marca'),
         format='select',
     ),
 ),
 atapi.IntegerField(
     name="ano",
     validators=('isInt', ),
     searchable=True,
     widget=atapi.IntegerWidget(label=_(u'label_ano', u'Ano'), ),
 ),
 atapi.IntegerField(
     name="modelo",
     validators=('isInt', ),
     searchable=True,
     widget=atapi.IntegerWidget(label=_(u'label_modelo', u'Modelo'), ),
 ),
 atapi.StringField(name="cor",
                   required=True,
                   searchable=True,
                   widget=atapi.StringWidget(label=_(u'label_cor',
                                                     u'Cor'), )),
 atapi.StringField(name="valor",
                   required=True,
示例#15
0
            label=_(u'Randomize Question Order'),
            description=_(
                u'Check this box if you want the questions '
                u'in this container to appear in a different, random '
                u'order for each candidate. Otherwise the same order '
                u'as in the "contents"-view will be used.'),
        ),
    ),
    atapi.IntegerField(
        "numberOfRandomQuestions",
        required=False,
        default=-1,
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u'Number of Random Questions'),
            description=_(u'The number of questions which are randomly '
                          u'selected when a new quiz is '
                          u'generated for a student. (This only works if '
                          u'"Randomize Question Order" '
                          u'is checked.) A value <= 0 means that all '
                          u'questions will be used.'),
        ),
    ),
    atapi.BooleanField('BadResults',
                       default=True,
                       accessor='viewBadResults',
                       storage=atapi.AnnotationStorage(),
                       widget=atapi.BooleanWidget(
                           label=_(u'Show incorrect answers'), )),
))
示例#16
0
# -*- Message Factory Imported Here -*-
from leam.luc import lucMessageFactory as _

from leam.luc.interfaces import IProbmap
from leam.luc.config import PROJECTNAME

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

    # -*- Your Archetypes field definitions here ... -*-
    atapi.IntegerField(
        'year',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Effective Year"),
            description=_(
                u"Each driver given below should correspond to this year."),
        ),
        required=True,
        default=_(u"2010"),
        validators=('isInt'),
    ),
    atapi.ReferenceField(
        'tdm',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            allow_browse=1,
            allow_search=1,
            startup_directory='/luc/drivers/transportation',
            label=_(u"TDM Transportation Network"),
            #description=_(u""),
        ),
示例#17
0
        mutator="setPlayer",
        mode='rw',
        default_method="getDefaultPlayerId",
        vocabulary_factory="rfa.kaltura.video_players",
        widget=atapi.SelectionWidget(label="Player",
                                     label_msgid="label_kplayerid_msgid",
                                     description="Choose the player to use",
                                     description_msgid="desc_kplayerid_msgid",
                                     i18n_domain="kaltura_video"),
    ),
    atapi.IntegerField(
        'partnerId',
        searchable=0,
        mode='rw',
        default_method="getDefaultPartnerId",
        widget=atapi.IntegerWidget(
            label="Partner Id",
            label_msgid="label_kpartnerid_msgid",
            description="Kaltura Partner Id (use default if unsure)",
            description_msgid="desc_kpartnerid_msgid",
            i18n_domain="kaltura_video"),
    ),
))

#this seems misnamed
KalturaMetadataSchema = atapi.Schema((
    atapi.LinesField(
        'categories',
        multiValued=True,
        searchable=0,
        required=False,
        vocabulary="getCategoryVocabulary",
示例#18
0
from rendereasy.origineclub.config import PROJECTNAME

from DateTime.DateTime import *
from Products.CMFPlone.utils import getToolByName
from string import join

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

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

    atapi.IntegerField(
        'tempo',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Tempo"),
            description=_(u"Informe o tempo em segundos."),
        ),
        required=True,
        default=5,
        validators=('isInt'),
    ),

    atapi.ImageField(
        'imagem',
        storage=atapi.AnnotationStorage(),
        widget=atapi.ImageWidget(
            label=_(u"Foto"),
        ),
        required=True,
        validators=('isNonEmptyFile'),
    ),
示例#19
0
                        label=_(u'Criteria for adding new rows'),
                        description=_('help_insertType',
                                      default=u'Criteria of inserting new row.\n'
                                              u'Choose if add row at the end of group (append) '
                                              u'or before group (prepend).'),
            ),
    ),

    atapi.IntegerField('batchSize',
              searchable=False,
              schemata="settings",
              default=100,
              required=True,
              widget=atapi.IntegerWidget(
                        label=_(u'Max number of rows'),
                        description=_('help_batchSize',
                                      default=u'Insert the maximum number of rows to be displayed '
                                              u'in a single page.\n'
                                              u'When this limit is reached a batching navigation section '
                                              u'will be displayed.\n'
                                              u'Use 0 to disable batching (NOT suggested on very large tables or '
                                              u'extremly complex column types).'),
              ),
    ),

    # FOO FIELD!!!! Only needed to being able to use the ATReferenceBrowserWidget... :(
    atapi.StringField('link_internal',
            widget=ReferenceBrowserWidget(
                    label=u"Internal link dump field",
                    visible={'view': 'invisible', 'edit': 'invisible'},
                    force_close_on_insert=True,
                    startup_directory_method="this_directory",
示例#20
0
         force_close_on_insert=True,
         label=_(u"Images cover collection"),
         description=_(u"if cover image not present use "
                       "a random cover from the collection."),
     ),
 ),
 atapi.BooleanField('javascript',
                    schemata='default',
                    default=True,
                    widget=atapi.BooleanWidget(
                        label=_(u"JavaScript"),
                        description=_(u"Enable or disable javascript"))),
 atapi.IntegerField(
     'javascriptdelay',
     schemata='default',
     default=0,
     widget=atapi.IntegerWidget(
         label=_(u"JavaScript delay"),
         description=_(u"Wait some seconds for javascript to finish"))),
 atapi.IntegerField(
     'timeout',
     schemata='default',
     default=3600,
     widget=atapi.IntegerWidget(
         label=_(u"Timeout"),
         description=_(
             u"Abort PDF export after specified number of seconds. "
             u"Use zero to disable it."))),
 atapi.BooleanField(
     'async',
     schemata='default',
示例#21
0
# -*- Message Factory Imported Here -*-
from leam.luc import lucMessageFactory as _

from leam.luc.interfaces import IProbmap
from leam.luc.config import PROJECTNAME

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

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

    atapi.IntegerField(
        'year',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Effective Year"),
            description=_(u"Each driver given below should correspond to this year."),
        ),
        required=True,
        default=_(u"2010"),
        validators=('isInt'),
    ),


    atapi.ReferenceField(
        'tdm',
        storage=atapi.AnnotationStorage(),
        widget=ReferenceBrowserWidget(
            allow_browse=1,
            allow_search=1,
            startup_directory='/luc/drivers/transportation',
            label=_(u"TDM Transportation Network"),
示例#22
0
BookSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.StringField(
        'author',
        widget=atapi.StringWidget(
            label=_(u"Author"),
            description=_(u"Author of this book"),
        ),
        required=True,
    ),
    atapi.IntegerField(
        'stars',
        widget=atapi.IntegerWidget(
            label=_(u"Stars"),
            description=_(
                u"How well do you like this book? Use number 1 through 5."),
        ),
        validators=('isInt'),
        schemata='starschema',
    ),
))

schemata.finalizeATCTSchema(BookSchema, moveDiscussion=False)


class Book(base.ATCTContent):
    """Information about a book"""
    implements(IBook)

    meta_type = "Book"
    schema = BookSchema
     widget=atapi.LinesWidget(
         label=_(u"Giorni festivi"),
         description=_(
             'help_holidays', u"Indicare i giorni festivi (uno per riga) "
             u"nel formato GG/MM/AAAA. Al posto dell'anno puoi mettere un "
             u"asterisco per indicare un evento che ricorre annualmente."),
     ),
     required=False,
 ),
 atapi.IntegerField(
     'futureDays',
     required=True,
     default=0,
     widget=atapi.IntegerWidget(
         label=_(u'Max days in the future'),
         description=_('futureDays',
                       default=u"Limit booking in the future to an amount "
                       u"of days in the future starting from "
                       u"the current day. \n"
                       u"Keep 0 to give no limits."),
     ),
 ),
 DataGridField(
     'tipologia',
     storage=atapi.AnnotationStorage(),
     columns=('name', 'duration'),
     allow_delete=True,
     allow_insert=True,
     allow_reorder=False,
     widget=DataGridWidget(
         label=_(u"Tipologie di richiesta"),
示例#24
0
        validators=('isDecimal'),
    ),
    atapi.StringField(
        'latlong',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Latitude Longitude"),
            description=_(u'formatted as "lat long"'),
        ),
        required=False,
    ),
    atapi.IntegerField(
        'zoom',
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u"Zoom Level"),
            description=_(u"0 = No Zoom, 19 = Full Zoom"),
        ),
        default=10,
        validators=('isInt'),
    ),
))

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

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

schemata.finalizeATCTSchema(simmapSchema, moveDiscussion=False)

示例#25
0
from Products.ATContentTypes.content.base import ATContentTypeSchema, ATCTContent

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

from mpdg.govbr.observatorio.content.interfaces import IContador
from DateTime.DateTime import DateTime
from mpdg.govbr.observatorio.config import PROJECTNAME
from mpdg.govbr.observatorio import MessageFactory as _

ContadorSchema = ATContentTypeSchema.copy() + atapi.Schema((

    # contador
    atapi.IntegerField(
        name = 'contador',
        required =True,
        default = 0,
    ),

    # content_type
    atapi.StringField(
        name = 'content_type',
        required = True,
    ),

    # uid
    atapi.StringField(
        name='uid_obj',
        required=True,
    ),
))
示例#26
0
     multiValued=True,
     allowed_types=('Person', ),
     widget=ReferenceBrowserWidget(
         label='Administrators',
         allow_browse=1,
         startup_directory='/people',
     ),
 ),
 atapi.LinesField(
     'supported_os',
     searchable=True,
     multiValued=True,
     vocabulary='getOSVocab',
     widget=atapi.MultiSelectionWidget(format='checkbox'),
 ),
 atapi.IntegerField('committed_cores', schemata='resources'),
 atapi.IntegerField('committed_disk', schemata='resources', size=20),
 atapi.IntegerField('committed_tape', schemata='resources', size=20),
 atapi.IntegerField('used_disk', schemata='resources', size=20),
 atapi.IntegerField('used_tape', schemata='resources', size=20),
 atapi.ReferenceField(
     'communities_primary',
     relationship='primary_provider_for',
     multiValued=True,
     allowed_types=('Community', ),
     widget=ReferenceBrowserWidget(
         label='Primary provider for',
         allow_browse=1,
         startup_directory='/communities',
     ),
 ),
             default=
             u"Enter the web address (URL). You can copy & paste this from a browser window."
         ),
         i18n_domain='ploneservicescenter',
     ),
     required=1,
 ),
 atapi.IntegerField(
     'rating',
     widget=atapi.SelectionWidget(
         label=_(u"label_services_rating", default=u"Rating"),
         description=_(
             u"help_services_rating",
             default=
             u"Select a value of options from the below list by rating."),
         format='select',
         i18n_domain='ploneservicescenter',
     ),
     required=1,
     default=2,
     vocabulary=atapi.IntDisplayList([(i, i) for i in range(1, 4)]),
     write_permission='Manage portal',
     index=('FieldIndex:schema', ),
 ),
 atapi.StringField(
     'contactName',
     widget=atapi.StringWidget(
         label=_(u"label_services_contactname", default=u"Contact Name"),
         description=_(u"help_services_contactname",
                       default=u"Enter the contact name."),
         i18n_domain='ploneservicescenter',
示例#28
0
TimeSlotSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.DateTimeField('startTime',
                        storage=atapi.AnnotationStorage(),
                        widget=TimeWidget(label=_('Start Time'))),
    atapi.DateTimeField('endTime',
                        storage=atapi.AnnotationStorage(),
                        widget=TimeWidget(label=_('End Time'))),
    atapi.StringField('name',
                      storage=atapi.AnnotationStorage(),
                      widget=atapi.StringWidget(
                          label=_('Name'), description=_(u'Optional name'))),
    atapi.IntegerField('maxCapacity',
                       storage=atapi.AnnotationStorage(),
                       default=1,
                       required=True,
                       widget=atapi.IntegerWidget(
                           label=_(u'Max Capacity'),
                           description=_(u'The max number of people'))),
    atapi.BooleanField(
        'allowWaitingList',
        storage=atapi.AnnotationStorage(),
        widget=atapi.BooleanWidget(
            label=_(u'Allow Waiting List'),
            description=_(u'Check if you want to allow signups to waiting '
                          'list once max capacity is reached'))),
))

TimeSlotSchema['title'].required = False
TimeSlotSchema['title'].widget.visible = {
    'view': 'invisible',
示例#29
0
from Products.Archetypes import atapi
from Products.ATContentTypes.content.document import ATDocument

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


class Book(ATDocument):
    """ Demo Book
    """
    archetypes_name = meta_type = portal_type = 'Book'
    _at_rename_after_creation = True
    schema = SCHEMA
示例#30
0
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from jyu.rsslisting.interfaces.rsslisting import IRSSListing
from jyu.rsslisting.config import PROJECTNAME

from zope.i18nmessageid import Message as _  # requires explicit domain

RSSListingSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((
    atapi.IntegerField(
        'count',
        required=True,
        searchable=True,
        storage=atapi.AnnotationStorage(),
        widget=atapi.IntegerWidget(
            label=_(u'Number of items to display', domain="plone"),
            description=_(u'How many items to list.', domain="plone")),
        default=5,
    ),
    atapi.TextField(
        'url',
        required=True,
        searchable=True,
        #        validators=(('isURL'),),
        storage=atapi.AnnotationStorage(),
        widget=atapi.TextAreaWidget(
            label=_(u'List of RSS feed URLs', domain="jyu.rsslisting"),
            description=
            _(u'List of links to the RSS feeds to display. Please, enter only one link per line.',
              domain="jyu.rsslisting")),