Skip Headers
Oracle® Fusion Middleware Federated Portals Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)

Part Number E14235-05
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

11 Consumer Entitlement

Consumer entitlement allows producers to decide which portlets to offer to consumers based on registration properties.

This chapter includes these topics:

11.1 Introduction

WSRP allows consumers to pass information to producers during registration. Through the User Management features of WebLogic Portal, you can create roles based on this registration information. The roles, in turn, can be used to entitle specific portlets for specific consumers. This feature allows producers to control which portlets are offered to specific consumers.

To entitle consumers based on registration properties:

  1. Define one or more application-defined property sets using Oracle Enterprise Pack for Eclipse. See Section 11.2.1, "Creating an Application Property Set".

  2. Modify the wsrp-producer-config.xml configuration file for each portal web application on the producer. See Section 11.2.2, "Editing the Producer Configuration File".

  3. Define user entitlements based on the application-defined property set(s). See Section 11.2.3, "Defining Consumer Entitlements".

No configuration is required by consumers. All of the configuration takes place on the producer. Once the producer is properly configured, required registration information is sent to the consumer in response to a service description request. The consumer simply prompts the user to enter the registration information requested by the producer through either the WebLogic Portal Administration Console or Oracle Enterprise Pack for Eclipse.

A typical use case for consumer entitlements is to provide one consumer access to a set of portlets and another consumer access to another set of portlets. For example, suppose your company has several partners. The administrator of the producer could create a registration property with a set of unique values. The administrator could then give each partner their own unique registration property value. When partners register the producer, they are required to enter their value as a registration property, which entitles them to receive a specific set of portlets.

11.2 Configuring a Producer

This section explains how to configure a producer to entitle consumers based on registration properties.

Tip:

You can only define consumer entitlements in a complex producer. For information on complex producers, see Section 3.4, "Understanding Producers and Consumers".

The basic steps include:

11.2.1 Creating an Application Property Set

The first step in creating entitlements for consumers based on registration properties is to create one or more Application-Defined Property Sets using Oracle Enterprise Pack for Eclipse. These property sets are used to specify the values a consumer must supply to a producer at registration time.

Tip:

Application-Defined Property Sets must be created in a datasync project. To start the datasync creation wizard in Oracle Enterprise Pack for Eclipse, select File > New > Other > WebLogic Portal > Datasync. For detailed information on creating Application-Defined Property Sets, see the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal.

For example, if you create a property set containing a set of identification keywords. When the producer receives the registration information from the consumer, it can evaluate the keyword it receives and, based on a visitor entitlement, return a specific set of portlets. If the user registers with a different keyword, a different set of portlets could be returned.

The property sets you create appear in Oracle Enterprise Pack for Eclipse in the datasync project's src/propset folder. Figure 11-1 shows a sample propset folder containing two property sets.

Figure 11-1 Application-Defined Property Sets

Description of Figure 11-1 follows
Description of "Figure 11-1 Application-Defined Property Sets"

11.2.2 Editing the Producer Configuration File

After you create property sets containing consumer registration properties and optional default values, you need to make the producer aware of these property sets. To do this, you must edit the configuration file wsrp-producer-config.xml. Only the property sets listed in this configuration file are sent to consumers for registration. This configuration file includes a <registration> element. This element includes the <property-uri> element, which specifies paths to each of the property sets you defined for that producer.

By default, a producer includes a path /wsrpregistrationproperties. You can either put .propset files in that directory or create other directories as needed and list them in the <property-uri> element.

Tip:

By default, the wsrp-producer-config.xml file is stored in a J2EE Shared Library. To edit the file, you must first copy it from the J2EE Shared Library to your workspace. To do this, switch to the Merged Projects view in Oracle Enterprise Pack for Eclipse. In the WEB-INF directory of the producer web application, right-click the wsrp-producer-config.xml file (it appears in an italic font) and select Copy to Project. The configuration file is then copied from the J2EE Shared Library to your file system, where you can edit it. Any local changes you make to the file take precedence over the J2EE Shared Library version.

Example 11-1 shows a sample <registration> element in a wsrp-producer-config.xml file. A directory called /wsrpregistrationproperties is created and configured by default in the wsrp-producer-config.xml file. Any property sets placed in this directory are automatically sent to the consumer as registration properties. In addition, all property sets in the /wsrp directory will be sent to the consumer as registration properties. The paths specified in the <property-uri> element are relative to the META-INF/data directory of each producer web application. Note that the directory name /wsrp is an example only; you can create property sets under any directory name you choose. If you do not provide specific property sets using <property-uri> elements, WebLogic Portal imports all Application-Defined Property Sets for registration properties.

Example 11-1 Registration Element

<service-config>
        <registration required="true" secure="false">
     <property-uri>/wsrpregistrationproperties</property-uri>
            <property-uri>/wsrp</property-uri>
        </registration>
        <service-description secure="false" supports-method-get="true"/>
        <markup secure="false" rewrite-urls="true" transport="string"/>
        <portlet-management required="true" secure="false"/>
    </service-config>

The isStrict keyword is a <registration> keyword that causes registration to fail in a specific case, as specified in Table 11-1.

Table 11-1 isStrict Keyword

Value of isStrict Explanation
isStrict = true 

Causes registration to fail if both of these are true:

  • a consumer provides a property value for a registration property that has a restricted set of values defined and

  • the provided value(s) do not fall within the restricted set of values.

isStrict = false 

(Default) If the consumer sends a value that lies outside of the set of values associated with a registration property set, the user can register, but the registration value(s) are not saved. In this case, entitled portlets that require these values will not be offered to the consumer.


The isStrict keyword is part of the <registration> element. The isStrict keyword is show in bold type in Example 11-2.

Example 11-2 isStrict Keyword

<service-config>
   <registration required="true" secure="false" isStrict="true">
      <property-uri>/wsrpregistrationproperties</property-uri>
      <property-uri>/wsrp</property-uri>
</registration>
   </service-config> 

11.2.3 Defining Consumer Entitlements

After you have created property sets for consumer registration and added them to the wsrp-producer-config.xml file, you can create visitor entitlements based on the property sets.

In the WebLogic Portal Administration Console, you can define Role Expressions for consumer registration. Figure 11-2 shows the Role Expressions tab selected for a Visitor Role called role1.

Figure 11-2 Role Expressions Tab

Description of Figure 11-2 follows
Description of "Figure 11-2 Role Expressions Tab"

The role expressions are used to dynamically determine whether or not a consumer belongs to a visitor entitlement role. Individual portlets can then be offered based on membership in that role.

To create a visitor entitlement in the Administration Console:

  1. Create a visitor role.

  2. Define one or more consumer registration expressions in the role.

  3. Entitle specific portlets based on the role.

For example, you can define a role with the following Role Expression: If the property p1 equals red, blue, or green, then consumer is considered to be a role member. The producer then returns all portlets that are entitled for that role to the consumer. Figure 11-3 shows the Add Conditions dialog in the WebLogic Portal Administration Console. This dialog is used to define Role Expressions. When creating entitlements for consumer registration, select The Consumer's registration has these values from the Type of condition drop-down menu.

Figure 11-3 Setting Registration Properties

Description of Figure 11-3 follows
Description of "Figure 11-3 Setting Registration Properties "

Detailed information on setting up visitor entitlements is beyond the scope of this guide. See the Oracle Fusion Middleware Security Guide for Oracle WebLogic Portal for information on this topic.

To entitle a portlet with a consumer registration role:

  1. In the Administration Console, select the portlet you want to entitle.

  2. Select the Entitlements tab.

  3. Click Add Role.

  4. Use the Add Role dialog to select the role to add to the portlet, and click Save.

  5. Complete the Entitle Capabilities to Resource dialog (Figure 11-4) to assign capabilities to the role and click Save.

    Figure 11-4 Entitling Capabilities to Resource Dialog

    Description of Figure 11-4 follows
    Description of "Figure 11-4 Entitling Capabilities to Resource Dialog"

11.3 Registering a Consumer

When you register a consumer with a producer that has been configured to request registration properties, the producer asks the consumer to provide values for those properties. In Oracle Enterprise Pack for Eclipse, the set of extended registration properties and optional default values are added to the Register dialog, which appears when you attempt to create a remote portlet. On each subsequent request by the consumer, the producer retrieves these registration properties and uses them to make entitlement decisions.

Figure 11-5 shows the registration dialog for a producer that requires registration properties. In this example, two properties are requested: reg1 and reg2. The property values entered by the user are sent to the producer. The producer retrieves the values and stores them. On subsequent requests, the producer compares the stored registration values to the registration values it requires. If the registration values are accepted, the producer uses them to determine to which role the consumer belongs. Once the consumer's role is established, the producer returns only entitled portlets to the consumer.

Figure 11-5 Register Dialog

Description of Figure 11-5 follows
Description of "Figure 11-5 Register Dialog"

Tip:

When you register a producer, the consumer sends a getServiceDescription request to the producer. The producer's response includes the <registration> element. This element includes a list of the types of registration properties the producer requires. The consumer then populates the registration dialog with the appropriate fields. The user fills out these fields and submits them with the registration request. For information on getServiceDescription and other WSRP operations, see Chapter 3, "Federated Portal Architecture."

11.4 Modifying Registration Properties

Using the WebLogic Portal Administration Console, you can modify the registration properties for a producer that has already been registered with a consumer. When the consumer re-registers the producer, some portlets that were previously in use might not be available or some additional portlets might be available to the consumer. For detailed information on modifying the registration properties for a producer using the Administration Console, see Section 20.2, "Modifying Producer Registration Properties".