def afterSetUp(self):
        import experimental.atrefspeedup
        fiveconfigure.debug_mode = True
        zcml.load_config("configure.zcml", experimental.atrefspeedup)
        fiveconfigure.debug_mode = False
        ztc.installPackage("experimental.atrefspeedup", quiet=True)

        # Add us a second reference field
        from Products.ATContentTypes.content.schemata import relatedItemsField
        rel2 = relatedItemsField.copy()
        rel2.relationship = 'rel2'
        rel2.__name__ = 'rel2'

        from Products.ATContentTypes.content.document import ATDocument
        ATDocument.schema.addField(rel2)

        from Products.Archetypes.ClassGen import generateMethods as atgm
        atgm(ATDocument, (ATDocument.schema.get('rel2'), ))

        self.loginAsPortalOwner()
        self.portal.invokeFactory('Document', 'doc1')
        self.portal.invokeFactory('Document', 'doc2')
        self.portal.invokeFactory('Document', 'doc3')
        pil_quality=zconf.pil_config.quality,
        pil_resize_algo=zconf.pil_config.resize_algo,
        widget=ImageWidget(
            label=_(u'label_preview_image', default=u'Preview image'),
            description=_(u''),
            show_content_type=False,
        ),
    ),
))

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

TCNews_schema = ATFolder.schema.copy() + schema.copy()

TCNews_schema.addField(relatedItemsField.copy())
##code-section after-schema #fill in your manual code here
TCNews_schema['creation_date'].widget.visible = {
    'edit': 'visible',
    'view': 'invisible'
}
TCNews_schema['relatedItems'].schemata = 'default'
TCNews_schema['relatedItems'].callStorageOnSet = True
##/code-section after-schema


class ITCNews(Interface):
    """Marker interface for IDuweEvent
    """

        widget=StringField._properties['widget'](
            label='Type',
            label_msgid='extendedlink_label_type',
            description='Teaser type.',
            description_msgid='extendedlink_description_type',
            i18n_domain='plone',
        ),
    ),
))

##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
TCTeaser_schema = ATFolder.schema.copy()+schema.copy()
TCTeaser_schema.addField(relatedItemsField.copy())
TCTeaser_schema['creation_date'].widget.visible={'edit':'visible', 'view':'invisible'}
TCTeaser_schema['relatedItems'].schemata='default'
TCTeaser_schema['relatedItems'].callStorageOnSet=True
##/code-section after-schema

class TCTeaser(ATFolder):
    """
    """
    security = ClassSecurityInfo()

    implements(ITCTeaser)

    meta_type = 'Teaser'
    _at_rename_after_creation = True
Beispiel #4
0
from Products.PloneChat.content.PloneChat import PloneChat
from Products.Archetypes.atapi import *
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ATContentTypes.atct import ATContentTypeSchema 
from Products.ATContentTypes.content.schemata import relatedItemsField
from DateTime import DateTime

from zopen.plone.widgets.category.interfaces import ICategoryManager
from zopen.plone.chat.config import PROJECTNAME

PloneChat.schema.addField(relatedItemsField.copy())
PloneChat.schema = ATContentTypeSchema + PloneChat.schema

class Chat(BaseFolder, PloneChat):
    """PloneChat class"""

    schema = PloneChat.schema

    security = ClassSecurityInfo()

    def _createChatLog(self):
        wftool = getToolByName(self, 'portal_workflow')
        isPrivate = wftool.getInfoFor(self, 'review_state') == 'private'

        project = self.getProject()
        files = project.files.aq_inner

        if not hasattr(files, 'chatlogs'):
            cm = ICategoryManager(files)
            cm.addCategory('chatlogs', '讨论记录')
        pil_resize_algo = zconf.pil_config.resize_algo,
        widget = ImageWidget(
            label = _(u'label_preview_image', default=u'Preview image'),
            description=_(u''),
            show_content_type = False,
        ),
    ),

))

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

TCNews_schema = ATFolder.schema.copy()+schema.copy()

TCNews_schema.addField(relatedItemsField.copy())
##code-section after-schema #fill in your manual code here
TCNews_schema['creation_date'].widget.visible={'edit':'visible', 'view':'invisible'}
TCNews_schema['relatedItems'].schemata='default'
TCNews_schema['relatedItems'].callStorageOnSet=True
##/code-section after-schema

class ITCNews(Interface):
    """Marker interface for IDuweEvent
    """


class TCNews(ATFolder):
    """
    """
    security = ClassSecurityInfo()
Beispiel #6
0
from Products.PloneChat.content.PloneChat import PloneChat
from Products.Archetypes.atapi import *
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ATContentTypes.atct import ATContentTypeSchema
from Products.ATContentTypes.content.schemata import relatedItemsField
from DateTime import DateTime

from zopen.plone.widgets.category.interfaces import ICategoryManager
from zopen.plone.chat.config import PROJECTNAME

PloneChat.schema.addField(relatedItemsField.copy())
PloneChat.schema = ATContentTypeSchema + PloneChat.schema


class Chat(BaseFolder, PloneChat):
    """PloneChat class"""

    schema = PloneChat.schema

    security = ClassSecurityInfo()

    def _createChatLog(self):
        wftool = getToolByName(self, 'portal_workflow')
        isPrivate = wftool.getInfoFor(self, 'review_state') == 'private'

        project = self.getProject()
        files = project.files.aq_inner

        if not hasattr(files, 'chatlogs'):
            cm = ICategoryManager(files)