Share » Forums » Developer » Help required for updating the eZ...

Help required for updating the eZ publish database from external application.

Help required for updating the eZ publish database from external application.

Monday 14 February 2005 1:15:27 pm - 13 replies

Author Message

Gabriel Ambuehl

Tuesday 15 February 2005 12:00:35 am

Look into ezcontentobject and ezcontentobjectattribute tables for starters. The schema is pretty complex to implement yourself, but interfacing to PHP code isn't possible from VB for all I know.

Maybe you could write some PHP code that reads a CSV or somethingl ike that and have VB output such?

Visit http://triligon.org

Olivier Pierret

Tuesday 15 February 2005 3:04:28 am

Hello,

I am not a specialist of EZ Publish yet and if somoeone from EZ-Team could review this post and possibly amend the content, this would be interesting for every one.

My opinion is that writing directly in the EZ database is not a good idea for the following reasons:
- while doing this, you actually bypass the abstraction layer of EZ Publish hence you might insert wrongly formatted data that later may appear unusable or you can event corrupt your database
- if you upgrade to a newer version of EZ Publish, the database structure might change and would make your import script not working anymore (data corrupting again is a possibility in this case)
- If you change the database (mysql to Oracle for instance) you might have to rework your script procedure

An alternate way to import data into ez-publish would be to export your external data to XML and then write a procedure as an extension that will parse this XML files and import the content as a series of ez publish objects.

I have written and tested such an extension. I consider contribute this code to the community if some people find it useful but it is not packaged yet.

Thank you for any feedback on this

regards

Olivier

 

Paulo Almeida

Tuesday 15 February 2005 8:17:01 am

I'm not favor to write in DB directly, but i'm favor to read data from DB.

My needs ate the moment for example:

I have a intranet working with ez, now i need to access DB directly to any report designer (Crystal Reports, JasperReports , etc), and a public schema helps a lot.
I know i can write a template for this, but i want give to the user the chance of change the report for their needs in the moment withou my interference.

Regards,
Paulo Almeida
PACPI.COM

PACPI.COM Internet Consulting
http://pacpi.com

Gabriel Ambuehl

Tuesday 15 February 2005 8:47:31 am

Olivier: I'd love to see such code contributed!

Visit http://triligon.org

Megha Barpande

Tuesday 15 February 2005 12:52:37 pm

Hi Olivier,

Thanks for the suggestion. Can you please contribute that code to community and also assist where I can find it? It would be a great help really.

Thanks,
Megha B

Olivier Pierret

Wednesday 16 February 2005 12:26:33 am

Hello

I will try to contribute the code on this site but I don't know yet how to contribute in the right section right now. I am asking the webmaster on how to do it...

Alternately in the mean time you could provide me email adresses where I could send you a zip of the module I wrote. I am not sure this is in the policy of this forum however. Let me know how to do.

It is definitely not practicable to write down the complete files here below.

rgds

Olivier

Olivier Pierret

Wednesday 16 February 2005 12:32:04 am

Hello

I will try to contribute the code on this site but I don't know yet how to contribute in the right section right now. I am asking the webmaster on how to do it...

Alternately in the mean time you could provide me email adresses where I could send you a zip of the module I wrote. I am not sure this is in the policy of this forum however. Let me know how to do.

It is definitely not practicable to write down the complete files here below.

rgds

Olivier

Gabriel Ambuehl

Wednesday 16 February 2005 1:15:54 am

You should probably upload the files to http://ez.no/community/contribs/import_export (there's a button at the bottom of the page). Quite simple, really.

ZIPs or tars are preferred so that everything's together.

Visit http://triligon.org

Olivier Pierret

Wednesday 16 February 2005 1:17:38 am

OK the code is available in :
http://ez.no/community/contribs/import_export

I forgot to mention in the contrib that the upload form should be accessible at

admin/importXMLData/form.php

Please feel free to cut and paste the useful part of the code into your own code if necessary. Well If you cut and paste dont forget to cut and paste the GPL License and copyright of course :).

Good luck

Olivier

Olivier Pierret

Wednesday 16 February 2005 6:08:34 am

New version uploaded - the previous one might not work due to last minute folder name changes.
O.

Megha Barpande

Wednesday 16 February 2005 12:22:52 pm

Hi Olivier,

Thanks for the help. I'm sure that I'll be able to workout something.

Regards,
Megha B

Megha Barpande

Wednesday 16 February 2005 1:30:00 pm

Hi Olivier,

Thanks for the code once again. I think its good and will definitely solve our issue. Just a couple of things. Is this code compatible with version 3.4.4 (we are using this version)?

Also we have three fields of datatype ezselection so will it work?

My VB application can generate the XML and I've identified all the values that will be required to create the object. But I'm still a little nervous how to upload this XML file or how the CMS will pick it up. I mean what will be the exact interface?

I'm totally new in this whole development process. I'm experienced using VB and ASP however have almost a negative knowledge in PHP. Please be patient with me.

Regards,
Megha B

Olivier Pierret

Thursday 17 February 2005 1:29:03 am

Hello Megha,

Here is my answers

Version 3.4.4: not tested but should work

Datatype ezselection: Unfortunately i don't think it would work like this: I guess selection values are encoded as index into the attribute and not as actual text value but not sure. If you give a try, please back up your data first!

Upload interface: the file form.tpl in the design/importXMLData directory implement the HTML form that will used to upload the file. You should be able to access the form at the url: http://<your_site>/index.php/admin/importXMLData/form.

Good luck

Olivier

PS: I notice that in the import/export contribs there is another module that looks like doing the same job but i didn't dig into it. Maybe you could have a look and select which one is best fit for you.

 

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu