[opencms-dev] Static Export/Publish to WebServer Using FTP

Thomas März thomasmaerz at gmx.de
Thu May 22 01:37:01 CEST 2003


Hello,

Kim Altintop <kim at deepfx.com> writes:
>> http://mail.opencms.org/pipermail/opencms-dev/2003q2/004358.html
>
> Thanks, this answers my post as well!
>
> What do you think about implementing such a replication / remote
> publishing mechanism using Webservices (aka SOAP)?

I only wrote two replication classes, one for local copying of the
changed files and one for FTP. Both classes get a configuration object,
read from an XML-file, and then copy resp. delete the changed files. It
is more a hack than a good implementation, although the local copying of
files works flawless, the FTP upload stucks after about 15 files. So
there are a lot of things missing:
 - nice logging directly to the browser like OpenCMS
 - error handling of FTP upload
 - replacing /pics/ to /system/galleries/pics/ and so on
 - using threads for different targets, but not for the same FTP-server
 - and some nice to have features

All resources beneath "/project/" or "/system/galleries/pics/" get
copied to the destinations specified in the config.file. So you can copy
one resource to as much destinations as you want to.

,----[ config.file ]
| <?xml version="1.0" encoding="iso-8859-1"?>
| <projects>
| 	<project>
| 		<name>Sync Name 1 - no meaning</name>
| 		<localpath>path/to/export/directory</localpath>
| 		<targetpath>/path/to/apache</targetpath>
| 		<type>COPY</type>
| 		<resources>
| 			<ascii>/project/</ascii>
| 			<ascii>/another/folder/</ascii>
| 		</resources>
| 	</project>
| 	<project>
| 		<name>FTP name</name>
| 		<localpath>path/to/export/directory</targetpath>
| 		<targetpath>/htdocs</targetpath>
| 		<type>FTP</type>
| 		<hostname>www.example.org</hostname>
| 		<username>username</username>
| 		<password>password</password>
| 		<resources>
| 			<ascii>/project/</ascii>
| 			<binary>/system/galleries/pics/</binary>
| 		</resources>
| 	</project>
| </projects>
`----

So the "CmsEventListenIng" class reads the configuration and calls a
constructor passing a configuration to the according class. 

By the way, I would rather try to use WebDAV than SOAP to copy files to
different locations.


Best Regards,
Thomas März



More information about the opencms-dev mailing list