cancel
Showing results for 
Search instead for 
Did you mean: 

How to extend the user model?

lista
Star Contributor
Star Contributor
I'd like someone who already dealt with this to give me an advice.
How would you extend the user model, or to put it in another words, how would you add your own custom properties to the user?
Obviously, the original contentModel.xml should not be modified.

All advices are welcome.

Cheers,
Lista.
23 REPLIES 23

inocka
Champ in-the-making
Champ in-the-making
I several questions:
Maybe Alfresco Explorer has default user disabling parameter like alfresco share has?
And where I could read more or may be you could tell me more about adding that as:IsClubMember aspect action.
What I have at the moment: testUser.xml where aspects are defined (like in forum issue) and test-context.xml for registration.
That my next steps should be?

Thanks for you help

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
about diableing user you can do that with.

authenticationService.setAuthenticationEnabled(userName, false);
authenticationService.setAuthenticationEnabled(userName, true);

inocka
Champ in-the-making
Champ in-the-making
What should be done to see custom aspect in person information (Alfresco Explorer)?

Thanks a lot

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
you go to edit user and you will see thoose, because in that dialog you have <rSmiley TongueropertySheetGrid , witch shows all props on a node( in this case user)

inocka
Champ in-the-making
Champ in-the-making
I checked that part already and didn't find it. In addition to what I have done before I write custom dialog. My dialog which adds the aspect code:

NodeRef nodeRef = Application.getCurrentUser(FacesContext.getCurrentInstance()).getPerson();
      
      if (!this.getNodeService().hasAspect(nodeRef,
            MyContentModel.ASPECT_INFO)) {
         Map<QName, Serializable> vInfoProps = new HashMap<QName, Serializable>();
         vCardProps.put(MyContentModel.PROP_1,
               this.number);

         // add the aspect to the space
            this.getNodeService().addAspect(nodeRef,
                  MyContentModel.ASPECT_INFO, vInfoProps );
            // if the above calls were successful, then reset Person Node in the session
               Application.getCurrentUser(context).reset();
      }
What I am missing?

inocka
Champ in-the-making
Champ in-the-making
Thanks,
I found that <config evaluator="aspect-name" … part was missing. Thanks everyone

inocka
Champ in-the-making
Champ in-the-making
I want to show disable user button in users.jsp Alfresco explorer only for active users. How to do that?

Thanks a lot

about diableing user you can do that with.

authenticationService.setAuthenticationEnabled(userName, false);
authenticationService.setAuthenticationEnabled(userName, true);

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Takes a bit of know how in order to do this.


<a:actionLink value="#{msg.modify}" image="/images/icons/edituser.gif" showLink="false" action="dialog:somedialog" actionListener="#{DialogManager.bean.setupUserAction}">
<f:param name="id" value="#{r.id}" />
</a:actionLink>

define your dialog and that is all, have a look how delete user is done and you fill fix this in 30min max.

inocka
Champ in-the-making
Champ in-the-making
I already implemented the disable action and it works fine. My question was how to show that action only for active user. I don't want to see actionLink disable if user was already disabled. Thanks in advance

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
you can create to  have rendered="!r.disabled"