Last of the user related dialogs correctly converted to dialog framework, Users list and Quota info UI improvements.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7471 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-11-29 08:35:33 +00:00
parent de55e11515
commit f907501d38
3 changed files with 110 additions and 137 deletions

View File

@@ -112,6 +112,11 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
return this.users; return this.users;
} }
public int getUsersSize()
{
return getUsers().size();
}
public long getUsersTotalUsage() public long getUsersTotalUsage()
{ {
long totalUsage = 0L; long totalUsage = 0L;
@@ -121,7 +126,7 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
Long sizeLatest = (Long)properties.getUserUsage((String)user.getProperties().get("userName")); Long sizeLatest = (Long)properties.getUserUsage((String)user.getProperties().get("userName"));
if (sizeLatest != null) if (sizeLatest != null)
{ {
totalUsage = totalUsage + sizeLatest; totalUsage += sizeLatest;
} }
} }
return totalUsage; return totalUsage;
@@ -136,7 +141,7 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
Long sizeCurrent = (Long)user.getProperties().get("sizeQuota"); Long sizeCurrent = (Long)user.getProperties().get("sizeQuota");
if (sizeCurrent != null) if (sizeCurrent != null)
{ {
totalQuota = totalQuota + sizeCurrent; totalQuota += sizeCurrent;
} }
} }
return totalQuota; return totalQuota;
@@ -366,8 +371,7 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
public NodePropertyResolver resolverUserSizeLatest = new NodePropertyResolver() { public NodePropertyResolver resolverUserSizeLatest = new NodePropertyResolver() {
public Object get(Node personNode) { public Object get(Node personNode) {
Long sizeLatest = (Long)properties.getUserUsage((String)personNode.getProperties().get("userName")); return (Long)properties.getUserUsage((String)personNode.getProperties().get("userName"));
return sizeLatest;
} }
}; };
@@ -398,6 +402,14 @@ public class UsersDialog extends BaseDialogBean implements IContextListener
return null; return null;
} }
public String close()
{
contextUpdated();
return DIALOG_CLOSE;
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// IContextListener implementation // IContextListener implementation

View File

@@ -28,136 +28,97 @@
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> <%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> <%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<f:verbatim> <h:panelGrid columns="1" cellpadding="0" cellspacing="3" width="100%">
<table cellspacing=0 cellpadding=3 border=0 width=100%> <h:panelGroup>
<tr> <h:panelGroup id="mydetails-panel-facets">
<td width="100%" valign="top"><%-- wrapper comment used by the panel to add additional component facets --%> <f:facet name="title" >
</f:verbatim> <a:actionLink value="#{msg.modify}" action="dialog:editUserDetails"
<h:panelGroup id="mydetails-panel-facets"> showLink="false" image="/images/icons/Change_details.gif"
<f:facet name="title" > rendered="#{NavigationBean.isGuest == false}" />
<a:actionLink value="#{msg.modify}" action="dialog:editUserDetails" </f:facet>
showLink="false" image="/images/icons/Change_details.gif" </h:panelGroup>
rendered="#{NavigationBean.isGuest == false}" /> <a:panel label="#{msg.my_details}" id="mydetails-panel"
</f:facet> facetsId="dialog:dialog-body:mydetails-panel-facets" border="white" bgcolor="white"
</h:panelGroup> titleBorder="lbgrey" expandedTitleBorder="dotted"
<a:panel label="#{msg.my_details}" id="mydetails-panel" titleBgcolor="white">
facetsId="dialog:dialog-body:mydetails-panel-facets" border="white" bgcolor="white" <h:panelGrid columns="2" cellpadding="2" cellspacing="2">
titleBorder="lbgrey" expandedTitleBorder="dotted" <h:outputText value="#{msg.first_name}:" styleClass="propertiesLabel" />
titleBgcolor="white"> <h:outputText value="#{UsersBeanProperties.person.properties.firstName}" />
<f:verbatim>
<table cellspacing=2 cellpadding=2 border=0> <h:outputText value="#{msg.last_name}:" styleClass="propertiesLabel" />
<tr> <h:outputText value="#{UsersBeanProperties.person.properties.lastName}" />
<td class="propertiesLabel"></f:verbatim> <h:outputText
value="#{msg.first_name}" /> <f:verbatim>:</td> <h:outputText value="#{msg.email}:" styleClass="propertiesLabel" />
<td></f:verbatim><h:outputText <h:outputText value="#{UsersBeanProperties.person.properties.email}" />
value="#{UsersBeanProperties.person.properties.firstName}" /><f:verbatim></td> </h:panelGrid>
</tr>
<tr> <%-- context for current user is setup on entry to user console --%>
<td class="propertiesLabel"></f:verbatim><h:outputText <a:actionLink id="change-password" value="#{msg.change_password}"
value="#{msg.last_name}" /><f:verbatim>:</td> action="dialog:changeMyPassword"
<td></f:verbatim><h:outputText image="/images/icons/change_password.gif"
value="#{UsersBeanProperties.person.properties.lastName}" /><f:verbatim></td> rendered="#{NavigationBean.isGuest == false}" />
</tr> </a:panel>
<tr> </h:panelGroup>
<td class="propertiesLabel"></f:verbatim><h:outputText
value="#{msg.email}" /><f:verbatim>:</td> <f:verbatim/>
<td></f:verbatim><h:outputText
value="#{UsersBeanProperties.person.properties.email}" /><f:verbatim></td>
</tr>
</table>
<div style="padding:4px"></div>
<%-- context for current user is setup on entry to user console --%>
</f:verbatim>
<a:actionLink id="change-password" value="#{msg.change_password}"
action="dialog:changeMyPassword"
image="/images/icons/change_password.gif"
rendered="#{NavigationBean.isGuest == false}" />
</a:panel><f:verbatim>
<div style="padding:4px"></div> <a:panel label="#{msg.general_pref}" id="pref-panel"
rendered="#{NavigationBean.isGuest == false || UserPreferencesBean.allowGuestConfig == true}"
border="white" bgcolor="white" titleBorder="lbgrey"
expandedTitleBorder="dotted" titleBgcolor="white">
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<h:outputText value="#{msg.start_location}:" />
<%-- Start Location drop-down selector --%>
<h:selectOneMenu
id="start-location" value="#{UserPreferencesBean.startLocation}"
onchange="document.forms['dialog'].submit(); return true;">
<f:selectItems value="#{UserPreferencesBean.startLocations}" />
</h:selectOneMenu>
<h:outputText value="#{msg.interface_language}:" />
<h:selectOneMenu
id="language" value="#{UserPreferencesBean.language}"
onchange="document.forms['dialog'].submit(); return true;">
<f:selectItems value="#{UserPreferencesBean.languages}" />
</h:selectOneMenu>
<h:outputText value="#{msg.content_language_filter}:" />
<%-- Content Language Filter drop-down selector --%>
<h:selectOneMenu
id="content-filter-language"
value="#{UserPreferencesBean.contentFilterLanguage}"
onchange="document.forms['dialog'].submit(); return true;">
<f:selectItems value="#{UserPreferencesBean.contentFilterLanguages}" />
</h:selectOneMenu>
</h:panelGrid>
</a:panel>
<f:verbatim/>
</f:verbatim><a:panel label="#{msg.general_pref}" id="pref-panel" <a:panel label="#{msg.user_management}" id="man-panel"
rendered="#{NavigationBean.isGuest == false || UserPreferencesBean.allowGuestConfig == true}" rendered="#{NavigationBean.isGuest == false}" border="white"
border="white" bgcolor="white" titleBorder="lbgrey" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted"
expandedTitleBorder="dotted" titleBgcolor="white"> titleBgcolor="white">
<f:verbatim>
<table cellspacing=2 cellpadding=2 border=0> <a:panel id="usage-quota" rendered="#{UsersBeanProperties.usagesEnabled == true}">
<tr> <h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<td></f:verbatim><h:outputText value="#{msg.start_location}" /><f:verbatim>:&nbsp;</td> <h:outputText value="#{msg.sizeCurrent}:" styleClass="propertiesLabel" />
<td><%-- Start Location drop-down selector --%> </f:verbatim><h:selectOneMenu <h:outputText value="#{UsersBeanProperties.userUsage}">
id="start-location" value="#{UserPreferencesBean.startLocation}" <a:convertSize />
onchange="document.forms['dialog'].submit(); return true;"> </h:outputText>
<f:selectItems value="#{UserPreferencesBean.startLocations}" />
</h:selectOneMenu><f:verbatim></td> <h:outputText value="#{msg.sizeQuota}:" />
</tr> <h:outputText value="#{UsersBeanProperties.userQuota}">
<tr> <a:convertSize />
<td></f:verbatim><h:outputText value="#{msg.interface_language}" /><f:verbatim>:&nbsp; </h:outputText>
</td> </h:panelGrid>
<td><%-- Interface Language drop-down selector --%> </f:verbatim><h:selectOneMenu </a:panel>
id="language" value="#{UserPreferencesBean.language}"
onchange="document.forms['dialog'].submit(); return true;"> <h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<f:selectItems value="#{UserPreferencesBean.languages}" /> <a:actionLink id="manage-deleted-items"
</h:selectOneMenu><f:verbatim></td> value="#{msg.manage_deleted_items}"
</tr> action="dialog:manageDeletedItems"
<tr> image="/images/icons/trashcan.gif" />
<td></f:verbatim><h:outputText value="#{msg.content_language_filter}" /><f:verbatim>:&nbsp;</td> </h:panelGrid>
<td><%-- Content Language Filter drop-down selector --%> </f:verbatim><h:selectOneMenu </a:panel>
id="content-filter-language" </h:panelGrid>
value="#{UserPreferencesBean.contentFilterLanguage}"
onchange="document.forms['dialog'].submit(); return true;">
<f:selectItems
value="#{UserPreferencesBean.contentFilterLanguages}" />
</h:selectOneMenu><f:verbatim></td>
</tr>
</table>
</f:verbatim>
</a:panel><f:verbatim>
<div style="padding:4px"></div>
</f:verbatim><a:panel label="#{msg.user_management}" id="man-panel"
rendered="#{NavigationBean.isGuest == false}" border="white"
bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted"
titleBgcolor="white">
<a:panel id="usage-quota" rendered="#{UsersBeanProperties.usagesEnabled == true}">
<f:verbatim>
<table cellspacing=2 cellpadding=2 border=0>
<tr>
<td class="propertiesLabel"></f:verbatim> <h:outputText
value="#{msg.sizeCurrent}" /> <f:verbatim>:
</td>
<td></f:verbatim><h:outputText value="#{UsersBeanProperties.userUsage}">
<a:convertSize />
</h:outputText><f:verbatim>
</td>
</tr>
<tr>
<td class="propertiesLabel"></f:verbatim> <h:outputText
value="#{msg.sizeQuota}" /> <f:verbatim>:
</td>
<td></f:verbatim>
<h:outputText value="#{UsersBeanProperties.userQuota}">
<a:convertSize />
</h:outputText>
<f:verbatim>
</td>
</tr>
</table>
</f:verbatim>
</a:panel>
<f:verbatim>
<table cellspacing=2 cellpadding=2 border=0>
<tr>
<td></f:verbatim><a:actionLink id="manage-deleted-items"
value="#{msg.manage_deleted_items}"
action="dialog:manageDeletedItems"
image="/images/icons/trashcan.gif" /><f:verbatim></td>
</tr>
</table>
</f:verbatim>
</a:panel><f:verbatim></td>
</tr>
</table>
</f:verbatim>

View File

@@ -230,7 +230,7 @@
<a:dataPager styleClass="pager" /> <a:dataPager styleClass="pager" />
</a:richList> </a:richList>
<a:panel id="quota-panel" rendered="#{UsersBeanProperties.usagesEnabled == true}"> <a:panel id="quota-panel" rendered="#{UsersDialog.usersSize != 0 && UsersBeanProperties.usagesEnabled == true}">
<table border="0" cellspacing="2" cellpadding="2"> <table border="0" cellspacing="2" cellpadding="2">
<tr> <tr>
<td><h:outputText value="#{msg.quota_totalusage}:" /></td> <td><h:outputText value="#{msg.quota_totalusage}:" /></td>
@@ -252,7 +252,7 @@
<table cellpadding="0" cellspacing="0" border="0"> <table cellpadding="0" cellspacing="0" border="0">
<tr> <tr>
<td align="center"> <td align="center">
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" /> <h:commandButton value="#{msg.close}" action="#{UsersDialog.close}" styleClass="wizardButton" />
</td> </td>
</tr> </tr>
</table> </table>