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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:28:32
Script start
Timing: Jan 18 2025 16:28:32
Module start 'layout'
Timing: Jan 18 2025 16:28:32
Module start 'content'
Timing: Jan 18 2025 16:28:32
Module end 'content'
Timing: Jan 18 2025 16:28:32
Script end

Main resources:

Total runtime0.0181 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 587.7891152.6094
Module start 'layout' 0.00800.0034 740.398439.4141
Module start 'content' 0.01150.0047 779.812593.4141
Module end 'content' 0.01620.0019 873.226638.3047
Script end 0.0181  911.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002513.8862140.0002
Check MTime0.00116.1610140.0001
Mysql Total
Database connection0.00116.301810.0011
Mysqli_queries0.003720.161730.0012
Looping result0.00000.110610.0000
Template Total0.00168.710.0016
Template load0.00084.484810.0008
Template processing0.00084.214810.0008
Override
Cache load0.00063.053510.0006
General
dbfile0.00042.329380.0001
String conversion0.00000.067240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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