Customizing user XML element templates  Customizing mobile application templates

Chapter 6: Building Templates

Enabling different templates for the same element

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>.<application id>.ui=<xslt file>
<userid>.<application id>.content=<xsl file>

where:

Place the xsltinfo.properties file in the %UnwiredAccelerator70%\tomcat\webapps\onepage\config directory if you are using Tomcat. If you are using EAServer, place the file in the %JAGUAR%\Repository\WebApplication\onepage\config, 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 application with a pink background and Cindy will see the XML_sample application 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 © 2005. Sybase Inc. All rights reserved. Customizing mobile application templates

View this book as PDF