Modification de CreateUserWizard

cancel
Showing results for 
Search instead for 
Did you mean: 
nathservice
Member II

Modification de CreateUserWizard

Bonjour,

j'aimerai (et je n'arrive pas…) à modifier le wizard CreateUserWizard.
J'ai utilisé le wiki comme exemple : http://wiki.alfresco.com/wiki/Customising_The_Create_Content_Wizard  Qui ne me parraisait pas insurmontable…

Pour cela, j'ai crée :
           CustomCreateUserWizard.java qui étend CreateUserWizard ( sert seulement de test pour le moment…)
           faces-config.xml où j'ai modifié le "managed-bean-name" ainsi que "managed-bean-class"
           web-client-config-custom.xml pour re-déclarer le wizard en modifiant > managed-bean="CustomCreateUserWizard"
           module-context.xml

Tout cela dans un package Amp, application du package, restart du serveur,et….. rien…

Quand je crée un nouvel utilisateur depuis la console d'administration, il n'y a pas d'affichage dans ma console eclipse…

J'ai fais les tests (mettre des erreurs syntaxiques ) nécessaires pour être sur que faces-config.xml, web-client-config-custom.xml soient bien pris en compte, donc je ne comprend pas pourquoi je n'arrive pas à overridder (ou étendre) le wizard…

Si je mis prend mal, ou si quelqu'un aurai une idée, je suis preneur.

Merci d'avance.


Si dessous les fichiers et je suis sur la version alfresco comunity 3.4d

CustomCreateUserWizard.java

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;
    }
}



faces-config.xml

<?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>



web-client-config-custom.xml

<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>



module-context.xml

<?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>
1 Reply
nathservice
Member II

Re: Modification de CreateUserWizard

je me répond  à moi même…

je n'avais pas mis les balises <wizards> </wizards>  :roll:


Ca tourne mieux maintenant…  :?