mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Custom property (UIPropertySheet) support added to User Profile/Edit User Profile screens, New/Edit User summary screen improvements
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7486 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -83,6 +83,9 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
protected NodeRef homeSpaceLocation = null;
|
||||
protected String presenceProvider = null;
|
||||
protected String presenceUsername = null;
|
||||
protected String organisation = null;
|
||||
protected String jobtitle = null;
|
||||
protected String location = null;
|
||||
|
||||
protected Long sizeQuota = null; // null is also equivalent to -1 (ie. no quota limit set)
|
||||
protected String sizeQuotaUnits = null;
|
||||
@@ -169,6 +172,9 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
this.homeSpaceLocation = getDefaultHomeSpace();
|
||||
this.presenceProvider = "";
|
||||
this.presenceUsername = "";
|
||||
this.organisation = "";
|
||||
this.jobtitle = "";
|
||||
this.location = "";
|
||||
|
||||
this.sizeQuota = null;
|
||||
this.sizeQuotaUnits = "";
|
||||
@@ -179,16 +185,39 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
*/
|
||||
public String getSummary()
|
||||
{
|
||||
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||
|
||||
String homeSpaceLabel = this.homeSpaceName;
|
||||
if (this.homeSpaceName.length() == 0 && this.homeSpaceLocation != null)
|
||||
{
|
||||
homeSpaceLabel = Repository.getNameForNode(this.nodeService, this.homeSpaceLocation);
|
||||
}
|
||||
|
||||
String quotaLabel = "";
|
||||
if (this.sizeQuota != null && this.sizeQuota != -1L)
|
||||
{
|
||||
quotaLabel = Long.toString(this.sizeQuota) + bundle.getString(this.sizeQuotaUnits);
|
||||
}
|
||||
|
||||
String presenceLabel = "";
|
||||
if (this.presenceProvider != null && this.presenceProvider.length() != 0)
|
||||
{
|
||||
presenceLabel = this.presenceUsername + " (" + presenceProvider + ")";
|
||||
}
|
||||
|
||||
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||
|
||||
return buildSummary(new String[] { bundle.getString("name"), bundle.getString("username"), bundle.getString("password"), bundle.getString("homespace") }, new String[] {
|
||||
this.firstName + " " + this.lastName, this.userName, "********", homeSpaceLabel });
|
||||
return buildSummary(
|
||||
new String[] {
|
||||
bundle.getString("name"), bundle.getString("username"),
|
||||
bundle.getString("password"), bundle.getString("homespace"),
|
||||
bundle.getString("email"), bundle.getString("user_organization"),
|
||||
bundle.getString("user_jobtitle"), bundle.getString("user_location"),
|
||||
bundle.getString("presence_username"), bundle.getString("quota")},
|
||||
new String[] {
|
||||
this.firstName + " " + this.lastName, this.userName,
|
||||
"********", homeSpaceLabel,
|
||||
this.email, this.organisation,
|
||||
this.jobtitle, this.location,
|
||||
presenceLabel, quotaLabel});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -377,6 +406,54 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
this.confirm = confirm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the jobtitle
|
||||
*/
|
||||
public String getJobtitle()
|
||||
{
|
||||
return this.jobtitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jobtitle the jobtitle to set
|
||||
*/
|
||||
public void setJobtitle(String jobtitle)
|
||||
{
|
||||
this.jobtitle = jobtitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the location
|
||||
*/
|
||||
public String getLocation()
|
||||
{
|
||||
return this.location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param location the location to set
|
||||
*/
|
||||
public void setLocation(String location)
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the organisation
|
||||
*/
|
||||
public String getOrganization()
|
||||
{
|
||||
return this.organisation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param organisation the organisation to set
|
||||
*/
|
||||
public void setOrganization(String organisation)
|
||||
{
|
||||
this.organisation = organisation;
|
||||
}
|
||||
|
||||
public Long getSizeQuota()
|
||||
{
|
||||
return sizeQuota;
|
||||
@@ -630,6 +707,9 @@ public class CreateUserWizard extends BaseWizardBean
|
||||
props.put(ContentModel.PROP_HOMEFOLDER, homeSpaceNodeRef);
|
||||
props.put(ContentModel.PROP_EMAIL, this.email);
|
||||
props.put(ContentModel.PROP_ORGID, this.companyId);
|
||||
props.put(ContentModel.PROP_ORGANIZATION, this.organisation);
|
||||
props.put(ContentModel.PROP_JOBTITLE, this.jobtitle);
|
||||
props.put(ContentModel.PROP_LOCATION, this.location);
|
||||
props.put(ContentModel.PROP_PRESENCEPROVIDER, this.presenceProvider);
|
||||
props.put(ContentModel.PROP_PRESENCEUSERNAME, this.presenceUsername);
|
||||
|
||||
|
@@ -118,7 +118,7 @@ public class EditUserDetailsDialog extends BaseDialogBean
|
||||
return outcome;
|
||||
}
|
||||
|
||||
private Node getPerson()
|
||||
public Node getPerson()
|
||||
{
|
||||
return person;
|
||||
}
|
||||
|
@@ -71,9 +71,16 @@ public class EditUserWizard extends CreateUserWizard
|
||||
this.userName = (String) props.get("userName");
|
||||
this.email = (String) props.get("email");
|
||||
this.companyId = (String) props.get("organizationId");
|
||||
this.organisation = (String) props.get("organization");
|
||||
this.jobtitle = (String) props.get("jobtitle");
|
||||
this.location = (String) props.get("location");
|
||||
this.presenceProvider = (String) props.get("presenceProvider");
|
||||
this.presenceUsername = (String) props.get("presenceUsername");
|
||||
this.sizeQuota = (Long) props.get("sizeQuota");
|
||||
if (this.sizeQuota != null && this.sizeQuota == -1L)
|
||||
{
|
||||
this.sizeQuota = null;
|
||||
}
|
||||
|
||||
if (this.sizeQuota != null)
|
||||
{
|
||||
@@ -188,6 +195,9 @@ public class EditUserWizard extends CreateUserWizard
|
||||
props.put(ContentModel.PROP_HOMEFOLDER, newHomeFolderRef);
|
||||
props.put(ContentModel.PROP_EMAIL, this.email);
|
||||
props.put(ContentModel.PROP_ORGID, this.companyId);
|
||||
props.put(ContentModel.PROP_ORGANIZATION, this.organisation);
|
||||
props.put(ContentModel.PROP_JOBTITLE, this.jobtitle);
|
||||
props.put(ContentModel.PROP_LOCATION, this.location);
|
||||
props.put(ContentModel.PROP_PRESENCEPROVIDER, this.presenceProvider);
|
||||
props.put(ContentModel.PROP_PRESENCEUSERNAME, this.presenceUsername);
|
||||
this.nodeService.setProperties(nodeRef, props);
|
||||
|
@@ -342,6 +342,7 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
|
||||
}
|
||||
|
||||
node.addPropertyResolver("sizeLatest", this.resolverUserSizeLatest);
|
||||
node.addPropertyResolver("quota", this.resolverUserQuota);
|
||||
|
||||
this.users.add(node);
|
||||
}
|
||||
@@ -375,6 +376,13 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
|
||||
}
|
||||
};
|
||||
|
||||
public NodePropertyResolver resolverUserQuota = new NodePropertyResolver() {
|
||||
public Object get(Node personNode) {
|
||||
Long quota = (Long)personNode.getProperties().get("sizeQuota");
|
||||
return (quota != null && quota != -1L) ? quota : null;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Action handler to show all the users currently in the system
|
||||
*
|
||||
@@ -390,6 +398,7 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
|
||||
for (Node node : this.users)
|
||||
{
|
||||
node.addPropertyResolver("sizeLatest", this.resolverUserSizeLatest);
|
||||
node.addPropertyResolver("quota", this.resolverUserQuota);
|
||||
}
|
||||
|
||||
// return null to stay on the same page
|
||||
|
Reference in New Issue
Block a user