class AddForm(base.AddForm): label = _("Add repository navigator portlet") description = _("This portlet renders custom navigation for\ repository content types") def create(self, data): return Assignment()
def getSearchMessage(self, count): search_message = _(u'bungenicms_repository_search_results_message', default = u"Found ${item_count} items\ matching \"${search_query}\"", mapping = { u'item_count': count, u'search_query': self.getSearchText() }) return search_message
def getSearchMessage(self, count): search_message = _(u'bungenicms_repository_search_results_message', default=u"Found ${item_count} items\ matching \"${search_query}\"", mapping={ u'item_count': count, u'search_query': self.getSearchText() }) return search_message
class EditForm(base.EditForm): label = _("Edit repository navigator portlet") description = _("This portlet renders custom navigation for \ repository content types")
def title(self): return _('Content Browser')
def getFilterTitle(self): filter_title = BROWSE_INDICES[self.getFilterKey()] title_message = _(u'bungenicms_repository_filter_title_message', default=u"Browsing results by ${filter_title}", mapping={u'filter_title': filter_title}) return title_message
from Acquisition import aq_inner from Products.Five.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from bungenicms.repository import repositoryMessageFactory as _ from Products.CMFCore.utils import getToolByName from bungenicms.repository.browser.utils import slugify, country_vocabulary log = __import__("logging").getLogger("bungenicms.repository.browser") # * globals * BROWSE_VIEW = "browse-items" BROWSE_INDICES = { u'subject_terms': _("Subject Terms"), u'item_authors': _("Author"), u'Title': _("Title"), u'issue_date': _("Issue date"), u'legislative_type': _("Legislative Type"), u'item_publisher': _("Published By"), } FILTER_KEY = u"index" SEARCH_KEY = u"term" SEARCH_TEXT = u"search_query" DEFAULT_SORT_INDEX = u'path' DEFAULT_SORT_ORDER = u'ascending' DEFAULT_META_TYPES = [ 'RepositoryItem', 'RepositoryCollection', 'RepositoryCommunity' ] #also need to determine render methods for various keys
GROUPS_VOCAB = u"bungenicms_repository_groups_vocab" YEARS_VOCAB = u"bungenicms_repository_years_vocab" MONTHS_VOCAB = u"bungenicms_repository_months_vocab" DAYS_VOCAB = u"bungenicms_repository_days_vocab" #RepositoryItemSchema = ATFile.schema.copy() + atapi.Schema(( RepositoryItemSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( 'legislative_type', required=1, vocabulary=NamedVocabulary( 'org.bungeni.metadata.vocabularies.parliamentarytypes'), widget=atapi.SelectionWidget( label=_('Type'), description=_('Choose the applicable document type'), ), ), atapi.LinesField( 'item_authors', required=1, multiValued=True, searchable=True, widget=atapi.LinesWidget( label=_('Source'), description=_('List the authors/sponsors of this item.'), cols=5, rows=2, )), atapi.StringField('publication_number',
def getFilterTitle(self): filter_title = BROWSE_INDICES[self.getFilterKey()] title_message = _(u'bungenicms_repository_filter_title_message', default = u"Browsing results by ${filter_title}", mapping = {u'filter_title': filter_title}) return title_message
from Acquisition import aq_inner from Products.Five.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from bungenicms.repository import repositoryMessageFactory as _ from Products.CMFCore.utils import getToolByName from bungenicms.repository.browser.utils import slugify, country_vocabulary log = __import__("logging").getLogger("bungenicms.repository.browser") # * globals * BROWSE_VIEW = "browse-items" BROWSE_INDICES = {u'subject_terms': _("Subject Terms"), u'item_authors': _("Author"), u'Title': _("Title"), u'issue_date': _("Issue date"), u'legislative_type': _("Legislative Type"), u'item_publisher': _("Published By"), } FILTER_KEY = u"index" SEARCH_KEY = u"term" SEARCH_TEXT = u"search_query" DEFAULT_SORT_INDEX = u'path' DEFAULT_SORT_ORDER = u'ascending' DEFAULT_META_TYPES = ['RepositoryItem', 'RepositoryCollection', 'RepositoryCommunity'] #also need to determine render methods for various keys class RepositoryItemsBrowser(BrowserView): """
GROUPS_VOCAB = u"bungenicms_repository_groups_vocab" YEARS_VOCAB = u"bungenicms_repository_years_vocab" MONTHS_VOCAB = u"bungenicms_repository_months_vocab" DAYS_VOCAB = u"bungenicms_repository_days_vocab" # RepositoryItemSchema = ATFile.schema.copy() + atapi.Schema(( RepositoryItemSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema( ( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( "legislative_type", required=1, vocabulary=NamedVocabulary("org.bungeni.metadata.vocabularies.parliamentarytypes"), widget=atapi.SelectionWidget(label=_("Type"), description=_("Choose the applicable document type")), ), atapi.LinesField( "item_authors", required=1, multiValued=True, searchable=True, widget=atapi.LinesWidget( label=_("Source"), description=_("List the authors/sponsors of this item."), cols=5, rows=2 ), ), atapi.StringField( "publication_number", required=False, searchable=True, widget=atapi.StringWidget(label=_(u"Number"), description=_(u"Publication Number")),