primary=True, validators=(('isNonEmptyFile', V_REQUIRED), ('checkFileMaxSize', V_REQUIRED)), widget=FileWidget( description="Select the file to be added by " "clicking the 'Browse' button.", description_msgid="help_file", label="File", label_msgid="label_file", i18n_domain="plone", show_content_type=False, )), ), ) FactSheetDocument_schema = ATFileSchema.copy() + \ getattr(ATFile, 'schema', Schema(())).copy() + \ schema.copy() FactSheetDocument_schema['description'].required = False FactSheetDocument_schema['relatedItems'].widget.visible = \ {'view':'invisible', 'edit':'invisible'} class FactSheetDocument(ATFile, BrowserDefaultMixin): """FactSheet Document """ implements(interfaces.IFactSheetDocument) meta_type = 'FactSheetDocument' schema = FactSheetDocument_schema
from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from Products.ATContentTypes.content.file import ATFile, ATFileSchema from Products.CMFCore import permissions # -*- Message Factory Imported Here -*- from uniba.bandilavoro.interfaces import IRettifica from uniba.bandilavoro.config import PROJECTNAME from uniba.bandilavoro import bandiMessageFactory as _ from zope.interface import implements from zope.component import getMultiAdapter, getUtility # eredito lo schema del tipo File classico RettificaSchema = ATFileSchema.copy() + atapi.Schema(( atapi.LinesField('rettificapercampi', required=True, searchable=True, multiValued=True, vocabulary='getCampiDaRettificare', widget = atapi.MultiSelectionWidget( label = _(u'label_rettifica_rettificapercampi', default=u'Campi da rettificare'), description = _(u'desc_rettifica_rettificapercampi', default=u'Selezionare almeno un campo'), size = 10, )), )) # Set storage on fields copied from ATContentTypeSchema, making sure
from Products.ATContentTypes.content.file import ATFileSchema from Products.PloneConfContentTypes.config import * ##code-section module-header #fill in your manual code here ##/code-section module-header schema = Schema(( ), ) ##code-section after-local-schema #fill in your manual code here ##/code-section after-local-schema PloneConfFile_schema = ATFileSchema.copy() + \ schema.copy() ##code-section after-schema #fill in your manual code here ##/code-section after-schema class PloneConfFile(ATFile): """ """ security = ClassSecurityInfo() implements(interfaces.IPloneConfFile) meta_type = 'PloneConfFile' _at_rename_after_creation = True
from plone.app.blob.content import ATBlob from plone.app.blob.content import ATBlobSchema # only required for migration from iw.fss to plone.app.blob try: from iw.fss.FileSystemStorage import FileSystemStorage HAS_FSS = True except ImportError: HAS_FSS = False from unimr.red5.protectedvod.interface import IRed5Stream from unimr.red5.protectedvod.permissions import DownloadRed5Stream from unimr.red5.protectedvod.config import PROJECTNAME if HAS_FSS: Red5StreamSchema = ATFileSchema.copy() file_field = Red5StreamSchema['file'] file_field.read_permission = DownloadRed5Stream file_field.storage = FileSystemStorage() file_field.registerLayer('storage', file_field.storage) else: Red5StreamSchema = ATBlobSchema.copy() finalizeATCTSchema(Red5StreamSchema) class Red5Stream(ATBlob): """ video/audio content for streaming by red5 server """ implements(IRed5Stream) portal_type = 'Red5Stream' archetype_name = 'Red5Stream'
from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from Products.ATContentTypes.content.file import ATFileSchema from Products.ATContentTypes.content.image import ATImageSchema from Products.ATContentTypes.lib.imagetransform import ATCTImageTransform from collective.flowplayer.interfaces import IFlowPlayable from redturtle.video import videoMessageFactory as _ from redturtle.video.interfaces import IRTInternalVideo from redturtle.video.config import PROJECTNAME from redturtle.video.content.default import DefaultVideo from redturtle.video.content.video_schema import VIDEO_SCHEMA RTInternalVideoSchema = ATFileSchema.copy() + VIDEO_SCHEMA.copy() # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. RTInternalVideoSchema['title'].storage = atapi.AnnotationStorage() RTInternalVideoSchema['title'].required = True RTInternalVideoSchema['description'].storage = atapi.AnnotationStorage() RTInternalVideoSchema['file'].searchable = False #RTInternalVideoSchema['file'].index_method = '_at_accessor' imageField = ATImageSchema['image'].copy() imageField.required = False imageField.primary = False imageField.widget.description = _( u'help_video_image',
from plone.app.blob.content import ATBlob from plone.app.blob.content import ATBlobSchema # only required for migration from iw.fss to plone.app.blob try: from iw.fss.FileSystemStorage import FileSystemStorage HAS_FSS = True except ImportError: HAS_FSS = False from unimr.red5.protectedvod.interface import IRed5Stream from unimr.red5.protectedvod.permissions import DownloadRed5Stream from unimr.red5.protectedvod.config import PROJECTNAME if HAS_FSS: Red5StreamSchema = ATFileSchema.copy() file_field = Red5StreamSchema['file'] file_field.read_permission = DownloadRed5Stream file_field.storage = FileSystemStorage() file_field.registerLayer('storage', file_field.storage) else: Red5StreamSchema = ATBlobSchema.copy() finalizeATCTSchema(Red5StreamSchema) class Red5Stream(ATBlob): """ video/audio content for streaming by red5 server """ implements(IRed5Stream) portal_type = 'Red5Stream'
from Products.ATContentTypes.content.file import ATFile, ATFileSchema from Products.ATContentTypes.content.image import ATImage, ATImageSchema from Products.ATContentTypes.content.newsitem import ATNewsItem, \ ATNewsItemSchema from Products.ATContentTypes import ATCTMessageFactory as _ from Products.validation import V_REQUIRED from Products.ATContentTypes.config import PROJECTNAME from Products.ATContentTypes.configuration import zconf from Products.ATContentTypes.content.base import registerATCT from collective.contentfiles2aws.fields import AWSFileField, AWSImageField from collective.contentfiles2aws.widgets import AWSFileWidget, AWSImageWidget from collective.contentfiles2aws.storage import AWSStorage ATFileSchema = ATFileSchema.copy() ATFileSchema['file'] = \ AWSFileField('file', required=True, primary=True, searchable=True, languageIndependent=True, storage = AWSStorage(), validators = (('isNonEmptyFile', V_REQUIRED), ('checkFileMaxSize', V_REQUIRED)), widget = AWSFileWidget( description = '', label=_(u'label_file', default=u'File'), show_content_type = False,)) ATFile.schema = ATFileSchema
from AccessControl import ClassSecurityInfo from Products.CMFCore.permissions import ModifyPortalContent from zope.interface import implements, directlyProvides from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from Products.ATContentTypes.content.file import ATFile, ATFileSchema from Products.Archetypes.public import StringField, StringWidget from nrbc.literature import literatureMessageFactory as _ from nrbc.literature.interfaces import ILiterature from nrbc.literature.config import PROJECTNAME LiteratureSchema = schemata.ATContentTypeSchema.copy() + ATFileSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( name='authors', #storage = atapi.AnnotationStorage(), required=True, searchable=1, #default='', #schemata ='default', widget=atapi.StringWidget( label=_(u"Authors"), description=_(u"The authors of the given piece of literature"), maxlength = 1000, size = 50,
TextField( name='extractedText', widget=TextAreaWidget( label='Extractedtext', label_msgid='PloneMeeting_label_extractedText', i18n_domain='PloneMeeting', ), ), ), ) ##code-section after-local-schema #fill in your manual code here ##/code-section after-local-schema MeetingFile_schema = ATFileSchema.copy() + \ schema.copy() ##code-section after-schema #fill in your manual code here # Integrate potential extensions from PloneMeeting sub-products from Products.PloneMeeting.model.extender import ModelExtender MeetingFile_schema = ModelExtender(MeetingFile_schema, 'file').run() # Register the marshaller for DAV/XML export. MeetingFile_schema.registerLayer('marshall', MeetingFileMarshaller()) ##/code-section after-schema class MeetingFile(ATFile, BrowserDefaultMixin): """ """ security = ClassSecurityInfo()
from Products.ATContentTypes.content import schemata from plone.app.blob.field import BlobField, ImageField # -*- Message Factory Imported Here -*- from mj.agenda import agendaMessageFactory as _ from mj.agenda.interfaces.interfaces import IMJEvento from mj.agenda.config import PROJECTNAME ATFileSchema['file'].primary = False ATFileSchema['file'].schemata = 'Arquivo' ATFileSchema['file'].required = False MJEventoSchema = ATEventSchema.copy() + ATFileSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( name='event_categoria', required=False, searchable=True, schemata='categorization', widget=atapi.SelectionWidget( label=_(u"Categoria do evento"), description=_(u"Selecione a categoria do evento"), format='select',), vocabulary='getCategoria', ), ))
label="Notes", label_msgid='ILOProjectEvaluation_label_proj_eval_notes', i18n_domain='ILOProjectEvaluation', ), searchable=1, ), copied_fields['file'], ), ) ##code-section after-local-schema #fill in your manual code here ##/code-section after-local-schema Project_schema = ATFileSchema.copy() + \ schema.copy() ##code-section after-schema #fill in your manual code here ##/code-section after-schema class Project(ATFile): """ """ security = ClassSecurityInfo() implements(interfaces.IProject) meta_type = 'Project' _at_rename_after_creation = True
Created on 07.11.2011 @author: peterm ''' from Products.ATContentTypes.content import schemata from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \ ReferenceBrowserWidget from Products.Archetypes import atapi from Products.SimpleReference import SimpleReferenceMessageFactory as _ from Products.SimpleReference.config import PROJECTNAME from Products.SimpleReference.interfaces import IFileReference from zope.interface import implements from Products.ATContentTypes.content.file import ATFile, ATFileSchema FileReferenceSchema = ATFileSchema.copy() + atapi.Schema(( atapi.ReferenceField("file", title=_(u"File Reference"), relationship='file_reference', allowed_types=('File',), required=True, primary=True, languageIndependent=True, keepReferencesOnCopy=True, widget=ReferenceBrowserWidget, ), )) FileReferenceSchema['title'].storage = atapi.AnnotationStorage()
from Products.ATContentTypes.content import schemata from plone.app.blob.field import BlobField, ImageField # -*- Message Factory Imported Here -*- from mj.agenda import agendaMessageFactory as _ from mj.agenda.interfaces.interfaces import IMJEvento from mj.agenda.config import PROJECTNAME ATFileSchema['file'].primary = False ATFileSchema['file'].schemata = 'Arquivo' ATFileSchema['file'].required = False MJEventoSchema = ATEventSchema.copy() + ATFileSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( name='event_categoria', required=False, searchable=True, schemata='categorization', widget=atapi.SelectionWidget( label=_(u"Categoria do evento"), description=_(u"Selecione a categoria do evento"), format='select', ), vocabulary='getCategoria', ), ))
# No multilingual support from Products.Archetypes.public import * # ATCT imports from Products.ATContentTypes.content.base import ATCTFileContent from Products.ATContentTypes.content.file import ATFileSchema, ATFile # PloneExFile imports from Products.AttachmentField.AttachmentField import AttachmentField from Products.AttachmentField.AttachmentWidget import AttachmentWidget from Products.PloneExFile.interfaces import IExFile from Products.PloneExFile.config import PROJECTNAME from Products.PloneExFile import Permissions PloneExFileSchema = ATFileSchema.copy() + Schema(( AttachmentField( 'file', primary=True, searchable=True, required=True, languageIndependent=True, widget=AttachmentWidget( label="File", label_msgid="label_file", description="Select the file to be added by clicking the 'Browse' button.", description_msgid="help_file", i18n_domain="plone", show_content_type=False, ), ),
try: from Products.CMFCore import CMFCorePermissions as permissions except ImportError: from Products.CMFCore import permissions from Products.CMFCore.utils import getToolByName from Products.Archetypes.atapi import Schema, registerType from Products.Archetypes.atapi import IntegerField, StringField from Products.Archetypes.atapi import StringWidget, SelectionWidget, IntegerWidget from Products.ATContentTypes.content.file import ATFile, ATFileSchema from Products.PromoEngine.content.basead import BaseAd, BaseAdSchema from Products.PromoEngine.config import PROJECTNAME, SCALE_LIST from Products.PromoEngine.swfHeaderData import analyseContent FlashAdSchema = BaseAdSchema.copy() + ATFileSchema.copy() schema = FlashAdSchema + Schema(( IntegerField( 'scale', required = True, default = 100, validators = ('isInt'), vocabulary = SCALE_LIST, widget=SelectionWidget( label = 'Scale', description = 'Scale of the flash movie.', ), ), StringField(
primary=True, validators=(('isNonEmptyFile', V_REQUIRED), ('checkFileMaxSize', V_REQUIRED)), widget=FileWidget( description="Select the file to be added by " "clicking the 'Browse' button.", description_msgid="help_file", label="File", label_msgid="label_file", i18n_domain="plone", show_content_type=False,)), ), ) FactSheetDocument_schema = ATFileSchema.copy() + \ getattr(ATFile, 'schema', Schema(())).copy() + \ schema.copy() FactSheetDocument_schema['description'].required = False FactSheetDocument_schema['relatedItems'].widget.visible = \ {'view':'invisible', 'edit':'invisible'} class FactSheetDocument(ATFile, BrowserDefaultMixin): """FactSheet Document """ implements(interfaces.IFactSheetDocument) meta_type = 'FactSheetDocument' schema = FactSheetDocument_schema security = ClassSecurityInfo()
from Products.ATContentTypes.content.file import ATFileSchema from Products.ATContentTypes.content.file import ATFile #from Products.ATContentTypes.content.schemata import ATContentTypeSchema from Products.ATContentTypes.content.schemata import finalizeATCTSchema #from Products.ATContentTypes.content.base import updateActions #from Products.ATContentTypes.content.base import ATCTFileContent from marsapp.categories.widget import ReferenceBrowserWidget #from Products.ATContentTypes.configuration import zconf from Products.CMFBibliographyAT.config import REFERENCE_TYPES REFERENCE_TYPES = REFERENCE_TYPES + ('MarsArchive', 'MarsLetter') PDFFileSchema = ATFileSchema.copy() + Schema(( #FileField('file', # required = True, # primary = True, # languageIndependent = True, # storage = FileSystemStorage(), # searchable = False, # validators = (('isNonEmptyFile', V_REQUIRED), # ('checkFileMaxSize', V_REQUIRED), # #('isPDF', V_REQUIRED), #XXX why doesn't it work? # ), # widget = FileWidget( # #description = "Select the file to be added by clicking the 'Browse' button.", # #description_msgid = "help_file", # description = "", # label= "PDF File",
name='cp_evaluation_notes', widget=TextAreaWidget( label="Notes", label_msgid='ILOProjectEvaluation_label_cp_evaluation_notes', i18n_domain='ILOProjectEvaluation', ), searchable=1, ), ), ) ##code-section after-local-schema #fill in your manual code here ##/code-section after-local-schema CountryProgrammeEvaluation_schema = ATFileSchema.copy() + \ schema.copy() ##code-section after-schema #fill in your manual code here ##/code-section after-schema class CountryProgrammeEvaluation(ATFile): """ """ security = ClassSecurityInfo() implements(interfaces.ICountryProgrammeEvaluation) meta_type = 'CountryProgrammeEvaluation' _at_rename_after_creation = True
from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin from Products.ATContentTypes.content.file import ATFile from Products.ATContentTypes.content.file import ATFileSchema from Products.PloneConfContentTypes.config import * ##code-section module-header #fill in your manual code here ##/code-section module-header schema = Schema((), ) ##code-section after-local-schema #fill in your manual code here ##/code-section after-local-schema PloneConfFile_schema = ATFileSchema.copy() + \ schema.copy() ##code-section after-schema #fill in your manual code here ##/code-section after-schema class PloneConfFile(ATFile): """ """ security = ClassSecurityInfo() implements(interfaces.IPloneConfFile) meta_type = 'PloneConfFile' _at_rename_after_creation = True
from Products.Archetypes.atapi import * from Products.ATContentTypes.content.file \ import ATFile as BaseClass from Products.ATContentTypes.content.file \ import ATFileSchema as DefaultSchema from Products.ATContentTypes.content.base import registerATCT from zope.interface import implements from ubify.coretypes.config import PROJECTNAME from ubify.coretypes.interfaces import IAudio from zope.event import notify from Products.Archetypes.event import ObjectInitializedEvent, ObjectEditedEvent schema = DefaultSchema.copy() class Audio(BaseClass): implements(IAudio) __doc__ = BaseClass.__doc__ + "(customizable version)" portal_type = "Audio" archetype_name = BaseClass.archetype_name assocFileExt = ('mp3', 'wav', ) if schema['file'] <> None: schema['file'].widget.label = 'Audio' schema['file'].widget.description = 'Select a .mp3 or .wav audio file.'
from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from Products.ATContentTypes.content.file import ATFileSchema from Products.ATContentTypes.content.image import ATImageSchema from Products.ATContentTypes.lib.imagetransform import ATCTImageTransform from collective.flowplayer.interfaces import IFlowPlayable from redturtle.video import videoMessageFactory as _ from redturtle.video.interfaces import IRTInternalVideo from redturtle.video.config import PROJECTNAME from redturtle.video.content.default import DefaultVideo from redturtle.video.content.video_schema import VIDEO_SCHEMA RTInternalVideoSchema = ATFileSchema.copy() + VIDEO_SCHEMA.copy() # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. RTInternalVideoSchema['title'].storage = atapi.AnnotationStorage() RTInternalVideoSchema['title'].required = True RTInternalVideoSchema['description'].storage = atapi.AnnotationStorage() RTInternalVideoSchema['file'].searchable = False #RTInternalVideoSchema['file'].index_method = '_at_accessor' imageField = ATImageSchema['image'].copy() imageField.required = False imageField.primary = False imageField.widget.description = _(u'help_video_image', default=u'Can be used to provide splash image when needed')