Package: plone.app.vocabularies
OverviewA collection of generally useful vocabularies for Plone.It is implemented usingzope.schema.vocabulary.
Intended to be used as a base and example for custom vocabularies.Common Named VocabulariesLanguagesplone.app.vocabularies.AvailableContentLanguagesall known languagesplone.app.vocabularies.SupportedContentLanguagescurrently configured/supported content languages for the portalUsers, Groups, Securityplone.app.vocabularies.UsersUsers of the portal (searchable).plone.app.vocabularies.GroupsGroups of the portal (searchable).plone.app.vocabularies.PrincipalsCombined groups and users of the portal (searchable).
Values are prefixed bygroup:...oruser:....The factory-class of the above three vocabularies is made for subclassing to filter the results in the subclass.
The post-filtering approach works by overriding thedef use_principal_triple(self, principal_triple):method of theplone.app.vocabularies.principals.BaseFactorysubclass.use_principal_tripleargumentprincipal_tripleis a triple(value, token, title).use_principal_tripleis expected to returnTruewhen the triple has be added to the vocabulary orFalseif it has to be skipped.
Be aware there might be many values, like several thousands, in the vocabulary and the filtering has to be perform.
The subclass needs to have asourceattribute with value one out ofuser,grouporprincipal.
Don’t forget to register the new vocabulary in ZCML!plone.app.vocabularies.Rolesall possible roles in the portalplone.app.vocabularies.Permissionsall possible permissions in the portalText Input Fieldplone.app.vocabularies.AllowedContentTypesConfigured allowed mime-types (text/*) for text input fieldsplone.app.vocabularies.AllowableContentTypesAll possible mime types (text/*) for text input fieldsplone.app.vocabularies.AvailableEditorsConfigured WYSIWIG editorsPortal Typesplone.app.vocabularies.PortalTypesAll portal-types installed in the portalplone.app.vocabularies.ReallyUserFriendlyTypesStatic filtered list of portal-types.
Filter is a list of portal_type ids (strings) defined atplone.app.vocabularies.types.BAD_TYPES.plone.app.vocabularies.UserFriendlyTypesPortal types filtered as ‘user friendly’ by the Types Tool.Portal actionsplone.app.vocabularies.ActionsAll the actions category ids. Used in Actions portlet.plone.app.vocabularies.PortalActionCategoriesAll the actions categories (ids + translated title). Used in Actions control panel.Workflowsplone.app.vocabularies.WorkflowsAll installed workflowsplone.app.vocabularies.WorkflowStatesAll titles of workflow states - for any workflow installedplone.app.vocabularies.WorkflowTransitionsAll titles of workflow transitions - for any workflow installedSyndication/ Feedsplone.app.vocabularies.SyndicationFeedTypesConfigured allowed feed typesplone.app.vocabularies.SyndicatableFeedItemsFolders or Collections on the first two navigation levels (depth=2) relative to the site root.
Value is UID of the Folder or Collection, term is title of it
(searchable)Catalogplone.app.vocabularies.KeywordsIt either displays all Subjects aka Tags aka Keywords used by the portals content.
Or if there is aIEditingSchema.subjects_of_navigation_rootboolean set to True in the registry,
thegetNavigationRootObjectis used as the section and only keywords used in this section are part of the vocabulary.Developers can subclassplone.app.vocabularies.catalog.KeywordVocabulary, it is build to be developer friendly.keyword_indexproperty may be redefined to use a different index than ‘Subject’ for the Keywords.path_indexproperty may be redefined to use a different index thanpathfor the sections pathsectionmethod may be redefined to located the section keywords should be restricted to.plone.app.vocabularies.CatalogGeneric queryable catalogplone.app.vocabularies.MetadataFieldsList of available metadata fields (catalog brain columns) that can be used
as table columns in a folder or collection listing.Themeplone.app.vocabularies.SkinsThemes/ skins available in the portal.Date/Time Relatedplone.app.vocabularies.Timezonesall timezones provided bypytzplone.app.vocabularies.CommonTimezonescommon timezones provided by ‘pytz’.
This are those a user would choose from and is not too much confused.plone.app.vocabularies.AvailableTimezonestimezones configured in the portal.plone.app.vocabularies.Weekdaysthe seven weekdays in fullname.
Value is the day number start counting at zero on monday.
Title of the term is an i18n messagestring inplonelocalesnamespace, so it translates.plone.app.vocabularies.WeekdaysAbbrsame as above but with 3 character abbreviations.plone.app.vocabularies.WeekdaysShortsame as above but with 2 character abbreviations.plone.app.vocabularies.Monthsame as above but with month names starting with zero in January.plone.app.vocabularies.MonthAbbrsame as above but with 3 character abbreviations.Imagesplone.app.vocabularies.ImagesScalesAll image scales which are available on Plone site.API/ Toolsplone.app.vocabularies.terms.TermWithDescription(class)A SimpleTerm accepting additionally a description parameter.
Like title it may be used for display.plone.app.vocabularies.terms.BrowsableTerm(class)A term which may be browsed.
In a vocabulary those are used to identify terms which are actually browsable (e.g. those representing folders).plone.app.vocabularies.terms.safe_simpleterm_from_value(function)Create aSimpleTermfrom adirtyoruntrustedvalue.
Token is encoded carefully and Title converted to Unicode.plone.app.vocabularies.terms.safe_simplevocabulary_from_values(function)Create aSimpleVocabularyfrom a iterable (list) ofdirtyoruntrustedvalues.
Utilizes abovesafe_simpleterm_from_valueto achieve this.Source CodeContributors please read the documentProcess for Plone core’s developmentSources are at thePlone code repository hosted at Github.Changelog5.0.5 (2024-01-19)Internal:Update configuration files.
[plone devs] (cfffba8c)5.0.4 (2023-10-07)Bug fixes:Fix the untranslated table-column-heading “Title” in listing_tabular for collections and folders.
[pbauer] (#82)5.0.3 (2023-05-22)Bug fixes:Fix a circular dependency toplone.app.querystring.
Move.catalog.CatalogVocabularyFactorytoplone.app.querystring.vocabularies, move the ZCML to register the factory, move the the test and put BBB code with deprecation wanring into place.
Move.utils.parse_querywith new nameparseAndModifyFormquerytoplone.app.querystring.queryparserand put BBB code with deprecation wanring into place.
[@jensens] (fix-circular-dep-paquerstring)5.0.2 (2023-04-06)Bug fixes:Import navigation root specific from plone.base.
And so remove transitive circular dependency on plone.app.layout.
[jensens] (#74)5.0.1 (2023-03-22)Internal:Update configuration files.
[plone devs] (b2d5d4a5)5.0.0 (2022-11-30)Bug fixes:Final release.
[gforcada] (#600)5.0.0b1 (2022-08-31)New features:Remove dependency on CMFPlone (use plone.base).
In images vocab use utility instead of import.
isort/black (pure) and pyupgrade –py37-plus`.
Remove traces of six.
Bump version to 5.0.
[jensens] (#72)4.3.0 (2021-09-01)New features:Add newStaticCatalogVocabularyclass providing a simplified mechanism for
creating queryable content vocabularies. Allows use of e.g. AJAXSelectWidget for
fields that store Relations or UUIDs. (#66)4.2.2 (2021-02-16)Bug fixes:Change vocabulary tokens to usebase64.urlsafe_b64encode().
No newlines and safe to use as an xml attribute.
Seecommunity post.
[flipmcf] (#64)4.2.1 (2020-09-26)Bug fixes:Fixed deprecation warning for zope.site.hooks. (#3130)4.2.0 (2020-06-30)New features:Add new plone.app.vocabularies.MetadataFields vocabulary.
[vincentfretin] (#62)4.1.2 (2020-04-20)Bug fixes:Minor packaging updates. (#1)4.1.1 (2019-08-29)Bug fixes:Principals vocabularies: Fixed handling of results from multiple PAS plugins (like pasldap and mutable_properties). (#60)4.1.0 (2019-04-29)New features:Overhaul of the groups-vocabularyplone.app.vocabularies.Groups,
a refined version of the users-vocabularyplone.app.vocabularies.Users,
a new principals vocabulary combining users and groupsplone.app.vocabularies.Principals.
Ability to apply a filter to the vocabularies in subclasses.
Moved all toprincipals.py, bbb import are in place (user.py,security,py).
Deprecated theUserSourceandGroupsSourceimplementations.
Documented new vocabulary inREADME.rst.
Move doctests to unittests and added more tests.
Benefits:
200x faster validation of groups;
less and cleaner code;
unified code for all three vocabularies.
[jensens] (#56)4.0.7 (2018-09-27)Bug fixes:Python 3 support [ale-rt, pbauer]4.0.6 (2018-02-11)Bug fixes:Do not wake up all the users when no query is submitted
[ale-rt]4.0.5 (2018-02-05)Bug fixes:Fix test that breaks when catalog is not registered as a utility in CMF 2.3+
[pbauer]Add Python 2 / 3 compatibility
[vincero]4.0.4 (2017-07-03)Bug fixes:Letplone.app.vocabularies.SupportedContentLanguagesreturn the language title in native language.
[thet]Remove unittest2 dependency
[kakshay21]4.0.3 (2017-05-10)Bug fixes:return empty vocabulary when no imagescales defined
[fgrcon]4.0.2 (2017-03-29)Bug fixes:plone/Products.CMFPlone#1794: use permissive vocabulary type
for numeric-indexed weekday and month vocabularies
to avoid breaking GenericSetup import.
[seanupton]plone/Products.CMFPlone#1268: use permissive vocabulary type
for ReallyUserFriendlyTypes, to avoid insertion of new types
in plone.displayed_types (registry) from breaking GenericSetup
profiles in add-ons.
[seanupton]4.0.1 (2017-01-12)Bug fixes:Fix problem in ParseError fallback introduced in 4.0
[jensens]4.0 (2016-11-17)Breaking changes:Make zope.formlib optional.
[gforcada]Mark vocabularies based on zope.formlib as deprecated.
[gforcada]Bug fixes:Adapt code to follow Plone styleguide.
[gforcada]Fix in catalog: If ZCTextIndex catches a ParseError, try w/o SearchableText if there is one given.
OftenQuery contains only common wordshappen (only stop words given) and results are not fetched.
Semantically this means that we want all results.
[jensens]3.0 (2016-06-12)Breaking changes:CatalogVocabulary now takes a query for it’s constructor instead of a LazyMap of brains
and lazy loads terms. Also, in __contains__, do a UID query instead of checking the
entire contents of the result. This prevents potential DOS with custom code where the
whole contents of the catalog would get loaded with terms created for it on every
validation attempt.
[vangheem]New features:Optional allow to filter keyword vocabulary to a currentsectionbased on the current context.
The class was build for easy subclassing - and still is.
It allows to override the section fetching logic in a subclass.
The default logic is first to look in the controlpanel if there is aIEditingSchema.subjects_of_navigation_rootboolean.
If itsTruethegetNavigationRootObjectis used as the section and only keywords used in this section are part of the vocabulary.
Otherwise all keywords in the index are displayed.
[jensens]2.3.0 (2016-06-07)New features:RefactorKeywordsVocabularylogic of term construction fromdirtyvalues out into own functions.
Document functions in README.
[jensens]2.2.5 (2016-05-25)Bug fixes:Import getAllowedSizes from CMFPlone to avoid dependency on plone.app.imaging.
[davisagli]Fix bug where queries would not be parsed correctly for date queries on the catalog
vocabulary
[vangheem]2.2.4 (2016-04-26)New:Add ImagesScales vocabulary.
[bsuttor]Fixes:increase readability of code in CatalogSource.
[jensens]2.2.3 (2016-03-03)New:Vocabulary for permissions
[ebrehault]Vocabulary for portal action categories
[ebrehault]2.2.2 (2016-02-25)Fixes:Restrict Catalog vocabulary to search current Navigation Root unless
path is specified.
[alecm]2.2.1 (2015-12-03)Fixes:Make user vocabulary handle non-ASCII characters.
This fixeshttps://github.com/plone/plone.app.widgets/issues/120[davisagli]2.2.0 (2015-10-28)Fixes:Updated version to 2.2.0, as the previous release introduced an
incompatibility with Plone 4.3.
[maurits]Pull default_charset value from the configuration registry.
[esteele]2.1.21 (2015-09-07)Pull available_editors values from the configuration registry.
[esteele]2.1.20 (2015-08-13)Cleanup: PEP8, decorators for zca, et al. Also pimped the README.
[jensens]2.1.19 (2015-07-29)Fixed SyndicatableFeedItems to allow unicode characters in objects titles.
[Gagaro]2.1.18 (2015-06-05)change CatalogSource to be able to validate
path strings in addition to UIDs
[vangheem]2.1.17 (2015-05-13)default to having english with AvailableContentLanguageVocabularyFactory
to fix issue that happens sometimes when setting language and multilingual
is not installed
[vangheem]Fix issue with missing context in plone.app.vocabularies.Users.
[pbauer]2.1.16 (2014-09-07)Added the missing Authenticated and Anonymous roles within theRolesVocabulary`.
[ichim-david]Cleanup.
[thet]2.1.15 (2014-04-11)MakeKeywordsVocabularymore customizable using ankeyword_indexclass variable to allow users to inherit and just override that attribute
to build their own keyword vocabularies.
[saily]Add datetime related vocabularies: timezones, weekdays, months.
This are moved fromplone.app.eventand extended by to be more
complete.
[yenzenz]Add catalog source which can eventually replace the vocabulary.
[davisagli]2.1.14 (2014-02-23)Add actions vocabulary.
[giacomos]2.1.13 (2014-01-27)2.1.12 (2013-11-14)provide proper contains method for catalog results
[vangheem]fallback to getSite for grabbing portal_catalog
[vangheem]catalog vocabulary query could be None
[garbas]getTerm and getTermByToken were not really checking if item is in the
vocabulary list
[garbas]use sort_on and sort_order in catalog vocabulary
[vangheem]2.1.11 (2013-07-18)Add documentation to SlicableVocabulary, fix handling of internal structure
[do3cc]SlicableVocabulary context is not needed when initialing
[garbas]KeywordsVocabularyFactory now accepts query which filters keywords listed in vocabulary
[garbas]add support for a catalog vocabulary
[vangheem]2.1.10 (2013-01-30)UsersVocabulary should search on fullname .
[garbas]2.1.9 (2013-01-13)adding users vocabulary (lazy loading of users) also supports searching over
users.
[garbas]2.1.8 (2012-10-03)Make KeywordsVocabulary work with unicode and non-unicode vocabularies.
[thet]Fix exceptions with workflow states/transitions titles when their titles
contained encoded characters [ericof]Fix exception with workflow vocabulary when workflow titles contained UTF-8 encoded
characters [miohtama]Add syndication feed types vocabulary
[vangheem]2.1.7 (2012-07-02)Depend on zope.formlib instead of zope.app.form.
[davisagli]Remove hard dependency on Archetypes.
[davisagli]2.1.6 (2012-04-09)Made our mock queryUtility in the tests more life like.  This avoids
test failures in combination with zope.pagetemplate 3.6.0 or higher.
[maurits]2.1.5 - 2011-12-22Ensure that the keywords vocabulary term titles are unicode values,
as per zope.schema.interfaces.ITitledTokenizedTerm.
[mj]2.1.4 - 2011-12-22Ensure that the keywords vocabulary term tokens are 7-bit values,
as per zope.schema.interfaces.ITokenizedTerm.
[mj]2.1.3 - 2011-07-04Roles vocabulary is translated and sorted by translated role id.
Fixeshttp://dev.plone.org/plone/ticket/11958.
[WouterVH]2.1.2 - 2011-04-21Types vocabularies are sorted by translated titles.
[thomasdesvenain]Add MANIFEST.in.
[WouterVH]Transitions vocabulary is translated and sorted by transition id.
[thomasdesvenain]2.1.1 - 2011-03-02Exclude ‘text/x-plone-outputfilters-html’ from the allowable content types
vocabulary.
[davisagli]2.1 - 2011-02-10Remove “Discussion Item” from BAD_TYPES vocabulary.
[timo]2.0.2 - 2010-10-27Translation of workflow states vocabularies didn’t work in some contexts.
[thomasdesvenain]2.0.1 - 2010-07-18Update license to GPL version 2 only.
[hannosch]2.0 - 2010-07-01Internationalized editor label (especially for ‘None’ value).
[thomasdesvenain]2.0b4 - 2010-06-13Use the standard libraries doctest module.
[hannosch]2.0b3 - 2010-04-07Add a vocabulary to list all Keywords (via the Subject index).
[esteele]Avoid ConstraintNotSatisfied-error when GS-importing the default navigation
portlet. Fixeshttps://dev.plone.org/plone/ticket/8380[WouterVH]2.0b2 - 2010-01-24In the skins vocabulary, give the ‘Plone Default’ skin the title ‘(Unstyled)’
to reduce confusion, now that Sunburst is actually the default.
[davisagli]2.0b1 - 2009-12-27Added missing zope.browser dependency.
[hannosch]2.0a2 - 2009-12-16Avoid the last use ofSimpleVocabulary.fromItems. This refshttp://dev.plone.org/plone/ticket/6480.
[hannosch]Removed funky Acquisition handling for vocabularies inside addforms. This
closeshttp://dev.plone.org/plone/ticket/9408.
[hannosch]2.0a1 - 2009-11-14Avoid dependencies on zope.app.pagetemplate and zope.app.schema.
[hannosch]Added AvailableEditors vocabulary.
[robgietema]Removed ChangeSet from the BAD_TYPES as this is not a portal type anymore.
[maurits]Use the ITerms interface from the new zope.browser package.
[hannosch]Specified package dependencies.
[hannosch]1.0.6 - 2008-11-06Made the tests forward-compatible with Python 2.6.
[hannosch]The QuerySearchableTextSourceView made terms with string titles. However
zope.app.form.browser.source assumes it to be unicode, with the result that
you get unicode errors if you have non-ascii characters. [regebro]1.0.5 - 2008-08-18Documentation updates.
[hannosch]1.0.4 - 2008-03-09Added option to omit the current folder in a browse query, this is used
for the UberSelectionWidget.
[fschulze]1.0.3 - 2008-02-13Added tests for the catalog, groups and users sources. Fixed three bugs,
where a LookupError was not raised.
[hannosch]Added tests for the special term classes.
[hannosch]Added tests for the language, security, skins, types and
workflow vocabularies.
[hannosch]1.0.2 - 2007-12-24Fixed invalid context argument passed into the translation machinery in
the workflow state vocabulary. This fixeshttp://dev.plone.org/plone/ticket/7492.
[hannosch]Added optional default query string to searchable text source.
[fschulze]Correct name for attributes.
[wichert]1.0.1 - 2007-08-17Fixed catalog vocabulary when dealing with the degenerate-case of
an empty value. This makes it work better with the UberSelectionWidget.
[optilude]Made catalog vocabulary less fragile for simple/short queries.
[optilude]1.0 - 2007-08-14Fixed ReallyUserFriendlyTypesVocabulary to include the Messages for
type names. This refshttp://dev.plone.org/plone/ticket/6911.
[hannosch]1.0rc3 - 2007-07-28Fixed missing history.
[hannosch]1.0rc2 - 2007-07-27Fixed to return localized workflow state names.
[deo]1.0rc1 - 2007-07-09Added new ReallyUserFriendlyTypes and a BAD_TYPES list, which are used
to filter out types which are not content types at all.
[hannosch]Added new AvailableContentLanguages and SupportedContentLanguages
vocabularies.
[hannosch]If we have a users vocabulary, we should have a groups one :)
[optilude]Make use of description-aware terms
[optilude]Allow parameterisation of the query, so that we can restrict to
folders-only, for example.
[optilude]Add a user source, so that we can use the UberSelectionWidget on users.
[optilude]1.0b3 - 2007-05-1Back to getToolByName we go.
[wichert]1.0b2 - 2007-03-23Replaced getToolByName with getUtility.
[hannosch]1.0b1 - 2007-03-05Added workflow vocabulary.
[optilude]Added UserFriendlyTypes vocabulary.
[hannosch]1.0a2 - 2007-02-06Some initial vocabularies.
[hannosch, optilude]Initial package structure.
[zopeskel]