Forums / Developer / Extension : form + own php logic + result page

Extension : form + own php logic + result page

Author Message

Alexandre Henriet

Thursday 30 July 2009 5:14:20 am

Hi,

I need to create an extension allowing me to do :

- Somewhere on an existing page (or on a specific one created for that purpose if it's easier),
I need to display a form containing input text fields and select boxes.

- When the form is posted, I need to be able to validate input (own php logic)
and redisplay the form with posted data if data does not fit.

- If submitted data is ok, a rest webservice must be called (own php logic)
using post values as parameters.

- The XML returned by the webservice must be parsed and displayed on a result specific page
(own php logic).

I only have basic knowledge about eZ Publish and I cannot figure out how to realize this ..

I don't find the answer to my problem in the documentation, and I have not found an example
doing something similar ..

Could someone try to explain me briefly the different steps I need to go through ?
Or redirect me to a relevant documentation or example ?

Thx in advance,
Alexandre

PS: I have read the documentation concerning form creation (information collectors),
but in my case, posted data don't have to be stored .. and it would be nice if the whole module
could be in one extension ..

Clemens T

Thursday 30 July 2009 5:33:11 am

This is a very good presentation for that purpose, I won't go into details, but reading through the presentation will help you develop more specific follow-up questions:

*for you it seems that aside from the intro the 'Module Extension' section is most important.

http://sandro.groganz.com/mediawiki/images/f/fc/Extensions_SG_Camp_2005.pdf

A more article-like source is:

http://ez.no/es/layout/set/printarticle/developer/articles/an_introduction_to_developing_ez_publish_extensions

What eZPublish version are you using?

Greets,
Clemens

Alexandre Henriet

Thursday 30 July 2009 6:01:09 am

@Clemens,

Thanks for answering so quickly and for the 2 links ;)

We are using a brand new 4.1.3 for that project.

Alex

Clemens T

Thursday 30 July 2009 6:24:24 am

No problem at all, let me (and others) know if you have any problems understanding the logic / ezpublish system.

eZ debug

Timing: Jan 18 2025 02:50:47
Script start
Timing: Jan 18 2025 02:50:47
Module start 'content'
Timing: Jan 18 2025 02:50:48
Module end 'content'
Timing: Jan 18 2025 02:50:48
Script end

Main resources:

Total runtime0.8335 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.8438180.8125
Module start 'content' 0.00610.7111 768.6563493.1172
Module end 'content' 0.71720.1161 1,261.7734333.4688
Script end 0.8334  1,595.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4520210.0002
Check MTime0.00140.1661210.0001
Mysql Total
Database connection0.00090.113310.0009
Mysqli_queries0.769892.36401970.0039
Looping result0.00170.20421950.0000
Template Total0.804296.520.4021
Template load0.00190.223920.0009
Template processing0.802396.263720.4012
Template load and register function0.00030.040310.0003
states
state_id_array0.00080.094810.0008
state_identifier_array0.00100.114620.0005
Override
Cache load0.00160.1893390.0000
Sytem overhead
Fetch class attribute can translate value0.00110.135430.0004
Fetch class attribute name0.00110.130340.0003
XML
Image XML parsing0.00050.060130.0002
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00370.4453210.0002
String conversion0.00000.000630.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
4content/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
9content/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: 28
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs