Beispiel #1
0
class IWikiPage(IFolder, ICommunityContent, IPages):
    """A page using wiki markup
    """
    taggedValue('name', 'Wiki Page')
    taggedValue('search_option', True)
    taggedValue('icon', 'wiki.png')
    text = Attribute(u'Text -- includes wiki markup.')
Beispiel #2
0
class IBlogEntry(ICommunityContent, IPosts):
    """A folder for a blog entry and its comments

    o The `comments` key returns a CommentsFolder
    o The `attachments` key returns an AttachmentsFolder

    """
    taggedValue('name', 'Blog Entry')
    taggedValue('search_option', True)
    taggedValue('icon', 'blog.png')
Beispiel #3
0
class ICommunityFile(ICommunityContent, IFiles):
    """A file in a community"""
    taggedValue('name', 'File')
    taggedValue('search_option', True)
    taggedValue('icon', 'blue-document-text.png')

    blobfile = Attribute(u'Optional file attachment')
    mimetype = Attribute(u'Content type')
    filename = Attribute(u'Uploaded filename')
    size = Attribute(u'Size in bytes')
Beispiel #4
0
class ICommunity(IFolder, IContent, IOthers):
    """ Community folder """
    taggedValue('name', 'Community')
    taggedValue('search_option', True)
    taggedValue('icon', 'building.png')
    taggedValue('marker', 'Community')

    description = Attribute(u'Description -- plain text summary')
    text = Attribute(u'Text -- includes wiki markup.')
    content_modified = Attribute(
        u'datetime: last modification to any subcontent ')
Beispiel #5
0
class INewsItem(ICommunityContent, IFolder):
    """ A news item.
    """
    taggedValue('name', 'News Item')
    taggedValue('search_option', True)
    taggedValue('icon', 'newspaper.png')

    title = Attribute(u'Title of news item.')
    text = Attribute(u'Body of news item.')
    publication_date = Attribute(u'Date item was (will be) published.')
    creator = Attribute(u'User id of user that created this news item.')
    caption = Attribute(u'Caption that appears under photo for this article.')
Beispiel #6
0
class IUserProfile(
        IProfileAvatarURL,  # pylint:disable=too-many-ancestors
        IUserContactProfile,
        IFriendlyNamed,
        IRootInterface):
    """A user profile"""
    taggedValue('__external_class_name__', 'UserProfile')
Beispiel #7
0
class ISite(IFolder):
    """ Karl site """
    taggedValue('name', 'Site')
    list_aliases = Attribute("Mailng list address -> path")

    def update_indexes():
        """Add and remove catalog indexes to match a fixed schema"""
Beispiel #8
0
class ICalendarEvent(ICommunityContent, IOthers):
    """A folder for a calendar event"""
    taggedValue('name', 'Event')
    taggedValue('search_option', True)
    taggedValue('icon', 'calendar-select.png')
    taggedValue('marker', 'Event')

    title = Attribute(u'Event title')
    startDate = Attribute(u'DateTime object with value from form')
    endDate = Attribute(u'DateTime object with value from form')
    text = Attribute(u'Text description of event.')
    location = Attribute(u'Location of event.')
    attendees = Attribute(u'List of names of people attending event.')
    contact_name = Attribute(u'Name of person to contact about this event.')
    contact_email = Attribute(u'Email of person to contact about this event.')
    creator = Attribute(u'User id of user that created this event.')
    calendar_category = Attribute("Name of the associated calendar category")
class IStoryPageKind(IPagePageKind):
    """A story page.
    You must still manually opt-in to using the story template
    in the post metadata or site configuration.
    """

    # 'story_page' and 'page_page' in pagekind
    interface.taggedValue('__pagekinds__', (u'page_page', u'story_page',))
Beispiel #10
0
class IArchiveIndexPageKind(IIndexPageKind,
                            IArchivePageKind):
    """
    When archives are indexes.

    ARCHIVES_ARE_INDEXES = True
    """

    interface.taggedValue('__pagekinds__', (u'index', u'archive_page'))
Beispiel #11
0
class IBookPageKind(IStoryPageKind):
    """
    A book page. Note that this doesn't actually have
    its own pagekinds value, it's specified by
    setting 'template:book.tmpl' in the post metadata.
    """
    interface.taggedValue('__pagekinds__', (u'page_page',
                                            u'story_page',
                                            u'book_page'))
Beispiel #12
0
class IPageKind(interface.Interface):
    """
    The type of page being rendered.

    Specific types of pages will have a more specific
    interface.

    This is similar to IBrowserLayer concept in Zope 3.
    """

    interface.taggedValue('__pagekinds__', ())
Beispiel #13
0
class IFeedEntry(Interface):
    taggedValue('name', 'Feed Entry')

    title = Attribute('Title')
    summary = Attribute('Summary')
    link = Attribute('Link to source HTML page')
    id = Attribute('Globally unique entry identifier')
    content_html = Attribute('The content as a sanitized HTML string')
    published = Attribute('Publication date as a datetime')
    updated = Attribute('Last update as a datetime')

    def update(parser_entry):
        """Change the content to match a FeedParser entry.
Beispiel #14
0
class ITemplateEngine(interface.Interface):
    extensions = interface.Attribute("A list of file extensions")

    def compile(template, encoding="utf-8", filename=None):
        """
        Compile the template.

        Returns a callable object that takes an object and returns the
        unicode string result of rendering it.

        :param template: A string representing the template. If it
          is a byte string, it should be decoded according to *encoding*.
        :keyword str filename: If not-None, the path to the file the template
          was loaded from. This can help engines generate better error messages.
        """

    taggedValue("engine_type", None)
Beispiel #15
0
class IFeed(IContent):
    taggedValue('name', 'Feed')

    title = Attribute('Title')
    subtitle = Attribute('Subtitle')
    link = Attribute('Link to source HTML page')

    etag = Attribute('Etag (bandwidth optimization)')
    feed_modified = Attribute('Last-modified date (bandwidth optimization)')

    entries = Attribute('List of contained IFeedEntry objects')

    old_uri = Attribute('Old feed URI (set if the feed moves or disappears)')
    new_uri = Attribute('New feed URI (set if the feed moves or disappears)')

    def update(parser):
        """Change the content to match a FeedParser result.
Beispiel #16
0
class IAddress(IRootInterface):

    full_name = ValidTextLine(title=u"First name", required=True)

    street_address_1 = ValidTextLine(title=u"Street line 1",
                                     max_length=75,
                                     required=True)

    street_address_2 = ValidTextLine(title=u"Street line 2",
                                     required=False,
                                     max_length=75)

    city = ValidTextLine(title=u"City name", required=True)

    state = ValidTextLine(title=u"State name", required=False, max_length=10)

    postal_code = ValidTextLine(title=u"Postal code",
                                required=False,
                                max_length=30)

    country = ValidTextLine(title=u"Nation name", required=True)
    taggedValue('__external_class_name__', 'Address')
Beispiel #17
0
class ICommentKindDisqus(ICommentKindAllowed):
    """
    Use disqus comments.
    """
    interface.taggedValue('__comment_system__', 'disqus')
Beispiel #18
0
class ICommentKindAllowed(interface.Interface):
    """
    Comments are allowed on this view.
    """

    interface.taggedValue('__comment_system__', None)
Beispiel #19
0
class IPostPage(IPost, IPageKind):
    """
    A page being rendered for a post.
    """

    interface.taggedValue('__pagekinds__', ())
Beispiel #20
0
class IPagePageKind(IPageKind):
    """A page"""

    # 'page_page' in pagekind
    interface.taggedValue('__pagekinds__', (u'page_page',))
Beispiel #21
0
class ITagsPageKind(IPageKind):
    "The page for listing tags"

    # 'list' and 'tags_page' in pagekind
    interface.taggedValue('__pagekinds__', (u'list', u'tags_page'))
Beispiel #22
0
class IMainIndexPageKind(IIndexPageKind):
    """The main index"""

    # 'index' and 'main_index' in pagkeind
    interface.taggedValue('__pagekinds__', (u'index', u'main_index'))
Beispiel #23
0
class IIndexPageKind(IPageKind):
    """An index page"""

    # 'index' in pagkekind
    interface.taggedValue('__pagekinds__', (u'index',))
Beispiel #24
0
class IArchivePageKind(IListPageKind):
    """An archive page"""

    # 'list' and 'archive_page' in pagekind
    interface.taggedValue('__pagekinds__', (u'list', u'archive_page'))
Beispiel #25
0
class IListingPageKind(IPageKind):
    """A listing page"""

    # 'listing' in pagkeind
    interface.taggedValue('__pagekinds__', (u'listing',))
Beispiel #26
0
class ITagPageKind(IPageKind):
    """The page for listing a tag"""

    # 'list' and 'tag_page' in pagkeind
    interface.taggedValue('__pagekinds__', (u'list', u'tag_page'))
Beispiel #27
0
class ICommentKindFacebook(ICommentKindAllowed):
    """
    Use Facebook comments.
    """
    interface.taggedValue('__comment_system__', 'facebook')
Beispiel #28
0
class IPostPageKind(IPageKind):
    """A blog post"""

    # 'post_page' in pagekind
    interface.taggedValue('__pagekinds__', (u'post_page',))
Beispiel #29
0
class IGalleryPageKind(IPageKind):
    """A gallery page"""

    # 'gallery_page' in pagkeind
    interface.taggedValue('__pagekinds__', (u'gallery_page',))
Beispiel #30
0
class IAuthorPageKind(IPageKind):
    "The page for listing an author"

    # 'list' and 'author_page' in pagkeind
    interface.taggedValue('__pagekinds__', (u'list', u'author_page'))