Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Publishing Multiple Documents

This article is about moving many Lenya documents from Authoring to Live.

Lenya without Jackrabbit


Before Jackrabbit, Lenya documents are XML files stored in a tree structure on the file system. The website structure is stored in "sitetree.xml". It is possible to "publish" documents using the operating system's copy commands if there is no concern about recording when a document is published. Ignoring any historical records, "publishing" means copying the document files to the correct directory under "live", and possible updating "sitetree.xml"

Make a Backup

Make a backup in case something goes horribly wrong.
Rename the {pub}/content/live directory. (I use date-based backups such as "live.20051217".)

Linux (or any OS with bash):
mv {pub}/content/live {pub}/content/live.backup

Microsoft:
cd {pub}/content
ren live live.backup

Publish All

To publish the entire Authoring section when using the file system for the datastore (such as Lenya1.2, or Lenya1.4 without Jackrabbit):
2. Copy the entire {pub}/content/authoring to {pub}/content/live.

Linux (or any OS with bash):
cd {pub}/content
cp -furR authoring/{mypath}/* live/{mypath}/*
[Options: f=force overwrite, u=only if file is newer, r=include files in subdirectories, R=create subdirectories as needed.]

Microsoft:
CD {pub}/content
XCOPY /S /Y authoring\* live\*
[Options: /S=include files in subdirectories, /Y=do not prompt about overwrites.]

"sitetree.xml" will be copied with the data, so the navigation tree is correct.

Republish Documents

If the documents have been published once, and the Navigation Titles are correct, then overwriting the existing files in "live" with the ones from the Authoring section will "publish" them (bypassing Lenya.)

For one file (which defeats the purpose of the article, but demonstrates how this works), copy:
{pub}/content/authoring/{path}/index_{language}.xml
To
{pub}/content/live/{path}/index_{language}.xml

For multiple files, copy the subdirectories:
Linux (or any OS with bash):
cd {pub}/content
cp -furR authoring/{mypath}/* live/{mypath}/*
[Options: f=force overwrite, u=only if file is newer, r=include files in subdirectories, R=create subdirectories as needed.]

Microsoft:
CD {pub}/content
XCOPY /S /Y authoring\{mypath}\* live\{mypath}\*
[Options: /S=include files in subdirectories, /Y=do not prompt about overwrites.]

Publish New Documents


Documents that have not been published do not have entries in "sitetree.xml". Those entries must be manually copied from the Authoring sitetree.xml. I do not recommend this, but if you must... "sitetree.xml" is formatted very poorly. The first step is to format "sitetree.xml" so it is usable by humans. See Formatting Sitetree.xml for an easy method of reformatting them. Then copy the appropriate entries from live to authoring.

Lenya1.4 with Jackrabbit

The current tree-based datastore makes operations on multiple files rather difficult. We discussed changing the data structure to a flat datastore for Lenya1.4. That would make operations on multiple documents easy. I (and you?) would like a screen of all documents ready for publishing, with the ability to check the box and "Publish Selected Documents". The only downside (besides programming time) is the manual methods above will be impossible, but just changing to Jackrabbit already has that effect.

For my contributions to the discussion, see Restructuring Lenya.

<< PublicationsFormat sitetree.xml >>

Contact Solprovider
Paul Ercolino