Importing content into Lenya

* HowToPermissions You may want to read this if things don't work as expected.

Documents

To import xml document into lenya publication you have to do following things:

1. copy document file into context://lenya/pubs/$pub/content/$area/$nodepath/$nodename/index_$ln.xml

2. add node to sitetree at context://lenya/pubs/$pub/content/$area/sitetree.xml

3. create workflow file for this node (as "not live") in context://lenya/pubs/$pub/content/workflow/history/authoring/$nodepath/index_$ln.xml:

If you want to import authoring document, you should import it into authoring area, and set workflow value of is_live to "false" and state="authoring". And then publish document using lenya menues.

If you want to import live document, you should import it to both authoring and live areas, and then set workflow value of is_live to "true" and state="live".

Assets

To import asset for some node $nodepath/$nodename:

1. put it in context://lenya/pubs/$pub/resources/$area/$nodepath/$nodename/$filename

2. create context://lenya/pubs/$pub/resources/$area/$nodepath/$nodename/$filename.meta with DublinCore data.

3. That's it.

Script

Usually, with large document sets, you are looking at writing an import script to automate things a bit. qMax has donated a perl script for this purpose that may serve as inspiration.

If you write your own script, make sure that the xml declaration in the .meta files begins on the first line and doesn't have whitespace before it otherwise Lenya will ignore it as invalid XML.

PS: This code runs on Linux and not on Windows.

HowToContentImport (last edited 2009-09-20 23:28:03 by localhost)