Package: imio.helpers
imio.helpersVarious helper methods for development.RequirementsThe barcode generation method uses zint tool (https://sourceforge.net/projects/zint/).You have to install zint version >= 2.6.0.CachingUse cache.get_plone_groups_for_user(the_objects=True) instead portal_groups.getGroupsForPrincipal
Avoid portal_groups.getGroupById but use source_groups.getChangelog0.80 (2023-12-11)Added parameterwith_user_idtocontent.get_user_fullname, this will
includeuseridin brackets in result likeFirstname Lastname (userid).
[gbastien]Added parameteruseridtosecurity.get_user_from_criteria[sgeulette]0.79 (2023-11-28)Improvedsecurity.get_user_from_criteriato add email and description in ldap results.
[sgeulette]Included Products.CMFCore permissions.zcml
[sgeulette]0.78 (2023-10-27)Addedworkflow.get_final_statesthat will return a given WF final states.
[gbastien]0.77 (2023-10-19)Addedxhtml.unescape_htmlthat will decode HTML entities of a HTML text.
[gbastien]0.76 (2023-09-28)Addedtransmogrifier.get_correct_idto generate a unexisting id with numbered or lettered suffix.
[sgeulette]Renamedtransmogrifier.correct_pathtotransmogrifier.get_correct_path[sgeulette]0.75 (2023-09-04)Fixedsetup.load_type_from_packagewhen loading a Dexterity FTI because
it fails to purge old values.
Purging is disabled forDexterity FTI, added new parameterpurge_actions=Falsethat will remove the actions for aDexterity FTIso it is reloaded in correct order.
[gbastien]Improvedtransmogrifier.str_to_datewith min and max
[sgeulette]FixedValueError: ‘value’ is not in listincontent.sort_on_vocab_orderwhen a value of givenp_valuesdoes not exist in the givenp_vocab.
[gbastien]0.74 (2023-08-24)Fixedcache.obj_modifiedwhen checking annotations, take care that_p_mtimeis not changed on__annotations__when a value changes in a stored annotation
that is aPersistentMapping.
Also removed parameterasstring=False, whenasdatetime=False, returned
value is float which is convenient to be used in a cachekey.
[gbastien]Addcatalogparameter oncontent.uuidsToObjects,content.uuidsToObject,content.uuidsToCatalogBrainsanduuidsToCatalogBrainto allow query on
other catalogs (e.g. uid_catalog)
[mpeeters]0.73 (2023-07-20)Be more defensive incontent.get_user_fullname, in some case, a userid
is found inmutable_propertiesbut there is no properties associated with it.
[gbastien]Improvedtransmogrifier.clean_valuegiving a replacement value
[sgeulette]0.72 (2023-07-12)InsubmitFormHelperOnsuccessDefaultJS function, only manageblobifcontent-typeisapplication/xxx.
[gbastien]Addedcontent.sort_on_vocab_orderthat will sort a list ofvaluesrespecting a givenvocabularyterms order. This relies onsort_by_indexesfromimio.pyutilsthat is now a dependency.
[gbastien]0.71 (2023-07-07)Modifiedtransmogrifier.relative_pathto add option to keep leading slash
(True by default).
[sgeulette]Incontent.get_user_fullname, iffullnamenot found at the end,
finally fallback toportal_membership.getMemberInfo, this is sometimes
necessary when using LDAP.
[gbastien]Removed backward compatible imports forget_state_infos,get_transitionsanddo_transitionsmoved fromcontenttoworkflow.
[gbastien]0.70 (2023-06-21)Addedsecurity.check_zope_admin(moved fromProducts.CPUtils).
[gbastien]Improvedtransmogrifier.filter_keys[sgeulette]Addedworkflow.update_role_mappings_forhelper to update WF role mappings
for a given object.
[gbastien]0.69 (2023-05-31)MonkeypatchCatalogTool._listAllowedRolesAndUsersto addram.cachedecorator.
[gbastien]0.68 (2023-05-12)Addedsplit_textin transmogrifier module.
[sgeulette]Addedworkflow.get_leading_transitionsthat will return every WF transitions
leading to a givenstate_id.
[gbastien]0.67 (2023-03-29)Addedclean_value,correct_path,filter_keys,get_obj_from_pathin transmogrifier module.
[sgeulette]Addedkey_val,pool_tuples,str_to_datein transmogrifier module.
[sgeulette]Renamedtext_int_to_booltostr_to_bool[sgeulette]0.66 (2023-02-13)Addedtransmogrifiermodule withget_main_path,relative_pathandtext_int_to_boolfunctions.
[sgeulette]Addednone_if_unfoundparameter inget_user_fullnamefunction
[sgeulette]Added parameteronsuccess=falseto JS functioncallViewAndReloadso it is
possible to trigger custom JS code after a success.
[gbastien]Addedxhtml.is_htmlthat will return True or False if given text is HTML or not.
[gbastien]Raised validation error when email realname contains an accented character
[sgeulette]0.65 (2022-12-07)Return new date whencache.invalidate_cachekey_volatile_foris called withget_again=True.
[gbastien]Usedict.itemsinsteaddict.iteritemsfor Py2/Py3 compatibility.
[gbastien]0.64 (2022-10-28)Addedworkflow.remove_state_transitionsfunction do remove transitions on a state and clean duplicates
[sgeulette]Added more tests on cached methods.
[sgeulette]0.63 (2022-09-01)Invalidated ‘_users_groups_value’ volatile after a call ofGroupAwareRoleManager.assignRolesToPrincipal,ZODBRoleManager.assignRoleToPrincipalandZODBRoleManager.removeRoleFromPrincipal[sgeulette]Removed duplicated classifiers.
[sgeulette]0.62 (2022-08-19)AddedIMIORAMCacheusingIMIOStorageto extend used cache duration and
improve displayed statistics
[gbastien]Added cache on various acl methods followingdecorate_acl_methodsenv variable
[gbastien, sgeulette]Added IIMIOLayer BrowserLayer (need to execute upgrade step to 2).
[gbastien]Overridecaching-controlpanel-ramcacheto compute totals forHits,Misses,SizeandEntries, displayOlder entry, do not break to display statistics
when a pickle error occurs but add a portal message.
[gbastien]Added parameterttl=0tocache.get_cachekey_volatilethis way a date older
than giventtl(in seconds) will be recomputed.Added ‘none_if_no_user’ param incontent.get_user_fullname.
[sgeulette]Always return unicode incontent.get_user_fullname.
[sgeulette]Addedtest_helpers.ImioTestHelpersclass with useful methods from iA.delib
[sgeulette]Addedvocabularies.SimplySortedUsersand modifiedvocabularies.SortedUsers[sgeulette]Addedcache.get_users_in_plone_groups[sgeulette]Addedsetup.load_type_from_packageto reload a single type.
Movedworkflow.load_workflow_from_packagetosetup.load_workflow_from_package.
[gbastien]0.61 (2022-07-01)Moved workflow related functions from content to workflow module.
[sgeulette]Addedworkflow.load_workflow_from_packageto reload a single workflow.
[sgeulette]Be defensive in JS functiontoggleDetailsif tag is not available.
[gbastien]0.60 (2022-06-24)Handled unfound site inset_site_from_package_config.
[sgeulette]0.59 (2022-06-21)Addedescaped=Trueparam onxhtml.object_link.
[sgeulette]Require a version offuturerecent enough sohtml.escapeis available.
[gbastien]Added parameterreplace_not_found_image=Truetoxhtml.storeImagesLocally,
whenTrue(default) and an image could not be retrieved,
aNot foundimage will be used. This solves problem when copy/paste a private
image from another site, available in the browser because of shared
authentication but not retrievable.
[gbastien]0.58 (2022-06-14)Addedget_zope_rootto get zope app.
[sgeulette]Addedzope_appparameter inset_site_from_package_config.
[sgeulette]Fixedxhtml.replace_content, make sure the entire content is replaced
including sub tags.
[gbastien]0.57 (2022-06-10)AddedNoEscapeLinkColumnas base for link column rendering html.
Escape must be done in inherited column.
[sgeulette]content.uuidToObjectwill now returnNoneinstead an empty list if uuid not found.
[gbastien]Remove zope.app.publication dependency insecurity.set_site_from_package_configas it is now
removed since Plone >= 5.2.6
[aduchene]0.56 (2022-05-13)Addedsetup_ram_cachemethod.
[sgeulette]Addedset_site_from_package_configmethod
[sgeulette]0.55 (2022-05-06)Improvedget_relationsto get optionally referenced objects.
[sgeulette]0.54 (2022-03-25)Addedcontent.get_vocab_valuebased oncontent.get_vocabbut returns
the values (attr_name=’token’by default, may also bevalueortitle).
[gbastien]AddedEnhancedTermbased onSimpleTermprovidingattrsdict on term
[sgeulette]Addedcache.cleanForeverCachethat will clear cache of functions using the@forever.memoizedecorator.
[gbastien]0.53 (2022-03-17)Refactoredget_object[sgeulette]0.52 (2022-01-12)Addedcache.obj_modifiedfunction that returns max value between
obj.modified(), obj._p_mtime and __anotations__._p_mtime
[sgeulette]Addedcache.extract_wrappedfunction that returns original decorated function.
Useful to compare cached and non cached results in tests.
[sgeulette]Updated git fetch url
[sgeulette]0.51 (2022-01-03)Added monkey patch to handle SSL mailer on port 465.
[sgeulette]Addedcontent.base_getattrmethod that willgetattrwithout acquisition.
[gbastien]0.50 (2021-11-26)Addedcontent.get_transitionsto be able to get available transition ids
(aswfTool.getTransitionsForreturns a list of dict with transition infos).
[gbastien]Addedadapters.MissingTerms, a basez3c.formmissing terms adapter to be
extended by local packages.
[gbastien]Added cache auto invalidation mecanism when usingcache.get_cachekey_volatilethe caller method can be passed, it’s name is stored in the volatiles registry
then when callingcache.invalidate_cachekey_volatile_forwithinvalidate_cache=True, every cached methods are invalidated fromram.cache.
This will make stale cache be invalidated immediatelly as when a date changed,
the existing cache is never used again.
[gbastien]0.49 (2021-11-08)Requireplone.api>1.9.1because we needcontent._parse_object_provides_query.
This is necessay since we addedcontent.find.
[gbastien]0.48 (2021-10-20)Renamedcontent.ur_findtocontent.findwith unrestricted parameter.
[sgeulette]Fixedcontent.findto avoid error if corresponding looped object is deleted.
[sgeulette]0.47 (2021-10-13)Fixedcontent.get_user_fullnamethat was breaking when user had no fullname.
[gbastien]Addedcontent.ur_findthat’s the same as api.content.find but unrestrictedly
[sgeulette]0.46 (2021-09-28)Addedxhtml.replace_contentfunction that will replace the content of given
XHTML tag with some other content. This relies on packagecssselectthat is
added as an extra dependency thruimio.helpers[lxml].
[gbastien]0.45 (2021-07-16)Addedimio.helpers.SortedUsers, a vocabulary listing users sorted usingnatsort.humansorted. We need to rely onnatsortto handle this.
[gbastien]Fixed bug in JS functionsubmitFormHelperOnsuccessDefaultcalled onsuccess
bysubmitFormHelperto only consider response as a file to return if
responser headercontent-lengthis found in request, this avoid returning
a wrong blob object when called code returns an error message.
[gbastien]0.44 (2021-06-15)Inxhtml.separate_imagesbe a bit less defensive, too complex cases are
still ignored but when the<p>contains only non textual elements like<br>orblanks, just ignore these elements.
[gbastien]0.43 (2021-05-31)Lowercased email address after validation.
[sgeulette]FixedsubmitFormHelperOnsuccessDefaultJS function to handle binary response
so it is possible to download the result of the ajax query.Addedxhtml.imagesToDatathat turns the src of images used in a xhtml
content from anhttpor equivalent URL to a data base64 value.
[gbastien]0.42 (2021-04-30)Added parameterfiletype=’PNG’tobarcode.generate_barcodeso it is
possible to use another supported image file format.
[gbastien]Added parameterreplytotoemailer.send_emailso it is possible to addreply-toheader in message
[sgeulette]Adaptedcontent.object_valuesandcontent.object_idsto be able to pass
a single class name or a list of class names like it is the case forobjectValues/objectIds.
[gbastien]0.41 (2021-04-21)Corrected encoding problem in emailer.
[sgeulette]0.40 (2021-04-01)Addedtargetoption inobject_linkfunction
[sgeulette]Added a ZPublisher:jsonsuffix type converter.
[gbastien]Changed MockMailHost patch to avoid some problems
[sgeulette]Makexhtml.storeImagesLocallyhandle images withsrcusing base64 encoded
data (likedata:image/png;base64,…).
[gbastien]0.39 (2021-02-25)Addedvalidate_email_addressto check email address with a real name part.
[sgeulette]Addedvalidate_email_addressesto check email addresses, separated by a comma.
[sgeulette]Addedcontent.get_modified_attrs, when called in aIObjectModifiedEventhandler, will return the list of field names that were actually modified.
[gbastien]Returned email sender error messages.
[sgeulette]Addedcontent.uuidToCatalogBrainthat is a shortcut tocontent.uuidsToCatalogBrainsbut that will return a single value.
[gbastien]Addedcontent.object_valuesandcontent.object_idsmethod, equivalent to
Zope’sobjectValuesandobjectIdsbut that will check contained element
class name insteadmeta_typeso it works with DX content types wheremeta_typeis the same for every types.
[gbastien]Addedcontent.uuidToObjectthat is a shortcut tocontent.uuidsToObjectsbut that will return a single value.
[gbastien]Correctedhas_facetedfunction call insubmitFormHelperOnsuccessDefaultjs
[sgeulette]Reloaded page whensubmitFormHelperis used on a non faceted page
[sgeulette]Added parametertoggle_type=’slide’to JS helpertoggleDetails,
so it is possible to useslideToggle(default) orfadeToggle.fadeTogglebehaves better when the hidden part contains a sticky element
(table header).
[gbastien]0.38 (2021-01-06)Addedcontent.normalize_namethat will normalize a given name, this is the
code used when turning a title to an id when creating a new content.
[gbastien]0.37 (2020-12-21)Added JS functionsubmitFormHelperthat will submit a given form andonsuccess, will call the functiononsuccessin parameter
(by default, when called in an overlay, will close the overlay and
reload the faceted navigation).
[gbastien]Addedsecurity.fploghelper to ease adding acollective.fingerpointingmessage to the log.
[gbastien]Addedplone.app.relationfieldas a direct dependency.
[gbastien]0.36 (2020-12-07)Added email functions (create_html_email,add_attachment,send_email)
to create and send an email with attachments.
[sgeulette]Optimizedxhtml.separate_images, do only walk the tree if
it contains images (imgtag).
[gbastien]Fixedcontent.richtextvaloutputMimeTypeparameter to usetext/x-html-safeinsteadtext/html.
[gbastien]Renamed JS functionloadCollapsibleContenttoloadContentas it can be
used outside ofcollapsiblescope.
[gbastien]0.35 (2020-11-18)Added JS helper methodcanonical_urlto get the current canonical URL
so the url of the context when on a view.
[gbastien]IntoggleDetailsJS function, moved the part that does the async load inloadCollapsibleContentfunction so it is possible to call if from outside.
[gbastien]Addedget_user_from_criteriahelper method to search users following
email or fullname
[sgeulette]Added param ontransitionsmethod, to not warn by default
[sgeulette]Completedappy_podusecases,font-size 50%/150%.
[gbastien]Addedcatalog.merge_queriesfunction that mergesplone.app.querystringcompatible catalog queries into one single query.
[gbastien]Do not break inxhtml.storeImagesLocallyif aNotFoundoccurs while
getting an internal image.
[gbastien]0.34 (2020-10-16)Moved JS functionsetoddevenfromlistings.jstohelpers.jsso it is available by default.
[gbastien]Added setup_logger in security module to change logger level (when
doinginstance runby example)
[sgeulette]0.33 (2020-10-01)Addedcontent.get_relationsandcontent.get_back_relationsto easily
get relations and back relations on an object.
[gbastien]Do not break inxhtml.storeImagesLocallyif image URL
contains non-ASCII characters.
[gbastien]Addedxhtml.separate_imagesthat will make sure images are separated in
different<p>to avoid breakingappy.podwhen usingLibreOffice 6.0.x.
[gbastien]0.32 (2020-09-10)Log every 1000 elements instead 100 incatalog.addOrUpdateIndexesandcatalog.reindexIndexes.
[gbastien]Fixed code to make except Exception syntax Python 3.8 compatible.
[gbastien]0.31 (2020-08-18)Correctly translate a utf8 state title.
[sgeulette]Addedcontent.safe_delattrto avoid having to checkbase_hasattrbefore.
[gbastien]Added JS helper functiontoggleDetailsto be able to show/hide details
using a collapsable<div>.
[gbastien]Completedappy_podusecases,
fixed images to usehttps://picsum.photos/insteadhttps://www.imio.be[gbastien]0.30 (2020-06-24)Incontent.uuidsToObjects, get object withbrain._unrestrictedGetObjectin case parameterunrestricted=True.
[gbastien]0.29 (2020-05-28)Added parameterunrestricted=Falsetocontent.uuidsToCatalogBrainsandcontent.uuidsToObjects, whenTrue, catalog search is done unrestricted.
[gbastien]0.28 (2020-05-26)AddedoutputMimeTypeparameter torichtextvalmethod
[sgeulette]Added parameterquery={}tocontent.uuidsToCatalogBrains, this let’s you
complete the catalog query in case you haveUIDsand you want to filter
it on additional index likereview_state.
[gbastien]Added new parametercatalog_id=’portal_catalog’to methodscatalog.addOrUpdateIndexes,catalog.removeIndexes,catalog.removeColumnsandcatalog.reindexIndexesso it is possible to
proceed with another catalog thanportal_catalog.
[gbastien]Added parametercheck_contained_uids=Falsetocontent.uuidsToCatalogBrainsandcontent.uuidsToObjects,
when set toTrue, if query onUIDindex returns nothing, it will query oncontained_uidsindex if it exists in theportal_catalogthat is a special
index used to indexUIDsof contained elements that are not indexed.
[gbastien]AddedIContainerOfUnindexedElementsMarkermarker interface to mark objects
containing unindexed objects.
[gbastien]0.27 (2020-04-20)Do not break inxhtml.imagesToPathif<img>use a
wrongresolveuid/unknown_uid.
[gbastien]Fixed tests to not use images from sitehttps://www.imio.be/but
from sitehttps://i.picsum.photos/.
[gbastien]0.26 (2020-02-25)Added set_to_annotation method.
[sgeulette]Always return something in annotations functions.
[sgeulette]0.25 (2019-11-26)Added logging inxhtml.storeImagesLocallyif unable to
traverse toimg_path.
[gbastien]Fixed bug inxhtml.storeImagesLocallywhere an image stored in another
Plone element havingabsolute_urlstarting with current elementabsolute_urlwas not stored locally.
[gbastien]0.24 (2019-11-25)Removed wrong overrides ofcollective.iconifiedcategorytranslation file.
[gbastien]Added optionally behavior prefix in get_schema_fields.
[sgeulette]Fixed bug inxhtml.storeImagesLocally._handle_internal_imageto be sure
that traversed path to image does not starts with a/or it fails with
aKeyError.  This is the case when thePlone Siteis using a domain name.
Make sure also traversedimg_pathelement is actually anImage.
[gbastien]0.23 (2019-09-12)Addedcontent.get_vocabhelper method to easily get aIVocabularyFactoryvocabulary instance or only the factory when parameteronly_factory=True.
[gbastien]Addedcatalog.reindexIndexeshelper method making it possible to reindex a
specificportal_catalogindex withZLogHandlerlog output.
[gbastien]Added javascript function to callViewAndReload with ajax. Gotten from PloneMeeting ;-)
[sgeulette]Added get_state_infos (used in PM and plonetheme.imioapps).
[sgeulette]0.22 (2019-08-23)Added parameterupdate_metadatatocatalog.addOrUpdateColumns,
ifTrue(default), the new added metadata are updated on every
catalogued objects.
[gbastien]Added function to return html link for an object
[sgeulette]0.21 (2019-08-13)Added parameterget_again=Falsetocache.invalidate_cachekey_volatile_for, when True, this will callcache.get_cachekey_volatilejust after the cache is invalidated so we get
a fresh date stored. This is useful to avoid write by async requests if it
callscache.get_cachekey_volatile.
[gbastien]0.20 (2019-07-19)Inxhtml.storeImagesLocally, do not break when aresolveuidis found but
it does not find the image. This can be the case when copy/pasting HTML code
from another instance or so.
[gbastien]Inxhtml.removeBlanks, check if content is empty by callingxhtml.xhtmlContentIsEmptywith parametertagWithAttributeIsNotEmpty=Falseso empty tags with attributes are considered empty.
[gbastien]0.19 (2019-07-05)Patch index method from collective.solr to fix an issue with partial reindex
[mpeeters]Added css id on row field display in container.pt and content.pt.
[sgeulette]0.18 (2019-05-16)Addedappy.podsample that show problem of wrongly defined style likemargin-left: opt;usingoptinstead0pt.
[gbastien]Addedappy.podsample that show problem of class not used in<li>or<td>.
[gbastien]Added methodscontent.disable_link_integrity_checksandcontent.restore_link_integrity_checksto be able to disable theenable_link_integrity_checks propertyand to restore it to it’s original
value.  This works for Plone4 (property) and Plone5 (registry).
[gbastien]Fix import ofIEditingSchemaon Plone5.
[gbastien]0.17 (2019-02-12)Added collapsible option on container view.
[sgeulette]Do not store date for get_cachekey_volatile/invalidate_cachekey_volatile_for
in a volatile (_v_…) as it seems “stored” by thread and is computed to much
times.
[gbastien]Added JS helper method has_faceted returning true if currently on a faceted.
[gbastien]0.16 (2019-01-31)Addedappy.podusecase to show problems with table optimization if<td>has a defined size.
[gbastien]Addedappy.podusecase to show problems with table having a first empty<tr></tr>that do not render second column of following lines.
[gbastien]Addedappy.podusecase for line-height style.
[gbastien]Addedappy.podusecase for<img>withoutsrcthat breaks generation.
[gbastien]Do not break inxhtml.imagesToPathif<img>does not have asrc.
[gbastien]0.15 (2018-12-18)Display more logging incontent.validate_fieldswhen bypassing validation.
[gbastien]Incatalog.addOrUpdateIndexes, pass aZLogHandlertoreindexIndexso the
progress is shown in the Zope log.
[gbastien]Incontent.add_to_annotationandcontent.del_from_annotation, store
annotation in aPersistentListinstead aset()to avoid persistence
problems.
[gbastien]0.14 (2018-10-22)Improved content create to avoid creating object when defined id already exists.
[sgeulette]Added methods content.uuidsToCatalogBrains and content.uuidsToObjects.
[gbastien]Adaptedcontent.validate_fieldsto bypass validation when field.required=False,
value is None and field type is other than Bool.  Validation is also bypassed for
field using asourceattribute because it fails for now…
[gbastien]Added parameter raise_on_errors to content.validate_fields to raise a ValueError
when errors are found instead simply returning it.
[gbastien]0.13 (2018-08-31)Addedcontent.get_schema_fieldsto get schema fields (behaviors included
by default).
[sgeulette]Pep8 on imports.
[sgeulette]Added appy.pod usecase for lists containing tables.
[bleybaert]Added dependency onPloneinsetup.py.
[gbastien]Do not break inxhtml.storeImagesLocally._handle_internal_imageif image
src is not a path to an image but to another element (likeFolderorPlone Site).
[gbastien]0.12 (2018-05-03)Added appy.pod usecase for rgba().
[gbastien]Improved annotation code
[sgeulette]0.11 (2018-01-30)Usehtmlinsteadxmlforlxml.html.to_stringrenderingmethod.
This avoids results like<p>

</p>turned to<p><s/></p>.
[gbastien]0.10 (2017-12-21)Fixed bug incatalog.addOrUpdateIndexeswhere a new index was not reindexed
if it was added together with an already existing index.
[gbastien]Fixed bug inxhtml.storeImagesLocallywhen img uses aresolveuidand
starts with theportal_url(this is the case when usinguploadimage pluginincollective.ckeditor), it raised a NotFound error.
[gbastien]Inxhtml.storeImagesLocally, keep thescaleat the end of the URL usingresolveuid(likeresolveuid/content_uid/image_preview).
[gbastien]UsePyPDF2instead deprecatedpyPdfto insert barcode into PDF.
This solvesValueError: invalid literal for int() with base 10: ‘’.
[gbastien]0.9 (2017-11-27)Added appy.pod usecase for complex styles start/end on same paragraph.
[gbastien]Do not break inxhtml.storeImagesLocallywhen no<img> srcfound.
[gbastien]Add methods to manage annotations (Add and Remove).
[anuyens, odelaere]Added method to get annotation
[sgeulette]0.8 (2017-10-04)Inxhtml.storeImagesLocally, take into account<img> srcthat usesresolveuid.  This is the case when usingcollective.ckeditorand
optionallow_link_byuidis enabled.
[gbastien]Do not use/* … */together withhttps://in helpers.js comment or
merged javascripts produce a wrong format and raise a JS comment unterminated
error in the browser.
[gbastien]0.7 (2017-09-22)Added methodtesting_loggertotesting.pythat enables logging into tests.
[gbastien]0.6 (2017-09-15)Changed methodxhtml.storeExternalImagesLocallytoxhtml.storeImagesLocally, it handles now external and internal images
retrieval so an image stored in the portal is also created in given context
when necessary.
[gbastien]0.5 (2017-08-30)Added method to safe encode string.
[sgeulette]appy.pod usecase : table using width of 0px.
[gbastien]Incontent.validate_fields, added special bypass to avoid failing
validation forChoicefield that isrequired=Falseand for which given
value is None. Validation fails because None not in vocabulary but it is
nevertheless a correct value as it is managed by the widget while added thru
the UI.
[gbastien]Added JS fix to be able to print<fieldset>on several pages in Firefox,
seehttps://bugzilla.mozilla.org/show_bug.cgi?id=471015.
This makes it necessary to add a default profile to add the JS resource++resource++imio.helpers/helpers.js.
[gbastien]0.4.29 (2017-07-25)Get intid value or create it if not found.
[sgeulette]Added possibility to pass ‘scale’ value to pdf.BarcodeStamp.
[gbastien]More appy.pod usecase : not rendered sub bullets with no parent bullet.
[gbastien]0.4.28 (2017-07-04)Added method to create NamedBlobFile or NamedBlobImage.
[sgeulette]0.4.27 (2017-06-30)Return portal when obj_path is / on create content.
[bsuttor]Added case for appy.pod that show complex HTML structure failing
in appy.pod 0.9.7.
[gbastien]Added root attribute in fancytree
[sgeulette]Changed barcode generation options, following zint 2.6
[sgeulette]0.4.26 (2017-03-14)Set CLASS_TO_LAST_CHILDREN_NUMBER_OF_CHARS_DEFAULT = 240.
[gbastien]0.4.25 (2017-02-21)Use same class names than appy.pod regarding the ‘keep with next’
functionnality.
[gbastien]0.4.24 (2017-02-14)In content.validate_fields, initialize field by calling bind(obj) so
necessary things like vocabularies are available.
[gbastien]0.4.23 (2017-02-14)Added content module test.
[sgeulette]Improved get_object, add_image, add_file, create methods
[sgeulette]Added content.validate_fields that will validate fields of
a given dexterity obj.
[gbastien]0.4.22 (2016-12-21)Added more usecases to test appy.pod rendering : ‘text-decoration: none;’,
complex and reallife table examples, …
[gbastien]Added method xhtml.removeCssClasses to be able to remove some specific Css
classes from a given xhtmlContent.
[gbastien]0.4.21 (2016-12-05)Added method xhtml.addClassToContent that gives the ability to add a CSS class
to the CONTENT_TAGS (<p>, <strong>, …) of a given xhtmlContent.
[gbastien]Add @volatile_cache_without_parameters and
@volatile_cache_with_parameters decorators
[mpeeters]Store the volatile keys on a dictionary on the portal
[mpeeters]Can add a file to an object.
[sgeulette]Added case in ‘appy_pod_sample’ to check when style attribute is used to
define italic/bold/underline/strike directly on <li> or on <li> containing
<p> or <span>.
[gbastien]0.4.20 (2016-10-05)Added ‘path’ module with method ‘path_to_package’ that will return the absolute
FS path to a given package.  An extra ‘filepart’ can be provided to complete the
returned path.  This is useful to get a template in a ‘browser/template’ folder
for example.
[gbastien]0.4.19 (2016-09-26)Do not pretty_print HTML returned by lxml.html.tostring or it can leads to
weird behaviors like extra blank space in case we have nested <span> tags.
‘pretty_print’ is now a parameter to relevant methods and is False by default
[gbastien]Added methods to create content from a dictionary, to get object following
criterias, to apply multiple transitions, to create a RichTextValue object
[sgeulette]Added default views for Dexterity content and container that display
fields in a table with widget label and the left and widget value on
the right.  The view for container also includes an asynchronous
folder_listing that lists contained elements.
Taken from imio.project.core
[gbastien]0.4.18 (2016-06-17)Use by default scale=2 instead of scale=4 when generating barcode.
[gbastien]Added methods int2word, wordizeDate and formatDate aiming to transform
numbers into french translation, date with only numbers into date in full
and to format dates (with hours, with month name in full, …).
[DieKatze]0.4.17 (2016-03-22)Added constant CLASS_TO_LAST_CHILDREN_NUMBER_OF_CHARS_DEFAULT to define the
default number of characters to take into account while marking last tags
in xhtml.addClassToLastChildren.  This way it can be used in other packages.
[gbastien]Fixed xhtml.imagesToPath to handle image src using ‘resolveuid’ correctly.
[gbastien]0.4.16 (2016-03-14)Bugfix in xhtml.storeExternalImagesLocally if downloaded external image has
no ‘Content-Disposition’ header.
[gbastien]0.4.15 (2016-03-14)Added helper to be able to easily test appy.pod rendering by loading a full
HTML content to any content (AT or DX) by specifying a RichText field_name.
[gbastien]Added method xhtml.imagesToPath that turns the src of images used in a xhtml
content from an ‘http’ or equivalent path to the absolute path on the FileSystem
to the .blob image file.
[gbastien]Added method xhtml.storeExternalImagesLocally that will ensure that externally
referenced images are downloaded, stored locally and xhtmlContent is adapted
accordingly.
[gbastien]0.4.14 (2016-02-25)Added methods cache.get_cachekey_volatile and
cache.invalidate_cachekey_volatile_for to be used with methods using
decorator @ram.cache.  This is meant for long living cached methods that are
invalidated manually. get_cachekey_volatile will be used in the method
cachekey and invalidate_cachekey_volatile_for will be used to invalidate the
cachekey.
[gbastien]Add a function to generate a barcode with zint : #13100.
[mpeeters]Removed initialize() call from __init__, no need to be considered
as a Zope2 product.
[gbastien]0.4.13 (2016-01-22)Use safe_unicode() instead of unicode(), especially in xhtml.markEmptyTags
to avoid UnicideDecode errors.
[gbastien]0.4.12 (2016-01-21)Added test when an uid (path) is no more in the portal_catalog,
it does not break catalog.addOrUpdateColumns.
[gbastien]In xhtml.xhtmlContentIsEmpty, do no more consider tag children in _isEmpty,
a tag rendering nothing (text_content().strip() is empty) will be considered empty.
[gbastien]0.4.11 (2015-11-12)Added ‘cache.cleanRamCache’ method that will invalidateAll ram.cache.
[gbastien]0.4.10 (2015-08-21)Add get_environment method and test.
[bsuttor]is_develop_environment method is true if global environment variable ‘ENV’ is equal to ‘dev’.
[bsuttor]Added ‘cache’ module with helper methods ‘cleanVocabularyCacheFor’ that will clean
instance.memoize cache defined on a named vocabulary and ‘cleanRamCacheFor’ that
will clean ram.cache defined on a given method.
[gbastien]0.4.9 (2015-04-21)In xhtml.addClassToLastChildren, do not define an empty class attribute.  Indeed, not
managed tags were decorated with a ‘class=””’ attribute, this is no more the case.
[gbastien]0.4.8 (2015-04-20)Manage every text formatting tags in xhtml.addClassToLastChildren and
do not break on unknwon tags.
[gbastien]Replace special characters by corresponding HTML entity in xhtml.addClassToLastChildren
so rendered content still contains original HTML entities.  This avoid HTML entities being
rendered as UTF-8 characters and some weirdly recognized (”&nbsp;“).
[gbastien]0.4.7 (2015-03-06)Adapted method xhtml.addClassToLastChildren to mark parent tag containing unhandled tags.
[gbastien]0.4.6 (2015-02-26)Added method markEmptyTags that will mark empty tags of a given
xhtmlContent with a specific CSS class.
[gbastien]Removed method security.call_as_super_user as we will rely on
plone.api.env.adopt_roles to execute some methods as super user.
[gbastien]0.4.5 (2015-02-05)Added method to test if the buildout is in development mode (IS_DEV_ENV=True).
[sgeulette]Added method to generate a password following criterias.
[sgeulette]0.4.4 (2015-01-29)Make it possible to pass specific class by tag to hxtml.addClassToLastChildren,
this way, a specific class can be set depending on the node tag.
[gbastien]0.4.3 (2015-01-20)Added method addClassToLastChildren that will add a specific class attribute
to last tags of a given xhtmlContent.
[gbastien]0.4.2 (2014-09-19)Do not consider xhtmlContent to easily empty : xhtmlContent is empty if it does not produce
text, does not have attributes and does not have children.
[gbastien]Use method xhtmlContentIsEmpty in method removeBlanks to avoid duplicating code and logic.
[gbastien]0.4.1 (2014-09-11)Corrected bug in ‘removeBlanks’ that removed children of an empty parent tag, that leaded
to removal of complex trees like <u><li>My text</li><li>My second text</li></ul>.
[gbastien]0.3 (2014-09-04)Corrected bug in ‘xhtmlContentIsEmpty’ that did not managed correctly complex HTML tree.
We use now lxml method ‘text_content’ to check if a HTML structure will render something or not.
[gbastien]0.2 (2014-08-27)Added xhtml.py module with helper methods for XHTML content :‘removeBlanks’ that will remove blank lines of a given xhtmlContent;‘xhtmlContentIsEmpty’ that will check if given xhtmlContent will produce something when rendered.[gbastien]0.1 (2014-08-18)Initial release.
[sdelcourt]