Adding Validation-Based Caching After you have used the Portlet Wizard to build a portlet as described in

Enhancing Java Portlets 7-71 acceptContentTypetextvnd.oracle.mobilexmlacceptContentType For more information on the syntax of provider.xml, refer to the provider Javadoc on OTN: http:www.oracle.comtechnologyproductsiasportalhtmljavadocx ml_tag_reference_v2.html 3. Declare the mapping of JSP renderers to Show modes in provider.xml. You need to define a render handler for the pertinent Show modes by content type. One showPage declaration identifies a JSP that renders the HTML response and another one identifies the JSP that renders the OracleAS Wireless XML response. Note that the class attribute is now required, whereas, in a simpler case, it could allow the class to default. You express the association of a particular JSP to a particular content type through the resourcePath and contentType tags inside the showPage declaration as follows: ■ resourcePath defines the JSP used to render this mode. ■ contentType defines the response type of this JSP. When the ResourceRenderer receives a show request for the lottery portlet it invokes lotto.jsp to render the HTML response and mlotto.jsp for OracleAS Wireless XML. The following code illustrates how you express this relationship in provider.xml: renderer class=oracle.portal.provider.v2.render.RenderManager contentTypetexthtmlcontentType renderContainertruerenderContainer showPage class=oracle.portal.provider.v2.render.http.ResourceRenderer resourcePathhtdocslotterylotto.jspresourcePath contentTypetexthtmlcontentType showPage showPage class=oracle.portal.provider.v2.render.http.ResourceRenderer resourcePathhtdocslotterymlotto.jspresourcePath contentTypetextvnd.oracle.mobilexmlcontentType showPage ... renderer 7-72 Oracle Fusion Middleware Developers Guide for Oracle Portal 4. Declare a short title. A short title is the short form of a portlets name and is for use where display space is limited. Specifically, Oracle Portal uses it when rendering portlets as menu items in the page menu generated in response to a mobile request. If the portlet has registered a short title, Oracle Portal uses that as the menu item label. Otherwise, it uses the portlets standard title. To declare a short title, you include the shortTitle tag in the portlets metadata section in provider.xml: portlet class=oracle.portal.provider.v2.DefaultPortletDefinition id2id nameLotteryname titleLottery Portlettitle shortTitleLotteryshortTitle ... portlet 5. Support short title personalization. Because the portlets short title is presented to the user as the menu item label that references the portlet instance on the page, we recommend that all portlets allow users to personalize the short title. PDK-Java provides a base data class that manages both the short and standard title: oracle.portal.provider.v2.personalize.NameValuePersonalizationObject The NameValuePersonalizationObject manages both the title and short title. It contains methods for getting and setting the values. The personalization Note: The ResourceRenderer and any portlet determines the type of request it has received by the requests Accept header. The Accept header is a standard HTTP header that defines the acceptable response types for a given request. It may be a list with multiple values if multiple content types are acceptable. When there are multiple values, they are listed in order from most to least preferred. Oracle Portal controls the values passed to the portlet in the Accept header. In the case of an HTML request, the Accept header is: texthtml, textxml, textvnd.oracle.mobilexml These values indicate that Oracle Portal prefers an HTML response but also accepts XML and OracleAS Wireless XML. For mobile requests, the Accept header is: textvnd.oracle.mobilexml, textxml These values indicate that Oracle Portal prefers OracleAS Wireless XML but also accepts general XML that contains a stylesheet reference that transforms to OracleAS Wireless XML. The ResourceRenderer maps requested content type to the specific resource renderer by working through the Accept list in preference order. Once it finds a match between an acceptable response type and a registered renderer, it dispatches the request to the resource. For example, for HTML requests the ResourceRenderer will match the first entry, texthtml, to the declaration that defines lotto.jsp as the texthtml handler. Likewise, when a mobile request is received, the ResourceRenderer matches the first entry, textvnd.oracle.mobilexml, to the declaration that defines mlotto.jsp as the textvnd.oracle.mobilexml handler.