from . import interfaces try: from archetypes.referencebrowserwidget import ReferenceBrowserWidget ReferenceBrowserWidget # pyflakes except ImportError: # BBB for Plone 3 and earlier. from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \ ReferenceBrowserWidget schema = atapi.Schema((atapi.ReferenceField( name='internal_link', widget=ReferenceBrowserWidget( label=_('Internal_link'), label_msgid='Doormat_label_internal_link', i18n_domain='Doormat', ), relationship="internally_links_to", ), ), ) DoormatReference_schema = atapi.BaseSchema.copy() + \ schema.copy() class DoormatReference(ATCTContent, BrowserDefaultMixin): """ """ security = ClassSecurityInfo() implements(interfaces.IDoormatReference)
ScheduleSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( atapi.TextField( 'body', storage=atapi.AnnotationStorage(), default_output_type='text/x-html-safe', widget=atapi.RichWidget( label=_(u"Body"), rows=20, ), ), atapi.ReferenceField( 'temples', widget=ReferenceBrowserWidget( label=_(u"Related Temples"), allow_browse=1, allow_sorting=1, startup_directory='/temples', ), multiValued=1, relationship="temples_in_pilgrimage", index='KeywordIndex', referencesSortable=1, ), )) # Set storage on fields copied from ATFolderSchema, making sure # they work well with the python bridge properties. ScheduleSchema['title'].storage = atapi.AnnotationStorage() ScheduleSchema['description'].storage = atapi.AnnotationStorage() ScheduleSchema['title'].widget.label = _(u'Schedule Title')
from Products.ATContentTypes import ATCTMessageFactory as _ ATPathCriterionSchema = ATBaseCriterionSchema + Schema(( ReferenceField('value', required=1, mode="rw", write_permission=ChangeTopics, accessor="Value", mutator="setValue", allowed_types_method="getNavTypes", multiValued=True, relationship="paths", widget=ReferenceBrowserWidget( allow_search=1, label=_(u'label_path_criteria_value', default=u'Folders'), description=_(u'help_path_criteria_value', default=u'Folders to search in.'), base_query={'is_folderish':True}, restrict_browse=True, startup_directory='../') ), BooleanField('recurse', mode="rw", write_permission=ChangeTopics, accessor="Recurse", default=False, widget=BooleanWidget( label=_(u'label_path_criteria_recurse', default=u'Search Sub-Folders'), description='', ), ), ))
label='Description', label_msgid='label_description', )), OrderableReferenceField( 'references', languageIndependent=1, required=0, allowed_types=(), multiValued=1, relationship='references', widget=ReferenceBrowserWidget( allow_browse=1, allow_search=1, allow_sorting=1, description='Select one or more remote objects', description_msgid='help_references', i18n_domain='plonegazette', label='References', label_msgid='label_references', show_indexes=0, )), )) class NewsletterReference(BaseContent, PropertyManager): portal_type = meta_type = 'NewsletterReference' archetype_name = 'Newsletter Reference' # this name appears in the 'add' box schema = NewsletterReferenceSchema security = ClassSecurityInfo()
atapi.StringField('role', enforceVocabulary=True, vocabulary='getSelectableRoles', required=True, default='', widget=SelectionWidget(label='Role', format='select', description='The role to be granted',), ), atapi.ReferenceField('context', relationship='rolerequest_for_context', allowed_types=(), vocabulary_display_path_bound=0, required=True, widget=ReferenceBrowserWidget(label='Context', description='The context to grant the role for', startup_directory='/',), ), atapi.TextField('motivation', required=True, widget=TextAreaWidget(label='Motivation', description='Motivation of this request', allow_browse=True), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. RoleRequestSchema['title'].storage = atapi.AnnotationStorage()
'date', default_method=DateTime, widget=CalendarWidget(label='Date', visible={'edit': 'invisible'}), ), # o DefaultReferenceField e' um ReferenceField com suporte a default_method DefaultReferenceField( 'doctor', required=1, relationship='doctor', allowed_types=('Doctor', ), vocabulary_custom_label='b.Title', default_method='getDefaultDoctor', widget=ReferenceBrowserWidget( label=_('Provider'), startup_directory='Doctors', restrict_browsing_to_startup_directory=True, ), ), DateTimeField( 'dateOfVisit', default_method=DateTime, index="DateIndex:schema", widget=CalendarWidget( label=_('Date of Encounter'), show_hm=False, format='%d.%m.%Y', ), ), StringField( 'medicalNote',
class SlideshowExtender(object): adapts(IATDocument) implements(ISchemaExtender, IBrowserLayerAwareExtender) layer = IUOLImagesThemeLayer fields = [ ExReferenceField('slideshow_gallery', schemata='slideshow', relationship='relatesToGallery', multiValued=True, write_permission=ModifyPortalContent, allowed_types=("Gallery", ), keepReferencesOnCopy=True, storage=AnnotationStorage(), widget=ReferenceBrowserWidget( allow_search=True, allow_browse=True, show_indexes=False, force_close_on_insert=True, label=u'Slideshow gallery', ) ), ExIntegerField('image_count', schemata='slideshow', required=True, default=0, write_permission = ModifyPortalContent, languageIndependent=True, storage=AnnotationStorage(), widget=StringWidget( description='Enter 0 for all images', label=u'Number of images to show' ) ), ExBooleanField('show_captions', default=True, schemata='slideshow', widget = BooleanWidget( label="Show image captions" ) ), ExIntegerField('time_delay', schemata='slideshow', required=True, default=2, write_permission = ModifyPortalContent, languageIndependent=True, storage=AnnotationStorage(), widget=StringWidget( description='', label=u'Time delay in seconds' ) ), ExStringField('scale', schemata='slideshow', required=True, default='preview', write_permission = ModifyPortalContent, languageIndependent=True, vocabulary_factory="uniofleicester.jsimages.imagesscalevocabulary", enforceVocabulary=1, storage=AnnotationStorage(), widget=SelectionWidget( description='', label=u'Image scale to display' ) ), ] def __init__(self, context): self.context = context def getFields(self): return self.fields
widget=atapi.StringWidget( label=_(u"Campaign FROM name"), description=_(u"Custom Mailchimp FROM name for this campaign"), ), ), atapi.ReferenceField('campaign_items', relationship='campaignItems', multiValued=True, languageIndependent=False, widget=ReferenceBrowserWidget( allow_search=True, allow_browse=True, allow_sorting=True, show_indexes=False, force_close_on_insert=True, label=_(u'label_campaign_items', default=u'Campaign\'s items'), description='', visible={ 'edit': 'visible', 'view': 'invisible' }, )), )) # Set storage on fields copied from ATFolderSchema, making sure # they work well with the python bridge properties. CampaignSchema['title'].storage = atapi.AnnotationStorage() CampaignSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(CampaignSchema,
u"Leave empty to disable it."))), atapi.BooleanField('toclinks', schemata='default', default=False, widget=atapi.BooleanWidget( label=_(u"Table of contents links"), description=_(u"Enable table of contents links"))), atapi.ReferenceField( 'imagescollection', relationship='imagescollectionrel', multiValued=0, allowed_types=('Collection', 'ATTopic', 'Folder'), widget=ReferenceBrowserWidget( allow_search=True, allow_browse=True, 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(
description= _(u"Enter as many population and employment values as needed. Intermediate values will be calculated automatically." ), columns={ 'year': Column(_(u"Year"), default='2010'), 'pop': Column(_(u"Population"), default='0'), 'emp': Column(_(u"Employment"), default='0'), }), required=True, ), atapi.ReferenceField( 'zone', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"Effective Zone"), description= _(u"Select a subregional map defining the effective modeling zone." ), startup_directory='/luc/projections/subregional'), relationship='projection_zone', allowed_types=('SimMap', ), multiValued=False, required=True, ), atapi.ReferenceField( 'pop_density', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"Population Density"), description=_(u"A GIS layer defining the new population density."), startup_directory='/luc/projections/density', ),
description='', description_msgid='ftw_help_text', i18n_domain='ftw.tagging', rows=15, rooted=True, ), ), atapi.ReferenceField( name='categories', required=False, widget=ReferenceBrowserWidget( label=_('Categories'), allow_browse=False, show_results_without_query=True, restrict_browsing_to_startup_directory=True, base_query={ "portal_type": "BlogCategory", "sort_on": "sortable_title" }, macro='category_reference_widget', ), multiValued=1, schemata='default', relationship='blog_categories', allowed_types=['BlogCategory'], ), atapi.BooleanField( name='showImages', required=False, default=True, schemata='default',
from xml.etree.ElementTree import Element, SubElement, tostring, fromstring import json import logging log = logging.getLogger(__name__) LUCScenarioSchema = folder.ATFolderSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.ReferenceField( 'growth', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=0, startup_directory='/luc/projections', label=_(u"Growth Projections"), description=_(u"Identify one or more growth projection."), ), required=False, relationship='lucscenario_growth', allowed_types=('Projection'), multiValued=True, ), atapi.ReferenceField( 'growthmap', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=0, startup_directory='/luc/drivers',
from izug.refegovservice.config import PROJECTNAME from izug.refegovservice.interfaces import IRefEgovService from Products.Archetypes import atapi from Products.ATContentTypes.content import schemata from Products.ATContentTypes.content.base import ATCTContent from zope.interface import implements schema = atapi.Schema(( atapi.ReferenceField( 'referencedService', required=True, relationship='pointstoservice', allowed_types=('EgovLeistung', ), widget=ReferenceBrowserWidget( label='Service Referenz', default_search_index='Title' ), ), ), ) RefEgovServiceSchema = schemata.ATContentTypeSchema.copy() + schema.copy() RefEgovServiceSchema['description'].widget.visible = -1 schemata.finalizeATCTSchema(RefEgovServiceSchema, folderish=0) class RefEgovService(ATCTContent): """ """
default_output_type='text/x-html-safe', widget=atapi.RichWidget( label=_(u'label_text_after', default=u'Text after the table'), visible={'view': 'invisible', 'edit': 'visible'}, rows=25, allow_file_upload=zconf.ATDocument.allow_document_upload), ), atapi.ReferenceField('attachmentStorage', allowed_types=('Folder',), relationship="tablepage_storage", widget=ReferenceBrowserWidget(label=_(u"Attachment storage"), description=_('attachmentStorage_help', default=u"Select the folder where users will be able to store attachments for " u"attachment-like columns (if any).\n" u"Users must be able to add new contents on that folder; if not, they " u"will be only able to select existings items.\n" u"If not provided, the folder containing this document will be used."), force_close_on_insert=True, visible={'view': 'invisible', 'edit': 'visible'}, ), ), atapi.BooleanField('downloadEnabled', required=False, searchable=False, schemata="settings", widget=atapi.BooleanWidget( label=_(u'Show download link for data'), description=_('help_download_enabled', default=u'Display a download link for data inside the table in CSV format'), ),
'image', primary=True, expression="""context.getPrimaryValue('image', 'attachedImage', '')""", widget=ComputedWidget( label='Image', label_msgid='label_image', i18n_domain='plonearticle', ), ), ReferenceField( 'referencedContent', relationship='article_image', keepReferencesOnCopy=True, widget=ReferenceBrowserWidget( label='Referenced image', label_msgid='label_referenced_image', i18n_domain='plonearticle', ), ), ImageField( 'attachedImage', attached_content=True, widget=ImageWidget( label='Attached image', label_msgid='label_attached_image', i18n_domain='plonearticle', ), ), )) ImageInnerContentProxySchema['title'].required = False
"Select this to activate the dashboard as a default front page." )), ), ReferenceField( 'LandingPage', schemata="Analyses", multiValued=0, allowed_types=('Document', ), relationship='SetupLandingPage', widget=ReferenceBrowserWidget( label=_("Landing Page"), description= _("The selected landing page is displayed for non-authenticated users " "and if the Dashboard is not selected as the default front page. " "If no landing page is selected, the default Bika frontpage is displayed." ), allow_search=1, allow_browse=1, startup_directory='/', force_close_on_insert=1, default_search_index='SearchableText', base_query={'review_state': 'published'}, ), ), StringField( 'AutoPrintStickers', schemata="Stickers", vocabulary=STICKER_AUTO_OPTIONS, widget=SelectionWidget( format='select', label=_("Automatic sticker printing"), description=
# -*- Message Factory Imported Here -*- from leam.stress import stressMessageFactory as _ from leam.stress.interfaces import IStressAnalysis from leam.luc.interfaces import IModel from leam.stress.config import PROJECTNAME StressAnalysisSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.ReferenceField( 'layer', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"GIS Layer"), description=_( u"A GIS layer with the environmentally sensitive areas."), startup_directory='/luc/impacts/stress-analysis/es-zones', ), required=True, relationship='stressanalysis_layer', allowed_types=('SimMap', ), multiValued=True, ), atapi.ReferenceField( 'scenario', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"LUC Scenario"), description= _(u"An existing LUC Scenario with it's associated probability maps." ),
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""), ), required=True, relationship='probmap_tdm', allowed_types=('SimMap'), multiValued=False, ), atapi.IntegerField( 'trans_w', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Transportation Weight"), description=_(u"Weight for transportation. From 0.5 to 5"),
), atapi.TextField( 'remark', storage=atapi.AnnotationStorage(), default_output_type='text/x-html-safe', widget=atapi.RichWidget( label=_(u"Remark"), description=_(u"Enter Text."), ), ), atapi.ReferenceField( 'r_temples', widget=ReferenceBrowserWidget( label=_(u"Related Temples"), force_close_on_insert=1, allow_browse=1, allow_sorting=1, startup_directory='/temples/KinmenCounty', ), multiValued=1, relationship="temple_bixiewu", index='KeywordIndex', referencesSortable=1, ), atapi.StringField( 'village', storage=atapi.AnnotationStorage(), widget=atapi.StringWidget( label=_(u"Village Name"), description=_(u"Enter Village."), ),