Pollo: Cocoon features

Cocoon logo

Pollo includes a customized environment for editing  Cocoon Sitemap files. It consists of a custom display specification, a schema, an attribute editor plugin and action plugins.

At the time of this writing, it was tailored towards Cocoon 2.02, but it won't do any damage to sitemap files for other Cocoon versions.

Activating the sitemap support

After you select a file in the file dialog, you are presented with a 'view type' selection dialog. Here it is important to choose for 'Cocoon 2.02', otherwise you won't see the special features described below.

The sitemap schema

The schema is responsible for letting Pollo know what elements are available, and what attributes can occur on the elements. It also defines things like selection lists for attribute values, sometimes dynamically generated. In the screenshot below, the selection list for the 'type' attribute is dynamically composed from the generators defined in the map:components section of the sitemap.

Screenshot of Pollo showing the dynamically generated attribute selectionlist

The same schema as used inside Pollo (with the same colors) is also available as a poster diagram to stick on your wall.

The action plugins

Matchers overview

To get a quick overview of all matcher patterns in a document, choose 'Plugin actions | Goto matcher ...' in the menubar. You will get a dialog like this:

Screenshot of Cocoon's matcher dialog

Selecting a pattern and clicking 'Goto' will bring you to the location in the document where that pattern is used.

This feature looks in the map:components section of the sitemap to know what matcher types have been defined, what their names are, and what the default one is. If you are editing a subsitemap which does not have these declarations (because they are inherited from the parent sitemap), this feature will not work. The work-around is to redefine the matchers in the subsitemap.

Edit generator/transformer source

When you have selected a map:generate or map:transform element, you can open the file referred to by their 'src' attribute by choosing 'Plugin actions | Edit [generator/transformer] source' in the menubar. If the filename in the src attribute is a relative file path, it will be resolved relative to the location of the sitemap file being edited.

Goto component declaration

When you have selected a component instance in the sitemap (a map:generate, map:transform, map:act, and so on), you can choose 'Plugin actions | Goto component declaration'. This will jump to the element in the map:components section where the type of that component is declared.

The attribute editor plugins

While entering a reference to a substitution parameter (i.e. something between { and } ), Pollo will show a hint displaying from what component the parameters will be substituted.

Screenshot showing the hints you get while inputing parameter references

As can also be seen in the above screenshot, in the attribute editor field there are little buttons on the right. The first one will show a file dialog to browse for a filename which will then be inserted in the attribute value. The second one will show a dialog with the nearest wildcard URI matcher pattern, in which you can then click on any of the stars to insert a reference to them:

Screenshot showing the Cocoon URI matcher helper.

[Home] SourceForge.net Logo