![]() ![]() ![]() ![]() ![]() ![]() |
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. Each portlet can access its resources in different ways. Each tab within the Administration Console is a page containing a portlet, see Figure 2-1 for an illustration.
To access portal resources without accessing the Administration Console, you can re-use these portlets in your portal application. 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, such as the Portal Resource tree and the Content Resource tree, cannot be re-used in your portal application. If you want to use the entire Administration Console functionality such as the Content Management Resource tree as well as its portlets, Oracle recommends using the Administration Console rather than adding an Administration Console portlet to your portal. |
WebLogic Portal provides specific APIs for working with Administration Console portlets that provide 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 the interface-based framework.
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. To do so, within the Content Presenter portlet, you add an Edit Content button, which activates the edit content portlet.
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 for this purpose.
After ensuring that your web project includes all the library modules you need, you can add administration portlets to your portal.
To be activated, Administration Console portlets require communication from another portlet. Subsequently, you need to build a portlet that activates or calls an Administration Console portlet. Activating an Administration Console portlet is done by using resource IDs. You need to include code in the primary portlet to generate an event using a resource ID that the Administration Console portlet recognizes.
Administration Console portlets are included in respective library modules that you must add to your web project, as shown in Table 2-1. 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 the content displayed in a portlet by adding code in that portlet that activates the Edit Content Properties portlet, as shown in Listing 2-1. 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);
If you are reusing WebLogic Portal Administration Console portlets in a portal, some features and steps that are referred to in the administration console online help system might not apply in the context in which the portlets are reused.
For example, in the context of the administration console, content management portlets react to tree events (events generated by clicking in the content resources tree to select content). In a reuse context, the portlets are configured (by a portlet developer) to react to events fired by other portlets. The tree view will not be present and therefore, some steps described the help system will not apply.
It is possible that some resources, such as certain images, CSS files, and scripts, will not appear in a reused Administration Console portlet. This is because the portlet references resources that are only specified in the skin file that is used by the Portal Administration Console. If your portal uses a different skin file, these resources will not show up, as shown in Figure 2-3.
The simplest way to fix this problem is to add the appropriate references to the skin.xml
file used by your portal’s look and feel. To edit the skin.xml
file, you must first copy it to your project in Workshop for WebLogic (right-click the file and select Copy to Project). For more information on skins, see
Working with Skins in the Portal Development Guide.
Listing 2-2 highlights the kinds of changes you might need to make to your skin file to ensure that Administration Console specific resources show up in your reused portlet. These resources are indicated in Listing 2-2 by the comment:
<!-- from the wlp-tools skin -->
Note: | If your portal is using the Bighorn skin, you also need to make similar changes to the Internet Explorer specific skin file, .../skins/bighorn/msie/skin.xml . This ensures that the skin will function properly in Internet Explorer browsers. |
<skin
xmlns="http://www.bea.com/servers/portal/framework/laf/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/servers/portal/framework/laf/1.0.0 laf-skin-1_0_0.xsd"
>
<target-skeleton>
<skeleton-id>bighorn</skeleton-id>
</target-skeleton>
<images>
<search-path>
<path-element>images</path-element>
<!-- from the wlp-tools skin -->
<path-element>../wlp-tools/images</path-element>
</search-path>
</images>
<render-dependencies>
<html>
<links>
<search-path>
<!-- from wlp-tools skin -->
<path-element>../wlp-tools/custom/css</path-element>
<path-element>../wlp-tools/css</path-element>
<path-element>css</path-element>
</search-path>
<link href="colors.css" rel="stylesheet" type="text/css" />
<link href="general.css" rel="stylesheet" type="text/css" />
<link href="menu.css" rel="stylesheet" type="text/css" />
<link href="window.css" rel="stylesheet" type="text/css" />
<link href="wsrp.css" rel="stylesheet" type="text/css" />
<link href="custom.css" rel="stylesheet" type="text/css" />
<!-- from wlp-tools skin -->
<link href="wlp.css" type="text/css" rel="stylesheet"/>
<link href="wlp-custom.css" type="text/css" rel="stylesheet"/>
</links>
<!-- from wlp-tools skin -->
<scripts>
<search-path>
<path-element>../wlp-tools/js</path-element>
<path-element>../../../js</path-element>
</search-path>
<script type="text/javascript" src="com/bea/portal/tools/js/Core.js"/>
<script type="text/javascript" src="com/bea/portal/tools/js/Core.jsp"/>
<script type="text/javascript" src="com/bea/portal/tools/js/javascriptConstants.jsp"/>
<script type="text/javascript" src="com/bea/portal/tools/js/Math.js"/>
<script type="text/javascript" src="com/bea/portal/tools/js/skin/FeatureProviderManager.js"/>
<script type="text/javascript" src="com/bea/portal/tools/js/skin/ProgressManager.js"/>
<script type="text/javascript" src="com/bea/portal/tools/js/html/Form.js"/>
<script type="text/javascript" src="com/bea/portal/tools/js/html/Event.js"/>
<script type="text/javascript" src="progress-manager.js"/>
<script type="text/javascript" src="progress-manager.jsp"/>
<script type="text/javascript" src="main-menu.js"/>
<script type="text/javascript" src="resize-collapse.js"/>
<script type="text/javascript" src="skin.js"/>
</scripts>
<!-- from wlp-tools skin -->
<styles>
<search-path>
<path-element>../wlp-tools/custom/css</path-element>
<path-element>../wlp-tools/css</path-element>
</search-path>
<style content-uri="wlp-ajax-image.css" type="text/css" />
</styles>
</html>
</render-dependencies>
<!-- from wlp-tools skin -->
<script-dependencies>
<script-fragments>
<fragment event-handler="onload">__BEA.framework.skins['wlp-tools'].js.onload()
</fragment>
</script-fragments>
</script-dependencies>
</skin>
![]() ![]() ![]() |