schemata = "settings",
        default = "default_template",
        required = 1,
        widget = atapi.StringWidget(
            macro = "NewsletterTemplateWidget",
            label = _(u"EasyNewsletter_label_template",
                default=u"Newsletter Template"),
            description = _(u"EasyNewsletter_help_template"),
                default=u"Template, to generate the newsletter.",
            i18n_domain = 'EasyNewsletter',
        ),
    ),
),
)

schema = ATTopicSchema.copy() + schema
schema.moveField('acquireCriteria', before='template')

# hide id, even if visible_ids is True
schema['id'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
schema['limitNumber'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
schema['itemCount'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
schema['customView'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
schema['customViewFields'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}

schema.moveField('header', pos='bottom')
schema.moveField('footer', pos='bottom')
schema.moveField('relatedItems', pos='bottom')
schema.moveField('language', pos='bottom')

Exemple #2
0
from Acquisition import aq_parent, aq_inner

from Products.ATContentTypes.content.base import updateActions
from Products.ATContentTypes.content.topic import ATTopic, IGNORED_FIELDS
from Products.ATContentTypes.interfaces import IATTopic
from Products.ATContentTypes.types.criteria import _criterionRegistry
from Products.ATContentTypes.permission import ChangeTopics, AddTopics
from Products.CMFCore.permissions import View
from Products.ATContentTypes.content.topic import ATTopicSchema
from Products.ATContentTypes.interfaces import IATTopicSearchCriterion, IATTopicSortCriterion
from Products.Archetypes.public import *
from config import *
from Products.CMFPlone.PloneBatch import Batch
from Products.ATContentTypes.config import TOOLNAME

qTopic_schema = ATTopicSchema.copy() + Schema((
          StringField("catalog",
                       default = "portal_catalog",
                       vocabulary = "getCatalogList",
                       widget = SelectionWidget(label="Catalog",
                                       label_msgid="label_catalog",
                                       description="Select catalog to query",
                                       description_msgid="description_catalog")
          ),
          BooleanField("showHeader",
                      schemata = "export",
                      default = 1,
                      widget = BooleanWidget(label="Print field headers",
                                             label_msgid="label_print_headers",
                                             description="Check if headers need to be printed",
                                             description_msgid="description_print_headers")
Exemple #3
0
                u'EasyNewsletter_label_subscriber_confirmation_mail_text',
                default=u'Subscriber confirmation mail text'),
            description=_(
                u'description_subscriber_confirmation_mail_text',
                default=u'Text used for confirmation email. You can customize \
                    the text, but it should include the placeholders: \
                    ${portal_url}, ${subscriber_email} and \
                    ${confirmation_url}!'),
            i18n_domain='EasyNewsletter',
        ),
    ),
),
)


schema = ATTopicSchema.copy() + schema
schema['text'].widget.description = _(
    u'description_text',
    default=u'This is used in the frontpage of EasyNewsletter \
            on top of Issue archive list.')

schema['limitNumber'].widget.visible = {
    'view': 'invisible', 'edit': 'invisible'}
schema['itemCount'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
schema['customView'].widget.visible = {
    'view': 'invisible', 'edit': 'invisible'}
schema['customViewFields'].widget.visible = {
    'view': 'invisible', 'edit': 'invisible'}
schema['allowDiscussion'].widget.visible = {
    'view': 'invisible', 'edit': 'invisible'}
schema['subject'].widget.visible = {'view': 'invisible', 'edit': 'invisible'}
Exemple #4
0
#Dheeraj Sagar, Malad(W)
#Mumbai-400064, India
###############################################################################
from Products.Archetypes.atapi import *

from Products.ATContentTypes.content.topic \
     import ATTopic as BaseClass
from Products.ATContentTypes.content.topic \
     import ATTopicSchema as DefaultSchema

from Products.ATContentTypes.content.base import registerATCT

from ubify.coretypes.config import PROJECTNAME
from Products.CMFCore.utils import getToolByName

schema = DefaultSchema.copy()


class ATTopic(BaseClass):

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

    portal_type = BaseClass.portal_type
    archetype_name = BaseClass.archetype_name

    schema = schema
    
    def getEntries(self,num_of_entries):        
        syn_tool = getToolByName(self, 'portal_syndication')
        if num_of_entries is None:
            num_of_entries = int(syn_tool.getMaxItems(self))