Personal tools
Skip to content. | Skip to navigation
Sometimes, a monkey patch is a necessary evil. This package makes it easier to apply a monkey patch during Zope startup. It uses the ZCML configuration machinery to ensure that patches are loaded "late" in the startup cycle, so that the original code has had time to be fully initialised and configured. This is similar to using the `initialize()` method in a product's __init__.py, except it does not require that the package be a full-blown Zope 2 product with a persistent Control_Panel entry. Applying a monkey patch ======================= Here's an example:: <configure xmlns="http://namespaces.zope.org/zope" xmlns:monkey="http://namespaces.plone.org/monkey" i18n_domain="collective.monkeypatcher"> <include package="collective.monkeypatcher" /> <monkey:patch description="This works around issue http://some.tracker.tld/ticket/123" class="Products.CMFPlone.CatalogTool.CatalogTool" original="searchResults" replacement=".catalog.patchedSearchResults" /> </configure> In this example, we patch Plone's CatalogTool's searchResults() function, replacing it with our own version in catalog.py. To patch a module level function, you can use `module` instead of `class`. The original class and function/method name and the replacement symbol will be checked to ensure that they actually exist. If patching happens too soon (or too late), use the `order` attribute to specify a higher (later) or lower (earlier) number. The default is 1000. By default, `DocFinderTab <http://pypi.python.org/pypi/Products.DocFinderTab>`_ and other TTW API browsers will emphasize the monkey patched methods/functions, appending the docstring with "Monkey patched with 'my.monkeypatched.function'". If you don't want this, you could set the `docstringWarning` attribute to `false`. If you want to do more than just replace one function with another, you can provide your own patcher function via the `handler` attribute. This should be a callable like:: def apply_patch(scope, original, replacement): ... Here, `scope` is the class/module that was specified. `original` is the string name of the function to replace, and `replacement` is the replacement function. Full list of options: - ``class`` The class being patched - ``module`` The module being patched - ``handler`` A function to perform the patching. Must take three parameters: class/module, original (string), and replacement - ``original`` Method or function to replace - ``replacement`` Method to function to replace with - ``preservedoc`` Preserve docstrings? - ``preserveOriginal`` Preserve the original function so that it is reachable view prefix _old_. Only works for default handler - ``preconditions`` Preconditions (multiple, separated by space) to be satisified before applying this patch. Example: Products.LinguaPlone-=1.4.3 or Products.TextIndexNG3+=3.3.0 - ``preserveOriginal`` Preserve the original function so that it is reachable view prefix _old_. Only works for default handler - ``preconditions`` Preconditions (multiple, separated by space) to be satisified before applying this patch. Example: Products.LinguaPlone-=1.4.3 or Products.TextIndexNG3+=3.3.0 - ``ignoreOriginal`` Ignore if the orginal function isn't present on the class/module being patched - ``docstringWarning`` Add monkey patch warning in docstring - ``description`` Some comments about your monkey patch - ``order`` Execution order Handling monkey patches events ============================== Applying a monkey patch fires an event. See the `interfaces.py` module. If you to handle such event add this ZCML bunch:: ... <subscriber for="collective.monkeypatcher.interfaces.IMonkeyPatchEvent" handler="my.component.events.myHandler" /> ... And add such Python:: def myHandler(event): """see collective.monkeypatcher.interfaces.IMonkeyPatchEvent""" ...
collective.mtrsetup provides a GenericSetup extension for importing and exporting mimetypes to / from the mimetypes registry. How to use Add collective.mtrsetup as dependency to your setup.py Add a zcml-include to your configure.zcml or dependency.zcml Add a dependency to profile-collective.mtrsetup:default to your metadata.xml in your generic setup profile Create a mimetypes.xml as showed below in your generic setup profile OpenOffice / Office 2007 There is a additional generic setup profile provided in this package (profile-collective.mtrsetup:default) which adds icons for OpenOffice (with backwards compatiblity to StarOffice) and adds the already used ms-office-icons to the new office 2007 mimetypes. The official Office 2007 icons are not added because of the license.
This addon integrate oembed into Plone. You can find a demo at http://youtu.be/kHikGIWrvCs oEmbed official documentation: http://oembed.com/ You have to know this addon try to go beyond already supported website and with as many providers as possible without third party services.
Produce Open Search Feeds collective.opensearch adds the possibility to add OpenSearch compatible search results to your Plone site. site wide: this is a simple copy of the plone search so all option that you may pass to the standard /search will be recognized as well. for a collection/topic: You can search inside a topic, i.e. you define a 'base query' as a topic and additional parameters of the query are applied additional. OpenSearch is a collection of simple formats for the sharing of search results. OpenSearch helps search engines and search clients communicate by introducing a common set of formats to perform search requests and syndicate search results. OpenSearch helps search engines and search clients communicate by introducing a common set of formats to perform search requests and syndicate search results. The OpenSearch description document format can be used to describe a search engine so that it can be used by search client applications. The OpenSearch response elements can be used to extend existing syndication formats, such as RSS and Atom, with the extra metadata needed to return search results collective.opensearch enables you to syndicate the search results of your plone site by formatting them in the RSS or Atom formats, augmented with OpenSearch response elements. Implemented extensions and conventions opensearch relevance opensearch description for autodiscovery suggestions so that browsers can autocomplete response elements and first, previous, next, last links Consume Open Search Feeds collective.opensearch adds a view to the link type that lets you search OpenSearch (or other searches that return RSS or Atom, pretty much any other format feed parser supports and KML) compatible search providers within your site. The feeds do not need to implement the opensearch extensions it suffices that they are valid feeds (e.g you can query yahoo, bing, google site search or any plone site). When you add a link with an open search url this view will be automatically set. To search e.g. plone.org from your site add a Link with the url: http://plone.org/search_rss?SearchableText={searchTerms} You can combine several open search links as a metasearch. All OpenSearch links inside a folder will be queried and their results displayed when you change the view of a folder to 'Open Search View' Usage: 1) A single remote search If you add a link content type with a open search description compatible url (i.e. it has a parameter {searchTerms} in the querystring) the view of the link will be set when the link is saved. The view consits of a simple searchform and the results of the query 2) search multiple sources at once To build a simple metasearch create a folder and add your query links to it. Change the view of the folder to 'Open Search View'. The view consist of a search form (currently only for full text search) which input will be appied to all open search links (i.e. any link that has 'Open Search View' set as its view). The results of the searches will be displayed in tabs beneath the form. The queries are executed asynchronously via AJAX, so you do not have to wait until the last query has finished. Abusing collective.opensearch to display miscelaneous feeds 3) display an abritary 'static' feed Allthough the main focus of this product is to produce and display search feeds you may use it to display any valid feed. If the url of the link you added does not contain the {searchTerms} parameter and 'Open Search View' (you have to select the view manually from the 'display' menu) is selected as the view of the link, the feed will be fetched regardless of the presence of a query parameter and its results will be displayed. The search form will not be displayed in the absence of the {searchTerms} parameter. 4) display multiple feeds Add your feeds to display to a folder (as in [2]) and select 'Open Search View' as the display view of the folder All feeds that do not have a {searchTerms} parameter in their url will be fetched immediately, regardless if a search input was provided. The search form will only be displayed if at least one of the links inside the folder has a {searchTerms} parameter. 5) Use collective.opensearch to search inside your collections As opensearch results are added to all collections you may use it as a searchform to search inside your collections. if you use a relative link (e.g. /mycollection/SearchableText={searchTerms}) you have to choose 'Open Search View' manually to display the search results.
Introduction Search Engine Optimization Package Features With collective.perseo you can manage several kind of SEO features. Globally Configurations applied to each page of the site, through 'PerSEO' tool under Add-on Configuration: * Webmaster Tools * tag title, description and keywords meta tags, separately for: o Home page o Single pages o Search page o Not Found page o Author page o Site Map page o Contact page o Event o File o Folder o Image o Link o News Item o Topic * Disable the indexing of resources using noindex and nofollow, separately for: o Search page o Login and Registration pages o Administration pages o Single pages o Event o File o Folder o Image o Link o News Item o Topic o (also handle noodp, noydir, noarchive, nosnippet) * Content types included in the sitemap.xml.gz * Ping sites (Google, Bing, Ask) automatically when the Site Map is updated * Indexing RSS feeds * Add itemscope and itemtype attributes to body tag (if you install the extension collective.perseoschema per Schema org) One by one Through 'SEO' tab on each content of the site (allows you to change SEO settings for that specific content): * tag title and description and Keywords meta tags * Meta Robots Follow Tag (follow/nofollow) * Meta Robots Index Tag (index/noindex) * Meta Robots Advanced Tag (noodp, noydir, noarchive, nosnippet) * Canonical URL * Content included in the sitemap.xml.gz (yes/no). * Priority of content in sitemap.xml.gz * itemtype attribute (if you install the extension collective.perseoschema per Schema org) SCHEMA.ORG For Schema.org attributes add the collective.perseoschema package. Warning! Installing collective.perseoschema package, the main_template and plone.path_bar, plone.global_sections, plone.header viewlets will be customized, to insert Schema.org attributes. The customizations of these resources in other Themes and Skins could be disabled.
Analytics support for pages using Piwik (core package)
collective.piwik.mediaelement displays a video play counter for Plone sites that use collective.mediaelementjs (http://pypi.python.org/pypi/collective.mediaelementjs). A download counter is displayed when used in combination with collective.transcode.star (http://pypi.python.org/pypi/collective.transcode.star) or Plumi (http://plumi.org). Usage data is stored and retrieved by Piwik (http://piwik.org), an open source analytics platform. How to get it working Install collective.piwik.core and collective.mediaelementjs from the Plone control panel. You need to have access to a working Piwik installation. Create a new site in the Piwik admin UI and a new user who should have view access for that site. Go to the Piwik Settings page in the Plone control panel and enter the URL of your Piwik instance, the siteId and the user's authentication token Upload a video that can be played by mediaelementjs and click play If you do the above a viewlet should appear on top of mediaelementjs displaying the number of views of each video.
Introduction ------------ collective.plonetruegallery is a Plone product that implements a very customizable and sophisticated gallery. How It Works ------------ All you need to do is select the ``Gallery View`` from the ``Display`` drop down item for any Folder or Collection content type. Once that is done, a ``Gallery Settings`` tab is enabled for the type. With this, you can customize the various settings for the Gallery. Supported Display Types ----------------------- To install any of the various extra display types, you need to install the dependent package in buildout - galleria(ships with) - contact sheet(collective.ptg.contactsheet) - thumbnail zoom gallery(collective.ptg.thumbnailzoom) - presentation(collective.ptg.presentation) - galleriffic(collective.ptg.galleriffic) - highslide(collective.ptg.highslide) - fancybox(collective.ptg.fancybox) - pikachoose(collective.ptg.pikachoose) - s3slider(collective.ptg.s3slider) - nivo slider(collective.ptg.nivoslider) - nivo gallery(collective.ptg.nivogallery) - content flow(collective.ptg.contentflow) - supersized(collective.ptg.supersized)
Display a contact in a Plone portlet. Contacts are provided throw backends. When installed this addon is configured to use the 'dummy' backend. You can configure this addon to use an other backend: Dummy backend, used for tests LDAP backend (add python-ldap in your setup) SugarCRM backend (add the addon collective.sugarcrm)
This package defines a portlet that shows additional filter of current search results. The filtering works in two modes. Results grouped by a simple index/value Additionally group by unique values of selected criteria