Exemplo n.º 1
0
#Mumbai-400064, India
###############################################################################
from Products.Archetypes.atapi import *

from Products.ATContentTypes.content.image \
     import ATImage as BaseClass
from Products.ATContentTypes.content.image \
     import ATImageSchema as DefaultSchema

from Products.ATContentTypes.content.base import registerATCT

from ubify.coretypes.config import PROJECTNAME
from zope.event import notify
from Products.Archetypes.event import ObjectInitializedEvent, ObjectEditedEvent

schema = DefaultSchema.copy()


class ATImage(BaseClass):

    __doc__ = BaseClass.__doc__ + "(customizable version)"

    portal_type = BaseClass.portal_type
    archetype_name = BaseClass.archetype_name

    schema = schema
    
    def manage_afterPUT(self, data, marshall_data, file, context, mimetype,filename, REQUEST, RESPONSE):
        is_new = False
        title = self.Title()
        if not title:
Exemplo n.º 2
0
#Mumbai-400064, India
###############################################################################
from Products.Archetypes.atapi import *

from Products.ATContentTypes.content.image \
     import ATImage as BaseClass
from Products.ATContentTypes.content.image \
     import ATImageSchema as DefaultSchema

from Products.ATContentTypes.content.base import registerATCT

from ubify.coretypes.config import PROJECTNAME
from zope.event import notify
from Products.Archetypes.event import ObjectInitializedEvent, ObjectEditedEvent

schema = DefaultSchema.copy()


class ATImage(BaseClass):

    __doc__ = BaseClass.__doc__ + "(customizable version)"

    portal_type = BaseClass.portal_type
    archetype_name = BaseClass.archetype_name

    schema = schema

    def manage_afterPUT(self, data, marshall_data, file, context, mimetype,
                        filename, REQUEST, RESPONSE):
        is_new = False
        title = self.Title()
            label_msgid='PloneConfContentTypes_label_image',
            i18n_domain='PloneConfContentTypes',
        ),
        required=True,
        storage=AnnotationStorage(),
        primary=True,
        sizes={'large'   : (768, 768), 'fullwidth' :(520, 520), 'preview' : (400, 400), 'mini'    : (200, 200), 'thumb'   : (128, 128), 'tile'    :  (64, 64), 'icon'    :  (32, 32), 'listing' :  (16, 16), },
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

PloneConfImage_schema = ATImageSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class PloneConfImage(ATImage):
    """
    """
    security = ClassSecurityInfo()

    implements(interfaces.IPloneConfImage)

    meta_type = 'PloneConfImage'
    _at_rename_after_creation = True
Exemplo n.º 4
0
    copied_fields['remoteUrl'],

    BooleanField(
        name='newWindow',
        widget=BooleanWidget(
           label='Open in new window?',
           description='Should the link attached to this image open in a new window?',
        ),
        default=False,
        schemata='default',
    ),

)
)

LinkableImageSchema = ATImageSchema.copy() + schema.copy()

class LinkableImage(ATImage):
    """
    
    """
    
#     assocMimetypes = ('application/*', 'audio/*', 'video/*', )
#     assocFileExt   = ('mp3', 'flv', 'mov', 'swf')
    
    security = ClassSecurityInfo()

    implements(interfaces.ILinkableImage)
    
    archetype_name = 'LinkableImage'
    meta_type = 'LinkableImage'
Exemplo n.º 5
0
schema = Schema((
    copied_fields['remoteUrl'],
    BooleanField(
        name='newWindow',
        widget=BooleanWidget(
            label='Open in new window?',
            description=
            'Should the link attached to this image open in a new window?',
        ),
        default=False,
        schemata='default',
    ),
))

LinkableImageSchema = ATImageSchema.copy() + schema.copy()


class LinkableImage(ATImage):
    """
    
    """

    #     assocMimetypes = ('application/*', 'audio/*', 'video/*', )
    #     assocFileExt   = ('mp3', 'flv', 'mov', 'swf')

    security = ClassSecurityInfo()

    implements(interfaces.ILinkableImage)

    archetype_name = 'LinkableImage'
Exemplo n.º 6
0
"""Definition of the SimpleReference content type
"""

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 IImageReference
from zope.interface import implements
from Products.ATContentTypes.content.image import ATImage, ATImageSchema
from Products.ATContentTypes.content.base import ATCTFileContent


ImageReferenceSchema = ATImageSchema.copy() + atapi.Schema((

    atapi.ReferenceField("image",
        title=_(u"Image Reference"),
        relationship='image_reference',
        allowed_types=('Image',),
        required=True,
        primary=True,
        languageIndependent=True,
        keepReferencesOnCopy=True,
        widget=ReferenceBrowserWidget,
    ),

))

ImageReferenceSchema['title'].storage = atapi.AnnotationStorage()
              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
registerATCT(ATFile, PROJECTNAME)


ATImageSchema = ATImageSchema.copy()
ATImageSchema['image'] = \
    AWSImageField('image',
               required=True,
               primary=True,
               languageIndependent=True,
               storage = AWSStorage(),
               swallowResizeExceptions = zconf.swallowImageResizeExceptions.enable,
               pil_quality = zconf.pil_config.quality,
               pil_resize_algo = zconf.pil_config.resize_algo,
               max_size = zconf.ATImage.max_image_dimension,
               sizes= {'large'   : (768, 768),
                       'preview' : (400, 400),
                       'mini'    : (200, 200),
                       'thumb'   : (128, 128),
                       'tile'    :  (64, 64),
Exemplo n.º 8
0
"""

from zope.interface import implements

from Products.Archetypes import atapi
#from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata
from Products.ATContentTypes.content.image import ATImage,ATImageSchema

# -*- Message Factory Imported Here -*-
from my315ok.MediaPage import MediaPageMessageFactory as _

from my315ok.MediaPage.interfaces import Irich_image
from my315ok.MediaPage.config import PROJECTNAME

rich_imageSchema = ATImageSchema.copy() + atapi.Schema((

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

    atapi.TextField(
        'comment',
        storage=atapi.AnnotationStorage(),
        default_output_type='text/html',
        searchable=True,
        widget=atapi.RichWidget(
            label=_(u"comment details"),
            description=_(u""),
        ),
    ),

Exemplo n.º 9
0
from Products.Archetypes.atapi import StringWidget
from Products.Archetypes.atapi import TextField

from Products.ATContentTypes.content.schemata import ATContentTypeSchema
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.content.image import ATImageSchema

SectionFolderSchema = ATFolderSchema.copy() + Schema((

))

SectionImageFolderSchema = ATFolderSchema.copy() + Schema((

))

BannerImageSchema = ATImageSchema.copy() + Schema((

))

BannerImageSchema['image'].widget.description = """The image must be 930 pixels wide and 180 pixels tall,
                                                   otherwise the image will be stretched."""

finalizeATCTSchema(BannerImageSchema)

SectionImageSchema = ATImageSchema.copy() + Schema((

))

SectionImageSchema['image'].sizes = {
    'large': (768, 768),
    'preview': (400, 400),