Forums / Setup & design / Object name pattern from a Object relations datatype

Object name pattern from a Object relations datatype

Author Message

Leandro Alves

Wednesday 07 February 2007 10:20:59 am

Hello

When I create a new class I would like to have the "Object name pattern:" of this class from an attribute of a Objet relations.

For example:

I created a new class "Student" with two attributes:

<b>First Name [Text line]</b>
Name: First Name
Identifier: first_name

<b>Last Name [Text line]</b>
Name: Last Name
Identifier: last_name

And then I created other new class "School Report" with two other attributes:

<b>Student Name [Object relations]</b>
Name: Student Name
Identifier: student_name

<b>Result [Integer]</b>
Name: Result
Identifier: result

I will relate a student object in the "Student Name".

For the "School Report" class I would like to define the "Object name pattern:" with the first attribute of "Student" class. Does it possible?

By default eZ uses <student_name> as "Object name pattern:" in "School Report" class. I would like something like <student.firstname>.

I appreciate any feedback.

Thanks in advance.

Leandro

Bruce Morrison

Wednesday 07 February 2007 3:35:03 pm

Hi Leandro

I'm 99% certian that you cannot do what you want and will be limited to using the student's full name.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Leandro Alves

Wednesday 07 February 2007 6:36:10 pm

Hi Bruce!

Thanks a lot for your reply.

Do you have any suggestion how I could relate these two class in a different way?

Cheers
Leandro

Bruce Morrison

Wednesday 07 February 2007 8:23:43 pm

Hi Leandro

I don't think there is anything wrong with the way you are relating the content.

I don't understand you you can't use the student object name as the object name of the report. Maybe it's so you don't have both the student and report objects with the same name?

You can use static text the the object name of the report. e.g.

Report for <student>

HTH
Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Leandro Alves

Thursday 08 February 2007 3:04:27 am

Hi Bruce

The relation that I tried would work fine for me... The only problem is when I create a new object "School Report" in the content structure, this object is showed without a name in the content tree, it is showed just a icon without a name for a link. It because the "Object name pattern" of the "School Report" class is an object related.

I could create a new attribute in the "School Report" for the student name even I already have the student's name in the Student class. But after I will need to identify if the "School Report" pertains to the current user that is accessing the site. A student can only see his own report, he cannot see the report of others students. I cannot do that with the rule (Self) because this object will not be created by the student.

For true the "Stuent class" will be the default "User class" of eZ publish, so I will have the "user_id" to compare with the current user.

I'm here just thinking a way how to make it easier...

Thanks for you reply!

Cheers,
Leandro

eZ debug

Timing: Jan 18 2025 16:28:49
Script start
Timing: Jan 18 2025 16:28:49
Module start 'content'
Timing: Jan 18 2025 16:28:50
Module end 'content'
Timing: Jan 18 2025 16:28:50
Script end

Main resources:

Total runtime0.8056 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.9531180.8125
Module start 'content' 0.00650.6822 768.7656570.6797
Module end 'content' 0.68880.1168 1,339.4453337.3516
Script end 0.8055  1,676.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5018210.0002
Check MTime0.00150.1915210.0001
Mysql Total
Database connection0.00070.093010.0007
Mysqli_queries0.731690.81192000.0037
Looping result0.00190.23171980.0000
Template Total0.772995.920.3864
Template load0.00200.247420.0010
Template processing0.770995.692320.3854
Template load and register function0.00020.021710.0002
states
state_id_array0.00150.189710.0015
state_identifier_array0.00150.181420.0007
Override
Cache load0.00170.2157570.0000
Sytem overhead
Fetch class attribute can translate value0.00090.117830.0003
Fetch class attribute name0.00130.158660.0002
XML
Image XML parsing0.00100.119030.0003
class_abstraction
Instantiating content class attribute0.00000.001770.0000
General
dbfile0.00200.2487270.0001
String conversion0.00000.001130.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs