Forums / Developer / Browse mecanism

Browse mecanism

Author Message

Maxime Thomas

Wednesday 23 January 2008 4:04:14 am

Hi,

I would like to know if a documentation exists on the browse mecanism used in eZPublish and how to plug it in a custom extension.
If someone have a nice exemple, it would be welcome too !

Thanx.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Ɓukasz Serwatka

Saturday 26 January 2008 2:58:15 pm

Hi,

On PHP level you have to use eZContentBrowse class http://pubsvn.ez.no/doxygen/trunk/html/classeZContentBrowse.html

There are plenty of examples inside eZ Publish kernel folder (kernel/classes/datatypes). You can look on examples there.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Maxime Thomas

Wednesday 30 January 2008 2:07:39 am

Thanks, it works...
Maybe we can put this in the eZPedia.

Cheers.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Maxime Thomas

Thursday 14 February 2008 9:04:30 am

Hi,

I've got another problem. I wished to improve my module by adding a new select button but I haven't expected the following beahviour : each button are working well, they provide the select interface I have chosen, but when used sequencially, I cannot dissociate it.

In my module :

$browse_result_1 = eZContentBrowse::result("select1");
$browse_result_2 = eZContentBrowse::result("select2");

eZDebug::writeDebug($browse_result_1);
eZDebug::writeDebug($browse_result_2);

if (isset($browse_result_1[0]) and $browse_result_1 != '')
{
	$selected_node_1 = $browse_result_1[0];
}

if (isset($browse_result_2[0]) and $browse_result_2 != '')
{
	$selected_node_2 = $browse_result_2[0];
}

if ($http->hasVariable('Select1'))
{
	eZContentBrowse::browse( array( 'action_name' => 'Select1', 'from_page' => 'module/function'), $module );
}
else if ($http->hasVariable('Select2') and $selected_node_1!=0)
{
	eZContentBrowse::browse( array( 'action_name' => 'Select2', 'from_page' => 'module/function/'.$selected_node_1), $module );
}

And in my browse.ini :

[Select1]
StartNode=images
SelectionType=single
ReturnType=NodeID

[Select2]
StartNode=images
SelectionType=single
ReturnType=NodeID

And in the debug, I have $browse_result_1 and $browse_result_2 are the same even if I have not clicked in the second button. Where is my mistake ?

Cheers.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

eZ debug

Timing: Jan 30 2025 21:37:24
Script start
Timing: Jan 30 2025 21:37:24
Module start 'content'
Timing: Jan 30 2025 21:37:24
Module end 'content'
Timing: Jan 30 2025 21:37:24
Script end

Main resources:

Total runtime0.2478 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.8047370.3125
Module start 'content' 0.00610.0138 958.11721,005.5938
Module end 'content' 0.01990.2279 1,963.71093,893.6250
Script end 0.2477  5,857.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00421.6914200.0002
Check MTime0.00130.5063200.0001
Mysql Total
Database connection0.00050.217510.0005
Mysqli_queries0.152761.63491410.0011
Looping result0.00170.69501390.0000
Template Total0.227591.810.2275
Template load0.00070.286910.0007
Template processing0.226891.513210.2268
Override
Cache load0.00050.196610.0005
Sytem overhead
Fetch class attribute can translate value0.00170.705410.0017
XML
Image XML parsing0.00020.094910.0002
General
dbfile0.00933.7565200.0005
String conversion0.00000.001530.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs