Personal tools
Skip to content. | Skip to navigation
This module provides a z3c.form version of the Products.DataGridField . This product was developed for use with Plone4/5 and Dexterity.
collective.workspace package for providing 'membership' in specific areas of a Plone Site. It allows you to grant people access to areas of content using a membership group rather than local roles for each user, and to delegate control over that group to people who don't have access to the site-wide user/group control panel. collective.workspace provides a behavior that can be enabled for any Dexterity content type. When enabled, it adds a "Roster" tab which is where you can manage the team. All the functionality takes place via an IWorkspace adapter, which can be overridden to specify: A list of groups, and the roles that each group should receive. These groups are created automatically via a PAS plugin, and automatically granted local roles using a borg.localrole adapter. The schema for which fields should be stored for each member in the roster. This includes checkboxes for the groups, to determine which groups the member is in. Action links for each row in the roster. The default is an "Edit" link which brings up a popup to edit the fields for that person's roster membership. Action buttons at the bottom of the roster which apply to the rows the user selects. An example of this could be a 'Send email' action, so a roster admin can easily email users in the roster. Unlike similar previous packages (see slc.teamfolder and collective.local.*), collective.workspace supplies its own PAS groups plugin, instead of using standard Plone groups. This means that Workspace-specific groups do not appear in the sitewide group control panel. Some other features are: Membership in a roster is indexed, so you can search the catalog for items of portal_type X that have a particular user in their roster. Events are fired when roster memberships are added/modified/removed.
collective.transcode.* or transcode.star for short, is a suite of modules that provide transcoding services to Plone sites. Both the naming scheme and the basic design priciples were inspired by collective.blog.star. Namely: Be modular. Not everyone wants everything your software has to offer. Be flexible. Don't assume that people want to use your software in one way. Be simplistic. If there is a simple way of doing it, do it that way. Be Ploneish. Plone already has 90% of what we need built in. Use it. It works out of the box with standard Plone Files, providing transcoding services to web friendly formats (mp4, ogv) when uploading video content. Additionally, a jpeg thumbnail is being extracted from the 5th second of the videos and a flowplayer viewlet pointing to the produced mp4 file will be displayed inside the IAboveContentBody viewlet manager when transcoding is complete. Transcode.star can be easily configured through the Plone Control Panel to work with any custom AT content type, as long as there is a File field in the schema. In the Transcode Settings panel you can enter a new line in the supported portal types, following the format customPortalType:fileFieldName where customPortalType the name of your portal_type and fileFieldName the name of the file field that you need transcoding for. Support for Dexterity content types is planned for the coming versions. For the transcoding to work you need to start the transcodedaemon instance provided in the buildout. If your transcoding needs are high, you can configure several transcode daemons in a load balanced setup. Transcode.star will select the daemon with the minimum transcoding queue length. All communication between transcode.star and transcode.daemon is encrypted using symmetric encryption by the pycrypto module so that the transcode server(s) transcode videos sent by the Plone site only, preventing abuse by third parties. Also extra care has been taken to transcode videos in private state (typical senario for a Plone site, when users upload a file) by using the same secure channel.
Grok-like directives for creating Dexterity content
Dexterity is a system for building content types, both through-the-web and as filesystem code. It is aimed at Plone, although this package should work with plain Zope + CMF systems. Key use cases Dexterity wants to make some things really easy. These are: * Create a "real" content type entirely through-the-web without having to know programming. * As a business user, create a schema using visual or through-the-web tools, and augment it with adapters, event handlers, and other Python code written on the filesystem by a Python programmer. * Create content types in filesystem code quickly and easily, without losing the ability to customise any aspect of the type and its operation later if required. * Support general "behaviours" that can be enabled on a custom type in a declarative fashion. Behaviours can be things like title-to-id naming, support for locking or versioning, or sets of standard metadata with associated UI elements. * Easily package up and distribute content types defined through-the-web, on the filesystem, or using a combination of the two. Philosophy Dexterity is designed with a specific philosophy in mind. This can be summarised as follows: Reuse over reinvention As far as possible, Dexterity should reuse components and technologies that already exist. More importantly, however, Dexterity should reuse concepts that exist elsewhere. It should be easy to learn Dexterity by analogy, and to work with Dexterity types using familiar APIs and techniques. Small over big Mega-frameworks be damned. Dexterity consists of a number of speciaised packages, each of which is independently tested and reusable. Furthermore, packages should has as few dependencies as possible, and should declare their dependencies explicitly. This helps keep the design clean and the code manageable. Natural interaction over excessive generality The Dexterity design was driven by several use cases (see docs/Design.txt) that express the way in which we want people to work with Dexterity. The end goal is to make it easy to get started, but also easy to progress from an initial prototype to a complex set of types and associated behaviours through step-wise learning and natural interaction patterns. Dexterity aims to consider its users - be they business analysts, light integrators or Python developers, and be they new or experienced - and cater to them explicitly with obvious, well-documented, natural interaction patterns. Real code over generated code Generated code is difficult to understand and difficult to debug when it doesn't work as expected. There is rarely, if ever, any reason to scribble methods or 'exec' strings of Python code. Zope 3 over Zope 2 Although Dexterity does not pretend to work with non-CMF systems, as many components as possible should work with plain Zope 3, and even where there are dependencies on Zope 2, CMF or Plone, they should - as far as is practical - follow Zope 3 techniques and best practices. Many operations (e.g. managing objects in a folder, creating new objects or manipulating objects through a defined schema) are better designed in Zope 3 than they were in Zope 2. Zope concepts over new paradigms We want Dexterity to be "Zope-ish" (and really, "Zope 3-ish"). Zope is a mature, well-designed (well, mostly) and battle tested platform. We do not want to invent brand new paradigms and techniques if we can help it. Automated testing over wishful thinking "Everything" should be covered by automated tests. Dexterity necessarily has a lot of moving parts. Untested moving parts tend to come lose and fall on people's heads. Nobody likes that.
The “IReferenceable” behavior is used for enabling UUID (plone.app.uuid) support for dexterity contents, like in archetypes content types. This allow for example references between archetypes and dexterity content types. Note: It can’t work with Plone==4.0 because it is based on plone.uuid integration in CMF. It is compatible with Plone>=4.1
Introduction ============ Talking about multi-language support in Plone is talk about Products.LinguaPlone. It has been the *defacto* standard for managing translations of Archetypes-based content types in Plone through the years. Somehow its functionality never made its way into the Plone core and today it is in legacy status. Nowadays, Plone faces the rising of Dexterity content types and its incoming adoption into the Plone core in the near future (4.3) and complete the transition to Plone as default content types in Plone 5. plone.app.multilingual was designed originally to provide Plone a whole multilingual story. Using ZCA technologies, enables translations to Dexterity and Archetypes content types as well managed via an unified UI. This module provides the user interface for managing content translations. It's the app package of the next generation Plone multilingual engine. It's designed to work with Dexterity content types and the *old fashioned* Archetypes based content types as well. It only works with Plone 4.1 and above due to the use of UUIDs for referencing the translations. After more than 7 years, a GSOC, redesigns, reimplementations due to deprecated libraries, two major Plone versions finally we are able to say that plone.app.multilingual is finally here. Components ========== PAM is composed of four packages, two are mandatory: * plone.app.multilingual (UI) * plone.multilingual (core) and two optionals (at least one should be installed): * plone.multilingualbehavior (enables Dexterity support via a behavior) * archetypes.multilingual (enables Archetypes support) Usage ===== To use this package with both Dexterity and Archetypes based content types you should add the following line to your *eggs* buildout section:: eggs = plone.app.multilingual[archetypes, dexterity] If you need to use this package only with Archetypes based content types you only need the following line:: eggs = plone.app.multilingual[archetypes] While archetypes is default in Plone for now, you can strip ``[archetypes]``. This may change in future so we recommend adding an appendix as shown above. Setup ===== After re-running your buildout and installing the newly available add-ons, you should go to the *Languages* section of your site's control panel and select at least two or more languages for your site. You will now be able to create translations of Plone's default content types, or to link existing content as translations. Features ======== These are the most important features PAM provides. Root Language folders --------------------- After the setup, PAM will create root folders for each of your site's languages and put translated content into the appropriate folders. A language folder implements INavigationRoot, so from the user's point of view, each language is "jailed" inside its correspondent language folder. There are event subscribers in place to capture user interaction with content and update the language in contents accordingly, for example when user moves or copy content between language folders. Babel view ---------- An evolution of the LP *translate* view, unified for either Archetypes and Dexterity content types. It features an already translated content viewer for the current content being edited via an ajaxified dinamic selector that shows them on the fly on user request. Language independent fields --------------------------- PAM has support for language independent fields, but with a twist respect the LP implementation. As PAM does design does not give more relevance to one translated object above the others siblings (has no canonical object), fields marked as language independent get copied over all the members of the translation group always. The PAM UI will warn you about this behavior by reminding you that the values in the field on the other group participants will be overwritten. Translation locator policy -------------------------- When translating content, this policy decides how it would be placed in the site's structure. There are two policies in place: * LP way, the translation gets placed in the nearest translated folder in parent's hierarchy * Ask user where to place the translated element in the destination language root folder Language selector policy ------------------------ While browsing the site, the language selector viewlet allows users to switch site's content language and ease access between translations of the current content. There are two policies in place in case the translation of a specific language does not exist (yet): * LP way, the selector shows the nearest translated container. * Shows the user an informative view that shows the current available translations for the current content. Neutral root folder support --------------------------- The root language folders are used to place the tree of the correspondent language content. However, there are some use cases we need content that does not belongs to any language. For example, for assets or side resources like images, videos and documents. There is need to maintain a language neutral folder for place this kind of objects. After PAM setup, there is a special folder called *Language shared*. All items placed in this folder will have neutral as its default language and will be visible from the other root language folders as they were placed there. Translation map --------------- In order to ease the translation tasks, we devised a tool that displays in a useful way all the current translated objects and its current translation information. The map also shows a list of missing translations in case you want to build a *mirrored* (completely) translated site. Google Translation Service integration -------------------------------------- If you are subscriber of the Google Translation service (a paid service), you can setup your API key on *Languages* site setup. Then, you will notice a new icon in the babel view that takes the original field on the left side and using Google Translations service, translates its contents and fill the right side field. LinguaPlone migration --------------------- You can migrate your existing LP powered sites to PAM using the *Migration* tab in the *Languages* control panel. The migration has been divided into 4 steps for separation of concerns and for improving the success of each of the required procedures. Step 0 (optional) - Reindex the language index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The migration of LinguaPlone content depends on an up-to-date Language index. Use this step to refresh this index. **Warning:** Depending on the number of items in your site, this can take a considerable amount of time. This step is not destructive and can be executed as many times as needed. Step 1 - Relocate content to the proper root language folder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This step will move the site's content to its correspondent root language folder and previously will make a search for misplaced content through the site's content tree and will move them to its nearest translated parent. **Warning:** This step is destructive as it will alter your content tree structure. Make sure you have previously configured your site's languages properly in the 'Site Languages' tab of the 'Languages' control panel. It's advisable that you do not perform this step on production servers having not tried it in development/preproduction servers previously. Depending on the distribution of your site's content and the accuracy of the language information on each content object you may need to relocate manually some misplaced content after this step. Despite the fact that this step is 'destructive' it can be executed as times as needed if some problem is detected and afterwards you fix the problem. Please, refer to the procedure log when it finishes. Step 2 - Transfer multilingual catalog information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This step will transfer the relations between translations stored by LinguaPlone to the PAM catalog. This step is not destructive and can be executed as many times as needed. Step 3 - Cleanup after migration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This step will search and fix some lost dependencies to the ITranslatable interface hidden in the relation catalog and it gets rid of them. It must be run only when LinguaPlone is already uninstalled, so this step is hidden until then. Marking objects as translatables ================================ Archetypes ---------- By default, if PAM is installed, Archetypes-based content types are marked as translatables Dexterity --------- Users should mark a dexterity content type as translatable by assigning a the multilingual behavior to the definition of the content type either via file system, supermodel or through the web. Marking fields as language independant ====================================== Archetypes ---------- The language independent fields on Archetype-based content are marked the same way as in LinguaPlone:: atapi.StringField( 'myField', widget=atapi.StringWidget( .... ), languageIndependent=True ), .. note:: If you want to completely remove LinguaPlone of your installation, you should make sure that your code are dependant in any way of LP. Dexterity --------- There are four ways of achieve it. Grok directive ~~~~~~~~~~~~~~ In your content type class declaration:: from plone.multilingualbehavior import directives directives.languageindependent('field') Supermodel ~~~~~~~~~~ In your content type XML file declaration:: <field name="myField" type="zope.schema.TextLine" lingua:independent="true"> <description /> <title>myField</title> </field> Native ~~~~~~ In your code:: from plone.multilingualbehavior.interfaces import ILanguageIndependentField alsoProvides(ISchema['myField'], ILanguageIndependentField) Through the web ~~~~~~~~~~~~~~~ Via the content type definition in the *Dexterity Content Types* control panel. Internal design of plone.multilingual ====================================== All the internal features are implemented on the package plone.multilingual. The key points are: 1. Each translation is a content object 2. There is no canonical object 3. The translation reference storage is external to the content object 4. Adapt all the steps on translation 5. Language get/set via an unified adapter 6. Translatable marker interface(s) There is no canonical content object ------------------------------------ Having a canonical object on the content space produces a dependency which is not orthogonal with the normal behavior of Plone. Content objects should be autonomous and you should be able to remove it. This is the reason because we removed the canonical content object. There is a canonical object on the translation infrastructure but is not on the content space. Translation reference storage ----------------------------- In order to maintain the relations between the different language objects we designed a common object called a *translation group*. This translation group has an UUID on its own and each object member of the group stores it in the object catalog register. You can use the ITranslationManager utility to access and manipulate the members of a translation group given one object of the group. Adapt all the steps on translation ---------------------------------- The different aspects involved on a translation are adapted, so it's possible to create different policies for different types, sites, etc. * ITranslationFactory - General factory used to create a new content * ITranslationLocator - Where we are going to locate the new translated content Default : If the parent folder is translated create the content on the translated parent folder, otherwise create on the parent folder. * ITranslationCloner - Method to clone the original object to the new one Default : Nothing * ITranslationIdChooser - Which id is the translation Default : The original id + lang code-block * ILanguageIndependentFieldsManager - Manager for language independent fields Default: Nothing Language get/set via an unified adapter --------------------------------------- In order to access and modify the language of a content type regardless the type (Archetypes/Dexterity) there is a interface/adapter:: plone.multilingual.interfaces.ILanguage You can use:: from plone.multilingual.interfaces import ILanguage language = ILanguage(context).get_language() or in case you want to set the language of a content:: language = ILanguage(context).set_language('ca') Translatable marker interface ----------------------------- In order to know if a content can be translated there is a marker interface: plone.multilingual.interfaces.ITranslatable
Locking integration for dexterity content objects.
Dexterity is a content type framework for CMF applications, with particular emphasis on Plone. It can be viewed as an alternative to Archetypes that is more light-weight and modular.
This package provides the demo views for collective.z3cform.datagridfield. Examples of configurations are in the demo folder. Once you install this package, the demo views will be visible on your site. * http://localhost:8080/Plone/@@demo-collective.z3cform.datagrid