eZ Community » Forums » Extensions » ezodf : importing an .odt section
expandshrink

ezodf : importing an .odt section

ezodf : importing an .odt section

Saturday 08 May 2010 4:50:54 pm - 17 replies

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

Modified on Saturday 08 May 2010 5:30:45 pm by Pascal France

Saturday 08 May 2010 8:28:44 pm

Hi Pascal,

Did you check on http://share.ez.no/tutorials/ez-p.../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

Saturday 08 May 2010 11: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

Sunday 09 May 2010 8:19:30 pm

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

Sunday 09 May 2010 11: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

Modified on Saturday 15 May 2010 1:19:04 am by Pascal France

Wednesday 12 May 2010 8:41:46 pm

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

Modified on Wednesday 12 May 2010 10:05:49 pm by Robin Muilwijk

Saturday 15 May 2010 2:02:16 am

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

Sunday 16 May 2010 7:53:19 pm

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

Monday 17 May 2010 1:22:59 am

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

Modified on Monday 17 May 2010 1:24:21 am by Pascal France

Tuesday 18 May 2010 8:46:57 pm

Hi Pascal,

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

Regards Robin

Tuesday 18 May 2010 11: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

Wednesday 19 May 2010 10: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,

Thursday 20 May 2010 2:06:09 am

Hi Nicolas blunk.gif Emoticon

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

Friday 21 May 2010 6:35:20 pm

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 blunk.gif Emoticon not to manage to run this extension.

Pascal

Modified on Friday 21 May 2010 6:36:18 pm by Pascal France

Friday 21 May 2010 10: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

Saturday 22 May 2010 12:27:12 am

Robin, can I tell you that you are my savior ! blunk.gif Emoticon

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

Saturday 22 May 2010 8:54:46 am

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 happy.gif Emoticon

-- Robin

Modified on Saturday 22 May 2010 8:56:15 am by Robin Muilwijk

Saturday 22 May 2010 1:34:54 pm

Hi Robin,

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

Regards

Pascal

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from