Decorators allow content generated by one of your servlet modules to appear in the Fisheye/Crucible UI without you needing to generate headers, footers, sidebars and so on.
A decorator creates standard parts of the page and inserts the content created by a plugin servlet in the appropriate place. For example, the atl.general decorator provides the standard header and footer, while the atl.admin decorator also provides the left hand column of administration links, with the plugin generated content in a section to its right.
So, a servlet which is rendering a URL from a web item in the system.admin location would request the atl.admin decorator.
All servlet plugins whose response is rendered as a Fisheye/Crucible page should specify a decorator in the response. Meta tags in the head of the HTML page are used to choose a decorator and provide it with any parameters it needs.
The decorator name and parameters are given thus:
1 2<head> ... <meta name='decorator' content='fisheye.userprofile.tab'/> <meta name='profile.tab.key' content='com.atlassian.crucible.example.plugin.event.crucible-example-event-plugin:test-profile-tab'/> ... </head>
The value given by the content parameter of the profile.tab.key is the plugin module key of the web-item which creates the tab we want, shown as selected when this page is rendered.
Alternatively you can request a decorator by setting an attribute on the request in your servlet:
1 2request.setAttribute("decorator", "fisheye.userprofile.tab"); // request.setAttribute("meta.profile.tab.key", "twitter"); -- should work, but doesn't response.setContentType("text/html");
Note that:
meta parameters as attributes doesn't seem to work - put them in your page instead.text/html are decorated.Decorator | Description |
|---|---|
| Provides standard header and footer. Parameters: None |
| Provides left hand column of administration links. Parameters: None |
| Content rendered as a single tab on the user profile page. Parameters: |
| Content rendered as a single tab on the Source, Reports page Parameters: |
| Content rendered as a single tab on the Reviews, Reports page Parameters: |
Rate this page: