The publishing process is tailored to be used with the Light Development Photo Gallery. It can be used for plain FTP upload too but when another type of dynamic photo album is to be used with the application it might be necessary to adjust or replace the table of contents handling. This chapter describes the publishing process in more detail for this reason.
Technically Photo Album Helper uses an instance of class com.lightdev.app.albumhelper.kernel.PublishThread to publish images. As a subclass of com.lightdev.lib.util.InfoThread class PublishThread performs a number of tasks in an own thread while informing objects registered as thread listeners about the progress at the same time.
The tasks performed by class PublishThread are basically
determine the files to publish
establish an FTP connection to the machine to publish to
create directories as appropriate
upload files recursively
update the table of contents
disconnect
In step 5 above a table of contents is updated in the way that name, directory and type of the newly published album are appended to an existing TOC or created in a new TOC when none is found. The table of contents is assumed to be in the format described in chapter Using a table of contents.
To extend or change the way a table of contents is handled method updateTOC of class PublishThread needs to be adjusted along with methods updateTOCFile and createTOCFile respectively. Please refer to the source code and comments in file PublishThread.java for additional details on how the handling of an album table of contents is implemented.
Please note: The Light Development XML Package is required to use a table of contents in the way described. Class PublishThread uses class com.lightdev.web.gallery.AlbumToc which contains methods to store an AlbumToc as XML file in turn using the XML Package. While class AlbumToc is included in the distribution package the Light Development XML Package needs to be obtained separately to use this feature.
See also