. First cut of User Settings page

- will contain useful things like User Info (which can be changed e.g. name and email), Change Password, View Settings etc.
 - Added Change Password page implementation

. Preferences Service for web-client
 - handles and hides away the retrieving and storing properties from the configurable aspect on the current Person
 - simple use case such as: PreferencesService.getPreferences().setValue(name, value);

. Moved Admin Console to title area in main UI page

. Fixed various Admin Console actions to use dialog framework navigation

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3315 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-07-13 07:21:02 +00:00
parent 08f4586da7
commit 3f63e8b83b
21 changed files with 737 additions and 104 deletions

View File

@@ -843,6 +843,19 @@ recovery_report_success=The following items were recovered successfully
recovery_report_failed=The following items failed to recover
recovery_report_reason=Failure Reason
# My Alfresco messages
my_alfresco=My Alfresco
title_user_console=User Options
user_console=User Options
user_console_info=User Options
user_console_description=Use this page to change your options and settings
my_details=My Details
general_pref=General Preferences
change_my_password_description=Use this view to change your password
change_my_password_instructions=Enter your new password.
old_password=Old Password
new_password=New Password
# Admin Console messages
title_admin_console=Administration Console
admin_console=Administration Console

View File

@@ -45,7 +45,6 @@
<!-- Limit search results. -1 for unlimited. -->
<search-max-results>-1</search-max-results>
<!-- The default permissions to apply to a new users Home Space when first created -->
<!-- this permission is for other users attempting to access that Home Space -->
<!-- generally set to "Consumer" or empty value to indicate a private hidden space. -->

View File

@@ -34,10 +34,9 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.PreferencesService;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
@@ -65,7 +64,7 @@ public class UserShortcutsBean
/** List of shortcut nodes */
private List<Node> shortcuts = null;
private QName QNAME_SHORTCUTS = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "shortcuts");
private String PREF_SHORTCUTS = "shortcuts";
// ------------------------------------------------------------------------------
@@ -113,8 +112,7 @@ public class UserShortcutsBean
tx.begin();
// get the shortcuts from the preferences for this user
prefRef = getShortcutsNodeRef();
shortcuts = (List<String>)this.nodeService.getProperty(prefRef, QNAME_SHORTCUTS);
shortcuts = (List<String>)PreferencesService.getPreferences(context).getValue(PREF_SHORTCUTS);
if (shortcuts != null)
{
// each shortcut node ID is persisted as a list item in a well known property
@@ -184,7 +182,7 @@ public class UserShortcutsBean
{
shortcuts.add(this.shortcuts.get(i).getId());
}
this.nodeService.setProperty(prefRef, QNAME_SHORTCUTS, (Serializable)shortcuts);
PreferencesService.getPreferences().setValue(PREF_SHORTCUTS, (Serializable)shortcuts);
}
catch (Exception err)
{
@@ -246,14 +244,13 @@ public class UserShortcutsBean
tx = Repository.getUserTransaction(context);
tx.begin();
NodeRef prefRef = getShortcutsNodeRef();
List<String> shortcuts = (List<String>)this.nodeService.getProperty(prefRef, QNAME_SHORTCUTS);
List<String> shortcuts = (List<String>)PreferencesService.getPreferences(context).getValue(PREF_SHORTCUTS);
if (shortcuts == null)
{
shortcuts = new ArrayList<String>(1);
}
shortcuts.add(node.getNodeRef().getId());
this.nodeService.setProperty(prefRef, QNAME_SHORTCUTS, (Serializable)shortcuts);
PreferencesService.getPreferences(context).setValue(PREF_SHORTCUTS, (Serializable)shortcuts);
// commit the transaction
tx.commit();
@@ -280,14 +277,6 @@ public class UserShortcutsBean
}
}
/**
* Get the node we need to store our user preferences
*/
private NodeRef getShortcutsNodeRef()
{
return Application.getCurrentUser(FacesContext.getCurrentInstance()).getUserPreferencesRef();
}
/**
* Action handler bound to the user shortcuts Shelf component called when a node is removed
*/
@@ -303,13 +292,12 @@ public class UserShortcutsBean
tx = Repository.getUserTransaction(context);
tx.begin();
NodeRef prefRef = getShortcutsNodeRef();
List<String> shortcuts = (List<String>)this.nodeService.getProperty(prefRef, QNAME_SHORTCUTS);
List<String> shortcuts = (List<String>)PreferencesService.getPreferences(context).getValue(PREF_SHORTCUTS);
if (shortcuts != null && shortcuts.size() > shortcutEvent.Index)
{
// remove the shortcut from the saved list and persist back
shortcuts.remove(shortcutEvent.Index);
this.nodeService.setProperty(prefRef, QNAME_SHORTCUTS, (Serializable)shortcuts);
PreferencesService.getPreferences(context).setValue(PREF_SHORTCUTS, (Serializable)shortcuts);
// commit the transaction
tx.commit();
@@ -380,13 +368,12 @@ public class UserShortcutsBean
tx = Repository.getUserTransaction(context);
tx.begin();
NodeRef prefRef = getShortcutsNodeRef();
List<String> shortcuts = (List<String>)this.nodeService.getProperty(prefRef, QNAME_SHORTCUTS);
List<String> shortcuts = (List<String>)PreferencesService.getPreferences(context).getValue(PREF_SHORTCUTS);
if (shortcuts != null && shortcuts.size() > shortcutEvent.Index)
{
// remove the shortcut from the saved list and persist back
shortcuts.remove(shortcutEvent.Index);
this.nodeService.setProperty(prefRef, QNAME_SHORTCUTS, (Serializable)shortcuts);
PreferencesService.getPreferences(context).setValue(PREF_SHORTCUTS, (Serializable)shortcuts);
// commit the transaction
tx.commit();

View File

@@ -0,0 +1,99 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.bean.repository;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
/**
* Wraps the notion of preferences and settings for a User.
* Caches values until they are overwritten with a new value.
*
* @author Kevin Roast
*/
public final class Preferences
{
private NodeRef preferencesRef;
private NodeService nodeService;
private Map<String, Serializable> cache = new HashMap<String, Serializable>(16, 1.0f);
/**
* Package level constructor
*/
Preferences(NodeRef prefRef)
{
if (prefRef == null)
{
throw new IllegalArgumentException("Preferences NodeRef cannot be null.");
}
this.preferencesRef = prefRef;
}
/**
* Get a serialized preferences value.
*
* @param name Name of the value to retrieve.
*
* @return The value or null if not found/set.
*/
public Serializable getValue(String name)
{
Serializable value = this.cache.get(name);
if (value == null)
{
QName qname = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, name);
value = getNodeService().getProperty(this.preferencesRef, qname);
this.cache.put(name, value);
}
return value;
}
/**
* Set a serialized preference value.
*
* @param name Name of the value to set.
* @param value Value to set.
*/
public void setValue(String name, Serializable value)
{
QName qname = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, name);
// persist the property to the repo
getNodeService().setProperty(this.preferencesRef, qname, value);
// update the cache
this.cache.put(name, value);
}
/**
* @return the NodeService instance.
*/
private NodeService getNodeService()
{
if (this.nodeService == null)
{
this.nodeService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getNodeService();
}
return this.nodeService;
}
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.bean.repository;
import javax.faces.context.FacesContext;
import org.alfresco.web.app.Application;
/**
* Simple client service to retrieve the Preferences object for the current User.
*
* @author Kevin Roast
*/
public final class PreferencesService
{
/**
* Private constructor
*/
private PreferencesService()
{
}
/**
* @return The Preferences for the current User instance.
*/
public static Preferences getPreferences()
{
return getPreferences(FacesContext.getCurrentInstance());
}
/**
* @param fc FacesContext
* @return The Preferences for the current User instance.
*/
public static Preferences getPreferences(FacesContext fc)
{
User user = Application.getCurrentUser(fc);
return getPreferences(user);
}
/**
* @param user User instance
* @return The Preferences for the current User instance.
*/
public static Preferences getPreferences(User user)
{
return user.getPreferences();
}
}

View File

@@ -45,8 +45,7 @@ public final class User
private String fullName = null;
private Boolean administrator = null;
/** cached ref to our user preferences node */
private NodeRef preferencesFolderRef = null;
private Preferences preferences = null;
/**
* Constructor
@@ -139,13 +138,23 @@ public final class User
return administrator;
}
/**
* @return The Preferences for the User
*/
Preferences getPreferences()
{
if (this.preferences == null)
{
this.preferences = new Preferences(getUserPreferencesRef());
}
return this.preferences;
}
/**
* Get or create the node used to store user preferences.
* Utilises the 'configurable' aspect on the Person linked to this user.
*/
public synchronized NodeRef getUserPreferencesRef()
{
if (this.preferencesFolderRef == null)
synchronized NodeRef getUserPreferencesRef()
{
FacesContext fc = FacesContext.getCurrentInstance();
ServiceRegistry registry = Repository.getServiceRegistry(fc);
@@ -193,9 +202,6 @@ public final class User
prefRef = childRef.getChildRef();
}
this.preferencesFolderRef = prefRef;
}
return this.preferencesFolderRef;
return prefRef;
}
}

View File

@@ -59,6 +59,7 @@ public class UsersBean implements IContextListener
private static final String ERROR_USER_DELETE = "error_delete_user_object";
private static final String DEFAULT_OUTCOME = "manageUsers";
private static final String DIALOG_CLOSE = "dialog:close";
/** NodeService bean reference */
protected NodeService nodeService;
@@ -81,6 +82,7 @@ public class UsersBean implements IContextListener
private List<Node> users = Collections.<Node>emptyList();
private String password = null;
private String oldPassword = null;
private String confirm = null;
private String searchCriteria = null;
@@ -209,6 +211,22 @@ public class UsersBean implements IContextListener
this.password = password;
}
/**
* @return Returns the old password.
*/
public String getOldPassword()
{
return this.oldPassword;
}
/**
* @param oldPassword The old password to set.
*/
public void setOldPassword(String oldPassword)
{
this.oldPassword = oldPassword;
}
/**
* @return Returns the person context.
*/
@@ -313,7 +331,7 @@ public class UsersBean implements IContextListener
.getCurrentInstance(), ERROR_DELETE), e.getMessage()), e);
}
return DEFAULT_OUTCOME;
return DIALOG_CLOSE;
}
/**
@@ -321,7 +339,7 @@ public class UsersBean implements IContextListener
*/
public String changePasswordOK()
{
String outcome = DEFAULT_OUTCOME;
String outcome = DIALOG_CLOSE;
if (this.password != null && this.confirm != null && this.password.equals(this.confirm))
{
@@ -347,6 +365,39 @@ public class UsersBean implements IContextListener
return outcome;
}
/**
* Action handler called for OK button press on Change My Password screen
* For this screen the user is required to enter their old password - effectively login.
*/
public String changeMyPasswordOK()
{
String outcome = DIALOG_CLOSE;
if (this.password != null && this.confirm != null && this.password.equals(this.confirm))
{
try
{
String userName = (String)this.person.getProperties().get(ContentModel.PROP_USERNAME);
this.authenticationService.updateAuthentication(userName, this.oldPassword.toCharArray(), this.password.toCharArray());
}
catch (Exception e)
{
outcome = null;
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext
.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
}
}
else
{
outcome = null;
Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(),
ERROR_PASSWORD_MATCH));
}
return outcome;
}
/**
* Event handler called when the user wishes to search for a user
*

View File

@@ -77,13 +77,17 @@
</navigation-case>
</navigation-rule>
<!-- rule to get back to the Admin Console from anywhere -->
<!-- rule to get back to the Admin/User Console from anywhere -->
<navigation-rule>
<from-view-id>/jsp/*</from-view-id>
<navigation-case>
<from-outcome>adminConsole</from-outcome>
<to-view-id>/jsp/admin/admin-console.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>userConsole</from-outcome>
<to-view-id>/jsp/users/user-console.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- Browse screen action outcomes -->
@@ -600,6 +604,15 @@
</navigation-case>
</navigation-rule>
<!-- User Details and preferences action outcomes -->
<navigation-rule>
<from-view-id>/jsp/users/user-console.jsp</from-view-id>
<navigation-case>
<from-outcome>changePassword</from-outcome>
<to-view-id>/jsp/users/change-my-password.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- navigation rules for the New User wizard -->
<navigation-rule>
<from-view-id>/jsp/wizard/new-user/*</from-view-id>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -98,13 +98,13 @@
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "ballongrey", "#EEEEEE"); %>
<table cellpadding="6" cellspacing="6" border="0" width="100%">
<tr>
<td><a:actionLink value="#{msg.manage_users}" image="/images/icons/users.gif" action="manageUsers" styleClass="title" actionListener="#{NewUserWizard.setupUsers}" /></td>
<td><a:actionLink value="#{msg.manage_users}" image="/images/icons/users.gif" action="dialog:manageUsers" styleClass="title" actionListener="#{NewUserWizard.setupUsers}" /></td>
</tr>
<tr>
<td><a:actionLink value="#{msg.manage_groups}" image="/images/icons/group.gif" action="manageGroups" styleClass="title" /></td>
<td><a:actionLink value="#{msg.manage_groups}" image="/images/icons/group.gif" action="dialog:manageGroups" styleClass="title" /></td>
</tr>
<tr>
<td><a:actionLink value="#{msg.category_management}" image="/images/icons/categories.gif" action="manageCategories" styleClass="title" /></td>
<td><a:actionLink value="#{msg.category_management}" image="/images/icons/categories.gif" action="dialog:manageCategories" styleClass="title" /></td>
</tr>
<tr>
<td>
@@ -121,10 +121,10 @@
</td>
</tr>
<tr>
<td><a:actionLink value="#{msg.system_info}" image="/images/icons/info_icon.gif" action="showSystemInfo" styleClass="title" /></td>
<td><a:actionLink value="#{msg.system_info}" image="/images/icons/info_icon.gif" action="dialog:showSystemInfo" styleClass="title" /></td>
</tr>
<tr>
<td><a:actionLink value="#{msg.node_browser}" image="/images/icons/node_browser.gif" action="showNodeBrowser" styleClass="title" /></td>
<td><a:actionLink value="#{msg.node_browser}" image="/images/icons/node_browser.gif" action="dialog:showNodeBrowser" styleClass="title" /></td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "ballongrey"); %>
@@ -136,7 +136,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="browse" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>

View File

@@ -137,11 +137,6 @@
<%-- More actions menu --%>
<a:menu id="actionsMenu" itemSpacing="4" label="#{msg.more_actions}" image="/images/icons/menu.gif" menuStyleClass="moreActionsMenu" style="white-space:nowrap">
<r:actions id="acts_browse" value="browse_actions_menu" context="#{NavigationBean.currentNode}" />
<%-- admin user only actions --%>
<a:booleanEvaluator value="#{NavigationBean.currentUser.admin == true}" id="eval8">
<a:actionLink value="#{msg.admin_console}" image="/images/icons/admin_console.gif" action="adminConsole" id="link11" />
</a:booleanEvaluator>
</a:menu>
</td>
</a:panel>

View File

@@ -189,7 +189,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="adminConsole" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>

View File

@@ -151,7 +151,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="adminConsole" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>

View File

@@ -270,7 +270,7 @@
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="adminConsole" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>

View File

@@ -31,6 +31,7 @@
<a:listItem value="company" label="#{msg.company_home}" rendered="#{NavigationBean.companyHomeVisible}" />
<a:listItem value="home" label="#{msg.my_home}" />
<a:listItem value="guest" label="#{msg.guest_home}" rendered="#{NavigationBean.isGuest == false && NavigationBean.guestHomeVisible}" />
<a:listItem value="myalfresco" label="#{msg.my_alfresco}" />
</a:modeList>
</td>
<td><img src="<%=request.getContextPath()%>/images/parts/titlebar_end.gif" width=8 height=30></td>
@@ -42,10 +43,23 @@
<td>
<table cellspacing=2 cellpadding=0 width=100%>
<tr>
<td><a:actionLink value="#{msg.toggle_shelf}" image="/images/icons/shelf.gif" actionListener="#{NavigationBean.toggleShelf}" showLink="false" /></td>
<td>
<%-- admin user only actions --%>
<a:booleanEvaluator value="#{NavigationBean.currentUser.admin == true}" id="evalA">
<a:actionLink value="#{msg.admin_console}" image="/images/icons/admin_console.gif" showLink="false" action="dialog:adminConsole" id="link11_1" />
</a:booleanEvaluator>
</td>
<td width=8>&nbsp;</td>
<td><img src="<%=request.getContextPath()%>/images/icons/Help_icon.gif" width=15 height=15></td>
<td><nobr><h:outputLink value="#{NavigationBean.helpUrl}" target="help"><h:outputText value="#{msg.help}" /></h:outputLink></nobr></td>
<td>
<%-- user preferences --%>
<a:actionLink value="#{msg.user_console}" image="/images/icons/user_console.gif" showLink="false" action="dialog:userConsole" actionListener="#{UsersBean.setupUserAction}" id="link11_2">
<f:param name="id" value="#{NavigationBean.currentUser.person.id}" />
</a:actionLink>
</td>
<td width=8>&nbsp;</td>
<td><a:actionLink value="#{msg.toggle_shelf}" image="/images/icons/shelf.gif" showLink="false" actionListener="#{NavigationBean.toggleShelf}" /></td>
<td width=8>&nbsp;</td>
<td><a:actionLink value="#{msg.help}" image="/images/icons/Help_icon.gif" showLink="false" href="#{NavigationBean.helpUrl}" target="help" /></td>
<td width=8>&nbsp;</td>
<td><nobr><a href="http://www.alfresco.com/services/support/issues/" target="new"><h:outputText value="#{msg.raise_issue}" /></a></nobr></td>
<td width=8>&nbsp;</td>

View File

@@ -0,0 +1,205 @@
<%--
Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the
License.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_change_password">
<script language="JavaScript1.2">
window.onload = pageLoaded;
function pageLoaded()
{
document.getElementById("edit-my-pass:old-password").focus();
updateButtonState();
}
function updateButtonState()
{
if (document.getElementById("edit-my-pass:password").value.length == 0 ||
document.getElementById("edit-my-pass:old-password").value.length == 0 ||
document.getElementById("edit-my-pass:confirm").value.length == 0)
{
document.getElementById("edit-my-pass:ok-button").disabled = true;
}
else
{
document.getElementById("edit-my-pass:ok-button").disabled = false;
}
}
</script>
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<%-- set the form name here --%>
<h:form acceptCharset="UTF-8" id="edit-my-pass">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#EEEEEE">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width="32">
<h:graphicImage id="wizard-logo" url="/images/icons/edituser_large.gif" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.change_password}" /></div>
<div class="mainSubText"><h:outputText value="#{msg.change_my_password_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<a:errors message="#{msg.error_wizard}" styleClass="errorMessage" />
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td colspan="2"><h:outputText value="#{msg.change_my_password_instructions}" /></td>
</tr>
<tr><td colspan="2" class="paddingRow"></td></tr>
<tr>
<td><h:outputText value="#{msg.username}"/>:</td>
<td>
<h:outputText value="#{UsersBean.person.properties.userName}" />
</td>
</tr>
<tr>
<td><h:outputText value="#{msg.old_password}"/>:</td>
<td>
<h:inputSecret id="old-password" value="#{UsersBean.oldPassword}" size="35" maxlength="1024" validator="#{LoginBean.validatePassword}" onkeyup="updateButtonState();" onchange="updateButtonState();" redisplay="true" />&nbsp;*
&nbsp;<h:message id="errors0" for="old-password" style="color:red" />
</td>
</tr>
<tr>
<td><h:outputText value="#{msg.new_password}"/>:</td>
<td>
<h:inputSecret id="password" value="#{UsersBean.password}" size="35" maxlength="1024" validator="#{LoginBean.validatePassword}" onkeyup="updateButtonState();" onchange="updateButtonState();" redisplay="true" />&nbsp;*
&nbsp;<h:message id="errors1" for="password" style="color:red" />
</td>
</tr>
<tr>
<td><h:outputText value="#{msg.confirm}"/>:</td>
<td>
<h:inputSecret id="confirm" value="#{UsersBean.confirm}" size="35" maxlength="1024" validator="#{LoginBean.validatePassword}" onkeyup="updateButtonState();" onchange="updateButtonState();" redisplay="true" />&nbsp;*
&nbsp;<h:message id="errors2" for="confirm" style="color:red" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.finish_button}" id="ok-button" action="#{UsersBean.changeMyPasswordOK}" styleClass="wizardButton" disabled="true" />
</td>
</tr>
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel_button}" action="dialog:close" styleClass="wizardButton" immediate="true" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
<script>
updateButtonState();
</script>
</r:page>

View File

@@ -162,7 +162,7 @@
<tr><td class="wizardButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.cancel_button}" action="cancel" styleClass="wizardButton" immediate="true" />
<h:commandButton value="#{msg.cancel_button}" action="dialog:close" styleClass="wizardButton" immediate="true" />
</td>
</tr>
</table>

View File

@@ -126,7 +126,7 @@
<tr><td class="dialogButtonSpacing"></td></tr>
<tr>
<td align="center">
<h:commandButton value="#{msg.no}" action="manageUsers" styleClass="dialogControls" />
<h:commandButton value="#{msg.no}" action="dialog:close" styleClass="dialogControls" />
</td>
</tr>
</table>

View File

@@ -0,0 +1,188 @@
<%--
Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the
License.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<r:page titleId="title_user_console">
<f:view>
<%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
<h:form acceptCharset="UTF-8" id="user-console">
<%-- Main outer table --%>
<table cellspacing="0" cellpadding="2">
<%-- Title bar --%>
<tr>
<td colspan="2">
<%@ include file="../parts/titlebar.jsp" %>
</td>
</tr>
<%-- Main area --%>
<tr valign="top">
<%-- Shelf --%>
<td>
<%@ include file="../parts/shelf.jsp" %>
</td>
<%-- Work Area --%>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<%-- Breadcrumb --%>
<%@ include file="../parts/breadcrumb.jsp" %>
<%-- Status and Actions --%>
<tr>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
<td bgcolor="#EEEEEE">
<%-- Status and Actions inner contents table --%>
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
<table cellspacing="4" cellpadding="0" width="100%">
<tr>
<td width=32>
<h:graphicImage id="logo" url="/images/icons/user_console_large.gif" width="32" height="32" />
</td>
<td>
<div class="mainTitle"><h:outputText value="#{msg.user_console_info}" /></div>
<div class="mainSubText"><h:outputText value="#{msg.user_console_description}" /></div>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with gradient shadow --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
</tr>
<%-- Details --%>
<tr valign=top>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
<td valign=top>
<table cellspacing=0 cellpadding=3 border=0 width=100%>
<tr>
<td width="100%" valign="top">
<%-- wrapper comment used by the panel to add additional component facets --%>
<h:panelGroup id="mydetails-panel-facets">
<f:facet name="title">
<%--<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalChange">--%>
<a:actionLink id="actModify1" value="#{msg.modify}" action="" showLink="false" image="/images/icons/Change_details.gif" />
<%--</r:permissionEvaluator>--%>
</f:facet>
</h:panelGroup>
<a:panel label="#{msg.my_details}" id="mydetails-panel" progressive="true" facetsId="mydetails-panel-facets"
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE">
<table cellspacing=2 cellpadding=2 border=0>
<tr>
<td class="propertiesLabel">
<h:outputText value="#{msg.first_name}" />:
</td>
<td>
<h:outputText value="#{UsersBean.person.properties.firstName}" />
</td>
</tr>
<tr>
<td class="propertiesLabel">
<h:outputText value="#{msg.last_name}" />:
</td>
<td>
<h:outputText value="#{UsersBean.person.properties.lastName}" />
</td>
</tr>
<tr>
<td class="propertiesLabel">
<h:outputText value="#{msg.email}" />:
</td>
<td>
<h:outputText value="#{UsersBean.person.properties.email}" />
</td>
</tr>
</table>
<div style="padding:4px"></div>
<%-- context for current user is setup on entry to user console --%>
<a:actionLink id="change-password" value="#{msg.change_password}" action="dialog:changePassword" image="/images/icons/change_password.gif" />
</a:panel>
<div style="padding:4px"></div>
<h:panelGroup id="pref-panel-facets">
<f:facet name="title">
<%--<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="evalChange">--%>
<a:actionLink id="actModify2" value="#{msg.modify}" action="" showLink="false" image="/images/icons/Change_details.gif" />
<%--</r:permissionEvaluator>--%>
</f:facet>
</h:panelGroup>
<a:panel label="#{msg.general_pref}" id="pref-panel" progressive="true" facetsId="pref-panel-facets"
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE">
<table width=100% cellspacing=2 cellpadding=2 border=0>
</table>
</a:panel>
</td>
<td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
<table cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
</td>
</tr>
</table>
</td>
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
</tr>
<%-- separator row with bottom panel graphics --%>
<tr>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</r:page>

View File

@@ -189,11 +189,11 @@
<a:actionLink value="#{msg.modify}" image="/images/icons/edituser.gif" showLink="false" action="editUser" actionListener="#{NewUserWizard.startWizardForEdit}">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
<a:actionLink value="#{msg.change_password}" image="/images/icons/change_password.gif" showLink="false" action="changePassword" actionListener="#{UsersBean.setupUserAction}">
<a:actionLink value="#{msg.change_password}" image="/images/icons/change_password.gif" showLink="false" action="dialog:changePassword" actionListener="#{UsersBean.setupUserAction}">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
<a:booleanEvaluator value="#{r.userName != 'admin'}">
<a:actionLink value="#{msg.delete}" image="/images/icons/delete_person.gif" showLink="false" action="deleteUser" actionListener="#{UsersBean.setupUserAction}">
<a:actionLink value="#{msg.delete}" image="/images/icons/delete_person.gif" showLink="false" action="dialog:deleteUser" actionListener="#{UsersBean.setupUserAction}">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
</a:booleanEvaluator>
@@ -211,7 +211,7 @@
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="adminConsole" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>