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.

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 05:11:06
Script start
Timing: Jan 18 2025 05:11:06
Module start 'layout'
Timing: Jan 18 2025 05:11:06
Module start 'content'
Timing: Jan 18 2025 05:11:06
Module end 'content'
Timing: Jan 18 2025 05:11:06
Script end

Main resources:

Total runtime0.8797 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 588.0469152.6406
Module start 'layout' 0.00740.0022 740.687539.4766
Module start 'content' 0.00960.8685 780.1641488.0234
Module end 'content' 0.87820.0015 1,268.187512.1250
Script end 0.8797  1,280.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3844160.0002
Check MTime0.00140.1546160.0001
Mysql Total
Database connection0.00160.185210.0016
Mysqli_queries0.824793.7421600.0137
Looping result0.00050.0592580.0000
Template Total0.850096.620.4250
Template load0.00190.215920.0009
Template processing0.848196.401820.4240
Template load and register function0.00040.048310.0004
states
state_id_array0.00090.104210.0009
state_identifier_array0.00070.080420.0004
Override
Cache load0.00170.1894390.0000
Sytem overhead
Fetch class attribute can translate value0.00080.094520.0004
Fetch class attribute name0.00120.131340.0003
XML
Image XML parsing0.00020.026620.0001
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00070.0840100.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs