ezodf : importing an .odt section

Author Message

Pascal France

Saturday 08 May 2010 7:50:54 am

Hi,

In the PDf doc of the ezodf extension it is said that we can define a section in the .odt file and then import it in a specific class attribute.

I've defined an «intro» section in my .odt document which contains a simple ligne of text.

My class «article» contains an attribute «intro»

But I don't understand what I need to configure in odf.ini.append.php to import the content of the .odt intro section in the intro attribute of the class.

Thanks for your help

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Saturday 08 May 2010 11:28:44 am

Hi Pascal,

Did you check on http://share.ez.no/tutorials/ez-publish/import-export-from-odf/%28page%29/3 and the link mentioned there to http://ez.no/doc/extensions/odf_import_export ? If you check the odf.ini.append.php file in a default install you will also see how to accomplish this.

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Saturday 08 May 2010 2:28:33 pm

Hi Robin,

Thanks for your reply.

In your first link, all seems clear: on the left, the class attribute, on the right, the odt section name... This is what we can understand reading the comments in the odf.ini file.

So, here is my odf.ini section:

ClassAttributeMappingToHeader=enabled

[frontpage]
DefaultImportTitleAttribute=name
DefaultImportBodyAttribute=corps_article
Attribute[name]=name
Attribute[intro]=intro
Attribute[corps_article]=body
Attribute[image]=image
Attribute[caption]=caption
Attribute[publish_date]=publish_date
Attribute[unpublish_date]=unpublish_date

In fact, what I don't understand is that the first two lines are mandatory because otherwise I obtain a PHP fatal error message and, consequently, all other lines are strictly useless and can be removed without effect.

Here is where I am.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Sunday 09 May 2010 11:19:30 am

Hi Pascal,

Are you saying that with the ini configuration posted above the import is not working? The intro section from the odt document is not imported to the intro attribute of your content class/object?

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Sunday 09 May 2010 2:49:13 pm

Hi Robin,

Yes. You have absolutely well understood what I've meant.

The only config which works is:

[frontpage]
DefaultImportTitleAttribute=name
DefaultImportBodyAttribute=corps_article

Nothing else is needed and nothing else works. The Attribute[xxx]=xxxx lines are totally useless.

Cordially,

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Wednesday 12 May 2010 11:41:46 am

Time to take a step back, what if you try to export/import with a default class, if you have any available on the site? Does that work? What I would like to know is if export/import works at all.

-- Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Friday 14 May 2010 5:02:16 pm

Hi Robin,

Sorry for the delay...

Well, here is my environment:

Debian 2.6.32.3 x86_64 GNU/Linux
mysql-server 5.1.46-1
php5 5.2.11.dfsg.1-2
apache2 2.2.15-2
eZ Publish 4.3.0 with ezComponents from scratch
Website Interface (ez webin)
Admin2 interface

My ODT document:

  1. An «intro» section which contains:
    Mon intro
  2. A «body» section which contains:
    Titre 2
    Pascal

When I import this document, I get a new article where "Mon intro" and "Titre2 - Pascal" are both in the body attribute of my article class object.

Normally, I should obtain an article which contains:

  1. "Mon intro" in its default intro attribute
  2. "Titre2 - Pascal" in its default body attribute

Does it answer your question ?

The sections in my ODT document are realised with "Insert" -> "Section..." and I give a name to my section.

Cordially,

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Sunday 16 May 2010 10:53:19 am

Hi Pascal,

How did you name the sections on your odt file? I assume with a matching name you set in the ini file? It's a difficult problem to tackle, I'm in doubt if this is a bug some kind of other problem.

-- Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Sunday 16 May 2010 4:22:59 pm

Hi Robin,

Here is 3 screenshots illustrating how I create a section in an .odt document:

http://linuxorable.fr/test/ODT/ODT_section_1.png

http://linuxorable.fr/test/ODT/ODT_section_2.png

http://linuxorable.fr/test/ODT/ODT_section_3.png

In this example I create a section named «intro» because the default class used to create an object via «Import odt document» contains an «intro» attribut. Moreover, the default /extension/ezodf/settings/odf.ini.append.php file contains:

[article]
DefaultImportTitleAttribute=title
DefaultImportBodyAttribute=body
Attribute[title]=title
Attribute[intro]=intro  <======== THIS LINE
Attribute[body]=body
Attribute[image]=image
Attribute[caption]=caption
Attribute[publish_date]=publish_date
Attribute[unpublish_date]=unpublish_date

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Tuesday 18 May 2010 11:46:57 am

Hi Pascal,

Everything looks ok to me, I'm out of ideas. I'll ask for some help on this one.

Regards Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Tuesday 18 May 2010 2:02:40 pm

Hi Robin,

Could you give me some information about the environment you are working with ?

From my part, I'm using OOo 3.2.1~rc1-2.deb

And could you send me an odt file which works for you ( advil4005 AT gmail DOT com)

Thank you in advance,

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Nicolas Pastorino

Wednesday 19 May 2010 1:28:47 am

Hi Pascal,

It seems like one configuration directive might come in the way 'ClassAttributeMappingToHeader'. Could you try the following modification :

[ODFExport]
ClassAttributeMappingToHeader=disabled

Let us know,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Pascal France

Wednesday 19 May 2010 5:06:09 pm

Hi Nicolas ;-)

This has no effect.

Btow, ClasseAttributeMappingToHeader is a parameter of the export section now my problem concerns the import of an odt document.

The best way to determine if my environment is the origine of the trouble would be that I could test an odt file which works for someone else.

Regards,

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Friday 21 May 2010 9:35:20 am

Hi,

I continue to look for the reasons of the dysfunction of the extension.

I tried with an .odt file created with OOo under Windows, but the result is always the same.

[ODFImport]
# Default class for import
DefaultImportClass=article
# Default class for making an image
DefaultImportImageClass=image
RegisteredClassArray[]=article
RegisteredClassArray[]=folder
RegisteredClassArray[]=image
RegisteredClassArray[]=documentation_page
RegisteredClassArray[]=blog_post
ImportedImagesMediaNodeName=Imported images
PlaceImagesInMedia=false
OOConverterPort=9090
# Currently only localhost (127.0.0.1) is allowed
OOConverterAddress=127.0.0.1

[article]
DefaultImportTitleAttribute=name
DefaultImportBodyAttribute=resume <== THIS LINE
Attribute[name]=name
Attribute[resume]=intro
Attribute[corps_article]=body
Attribute[image]=image
Attribute[caption]=caption
Attribute[publish_date]=publish_date
Attribute[unpublish_date]=unpublish_date

The only thing which has an effect is to modify the name of the class attribute (see THIS LINE above) which will contain all the sections of my .odt file.

I am discouraged ;-) not to manage to run this extension.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Friday 21 May 2010 1:39:20 pm

Hi Pascal,

I have OO 3.2 on Windows. I'll send you an odt to your mail which should work, if it doesn't let me know and I'll send another one.

-- Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Friday 21 May 2010 3:27:12 pm

Robin, can I tell you that you are my savior ! ;-)

Thanks a lot for your odt file.

Now, I think (I think...) that I understand how this extension works.

First, the odt file needs to contain as many sections as the object class (even if some sections are left empty in the odt file). If this is not the case, another object class will be used to create the new imported object.

Second, the object class defined in the odf.ini file must contain as many sections as the object class too. If this is not the case, another object class will be used to create the new imported object.

Last, in the odt file the right date format is: 2010/05/21 23:36

Thank you still for your help and your patience,

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Robin Muilwijk

Friday 21 May 2010 11:54:46 pm

Hi Pascal,

Does the above mean you are closer to a solution, or do you actually have it working now? I do see you marked the topic as solved :)

-- Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

Pascal France

Saturday 22 May 2010 4:34:54 am

Hi Robin,

Thanks to your odt file which also works at home I was able to understand how works the extension.

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

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

Main resources:

Total runtime1.0623 sec
Peak memory usage4,096.0000 KB
Database Queries121

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.9141152.6250
Module start 'layout' 0.00630.0026 740.539139.4453
Module start 'content' 0.00891.0519 779.9844792.1797
Module end 'content' 1.06070.0015 1,572.164140.1563
Script end 1.0622  1,612.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2997160.0002
Check MTime0.00130.1265160.0001
Mysql Total
Database connection0.00130.118610.0013
Mysqli_queries0.918686.47831210.0076
Looping result0.00150.14331190.0000
Template Total1.027196.720.5136
Template load0.00200.184720.0010
Template processing1.025196.505020.5126
Template load and register function0.00010.010710.0001
states
state_id_array0.00130.118710.0013
state_identifier_array0.00130.124020.0007
Override
Cache load0.00210.20161530.0000
Sytem overhead
Fetch class attribute can translate value0.00050.043630.0002
Fetch class attribute name0.00110.1010200.0001
XML
Image XML parsing0.00120.116830.0004
class_abstraction
Instantiating content class attribute0.00010.0057260.0000
General
dbfile0.00080.0787240.0000
String conversion0.00000.000940.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
18content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
33content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ol.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ol.tplEdit templateOverride template
3content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
3content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 87
 Number of unique templates used: 12

Time used to render debug report: 0.0002 secs