Forums / Developer / Importing external data into Ez

Importing external data into Ez

Author Message

Alex Muñoz

Wednesday 04 May 2011 9:29:48 am

Hi,
Recently, I choosed ezPublish because it has a lot of interesting features with wich I make good projects, but I don't know how to start with a project that I have:
My goal is import mysql data (two tables with a lot of registers) into ezPublish in order to manage them in the ez backend, but I don't know how can I do this.
Could you tell how can I export external data into ezPublish data base and then manage them?
Thanks in advance

Jérôme Vieilledent

Wednesday 04 May 2011 9:47:56 am

Hi Alex and welcome to the eZ Publish community !

The first thing you need to do is to figure out how you will organize your content inside eZ Publish. In short, you need to organize your content tree, maybe by designing custom content classes.

Then, to import your existing data, you can use SQLIImport extension. Check out the extension documentation for more details. You will have to develop a source handler in PHP to handle your data. The easiest way to do so would be to export your MySQL tables in XML files that you can handle in your source handler. Of course, you could also directly connect to your existing database, but it could be trickier (but still possible).

Cheers !

Alex Muñoz

Thursday 05 May 2011 1:21:07 am

Great!!

With this info I can start my project

Thanks a lot!!

Alex Muñoz

Monday 16 May 2011 6:28:00 am

Hi again Jérôme,
I'm trying your extension with an own handler in XML like the example RSSImport but it doesn't work, I'm using the "Request a new immediate import" option but when I choose an import handler (Rss or the new XML) and click in 'Request a new inmediate import" nothing happens and the screen shows:

Import list

 

10 25 50

No imports

I configured my handler in sqlimport.ini.append.php and I created a new class similar than sqlirssimporthandler.php, I think something in the extension doesn't work and I don't know where can I see an error log.

Could you help me?

Thanks a lot

Jérôme Vieilledent

Monday 16 May 2011 6:40:41 am

Hi Alex

Do you have error in the debug output ?

Did you install the extension DB tables ?

Alex Muñoz

Monday 16 May 2011 6:59:16 am

Sorry but I don't know where can I found the output debug
I didnt know about these tables, I find an sql file in sql/mysql/schema.sql folder, I suppose there are the tables, it is correct?

I'm going to try it

Thanks

Jérôme Vieilledent

Monday 16 May 2011 7:11:27 am

Yes these are the tables (as mentioned in INSTALL.txt btw ;-)).

You can activate the debug output from site.ini.append.php, or directly from the right column in the admin interface (in the Quick Settings part)

Alex Muñoz

Monday 16 May 2011 9:12:35 am

I've installed the tables, it seems that works but, the import status is always Pending and 0% of progress.
The debug shows messages like start and end module sqliimport and missing translations 'Debug: ezpI18n::translateText', no errors, e.g.:
"Missing translation for message in context: 'extension/sqliimport/type'. The untranslated message is: 'Immediate'"
I translated your extension in spanish, but I don't know why it doesn't work, because my current language into the CMS is spanish and I didn't found any .ini where I can change the extension current lang.
if you want, I'll send you the translation when I know that it works fine

eZ debug

Timing: Jan 17 2025 23:50:02
Script start
Timing: Jan 17 2025 23:50:02
Module start 'content'
Timing: Jan 17 2025 23:50:03
Module end 'content'
Timing: Jan 17 2025 23:50:03
Script end

Main resources:

Total runtime1.5388 sec
Peak memory usage4,096.0000 KB
Database Queries211

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.7109180.8438
Module start 'content' 0.00611.3499 768.5547588.4453
Module end 'content' 1.35610.1827 1,357.0000341.0625
Script end 1.5388  1,698.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.2623210.0002
Check MTime0.00150.0970210.0001
Mysql Total
Database connection0.00070.048610.0007
Mysqli_queries1.442893.76072110.0068
Looping result0.00230.14972090.0000
Template Total1.514398.420.7572
Template load0.00200.128220.0010
Template processing1.512398.278920.7562
Template load and register function0.00010.007310.0001
states
state_id_array0.00110.072510.0011
state_identifier_array0.00120.078820.0006
Override
Cache load0.00180.1151590.0000
Sytem overhead
Fetch class attribute can translate value0.00140.089530.0005
Fetch class attribute name0.00130.0854100.0001
XML
Image XML parsing0.00140.091230.0005
class_abstraction
Instantiating content class attribute0.00000.0023160.0000
General
dbfile0.00310.2030340.0001
String conversion0.00000.000330.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
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/header.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/header.tplEdit templateOverride template
2content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 39
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs