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

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 02:12:51
Script start
Timing: Jan 18 2025 02:12:51
Module start 'layout'
Timing: Jan 18 2025 02:12:51
Module start 'content'
Timing: Jan 18 2025 02:12:52
Module end 'content'
Timing: Jan 18 2025 02:12:52
Script end

Main resources:

Total runtime0.7014 sec
Peak memory usage4,096.0000 KB
Database Queries74

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.0313152.6250
Module start 'layout' 0.00580.0027 741.656339.4531
Module start 'content' 0.00840.6916 781.1094585.2891
Module end 'content' 0.70000.0014 1,366.398420.1641
Script end 0.7014  1,386.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4517160.0002
Check MTime0.00140.1989160.0001
Mysql Total
Database connection0.00080.115510.0008
Mysqli_queries0.622388.7131740.0084
Looping result0.00080.1143720.0000
Template Total0.674996.220.3375
Template load0.00230.323820.0011
Template processing0.672695.893020.3363
Template load and register function0.00010.018410.0001
states
state_id_array0.00080.118310.0008
state_identifier_array0.00080.115520.0004
Override
Cache load0.00190.2769590.0000
Sytem overhead
Fetch class attribute can translate value0.00070.093020.0003
Fetch class attribute name0.00170.2377100.0002
XML
Image XML parsing0.00280.396620.0014
class_abstraction
Instantiating content class attribute0.00000.0059160.0000
General
dbfile0.00280.4048230.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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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