Step 6: Login and View the Content Selector

In this step you will use the two users created in the previous step to login to the desktop. This allows the Content Selector to be evaluated and display the results of the expression. You will then make changes to the content and to the expressions to see the effects.

The tasks in this step are:

Login Using the Newly Created Users

  1. Open a browser and go to the URL: http://localhost:7001/sampleportal/appmanager/MyPortal/desktop1, and login as tutor1.

When logged in you should see one or more images in the Content Selector section of the tutorial portlet. The images displayed in the portlet are those that match the expression in the Content Selector, which is as follows:

In this step the user tutor1 is in the Internal segment and, therefore, satisfies the condition. The images displayed have the Audience property set to the value Internal and are displayed in the portlet. In the next tasks you will make changes that will cause different images to be displayed, demonstrating dynamic personalization of a site.

Change Properties on Content and View Results

  1. Select Content in the main navigation pane.

  2. In the Content Hierarchy Resource tree, navigate to BEA Repository -> Ads -> financial -> AdCampaign -> External -> collegePlanningCampaign.jpg.
  3. Select the collegePlanningCampaign.jpg, and select the Create and Edit Content tab.
  4. Locate the Audience property, and change the value to external.

  5. Click Update to save the changes.
  6. Refresh the browser with the tutorial portal, and note the changes in how the set of images display.

You might want to try changing the values on other content to see the effects. Be sure to include at least some images with the Audience property set to Internal and some set to External in order for the tutorials to work.

This task demonstrates how the content properties are used to select what will be displayed. In your own portal applications you will have content that has your own properties, all of which can be used for personalizing a site. In the next task we will see the role of the user’s properties can be used in a similar way.

Change Content Selector Expressions and View Results

As demonstrated in the preceding task, dynamic personalization is fundamentally tied to the evaluation of expressions based on a variety of properties. The Content Selector that you have been using has two parts, the first for evaluating a condition and the second for choosing the appropriate content.

In this task you will change the values in this expression, causing different images to be displayed in the tutorial portlet. If you changed the properties for the content in the previous task, please make sure that there are at least some images with the Audience property set to Internal and some set to External. If these are not set then you will not see the expected results.

  1. Select Content Selectors in the main navigation pane.

  2. In the Content Selectors Resource tree, navigate to Content Selectors-> tutorial.

  1. Open the expression editor by clicking on the tutorial content selector.
  2. Next to audience is equal to, click on the value Internal.
  3. Change the audience setting to External, and click Save Changes.

  4. In the browser displaying the tutorial desktop, refresh the display. If you have logged out, log back in as the user tutor1.

    Note: The images displayed in the Content Selector section of the tutorial portlet will now be those that have the Audience attribute set to External.

  5. In the WebLogic Administration Portal, select the Properties tab for Content Selector -> tutorial.
  6. Next to The visitor is in any of the following user segments click on the value Internal.

  7. Using the Select and Deselect buttons, swap the values so that the Selected User Segments column contains only the External segment, and click Save Changes.
  8. Refresh the display again in the browser displaying the tutorial portal. The content query section of the tutorial portlet is now blank because the user tutor1 is not classified as part of the External segment. The condition evaluates to false and, therefore, no content is displayed.
  9. Log out of the tutorial desktop and log back in as the tutor2 user. You should now see images displayed in the Content Selector section of the tutorial portlet as the tutor2 user is classified as part of the External segment.

In this task we have explored the expression used for Content Selectors to see how user and content property values are evaluated to determine what will be displayed. By using the appropriate content properties, user properties, conditions, and selection expressions, users see content defined specifically for them. The WebLogic Administration Portal is designed to make it easy for the application owners to easily manage sites that provide a truly dynamic user experience.