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.

eZ debug

Timing: Jan 19 2025 06:24:46
Script start
Timing: Jan 19 2025 06:24:46
Module start 'content'
Timing: Jan 19 2025 06:24:47
Module end 'content'
Timing: Jan 19 2025 06:24:47
Script end

Main resources:

Total runtime0.7734 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.0859180.8125
Module start 'content' 0.00600.6451 769.8984614.7031
Module end 'content' 0.65110.1222 1,384.6016341.0547
Script end 0.7733  1,725.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5038210.0002
Check MTime0.00150.1951210.0001
Mysql Total
Database connection0.00070.084710.0007
Mysqli_queries0.696890.09832050.0034
Looping result0.00220.28732030.0000
Template Total0.745196.320.3725
Template load0.00210.277120.0011
Template processing0.742996.056720.3715
Template load and register function0.00020.030810.0002
states
state_id_array0.00080.100110.0008
state_identifier_array0.00100.130720.0005
Override
Cache load0.00170.2208530.0000
Sytem overhead
Fetch class attribute can translate value0.00150.189640.0004
Fetch class attribute name0.00110.142970.0002
XML
Image XML parsing0.00110.136840.0003
class_abstraction
Instantiating content class attribute0.00000.002680.0000
General
dbfile0.00360.4616280.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs