}
};
public JetspeedPrincipalManagementEditPortlet()
{
PortletRequest request = ((AbstractAdminWebApplication) getApplication()).getPortletRequest();
subite = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.DEFAULT_SUBSITE, "");
profile = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.DEFAULT_PROFILE, "");
role = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.DEFAULT_ROLE, "");
templateDir = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.NEW_USER_TEMPLATE_DIR, "");
subSiteRoot = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.SUB_SITE_ROOT, "");
add(new FeedbackPanel("feedback"));
Form userPrefernces = new Form("userPrefernces");
userPrefernces.add(new Label("subsiterootLabel", new ResourceModel("subsiteroot")));
userPrefernces.add(new TextField("subsiteroot", new PropertyModel(this, "subSiteRoot")));
userPrefernces.add(new Label("subsiteLabel", new ResourceModel("default.subsite")));
userPrefernces.add(new DropDownChoice("defaultSubSite", new PropertyModel(this, "subite"),getSubSites));
userPrefernces.add(new Label("templateDirLabel", new ResourceModel("templatedir")));
userPrefernces.add(new RequiredTextField("templateDir", new PropertyModel(this, "templateDir")));
userPrefernces.add(new Label("profileLabel", new ResourceModel("default.profile")));
userPrefernces.add(new DropDownChoice("profile", new PropertyModel(this, "profile"), getProfileList));
userPrefernces.add(new Label("roleLabel", new ResourceModel("default.role")));
userPrefernces.add(new DropDownChoice("role", new PropertyModel(this, "role"), getRoleNames));
userPrefernces.add(new Button("addUserPrefernces", new ResourceModel("common.save"))
{
@Override
public void onSubmit()
{
PortletRequest request = ((AbstractAdminWebApplication) getApplication()).getPortletRequest();
try
{
if (log.isDebugEnabled())
{
log.debug("Setting default role as " + getRole());
log.debug("Setting default subsite as " + getSubite());
log.debug("Setting default profile as " + getSubite());
}
request.getPreferences().setValue(JetspeedPrincipalManagementPortlet.DEFAULT_ROLE, getRole());
request.getPreferences().setValue(JetspeedPrincipalManagementPortlet.DEFAULT_SUBSITE, getSubite());
request.getPreferences().setValue(JetspeedPrincipalManagementPortlet.DEFAULT_PROFILE, getProfile());
request.getPreferences().setValue(JetspeedPrincipalManagementPortlet.NEW_USER_TEMPLATE_DIR, getTemplateDir());
request.getPreferences().setValue(JetspeedPrincipalManagementPortlet.SUB_SITE_ROOT, getSubSiteRoot());
request.getPreferences().store();
if (log.isDebugEnabled())
{
log.debug("Default settiing for portlet saved . ");
}
}