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:
@@ -304,7 +304,6 @@ date=Date
|
||||
mimetype=Format
|
||||
modifier=Modifier
|
||||
locale=Locale
|
||||
|
||||
quota=Quota
|
||||
sizeCurrent=Usage
|
||||
sizeQuota=Quota
|
||||
@@ -731,7 +730,7 @@ show_details=Show Details
|
||||
user_search_info=To find a user search for them using their first name, last name and/or user name. Alternatively to see all users click 'Show All', however, this may take some time if there are a lot of users in the system.
|
||||
user_change_homespace_info=Selecting a new home space for a user will not remove the existing permissions on the original home space. You may wish to use the Manage Space Users dialog to modify permissions if they are no longer required on the original home space.
|
||||
quota_totalusage=Total Usage (for this search)
|
||||
quote_totalquota=Total Quota (for this search)
|
||||
quota_totalquota=Total Quota (for this search)
|
||||
|
||||
# Content Wizard messages
|
||||
add_content_dialog_title=Add Content Dialog
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||
String quotaLabel = "";
|
||||
if (this.sizeQuota != null && this.sizeQuota != -1L)
|
||||
{
|
||||
quotaLabel = Long.toString(this.sizeQuota) + bundle.getString(this.sizeQuotaUnits);
|
||||
}
|
||||
|
||||
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 });
|
||||
String presenceLabel = "";
|
||||
if (this.presenceProvider != null && this.presenceProvider.length() != 0)
|
||||
{
|
||||
presenceLabel = this.presenceUsername + " (" + presenceProvider + ")";
|
||||
}
|
||||
|
||||
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
|
||||
|
@@ -75,7 +75,7 @@ function updateButtonState()
|
||||
|
||||
<f:verbatim/>
|
||||
<h:outputText value="#{msg.user_organization}:"/>
|
||||
<h:inputText id="organsiation" value="#{DialogManager.bean.personProperties.organization}" size="35" maxlength="1024" />
|
||||
<h:inputText id="organisation" value="#{DialogManager.bean.personProperties.organization}" size="35" maxlength="1024" />
|
||||
|
||||
<f:verbatim/>
|
||||
<h:outputText value="#{msg.user_jobtitle}:"/>
|
||||
@@ -99,6 +99,13 @@ function updateButtonState()
|
||||
|
||||
</h:panelGrid>
|
||||
|
||||
<h:panelGrid columns="2" cellpadding="2" cellspacing="0" width="100%" style="padding-top:8px">
|
||||
<!-- custom properties for cm:person type -->
|
||||
<f:verbatim/>
|
||||
<r:propertySheetGrid id="person-props" value="#{DialogManager.bean.person}"
|
||||
var="personProps" columns="1" externalConfig="true" />
|
||||
</h:panelGrid>
|
||||
|
||||
<f:verbatim>
|
||||
<script>
|
||||
updateButtonState();
|
||||
|
@@ -79,6 +79,15 @@
|
||||
<h:outputText value="#{msg.company_id}:"/>
|
||||
<h:inputText value="#{WizardManager.bean.companyId}" size="35" maxlength="1024" />
|
||||
|
||||
<h:outputText value="#{msg.user_organization}:"/>
|
||||
<h:inputText id="organisation" value="#{WizardManager.bean.organization}" size="35" maxlength="1024" />
|
||||
|
||||
<h:outputText value="#{msg.user_jobtitle}:"/>
|
||||
<h:inputText id="jobtitle" value="#{WizardManager.bean.jobtitle}" size="35" maxlength="1024" />
|
||||
|
||||
<h:outputText value="#{msg.user_location}:"/>
|
||||
<h:inputText id="location" value="#{WizardManager.bean.location}" size="35" maxlength="1024" />
|
||||
|
||||
<h:outputText value="#{msg.presence_provider}:"/>
|
||||
<h:selectOneMenu value="#{WizardManager.bean.presenceProvider}">
|
||||
<f:selectItem itemValue="" itemLabel="(#{msg.none})"/>
|
||||
|
@@ -84,9 +84,16 @@
|
||||
</h:panelGrid>
|
||||
</h:panelGrid>
|
||||
|
||||
<!-- custom properties for cm:person type -->
|
||||
<f:verbatim><div style="padding-bottom:12px"></f:verbatim>
|
||||
<r:propertySheetGrid id="person-props" value="#{UsersBeanProperties.person}"
|
||||
var="personProps" columns="1" mode="view" labelStyleClass="propertiesLabel"
|
||||
externalConfig="true" />
|
||||
<f:verbatim></div></f:verbatim>
|
||||
|
||||
<%-- context for current user is setup on entry to user console --%>
|
||||
<a:actionLink id="change-password" value="#{msg.change_password}"
|
||||
action="dialog:changeMyPassword" style="padding-top:6px"
|
||||
action="dialog:changeMyPassword"
|
||||
image="/images/icons/change_password.gif"
|
||||
rendered="#{NavigationBean.isGuest == false}" />
|
||||
</a:panel>
|
||||
|
@@ -204,7 +204,7 @@
|
||||
<f:facet name="header">
|
||||
<h:outputText value="#{msg.sizeQuota}" rendered="#{UsersBeanProperties.usagesEnabled == true}"/>
|
||||
</f:facet>
|
||||
<h:outputText value="#{r.sizeQuota}" rendered="#{UsersBeanProperties.usagesEnabled == true}">
|
||||
<h:outputText value="#{r.quota}" rendered="#{UsersBeanProperties.usagesEnabled == true}">
|
||||
<a:convertSize />
|
||||
</h:outputText>
|
||||
</a:column>
|
||||
@@ -237,7 +237,7 @@
|
||||
<td><h:outputText value="#{UsersDialog.usersTotalUsage}"><a:convertSize/></h:outputText></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.quote_totalquota}:" /></td>
|
||||
<td><h:outputText value="#{msg.quota_totalquota}:" /></td>
|
||||
<td><h:outputText value="#{UsersDialog.usersTotalQuota}"><a:convertSize/></h:outputText></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user