Package: collective.iconifiedcategory
collective.iconifiedcategoryThis product will let you categorize created content using a category identified by an icon.A dexterity behavior can be enabled and will add a field “content category” that will list available categories defined in a configuration.So you first have to define the categories by adding a ContentCategoryConfiguration somewhere.  Then add a CategoryGroup on which some extra features may be activated :is content confidential?is content an element to print?is content an element to sign?If activated, these fields will be available on the content using the behavior.Then into a CategoryGroup, you will be able to add ContentCategory that are characterized by a title and an icon.  These ContentCategory elements will be the terms of a vocabulary used to select a category on a content using the behavior.This package is widely overridable and is made to manage many usecases of iconified categories.A element that contains categorized content will display a special widget where categorized content are grouped by ContentCategory behind an icon.A table view is also available listing categorized contents with more details.Screenshots to come…InstallationInstall collective.iconifiedcategory by adding it to your buildout:[buildout]

...

eggs =
    collective.iconifiedcategoryand then runningbin/buildoutContributeIssue Tracker:https://github.com/collective/collective.iconifiedcategory/issuesSource Code:https://github.com/collective/collective.iconifiedcategoryLicenseThe project is licensed under the GPLv2.ContributorsMartin Peeters, Original Author [Affinitic]Changelog0.66 (2024-02-27)Corrected bug due to typo.
[sgeulette]0.65 (2024-02-19)Replaced container cloned event by moved event to handle rename, copy/paste and cut/paste of a container in the path.
[sgeulette]Removed useless IconifiedModifiedEvent
[sgeulette]UsedIIconifiedCategorizationMarkerin adequate subscribers definition
[sgeulette]Removed some hasattr tests (MOD-831) and corrected events object
[sgeulette]Handled cut/paste and rename of a categorized element
[sgeulette]0.64 (2024-02-08)AddedIExcludeFromNavigationbehavior onContentCategoryConfigurationtype.
[sgeulette]Corrected bad step dependency
[sgeulette]0.63 (2024-01-02)Addedget_andset_methods for settings registry records inconfig.py.
[gbastien]0.62 (2023-12-11)FixedCategorizedObjectPreviewAdapter.statuswhen an existing element is updated.
[gbastien]0.61 (2023-11-27)SimplifiedCategorizedChildView.has_elements_to_show.
[gbastien]0.60 (2023-09-21)Fixed version (2105) inmetadata.xml.
[gbastien]0.59 (2023-09-04)Display the document conversion spinner in any relevant case.
[gbastien]AddedcontentTypevalue to thecategorized_elementsdata.
[gbastien]0.58 (2023-08-24)Added new fieldICategorize.show_previewto turn link to element to acollective.documentviewerpreview instead download.
Fixed icon displayed when preview computation in progress.
[gbastien]Force iconwidth/heightto16pxintooltipster(categorized-childs.ptandcategorized-childs-infos.pt).
[gbastien]FixedContentCategoryportal_type title inContentCategory.xml.
[gbastien]0.57 (2023-03-30)When no request (when usingplone.app.async), passNoneinstead{}toImageDataModifiedImageScalingsoplone.namedfilescaling is happy
when usingplone.protect >= 3.
[aduchene]0.56 (2023-02-27)Adapted french translation forMore infos.
[gbastien]0.55 (2022-09-29)Fixedutils.get_ordered_categoriesandIconifiedCategoryGroupAdapter.get_every_categoriesto make sure returned
categories are from the correctconfig_rootandcachekeyis invalidated
ifconfig_rootchanged.
[gbastien]0.54 (2022-06-14)Added@@categorized-childs-managethat will render a link to manage
categorized elements.
[gbastien]ImplementedCategorizedContent._unrestrictedGetObjectascollective.eeafaceted.z3ctablecalls nowitem._unrestrictedGetObjectinsteaditem.getObjectfor performance optimization.
[gbastien]Addedsafe_utils.pythat will only include safe utils.
[gbastien]We need to escape some content to avoid malicious content:Rely on collective.eeafaceted.z3ctable to display the categorized content table, it manages escaping content;Escape category title in vocabularies.[gbastien]0.53 (2022-04-22)MakevalidateFileIsPDFinvariant check if acontentTypeis directly
available on data, this avoid checking on the file.
[gbastien]0.52 (2022-03-22)Fixedmetadata.xmlversion, set2103instead2101.
[gbastien]0.51 (2022-03-10)Updated upgrade step to 2103 (Add ‘last_updated’ to categorized_elements),
do not stop in case we found alast_updatedkey incategorized_elementsof an element but continue to next element, maybe some elements were updated
by another part of code.
[gbastien]0.50 (2022-01-03)Use unrestricted catalog query when possible.
[gbastien]For the view that generated the CSS, do the catalog query that gets the categories
withoutpathandsort_onas called from portal and order does not matter.
[gbastien]Addedcollective.iconifiedcategory.every_categoriesandcollective.iconifiedcategory.every_category_titlesvocabularies returning
every possible categories, including not enabled ones. This will be used to
manage aMissingTermsadapter forz3c.form.
[gbastien]Fixed view that generatescollective-iconifiedcategory.css, get every
categories including ones that are notenabled.
[gbastien]Optimized@@categorized-childsview, compute everything only one time
(context url, context UID, …) and usepythonorstringin TAL expressions.
By default callutils.get_categorized_elementswithcheck_can_view=False.
[gbastien]Addedcheck_can_view=Trueparameter toutils.get_categorized_elements.
This will do theIIconifiedContent.can_viewcheck only done when necessary.
[gbastien]Added datalast_updatedtocategorized_elementsto be used for caching.
Added upgrade step to version2103.
[gbastien]Optimizedram.cachekey forutils.get_ordered_categories, cache until
any category added/deleted/position changed.
[gbastien]0.49 (2021-07-16)Added possibility to filter displayed categorized elements on any attribute
of the categorized element.
[gbastien]Rely on imio.helpers because we need the:jsonsuffix type converter.
[gbastien]Register thecategorized_content_container_cloned ObjectClonedEventhandler
only forAT IBaseObjectandDX IDexterityContentor is is applied also
for other elements likeportal_typebecause it providesOFS IItem.
[gbastien]Added specificcollective.iconifiedcategory.belowcategorizedelementsviewlet
manager just under the categorized elements table that will be displayed if
table displayed.
[gbastien]Make thez3c.table CategorizedTableeasy to override by making aBrowserViewout of it.
[gbastien]AdaptedFilesizeColumnto display total filesize in column header.
[gbastien]Addedsoft_warn_filesize, a CSS class applied to files of more that1 Mb(like it is already the case for thewarn_filesizeCSS class applied to
files of more than5 Mb).
[gbastien]Removed theShow detailsaction, details are always shown, except, for
display reasons, when more that 2 columns of elements in the popup.
[gbastien]0.48 (2021-01-19)Rely onCategorizedObjectAdapter.can_viewto manage access to a categorized
element, this way, we may manage usecases where current user does not have
theViewpermission on the element but access is managed by thecan_viewadapter method.
[gbastien]0.47 (2020-08-18)Added missing translation forNothing..
[gbastien]Inutils._categorized_elements, useaq_baseto getcategorized_elementsto be sure we get the one on context.
Indeed the parent could have this attribute too…
[gbastien]Do not useportal_catalogto getcategorized_elements, instead, storeallowedRolesAndUsersin thecategorized_elementsdata and rely on it to
get the content directly stored in the parent.  This for performance reasons.
[gbastien]Remove unusedutils.get_UIDfunction.
[gbastien]Make sure a content created with an unexistingcontent_categorydoes not break anything.
[gbastien]0.46 (2020-06-24)Makeplone.restapivalidation happy by defining default value forIIconifiedCategorization.default_titlesthat is not stored on the
adapted context.
[gbastien]0.45 (2020-05-26)When usingcollective.solr, brains are notICatalogBrainbutPloneFlareso registerIIconifiedContentadapter for it when installed.
[gbastien]0.44 (2020-05-08)Do no more make the elements using behavior marked withIIconifiedCategorizationorcontent_category.setteris not working
anymore.
[gbastien]0.43 (2020-04-30)Adapted tests to usefile_txtinsteadfileas id for defaultFileasfileis also the name of the field,portal.filereturns theFileinstance instead breaking because it does not have afilefield.
[gbastien]Do not break inutils.validateFileIsPDFwhile creating a new element and
no file has been selected.
[gbastien]0.42 (2020-04-29)Added parameteruse_category_uid_as_token=FalsetoCategoryVocabulary.__call__method to be able to use category/subcategory
as term token instead the calculated content_id (default).
[gbastien]0.41 (2020-03-12)Factorized events triggered when a categorized element attribute is changed
(to_print,confidential, …).  Now a singleIIconifiedAttrChangedEventevent is triggered.  Moreover it is optimized to avoid too much process.
[gbastien]Removed specific call toIconifiedAttrChangedEvent(‘confidential’)when creating a new categorized element.
[gbastien]AddedICategorize.only_pdfparameter making it possible to define if the
categorized element is a file, that it can only be PDF.  Added also invariant
onIIconifiedCategorizationchecking if file is a PDF when categorized
element has a file field and used content_category hasonly_pdf=True.
[gbastien]0.40 (2020-02-18)Make appearance of column inCategorizedTabViewcoherent with appearance of
detail icon in@@categorized-childs-infosview,
rely in both case onCategorizedChildInfosView.show[gbastien]0.39 (2019-11-26)Added management ofpublishableattribute like it is the case forto_printorconfidentialattributes.  Factorized when possible.
[gbastien]0.38 (2019-08-23)Fixed code to work withplone.app.asyncas in this case, there is noREQUEST.  To do this, needed to get the@@imagesview by instantiating theImageDataModifiedImageScalingclass, this could be a problem if it is
overrided by a subpackage.
[gbastien]Tried to fix again tooltipster popup when categorized element title is
displayed on several lines…
[gbastien]0.37 (2019-06-14)Avoid vertical scroll in tooltipster popup when categorized content title
is displayed on several lines.
[gbastien]Force use distribution trusty in Travis.
[gbastien]0.36 (2019-04-23)OverridedImageScaling.modifiedto take into account real stored icon file_p_mtimeinstead category_p_mtimebecause the category’s_p_mtimecan
be modified for several reasons and that breaks existing content using the
icon. Moreover, it is now necessary to update elements using a category only
when icon file changed.
[gbastien]Force display small icon in select2 droprown so it fits the available space,
this is the case when a large icon was uploaded.  Added description on fieldContentCategory.iconexplaining to use a 16x16 image icon.
[gbastien]0.35 (2019-02-22)Use ram.cache for utils.get_ordered_categories to cache during a REQUEST.
[gbastien]Added parameteronly_enabled (True by default)whenusing utils.get_ordered_categoriesandIconifiedCategoryGroupAdapter.get_every_categoriesto be able to have every
categories in utils.sort_categorized_elements.
[gbastien]Use generated url forscale minias icon url so it can be cached.
[gbastien]TriggerCategorizedElementsUpdatedEventafter elements using a
ContentCategory have been updated.
[gbastien]Usenatsortedinsteadrealsortedto sort annexes by title.
[gbastien]Updated upgrade step as step to 2100 should be done before step to 2000…
Removed step to 2000 and integrated it into step to 2100 so we first compute
ContentCategory icon listing scale then update every categorized elements.
[gbastien]0.34 (2019-01-31)Displaycontent_categorytitle at the top of@@categorized-childs-infostooltipster view.
[gbastien]Usenatsort.realsortedto sort categorized elements on their title,
elements are sorted regardless of uppercase or lowercase title.
[gbastien]Movedcontext._p_changed = Trueto theutils.sort_categorized_elementsmethod so we are sure that calling it will correctly manage_p_changed.
[gbastien]0.33 (2018-08-03)Adapted CSS regardingFontAwesomewhere font name changed in version 5+
fromFontAwesometoFont Awesome 5 Free.
Requirecollective.fontawesome >= 1.1.
[gbastien]0.32 (2018-05-04)Addedmany_elements_7_columnsandmany_elements_8_columnsstyles necessary
when displaying really many elements on several columns.
[gbastien]Make sure the icon sticks to the text first word in the tooltipster popup
by wrapping the icon and categorized element title first word in a<span>that uses astyle=”white-space: nowrap”.
[gbastien]0.31 (2018-05-03)Fix CSS applied in tooltipster popup for active confidential.
[gbastien]0.30 (2018-04-20)Make sure number of elements applied CSS is done when tooltipstered or not.
[gbastien]Added possibility to pass a CSS selector tocategorizedChildsInfos, the JS
method that initializetooltipsterfor categorized elements.
[gbastien]0.29 (2018-02-14)Adapted JS call totooltipsterascollective.js.tooltipsternow usestooltipster4.2.6.  Requirecollective.js.tooltipster> 0.1
[gbastien]0.28 (2018-01-23)When changing an element’scontent_category, reapply the default values for
fieldsto_print,confidential,to_signandsignedif it was still the
original default value defined on originalcontent_category.  Default values
are linked to thecontent_category.
[gbastien]0.27 (2017-12-07)Inactionview.BaseView, moved theObjectModifiedEventfrom the__call__to theset_valuesmethod so using it directly updates thecategorized_elementsof the parent.
[gbastien]0.26 (2017-11-29)Use a specific static resourceDirectory for images.
[gbastien]0.25 (2017-11-28)Callactionview._may_set_valuesinIconClickableColumn.is_editableto avoid double logic.
[gbastien]0.24 (2017-11-27)Fixed migration that addsto_sign/signedrelevant data to thecategorized_elementsof the parent containing categorized contents.
Execute the update withlimited=Falseand do not care about already
migrated content, do the update on every found elements.
[gbastien]Added tests for theSignedChangeViewview especially theloopamong
possibleto_sign/signedcombination values.
[gbastien]Do not break when deleting an element having acontent_categoryif container
does not have thecategorized_elementsdict.
[gbastien]Improved some translations.
[gbastien]Factorized the way categories and subcategories are get for thecontent_categoryvocabulariescollective.iconifiedcategory.categoriesandcollective.iconifiedcategory.category_titlesso it is easy to override and
we rely on same method for both vocabularies that needs same source.
[gbastien]0.23 (2017-08-10)Added management ofto_signandsignedattributes like it is the case forto_printandconfidentialattributes.  Both attributes are used behind a
single actionsignedthat have 3 options :not to sign,to signandsigned.
[gbastien]Default values forto_print,confidentialandto_sign/signedare now
managed in theIObjectAddedEventno more in thecontent_category setter,
this way every attribtues are managed the same way becauseto_printandconfidentialare simple attributes whereto_sign/signedcan come from theScan metadatabehavior ofcollective.dms.scanbehavior.
[gbastien]Added possibility to show/hide details aboutto_print,confidential,to_sign/signedin the categorized elements tooltipster.0.22 (2017-08-04)Make portal available on the tabview instance.
[gbastien]0.21 (2017-07-18)Reverted changes from releases0.19and0.20, we do not bypass can_view if
element is notconfientialbecausecan_viewcould take into account other
elements thanconfidential.
[gbastien]0.20 (2017-07-14)Make sure we correctly bypasscan_viewinutils._check_van_viewwhen
element is not confidential in case we do not receiveobjbutcategorized_elements.
[gbastien]0.19 (2017-07-13)Factorized call to _check_can_view from utils and views so we are sure that
the check is only done if obj is confidential.  This fix a bug where can_view
check was done for not confidential obj and raised an error on @@download even
though it was displayed in the categorized elements table.
[gbastien]0.18 (2017-05-29)Added missing translation when updating categorized elements using the
@@update-categorized-elements view.
[gbastien]Use icon_expr instead content_icon on the types fti to define the icon.
Actually we want to define no icon as the type icon is displayed using CSS.
[gbastien]Added one additional level to thecontent_categorygenerated byutils.calculate_category_idto avoid samecontent_categorygenerated for
different category group.
[gbastien]Added parametersort=Truetoutils.update_all_categorized_elementsto be
able to disable time consuming sorting.
[gbastien]0.17 (2017-03-22)Make theplone.formwidget.namedfile@@downloadview can_view aware.
[gbastien]0.16 (2017-03-08)Correctly hide to_print and confidential widgets on add and display view
if they were deactivated on the group
[mpeeters]Add new events to limit updated informations on parent
[mpeeters]Add an option to update only category informations on parent
[mpeeters]0.15 (2017-02-17)Adapted translations so it is more understandable.
[gbastien]Do only call_cookCssResourcesincategory_before_removeif not currently
removing thePlone Site.
[gbastien]MakeICategory.icona primary field so we may use a simpler download URL
that is only thepath_to_object/@@downloadwithout the file name anymore.
This is done to surround a bug in Apache that occurs when the filename
contains the%character.
[gbastien]0.14 (2017-02-13)Generate a CSS class on the<ul>tag of thecategorized-childs-infosview
that is the AJAX view called when hovering thecategorized-childselements
that will give the ability to display the infos on several columns.  This is
necessary when displaying a large amount of categorized elements using same
content_category.  TheMaximum number of elements to display by columns
when displaying categorized elements of same category in the tooltipster widgetcan be defined in the iconifiedcategory control panel.
[gbastien]Moved registry parameterfilesizelimitto the IIconifiedCategorySettings.
[gbastien]Added a way to defer call toutils.update_all_categorized_elementsin thecategorized_content_container_clonedIObjectClonedEvent event handler.
[gbastien]0.13 (2017-02-09)Makescollective-iconifiedcategory.csscacheable and cookable to avoid
recomputing it for every pages.  We callportal_css.cookResourceswhen
a category is added or moved.  Not necessary to recook for subcategory
as it uses same CSS class as parent category.
[gbastien]0.12 (2017-02-09)Do not fail inutils.get_categorized_elementsif context does not have thecategorized_elementsOrderedDict.
[gbastien]0.11 (2017-02-07)Use a batchSize of 999 in the tabview to show every categorized elements.
[gbastien]Inutils.get_categorized_elements, do not do the catalog query if the
categorized_elements dict is empty.
[gbastien]0.10 (2017-02-05)Only checkcan_viewif current element isconfidential, moreover only
instanciate theIIconifiedContentadapter to check forcan_viewwhen
element isconfidential.
[gbastien]0.9 (2017-01-31)Adapted CSS selector that changesfont-sizeof number of categorized
elements displayed in the tooltipster
[gbastien]Added a way to defer the categorized_content_created event and to defer
call to utils.update_categorized_elements in the categorized_content_updated
event.  This way we may manage adding several categorized elements but only
updating the categorized_elements dict (including time consuming sorting)
at the right time
[gbastien]Fixed tests to work in both Plone 4.3.7 and Plone 4.3.11
[gbastien]0.8 (2017-01-25)Do not fail incategorized-childs-infosif current context does not have
thecategorized_elementsdict
[gbastien]0.7 (2017-01-23)Usecategory_uidinsteadcategory_idas key for infos dict used byCategorizedChildInfosView, indeed we may have different configurations
used on same container for different categorized elements and those
configurations may contain categories with same id
[gbastien]Do not break if icon used for iconified category contains special characters
[gbastien]0.6 (2017-01-17)Use ajax to display the categorized childs informations
[gbastien]Display select2 widget larger and with no padding between options
so more options are displayed together
[gbastien]Added optionshow_nothing=Trueto thecategorized-childsview
to be able to show/hide the ‘Nothing’ label when there is no categorized
content to display
[gbastien]0.5 (2017-01-13)Do not fail inutils.sort_categorized_elementsif a key is not found,
it can be the case when copy/pasting and new element use another
configuration
[gbastien]0.4 (2017-01-12)Sortcategorized_elementsby alphabetical order into a category,
this way it can be directly displayed as it in the tooltipster
or in the tabview without having to sort elements again
[gbastien]Add methodIconifiedCategoryGroupAdapter.get_every_categoriesthat gets every available categories.  Mainly made to be overrided,
it is used inutils.get_ordered_categoriesto manage the fact
that a container could contain categorized elements using different
group of categories
[gbastien]Add a configlet to allow user to sort elements on title on the
categorized tab view
[mpeeters]Ensure that categorized elements are sorted by group folder order
[mpeeters]Refactoring of iconified JavaScript functions
[mpeeters]Increase speed that show the categorized elements in the tooltipster.
[gbastien]Do not fail to remove the Plone Site if categories or subcategorie exist.
[gbastien]0.3 (2016-12-21)Changed icon used with link toMore infos.
[gbastien]Do not fail if subcategory title contains special characters.
[gbastien]Turn iconmore_infos.pnginto a separated resource, in addition to other
resources stored in thestaticfolder declared as resourceDirectory,
so it is easy to override.
[gbastien]0.2 (2016-12-07)Usejavascript:event.preventDefault()when clicking on the tooltipster root
element to avoid the link action that will change the current url.
[gbastien]OpenMore infoslink intarget=_parentso it opens in the _parent frame
when displayed in an iframe, namely outside the iframe.
[gbastien]0.1 (2016-12-02)Initial release.
[mpeeters]