Esempio n. 1
0
 def __init__(self,
              title,
              startDate,
              endDate,
              creator,
              text=u'',
              location=u'',
              attendees=[],
              contact_name=u'',
              contact_email=u'',
              calendar_category=u''):
     Folder.__init__(self)
     self.title = unicode(title)
     self.startDate = startDate
     self.endDate = endDate
     self.location = location
     self.attendees = attendees
     self.contact_name = contact_name
     self.contact_email = contact_email
     self.creator = unicode(creator)
     self.modified_by = self.creator
     if text is None:
         self.text = u''
     else:
         self.text = unicode(text)
     self.calendar_category = calendar_category
     self['attachments'] = AttachmentsFolder()
Esempio n. 2
0
    def handle(self, message, info, text, attachments):
        """ See IMailinHandler.
        """
        entry = create_content(
            IBlogEntry,
            title=info['subject'],
            creator=info['author'],
            text=text,
            description=extract_description(text),
        )
        entry.created = info['date']

        if attachments:
            if 'attachments' not in entry:
                # XXX Not a likely code path, left here for safety
                entry['attachments'] = att_folder = AttachmentsFolder()
                att_folder.title = 'Attachments'
                att_folder.creator = info['author']
            else:
                att_folder = entry['attachments']
            _addAttachments(att_folder, info, attachments)

        entry_id = make_unique_name(self.context, entry.title)
        self.context[entry_id] = entry

        workflow = get_workflow(IBlogEntry, 'security', self.context)
        if workflow is not None:
            workflow.initialize(entry)

        alerts = queryUtility(IAlerts, default=Alerts())
        alerts.emit(entry, offline_request)
Esempio n. 3
0
File: forum.py Progetto: iotest3/new
 def __init__(self, title='', text='', creator=None):
     super(ForumTopic, self).__init__()
     self.title = unicode(title)
     if text is None:
         self.text = u''
     else:
         self.text = unicode(text)
     self.creator = unicode(creator)
     self.modified_by = self.creator
     self['comments'] = CommentsFolder()
     self['attachments'] = AttachmentsFolder()
Esempio n. 4
0
File: blog.py Progetto: iotest3/new
 def __init__(self, title, text, description, creator):
     super(BlogEntry, self).__init__()
     assert title is not None
     assert text is not None
     assert description is not None
     assert creator is not None
     self.title = unicode(title)
     self.text = unicode(text)
     self.description = unicode(description)
     self.creator = unicode(creator)
     self.modified_by = self.creator
     self['comments'] = CommentsFolder()
     self['attachments'] = AttachmentsFolder()
Esempio n. 5
0
File: page.py Progetto: iotest3/new
 def __init__(self, title, text, description, creator):
     Folder.__init__(self)
     assert title is not None
     assert text is not None
     assert description is not None
     assert creator is not None
     self.title = unicode(title)
     self.text = unicode(text)
     self.description = unicode(description)
     self.creator = unicode(creator)
     self.modified_by = self.creator
     # We might choose to make this more article-ish in KARL3
     self['attachments'] = AttachmentsFolder()
Esempio n. 6
0
    def __init__(self,
                 title,
                 text,
                 creator,
                 publication_date,
                 caption=None,
                 data=None):
        super(NewsItem, self).__init__(data)
        self.title = title
        self.text = text
        self.creator = unicode(creator)
        self.modified_by = self.creator
        self.publication_date = publication_date
        self.caption = caption

        self["attachments"] = AttachmentsFolder()