09-15-2011 12:31 PM
package org.alfresco.module.wizard;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.users.CreateUserWizard;
public class CustomCreateUserWizard extends CreateUserWizard
{
private static final long serialVersionUID = -1306020805717363794L;
protected PersonService personService;
/**
* @param personService The person service.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
/**
* @return personService
*/
private PersonService getPersonService()
{
if (personService == null)
{
personService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPersonService();
}
return personService;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Throwable
{
System.out.println("— start new User wizard —");
super.finishImpl(context, outcome);
NodeRef newPerson = this.getPersonService().getPerson(this.getUserName());
System.out.println("— nodeRef de newPerson : "+ newPerson +" —");
return outcome;
}
}
<?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 overright Create User Wizard
</description>
<managed-bean-name>CustomCreateUserWizard</managed-bean-name>
<managed-bean-class>org.alfresco.module.wizard.CustomCreateUserWizard</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>searchService</property-name>
<value>#{SearchService}</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>authenticationService</property-name>
<value>#{authenticationService}</value>
</managed-property>
<managed-property>
<property-name>permissionService</property-name>
<value>#{PermissionService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
<managed-property>
<property-name>personService</property-name>
<value>#{PersonService}</value>
</managed-property>
<managed-property>
<property-name>ownableService</property-name>
<value>#{OwnableService}</value>
</managed-property>
<managed-property>
<property-name>tenantService</property-name>
<value>#{tenantService}</value>
</managed-property>
</managed-bean>
</faces-config>
<alfresco-config>
<config>
<wizard name="createUser"
managed-bean="CustomCreateUserWizard"
title-id="custom_new_user_title"
description-id="new_user_desc"
icon="/images/icons/new_user_large.gif">
<step name="person-properties"
title-id="person_properties"
description-id="new_user_step1_desc">
<page
path="/jsp/users/new-user-wizard/person-properties.jsp"
title-id="new_user_step1_title"
description-id="new_user_step1_desc"
instruction-id="default_instruction" />
</step>
<step name="user-properties" title-id="user_properties"
description-id="new_user_step2_desc">
<page
path="/jsp/users/new-user-wizard/new-user-properties.jsp"
title-id="new_user_step2_title"
description-id="new_user_step2_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary"
description-id="summary_step_description">
<page path="/jsp/wizard/summary.jsp"
title-id="summary" description-id="summary_desc"
instruction-id="new_user_finish_instruction" />
</step>
</wizard>
</config>
</alfresco-config>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="CustomCreateUserWizard_ConfigBootstrap" class="org.alfresco.web.config.WebClientConfigBootstrap" init-method="init">
<property name="configs">
<list>
<value>classpath:alfresco/module/CustomCreateUserWizard/web-client-config-custom.xml</value>
</list>
</property>
</bean>
</beans>
09-16-2011 08:27 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.