To apply different templates to the same element, create the xsltinfo.properties file and populate it with new template and user information.
This file should have the following content and structure:
<userid>.<portlet id>.ui=<xslt file> <userid>.<portlet id>.content=<xsl file>
where:
userid – is the login name of the user.
portlet id – is the ID of the portlet for which you want to specify a user-specific UI or content XSLT. To determine a portlet’s ID:
In Web Studio, select Build | Portlets, then select Approved from the Portlet Manager Status Menu. Right-click the XML_sample portlet in the detail view and select Properties.
When the Portlet Properties window displays, write down the ID value, then click Close.
content or UI file – enter the user-specific template for the portlet.
For example, to set up the file for the XML_sample portlet, enter this information:
bob.231.ui=pink_ui_xslt cindy.231.ui=green_ui_xslt
where pink_ui_xslt is the name of the presentation file for Bob, and green_ui_xslt is the name of the presentation file for Cindy.
Place the xsltinfo.properties file in the %SYBASE%\EAServer\Repository\WebApplication\onepage\config directory on Windows and in $SYBASE/EAServer/Repository/WebApplication/onepage/config on UNIX, then restart EAServer.
When each user that is specified in xsltinfo.properties adds the XML_sample page to their portal view, Bob will see the XML_sample portlet with a pink background and Cindy will see the XML_sample portlet with a green background.
To create user-specific content, follow the same procedures in this section, but create a new content template and specify the two different content files in the xsltinfo.properties file; for example:
bob.231.content=moreover_content_xsl cindy.231.content=new_content_xslt
You can also provide different presentation and different content for different users in this file.
bob.231.ui=pink_ui_xslt bob.231.content=moreover_content_xsl cindy.231.ui=green_ui_xslt cindy.231.content=new_content_xslt
The first time you create xslt.properties, you must shut down and restart EAServer to initialize the user-specific settings. When you make additions, changes, or deletions to the file the portal is updated automatically with the new information; that is, you do not need to restart the application server
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |