Пример #1
0
            label=_(u'Show Individual Time Slot Names'),
            description=_(u'Whether or not to show individual slot names.'))),
    atapi.LinesField(
        'extraFields',
        storage=atapi.AnnotationStorage(),
        vocabulary="getExtraFieldsVocabulary",
        widget=atapi.MultiSelectionWidget(
            label=_(u'Extra Fields'),
            description=_(u'Information you want to collect from users besides'
                          ' just name and email.'),
            format='checkbox')),
    atapi.LinesField(
        'contactInfo',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Contact Information'),
            description=_(u'Contact information for the manager of the signup'
                          ' sheet.'))),
    atapi.LinesField(
        'extraEmailContent',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Extra Email Content'),
            description=_(u'Any additional information that you want included '
                          'in the notification emails. Note: Contact info., '
                          'sheet, day, time, and a url are included by '
                          'default.'))),
))

SignupSheetSchema['title'].storage = atapi.AnnotationStorage()
SignupSheetSchema['description'].storage = atapi.AnnotationStorage()
Пример #2
0
     'endDate',
     #required=True,
     searchable=False,
     accessor='end',
     #default_method=DateTime, # Default to current date
     languageIndependent=True,
     storage=atapi.AnnotationStorage(),
     widget=atapi.CalendarWidget(
         label=_(u"End Date"), description=_(u""), show_hm=False),
 ),
 atapi.LinesField(
     'instructor',
     #required=True,
     searchable=True,
     storage=atapi.AnnotationStorage(),
     widget=atapi.LinesWidget(label=_(u"Course code"), visible=False)),
 atapi.StringField(
     'registered',
     #required=True,
     storage=atapi.AnnotationStorage(),
     widget=atapi.StringWidget(label=_(u"Course code"), visible=False)),
 atapi.IntegerField(
     "vigencyDays",
     required=False,
     default=365,
     storage=atapi.AnnotationStorage(),
     widget=atapi.IntegerWidget(
         label=_(u'Course expiration period'),
         description=_(
             u'Defines the number of days the course stays open.'),
     ),
Пример #3
0
        required=True,
        storage=atapi.AnnotationStorage(),
        default_method='getCurrentDate',
        widget=atapi.CalendarWidget(
            label=_(u'Closing Date'),
            description=_(u'Date when applications close.'),
            show_hm=False,
        ),
    ),
    atapi.LinesField(
        'loiDates',
        required=False,
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Letters-of-Intent Dates'),
            description=_(u'Dates when letters-of-intent for this announcement are due, in the ISO format YYYY-MM-DD,' \
                + ' one per line.'),
        ),
    ),
    atapi.LinesField(
        'appReceiptDates',
        required=False,
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u'Application Receipt Dates'),
            description=_(u'Dates when applications must be received, in the ISO format YYYY-MM-DD, one per line.'),
        ),
    ),
))
AnnouncementSchema['title'].storage = atapi.AnnotationStorage()
AnnouncementSchema['description'].storage = atapi.AnnotationStorage()
Пример #4
0
#Libs

# Product imports
from lx.demanda import demandaMessageFactory as _
from lx.demanda.interfaces.contents import ISecao
from lx.demanda import config

# Schema definition
schema = ATFolder.schema.copy() + atapi.Schema((
    atapi.LinesField(
        name='lista_os',
        required=False,
        searchable=True,
        widget=atapi.LinesWidget(
            label=_(u"Lista de OS"),
            description=_(u"Lista de OS"),
            size=10,)
    ),
),)

schemata.finalizeATCTSchema(schema)


class Secao(ATFolder, HistoryAwareMixin):
    """
    """
    security = ClassSecurityInfo()
    implements(ISecao)

    meta_type = 'Secao'
    portal_type = 'Secao'
Пример #5
0
         description=
         u"Title of products when using the project view. For example, 'Add-on Product', 'Extension', or 'Template'.",
         i18n_domain='collective.TemplateUploadCenter',
     ),
 ),
 atapi.LinesField(
     'availableVersions',
     default=[
         'LibreOffice 3.3',
         'LibreOffice 3.4',
         'LibreOffice 3.5',
     ],
     widget=atapi.LinesWidget(
         label=u'Available Versions',
         description=
         u'Define the vocabulary for versions of LibreOffice that the templates can be listed as being compatible with. The first item will be the default selection.',
         i18n_domain='collective.TemplateUploadCenter',
         rows=6,
     ),
 ),
 atapi.LinesField(
     'availablePlatforms',
     default=[
         'All platforms', 'Linux', 'Linux-x64', 'Mac OS X', 'Windows',
         'BSD', 'UNIX (other)'
     ],
     widget=atapi.LinesWidget(
         label=u'Platforms',
         description=
         u'Define the available platforms for software files. The first line is reserved for All platforms or any equivalent labeling.',
         i18n_domain='collective.TemplateUploadCenter',
Пример #6
0
from AccessControl import ClassSecurityInfo
from Products.Archetypes import atapi
from Products.ATContentTypes.content.folder import ATBTreeFolder
from Products.CMFCore.utils import getToolByName
from Products.feedfeeder import _
from Products.feedfeeder.config import PROJECTNAME
from Products.feedfeeder.interfaces.container import IFeedsContainer
from zope import interface

schema = atapi.Schema((
    atapi.LinesField(
        name='feeds',
        widget=atapi.LinesWidget(description=_(
            "help_feeds",
            default="List of rss feeds. You can prefix feed link titles "
            "using | separator. It is probably a good idea to add a colon "
            "or dash at the end of the prefix "
            "('My place: |http://myplace/feed')."),
                                 label=_('feedfeeder_label_feeds',
                                         default='Feeds'))),
    atapi.BooleanField(
        name='redirect',
        widget=atapi.BooleanWidget(
            description=_(
                "help_redirect",
                default="If checked the feed item will be automatically "
                "redirected if you don't have the edit permission."),
            label=_('label_redirect',
                    default='Automatic redirect of feed items'))),
    atapi.StringField(
        name='defaultTransition',
        vocabulary='getAvailableTransitions',
from zope.interface import implements

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

from comuneimola.compensi.interfaces.atareacompensi import IATAreaCompensi
from comuneimola.compensi.config import PROJECTNAME
from comuneimola.compensi import compensiMessageFactory as _

ATAreaCompensiSchema = folder.ATFolderSchema.copy() + atapi.Schema((
    atapi.LinesField(
        name='elenco_uffici',
        widget=atapi.LinesWidget(
            label=_(u"office_list", default=u"Office List"),
            description=_(u"office_list_description",
                          default=u"List here offices for current area"),
        ),
        required=False,
    ),
    atapi.LinesField(
        name='modalita_affidamento',
        widget=atapi.LinesWidget(
            label=_(u"award_procedures_label",
                    default=u"Procedures for the award"),
            description=_(u"relied_modality_description",
                          default=u"List here the procedures for the award"),
        ),
        required=False,
    ),
    atapi.LinesField(
Пример #8
0
         label=_(u"label_variation1_attr",
                 default=u"Variation 1 Attribute"),
         description=_(u"desc_variation1_attr", default=u""),
         visible={
             'view': 'invisible',
             'edit': 'invisible'
         },
     ),
 ),
 atapi.LinesField(
     'variation1_values',
     required=0,
     widget=atapi.LinesWidget(
         label=_(u"label_variation1_values", default=u"Variation 1 Values"),
         description=_(u"desc_variation1_values", default=u""),
         visible={
             'view': 'invisible',
             'edit': 'invisible'
         },
     ),
 ),
 atapi.StringField(
     'variation2_attribute',
     required=0,
     widget=atapi.StringWidget(
         label=_(u"label_variation2_attr",
                 default=u"Variation 2 Attribute"),
         description=_(u"desc_variation2_attr", default=u""),
         visible={
             'view': 'invisible',
             'edit': 'invisible'
         },
Пример #9
0
    ImageField('image',
               widget=atapi.ImageWidget(label=_(u"Image")),
               validators=('isNonEmptyFile'),
               languageIndependent=True),
    backref.BackReferenceField(
        'services',
        relationship='sd_los',
        multiValued=True,
        widget=backref.BackReferenceWidget(label=_(u"Services"), ),
    ),
    atapi.LinesField(
        'synonyms',
        multiValued=1,
        searchable=True,
        #widget=atapi.LinesWidget(label=_(u'Synonyms'), visible=False),
        widget=atapi.LinesWidget(label=_(u'Synonyms')),
    ),
    atapi.LinesField(
        'synonymIds',
        multiValued=1,
        searchable=False,
        #widget=atapi.LinesWidget(label=_(u'Synonym Ids'), visible=False),
        widget=atapi.LinesWidget(label=_(u'Synonym Ids')),
    ),
))
LOSCategorySchema['losId'].widget.visible = \
    {"edit": "invisible", "view": "visible"}
LOSCategorySchema['services'].widget.visible = \
    {"edit": "invisible", "view": "visible"}
LOSCategorySchema['synonyms'].widget.visible = \
    {"edit": "invisible", "view": "visible"}
Пример #10
0
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content.schemata import finalizeATCTSchema

from eduintelligent.courses.interfaces import ICourseFolder
from eduintelligent.courses.config import PROJECTNAME
from eduintelligent.courses.utility import hideMetadataSchema
from eduintelligent.courses import coursesMessageFactory as _

CourseFolderSchema = folder.ATBTreeFolderSchema.copy(
) + atapi.Schema((atapi.LinesField(
    'categories',
    storage=atapi.AnnotationStorage(),
    widget=atapi.LinesWidget(
        label=_(u"Categories"),
        description=_(
            u"One category on each line. Used for grouping courses. <br /> "
            u"CAUTION: ONCE YOU ADD A NEW CATEGORY, YOU DON'T MODIFY OR DELETE THIS, ONLY YOU CAN ADD NEW CATEGORY"
        ),
        rows=6,
    ),
), ))

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

finalizeATCTSchema(CourseFolderSchema, folderish=True, moveDiscussion=False)
hideMetadataSchema(CourseFolderSchema, excludeFromNav=True)


class CourseFolder(folder.ATBTreeFolder):
    """Contains multiple courses.
    """
Пример #11
0
        storage=atapi.AnnotationStorage(),

        widget=atapi.StringWidget(
            label=_(u'HGNC Name'),

        ),
        predicateURI=predicateURIBase + 'HgncName',
    ),
    atapi.LinesField(
        'bmAliases',
        storage=atapi.AnnotationStorage(),

        multiValued=True,
        searchable=True,
        widget=atapi.LinesWidget(
            label=_(u'Aliases'),

        ),
        predicateURI=predicateURIBase + 'Alias'
    ),
    atapi.LinesField(
        'indicatedBodySystems',
        storage=atapi.AnnotationStorage(),

        multiValued=True,
        searchable=True,
        widget=atapi.LinesWidget(
            label=_(u'Indicated Organs'),

            visible={'view': 'invisible', 'edit': 'invisible'},
        ),
    ),
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from openpyxl import Workbook
from openpyxl.styles import Font
from openpyxl.writer.excel import save_virtual_workbook
from zope.i18n import translate
from zope.interface import implements

XlsxDataAdapterSchema = FormSaveDataAdapter.schema.copy() + atapi.Schema(
    (atapi.StringField(
        name='xlsx_recipients',
        required=False,
        widget=atapi.LinesWidget(
            label=_(u'label_xlsx_recipients', default=u'XLSX recipients'),
            description=_(u'help_xlsx_recipients',
                          default=u'One email address per line'),
        ))))

schemata.finalizeATCTSchema(XlsxDataAdapterSchema,
                            folderish=True,
                            moveDiscussion=False)
schemata.finalizeATCTSchema(XlsxDataAdapterSchema,
                            folderish=True,
                            moveDiscussion=False)
XlsxDataAdapterSchema['DownloadFormat'].widget.visible = {'edit': 0, 'view': 0}

if 'excludeFromNav' in XlsxDataAdapterSchema.keys():
    XlsxDataAdapterSchema['excludeFromNav'].default = True

Пример #13
0
    atapi.StringField('title',
                      widget=atapi.StringWidget(visible=dict(
                          edit='invisible',
                          view='invisible',
                      ), ),
                      required=False),
    atapi.StringField(
        'couponId',
        default_method='generate_cid',
        required=True,
        widget=atapi.StringWidget(label=_('coupon ID'), ),
    ),
    atapi.LinesField(
        'consumers',
        widget=atapi.LinesWidget(visible=dict(
            view='visible',
            edit='hidden',
        ), ),
    ),
))


class Coupon(atapi.BaseContent):
    """easyshop coupon"""
    implements(ICoupon)
    _at_rename_after_creation = True
    schema = schema.copy()

    def generate_cid(self):
        return ''.join(
            [choice(COUPON_ID_PATTERN) for i in range(COUPON_ID_LENGTH)])
Пример #14
0
GrupoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.ComputedField(
        'quantidade',
        storage=atapi.AnnotationStorage(),
        widget=atapi.ComputedWidget(
            label=_(u"Quantidade"),
            description=_(u"Quantidade de telefones cadastrados."),
        ),
        expression="context.numTelefones()"),
    atapi.LinesField(
        'telefones',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u"Telefones"),
            description=_(u"Um por linha, no formato 6199999999."),
        ),
    ),
))

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

GrupoSchema['title'].widget.label = _(u"Nome do grupo")
GrupoSchema['title'].storage = atapi.AnnotationStorage()
GrupoSchema['description'].storage = atapi.AnnotationStorage()
GrupoSchema['location'].widget.visible = {
    "edit": "invisible",
    "view": "invisible"
}
GrupoSchema['language'].widget.visible = {
Пример #15
0
             "inizio_p":
             SelectColumn(
                 "Ora inizio", vocabulary="vocOreInizio", default=""),
             "num_p":
             SelectColumn("Numero appuntamenti",
                          vocabulary="vocNumeroAppuntamenti",
                          default=""),
         }),
     required=True,
 ),
 atapi.LinesField(
     'festivi',
     storage=atapi.AnnotationStorage(),
     widget=atapi.LinesWidget(
         label=_(u"Giorni festivi"),
         description=_(u"Indicare i giorni festivi (una per riga) "
                       u"nel formato gg/mm/aaaa"),
     ),
     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 of days in the future starting from "
             u"the current day.\n"
Пример #16
0

logger = logging.getLogger("gcommons.Core.lib.container")


#
# Schema
#
gcContainerSchema_base = atapi.Schema ((
    atapi.LinesField(        
        name = 'txtEditors',
        storage = atapi.AnnotationStorage(),
        widget = atapi.LinesWidget(            
            condition="here/condition_txtEditors",
            label="Editorial Board",    #Guest Editors/Comittee      
            description="Enter the user ids of the users who compose the EB and are able to manage this journal, one per line.",            
            label_msgid='gcommons_label_editors',            
            description_msgid='gcommons_help_editors',            
            i18n_domain='gcommons.Core',        
        ),        
        default_method="getDefaultEditors"    
    ),

    atapi.ReferenceField(
        name='refEditors',
        relationship = 'refEditors',
        required = False,
        multiValued = True,
        searchable=1,
        allowed_types=('gcPerson',),
        storage=atapi.AnnotationStorage(),
        
Пример #17
0
                          "Bio.Alphabet.ProteinAlphabet",
                          "Bio.Alphabet.IUPAC.ExtendedIUPACProtein",
                          "Bio.Alphabet.IUPAC.IUPACProtein",
                      ],
                      widget=atapi.SelectionWidget(
                          label="alphabet",
                          label_msgid="alphabet_label",
                          description="Alphabet",
                          description_msgid="alphabet_help",
                          i18n_domain="plone4bio")),
    # TODO: custom widget
    atapi.StringField("dbxrefs",
                      required=False,
                      widget=atapi.LinesWidget(
                          label="dbxrefs",
                          label_msgid="dbxrefs_label",
                          description="Database cross references",
                          description_msgid="dbxrefs_help",
                          i18n_domain="plone4bio")),
))


class SeqRecord(ATCTContent):
    portal_type = 'SeqRecord'

    implements(ISeqRecord)

    security = ClassSecurityInfo()
    schema = SeqRecordSchema
    _at_rename_after_creation = True

    # TODO:
# -*- Message Factory Imported Here -*-
from msd.oxtalks import oxtalksMessageFactory as _

from msd.oxtalks.interfaces import IOxfordTalksCollection
from msd.oxtalks.config import PROJECTNAME

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

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

    atapi.LinesField(
        'feeds',
        storage=atapi.AnnotationStorage(),
        widget=atapi.LinesWidget(
            label=_(u"Feeds"),
            description=_(u"Enter the URLs of the feeds you want to use"),
        ),
        required=True,
        default= ["http://talks.ox.ac.uk/api/talks/search?from=today&organising_department=oxpoints:23232740",],
    ),
    
    atapi.StringField(
        'limitNum',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Limit"),
            description=_(u"Enter the number of items to show"),
        ),
        required=True,
        default=_(u"10"),
    ),
Пример #19
0
    atapi.StringField(
        name = 'service_name',
        required = True,
        searchable = False,
        widget = atapi.StringWidget(
            label = _('service_name_label', u'Service name'),
            size = 100,
        ),
    ),
    atapi.StringField(
        name = 'service_pars',
        required = False,
        searchable = False,
        widget = atapi.LinesWidget(
            label = _('service_pars_label', u'Service parameters'),
            description = _('service_pars_description', u'one service parameter per line (example self.REQUEST.get("par_name", "par_default_value"))'),
            size = 100,
        ),
    ),
    atapi.StringField(
        name = 'alternate_template',
        required = False,
        searchable = False,
        widget = atapi.StringWidget(
            label = _('alternate_template_label', u'Alternate Viewlet Template'),
            description = _('alternate_template_description', u'Relative path from directory containg the definition of WebserviceResultViewlet class (example ../../../../apt.visit/apt/visit/browser/templates/tpl_example.pt)'),
            size = 100,
        ),
    ),
))
Пример #20
0
            label_msgid="label_kvideofile_categories",
            description="Select video category(ies) this playlist will provide",
            description_msgid="desc_kvideofile_categories",
            i18n_domain="kaltura_video"),
    ),
    atapi.LinesField(
        'tags',
        multiValued=True,
        searchable=0,
        required=False,
        accessor="getTags",
        mutator="setTags",
        widget=atapi.LinesWidget(
            label="Tags",
            label_msgid="label_kvideofile_tags",
            description=
            "Add keyword tag(s) this playlist will provide (one per line)",
            description_msgid="desc_kvideofile_title",
            i18n_domain="kaltura_video"),
    ),
))

###XXX Todo: create base class ExternalMediaEntry
##based off of http://www.kaltura.com/api_v3/testmeDoc/index.php?object=KalturaExternalMediaEntry


class KalturaContentMixin(object):

    security = ClassSecurityInfo()
    KalturaObject = None
    categories = {}
Пример #21
0
class ShopItemExtender(object):
    """Extends the base type ShopItem with fields `price`
    and `skuCode`.
    """
    implements(ISchemaExtender)
    adapts(IShopItem)

    fields = [
        ExtFixedPointField(
            'price',
            default="0.00",
            required=0,
            languageIndependent=True,
            widget=atapi.DecimalWidget(
                label=_(u"label_price", default=u"Price"),
                description=_(u"desc_price", default=u""),
                size=8,
            ),
        ),
        ExtBooleanField(
            'showPrice',
            default=False,
            languageIndependent=True,
            widget=atapi.BooleanWidget(
                label=_(u"label_show_price", default=u"Show price"),
                description=_(u"desc_show_price", default=u""),
            ),
        ),
        ExtStringField(
            'skuCode',
            required=0,
            languageIndependent=True,
            widget=atapi.StringWidget(
                label=_(u"label_sku_code", default=u"SKU code"),
                description=_(u"desc_sku_code", default=u""),
            ),
        ),
        ExtStringField(
            'variation1_attribute',
            required=0,
            widget=atapi.StringWidget(
                label=_(u"label_variation1_attr",
                        default=u"Variation 1 Attribute"),
                description=_(u"desc_variation1_attr", default=u""),
                visible={
                    'view': 'invisible',
                    'edit': 'invisible'
                },
            ),
        ),
        ExtLinesField(
            'variation1_values',
            required=0,
            widget=atapi.LinesWidget(
                label=_(u"label_variation1_values",
                        default=u"Variation 1 Values"),
                description=_(u"desc_variation1_values", default=u""),
                visible={
                    'view': 'invisible',
                    'edit': 'invisible'
                },
            ),
        ),
        ExtStringField(
            'variation2_attribute',
            required=0,
            widget=atapi.StringWidget(
                label=_(u"label_variation2_attr",
                        default=u"Variation 2 Attribute"),
                description=_(u"desc_variation2_attr", default=u""),
                visible={
                    'view': 'invisible',
                    'edit': 'invisible'
                },
            ),
        ),
        ExtLinesField(
            'variation2_values',
            required=0,
            widget=atapi.LinesWidget(
                label=_(u"label_variation2_values",
                        default=u"Variation 2 Values"),
                description=_(u"desc_variation2_values", default=u""),
                visible={
                    'view': 'invisible',
                    'edit': 'invisible'
                },
            ),
        ),
        ExtFixedPointField(
            'vat',
            default="0.0",
            required=0,
            languageIndependent=True,
            widget=atapi.SelectionWidget(
                label=_(u"label_vat_rate", default=u"VAT rate"),
                description=_(
                    u"desc_vat_rate",
                    default=
                    u"Please select the value-added tax rate for this item."),
                size=8,
                format='select',
            ),
            vocabulary_factory='ftw.shop.VATRatesVocabulary',
        ),
    ]

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

    def getFields(self):
        return self.fields
Пример #22
0
class SchemaExtender(object):
    """ Extend a file to get more publication related fields """
    implements(IOrderableSchemaExtender)

    _fields = [
        # Override relatedItems make it langauge independent and override
        # the accessor to return langage dependent references.
        ExtendedReferenceField(
            'relatedItems',
            relationship='relatesTo',
            multiValued=True,
            isMetadata=True,
            languageIndependent=True,
            accessor='getRelatedItems',
            mutator='setRelatedItems',
            index='KeywordIndex',
            write_permission=permissions.ModifyPortalContent,
            widget=ReferenceBrowserWidget(allow_search=True,
                                          allow_browse=True,
                                          show_indexes=False,
                                          force_close_on_insert=True,
                                          label=_(u"Related Items"),
                                          description='',
                                          visible={
                                              'edit': 'visible',
                                              'view': 'invisible'
                                          }),
        ),
        ExtendedImageField(
            'cover_image',
            schemata='publication',
            sizes={'cover': (70, 100)},
            languageIndependent=True,
            accessor='getCover_image',
            mutator='setCover_image',
            widget=atapi.ImageWidget(
                label=_(u'label_cover_image', default=u'Cover Image'),
                description=_(
                    u'description_cover_image',
                    default=
                    u'Upload a cover image. Leave empty to have the system autogenerate one for you.'
                ),
            ),
        ),
        ExtendedStringField(
            'author',
            schemata='publication',
            languageIndependent=True,
            accessor='getAuthor',
            mutator='setAuthor',
            widget=atapi.StringWidget(
                label=_(u'label_author', default=u'Author'),
                description=_(
                    u'description_author',
                    default=
                    u'Fill in the Name of the Author of this Publication.'),
            ),
        ),
        ExtendedStringField(
            'isbn',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_isbn', default=u'ISBN'),
                description=_(
                    u'description_isbn',
                    default=u'Fill in the ISBN Number of this Publication.'),
            ),
        ),
        ExtendedStringField(
            'order_id',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_order_id', default=u'Order ID'),
                description=_(
                    u'description_order_id',
                    default=u'Fill in the Order ID of this Publication.'),
            ),
        ),
        ExtendedBooleanField(
            'for_sale',
            schemata='publication',
            languageIndependent=True,
            accessor='getFor_sale',
            mutator='setFor_sale',
            widget=atapi.BooleanWidget(
                label=_(u'label_for_sale', default=u'For sale?'),
                description=_(u'description_for_sale',
                              default=u'Is this Publication for sale?'),
            ),
        ),
        ExtendedLinesField(
            'chapters',
            schemata='publication',
            languageIndependent=True,
            accessor='getChapters',
            mutator='setChapters',
            widget=atapi.LinesWidget(
                label=_(u'label_chapters', default=u'Chapters'),
                description=_(
                    u'description_chapters',
                    default=
                    u'Chapters of this Publication. Specify the Link targets defined in your pdf file, one per line.'
                ),
            ),
        ),
        ExtendedFileField(
            'metadata_upload',
            schemata='publication',
            languageIndependent=True,
            accessor='getMetadata_upload',
            mutator='setMetadata_upload',
            widget=atapi.FileWidget(
                label=_(u'label_metadata_upload',
                        default=u'Metadata INI upload'),
                description=_(u'description_metadata_upload',
                              default=u'Upload Metadata in INI style format.'),
            ),
        ),
        ExtendedStringField(
            'owner_password',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_owner_password', default=u'Owner Password'),
                description=_(
                    u'description_owner_password',
                    default=
                    u'If this publication is protected, speciy the pdf owner password if you want to parse the file.'
                ),
            ),
        ),
        ExtendedStringField(
            'user_password',
            schemata='publication',
            languageIndependent=False,
            widget=atapi.StringWidget(
                label=_(u'label_user_password', default=u'User Password'),
                description=_(
                    u'description_user_password',
                    default=
                    u'If this publication is protected, speciy the pdf user password if you want to parse the file.'
                ),
            ),
        ),
    ]

    def __init__(self, context):
        """ init """
        self.context = context
        klass = context.__class__
        if HAVE_LINGUAPLONE and not getattr(
                klass, LANGUAGE_INDEPENDENT_INITIALIZED, False):
            fields = [
                field for field in self._fields if field.languageIndependent
            ]
            generateMethods(klass, fields)
            setattr(klass, LANGUAGE_INDEPENDENT_INITIALIZED, True)

    def getFields(self):
        """ get fields """
        return self._fields

    def getOrder(self, original):
        """ new order """
        publication = original.get('publication', [])

        publication.insert(0, 'author')
        publication.insert(1, 'isbn')
        publication.insert(2, 'order_id')
        publication.insert(3, 'for_sale')
        publication.insert(4, 'chapters')
        publication.insert(5, 'cover_image')
        publication.insert(6, 'metadata_upload')
        publication.insert(7, 'owner_password')
        publication.insert(8, 'user_password')

        original['publication'] = publication

        return original
Пример #23
0
     required=1,
     vocabulary=NamedVocabulary(
         'org.bungeni.metadata.vocabularies.parliamentarytypes'),
     widget=atapi.SelectionWidget(
         label=_('Type'),
         description=_('Choose the applicable document type'),
     ),
 ),
 atapi.LinesField(
     'item_authors',
     required=1,
     multiValued=True,
     searchable=True,
     widget=atapi.LinesWidget(
         label=_('Source'),
         description=_('List the authors/sponsors of this item.'),
         cols=5,
         rows=2,
     )),
 atapi.StringField('publication_number',
                   required=False,
                   searchable=True,
                   widget=atapi.StringWidget(
                       label=_(u"Number"),
                       description=_(u"Publication Number"),
                   )),
 atapi.StringField(
     'item_publisher',
     required=0,
     vocabulary_factory=GROUPS_VOCAB,
     widget=atapi.SelectionWidget(
         label=_('Published By'),
Пример #24
0
                          vocabulary="vocOreInizio",
                          default=""),
             "end_p":
             SelectColumn("Ora fine pomeriggio",
                          vocabulary="vocOreInizio",
                          default=""),
         }),
     required=True,
 ),
 atapi.LinesField(
     'festivi',
     storage=atapi.AnnotationStorage(),
     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"
Пример #25
0
class BlogExtender(object):
    adapts(IBlog)
    implements(ISchemaExtender)

    fields = [
        MyImageField("image",
                     required=True,
                     languageIndependent=True,
                     max_size=(225, 55),
                     sizes={
                         'mini': (200, 200),
                         'thumb': (128, 128),
                         'tile': (64, 64),
                         'icon': (32, 32),
                         'listing': (16, 16),
                     },
                     widget=atapi.ImageWidget(
                         label=_(u'Small image'),
                         description=_(u'Upload your small image here. '),
                         show_content_type=False)),
        MySecondImageField(
            "header_image",
            required=False,
            languageIndependent=True,
            max_size=(870, 150),
            sizes={
                'large': (768, 768),
                'preview': (400, 400),
                'mini': (200, 200),
                'thumb': (128, 128),
                'tile': (64, 64),
                'icon': (32, 32),
                'listing': (16, 16),
            },
            widget=atapi.ImageWidget(
                label=_(u'Header image'),
                description=_(u'Upload the image for the header of your blog'),
                show_content_type=False)),
        MyLinesField(
            "email",
            required=True,
            widget=atapi.LinesWidget(
                label=_(u'E-mail'),
                description=
                _('E-mail addresses where you will receive the replies of your posts. One per line.'
                  ))),
        MyStringField2(
            "feedburner_posts",
            required=False,
            widget=atapi.StringWidget(
                label=_(u"FeedBurner address for your blog posts"),
                description=
                _("If you are using FeedBurner to manage your RSS feeds, enter here the address of your posts' feed"
                  ))),
        MyStringField3(
            "feedburner_comments",
            required=False,
            widget=atapi.StringWidget(
                label=_(u"FeedBurner address for your blog comments"),
                description=
                _("If you are using FeedBurner to manage your RSS feeds, enter here the address of your comments' feed"
                  ))),
    ]

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

    def getFields(self):
        return self.fields
Пример #26
0
                default=u"Choose sources to aggregate newsletter content from."
            ),
        ),
    ),

    atapi.LinesField(
        'salutations',
        default=("mr|Dear Mr.", "ms|Dear Ms.", "default|Dear"),
        schemata='personalization',
        widget=atapi.LinesWidget(
            label=_(
                u'EasyNewsletter_label_salutations',
                default=u"Subscriber Salutations."),
            description=_(
                u"EasyNewsletter_help_salutations",
                default=u'Define here possible salutations for subscriber. \
                    One salutation per line in the form of: \"mr|Dear Mr.\". \
                    The left hand value "mr" or "ms" is mapped to salutation \
                    of each subscriber and then the right hand value, which \
                    you can customize is used as salutation.'),
            i18n_domain='EasyNewsletter',
        ),
    ),

    atapi.StringField(
        'fullname_fallback',
        default="Sir or Madam",
        schemata='personalization',
        widget=atapi.StringWidget(
            label=_(
                u'EasyNewsletter_label_fullname_fallback',
Пример #27
0
import urllib
import urllib2
import re

ExternalPageSchema = document.ATDocumentSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-
    atapi.StringField(
        name='external_urls',
        required=True,
        searchable=False,
        widget=atapi.LinesWidget(
            label=_('external_urls_label', u'External URLs'),
            description=_(
                'external_urls_description',
                u'use URL parameter _art_ext_url_ind to select the external URL, 0 is default [one URL per line]'
            ),
            rows=3,
            cols=100,
        ),
        validators=('areURLs', ),
    ),
    atapi.StringField(
        name='external_encoding',
        required=True,
        default='utf-8',
        searchable=False,
        widget=atapi.StringWidget(
            label=_('external_encoding_label', u'External encoding'),
            description=_('external_encoding_description',
                          u'example values: utf-8, ascii, cp1252, iso-8859-1'),
Пример #28
0
    ),
    atapi.ComputedField('end_date',        
        searchable=1,        
        expression='context._end_date()',       
    ),
    atapi.ComputedField('duration',
        searchable=1,        
        expression='context._duration()',       
    ),


    atapi.LinesField(
        name='agenda',
        widget = atapi.LinesWidget(
            label="Agenda topics",
            description="Add here proposed topics for the meeting.",
            i18n_domain='gcommons.Journal',
        ),
        searchable=True,
    ),


    atapi.ReferenceField('readingList',
        relationship = 'reading',
        multiValued = True,
        keepReferencesOnCopy = True,
        widget = ReferenceBrowserWidget(
            allow_search = True,
            allow_browse = True,
            show_indexes = False,
            force_close_on_insert = False,
Пример #29
0
     storage=atapi.AnnotationStorage(),
     required=False,
     widget=atapi.StringWidget(
         label=_(u'Design'),
         description=_(u'The design type of this protocol.'),
     ),
     predicateURI='http://edrn.nci.nih.gov/rdf/schema.rdf#design',
 ),
 atapi.LinesField(
     'fieldOfResearch',
     storage=atapi.AnnotationStorage(),
     required=False,
     multiValued=True,
     widget=atapi.LinesWidget(
         label=_(u'Fields of Research'),
         description=
         _(u'A list of numeric codes identifying what fields of research the protocol is pursuing.'
           ),
     ),
     predicateURI='http://edrn.nci.nih.gov/rdf/schema.rdf#fieldOfResearch',
 ),
 atapi.StringField(
     'abbrevName',
     storage=atapi.AnnotationStorage(),
     required=False,
     searchable=True,
     widget=atapi.StringWidget(
         label=_(u'Abbreviated Name'),
         description=
         _(u'A shorter and possibly far more convenient name for the protocol.'
           ),
     ),