Forums / Developer / Relating classes to each other - user profile

Relating classes to each other - user profile

Author Message

steve walker

Wednesday 27 April 2005 7:15:57 am

Hi EzPublish Crew,

We have a bit of a problem - and hopefully you can advise here.

My colleague Fabricio asked about this issue a while ago (http://www.ez.no/community/forum/developer/user_handling) .

Basically we have generated a site which has profiles for contractors - their profiles are huge and have about 100 attributes. The dirty fix (given that noone was forthcoming with class 'innerjoining' techniques) was to create one huge class.

This is fine in principle, except logging in as a user and trying to change your profile creates massive delays as Ez tries to update the mammoth class.

Surely there is some way to split up a class and have it so that your user class lets you authenticate and then update, say, your personal details class??

If you could advise on this we'd really appreciate it - we're having to stall on go-live dates as there is no way the client will accept the sites current slow responses.

Thanks, Steve.

http://www.oneworldmarket.co.uk

Bård Farstad

Wednesday 27 April 2005 7:31:16 am

Steve, what you are describing does indeed sound like a problem. Using eZ publish classes with 100 attribues is not a good thing, since they system is not designed for this. It's meant to work with a lower number of attributes pr class than this.

If you can split this up into some smaller classes that would be much better. Lets say whenever a user is created you also create objects containing personal information. These could be made empty by default and the users would have permission to edit them. Links to edit them could be provided via the user profile page.

Mabye create a small workflow which automatically creates the needed objects when a user is registered.

Not sure if this is the solution you were looking for?

--bård

Documentation: http://ez.no/doc

steve walker

Wednesday 27 April 2005 7:40:02 am

Bard,

Thanks for your reply.

<i>If you can split this up into some smaller classes that would be much better. Lets say whenever a user is created you also create objects containing personal information. These could be made empty by default and the users would have permission to edit them. Links to edit them could be provided via the user profile page.</i>

This is exactly what we'd like to do.

So the only way to create the empty objects is via a workflow? If so, how does this work - and how do we link them together...? I've seen the 'user account' attribute in the class options.

Essentially, in non-Ez speak ;), how do we achieve the 'inner join' process between the related classes?

Thanks, Steve

http://www.oneworldmarket.co.uk

Bård Farstad

Wednesday 27 April 2005 7:46:58 am

Steve,

workflows is not the only way of doing this. You could alternatively create a module which handled "personal/account information". When you clicked on "edit my personal info A" it creates the object on fly and stores the relation to it.

If you use a workflow you can create the objects on creation of the user but with empty/default values. You can store these classes in a hierarcy like:
/ user accounts/ user John doe / personal settings A
/ user accounts/ user John doe / personal settings B
/ user accounts/ user John doe / personal settings C

Create the objects under the user account, that way you can dynamically fetch then when you know the user. Create the objects as the user, so you can set permissions on edit by owner.

Was this clear? ;)

--bård

Documentation: http://ez.no/doc

steve walker

Wednesday 27 April 2005 8:31:09 am

Bard,

Yes - I think we're clear. Rather than get involved in creating modules, I think using workflows is going to be easier..?

Our plan of attack is:

1. create the classes (personal details, professional history etc) that split the data in managemeable chunks

2. add to the current user register work flow (at point when the user clicks register) instructions to insert the new classes under the users node

3. adjust out templates so they use the new classes when editing profile details.

Sounds far too easy to me!

Does all this sound OK?

Thanks, Steve

http://www.oneworldmarket.co.uk

Aladdin Mouhaimeed

Tuesday 09 August 2005 10:11:12 am

Bard, Steve,
Can anybody of you give us more details and explanation on his won suggested way?

I guess this problem is a very important one.
For me, and I guess hte others, I have converted to eZ because I believed, and still believe, I can make proffesional forms using it.

Then please share your experience.