def __init__(self, id, title, abstract, body, publish_date=None, blogitemurl='', abstract_display_format='html', body_display_format='html', category = None): """ init """ BaseContent.__init__(self, id, title, abstract = abstract, body = body, publish_date = publish_date) self.setCategory(category)
def editBlogItem(self, title=None, abstract=None, body=None, publish_date=None, abstract_display_format=None, body_display_format=None, blogitemurl=None, category = None, REQUEST=None): """ save changes to the blog item """ if blogitemurl is not None: if blogitemurl.startswith('http://http'): blogitemurl = blogitemurl[len('http://'):] if blogitemurl.startswith('http'): parsed = urlparse(blogitemurl) assert parsed[1], "URL has no domain" self.blogitemurl = blogitemurl if category is not None: self.setCategory(category) #Update base attributes, render and reindex BaseContent.editBaseContent(self, title = title, abstract = abstract, body = body, publish_date = publish_date, abstract_display_format = abstract_display_format, body_display_format = body_display_format) if REQUEST is not None: msg = "New details saved" url = self.absolute_url()+'/editBlogItemForm' self.http_redirect(url, msg=msg)
def editPage(self, title=None, abstract=None, body=None, publish_date=None, REQUEST=None): """ Update the body of the page """ #Update base attributes and reindex BaseContent.editBaseContent(self, title = title, abstract = abstract, body = body, publish_date = publish_date) if REQUEST is not None: msg = "New details saved" url = self.getRootURL()+'/PagesManagementHome' self.http_redirect(url, msg=msg)
def editFAQ(self, title = None, abstract = None, body = None, publish_date = None, category = None, REQUEST = None): """ Edit FAQ item """ if category is not None: self.setCategory(category) #Update base attributes, render and reindex BaseContent.editBaseContent(self, title = title, abstract = abstract, body = body, publish_date = publish_date) if REQUEST is not None: msg = "New details saved" url = self.getContiner().absolute_url()+'/FAQManagement' self.http_redirect(url, msg=msg)