Setting Up My Content Portlet

To make My Content portlet available for administrators to create and manage content, you much perform the following tasks:

Step 1: Add the My Content Portlet to a Portal Project (Web Application)

Before you begin this process, it is assumed that you already have a portal application with a portal project (web application) that it is running on a WebLogic Server. For more information on creating a portal application, see Creating a Portal Application and Portal Web Project.

  1. Start WebLogic Workshop and open your application.
  2. Create a directory in your portal project titled “portlets”, if one does not already exist.
  3. Right-click on your “portlets” folder and choose Import…, or click the portlets folder and choose File -> Import Files…
  4. In the Import Files to Project dialog, navigate to the folder called content.
    Import or copy this to this directory (create if necessary)
    <WEBLOGIC_HOME>\samples\portal\portalApp\
    sampleportal\portlets\content\
    <PORTAL_APP>\<project>\portlets\
  5. With the content folder selected, click Import.

    Note: The My Content portlet requires that users be logged in to determine the rights each user has on certain content. Consider importing the “Login to Portal” portlet as well. To do this, import the folder “login” and the file “includes/Login.portlet” from the same location as the “content” folder above.

Step 2: Add the Portlet to a Page in your Portal

  1. In WebLogic Workshop, Add the My Content portlet to a page in your .portal based Portal.
    Or
    In the Administration Portal, add the My Content portlet to a page in your streaming Portal.

    Note: The .portal file you create in WebLogic Workshop is a template. In this template you create books, pages and portlets and define defaults for them. When you view the .portal file with your browser the portal is rendered in "single file mode," meaning that you are viewing the portal from your file system as opposed to a database.

    The .portal file's XML is parsed and the rendered portal is returned to the browser. The creation and use of a .portal is intended for development purposes. Because there is no database involved you cannot take advantage of things such as user customization. Once you have created a .portal file you can use it to create desktops for a production environment.
  2. View your portal with the WebLogic Test Browser or with your default browser. Login to the portal as webLogic, webLogic so you can see the portlet.
    • WebLogic Test Browser - In the WebLogic Workshop toolbar, click the Start button (or press Ctrl+F5).
    • Default Browser - In the WebLogic Workshop menu, choose Portal-->Open Current Portal.

    Note: Only the BEA Repository is visible until you add content.

Step 3: Set Up User Access Rights to Content

You can set up user access to the My Content Portlet two ways:

Set Up Delegated Administration Rights in the Administration Portal

Delegated Administration provides a way for WebLogic Administration Portal to propagate privileges down a hierarchy of roles. A Delegated Administration role is a dynamic classification of users based on user name, group membership or by the user's characteristics (or expressions), such as user profile values or time.

The rights you set up in the Administration Portal determine the content users can see and manage in My Content Portlet. Users must be in the PortalSystemAdministrators group to manage content with My Content portlet, and you can set this up two ways:

To set up Delegated Administration Rights for content in the Administration Portal you will follow this general process:

  1. Create the Delegated Administration Role in the Administration Portal.
  2. Apply the role to a node/content using the Content Mananagement tools in the Administration Portal.

    Note: To grant Delegated Administration authority in the Administration Portal, be sure you select Can Manage for the content node to empower users with access to see and manage all of the content below the selected content node.

Set Up Portlet Preferences

This section contains information on the following subjects:

What is a Portlet Preference?

A portlet preference is a property in a portlet that can be customized by either an administrator or a user. The My Content Portlet provides you with a way to grant users access to content by using a special Portlet Preference called cm_homefolders. You can modify values of the cm_homefolders Portlet Preference using either the Administration Portal or WebLogic Workshop.

For example, your company provides each employee with his or her own private space for content on the corporate network. If you’ve got 10,000 employees, setting up Delegated Administration rights on each of those 10,000 folders individually would be very time consuming. The cm_homefolders Portlet Preference provides a way to quickly grant rights to content based on string substitution of users’ username, group names, or role names.

If each user’s private content area is represented by a folder that matches their username:

Corporate Repository

Employees

jan_h
jane_d
joe_p
john_d

To grant each user access to their folder, you add a value to the cm_homefolders Portlet Preference like /Corporate Repository/Employees/%username%. Now when jan_h logs in, she will have access to /Corporate Repository/Employees/jan_h and when joe_p logs in he will have access to /Corporate Repository/Employees/joe_p.

What Kind of Preferences Can I Set Up?

The My Content portlet supports three primary types of string substitution variables:

The %username% variable can be used to provide individual users access to the appropriate part of the content directory. The access is granted by adding %username% to a path in a repository. For example, /BEA Repository/%username%. If BEA Repository contains immediate children named Bob and Jane, the user named Jane would have access to /BEA Repository/Jane and its children while the user Bob would have access to /BEA Repository/Bob and its children.

Note: Users and groups are scoped to the users and groups that are set up in the Administration Portal. Roles are scoped to visitor entitlements.

Steps for Setting Up Preferences

You can set up portlet preferences in the Administration Portal or you can start the process in the Administration Portal and finish it in WebLogic Workshop.

Setting up Preferences in WebLogic Workshop

Use the following instructions to set up portlet preferences:

  1. In the Administration Portal, create the necessary Users and Groups,
    OR
    Create the necessary Visitor Entitlement Roles.
  2. Set up nodes for the Users, Groups, or Entitlements in the Content Management Hierarchy in the Administration Portal.
  3. In WebLogic Workshop, set up the Preferences to point to the nodes you created: (%username%, %groupname%, %rolename%)
    1. Open the portlet called content.portlet in the sampleportal\portlets\includes directory. The portlet appears in the Portlet Designer.
    2. Drag a New Preference from the Palette window and drop it on the body of the portlet.
    3. In the Portal Designer, expand the Portlet Preferences bar and select New Preference.
    4. In the Property Editor, enter preference values.
  4. After this restriction is set, the portlet will have access starting only at the path defined for both browsing and searching. You can create additional restrictions by creating additional portlet preferences using the previous steps. When you use multiple path restrictions, only those paths are available for browsing and searching.

 
Setting up Preferences in the Administration Portal
Use the following instructions to set up portlet preferences:
  1. In the Administration Portal, select the My Content portlet in the Library Portal Resources -> Library -> All Portlets -> My Content.
  2. Select the Portlet Preferences tab.
  3. Click Edit next to the cm_homefolders Portlet Preference.
  4. Enter a new value in the Add new value: box, such as /BEA Repository/employees/%username%.
  5. Click Add for each new value that you want to add to the Portlet Preference.
  6. Click the trash can icon to remove any unwanted values.
  7. Click Save Portlet Preference to save your changes.

    NOTE: Do NOT to change the Preference Name field. Make sure that Is Multi-Valued is checked on. If you wish to make sure that all occurrences of this portlet use your new values, check Propagate value(s) to all instances of this Portlet before saving.

For more information about portlet preferences in the Administration Portal, see Creating Portlet Preferences.

Related Topics

Searching with My Content Portlet