![]() ![]() ![]() ![]() ![]() ![]() |
You can re-use portlets from the Administration Console within your portal. Doing this allows you to access portal resources directly from your portal, such as content, user and group information, or campaign settings.
This chapter includes the following topics:
The Administration Console is comprised of many portlets that access respective resources in different ways. Each tab within the Administration Console is a page containing a portlet, see Figure 2-1 for an illustration.
You can re-use these portlets in your portal application if you want to access portal resources without accessing the Administration Console. Portlets associated with the following portal resources are available to add to your portal:
Note: | Portal Management, Delegated Administration, Entitlements, and Service Administration portlets cannot be re-used in portal applications. |
Portlets within the Administration Console react to tree events. For example, when you use the Content Resource tree to select content, the content Summary tab (the content summary portlet) is activated, see Figure 2-2.
However, within your portal, resource IDs are used in inter-portlet communication events to activate Administration Console portlets. If another portlet refers to the resource ID that is used by a Administration Console portlet, that portlet is activated.
Note: | Administration Console tree portlets (the Portal Resource tree, the Content Resource tree, and so on) cannot be re-used in your portal application. If you want to use entire Administration Console functionality such as the Content Management Resource tree as well as its portlets, BEA recommends using the Administration Console rather than adding an Administration Console portlet to your portal. |
For example, you can use a combination of the Content Presenter portlet and the edit content portlet from the Administration Console to allow users to modify content on the fly. By adding an "Edit Content" button within the content presenter portlet that activates the edit content portlet.
WebLogic Portal provides specific APIs for working with Administration Console portlets that provides an interface-based framework that integrates with inter-portlet communication events. Instead of using events and event handlers explicitly, Administration Console portlets generate and receive events using resource IDS and this interface-based framework.
Before you can add any administration console portlets to your portal, you must first add the respective J2EE libraries to your web project. These library modules provide the common framework and the respective portlets that you can use.
After ensuring your web project includes the library modules you need, you can add administration portlets to your portal
Administration Console portlets require communication from another portlet in order to be activated. You need to build a portlet that will be used to activate or call an Administration Console portlet. Activating an Administration Console portlet is done by using resource IDs. You need to include code in the primary portlet that generates an event using a resource ID that the Administration Console portlet recognizes.
This section includes the following topics:
Administration Console portlets are included in respective library modules that you must add to your web project. Copy the J2EE modules that you need. The wlp-tools-common-web-lib and wlp-tools-framework-web-lib libraries are required for all portlets.
To add administration console J2EE libraries:
Administration Console portlets are designed to react to inter-portlet communication events that are generated by resource IDs. When a portal resource such as content or a user name is entered or selected in a portlet, the respective Administration Console portlet is activated.
For example, you can allow portal users to edit content displayed in a portlet by adding code in that portlet that activates the Edit Content Properties portlet, see Listing 2-1 for an example.
The following WebLogic APIs are used to interact with or "activate" Administration Console portlets:
ResourceID
PortletORB
// Create a resource ID (see Javadoc)
final ResourceID resourceID = ... ;
// Get a TreeSelectListener
final HttpServletRequest request = ...;
final HttpServletResponse response = ...;
final PortletORB portletORB = PortletORB.getPortletORB(request, response);
final PortletHandle portletHandle = portletORB.getBroadcastPortletHandle();
final TreeSelectListener listener = portletHandle.
narrow(TreeSelectListener.class);
// Call selected(...)
final ResourcePath resourcePath = new ResourcePath(new ResourceID[] { resourceID });
final ResourceType resourceType = resourceID.getResourceType();
listener.selected(resourcePath, resourceType, resourceID);
![]() ![]() ![]() |