Hi Heiko,
I faced the same problem when I built the user profile settings for my Confluence app. My approach was to use the existing user settings pages as a template, make a copy of one of the user settings Velocity pages, and adapt this according to my needs.
So if you have access to the Confluence source code, you can find all of Confluence’s action mappings in file ${SRC_DIR}\confluence-project\confluence-core\confluence\src\etc\java\xwork.xml
. In this file, you’ll find, for instance, the action mapping for action viewmyemailsettings
which corresponds to the email settings page in the user profile. This action will render a Velocity template /users/editmyemailsettings.vm
which you’ll find in ${SRC_DIR}\confluence-project\confluence-core\confluence-webapp\src\main\webapp\users\editmyemailsettings.vm
. You can copy and adapt this file according to your needs. This file uses the following decorators:
<html>
<head>
<title>$generalUtil.htmlEncode($pageTitle)</title>
#requireResource("confluence.web.resources:aui-forms")
</head>
#applyDecorator("root")
#decoratorParam("context" "profile")
#decoratorParam("mode" "settings")
#decoratorParam("helper" $action.helper)
#decoratorParam("infopanel-width" "200px")
<body>
<div>
[...]
This worked quite well for me and I was able to build a custom user settings page for my app. This settings page is defined in my atlassian-plugin.xml
as follows:
<web-item key="myuserpreferences" name="Custom User Settings"
section="system.settings.edit/yoursettings" weight="40">
<label key="myapp.user.settings.tabs.header"/>
<link>/users/viewmycustomettings.action</link>
</web-item>
The section
attribute defines that this web item will be shown in the user settings, the weight
attribute defines the position in the menu bar. The label key defines a key in my i18n properties.
Cheers, Roland