|
|
+ |
This report shows the user a list of users and their roles associated with them. This report has to be used in conjunction with a report template such as the [[HTML Template]].
|
|
|
+ |
<pre>import com.urbancode.anthill3.domain.reporting.*;
|
|
|
+ |
ReportMetaData rmd = new ReportMetaData();
|
|
|
+ |
<pre>import com.urbancode.anthill3.domain.reporting.*;
|
|
|
+ |
import com.urbancode.anthill3.domain.security.*;
|
|
|
+ |
import com.urbancode.anthill3.domain.userprofile.*;
|
|
|
+ |
ReportOutput output = new ReportOutput(metaData);
|
|
|
+ |
Role[] roles = RoleFactory.getInstance().restoreAllActive();
|
|
|
+ |
for (int r=0; r<roles.length; r++) {
|
|
|
+ |
User[] users = UserFactory.getInstance().restoreAllForRole(roles[r]);
|
|
|
+ |
for (int u=0; u<users.length; u++) {
|
|
|
+ |
ReportRow row = new ReportRow(output, "1");
|
|
|
+ |
row.setColumnValue("Role", roles[r].getName());
|
|
|
+ |
row.setColumnValue("User", users[u].getName());
|
|
|
+ |
UserProfile profile = UserProfileFactory.getInstance().restoreForUser(users[u]);
|
|
|
+ |
row.setColumnValue("Name", profile.getFirstName() + " " + profile.getLastName());
|
|
|
+ |
[[AnthillPro Template Reports]]<br/>
|