14 Consuming Portlets
Register portlets to add them to portal pages in WebCenter Portal.
Topics:
Introduction to Consuming Portlets
WebCenter Portal enables you to consume a portlet by registering its producer with the ADF application. Your ADF application can consume portlets that you build and portlets that you receive from a third party, such as a packaged-application vendor.
In addition to WebCenter Portal, a producer application can also be consumed in other ADF applications. This enables you to use portlets in any applications based on ADF. Users developing portlets can tests the functionality in ADF application with JDeveloper.
You can register portlet producers in two ways:
-
Register the portlet producer with an ADF application. Use this option if you are not likely to register the producer with other applications.
-
Register the portlet producer using the Resource Palette. Use this option to use the producer's portlets in multiple applications.
A portlet that is available in the Resource Palette can be added to any of your application by dropping it on the page or by adding it to Application Resources. You can drag and drop a whole producer connection from the Resource Palette into the Application Resources panel of the Application Navigator. This registers the producer with the application. Alternatively, you can right-click a producer in the Resource Palette and choose Add to Application from the context menu to register the producer with the currently open application.
JDeveloper provides wizards for registering both WSRP producers and Oracle PDK-Java producers.
There are many options associated with portlet consumption. For example, you can choose to place portlets directly onto a page or nest them in a Composer component, you can adjust many attributes of the portlet tag, and you can wire portlets to each other.
Registering a WSRP Portlet Producer with WebCenter Portal
When you register a WSRP portlet producer, you provide basic information that describes the producer's operational parameters. This information is used by the portlet-consuming application to communicate with the producer and with the portlets through the producer.
WebCenter Portal supports both WSRP 1.0 and WSRP 2.0 producers. The WSRP 2.0 standard, among others, provides support for inter-portlet communication and export and import of portlet customizations. You can leverage the benefits of WSRP 2.0 while building standards-based JSR 286 portlets.
This section includes the following topics:
How to Register a WSRP Portlet Producer using JDeveloper
You can register a WSRP portlet producer using JDeveloper.
The Register WSRP Portlet Producer wizard is the entry point for registering both WSRP 1.0 and 2.0 producers. When registration is successful, the newly registered producer displays in JDeveloper either in the Application Resources panel of the Application Navigator, or in the Resource Palette, depending on where you created the connection. You can then select portlets from the producer for placement on your application (.jspx
) pages.
Note:
If you are registering a producer provided by Oracle WebLogic Portal, and the portlet uses ADF Rich Components, you should register the WSRP 2.0 WSDL URL to ensure that the portlet functions correctly.
You also use the Register WSRP Portlet Producer wizard to register JSF portlets, which are portletized JSF applications or portletized ADF task flows. Once you create a portlet from a JSF application, you can deploy the portlet to a WLS instance and register the JSF portlet producer as you would register any WSRP portlet producer. The Oracle JSF Portlet Bridge exposes JSF applications and task flows as JSR 286 portlets.
To register a WSRP portlet producer:
Note:
In the Register WSRP Portlet Producer wizard, if you click Cancel after you have clicked Finish, the registration is not canceled.
How to Map a Producer's Declared User Categories to an Application's Defined Java EE Security Roles
web.xml
file properties.
To map producer-declared user categories with application-defined Java EE security roles:
Registering an Oracle PDK-Java Portlet Producer with WebCenter Portal
When registration is successful, the newly registered producer is displayed in JDeveloper either in the Application Resources panel of the Application Navigator, or in the Resource Palette, depending on where you created the connection. You can then select portlets from the producer for placement on your application (.jspx) page.
Note:
In the Register Oracle PDK-Java Portlet Producer wizard, if you click Cancel after you have clicked Finish, the registration is not canceled.To register a PDK-Java portlet producer:
Managing Portlet Producer Connections
After registering a portlet producer, you can edit the registration settings, test the connection, refresh the producer to obtain the latest list of portlets, or delete the connection to the portlet producer.
This section includes the following topics:
Editing Portlet Producer Registration Settings
Both the WSRP and PDK-Java portlet producer registration wizards enable you to access and revise many of the values you entered when you registered the producer.
To edit portlet producer registration settings:
Testing a Portlet Producer Connection
The connection testing feature provides a means of testing the validity of a portlet producer connection.
To test a portlet producer connection:
Refreshing a Portlet Producer
Tip:
When a portlet is removed from a producer, be sure to manually delete the portlet from all application pages on which it has been placed. For more information, see Deleting a Portlet Producer
To refresh a portlet producer:
- Open Oracle JDeveloper.
- In the Application Navigator, expand Application Resources node.
- Navigate to the producer and right-click the producer you want to refresh, and choose Refresh Producer Registration.
- In the Portlet Producer Refresh dialog, click Yes.
Deleting a Portlet Producer
Note:
If you delete a producer, any pages that consume portlets from that producer display an error message that the portlet is unavailable. The portlets continue to be unavailable even if you re-register the producer using the same name.
To delete a portlet producer:
- Open Oracle JDeveloper.
- In the Application Navigator, expand Application Resources node.
- Navigate to the producer and right-click the producer you want to delete, and choose Delete.
- In the Delete Confirmation dialog, click Yes.
Adding Portlets to a Page
Placing a portlet on a page is a simple matter of dragging the portlet from the Application Resources panel or Resource Palette and dropping it on the page.
Before You Begin
Before you can place a portlet on a page, there are a few preparatory steps you must perform before you can take this simple action. These include:
-
Creating an ADF application
-
Creating an application page in the ADF application.
-
Registering the portlet's producer with the application.
-
Some of the portlets you plan to consume may come from applications that handle their own authentication. In such cases, you must register the application as an external application and identify it to the portlet producer that provides it.
-
Some of the portlets you plan to consume may come from producers that are Secure Sockets Layer (SSL) enabled. When you try to access an SSL-enabled producer, you may be presented with a Security Alert dialog, prompting you to view the producer's certificate and add it to the list of trusted certificates. The Security Alert dialog displays only if the producer uses a security certificate issued by a certificate authority that is not widely accepted. To consume portlets from such a producer, you must first add the producer's security certificate to the keystore.
Topics:
How to Add a Portlet to a Page
To add a portlet to a page:
What Happens When You Add a Portlet to a Page
When you add a portlet to a page, a portlet tag (adfp:portlet
or adfph:portlet
) is added to the page source. This is the tag that represents the portlet component. This tag includes attributes that you can edit using the Property Inspector, or in the page source, to further control the behavior and appearance of the portlet. For information about these attributes, see Setting Attribute Values for the Portlet Tag.
The type of portlet tag used is determined by the following:
-
If the project is configured for rich client components alone, the
adfp:portlet
tag is used. -
If the project is configured for Trinidad components alone, the
adfph:portlet
tag is used. -
If the project is configured for both rich client and Trinidad components, a dialog displays where you can choose which portlet tag to use.
-
If the project is not configured for rich client or Trinidad components, the
adfp:portlet
tag is used and the project is automatically configured for rich client components.
This is so that the look and feel of the portlet matches that of other components on the page. In this case, the portlet is added using the adfp:portlet tag
, as shown in the following example:.
Example 14-1 Rich Client Page Containing a Portlet
<?xml version='1.0' encoding='US-ASCII'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:adfp="http://xmlns.oracle.com/adf/faces/portlet">
<jsp:directive.page contentType="text/html;charset=US-ASCII"/>
<f:view>
<af:document>
<af:form>
<adfp:portlet value="#{bindings.Portlet11_1}"
id="portlet1"
renderPortletInIFrame="true"/>
</af:form>
</af:document>
</f:view>
</jsp:root>
If you are working with an upgraded 10.1.3.2 application or an application that contains Trinidad components, the application uses HTML components, rather than rich client components. In this case, when you drag a portlet onto a page, the adfph:portlet
tag is used, as shown in the following example.
Example 14-2 Trinidad Page Containing a Portlet
<?xml version='1.0' encoding='US-ASCII'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:adfph="http://xmlns.oracle.com/adf/faces/portlet/html">
<jsp:directive.page contentType="text/html;charset=US-ASCII"/>
<f:view>
<tr:document title="Title 1">
<tr:form><adfph:portlet value="#{bindings.Portlet12_1}
"id="portlet1"/>
</tr:form>
</tr:document>
</f:view>
</jsp:root>
If the application page includes one or more Composer components, this may influence where the portlet is placed. For example, in the Structure panel, a portlet placed on a page with a cust:panelCustomizable
tag, would be placed as illustrated in the following example:
Example 14-3 Hierarchical Placement of the Portlet Tag
af:document
af:form
cust:panelCustomizable
adfp:portlet
Note:
We recommend that you do not mix ADF Faces rich client components with HTML or Trinidad components on the same page. Doing so may produce unexpected results at runtime. Therefore, do not place a rich client portlet inside a Composer HTML component or an HTML portlet inside a Composer rich client component.
Note:
When you drop an instance of OmniPortlet onto your page, open the Property Inspector and ensure that the AllModesSharedScreen
property, under the Display Mode category, is set to false
, the default value. Setting this property to true may prevent you from editing certain sections of your OmniPortlet in the OmniPortlet wizard.
What You May Need to Know About Interportlet Communication
One way to make your application more interactive is by linking related components such that their contents are synchronized based upon the context. For example, suppose you have two stock portlets on a page, one provides data about a stock's price while the other provides headline news items for a stock. Both portlets are based upon the stock ticker symbol, hence it would make sense that, when the ticker symbol is changed in the stock price portlet, the stock headlines portlet picks up that change and refreshes itself with headlines pertaining to the same ticker symbol.
The JSR 286 standard introduces public render parameters, which you can use to link portlets on a page. See How to Use Public Render Parameters in JSR 286 Portlets.
The JSR 286 standard also supports portlet events. You can use portlet events to drive the content of a portlet based on actions that occur elsewhere on the page. Portlet events can be cascaded so that a portlet may respond to an event by triggering an event of its own, which in turn affects other portlets on the page. Portlet events can also be consumed by ADF contextual events and contextual events can be consumed by portlets. You can use this to contextually link portlets and task flows. See How to Use Portlet Events in JSR 286 Portlets.
When you add a portlet to a page, a portlet binding is added to the page definition file. This portlet binding includes attributes that specify whether the portlet should automatically listen for parameter changes and events.
Example 14-4 Portlet Binding
<portlet id="LotteryPortlet2_1"
portletInstance="oracle/adf/portlet/SamplePortlets/ap/Ei7default_03ba18be_012d_1000_8002_0ae8827e9493"
class="oracle.adf.model.portlet.binding.PortletBinding"
retainPortletHeaders="false"
listenForAutoDeliveredPortletEvents="true"
listenForAutoDeliveredParameterChanges="true"
xmlns="http://xmlns.oracle.com/portlet/bindings"/>
Setting these attributes to true
(the default) means that any parameters that are changed or events that are raised elsewhere on the page that match those supported by the portlet (that is, they have the same QName) automatically cause the portlet to be updated accordingly. In addition, the portlet can define aliases for its parameters and events to match parameters and events with different QNames.
You can set these attributes to false to disable this automatic parameter and event listening. For example, your page might contain multiple instances of the same portlet that require values to come from different sources. If you disable automatic parameter and event listening, or if your portlet defines parameters or events with names that do not match those you want to use for linking, you must manually configure the portlet wiring. See Manually Wiring Parameters and Events in JSR 286 Portlets.
What You May Need to Know About Inline Frames
Rendering a portlet directly on a page provides a better user experience as compared to placing it in an inline frame (iframe
). However, at times, it may be required to include the portlet markup inside an inline frame. You can use the renderPortletInIFrame
attribute to determine whether or not a portlet should be rendered in an inline frame.
The default setting of the renderPortletInIFrame
attribute is auto
. This causes the portlet consumer to attempt to rewrite the portlet markup whenever possible, so that it renders correctly within the Oracle ADF page without the need for an inline frame.
However, in the following circumstances, the portlet is rendered within an inline frame:
-
The parser throws an exception as it is not able to parse the markup.
-
The portlet code contains a multi-part form post.
-
The portlet code contains a file upload element.
-
The portlet developer explicitly requested that the portlet be rendered in an inline frame by setting the
com.oracle.portlet.requireIFrame
container runtime option in theportlet.xml
file to true.
Note:
Portlets created using the Oracle JSF Portlet Bridge have therequireIFrame
container runtime option set to true as these portlets are too complex to render directly on Oracle ADF pages due to JavaScript issues.
In some circumstances, the portlet consumer may be unable to rewrite the portlet markup and JavaScript to accommodate the portlet in the Oracle ADF page. If this is the case, you may find that the portlet does not behave as expected, for example, buttons do nothing or you get JavaScript errors in the console. If this happens, you should set the renderPortletInIFrame
attribute to true
so that the portlet is always rendered in an inline frame.
Some examples of when you should set renderPortletInIFrame
to true are when:
-
The portlet code builds up element names dynamically in JavaScript.
-
The portlet code uses multiple forms and references them in JavaScript by index.
-
JavaScript library code references elements within the portlet.
If you render a portlet within an inline frame, then manipulating window.location
may give unexpected results. If your portlet uses window.location
, then you should ensure that your JavaScript is robust enough to handle the case where the portlet renders itself inside an inline frame.
If you want to ensure that a portlet is never rendered in an inline frame, for example for accessibility reasons, set the renderPortletInIFrame
attribute to false
. Note however, that HTML markup from a portlet that is not rendered in an inline frame may interfere with other components on the Oracle ADF page.
For more information about the accessibility implications of using inline frames, see WebCenter Portal Accessibility Features.
What You May Need to Know About Portlet Sizing
ADF Faces components can stretch their children, or not. It is usually a requirement that a parent only contains a single child for it to be able to stretch that child. Components also support being stretched or not. When a component that supports being stretched is placed inside a parent that is stretching its child, the dimension of the child is determined by those of the parent. The child is said to be stretched by the parent and it is sized to fill the parent.
When a component is not stretched by its parent, it is said to be in a flow layout. Here it is not taking its size from its parent. It must determine its own size, either from its children or from dimension style settings specified by the page designer.
The portlet Faces component supports being stretched by its parent. It does not explicitly stretch its children.
There are three ways the size of a portlet component is determined, depending on the portlet's parent component and attributes set on the portlet component itself.
-
If the portlet is being stretched by its parent, the size is determined only by the parent. The portlet is in a stretch layout.
-
It does not matter how big the content is, this is irrelevant to the size of the portlet. If the content is bigger than the portlet, scrollbars are provided to enable users to display all the content.
-
If you specify a height for the portlet, it is ignored; stretching takes precedence.
-
This is the preferred layout method; it is always reliable.
-
The ADF Faces Tag documentation tells you whether each component stretches its children or not.
-
-
If the portlet is not being stretched by its parent and explicit sizes are set, they are used.
-
This is also always reliable; you'll get the size you specified.
-
If the content is bigger than the specified size, scrollbars are provided to enable users to display all the content.
-
The size is fixed; the size of the content is not taken into account.
-
-
If the portlet is not being stretched by its parent and no explicit sizes are set, the portlet attempts to auto-size to the content.
Auto-Sizing
When a portlet is in a flow layout and has no explicit size set, it attempts to set the size of the portlet so that it is exactly big enough to display all of the portlet content without scrollbars.
The portlet does this by asking the browser how much space is required to show the content without scrollbars and using that to set the height of the portlet. More specifically, it looks at the scrollHeight
property of the inline frame window.
How well this works depends on what is inside the portlet. Some layouts have a nice intrinsic size which auto-sizes well. However, some layouts and components inside the portlet, typically those that allow their content to overflow invisibly or with scrollbars, effectively hide the size of their contents. In specific terms of the HTML markup are HTML elements with overflow setting of hidden
, auto
, or scroll
. This can come from inline styles or CSS styles applied to the element.
The problem arises because the scrollHeight
is the minimum height required to correctly display the content. If you have, for example, a div
element with an overflow="auto"
, then if that div
is smaller than its content, then it uses scroll bars. So, when you ask what minimum size is needed to display the div
, unless it has an explicit height or minimum height set, the answer is 0. That means that the content of this div
, even if it has a definite height does not contribute to the overall scroll height of the content.
In ADF terms, this is often associated with components that expect to take their dimensions from their parents, for example panelStretchLayout with dimensionFrom="parent" or that scroll their contents, for example, panelGroupLayout with layout="scroll". These are the components that tend to have hidden or scrollable overflows.
Thinking about the ADF Faces layout model also gives us an alternative way of understanding the problem. The ADF Faces layout guidelines dictate starting with an unbroken chain of the components that are stretched by their parents and within that islands of flow layout, usually initiated by an af:panelGroupLayout where the components have fixed heights or take their dimensions from their children. If in the root of the portlet, we have that unbroken chain of components looking to take their dimensions from their parent but the portlet itself is in a flow layout and therefore is looking to take its dimensions from the content there is an impasse. The portlet is looking to take its dimensions from its parent for the size. It should be clear then that the solution to this is to stretch the portlet (that is, take it out of the flow layout island), set a height on the portlet, or make the content of the portlet entirely and island of flow layout content.
If the content cannot be auto-sized, the height defaults to 200px in Firefox and 0px in Internet Explorer. The fact that Internet Explorer is 0 is caused by incorrect behavior where the scrollHeight
does not correctly respect the min-height
CSS style setting. In Firefox, the 200px height comes from the minheight
setting on the region that renders the portletized task flow. To work around this, you can set the height
or min-height
CSS in the consumer.
Auto-Sizing Best Practice
To get the best results when using the portlet in a flow layout where you want it auto-size the content:
-
Make the portlet content an unbroken chain of components that take their dimensions from their children.
-
Use the
dimensionsFrom="children"
attribute on components that support it, for example,af:panelStretchLayout
, to make them take their dimensions from their children. -
Use
layout="vertical"
rather thanlayout="scroll"
onpanelGroupLayout
to make the size of its children contribute to the overall auto-sized dimensions. -
When switching from the flow layout chain of components to a stretch layout, set an explicit height on the first component that stretches its children. Typically, this will be where you have used
panelStretchLayout
withdimensionsFrom="parent"
.
What You May Need to Know About Minimize, Restore, and Move
To accommodate the needs of the development environment, the behavior of the actions Minimize, Restore, and Move for Show Detail Frame and portlet components differs between design time and runtime. At design time, these actions persist in a given WLS session, but do not persist over sessions (session means the time between starting and stopping WLS). At runtime, these actions persist both during a given WLS session and across sessions.
This difference has been introduced to enable an automatic reset of an application page at design time.
If persisting across sessions is not required at runtime, then a simple modification to the application's web.xml file can turn it off. Go to the following parameter setting in the application's web.xml file.
Example 14-5 Persistence Setting in the Application's web.xml File
<context-param>
<param-name>oracle.adf.view.faces.CHANGE_PERSISTENCE</param-name>
<param-value>oracle.adfinternal.view.faces.change.HybridChangeManager</param-value>
</context-param>
Replace it with the following example.
Example 14-6 Turning Runtime Persistence Off in the Application's web.xml File
<context-param>
<param-name>oracle.adf.view.faces.CHANGE_PERSISTENCE</param-name>
<param-value>oracle.adf.view.faces.change.SessionChangeManager</param-value>
</context-param>
If security has been implemented on the application, then the Minimize, Restore, and Move actions display only to users with Customize privileges. They do not display to users with Personalize privileges. Customize users can test the effect of these actions by following these steps at design time:
-
Run the application page using JDeveloper's Integrated WLS.
-
Log in as the administrator.
-
Minimize a portlet, move portlets around, make whatever changes you want using the relevant actions commands.
-
Log out, then log in as a user and check the effects of your actions.
What Happens at Runtime
Once you place a portlet on a page, right-click the page and choose Run. This displays the page and runs the portlet in your default browser using JDeveloper's Integrated WLS. Different portlets may require additional runtime configuration. Notably, the content of an OmniPortlet or Web Clipping portlet instance is defined at runtime. . For more information about portlets generally, see Introduction to Portlets.
When running a portlet that has an Edit mode (this renders as a Personalize icon (pencil icon) in the portlet header), the Personalize icon displays only to authenticated users (that is, users who have logged in). Anonymous or public users do not see the option to personalize the portlet. Some form of security must be implemented for the portlet-consuming application before users can personalize their view of a portlet. If you are a developer creating portlets and pages, you may want to test your portlet's Edit mode without creating a complete security model for your application. For information about how to add security to enable testing of a portlet's Edit mode.
Note:
To be able to add portlets to your page at runtime, you must add at least one portlet to that page at design time. Adding a portlet at design time ensures that the following is added to the <definitionFactories> element of the DataBindings.cpx file:
<factory nameSpace="http://xmlns.oracle.com/portlet/bindings"
className="oracle.adf.model.portlet.binding.PortletBindingDefFactoryImpl"/>
<dtfactory className="oracle.adfdtinternal.view.faces.portlet.PortletDefinitionDTFactory"/>
This entry is required to enable consumption of portlets at runtime.
If a portlet supports parameters or events and the automatic parameter and event listening is enabled, any changes to the supported parameters and events (or to parameters and events that are aliased) automatically update the portlet.
When running a portlet from a producer associated with an external application, a link to update login information is displayed. Clicking the link displays a credential provisioning page for entering external application credentials. After specifying valid credentials the portlet displays content appropriately. For more information about external applications.
Setting Attribute Values for the Portlet Tag
In the source code view of a page, each portlet is represented by an adfp:portlet
tag (or adfph:portlet tag
), which includes a set of required and optional attributes. Required attributes, value
and portletType
, are provided automatically by the framework , and must not be altered. Optional attribute values are relevant when support for the attribute is built into the portlet. For example, you can set isAboutModeAvailable
to true
, but if no About mode has been defined for the portlet, then the attribute setting does not affect the portlet.
Portlets also support a set of style-related attributes.
The portlet tag uses many attributes, which you can set at design time either through the JDeveloper Property Inspector or in the source code as attributes of the tag.
Topics:
How to Set Attribute Values for the Portlet Tag Using the Property Inspector
To set attribute values for the portlet tag using the Property Inspector:
How to Set Attribute Values for the Portlet Tag in Source Code
To set attribute values for the portlet tag directly in the source code:
Common Attributes of the Portlet Tag
The following describes the common attributes of the portlet tag.
Table 14-1 Common Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
Text string. For example:
|
The unique identifier of the portlet. This attribute is populated with a unique value by default when you add the portlet to a page. The value must follow a subset of the syntax allowed in HTML:
|
|
Text string. For example: title="Announcements" |
The portlet title, which is displayed in the portlet header. The value specified here takes precedence over any title specified elsewhere (for example, in the portlet markup). If no value is specified here, the portlet extracts its title from the portlet markup (response). If no value is specified either here or in the portlet markup, the portlet extracts its title from the portlet definition. Note: Supplying a value to the title attribute at design time means that any change made to the title at runtime in Edit or Edit Defaults mode is ignored. |
|
Number expressed in pixels or as a percentage of available area:
|
The width of the area to allow for portlet display. If the actual portlet width is larger than the |
|
Number expressed in pixels, for example: height = 300px |
The height of the area to allow for portlet display. If the actual portlet height is larger than the |
|
URI to an image. For example: icon="coffee.png" |
A URI specifying the location of an image to use as an icon, displayed to the left of the portlet title in the portlet header. You can use the icon to indicate the portlet's purpose, to reinforce branding, as a content indicator, or for some other reason. In the Property Inspector, click the Property Menu icon next to the field and then choose Edit to locate and select the required image. The value must be an absolute URI or a URI that is resolvable relative to the current page or the application context root. The URI provided in the preceding example is stored at the application context root, therefore a full path is not required. |
|
One or more component IDs. For example: partialTriggers="_id1 _id2 componentID5" Separate component IDs with spaces. |
The IDs of the components that trigger a partial update. The portlet listens on the specified trigger components. If a trigger component receives a trigger event that causes it to update in some way, this portlet also requests to be updated. |
Appearance Attributes of the Portlet Tag
The following table describes the appearance attributes of the portlet tag.
Table 14-2 Appearance Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
Default: |
The default state of the portlet:
|
|
Default: |
Whether a change in portlet mode renders the new mode on a new page, rather than the page on which the portlet resides.
|
|
Default: |
Whether the portlet is rendered in an IFRAME:
For more information, see What You May Need to Know About Inline Frames. |
|
Default: |
Whether a scroll bar is displayed:
|
|
Default: |
Whether the portlet header is displayed:
|
|
Default: |
Whether to display a shadow decoration around the portlet:
|
|
Default: |
Whether the portlet is rendered.
|
|
Default: |
The style selector to apply to the skin used by the portlet:
This provides a way for you to apply a different look and feel to each portlet on an page. |
|
Text string. For example:
|
A short description of the portlet. |
|
Default: |
Whether seeded interactions for the portlet are shown:
|
|
Default: |
Whether to display the Move command in the portlet's Action menu:
There is a difference in the way that the Move command behaves at design time and at runtime. For more information, see What You May Need to Know About Minimize, Restore, and Move |
|
Default: |
Whether to display the Remove icon on the portlet chrome:
There is a difference in the way that the Remove icon behaves at design time and at runtime. For more information, see What You May Need to Know About Minimize, Restore, and Move. Note: This attribute is available only for the |
|
Default: |
Whether to display the resize handle at the bottom right corner of the portlet.
Note: This attribute is available only for the |
|
Default: |
Whether to display the Minimize icon on the portlet chrome:
There is a difference in the way that the Minimize icon behaves at design time and at runtime. For more information, see What You May Need to Know About Minimize, Restore, and Move. |
Behavior Attributes of the Portlet Tag
The following table describes the behavior attributes of the portlet tag.
Table 14-3 Behavior Attributes of Portlet Tag
Attribute | Value | Description |
---|---|---|
|
One or more component IDs. For example:
Separate component IDs with spaces. |
The IDs of the components that trigger a partial update. The portlet listens on the specified trigger components. If a trigger component receives a trigger event that causes it to update in some way, this portlet also requests to be updated. |
|
Default: |
Whether parameters in portlet links that point to the page on which the portlet is placed are made available to the page:
|
Portlet Modes Attributes of the Portlet Tag
Portlet Modes attributes control the rendering of mode-switching UI actions, such as entering edit mode. The ability to render a portlet in a particular mode depends on the modes supported by the portlet and the user authorization. For example, if the isCustomizeModeAvailable
attribute is set to true, but the action is not supported in the portlet, then the attribute setting does not affect the portlet.
Portlet Modes attributes, described in the following table, are value binding expressions that evaluate to true
or false
:
-
true
means the portlet is allowed to render in the named mode. -
false
means the portlet is not allowed to render in the named mode.
Table 14-4 Portlet Modes Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
Default: |
Whether to render an Users choose About to invoke the portlet's About mode. |
|
Default: |
Whether to render a Users choose Configure to open the portlet's Configuration settings. |
|
Default: |
Whether to render a Customize icon in the portlet header. Site administrators choose Customize to edit a portlet's default personalization data. |
|
Default: |
Whether to render a Users choose Details to open the portlet in Full Screen mode. |
|
Default: |
Whether to render a Help command on the portlet's Actions menu. Users choose Help to open the portlet's Help page. |
|
Default: |
Whether to render a Users choose Print to displays a printer-friendly version of the portlet. |
|
Default: |
Whether to render a Users choose Refresh to redraw the portlet independent of any other content on the page (also known as a partial-page refresh). |
|
Default: |
Whether to render a Personalize icon in the portlet header. Users choose Personalize to alter their personal view of the portlet. This mode is equivalent to the Edit mode selection in the Standards-based Java Portlet (JSR286) Wizard. The Personalize icon displays only to authenticated users (that is, users who are logged in). It does not display to public or unauthenticated users. You must implement some form of application security for users to be able to personalize their portlet views. If you are a developer creating portlets, and you want to test the Personalize mode without creating a complete security model for your application. Note: A typical personalization setting is Portlet Title. You can set Portlet Title at design time, by providing a value for the |
|
Default: |
Whether to enable previewing of portlet content. This mode has no particular application in Framework applications, but it is used in Oracle Portal's Portlet Repository, where it renders as a magnifying glass icon, which users click to preview a portlet. |
Style Attributes of the Portlet Tag
The following table describes the style attributes of the portlet tag.
Table 14-5 Style Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
One or more CSS styles. These should be in compliance with, at least, CSS 2.0 and take the following format:
|
The CSS style to apply to the portlet content. Values entered here take precedence over styles specified in the inlineStyle attribute and those included in a CSS or skin on the specific portlet instance. |
|
One or more CSS styles. These should be in compliance with, at least, CSS 2.0 and take the following format:
|
The CSS style to apply to the whole portlet. Values entered here take precedence over styles included in a CSS or skin on the specific portlet instance. |
Binding Attributes of the Portlet Tag
The following table describes the binding attributes of the portlet tag.
Table 14-6 Binding Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
Name of a managed bean. For example:
In the Property Inspector, click the Property Menu icon next to the field and then choose Edit to select a managed bean and specify the relevant managed bean property. |
A binding reference to store the component instance. The binding reference binds an instance of the portlet to a managed bean property. Managed beans are any JavaBeans used by the application that are registered in the |
Customization Attributes of the Portlet Tag
The following table describes the customization attributes of the portlet tag.
Table 14-7 Customization Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
Default: |
Whether design time customizations of the portlet tag are allowed on this portlet. |
|
Text string |
Text string |
Other Attributes of the Portlet Tag
The following table describes the other attributes of the portlet tag.
Table 14-8 Other Attributes of the Portlet Tag
Attribute | Value | Description |
---|---|---|
|
Default: |
Which DTD, if any, is specified in the
|
Manually Wiring Parameters and Events in JSR 286 Portlets
If the portlet that you add to your page defines parameters or events that it uses to dynamically alter its content, for the most part this happens automatically. See What You May Need to Know About Interportlet Communication.
However, in some circumstances you may find it necessary to turn off the default automatic parameter and event listening, or you may be using portlets with parameters or events with names that do not match or define appropriate aliases. In such situations, you must manually wire the parameters and events in your portlets.
Topics:
How to Manually Link Portlets with Public Render Parameters
When you place a portlet on a page, any public render parameters with the same QName are automatically linked. For example, if one portlet publishes a value to a parameter with the name myParam
, then if a second portlet on the page accepts values from a parameter with the same name, the second portlet is automatically updated with the appropriate value.
Portlets can also link together using parameters with different QNames if the portlet developer has set up aliases for the parameter.
The following example shows how to use public render parameters to link the behavior of two portlets using parameters with different names and no defined aliases. In the example, we take a generic Parameter Form portlet that allows us to update public render parameters, and show how that can be linked to a Stock Price portlet that renders stock prices, taking the stock symbol from a public render parameter.
When these two portlets are dropped onto the same page, they are not automatically linked together. This is because none of the generic parameter names in the Parameter Form portlet match the stocksymbol
parameter in the Stock Price portlet, and the Stock Price portlet does not define any aliases for the stocksymbol
parameter that match the generic parameter names in the Parameter Form portlet.
There are two methods for manually linking parameters:
Manually Linking Parameters Using Page Variables
When the portlets are dropped onto a page, page variables are created for each of the parameters supported by the portlets. In our example, there are three page variables for the Parameter Form portlet and one for the Stock Price portlet.
Example 14-7 Page Variables Created for Portlet Parameters
<pageDefinition ...>
<parameters/>
<executables>
<variableIterator id="variables">
<variable Name="ParameterFormPortlet1_1_Parameter1"
Type="java.lang.Object"/>
<variable Name="ParameterFormPortlet1_1_Parameter2"
Type="java.lang.Object"/>
<variable Name="ParameterFormPortlet1_1_Parameter3"
Type="java.lang.Object"/>
<variable Name="StockPricePortlet1_1_stocksymbol"
Type="java.lang.Object"/>
</variableIterator>
<portlet id="ParameterFormPortlet1_1"
...>
<parameters>
<parameter name="Parameter1"
pageVariable="ParameterFormPortlet1_1_Parameter1"/>
<parameter name="Parameter2"
pageVariable="ParameterFormPortlet1_1_Parameter2"/>
<parameter name="Parameter3"
pageVariable="ParameterFormPortlet1_1_Parameter3"/>
</parameters>
<events>
<event eventType="ParametersChange"
name="ParameterFormPortlet1_1_Event"/>
</events>
</portlet>
<portlet id="StockPricePortlet1_1"
...>
<parameters>
<parameter name="stocksymbol"
pageVariable="StockPricePortlet1_1_stocksymbol"/>
</parameters>
<events>
<event eventType="ParametersChange"
name="StockPricePortlet1_1_Event"/>
</events>
</portlet>
</executables>
<bindings/>
</pageDefinition>
To link the portlets, you can make the Stock Price portlet use the value from one of the page variables created for the Parameter Form portlet..
Example 14-8 Linking Portlet Parameters Using Page Variables
<portlet id="StockPricePortlet1_1"
...>
<parameters>
<parameter name="stocksymbol"
pageVariable="ParameterFormPortlet1_1_Parameter1"/>
</parameters>
<events>
<event eventType="ParametersChange"
name="StockPricePortlet1_1_Event"/>
</events>
</portlet>
Now, entering a value in the first parameter field of the Parameter Form portlet sets the corresponding page variable to the same value, which in turn causes the Stock Price portlet to be updated with the new value.
Manually Linking Parameters Using the ParametersChange ADF Contextual Event
When you drop a portlet that supports parameters, as well as the page variables (see Manually Linking Parameters Using Page Variables), an ADF ParametersChange
contextual event is created for the portlet. This event is triggered when the values of the portlet's parameters change. The payload of the event is the new value of the parameter. You can use this event to set the value of another portlet's parameter by creating an event map in the page definition that maps the payload of the first portlet's event to the second portlet's parameter. The following example shows how this event map would look.
Example 14-9 Linking Portlet Parameters Using the ParametersChange ADF Contextual Event
<eventMap xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
<event name="ParameterFormPortlet1_1_Event">
<producer region="ParameterFormPortlet1_1">
<consumer handler="StockPricePortlet1_1">
<parameters>
<parameter name="stocksymbol">
value="${payLoad.Parameter1}"/>
</parameters>
</consumer>
</producer>
</event>
</eventMap>
Entering a value in the first parameter field of the Parameter Form portlet triggers the ParametersChange
event. The payload of this event, the new parameter value, is then sent to the Stock Price Portlet and used to specify the value of the stocksymbol
parameter.
How to Manually Link Portlets with Portlet Events
The following example shows how to manually link portlets using portlet events in the case where the names of the events defined for the different portlets do not match.
Tip:
You can download a ZIP file containing the example in this section from: http://www.oracle.com/technetwork/middleware/webcenter/ps3-samples-176806.htmlIn the example, we have a portlet, the Department Locations portlet, which lists the geographical locations of a company's various offices. The Department Locations portlet raises a portlet event (latLong) when a particular department is selected in the portlet.
There is another portlet, the Map portlet, which displays a Google map. The Map portlet listens out for a portlet event (geolocation) to use to determine a location to display on a map.
When the two portlets are dropped on a page, there is no way for the Map portlet to know that the event raised by the Department Locations portlet provides information that it can use to display a map. To make this link between the two portlets, you must edit the page definition to explicitly create the mapping between the two events, as shown in the following example:
Example 14-10 Explicit Event Mapping in the Page Definition
<pageDefinition ...>
<parameters/>
<executables>
<variableIterator id="variables"/>
<portlet id="DepartmentLocations1_1"
...
<events>
<event name="latLong">
<portletevent namespace-uri="http://xmlns.oracle.com/portlet/EventSample"
localpart="latLong"/>
</event>
</events>
</portlet>
<portlet id="Map1_1"
...
<events>
<event name="geolocation">
<portletevent namespace-uri="http://xmlns.oracle.com/portlet/EventSample"
localpart="geolocation"/>
</event>
</events>
</portlet>
</executables>
<bindings/>
<eventMap xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
<event name="{http://xmlns.oracle.com/portlet/EventSample}latLong">
<producer region="DepartmentLocations1_1">
<consumer handler="Map1_1.{http://xmlns.oracle.com/portlet/EventSample}geolocation"/>
</producer>
</event>
</eventMap>
</pageDefinition>
Copying Portlets
When you copy portlets, the portlets and their copies must reside within the same application. For example, you can copy a portlet from one page in an application to another page in the same project in that application, or from one place on a page to another place on the same page. You can also copy a portlet from one project to another project in the same application, if the target project is configured for consuming portlets. The copies are references to the same portlet instance, so customizations or personalizations made to any instance of the portlet (original or copy) affect all the other instances.
Copying a portlet is more than a matter of copying and pasting the portlet view tag. It involves copying portlet-related entries from the application page's source. It may also involve copying portlet-related entries from the page definition file and removing duplicate portlet binding information or creating a new method in the copied portlet's binding bean.
When a portlet is copied, the target page must be an Oracle ADF Faces page. Any preexisting code on the target page must reflect that. This is quite easy to accomplish. When JDeveloper creates a new JSF page, it contains pure JSF tags. The first time you drop an Oracle ADF Faces component onto the page, tags are automatically updated to be Oracle ADF Faces tags. For example, an <html>
tag becomes <afh:html>
, <head>
and <title="title">
tags become <afh:head title="title">
, and so on. Therefore, a simple way to ensure the conversion of the target page to an Oracle ADF Faces page is to place any Oracle ADF Faces component on the target page. This performs any required code conversion for you automatically.
Topics:
How to Copy a Portlet and Place it on the Same Page
To copy and place a portlet on the same page:
How to Copy a Portlet from One Application Page to Another
To copy a portlet from one page to another:
Deleting Portlets from Application Pages
When you delete a portlet from an application page, if the portlet had parameters, then you should also delete page variables associated with those parameters from the application page's Page Definition file.
To delete a portlet and its related page variables from a page:
Troubleshooting Portlets
Diagnostic Tools for Troubleshooting Portlets
There is a set of tools available for both the consumer and producer to help identify and resolve issues with portlets.
If you encounter a portlet error message when a portlet is rendered, or if the portlet displays but you cannot interact correctly with it, there are some general steps using these tools that you should follow to diagnose the issue.
This section includes the following topics:
Identify the Portlet Instance
The first step when you encounter a portlet error, is to identify which portlet producer and portlet instance is being invoked. Execute the portletDebugShow()
JavaScript from your browser to display this information in the main portlet content area.
To identify the portlet instance:
-
Enter the following command in the Location field of your browser:
javascript:portletDebugShow()
Tip:
In Internet Explorer and Google Chrome, you must type this command in the Location field. If you paste the command into the field, the
javascript
piece is removed.In Firefox 6 and above, you cannot enter JavaScript in the Location field, you must enter the command in JavaScript console.
-
After running the script, every portlet now displays the following information:
-
Producer name
-
Portlet name
-
Portlet instance ID
-
Execution Context IDs (ECIDs)
The ECIDs are unique IDs used to identify a portlet request. Use the ECIDs to correlate the messages across different consumer and producer log files using Fusion Middleware Control. The same ECID is propagated from the consumer to the producer.
Note:
Broken portlets show two ECIDs: one for the request in which the error occurred and one for request in which the error was reported. For inline portlets (that is, portlets that are not displayed in an IFRAME), these two ECIDs are the same.
For IFRAME portlets, for example Oracle JSF Portlet Bridge portlets, the ECIDs are different. This is because the error is reported in a later request than the one in which the original exception occurred. When checking the logs, you should look for both ECIDs, as either may contain relevant information.
You can use this information in the subsequent diagnostic steps to help locate the issue.
Note:
The ECIDs shown in the portlet diagnostic information do not reflect partial page rendering requests that have been made to the portlet producer (using the portlet consumer resource proxy). These requests may update the portlet, but the ECIDs are not recorded in the portlet diagnostic information. Errors that occur during these requests are logged on the producer and by the portlet resource proxy on the consumer but you cannot use the ECID information reported in the portlet diagnostic information to help you determine the ECIDs for the relevant log entries.
-
-
When you have finished debugging the portlets, enter the following command to hide the portlet debugging information:
javascript:portletDebugHide()
Tip:
In Internet Explorer and Google Chrome, you must type this command in the Location field. If you paste the command into the field, the
javascript
piece is removed.In Firefox 6 and above, you cannot enter JavaScript in the Location field, you must enter the command in JavaScript console.
Examine the Portlet Consumer Test Page
The next step in diagnosing a portlet error is to access the Portlet Consumer Test Page (shown in Figure E–2) to locate the portlet producer and, if necessary, test the portlet in isolation.
Figure 14-10 The Portlet Consumer Test Page
![Description of Figure 14-10 follows Description of Figure 14-10 follows](img/portlet_consumer_test_page.png)
Description of "Figure 14-10 The Portlet Consumer Test Page"
The Portlet Consumer Test Page contains three tabs:
-
Producers: This tab lists all the producers registered with the consumer application. Selecting a producer provides specific information about that producer.
-
Sanity Checks: This tab may contain a predefined set of portlet instances and required parameters that can be run in the consumer application, as configured by the consumer application developer. Any failures within these portlets indicate a problem with the corresponding producer and/or portlet.
-
Configuration: This tab enables you to identify the consumer configuration entries for portlet consumption. You cannot change these values as they are stored within the application; they are displayed for reference information only.
After accessing the Portlet Consumer Test Page, you can perform further diagnostic steps.
This section describes how to use the Portlet Consumer Test Page to diagnose portlet issues. It includes the following topics:
-
Access the Portlet Consumer Test Page
-
Locate the Portlet Producer
-
Locate and Run the Portlet Instance
-
Perform Sanity Checks
-
Check Consumer Configuration Entries
Examine the Producer Test Page
If you cannot identify the cause of the error in the consumer application, the next step is to use the Producer Test Page (shown in Figure E–5) to identify potential issues with the portlet producer application.
Access to the main Producer Test Page is public, but links to the test pages for each portlet are accessible only to users granted permission on the underlying pages and task flows.
The Producer Test Page contains five sections:
-
Portlets
A list of all the portlets within the producer. For Oracle JSF Portlet Bridge portlets, each portlet also provides a separate link to run the portlet as a servlet (this is a prerequisite to running them as portlets: if a portlet does not run as a servlet, it cannot run as a portlet).
-
Container Configuration
Information on where the consumer preference information is stored.
-
Container Version
The version number of the Portlet Producer Container.
-
WSDL URLs
Links to the Web Service Definition Language (WSDL) documents to use for registration.
-
SOAP Monitor
A link to the WSRP SOAP monitor where users with the
Monitor
orAdmin
role can track the SOAP messages between the consumer and producer.
After accessing the Producer Test Page, you can perform further diagnostic steps.
This section includes the following topics:
Access the Producer Test Page
The Producer Test Page provides diagnostic information about the portlet producer.
To access the Producer Test Page:
-
In your browser, enter the URL for the Producer Test Page:
http://host:port/context-root/info
-
In the Producer Test Page, you can perform further diagnostic steps as described in the following sections.
Run the JSF Portlet as a Servlet
To verify that an Oracle JSF Portlet Bridge portlet producer is running correctly, you must first verify that the producer application runs correctly through standard HTTP requests. If the artifacts the producer exposes as portlets do not run as servlets, they will not run as portlets.
To run a JSF portlet as a servlet:
-
In the Producer Test Page, click the run as servlet link next to the portlet.
-
The portlet is called using standard HTTP to request the underlying page or task flow. The results of the request are displayed in a new browser window.
If the resulting page or task flow does not render correctly, then there is a problem with the producer application that must be resolved before you can run the page or task flow as a portlet.
-
If the portlet accepts parameters, click show parameters to list them and provide values. When you click run as servlet, the portlet call includes the parameter values.
Examine the SOAP Monitor
The SOAP monitor provides access to the SOAP requests between the consumer and producer when rendering a portlet. This is very useful in diagnosing problems at the communication level.
To examine the SOAP monitor:
-
In the Producer Test Page, click the SOAP Monitor link at the bottom of the page.
-
When prompted, enter your user name and password.
Note:
To access the SOAP monitor you must be a member of the
Monitors
orAdministrators
role in the Identity Management System. -
By default, the SOAP monitor is disabled, so the page is empty. You must first enable the monitor by clicking the Enable link at the top of the page.
-
The page does not automatically refresh, so to display SOAP messages, you must click the Refresh link.
-
To force a request to the failing portlet, go to the Portlet Consumer Test Page: Portlet page for the portlet and select Refresh Portlet.
-
When the portlet has rendered, or failed, click the Refresh link in the SOAP monitor to display the captured request.
-
Now, you can investigate the SOAP messages that were sent and the responses to try to narrow down the cause of the problem.
Note:
If, after rerunning the portlet and refreshing the SOAP monitor, you see no messages displayed, this indicates that there may be a security issue between the producer and the consumer. You must verify that the correct WS-Security settings are set up for the producer and consumer to communicate.
Configuring the Portlet Logging File
To troubleshoot portlet issues, it is useful to add portlet log-handlers and loggers to the logging configuration file, logging.xml
.
The example below shows how to add the portlet log-handlers and loggers. The example assumes that you are running the consumer and producer applications on the same WebLogic Server instance. If you are running the consumer and producer applications on different instances, you must split them up appropriately.
Note:
Add the log entries at the end of the file to ensure that they override any seeded settings.
Example: Configuring Log Files for Troubleshooting Portlet Issues
<!-- NOTE: You need to change the path where the logfile is located --> <log_handlers> ... <!-- Portlet Consumer --> <log_handler name="portlet-consumer-handler" class="oracle.core.ojdl.logging.ODLHandlerFactory"> <property name="format" value="ODL-Text"/> <property name="path" value="/scratch/logs/portlet-consumer.log"/> </log_handler> <!-- Portlet Producer --> <log_handler name="portlet-producer-handler" class="oracle.core.ojdl.logging.ODLHandlerFactory"> <property name="format" value="ODL-Text"/> <property name="path" value="/scratch/logs/portlet-producer.log"/> </log_handler> <!-- Portlet Bridge --> <log_handler name="portlet-bridge-handler" class="oracle.core.ojdl.logging.ODLHandlerFactory"> <property name="format" value="ODL-Text"/> <property name="path" value="/scratch/logs/portlet-bridge.log"/> </log_handler> ... </log_handlers> <loggers> ... <!-- Portlet Consumer --> <logger name="oracle.portlet.client" level="FINEST" useParentHandlers="false"> <handler name="portlet-consumer-handler"/> </logger> <!-- Portlet Servers --> <logger name="com.bea.portlets" level="FINEST" useParentHandlers="false"> <handler name="portlet-producer-handler"/> </logger> <logger name="com.bea.netuix" level="FINEST" useParentHandlers="false"> <handler name="portlet-producer-handler"/> </logger> <logger name="com.bea.wsrp" level="FINEST" useParentHandlers="false"> <handler name="portlet-producer-handler"/> </logger> <logger name="oracle.portlet.producer" level="FINEST" useParentHandlers="false"> <handler name="portlet-producer-handler"/> </logger> <!-- Portlet Bridge --> <logger name="oracle.portlet.bridge" level="FINEST" useParentHandlers="false"> <handler name="portlet-bridge-handler"/> </logger> <logger name="oracle.portlet.server.bridge" level="FINEST" useParentHandlers="false"> <handler name="portlet-bridge-handler"/> </logger> ... </loggers>
The logging configuration file is located in:
DOMAIN_HOME/config/fmwconfig/servers/server/logging.xml
The log file name is also defined in logging.xml
. By default the log file name is:
DOMAIN_HOME/servers/server/logs/server-diagnostic.log
Portlet Displays a Portlet Consumer Error
The message Portlet Consumer Error (shown in Figure E–6) typically indicates that an error occurred within the operation of the portlet parts of the portlet consumer application.
Figure 14-12 Portlet Displaying a Portlet Consumer Error
![Description of Figure 14-12 follows Description of Figure 14-12 follows](img/portlet_unavailable.png)
Description of "Figure 14-12 Portlet Displaying a Portlet Consumer Error"
Problem
An error has occurred within the operation of the portlet parts of the portlet consumer application. In other words, the error is unrelated to the remote portlet producer application.
Solution 1
Consult the diagnostic log file to determine the cause of the exception.
If the DebugErrorRenderer
is enabled, the cause exception is displayed in the portlet along with links to the log file. If running in production mode, then consult the consumer-side logs.
The exception that caused the error message to be displayed is logged. Wherever possible, a message is included in the log at the start of the exception stack to indicate for which portlet binding the exception occurred. The following example shows a message logged for a portlet error:
Example Message Logged for a Portlet Error
<PortletRenderer> <setErrorState> An error has occured for Portlet Binding portlet1. oracle.portlet.client.container.PortletContentTypeException: Unexpected content type "null" in WSRPGetMarkup response. ...
Pay particular attention to the cause exceptions in the stack as this is likely to indicate what the real underlying problem is.
The cause is likely to be an internal error and the appropriate course of action is to contact Oracle Support.
Problem 2
The portlet queue is full and the pool is not able to process the new request. This can happen if the portal is under a particularly high load. When the portlet queue is full, no new portlet requests are processed.
If this is the cause of the problem, the diagnostic log contains an error message similar to the one shown in the following example:
Example Message Logged for Portlet Queue Full
Message oracle.portlet.client.container.PortletQueueFullException: Queue Full [cause=na submittedTasks=8,361 queuedTasks=20 queueFreeSpace=0 completedTasks=8,331 activeThreads=10 corePoolSize=10 keepAliveTime=9,223,372,036 largestPoolSize=10 maxPoolSize=10 poolSize=10 isShutdown=false isTerminated=false isTerminating=false]
Solution 2
The portlet queue size is determined by the parallelPoolSize
and parallelQueueSize
parameters in adf-config.xml
.
-
parallelPoolSize
indicates the number of threads to use for parallel execution of tasks. The default value is10
. -
parallelQueueSize
determines the size of the queue of tasks waiting for parallel execution. Tasks are rejected when the queue size is reached. The default value is20
.
The default values should be adequate for most portals. However, if you experience recurring errors due to the portlet queue becoming full, you might want to consider increasing the value of the parallelQueueSize
parameter. To boost performance, you might also consider increasing the parallelPoolSize
to increase the number of threads opened to handle the portlet requests from the queue.
Note:
Increasing the queue and pool size should be done carefully and in small increments. If the value of either parameter is set too high the increased usage of hardware resources could be counterproductive.
Portlet Displays a Portlet Timeout
If a Portlet Timeout is displayed in the area of the page that you would expect to contain a portlet (as shown in Figure E–7), this means that the consumer waited for a configured period of time for the producer to respond and did not get a response during that time, or the response did not complete during that time. There are a number of possible causes.
Figure 14-13 Portlet Displaying a Portlet Timeout Error
![Description of Figure 14-13 follows Description of Figure 14-13 follows](img/portlet_timeout_error.png)
Description of "Figure 14-13 Portlet Displaying a Portlet Timeout Error"
Problem 1
The producer machine is overloaded.
Solution 1
Check the load on the producer managed server (the tools used to do this vary depending on the operating system that is running on the producer). If the load is high, check whether a particular process is causing this high load, and whether such a process could be run on another machine, or at a less busy time. If no single process is causing the high load, or if the Oracle WebLogic Serveris causing the high load, and if the load is consistently high, consider whether the producer hardware is adequate, or whether it is necessary to upgrade it (or add further nodes to the cluster). Also consider adjusting the Oracle WebLogic Serverconfiguration to increase the size of the request thread pool. For more information, see Oracle WebLogic Server documentation.
Problem 2
The network is overloaded, or there are problems with the network affecting communication between the consumer and producer.
Solution 2
Check that you can ping the producer machine from the consumer machine. Check that you can access the producer's WSRP Producer Test Page in your local browser. If this works, check that you can access this same page from a browser running on the consumer machine. If any of these steps cause problems, and the machine is not overloaded, this could be a network problem, which should be investigated by a system administrator.
Problem 3
There is a deadlock (or a stuck thread) on the producer machine causing the request thread to hang.
Solution 3
This should not happen during normal operation. If it does occur, there will generally be an error in the producer's log files indicating the point at which the deadlock occurred. This may help diagnose the problem. In some cases, it may be possible to alleviate this by modifying the configuration of Oracle WebLogic Server. For more information, see the Oracle WebLogic Serverdocumentation.
Problem 4
The producer application is running slowly (for example, due to processing large quantities of data).
Solution 4
In this case, the producer application may be processing large quantities of data, causing it to spend too long building the response. If the application will regularly deal with large quantities of information, it may be necessary to either add or improve producer hardware, or to increase the portlet timeout duration. The portlet timeout can be configured on the producer connection in the consumer application using Enterprise Manager or the WLST setWSRPProducerConnection
command. Additionally, minimum and maximum timeouts for all producer connections within the application can be configured within the portlet section of the adf-config.xml
file.
Problem 5
The producer application is waiting for a response from another resource, such as a database, that is taking too long (for example, if the database is overloaded).
Solution 5
Check that the resource in question is functioning correctly. If it is, the solution is same as Solution 4.
Problem 6
The portlet timeout values have been misconfigured such that the timeout period is too short.
Solution 6
Typically, the timeout for a portlet is set on the registration of the producer. This may have been set to a value that does not give time for the portlet to respond.
Also, the portlet section of the adf-config.xml
file allows minimum, maximum, and default values for portlet timeouts to be configured across the whole application. The maximum timeout imposes an upper limit on timeouts specified by portlet producers, so if the maximum timeout is too short, this could cause unwanted portlet timeout errors even if the timeout specified on the producer connection is longer.
Portlet Displays a Remote Portlet Communication Error
When a section of the screen shows the Remote Portlet Communication Error message (as shown in Figure E–8), and there is an otherwise blank region surrounding it, this area is expected to be filled with a portlet, which the application is not able to contact.
Figure 14-14 Portlet Displaying a Remote Portlet Communication Error
![Description of Figure 14-14 follows Description of Figure 14-14 follows](img/portlet_communication_error.png)
Description of "Figure 14-14 Portlet Displaying a Remote Portlet Communication Error"
Problem 1
The producer is down.
Solution 1
It could be that the producer application is not running, or the managed server on which it is deployed is not started. In this case, it will need to be started. Identify the application that needs to be started based on the task being attempted at the time of the portlet failure.
Problem 2
The web services security is incorrectly configured.
Solution 2
Troubleshooting steps for web services security depend on the type of security profile being used, for example AuthN, SSL, or Message Security.
For more information about troubleshooting web service security, see the https://www.oracle.com/pls/topic/lookup?ctx=en/middleware/webcenter/portal/12.2.1.3/develop&id=WSSEC1693 chapter in the Administering Web Services.
Problem 3
The producer managed server cannot be reached.
Solution 3
The producer may be in a location that cannot be reached by the consumer application, due to intervening firewalls or incorrect routing rules. In an environment that is installed by Oracle's provisioning software, this should not be the case, but it is worth checking that you are able to access the WSDL endpoint for the producer from the machine hosting the consumer, by going to:
http://host:port/context-root/portlets/wsrp2?WSDL
Where:
-
host
is the server to which the portlet producer is deployed -
port
is the port to which the server is listening for HTTP requests -
context-root
is the producer web application's context root
For example:
http://portlets.example.com:9999/sample/portlets/wsrp2?WSDL
Portlet Displays a Remote Portlet Error
If the portlet displays a Remote Portlet Error, this indicates that the producer responded with an error message. The error message is returned in the form of a SOAP fault message inside the response document. There are a number of reasons the producer might return an error. The best strategy to diagnose these errors is to first find the corresponding exception stack trace in the consumer diagnostic logs. This stack trace shows what kind of fault was returned by the producer, plus any further information required in the response. Some faults you may encounter are listed in the following sections.
Problem 1
OperationFailedException
. This is the most common type of Remote Portlet Error and it is a catch-all for most unhandled exceptions raised in the producer application.
Solution 1
To resolve an OperationFailedException
, examine the exception in the consumer diagnostic logs. This generally shows any exception that was raised in the producer application to trigger the fault response as the final Caused by
exception.
Problem 2
InvalidRegistrationException
. This error indicates that the producer has not been properly registered with the consumer before the consumer attempted to communicate with it. This could also occur if the producer's preference store has been moved or deleted since the consumer registered it.
Solution 2
The most likely cause is a problem during provisioning. It is also worth checking the producer application's web.xml file setting to ensure that the entry shown in the example is present.
Example 14-11 Persistent Store Setting in web.xml
<env-entry>
<env-entry-name>oracle/portal/wsrp/server/persistentStore</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>Consumer</env-entry-value>
</env-entry>
Problem 3
InvalidHandleException
. This indicates that the consumer has asked the producer to render, or otherwise interact with, a portlet instance that the producer does not know about. This could occur if the producer's preference store has been corrupted in some way since the portlet was added to the page.
Solution 3
This error is most likely caused by a problem during provisioning, or a missing persistentStore
setting in the web.xml
file, as described in Solution 2.
Problem 4
AccessDeniedException
. This indicates that the producer application decided that the current user did not have access to the portlet or task flow in question.
Solution 4
This could either be a legitimate error message or an indication of a configuration problem. In most cases, WebCenter Portal should deal with authorization errors gracefully, without a Portlet Remote Error being displayed.