New in Liferay 5.2 is the concept of Scopes as it applies to portlets instead of roles. As we learned earlier, roles can be scoped by the portal, by a community, or by an organization. This means that the role only takes effect for the scope in which it resides. For example, a Message Boards Administrator role with complete access to the Message Boards portlet would have different permissions based on the Role's scope. If it's a regular role, members have permission to administer message boards across the portal. If it's a community role, members have permission to administer message boards only within the community in which they are members of the role. If it's an organization role, members have permission to administer message boards only within the organization in which they are members of the role.
In a similar fashion to this, some Liferay portlets can now have scopes that go beyond just the specific community or organization upon which the portlet has been placed. You can now scope them by page.
First of all, what do we mean by the word scope? Scopes are another term for a set of data that is isolated from another set of data stored in the portal database. For example, if you place a Message Boards portlet on two different communities, each Message Board has its own set of data. That is how there can be two, twenty, or 20,000 different message boards in the portal, because each has its own scope of data.
In previous versions of Liferay, scopes were hard-coded to be limited to organizations and communities. If you have what we would call a non-instanceable portlet, that's another way of saying the portlet is scopable. Yes, neither of those are real words, but they are an attempt to communicate the fact that each instance of the portlet has its own data set, and that data set is limited by a scope that is defined as belonging to a community or organization.
In Liferay 5.2, you can now set the scope to be for any page. This allows you to add any number of these portlets to a community or organization, and as long as they appear on different pages, they will have different sets of data. This allows you to have more than one message board per community or organization if you wish.
Unless otherwise noted, all of the portlets in this chapter support scopes. This gives you much more flexibility in how you want to set up your portal. By default, however, the scope remains the same as it always has, and is set to be by the community or organization. If you want to change the scope, it only takes a few simple steps.
Illustration 51: Changing the scope for a portlet. That's all it takes to change the scope for a particular portlet instance. By setting the scope to page, you can add as many of these portlets to a particular community or organization as you want, provided they all are added to different pages.