-
Usando Colecciones
last modified July 5, 2008 by macagua
1. Organization of Content
Before you know it, folders and subfolders have been created on a Plone web site and content added. Content is organized naturally by the hierarchy of folders.
Consider the butterflies web site, which would have an organization something like this, with the main areas of the web site each a few layers deep, and the butterfly pages arrayed in a hierarchy:
About History Keeping a Journal as a Kid Natural History Mentors The Present Treatment Family John Bio Other Interests Tennis Conservation Local Politics Sally Bio Other Interests Karate Cooking Edward Bio Other Interests Football Painting Elizabeth Bio Other Interests Clarinet Snowboarding Photography Equipment Techniques Favorite Photographers Butterflies Overview Biology Life Cycle Egg Caterpillar Pupa Adult Distribution Migration Field Work Projects Organizations North American Butterfly Association Lepidopterists’ Society Xerces Society Nature Conservancy Bibliography Species Treatments Swallowtails 13 species pages Pierids (Whites and Yellows) 30 species pages Hairstreaks 5 species pages Satyrium Hairstreaks 18 species pages Scrub Hairstreaks 9 species pages Blues 9 species pages Azures 9 species pages Metalmarks 3 species pages Brushfoots 4 species pages Greater Fritillaries 7 species pages Lesser Fritillaries 16 species pages Angelwings and Tortoiseshells 18 species pages Red-Spotted Admiral 10 species pages Satyrs (Browns) 13 species pages Alpines and Arctics 10 species pages Monarchs (Milkweed Butterflies) 3 species pages Skippers Spread-Wing Skippers 8 species pages Cloudy Wings 8 species pages Duskywings 15 species pages Intermediate Skippers 1 species page Grass Skippers 12 species pages Hesperia Skippers 41 species pages Roadside Skippers 16 species pages Giant Skippers 2 species pages
Each of the butterfly treatment pages has sections on identification tips, a description, and keywords. Photographs are scattered through the butterfly section for butterflies John as seen personally. He writes an observation account for each new species he photographs, providing location, habitat, and any specific behavioral observations made.
This web site has a range of content, from personal biographies and interests of John and his family, to expanded pages on photography and other topics, to the many butterfly pages and photographs. Click-navigation is effective for finding most information, and for the butterfly content the organization by taxonomy is useful and fitting for the most common needs, but this is not the only way it could be organized. For instance, the butterfly pages could have been organized by habitat, by behavior, by size, by color, by whether or not John has observed the species, etc. John was torn between these ways of organizing the butterfly pages, but chose the taxonomic structure, because grouping and relating species by evolutionary relationship is the most useful way to do it. But John discovered how Plone lets him have his cake and eat it too:
Collections offer a way to create separate organizational treatments for content.
2. Adding Collections
A collection is used for building a kind of virtual container for content -- the content actually exists wherever the items are stored throughout the web site, but the collection finds content along the guidelines set by a search criterion and makes it appear as if the items were stored in an alternate arrangement. For the butterfly pages described in the introduction to this section, the actual storage arrangement is by taxonomic grouping (Skippers, Monarchs, Dustywings, etc.), but with collections there can be virtual groupings by various criteria, such as by color. The butterfly pages matching the search criteria will be shown as if they "live" in the collection holding butterfly pages organized by color. Of course, there must be categories (formerly called keywords) set for color in the butterfly pages for this to work. Search criteria made for searching general text can assemble very meaningful arrangements also.
Learning to think about content being stored wherever it is stored, and about using custom collections to gather up different "views" of the content, is an important step to using Plone most effectively. It is an intelligent system.
To add a collection, use the Add new... menu, as for adding other content types:

You will see the Add Collection panel:

Below the title and description fields is a set of fields for specifying the format of search results returned by the search criterion for the new collection. The four fields in the panel above are in pairs. The top two fields let you limit the search results to a number of items that will be displayed. The bottom two fields let you control the order of the search result items.
Setting the search criterion
After setting the display configuration in the edit panel shown above, click the criteria tab to show the panel for setting search criteria:

The top area of the panel, Add New Search Criteria, lets you set a field and a matching criterion. The bottom area, Set Sort Order, is a simple selection for a field to sort on:
The criteria types for matching data in content items depend on which field is selected.
After saving the collection, the search criteria will be applied and the results shown when the collection is clicked. You can create any number of collections for such custom views. For the butterfly example described above, in addition to a date constraint to find recent items, the categories field could be used to match color to have a series of collections for "Blue Butterflies," "White Butterfles," etc.
Multiple criteria can be used for a collection. For example, a collection called "Butterflies Photographed in the Last Month," could be made by setting a criterion on Creation Date and on Item Type as Image. Such date-based collections are really effective to show up-to-date views of content that don't require any administrative hand-work -- once such a collection has been created, it will automatically stay up to date.
Note: A collection doesn't behave like a normal folder -- you can't add content items via the add item menu, as you can for a normal folder.
Watch a Plone 2 video about adding a smart folder (now called Collection).
3. Collection Connections
You've seen how collections provide a way to augment an organization of content, with overlapping or overarching additional collections that key on date, or specific fields, or text searches. There is a deeper meaning to this, which gets to something called metadata, or "data about data," introduced in the section on Setting Basic Properties. Content management systems have this metadata, a kind of low-level intelligence, built into them. Plone incorporates the Dublin Core metadata element set, which was devised in Dublin, Ohio in 1995 at a library conference (Librarians are the ones really on top of information, you know). As the name indicates, there is a core set of things one could describe for different bits of content, be they images or full documents, or whatever. The Dublin Core, properly, the Simple Dublin Core, includes the following 15 items:
- Title
- Creator
- Subject
- Description
- Publisher
- Contributor
- Date
- Type
- Format
- Identifier
- Source
- Language
- Relation
- Coverage
- Rights
There are added-on wrinkles to this core you may read about here, but for this introduction to the concept, the Simple Dublin Core will suffice. You'll find some of these under the Properties tab of any item in Plone, and several others are implied by the nature of the content itself, such as for Type and Format, or by basic record-keeping wired into Plone, as for Publisher.
We are all lazy by nature, someone said. If only we filled in this optional information for any content item we create -- Think of the vast information and power at our fingertips! An exaggeration? Perhaps, but as we explore here, the functionality is there waiting for your data-describing impulse to discover hidden potential (not so hidden -- in fact, right in front of you).
The Simple Dublin Core may be extended, as Plone has done for several additions. For example, with Plone 3.0 a location item was added to Plone's metadata machinery. This lets people provide latitude/longitude or other map coordinates, perhaps taken with a GPS, for content items. This is a need arising in the past decade, recently accelerated by cheaper GPSes and use in mobile devices.
Imagine a woman who stuffs all her content into a single big folder holding thousands of content items -- images, pages, events, news items, links -- the works. If you looked over her shoulder at this swirling mass, you might first think of her as a lazy person, or just one missing the organization gene. But you notice that she can always find stuff, and has quick search links stored away, and, when she needs to find something special, or to build a custom report, she is adept at fast assembly. How does she do it? She does it by dedication to filling out metadata fields and by taking advantage of those clever collections.
The one-folder woman is using Plone as a content management system de rigueur. (Of course, it is so easy to also organize by folders, even in some crude sense, if you really are missing the organization gene). You might think such dedication should be limited to very large organizations, or especially to those cases where finding connections within information is important. But think of all those photos you've been taking with your digital camera. If you add them to your website, will you have the presence of mind to fill in at least the description field? You know how quickly months become years, and 100s of photos become 1000s. You get the idea.
The payoff for using an intelligent system properly is efficiency and the discovery of relationships, perhaps subtle.