06-14-2011 08:56 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<!– *************************************************************** –>
<!– Empty JSF config file to prevent errors being thrown during JSF –>
<!– initialisation. Overwrite this file with your custom version. –>
<!– *************************************************************** –>
<navigation-rule>
<description>
The decision rule used by the NavigationHandler to
determine which view must be displayed after the
current view, login.jsp is processed.
</description>
<from-view-id>/jsp/extension/login.jsp</from-view-id>
<navigation-case>
<description>
Indicates to the NavigationHandler that the browse.jsp
view must be displayed if the Action referenced by a
UICommand component on the login.jsp view returns
the outcome "success".
</description>
<from-outcome>success</from-outcome>
<to-view-id>/jsp/browse/browse.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!– rule to get back to the login page from anywhere –>
<navigation-rule>
<from-view-id>/jsp/*</from-view-id>
<navigation-case>
<from-outcome>logout</from-outcome>
<to-view-id>/jsp/extension/login.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>relogin</from-outcome>
<to-view-id>/jsp/extension/relogin.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
<description>
The bean that backs up the Login screen
</description>
<managed-bean-name>LoginBean</managed-bean-name>
<managed-bean-class>org.alfresco.module.CustomLoginBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>authenticationService</property-name>
<value>#{AuthenticationService}</value>
</managed-property>
<managed-property>
<property-name>personService</property-name>
<value>#{PersonService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>userPreferencesBean</property-name>
<value>#{UserPreferencesBean}</value>
</managed-property>
</managed-bean>
</faces-config>
package org.alfresco.module;
import java.util.Date;
import org.alfresco.web.bean.LoginBean;
import org.apache.log4j.Logger;
public class CustomLoginBean extends LoginBean
{
/**
* Log variable
*/
private Logger logger = Logger.getLogger(CustomLoginBean.class);
@Override
public String login()
{
logger.debug("LOGIN has logged in at " + new Date());
String outcome = super.login();
// log to the console who logged in and when
String username = this.getUsername();
if (username == null)
{
username = "Guest";
}
return outcome;
}
@Override
public String logout()
{
String outcome = super.logout();
// log to the console who logged out and when
String username = this.getUsername();
if (username == null)
{
username = "Guest";
}
logger.debug(username + " logged out at " + new Date());
return outcome;
}
}
log4j.logger.org.alfresco.module.CustomLoginBean=debug
07-08-2011 03:41 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.