cancel
Showing results for 
Search instead for 
Did you mean: 

Custom New User Creation

ivo_costa
Champ in-the-making
Champ in-the-making
Hi

I'm trying to make some changes to Alfresco, so that when a new user is created, a notification eMail is sent to the user with his username and password. And Later I may try to set the password randomly.

I've been trying to find a easy way to do this, but until now I only got the idea that I must change NewUserWizard
I also started to think… Correct me if I'm wrong, in Alfresco every content, person, etc, is a node, so is it possible to set a behaviour on a new user creation?

I'd appreciate any help I can get… what can I do? what steps to take?? etc….


Thanks in Advance
6 REPLIES 6

zaizi
Champ in-the-making
Champ in-the-making
Would suggest that you adding an extra step to new user creation wizard which asks the admin to confirm the email to send out. This is similar to email option when you invite a user to a space. This gives the admin the option to customise and add any comments to the email.

This is assuming you are only creating users through the wizard.

ivo_costa
Champ in-the-making
Champ in-the-making
thanks for the suggestion zaizi i really appreciate it but unfortunately I can find the steps definition for NewUserWizard
I've tryed to take a look at http://wiki.alfresco.com/wiki/Customising_The_Create_Content_Wizard but there's no NewUserWizard definition in web-client-config-wizards.xml

and so I'm still stuck  :?

thanks for your reply

zaizi
Champ in-the-making
Champ in-the-making
This is the new user wizard configuration from web-client-config-wizards.xml. What version of Alfresco are you using?


         <wizard name="createUser"
               managed-bean="CreateUserWizard"
               title-id="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>

ivo_costa
Champ in-the-making
Champ in-the-making
My mistake… I was looking for NewUserWizard… I'll look for createUser
I'm using alfresco 2.2E…

edit: still can't find it
I was looking forward to make this as an additional step instead of a behavior

thanks

zaizi
Champ in-the-making
Champ in-the-making
My mistake. In 2.2E the create wizard is defined as an face navigation. It is in ./alfresco/tomcat/webapps/alfresco/WEB-INF/faces-config-navigation.xml.

The snippet is included below. This means you are going to have to do it the manual way or change it to use the wizard framework. The class that deals with the wizard creation is org.alfresco.web.bean.wizard.NewUserWizard. You'll need to add another step in the java code to do the emailing.


   protected String determineOutcomeForStep(int step)
   {
      String outcome = null;

      switch (step)
      {
         case 1:
         {
            outcome = "person-properties";
            break;
         }
         case 2:
         {
            outcome = "user-properties";
            break;
         }
         case 3:
         {
            outcome = "summary";
            break;
         }
         default:
         {
            outcome = CANCEL_OUTCOME;
         }
      }

      return outcome;
   }


   <navigation-rule>
      <from-view-id>/jsp/wizard/new-user/*</from-view-id>
      <navigation-case>
         <from-outcome>cancel</from-outcome>
         <to-view-id>/jsp/users/users.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>finish</from-outcome>
         <to-view-id>/jsp/users/users.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>person-properties</from-outcome>
         <to-view-id>/jsp/wizard/new-user/person-properties.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>user-properties</from-outcome>
         <to-view-id>/jsp/wizard/new-user/user-properties.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
         <from-outcome>summary</from-outcome>
         <to-view-id>/jsp/wizard/new-user/summary.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

ivo_costa
Champ in-the-making
Champ in-the-making
Thanks…
I'll give it a try