def publish(self):
        settings = utils.get_global_settings()
        if not settings.autopublish_enabled:
            self.logger.info(self.msg_autopublish_disabled)
            return self.msg_autopublish_disabled

        for brain in self.get_items():
            obj = brain.getObject()
            manager = IPublishStorageManager(obj)
            # XXX: we should delegate default text get to manager (?)
            content = manager.get_text() or utils.get_text(obj)
            for publisher, account_id in manager.get_accounts().items():
                self._publish(content, publisher, account_id=account_id)

        self.logger.info(self.msg_autopublish_done)
        return self.msg_autopublish_done
Пример #2
0
    def publish(self):
        settings = utils.get_global_settings()
        if not settings.autopublish_enabled:
            self.logger.info(self.msg_autopublish_disabled)
            return self.msg_autopublish_disabled

        for brain in self.get_items():
            obj = brain.getObject()
            manager = IPublishStorageManager(obj)
            # XXX: we should delegate default text get to manager (?)
            content = manager.get_text() or utils.get_text(obj)
            for publisher, account_id in manager.get_accounts().items():
                self._publish(content, publisher, account_id=account_id)

        self.logger.info(self.msg_autopublish_done)
        return self.msg_autopublish_done
Пример #3
0
 def get_content(self):
     default = utils.get_text(self.context)
     custom = self.request.get('text', '').strip()
     return custom or default
Пример #4
0
 def test_get_text(self):
     event = self.create_event()
     txt = utils.get_text(event)
     expected = 'Great event http://nohost/plone/event'
     self.assertTrue(expected, txt)
 def get_content(self):
     default = utils.get_text(self.context)
     custom = self.request.get('text', '').strip()
     return custom or default
 def test_get_text(self):
     event = self.create_event()
     txt = utils.get_text(event)
     expected = 'Great event http://nohost/plone/event'
     self.assertTrue(expected,txt)
 def get_text(self):
     manager = IPublishStorageManager(self.context, None)
     saved = manager.get_text()
     default = utils.get_text(self.context)
     return saved or default
 def get_text(self):
     manager = IPublishStorageManager(self.context, None)
     saved = manager.get_text()
     default = utils.get_text(self.context)
     return saved or default