from Products.EEAContentTypes.config import PROJECTNAME from Products.EEAContentTypes.content.ExternalHighlight import ExternalHighlight from Products.EEAContentTypes.content.ExternalHighlight import schema as \ ExtHighlightSchema from Products.EEAContentTypes.content.interfaces import IExternalHighlight from Products.EEAContentTypes.content.quotation import quotation_schema from Products.EEAContentTypes.content.validators import ExistsKeyFactsValidator from zope.interface import implements from eea.themecentre.interfaces import IThemeTagging schema = Schema((), ) Highlight_schema = getattr(ATNewsItem, 'schema', Schema(())).copy() + \ getattr(ExternalHighlight, 'schema', Schema(())).copy() + \ quotation_schema.copy() + \ schema.copy() # put all the external highlights fields into their own schema ExternalHighlightSchema = ExtHighlightSchema.copy() fields2Move2DefaultSchemata = ['management_plan'] for fieldname in getNames(ExternalHighlightSchema): field = Highlight_schema[fieldname] if fieldname in fields2Move2DefaultSchemata: field.schemata = 'default' elif field.schemata != 'metadata': field.schemata = 'Front Page' Highlight_schema['text'].required = True validators = Highlight_schema['text'].validators validators.appendRequired(ExistsKeyFactsValidator('existsKeyFacts'))
ThisAuthorTrailingSchema['editor_flag'].widget.description='Leave this checked unless the people specified above are not the editors of this proceedings volume.' ThisAuthorTrailingSchema['editor_flag'].widget.description_msgid='help_editor_flag_checked' ThisAuthorTrailingSchema['editor_flag'].mode='r' SourceSchema = Schema(( publisherField, addressField, 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)
languageIndependent=1, required=1, ), ) ) ##code-section after-local-schema #fill in your manual code here schema["hebergementsConcernes"].widget.table = "hebergement" schema["hebergementsConcernes"].widget.unique_column = "heb_pk" schema["hebergementsConcernes"].widget.default_columns = "heb_nom" schema["hebergementsConcernes"].widget.viewable_columns = {"heb_nom": "Nom"} schema["hebergementsConcernes"].languageIndependent = True ##/code-section after-local-schema DerniereMinute_schema = BaseSchema.copy() + schema.copy() ##code-section after-schema #fill in your manual code here DerniereMinute_schema = ATFolder.schema.copy() + schema.copy() DerniereMinute_schema["description"].widget.visible = {"view": "invisible", "edit": "invisible"} ##/code-section after-schema class DerniereMinute(ATFolder): """ """ security = ClassSecurityInfo() implements(IDerniereMinute) __implements__ = getattr(ATFolder, "__implements__", ())
ThisAuthorTrailingSchema[ 'editor_flag'].widget.description_msgid = 'help_editor_flag_checked' ThisAuthorTrailingSchema['editor_flag'].mode = 'r' SourceSchema = Schema(( publisherField, addressField, 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. """
searchable=1, required=0, vocabulary="PreprintServers", widget=SelectionWidget( label="Preprint server", label_msgid="label_preprint_server", description="If the preprint is available from one of the following preprint servers, you can indicate that here. Contact the site's admin if you want a server to be added to the list.", description_msgid="help_preprint_server", i18n_domain="cmfbibliographyat", ), ), ) ) PreprintSchema = ( HeaderSchema.copy() + AuthorSchema.copy() + CoreSchema.copy() + SourceSchema.copy() + TrailingSchema.copy() ) # the default AT 'description' field shall be invisible, it is kept in sync with the 'abstract' field PreprintSchema.get("description").widget.visible = {"view": "invisible", "edit": "invisible"} finalizeATCTSchema(PreprintSchema) class PreprintReference(BaseEntry): """ content type to make reference to a preprint """ implements(IPreprintReference) security = ClassSecurityInfo()
label="Themes", description="Choose max 3 themes", label_msgid='EEAContentTypes_label_themes', description_msgid='EEAContentTypes_help_themes', i18n_domain='EEAContentTypes', ), languageIndependent=True, vocabulary='_getMergedThemes', index="KeywordIndex:brains", enforceVocabulary=1, default=[], accessor='getThemes', mutator='setThemes', ), ), ) ThemeTaggable_schema = schema.copy() class ThemeTaggable(BaseContent): """ Theme Taggable Content-Type """ implements(IThemeTaggable) security = ClassSecurityInfo() allowed_content_types = [] _at_rename_after_creation = True schema = ThemeTaggable_schema # Methods def getThemes(self):
from Products.CMFBibliographyAT.content.fields \ import publisherField, addressField, editionField, volumeField, \ numberField, seriesField, editor_flagField, isbnField AuthorTrailingSchema = Schema((editor_flagField, )) SourceSchema = Schema(( publisherField, addressField, editionField, volumeField, numberField, seriesField, isbnField, )) BookSchema = HeaderSchema.copy() + AuthorSchema.copy() + AuthorTrailingSchema.copy() + \ CoreSchema.copy() + SourceSchema.copy() + TrailingSchema.copy() BookSchema.get('authors').required = 1 BookSchema.get('publication_year').required = 1 BookSchema.get('publisher').required = 1 # the default AT 'description' field shall be invisible, it is kept in # sync with the 'abstract' field BookSchema.get('description').widget.visible = { 'view': 'invisible', 'edit': 'invisible', } finalizeATCTSchema(BookSchema)
show_content_type=False) ), StringField( name='url', widget=StringWidget( label='Url', label_msgid='EEAContentTypes_label_url', i18n_domain='EEAContentTypes', ) ), )) Promotion_schema = getattr(ATNewsItem, 'schema', Schema(())).copy() + \ getattr(ThemeTaggable, 'schema', Schema(())).copy() + \ schema.copy() Promotion_schema['allowDiscussion'].schemata = 'metadata' Promotion_schema['relatedItems'].schemata = 'metadata' Promotion_schema['text'].schemata = 'metadata' class Promotion(ATNewsItem, ThemeTaggable): """ Promotion """ security = ClassSecurityInfo() implements(IExternalPromotion) # This name appears in the 'add' box archetype_name = 'Promotion'
widget=ChosenWidget( description="""Critères à choisir par l'utilisateur""", label='User Criteria', label_msgid='gites_core_package_usercriteria_label', description_msgid='gites_core_packages_usercriteria_description', i18n_domain='gites', )) ), ) ##code-section after-local-schema #fill in your manual code here ##/code-section after-local-schema ##code-section after-schema #fill in your manual code here Package_schema = folder.ATFolderSchema + schema.copy() Package_schema['location'].widget.visible = False Package_schema.changeSchemataForField('startDate', 'dates') Package_schema.changeSchemataForField('endDate', 'dates') class Package(ATFolder): """ """ security = ClassSecurityInfo() implements(IPackage, IBaseFolder, IBaseObject, IReferenceable, IContentish, IMonetMapsEnabledContent) # This name appears in the 'add' box archetype_name = 'Package'
AuthorTrailingSchema = Schema(( editor_flagField, )) SourceSchema = Schema(( publisherField, addressField, editionField, volumeField, numberField, seriesField, isbnField, )) BookSchema = HeaderSchema.copy() + AuthorSchema.copy() + AuthorTrailingSchema.copy() + \ CoreSchema.copy() + SourceSchema.copy() + TrailingSchema.copy() BookSchema.get('authors').required = 1 BookSchema.get('publication_year').required = 1 BookSchema.get('publisher').required = 1 # the default AT 'description' field shall be invisible, it is kept in # sync with the 'abstract' field BookSchema.get('description').widget.visible = {'view': 'invisible', 'edit': 'invisible', } finalizeATCTSchema(BookSchema) class BookReference(BaseEntry): """ content type to make reference to a book.
i18n_domain='EEAContentTypes', ), languageIndependent=True, vocabulary='_getMergedThemes', index="KeywordIndex:brains", enforceVocabulary=1, default=[], accessor='getThemes', mutator='setThemes', ), ), ) ThemeTaggable_schema = schema.copy() class ThemeTaggable(BaseContent): """ Theme Taggable Content-Type """ implements(IThemeTaggable) security = ClassSecurityInfo() allowed_content_types = [] _at_rename_after_creation = True schema = ThemeTaggable_schema # Methods def getThemes(self):