Personal tools

rPath Appliance Platform Agent:Templates

From rPath Wiki

Jump to: navigation, search

rPath Appliance Platform Agent uses kid templates for content layout and presentation. The following table lists some of the critical templates located in the raa/templates directory:

Template File Notes
master.kid Defines the main page layout
login.kid Defines the login page layout
index.kid Defines layout and content for the main index page
help.kid Defines the full User Guide page layout
helpsection.kid Defines individual help page layout

To specify a template to use in plugin development, apply the decorator @raa.web.expose(template="<project.plugin.display>") as described in rPath Appliance Platform Agent:Plugin Decorators. The return value of methods with this decorator is be passed to a designated kid template, and the result of that template is displayed to the user. For example, the backup plugin's config method has the following decorator: @raa.web.expose(allow_xmlrpc=True, template="raaplugins.backup.templates.config"). This imports the config.kid template from the raaplugins.backup.templates module. In this case from /usr/lib/raa/raaplugins/backup/templates. Also, to ensure the plugin template, when rendered, displays the appliance agent menu, the template should subclass master.kid.