def finalizeArticleSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['title'].widget.description = _(u"Article title.") schema['description'].storage = atapi.AnnotationStorage() schema['description'].required = True schema['description'].widget.label = _('Abstract') schema['description'].widget.description = _('A short summary of your article.') schema['subject'].storage = atapi.AnnotationStorage() #schema['subject'].widget.label = _('Keywords') #schema['subject'].widget.description = _('Please select among the existing keywords or add new ones to describe the subjects of your article.') schema['subject'].widget = AjaxKeywordsWidget( label=_('Keywords'), description=('Please select among the existing keywords or add new ones to describe the subjects of your article. Use semicolon or press ENTER to add a tag.') ) # Reorder schema.moveField('description', after=RelatorsMixin.lastField) schema.moveField('subject', after='description') # Hide this fields for field in ('effectiveDate', 'expirationDate', 'allowDiscussion'): schema[field].widget.visible = {'edit': 'invisible', 'view': 'invisible'} # Call ATContentTypes schemata.finalizeATCTSchema( schema, folderish=True, moveDiscussion=False ) # Fix after ATContentTypes schema.changeSchemataForField('subject', 'default') return schema
def finalizeJournalSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['title'].widget.label = 'Name' schema['title'].widget.description = 'Type the name of the Journal' schema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(schema,folderish=True,moveDiscussion=False) return schema
def finalizeConferenceSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['description'].storage = atapi.AnnotationStorage() schema['description'].required = True schema['description'].widget.label = _('Abstract') schema['description'].widget.description = _('A short summary of your article.') schema['subject'].storage = atapi.AnnotationStorage() schema['subject'].widget.label = _('Keywords') schema['subject'].widget.description = _('Please select among the existing keywords or add new ones to describe the subjects of your submission.') # Hide this fields for field in ('effectiveDate', 'expirationDate',): schema[field].widget.visible = {'edit': 'invisible', 'view': 'invisible'} # Call ATContentTypes schemata.finalizeATCTSchema( schema, folderish=True, moveDiscussion=False ) # Fix after ATContentTypes # Reorder schema.moveField('description', before='specialRequirements') schema.moveField('subject', after='description') # Schematas schema.changeSchemataForField('subject', 'default') return schema
def finalizeDraftSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['description'].storage = atapi.AnnotationStorage() schema['description'].widget.label = "Comments" schema['description'].widget.description = "Additional notes about this specific draft, such as known problems or issues fixed" schemata.finalizeATCTSchema(schema, moveDiscussion=False) return schema
def finalize_simplelayout_schema(schema, folderish=False, moveDiscussion=True): finalizeATCTSchema(schema,folderish,moveDiscussion) # Categorization if schema.has_key('subject'): schema.changeSchemataForField('subject', 'settings') if schema.has_key('relatedItems'): schema.changeSchemataForField('relatedItems', 'settings') if schema.has_key('location'): schema.changeSchemataForField('location', 'settings') schema['location'].widget.visible = -1 if schema.has_key('language'): schema.changeSchemataForField('language', 'settings') schema['language'].widget.visible = -1 # Dates if schema.has_key('effectiveDate'): schema.changeSchemataForField('effectiveDate', 'default') if schema.has_key('expirationDate'): schema.changeSchemataForField('expirationDate', 'default') if schema.has_key('creation_date'): schema.changeSchemataForField('creation_date', 'settings') if schema.has_key('modification_date'): schema.changeSchemataForField('modification_date', 'settings') # Ownership if schema.has_key('creators'): schema.changeSchemataForField('creators', 'settings') if schema.has_key('contributors'): schema.changeSchemataForField('contributors', 'settings') schema['contributors'].widget.visible = -1 if schema.has_key('rights'): schema.changeSchemataForField('rights', 'settings') schema['rights'].widget.visible = -1 # Settings if schema.has_key('allowDiscussion'): schema.changeSchemataForField('allowDiscussion', 'settings') if schema.has_key('excludeFromNav'): schema.changeSchemataForField('excludeFromNav', 'settings') if schema.has_key('nextPreviousEnabled'): schema.changeSchemataForField('nextPreviousEnabled', 'settings') schema['nextPreviousEnabled'].widget.visible = -1 marshall_register(schema) #set permissions for settings schemata settings_fields = [schema[key] for key in schema.keys() if schema[key].schemata == 'settings'] for field in settings_fields: field.write_permission = ManagePortal return schema
def finalizeConferenceEventSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['description'].storage = atapi.AnnotationStorage() # Call ATContentTypes schemata.finalizeATCTSchema( schema, folderish=True, moveDiscussion=False ) return schema
def finalizeConferenceSchema(schema): schema["title"].storage = atapi.AnnotationStorage() schema["description"].storage = atapi.AnnotationStorage() # Call ATContentTypes schemata.finalizeATCTSchema(schema, folderish=True, moveDiscussion=False) # finalizeATCTSchema moves 'location' into 'categories', we move it back to default schema.changeSchemataForField("location", "default") schema.moveField("location", before="startDate") return schema
def finalizegcPersonSchema(Schema): Schema["title"].storage = atapi.AnnotationStorage() Schema["description"].storage = atapi.AnnotationStorage() # Hide this fields for field in ("effectiveDate", "expirationDate", "allowDiscussion", "description", "excludeFromNav"): Schema[field].widget.visible = {"edit": "invisible", "view": "invisible"} schemata.finalizeATCTSchema(Schema, moveDiscussion=False) Schema.changeSchemataForField("description", "metadata") return Schema
def finalizegcPersonSchema(Schema): Schema['title'].storage = atapi.AnnotationStorage() Schema['description'].storage = atapi.AnnotationStorage() # Hide this fields for field in ('effectiveDate', 'expirationDate', 'allowDiscussion', 'description', 'excludeFromNav'): Schema[field].widget.visible = {'edit': 'invisible', 'view': 'invisible'} schemata.finalizeATCTSchema(Schema, moveDiscussion=False) Schema.changeSchemataForField('description', 'metadata') return Schema
def finalizeEditorsMeetingSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['description'].storage = atapi.AnnotationStorage() # Call ATContentTypes schemata.finalizeATCTSchema( schema, folderish=True, moveDiscussion=False ) # finalizeATCTSchema moves 'location' into 'categories', we move it back to default schema.changeSchemataForField('location', 'default') schema.moveField('location', before='startDate') return schema
def finalizeFieldSchema(schema, folderish=True, moveDiscussion=False): """ cleanup typical field schema """ finalizeATCTSchema(schema, folderish=True, moveDiscussion=False) # avoid showing unnecessary schema tabs for afield in ('subject', 'relatedItems', 'location', 'language', 'effectiveDate', 'expirationDate', 'creation_date', 'modification_date', 'creators', 'contributors', 'rights', 'allowDiscussion', 'excludeFromNav',): schema[afield].widget.visible = {'view': 'invisible', 'edit': 'invisible'} schema[afield].schemata = 'default'
def finalizeFieldSchema(schema, folderish=True, moveDiscussion=False): """ cleanup typical field schema """ finalizeATCTSchema(schema, folderish=True, moveDiscussion=False) if HAS_PLONE30: # avoid showing unnecessary schema tabs for afield in ( "subject", "relatedItems", "location", "language", "effectiveDate", "expirationDate", "creation_date", "modification_date", "creators", "contributors", "rights", "allowDiscussion", "excludeFromNav", ): schema[afield].widget.visible = {"view": "invisible", "edit": "invisible"} schema[afield].schemata = "default"
widget=StringWidget(label=_(u'label_execcondition_text', default=u"Execution Condition"), description=_(u'help_execcondition_text', default=u""" A TALES expression that will be evaluated to determine whether or not to execute this action. Leave empty if unneeded, and the action will be executed. Your expression should evaluate as a boolean; return True if you wish the action to execute. PLEASE NOTE: errors in the evaluation of this expression will cause an error on form display. """), size=70, ), ), )) finalizeATCTSchema(FormAdapterSchema, folderish=True, moveDiscussion=False) # avoid showing unnecessary schema tabs for afield in ('description', 'subject', 'relatedItems', 'location', 'language', 'effectiveDate', 'expirationDate', 'creation_date', 'modification_date', 'creators', 'contributors', 'rights', 'allowDiscussion',
from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata # -*- Message Factory Imported Here -*- from pcp.contenttypes.interfaces import IServiceComponentRequest from pcp.contenttypes.config import PROJECTNAME ServiceComponentRequestSchema = schemata.ATContentTypeSchema.copy( ) + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- )) schemata.finalizeATCTSchema(ServiceComponentRequestSchema, moveDiscussion=False) class ServiceComponentRequest(base.ATCTContent): """A project requests a specific service component""" implements(IServiceComponentRequest) meta_type = "ServiceComponentRequest" schema = ServiceComponentRequestSchema atapi.registerType(ServiceComponentRequest, PROJECTNAME)
FAQSchema['description'].widget = \ TextAreaWidget( description='More details on the question, if not evident from the '\ 'title.', description_msgid="help_detailed_question", label="Detailed Question", label_msgid="label_detailed_question", rows=5, i18n_domain="plonehelpcenter", ) FAQSchema['text'].widget.label = "Answer" FAQSchema['text'].widget.label_msgid = "label_answer" FAQSchema['text'].widget.i18n_domain = "plonehelpcenter" finalizeATCTSchema(FAQSchema, folderish=False, moveDiscussion=False) class HelpCenterFAQ(ATDocumentBase, PHCContentMixin): """A Frequently Asked Question defines a common question with an answer - this is a place to document answers to common questions, not ask them. """ content_icon = 'faq_icon.gif' schema = FAQSchema archetype_name = 'FAQ' meta_type = 'HelpCenterFAQ' typeDescription = 'A Frequently Asked Question defines a common question '\ 'with an answer - this is a place to document answers '\
description='Please enter longitude.', visible={ 'view': 'visible', 'edit': 'visible' }, ), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. VenueSchema['title'].storage = atapi.AnnotationStorage() VenueSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(VenueSchema, moveDiscussion=False) class Venue(base.ATCTContent): """Venue Description""" implements(IVenue) meta_type = "Venue" schema = VenueSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') # -*- Your ATSchema to Python Property Bridges Here ... -*-
'title': _('All'), 'contentFilter': {}, 'columns': ['Title', 'Description'] }, ] def folderitems(self): items = BikaListingView.folderitems(self) for x in range(len(items)): if not items[x].has_key('obj'): continue obj = items[x]['obj'] items[x]['Description'] = obj.Description() items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \ (items[x]['url'], items[x]['Title']) return items schema = ATFolderSchema.copy() class ProductCategories(ATFolder): implements(IProductCategories) displayContentsTab = False schema = schema schemata.finalizeATCTSchema(schema, folderish=True, moveDiscussion=False) atapi.registerType(ProductCategories, PROJECTNAME)
), # attachment FileField( 'xppm_artifact_attachment', widget=FileWidget( label="Attachment", description="You may upload a file here:", ), storage=AttributeStorage(), schemata='Metadata', ), )) # finalize the schema. finalizeATCTSchema(PPMArtifactSchema) # set the description field invisible. PPMArtifactSchema['description'].widget.visible = False # the class. class PPMArtifact(XPPMBase, ATFolder, HistoryAwareMixin): schema = PPMArtifactSchema meta_type = "PPMArtifact" portal_type = "PPMArtifact" archetypes_type = "PPMArtifact" __implements__ = (
relationship='opportunity program', multiValued=0, vocabulary_display_path_bound=-1, ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. OpportunitySchema['title'].storage = atapi.AnnotationStorage() OpportunitySchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(OpportunitySchema, moveDiscussion=False) class Opportunity(base.ATCTContent): """EJN Opportunity""" implements(IOpportunity) meta_type = "Opportunity" schema = OpportunitySchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') atapi.registerType(Opportunity, PROJECTNAME)
__author__ = """WebLion <*****@*****.**>""" __docformat__ = 'plaintext' from AccessControl import ClassSecurityInfo from Products.Archetypes.atapi import * from Products.ATContentTypes.content.base import ATCTContent from Products.ATContentTypes.content.schemata import ATContentTypeSchema, finalizeATCTSchema from Products.FacultyStaffDirectory.config import * from Products.FacultyStaffDirectory.interfaces.specialtiesfolder import ISpecialtiesFolder from zope.interface import implements schema = ATContentTypeSchema.copy() + Schema((), ) SpecialtiesFolder_schema = OrderedBaseFolderSchema.copy() + schema.copy() finalizeATCTSchema(SpecialtiesFolder_schema, folderish=True) class SpecialtiesFolder(OrderedBaseFolder, ATCTContent): """ """ security = ClassSecurityInfo() implements(ISpecialtiesFolder) meta_type = portal_type = 'FSDSpecialtiesFolder' # moved schema setting after finalizeATCTSchema, so the order of the fieldsets # is preserved. Also after updateActions is called since it seems to overwrite the schema changes. # Move the description field, but not in Plone 2.5 since it's already in the metadata tab. Although, # decription and relateditems are occasionally showing up in the "default" schemata. Move them # to "metadata" just to be safe. if 'categorization' in SpecialtiesFolder_schema.getSchemataNames():
from Products.Archetypes import atapi from Products.ATContentTypes.content import document from Products.ATContentTypes.content.schemata import finalizeATCTSchema from collective.portletpage.interfaces import IPortletPage from collective.portletpage.config import PROJECTNAME PortletPageSchema = document.ATDocumentSchema.copy() PortletPageSchema['title'].storage = atapi.AnnotationStorage() PortletPageSchema['title'].required = False PortletPageSchema['description'].storage = atapi.AnnotationStorage() PortletPageSchema['text'].storage = atapi.AnnotationStorage() finalizeATCTSchema(PortletPageSchema) class PortletPage(document.ATDocument): """A page with some body text and a list of portlets. """ implements(IPortletPage) portal_type = "Portlet Page" _at_rename_after_creation = True schema = PortletPageSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') text = atapi.ATFieldProperty('text')
# owner of this task.??? select from membership. # getToolByName(self, 'portal_membership') LinesField( 'xptask_owners', index='KeywordIndex:schema', searchable=False, required=False, vocabulary='vocabulary_developers', widget=InAndOutWidget( label='Task Owner(s)', descrpiton="Please select owners for this task", ), ), ), ) finalizeATCTSchema(XPointTaskSchema) # set the description field to invisible, we are not going to use it # for a task. XPointTaskSchema['description'].widget.visible = False # the content type class. class XPointTask(ATFolder): """The ATConentType class for a XPointTask. """ schema = XPointTaskSchema # type name and defination meta_type = 'XPointTask'
'howtoapply', storage=atapi.AnnotationStorage(), widget=atapi.RichWidget( label=_(u"How to Apply"), description=_(u""), ), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. ClassifiedJobSchema['title'].storage = atapi.AnnotationStorage() ClassifiedJobSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(ClassifiedJobSchema, moveDiscussion=False) class ClassifiedJob(base.ATCTContent): """A Classified Job Post""" implements(IClassifiedJob) meta_type = "ClassifiedJob" schema = ClassifiedJobSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') # -*- Your ATSchema to Python Property Bridges Here ... -*- positiondescription = atapi.ATFieldProperty('positiondescription')
from AccessControl import ClassSecurityInfo from Products.Archetypes import atapi from Products.ATContentTypes.content import schemata from plone.app.blob.content import ATBlob from plone.app.blob.interfaces import IATBlobFile from Products.ATContentTypes.interfaces import IATFile, IFileContent # -*- Message Factory Imported Here -*- from mj.agenda import agendaMessageFactory as _ from mj.agenda.interfaces.interfaces import IMJFileEvento from mj.agenda.config import PROJECTNAME MJFileEventoSchema = ATBlob.schema.copy() schemata.finalizeATCTSchema(MJFileEventoSchema, moveDiscussion=False) class MJFileEvento(ATBlob): """ """ implements(IMJFileEvento, IATBlobFile, IATFile, IFileContent) meta_type = "MJFileEvento" portal_type = 'MJFileEvento' schema = MJFileEventoSchema security = ClassSecurityInfo()
required=0, searchable=True, default_content_type="text/html", default_output_type="text/x-html-safe", widget=atapi.RichWidget(label=u'Body Text', rows=20, allow_file_upload=True)), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. MemberProfileSchema['title'].storage = atapi.AnnotationStorage() MemberProfileSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(MemberProfileSchema, moveDiscussion=False) MemberProfileSchema['title'].widget.label = u'Surname' MemberProfileSchema.moveField('description', before='body_text') class MemberProfile(base.ATCTContent): """Member Profile""" implements(IMemberProfile) meta_type = "MemberProfile" schema = MemberProfileSchema security = ClassSecurityInfo() security.declareProtected(View, 'tag')
) ), )) for field in ('creators', 'contributors', 'rights', 'subject', 'language', 'location', 'allowDiscussion'): if ShowcaseImageSchema.has_key(field): ShowcaseImageSchema[field].widget.visible = 0 ShowcaseImageSchema.changeSchemataForField('x', 'settings') ShowcaseImageSchema.changeSchemataForField('y', 'settings') ShowcaseImageSchema.changeSchemataForField('clipWidth', 'settings') ShowcaseImageSchema.changeSchemataForField('clipHeight', 'settings') ShowcaseImageSchema.changeSchemataForField('clipLeft', 'settings') ShowcaseImageSchema.changeSchemataForField('clipTop', 'settings') finalizeATCTSchema(ShowcaseImageSchema, folderish=True, moveDiscussion=True) class ShowcaseImage (ATImage): """ A ShowcaseImage """ implements(IShowcaseImage) portal_type = meta_type = "ShowcaseImage" schema = ShowcaseImageSchema _at_rename_after_creation = True security = ClassSecurityInfo() security.declareProtected(View, 'tag') def tag(self, **kwargs):
'icon' : (32, 32), 'listing' : (16, 16), }, validators = (('isNonEmptyFile', V_REQUIRED), ('checkImageMaxSize', V_REQUIRED)), widget = atapi.ImageWidget( description = '', label= _(u'label_image', default=u'Image'), show_content_type = False,) ), )) VideoSchema['title'].storage = atapi.AnnotationStorage() VideoSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(VideoSchema, folderish=False, moveDiscussion=True) class Video(file.ATFile): """A video file""" implements(IVideo) portal_type = "Video" schema = VideoSchema security = ClassSecurityInfo() title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') security.declareProtected(View, 'tag') def tag(self, **kwargs):
label=_(u'label_news_image', default=u'Image'), show_content_type=False)), StringField('imageCaption', required=False, searchable=True, widget=StringWidget(description='', label=_(u'label_image_caption', default=u'Image Caption'), size=40)), ), marshall=RFC822Marshaller()) ATNewsItemSchema['description'].widget.label = \ _(u'label_summary', default=u'Summary') finalizeATCTSchema(ATNewsItemSchema) class ATNewsItem(ATDocumentBase, ATCTImageTransform): """An announcement that will show up on the news portlet and in the news listing.""" schema = ATNewsItemSchema portal_type = 'News Item' archetype_name = 'News Item' _atct_newTypeFor = { 'portal_type': 'CMF News Item', 'meta_type': 'News Item' } assocMimetypes = () assocFileExt = ('news', )
)) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. SitemapSchema['id'].widget.ignore_visible_ids = True SitemapSchema['title'].storage = atapi.AnnotationStorage() SitemapSchema['title'].required = False SitemapSchema['title'].widget.visible = {'edit': 'invisible', 'view': 'invisible'} SitemapSchema['description'].storage = atapi.AnnotationStorage() SitemapSchema['description'].widget.visible = {'edit': 'invisible', 'view': 'invisible'} schemata.finalizeATCTSchema(SitemapSchema, moveDiscussion=False) SitemapSchema['relatedItems'].schemata = 'metadata' SitemapSchema['relatedItems'].widget.visible = {'edit': 'invisible', 'view': 'invisible'} class Sitemap(base.ATCTContent): """Search engine Sitemap content type""" implements(ISitemap) portal_type = "Sitemap" schema = SitemapSchema #title = atapi.ATFieldProperty('title') #description = atapi.ATFieldProperty('description')
searchable = False, required = True, default = ('Income:ConsultingIncome', 'Income:ServiceIncome', 'Expense:Gas', 'Expense:Parking', 'Expense:Lunch', 'Expense:Internet', 'Expense:OfficeSupply' ), widget = LinesWidget( label = 'Transaction Categories', description = 'Please specify the transaction categories, one per line', cols = 40, ), ), ) ) finalizeATCTSchema(BKFolderSchema) # customizing the schema here, set visible of some fields, location of # some fields. BKFolderSchema.changeSchemataForField('bk_unique_sequence', 'settings') # define the class class BKFolder(ATBTreeFolder): """ This is the base folder for all bookkeeping transactions: income and expense. """ schema = BKFolderSchema __implements__ = (ATBTreeFolder.__implements__)
def finalizeSpecialIssueSchema(schema): schema['title'].storage = atapi.AnnotationStorage() schema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(schema, folderish=True, moveDiscussion=False) return schema
allow_browse=True, show_indexes=False, allow_sorting=1, show_path=1, force_close_on_insert=True, base_query={'portal_type': 'ActionItem'}, label=_(u'label_action_items', default=u'Action Items'), description='', visible={ 'edit': 'visible', 'view': 'invisible' })))) schemata.finalizeATCTSchema(ActionListSchema, folderish=False, moveDiscussion=False) class ActionList(atapi.BaseContent): """Component of an EUDAT service""" implements(IActionList) meta_type = "ActionList" schema = ActionListSchema _at_rename_after_creation = True def createPOI(self, target_path): """ ActionList to Poi """
storage=atapi.AnnotationStorage(), widget=atapi.BooleanWidget( label=_(u"Redevelopment"), description=_(u"Check box to allow redevelopment."), ), default=False, ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. ProjectionSchema['title'].storage = atapi.AnnotationStorage() ProjectionSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(ProjectionSchema, moveDiscussion=False) class Projection(base.ATCTContent): """A population and employment projection used within the LEAM model""" implements(IProjection) meta_type = "Projection" schema = ProjectionSchema security = ClassSecurityInfo() title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') # -*- Your ATSchema to Python Property Bridges Here ... -*- projection = atapi.ATFieldProperty('projection')
from Products.Archetypes.atapi import LinesField from Products.Archetypes.atapi import LinesWidget from Products.Archetypes.atapi import TextField from Products.Archetypes.atapi import RichWidget from Products.ATContentTypes.content.schemata import ATContentTypeSchema from Products.ATContentTypes.configuration import zconf from Products.ATContentTypes.content.schemata import finalizeATCTSchema from Products.PloneGlossary.utils import PloneGlossaryMessageFactory as _ # PloneGlossary schema PloneGlossarySchema = ATContentTypeSchema.copy() PloneGlossarySchema['description'].schemata = 'default' finalizeATCTSchema(PloneGlossarySchema, folderish=True) # PloneGlossaryDefinition schema PloneGlossaryDefinitionSchema = ATContentTypeSchema.copy() + Schema(( StringField( 'title', required=True, searchable=True, default='', accessor='Title', widget=StringWidget(label=_(u'label_glossary_term', default=u"Term"), description=_( u'help_glossary_term', default=u"Enter the term to be defined."), visible={'view': 'invisible'}), ),
ImageField('category_image', widget=ImageWidget(label='Category image', description='', label_msgid='label_category_image', description_msgid='help_category_image', i18n_domain='plone', ), sizes={ 'icon':(16,16)}, ), ), marshall=PrimaryFieldMarshaller(), ) finalizeATCTSchema(COREBlogCategorySchema) class COREBlogCategory(ATCTFolder): """ Category class for coreblog2 """ schema = COREBlogCategorySchema meta_type = 'COREBlogCategory' typeDescMsgId = 'coreblog2_description_coreblog2category' implements(IATFolder) # INonStructuralFolder # Not to be shown at add item menu global_allow = False
accessor='getShowDescription', widget=atapi.BooleanWidget( label=_(u'label_show_description', default='Show description')), default=1), )) CollageSchema = CollageSchema + CommonCollageSchema.copy() # move description to main edit page CollageSchema['description'].schemata = 'default' # support show in navigation feature and at marshalling # speciel case set folderish to False since we want related items to be used finalizeATCTSchema(CollageSchema, folderish=False, moveDiscussion=False) class Collage(LayoutContainer, ATCTMixin, atapi.OrderedBaseFolder): # FIXME: Do we always need Zope 2 style interfaces ? __implements__ = (getattr(atapi.OrderedBaseFolder,'__implements__',()), getattr(ATCTMixin, '__implements__',())) schema = CollageSchema _at_rename_after_creation = True security = ClassSecurityInfo() implements(ICollage, INonStructuralFolder)
'showControls', storage=atapi.AnnotationStorage(), widget=atapi.BooleanWidget( label=_(u"Show controls"), description=_(u"Field description"), ), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. HomeBoxSchema['title'].storage = atapi.AnnotationStorage() HomeBoxSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(HomeBoxSchema, moveDiscussion=False) class HomeBox(folder.ATFolder): """Description of the Example Type""" implements(IHomeBox) meta_type = "HomeBox" schema = HomeBoxSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') text = atapi.ATFieldProperty('text') style = atapi.ATFieldProperty('style') resource = atapi.ATReferenceFieldProperty('resource')
default=('Title', 'Creator', 'Type', 'ModificationDate'), vocabulary='listMetaDataFields', enforceVocabulary=True, write_permission=ModifyPortalContent, widget=InAndOutWidget( label=_(u'Table Columns'), description=_( u"Select which fields to display when " u"'Tabular view' is selected in the display menu.") ), ), )) schemata.finalizeATCTSchema( QuerySchema, folderish=False, moveDiscussion=False) class AnalysisRequestQuery(Collection): """ Query form and results for Analysis Requests """ implements(IAnalysisRequestQuery) meta_type = "AnalysisRequestQuery" schema = QuerySchema security = ClassSecurityInfo() security.declareProtected(View, 'listMetaDataFields')
default=u"Execution Condition"), description=_(u'help_execcondition_text', default=u""" A TALES expression that will be evaluated to determine whether or not to execute this action. Leave empty if unneeded, and the action will be executed. Your expression should evaluate as a boolean; return True if you wish the action to execute. PLEASE NOTE: errors in the evaluation of this expression will cause an error on form display. """), size=70, ), ), )) finalizeATCTSchema(FormAdapterSchema, folderish=True, moveDiscussion=False) # avoid showing unnecessary schema tabs for afield in ( 'description', 'subject', 'relatedItems', 'location', 'language', 'effectiveDate', 'expirationDate', 'creation_date', 'modification_date', 'creators', 'contributors', 'rights',
StringField( name='customCSS', widget=TextAreaWidget( label=_(u"label_custom_css", u'Custom CSS'), #label_msgid='label_custom_css', description=_(u"help_custom_css", u"You can define custom CSS for this contentpanels " u"here. Leave it blank if you don't know about CSS."), #description_msgid='help_custom_css', i18n_domain='contentpanels', ), ), )) schemata.finalizeATCTSchema(ContentPanelsSchema, moveDiscussion=False) class ContentPanels(base.ATCTContent): """ContentPanels is a composite page build system.""" implements(IContentPanels) schema = ContentPanelsSchema archetype_name = 'ContentPanels' meta_type = 'CMF Content Panels' security = ClassSecurityInfo() _at_rename_after_creation = True def __init__(self, oid, **kw): BaseContent.__init__(self, oid, **kw)
schemata="Email Invite", required=0, searchable=0, widget=StringWidget( label=_("label_invite_from_email", default=u"Email Invite From"), description=_( "help_invite_from_email", default=u"Enter person's email address that the survey invite " u"email is from." ), ), ), )) finalizeATCTSchema(SurveySchema, moveDiscussion=False) SurveySchema["description"].widget.label = _("label_description", default=u"Survey description") SurveySchema["description"].widget.description = _( "help_description", default=u"Add a short description of the survey here.") del SurveySchema["relatedItems"] SubSurveySchema = ATContentTypeSchema.copy() + Schema(( StringField( 'requiredQuestion', schemata="Branching", searchable=0, required=0, vocabulary='getValidationQuestions',
ATLinkSchema = ATContentTypeSchema.copy() + Schema(( StringField('remoteUrl', required=True, searchable=True, primary=True, default="http://", # either mailto, absolute url or relative url validators=(), widget=StringWidget( description='', label=_(u'label_url', default=u'URL'), maxlength='511', )), )) finalizeATCTSchema(ATLinkSchema) class ATLink(ATCTContent): """A link to an internal or external resource.""" schema = ATLinkSchema portal_type = 'Link' archetype_name = 'Link' _atct_newTypeFor = {'portal_type': 'CMF Link', 'meta_type': 'Link'} assocMimetypes = () assocFileExt = ('link', 'url', ) cmf_edit_kws = ('remote_url', ) implements(IATLink)
), ), ), marshall=atapi.RFC822Marshaller()) # Repurpose the subject field for the event type ATEventSchema.moveField('subject', before='eventUrl') ATEventSchema['subject'].write_permission = ModifyPortalContent ATEventSchema['subject'].widget.size = 6 ATEventSchema.changeSchemataForField('subject', 'default') ATEventSchema.changeSchemataForField('timezone', 'dates') ATEventSchema.moveField('timezone', before='effectiveDate') finalizeATCTSchema(ATEventSchema) # finalizeATCTSchema moves 'location' into 'categories', we move it back: ATEventSchema.changeSchemataForField('location', 'default') ATEventSchema.moveField('location', before='attendees') class ATEvent(ATCTContent, HistoryAwareMixin): """Information about an upcoming event, which can be displayed in the calendar. """ implements(IATEvent, IATEventRecurrence) schema = ATEventSchema security = ClassSecurityInfo() portal_type = archetype_name = 'Event'
"view": "invisible" } CriacaoSchema['allowDiscussion'].widget.visible = { "edit": "invisible", "view": "invisible" } CriacaoSchema['excludeFromNav'].widget.visible = { "edit": "invisible", "view": "invisible" } CriacaoSchema['relatedItems'].widget.visible = { "edit": "invisible", "view": "invisible" } schemata.finalizeATCTSchema(CriacaoSchema, moveDiscussion=False) class Criacao(base.ATCTContent): """''""" implements(ICriacao) meta_type = "Criacao" schema = CriacaoSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') def getListaCriacao(self): """ Retorna a lista de membros presentes no grupo """
visible={ 'view': 'hidden', 'edit': 'hidden' }, ), validators=('isValidDate'), ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. StressAnalysisSchema['title'].storage = atapi.AnnotationStorage() StressAnalysisSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(StressAnalysisSchema, moveDiscussion=False) class StressAnalysis(base.ATCTContent): """Frontend to the LEAM Stress Analysis Model""" implements(IStressAnalysis, IModel) meta_type = "StressAnalysis" schema = StressAnalysisSchema security = ClassSecurityInfo() title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') # -*- Your ATSchema to Python Property Bridges Here ... -*-
ATLinkSchema = ATContentTypeSchema.copy() + Schema(( StringField( 'remoteUrl', required=True, searchable=True, primary=True, default="http://", # either mailto, absolute url or relative url validators=(), widget=StringWidget( description='', label=_(u'label_url', default=u'URL'), maxlength='511', )), )) finalizeATCTSchema(ATLinkSchema) class ATLink(ATCTContent): """A link to an internal or external resource.""" schema = ATLinkSchema portal_type = 'Link' archetype_name = 'Link' _atct_newTypeFor = {'portal_type': 'CMF Link', 'meta_type': 'Link'} assocMimetypes = () assocFileExt = ( 'link', 'url', )
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, folderish=False, moveDiscussion=False ) class Campaign(ATCTContent): """Monkey campaign""" implements(ICampaign) meta_type = "Campaign" schema = CampaignSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') @property
from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata # -*- Message Factory Imported Here -*- from pcp.contenttypes.interfaces import IRegisteredServiceComponent from pcp.contenttypes.config import PROJECTNAME RegisteredServiceComponentSchema = schemata.ATContentTypeSchema.copy( ) + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- )) schemata.finalizeATCTSchema(RegisteredServiceComponentSchema, moveDiscussion=False) class RegisteredServiceComponent(base.ATCTContent): """A CDI admin registers a new service component""" implements(IRegisteredServiceComponent) meta_type = "RegisteredServiceComponent" schema = RegisteredServiceComponentSchema atapi.registerType(RegisteredServiceComponent, PROJECTNAME)
from Products import ATContentTypes from Products.ATContentTypes.content.schemata import finalizeATCTSchema from schemata import HelpCenterItemSchemaNarrow from PHCContent import PHCContentMixin from Products.PloneHelpCenter.config import * from Products.PloneHelpCenter.interfaces import IHelpCenterNavRoot, IHelpCenterContent import re IMG_PATTERN = re.compile(r"""(\<img .*?)src="([^/]+?)"(.*?\>)""", re.IGNORECASE | re.DOTALL) ReferenceManualSchema = ATContentTypes.content.folder.ATFolderSchema.copy() + HelpCenterItemSchemaNarrow if GLOBAL_RIGHTS: del ReferenceManualSchema['rights'] finalizeATCTSchema(ReferenceManualSchema, folderish=True, moveDiscussion=False) ReferenceManualSchema['nextPreviousEnabled'].defaultMethod = None ReferenceManualSchema['nextPreviousEnabled'].default = True class HelpCenterReferenceManual(ATContentTypes.content.folder.ATFolder, PHCContentMixin): """A reference manual containing ReferenceManualPages, ReferenceManualSections, Files and Images. """ implements(IHelpCenterNavRoot) schema = ReferenceManualSchema archetype_name = 'Reference Manual' security = ClassSecurityInfo()
from Products.ATContentTypes.content.newsitem import ATNewsItem from Products.ATContentTypes.content.schemata import finalizeATCTSchema from vindula.blog.config import * from vindula.blog.content.interfaces import IAuthor author_schema = ATNewsItem.schema.copy() + Schema(()) # Change field 'description' descriptionField = author_schema['description'] descriptionField.widget.description = 'Texto que descreve brevemente sobre quem é o autor.' invisivel = { 'view': 'invisible', 'edit': 'invisible', } author_schema['image'].widget.visible = invisivel author_schema['imageCaption'].widget.visible = invisivel finalizeATCTSchema(author_schema, moveDiscussion=True) class Author(ATNewsItem): """ Object Author """ implements(IAuthor) portal_type = 'Author' _at_rename_after_creation = True schema = author_schema registerType(Author, PROJECTNAME)
from weka.content import contentMessageFactory as _ from weka.content.interfaces import IFeatureFolder from weka.content.config import PROJECTNAME FeatureFolderSchema = folder.ATFolderSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- )) # Set storage on fields copied from ATFolderSchema, making sure # they work well with the python bridge properties. FeatureFolderSchema['title'].storage = atapi.AnnotationStorage() FeatureFolderSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(FeatureFolderSchema, folderish=True, moveDiscussion=False) class FeatureFolder(folder.ATFolder): """A folder holding recommendations or features""" implements(IFeatureFolder) portal_type = "Feature Folder" schema = FeatureFolderSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') atapi.registerType(FeatureFolder, PROJECTNAME)
atapi.TextField('item_abstract', required=0, searchable=True, default_content_type="text/html", default_output_type="text/x-html-safe", widget=atapi.RichWidget( label=_('Abstract'), rows=20, allow_file_upload=True)), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. #RepositoryItemSchema['title'].storage = atapi.AnnotationStorage() #RepositoryItemSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(RepositoryItemSchema, moveDiscussion=False) #hide the description - we use abstract RepositoryItemSchema['description'].widget.visible = { "edit": "invisible", "view": "invisible" } class RepositoryItem(base.ATCTContent): """Repository Item""" implements(IRepositoryItem) meta_type = "RepositoryItem" schema = RepositoryItemSchema
volumeField, numberField, organizationField, seriesField, isbnField, )) ProceedingsSchema = HeaderSchema.copy() + AuthorSchema.copy() + ThisAuthorTrailingSchema.copy() + \ CoreSchema.copy() + SourceSchema.copy() + TrailingSchema.copy() ProceedingsSchema.get('authors').required = 0 ProceedingsSchema.get('publication_year').required = 1 # the default AT 'description' field shall be invisible, it is kept in sync with the 'abstract' field ProceedingsSchema.get('description').widget.visible = {'view': 'invisible', 'edit': 'invisible', } finalizeATCTSchema(ProceedingsSchema) class ProceedingsReference(BaseEntry): """ content type to make reference to a book. """ implements(IProceedingsReference) security = ClassSecurityInfo() archetype_name = "Proceedings Reference" source_fields = ('publisher', 'address', 'volume', 'number', 'organization', 'series', 'isbn',) schema = ProceedingsSchema security.declareProtected(View, 'Source')
description='Please Choose The Event Type ', format="radio", ), vocabulary=[ "ISS Event", "ISS Co-Sponsored Event", "UCD Community Event" ]), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. IssEventSchema['title'].storage = atapi.AnnotationStorage() IssEventSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(IssEventSchema, moveDiscussion=False) # finalizeATCTSchema moves 'location' into 'categories', we move it back: # IssEventSchema.changeSchemataForField('location', 'default') IssEventSchema.moveField('eventimage', before='startDate') IssEventSchema.moveField('eventimagetitle', after='eventimage') IssEventSchema.moveField('eventroom', after='text') IssEventSchema.moveField('building', after='eventroom') #Hide the lodation Field since we're not using it locationField = IssEventSchema['location'] locationField.widget.visible = {'edit': 'hidden', 'view': 'invisible'} class IssEvent(base.ATCTContent): """Event for ISS website""" implements(IIssEvent)
)) GroupSpecialistSchema['title'].widget.label = 'Group Specialist Title' GroupSpecialistSchema['title'].widget.description = 'Group Specialists can be any group who specializes in helping. (Tutors, Graduate Students, Writing Center Experts, etc...)' GroupSpecialistSchema['description'].widget.description = 'This is shown as a ToolTip over the Image.' GroupSpecialistSchema['title'].storage = atapi.AnnotationStorage() GroupSpecialistSchema['description'].storage = atapi.AnnotationStorage() GroupSpecialistSchema['listUsers'].storage = atapi.AnnotationStorage() GroupSpecialistSchema['imageReference'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(GroupSpecialistSchema, moveDiscussion=False) class GroupSpecialist(base.ATCTContent): """ @author: David Hietpas @version: 1.1 """ implements(IGroupSpecialist) meta_type = "GroupSpecialist" schema = GroupSpecialistSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description')
widget=StringWidget(description='', label=_(u'label_contact_phone', default=u'Contact Phone'))), ), marshall=RFC822Marshaller( )) # Repurpose the subject field for the event type ATEventSchema.moveField('subject', before='eventUrl') ATEventSchema['subject'].write_permission = ModifyPortalContent ATEventSchema['subject'].widget.label = _(u'label_event_type', default=u'Event Type(s)') ATEventSchema['subject'].widget.size = 6 ATEventSchema.changeSchemataForField('subject', 'default') finalizeATCTSchema(ATEventSchema) # finalizeATCTSchema moves 'location' into 'categories', we move it back: ATEventSchema.changeSchemataForField('location', 'default') ATEventSchema.moveField('location', before='startDate') @implementer(IATEvent) class ATEvent(ATCTContent, CalendarSupportMixin, HistoryAwareMixin): """Information about an upcoming event. This can be displayed in the calendar. """ schema = ATEventSchema portal_type = 'Event'
vocabulary=NOTIFICATION, required=True, widget=atapi.SelectionWidget( label=_("Notification type"), description=_("Please select how we should notify your company."), size=30 ), ), )) schemata.finalizeATCTSchema( CompanySchema, folderish=True, moveDiscussion=False ) CompanySchema['subject'].widget.visible['view'] = 'invisible' CompanySchema['subject'].widget.visible['edit'] = 'invisible' CompanySchema['location'].widget.visible['view'] = 'invisible' CompanySchema['location'].widget.visible['edit'] = 'invisible' CompanySchema['language'].widget.visible['view'] = 'invisible' CompanySchema['language'].widget.visible['edit'] = 'invisible' CompanySchema['allowDiscussion'].widget.visible['view'] = 'invisible' CompanySchema['allowDiscussion'].widget.visible['edit'] = 'invisible' CompanySchema['contributors'].widget.visible['view'] = 'invisible' CompanySchema['contributors'].widget.visible['edit'] = 'invisible' CompanySchema['creators'].widget.visible['view'] = 'invisible' CompanySchema['creators'].widget.visible['edit'] = 'invisible'
MiPagoAdapterSchema.changeSchemataForField('recipient_email', 'email') MiPagoAdapterSchema.changeSchemataForField('msg_subject', 'email') MiPagoAdapterSchema.changeSchemataForField('body_pre', 'email') MiPagoAdapterSchema.changeSchemataForField('body_post', 'email') MiPagoAdapterSchema.changeSchemataForField('body_footer', 'email') MiPagoAdapterSchema.changeSchemataForField('showAll', 'email') MiPagoAdapterSchema.changeSchemataForField('showFields', 'email') MiPagoAdapterSchema.changeSchemataForField('includeEmpties', 'email') MiPagoAdapterSchema.changeSchemataForField('body_pt', 'email') MiPagoAdapterSchema.changeSchemataForField('body_type', 'email') MiPagoAdapterSchema.moveField('to_field', before='recipient_email') MiPagoAdapterSchema.moveField('execCondition', pos='bottom') schemata.finalizeATCTSchema(MiPagoAdapterSchema, moveDiscussion=False) class InvalidReferenceNumber(Exception): pass class MiPagoAdapter(FormMailerAdapter): """Adapter for payments with MiPago""" implements(IMiPagoAdapter) meta_type = "MiPagoAdapter" schema = MiPagoAdapterSchema # title = atapi.ATFieldProperty('title') # description = atapi.ATFieldProperty('description')
description=_(u"Default active at map start"), ), ), )) # Set storage on fields copied from ATFolderSchema, making sure # they work well with the python bridge properties. TTGoogleMapCategorySchema['title'].storage = atapi.AnnotationStorage() TTGoogleMapCategorySchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema( TTGoogleMapCategorySchema, folderish=True, moveDiscussion=False ) def markers_cachekey(method, self, **args): """ Returns the key used by @ram.cache """ # get ram cache seconds property ptool = getToolByName(self, 'portal_properties') sheet = getToolByName(ptool, PROPERTY_SHEET) ram_cache_seconds = sheet.getProperty(PROPERTY_MARKERS_CACHE, 1) # if ram_cache_seconds is 0 sets it to 0.001 for division if not ram_cache_seconds: ram_cache_seconds = 0.001
label=_(u"How to Apply"), description=_(u""), ), required=True, ), )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. TransferJobSchema['title'].storage = atapi.AnnotationStorage() TransferJobSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema(TransferJobSchema, moveDiscussion=False) class TransferJob(base.ATCTContent): """Content type for a Transfer Position""" implements(ITransferJob) meta_type = "TransferJob" schema = TransferJobSchema title = atapi.ATFieldProperty('title') description = atapi.ATFieldProperty('description') # -*- Your ATSchema to Python Property Bridges Here ... -*- positiondescription = atapi.ATFieldProperty('positiondescription')