コード例 #1
0
class AuthorCriterium(TextCriterium):
    """ Full text criterium for 'author-fulltext' index."""

    zope.interface.implements(ICriteriumDescription)

    indexOrName = 'author-fulltext'

    label = _('author-fulltext-label', u"Author")

    description = _('author-fulltext-desc', u"Matches author or editor.")

    ui_weight = 110
コード例 #2
0
class TitleCriterium(TextCriterium):
    """ Full text criterium for 'title-fulltext' index."""

    zope.interface.implements(ICriteriumDescription)

    indexOrName = 'title-fulltext'

    label = _('title-fulltext-label', u"Title")

    description = _('title-fulltext-desc',
                    u"Matches title, original title, subtitle and the like.")

    ui_weight = 120
コード例 #3
0
class FlagsColumn(column.Column):
    """ The flags column of the bibliography table."""

    header = _('bibliography-columnheader-flags', u"flags")
    weight = 9999

    def renderCell(self, item):
        flags = zope.component.getMultiAdapter(
            (item, self.request, self.table), IContentProvider, name='flags')
        flags.update()
        return flags.render()
コード例 #4
0
class YearColumn(column.Column):
    """ The year column of the bibliography table."""

    zope.interface.implements(ISortingColumn)

    header = _('bibliography-columnheader-year', u"Year")
    weight = 300

    def renderCell(self, item):
        return zope.component.getMultiAdapter((item, self.request),
                                              name='year')()
コード例 #5
0
class TitleColumn(column.Column):
    """ The title column of the bibliography table."""

    zope.interface.implements(ISortingColumn)

    header = _('bibliography-columnheader-title', u"Title")
    weight = 200

    def renderCell(self, item):
        return zope.component.getMultiAdapter((item, self.request),
                                              name='title')()
コード例 #6
0
    first_criterium_connector_name = CONNECTOR_OR  # see ICriteriaChainSpecifier

    ignore_empty_criteria = True  # see ICriteriaChainSpecifier

    def resultURL(self, context, request):
        """ See IResultSpecifier"""
        bibliography = zope.component.getUtility(IBibliography,
                                                 context=context)
        return absoluteURL(bibliography, request) + u"/@@searchResult.html"

    session_name = 'bibliography'  # see IResultSpecifier


bibliography_search_filter_factory = zope.component.factory.Factory(
    BibliographySearchFilter,
    _('BibliographyFilter-title', u"Bibliographic entries"),
    _('BibliographySearchFilter-desc',
      u"Search for entries in the bibliography."))


class AuthorCriterium(TextCriterium):
    """ Full text criterium for 'author-fulltext' index."""

    zope.interface.implements(ICriteriumDescription)

    indexOrName = 'author-fulltext'

    label = _('author-fulltext-label', u"Author")

    description = _('author-fulltext-desc', u"Matches author or editor.")
コード例 #7
0
class IdColumn(column.LinkColumn):
    """ The id (__name__ attribute) of the bibliography table."""

    header = _('bibliography-columnheader-id', u"ID")

    weight = 10