コード例 #1
0
 def summary(self):
     exclude = self.exclude
     if exclude:
         msg = _(u"Exclude content object from navigation.")
     else:
         msg = _(u"Show content object in navigation.")
     return msg
コード例 #2
0
 def summary(self):
     exclude = self.exclude
     if exclude:
         msg = _(u"Exclude content from navigation.")
     else:
         msg = _(u"Show content object in navigation.")
     return msg
コード例 #3
0
 def summary(self):
     rights = self.rights
     only_empty = self.only_empty
     condition = (only_empty and _(u', only if rights was not set.') or
                  _(u'.'))
     msg = _(u"Set rights '${rights}'${condition}",
             mapping=dict(rights=rights, condition=condition))
     return msg
コード例 #4
0
 def summary(self):
     language = self.language
     only_empty = self.only_empty
     condition = (only_empty and _(u', only if language was not set.')
                  or _(u'.'))
     msg = _(u"Set language ${language}${condition}",
             mapping=dict(language=language, condition=condition))
     return msg
コード例 #5
0
 def summary(self):
     creators = self.creators
     only_empty = self.only_empty
     condition = (only_empty and _(u', only if creators was not set.')
                  or _(u'.'))
     msg = _(u"Set creators to ${creators}${condition}",
             mapping=dict(creators=','.join(creators), condition=condition))
     return msg
コード例 #6
0
 def summary(self):
     language = self.language
     only_empty = self.only_empty
     condition = (only_empty and _(u', only if language was not set.') or
                  _(u'.'))
     msg = _(u"Set language ${language}${condition}",
             mapping=dict(language=language, condition=condition))
     return msg
コード例 #7
0
 def summary(self):
     creators = self.creators
     only_empty = self.only_empty
     condition = (only_empty and _(u', only if creators was not set.') or
                  _(u'.'))
     msg = _(u"Set creators to ${creators}${condition}",
             mapping=dict(creators=','.join(creators),
                          condition=condition))
     return msg
コード例 #8
0
class IExcludeFromNavAction(Interface):
    '''Interface for the configurable aspects of exclude from navigation
       action.
       This is also used to create add and edit forms, below.
    '''

    exclude = Bool(title=_(u"Exclude content from navigation"),
                   description=_(u"If checked the content will not be "
                                 u"listed in portal navigation elements."))
コード例 #9
0
 def summary(self):
     same_as_parent = self.same_as_parent
     subject = self.subject
     if same_as_parent:
         msg = _(u"Apply tags from parent object.")
     else:
         msg = _(u"Apply tags ${tags}",
                 mapping=dict(tags=", ".join(subject)))
     return msg
コード例 #10
0
 def summary(self):
     same_as_parent = self.same_as_parent
     subject = self.subject
     if same_as_parent:
         msg = _(u"Apply tags from parent object.")
     else:
         msg = _(u"Apply tags ${tags}",
                 mapping=dict(tags=", ".join(subject)))
     return msg
コード例 #11
0
class IRightsAction(Interface):
    '''Interface for the configurable aspects of a set rights action.
       This is also used to create add and edit forms, below.
    '''

    rights = Text(title=_(u'Rights'),
                  description=_(u'Inform the copyright statement or other '
                                u'rights information on this item'),
                  required=True)

    only_empty = Bool(title=_(u"Only if not set"),
                      description=_(u"Apply this only if no rights was "
                                    u"set on the content item."),
                      required=False,
                      default=True)
コード例 #12
0
class IContributorsAction(Interface):
    '''Interface for the configurable aspects of a set contributors action.
       This is also used to create add and edit forms, below.
    '''

    contributors = Tuple(title=_(u'Contributors'),
                         description=DESC,
                         value_type=TextLine(),
                         required=False,)

    only_empty = Bool(title=_(u"Only if not set"),
                      description=_(u"Apply this only if no contributors was "
                                    u"set on the content item."),
                      required=False,
                      default=True)
コード例 #13
0
class ILanguageAction(Interface):
    '''Interface for the configurable aspects of a set language action.
       This is also used to create add and edit forms, below.
    '''

    language = Choice(title=_(u'Language'),
                      description=_(u'Select here the language to be applied '
                                    u'to the content item.'),
                      required=True,
                      vocabulary=VOCAB)

    only_empty = Bool(title=_(u"Only if not set"),
                      description=_(u"Apply this only if no language was "
                                    u"set on the content item."),
                      required=False,
                      default=True)
コード例 #14
0
class SubjectEditForm(EditForm):
    """
    An edit form for the set Tags contentrules action
    """
    form_fields = form.FormFields(ISubjectAction)
    label = _(u"Edit the set Tags content rules action")
    description = FORM_DESC
    form_name = FORM_NAME
コード例 #15
0
class ContributorsEditForm(EditForm):
    """
    An edit form for the set Contributors contentrules action
    """
    form_fields = form.FormFields(IContributorsAction)
    label = _(u"Edit the set Contributors content rules action")
    description = FORM_DESC
    form_name = FORM_NAME
コード例 #16
0
class ExcludeFromNavEditForm(EditForm):
    """
    An edit form for the exclude from navigation contentrules action
    """
    form_fields = form.FormFields(IExcludeFromNavAction)
    label = _(u"Edit an exclude from navigation content rules action")
    description = FORM_DESC
    form_name = FORM_NAME
コード例 #17
0
class LanguageEditForm(EditForm):
    """
    An edit form for the set Language contentrules action
    """
    form_fields = form.FormFields(ILanguageAction)
    label = _(u"Edit the set Language content rules action")
    description = FORM_DESC
    form_name = FORM_NAME
コード例 #18
0
class ISubjectAction(Interface):
    '''Interface for the configurable aspects of a set Tag action.
       This is also used to create add and edit forms, below.
    '''

    same_as_parent = Bool(title=_(u"Use Tags from parent object"),
                          description=_(u"Select this to use Tags as defined "
                                        u"in the parent object. If this "
                                        u"option is selected this action "
                                        u"ignores the following field."))

    subject = Set(title=_(u'Tags'),
                  description=_(u'Tags to check for. Leave it blank '
                                u'to check for contents without any '
                                u'tag set'),
                  required=False,
                  value_type=Choice(vocabulary=VOCAB))
コード例 #19
0
class ICreatorsAction(Interface):
    '''Interface for the configurable aspects of a set creators action.
       This is also used to create add and edit forms, below.
    '''

    creators = Tuple(
        title=_(u'Creators'),
        description=_(u'Persons responsible for creating the '
                      u'content of this item. Please enter a '
                      u'list of user names, one per line. The '
                      u'principal creator should come first.'),
        value_type=TextLine(),
        required=False,
    )

    only_empty = Bool(title=_(u"Only if not set"),
                      description=_(u"Apply this only if no creators was "
                                    u"set on the content item."),
                      required=False,
                      default=True)
コード例 #20
0
class ExcludeFromNavAddForm(AddForm):
    """
    An add form for the exclude from navigation contentrules action
    """
    form_fields = form.FormFields(IExcludeFromNavAction)
    label = _(u"Add an exclude from navigation content rules action")
    description = FORM_DESC
    form_name = FORM_NAME

    def create(self, data):
        a = ExcludeFromNavAction()
        form.applyChanges(a, self.form_fields, data)
        return a
コード例 #21
0
class ContributorsAddForm(AddForm):
    """
    An add form for the Contributors contentrules action
    """
    form_fields = form.FormFields(IContributorsAction)
    label = _(u"Add set Contributors content rules action")
    description = FORM_DESC
    form_name = FORM_NAME

    def create(self, data):
        a = ContributorsAction()
        form.applyChanges(a, self.form_fields, data)
        return a
コード例 #22
0
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import Choice


VOCAB = 'plone.app.vocabularies.AvailableContentLanguages'

FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that sets language to a content.')


class ILanguageAction(Interface):
    '''Interface for the configurable aspects of a set language action.
       This is also used to create add and edit forms, below.
    '''

    language = Choice(title=_(u'Language'),
                      description=_(u'Select here the language to be applied '
                                    u'to the content item.'),
                      required=True,
                      vocabulary=VOCAB)
コード例 #23
0
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import Choice
from zope.schema import Set


VOCAB = 'plone.app.vocabularies.Keywords'

FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that applies Tags to a content.')


class ISubjectAction(Interface):
    '''Interface for the configurable aspects of a set Tag action.
       This is also used to create add and edit forms, below.
    '''

    same_as_parent = Bool(title=_(u"Use Tags from parent object"),
                          description=_(u"Select this to use Tags as defined "
                                        u"in the parent object. If this "
                                        u"option is selected this action "
                                        u"ignores the following field."))
コード例 #24
0
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import TextLine
from zope.schema import Tuple


FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that sets contributors to a content.')

DESC = _(u'The names of people that have contributed to this item. Each '
         u'contributor should  be on a separate line.')


class IContributorsAction(Interface):
    '''Interface for the configurable aspects of a set contributors action.
       This is also used to create add and edit forms, below.
    '''

    contributors = Tuple(title=_(u'Contributors'),
                         description=DESC,
                         value_type=TextLine(),
コード例 #25
0
# -*- coding: utf-8 -*-
from OFS.SimpleItem import SimpleItem
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool

FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that excludes contents from navigation.')


class IExcludeFromNavAction(Interface):
    '''Interface for the configurable aspects of exclude from navigation
       action.
       This is also used to create add and edit forms, below.
    '''

    exclude = Bool(title=_(u"Exclude content from navigation"),
                   description=_(u"If checked the content will not be "
                                 u"listed in portal navigation elements."))


class ExcludeFromNavAction(SimpleItem):
コード例 #26
0
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import Choice

VOCAB = 'plone.app.vocabularies.AvailableContentLanguages'

FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that sets language to a content.')


class ILanguageAction(Interface):
    '''Interface for the configurable aspects of a set language action.
       This is also used to create add and edit forms, below.
    '''

    language = Choice(title=_(u'Language'),
                      description=_(u'Select here the language to be applied '
                                    u'to the content item.'),
                      required=True,
                      vocabulary=VOCAB)
コード例 #27
0
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import TextLine
from zope.schema import Tuple


FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that sets creators to a content.')


class ICreatorsAction(Interface):
    '''Interface for the configurable aspects of a set creators action.
       This is also used to create add and edit forms, below.
    '''

    creators = Tuple(title=_(u'Creators'),
                     description=_(u'Persons responsible for creating the '
                                   u'content of this item. Please enter a '
                                   u'list of user names, one per line. The '
                                   u'principal creator should come first.'),
                     value_type=TextLine(),
コード例 #28
0
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import Choice
from zope.schema import Set

VOCAB = 'plone.app.vocabularies.Keywords'

FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that applies Tags to a content.')


class ISubjectAction(Interface):
    '''Interface for the configurable aspects of a set Tag action.
       This is also used to create add and edit forms, below.
    '''

    same_as_parent = Bool(title=_(u"Use Tags from parent object"),
                          description=_(u"Select this to use Tags as defined "
                                        u"in the parent object. If this "
                                        u"option is selected this action "
                                        u"ignores the following field."))
コード例 #29
0
# -*- coding: utf-8 -*-
from OFS.SimpleItem import SimpleItem
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool


FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that excludes contents from navigation.')


class IExcludeFromNavAction(Interface):
    '''Interface for the configurable aspects of exclude from navigation
       action.
       This is also used to create add and edit forms, below.
    '''

    exclude = Bool(title=_(u"Exclude content from navigation"),
                   description=_(u"If checked the content will not be "
                                 u"listed in portal navigation elements."))

コード例 #30
0
from OFS.SimpleItem import SimpleItem
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from sc.contentrules.metadata import MessageFactory as _
from sc.contentrules.metadata import utils
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import Text


FORM_NAME = _(u"Configure action")

FORM_DESC = _(u'An action that sets rights to a content.')


class IRightsAction(Interface):
    '''Interface for the configurable aspects of a set rights action.
       This is also used to create add and edit forms, below.
    '''

    rights = Text(title=_(u'Rights'),
                  description=_(u'Inform the copyright statement or other '
                                u'rights information on this item'),
                  required=True)

    only_empty = Bool(title=_(u"Only if not set"),