Enterprise Portal allows you to customize XSL and XSLT templates on a per-user basis.
When you create XML portlets, you specify an Extensible Style Language Transformation (XSLT) template for content transformation and a user interface (UI) template for presentation.
The XSLT template contains the language used in XSL style sheets to transform XML documents into other XML documents. The UI template specifies how to present the portlet; that is, shading, borders, and so on.
In earlier versions of Enterprise Portal, the XSL and UI templates were selected and defined in the Web Studio during portlet design and were fixed for all users of the portlet. With Enterprise Portal 6.0 and later, you can customize these templates on a per-user basis for XML portlets.
Creating an XML sample portlet
Log in to Web Studio.
Select Build | Portlets from the Web Studio left pane and select New from the Portlet Manager Status menu.
Right-click in the detail pane and select New Aggregated Portlet.
When the Portlet Builder displays, click the down arrow beside the Add button and select XML Element from the menu.
You see the XML Element Definition window.
Enter the following sample input:
XML URL –
http://p.moreover.com/ cgi-local/page?c=Biotech%20news&o=xml
Content XSLT – moreover_content_xsl
UI XSLT – pink_ui_xslt
Click Preview.
The content has a pink background, as specified in the UI XSLT. Any user that accesses an XML portlet that used the specified UI XSLT sees a pink background.
Click Next until you reach the window where you enter the Element Name.
Enter “XML_sample” and click Finish to save the new element.
When the Portlet Builder reappears, click Save to save a portlet that uses the XML_sample element.
On the Finish window, enter a portlet name and select the J2EE roles:
Portlet Name – enter “XML_sample.”
J2EE Roles – click Add All.
Click Finish.
When you see the prompt “Portlet successfully saved,” click OK, then click Close to exit the Portlet Builder.
In the Portlet Manager, select New from the Status menu. You see the XML_sample portlet.
Approve and Activate the portlet. Right-click XML_sample portlet and select:
Active Status – Active.
Approval Status – Approved.
The portlet now displays under the Approved status.
Adding the XML_sample portlet to a page
You have created an XML_sample portlet that uses the XML_sample element and incorporates the pink_ui_xslt user interface. Now add the portlet to a page.
Select Build | Pages from the Web Studio main window and click New on the Page Builder menu bar.
When the Page Builder appears, click Add.
When the Search window appears, click Search.
Click XML_sample in the Results pane and click Add.
In the Page Builder, click Save As.
In the Save Page window:
Enter “XML_sample” for Name.
Click Add All for J2EE Roles.
Click OK.
When the “Page saved” prompt appears, click OK, then click Close to exit the Page Builder.
At the Web Studio main window, select New from the Manager Status menu.
Right-click XML_sample in the detail view and select Status | Approved from the pop-up. When the “Page saved” prompt appears, click OK.
Select Approved from the Page Manager Status menu.
Click XML_sample in the detail view and click Update from the Page Manager menu bar.
Enter the appropriate user name and password and click Update.
Portal Interface now has the page available for users.
Creating a user-specific UI XSLT template
Select Build | Templates and select Approved from the Template Manager Status menu.
Right-click the pink_ui_xslt template in the detail view and select Edit from the pop-up.
When the Template Editor appears, locate this line in the Code window:
<TD BGCOLOR="#ffccff">
Change the value from “#ffccff” to:
#ccffcc
Click Save As.
When the Save Template As dialog box displays, enter:
green_ui_xslt
for the name, then click OK.
When you see the prompt “Template successfully saved,” click OK, then click Close to exit the Template Editor.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |