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