/* Constructor */
public ExportForm(final String id)
{
super(id);
add(new Label("exportHeader", new ResourceModel("export.header")));
add(new ExportCheckBox(USERS_GROUPS_ROLES, new PropertyModel<Boolean>(this, "doUserGroupsRoles")));
add(new Label("usersGroupsRolesLabel", new ResourceModel("export.users_groups_roles")));
add(new ExportCheckBox(PERMISSIONS, new PropertyModel<Boolean>(this, "doPermissions")));
add(new Label("permissionsLabel", new ResourceModel("export.permissions")));
add(new ExportCheckBox(PROFILING, new PropertyModel<Boolean>(this, "doProfiling")));
add(new Label("profilingLabel", new ResourceModel("export.profiling_rules")));
add(new ExportCheckBox(CAPABILITIES, new PropertyModel<Boolean>(this, "doCapabilities")));
add(new Label("capabilitiesLabel", new ResourceModel("export.capabilities")));
add(new ExportCheckBox(SSO, new PropertyModel<Boolean>(this, "doSSO")));
add(new Label("ssoLabel", new ResourceModel("export.sso")));
add(new ExportCheckBox(USER_PREFS, new PropertyModel<Boolean>(this, "doUserPrefs")));
add(new Label("userPrefsLabel", new ResourceModel("export.user_preferences")));
this.exportResourceProvider = new ExportResourceProvider(getPortletRequest().getUserPrincipal().getName());
DynamicResourceLink downloadLink = new DynamicResourceLink("exportLink", new PropertyModel<ExportResourceProvider>(this,
"exportResourceProvider"))
{
private static final long serialVersionUID = 0L;
@Override
public void onClick()
{
Map<String, Object> settings = new HashMap<String, Object>();
settings.put(JetspeedSerializer.KEY_PROCESS_USERS, new Boolean(doUserGroupsRoles));
settings.put(JetspeedSerializer.KEY_PROCESS_PERMISSIONS, new Boolean(doPermissions));
settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, new Boolean(doProfiling));
settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, new Boolean(doCapabilities));
settings.put(JetspeedSerializer.KEY_PROCESS_SSO, new Boolean(doSSO));
settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, new Boolean(doUserPrefs));
settings.put(JetspeedSerializer.KEY_EXPORT_INDENTATION, "\t");
settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.TRUE);
settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.FALSE);
exportResourceProvider.setSettings(settings);
}
};
downloadLink.add(new Label("exportAction", new ResourceModel("export.action")));
add(downloadLink);
};