[opencms-dev] Remote export

Thomas Maerz thomasmaerz at gmx.de
Wed Apr 23 07:55:02 CEST 2003


Hello,

>  I work on my locale application 
>  http://localhost:8080/opencms/opencms
>  and I want to make an remote export. I want my files to be exported on a    
> remote machine.
>  Is that possible? Anybody have a clue? If yes, an example would be helpful.

Many people are using rsync - I think on the same machine or with a
machine having a rsync-server - so they only synchronize the export
folder of OC with a different folder; synchronization is executed by a
chron-job, i guess. This was my first approach, too.

But then I stumbled over this:

,----[ com.opencms.flex.I_CmsEventListener ]
| /**
|  * Implement this interface in case your class has to react 
|  * to CmsEvents that are thrown by system.<p>
|  * 
|  * In order to recieve system events, your class must register with 
|  * the OpenCms event mechanism. This can be done in the constructor of a class
|  * like this:
|  * <pre>
|  * com.opencms.core.A_OpenCms.addCmsEventListener(this);
|  * </pre>
|  * 
|  * A typical implementation might look like this:
|  * <pre>
|  * public void cmsEvent(com.opencms.flex.CmsEvent event) {
|  *     switch (event.getType()) {
|  *         case com.opencms.flex.I_CmsEventListener.EVENT_PUBLISH_PROJECT:
|  *         case com.opencms.flex.I_CmsEventListener.EVENT_CLEAR_CACHES:
|  *             // do something
|  *             break;
|  *         case com.opencms.flex.I_CmsEventListener.EVENT_LOGIN_USER:
|  *            // do something else
|  *             break;
|  *         }
|  * }
|  * </pre>
|  * 
|  * @author  Alexander Kandzior (a.kandzior at alkacon.com)
|  * 
|  * @version $Revision: 1.4 $
|  * @since FLEX alpha 1
|  * 
|  * @see CmsEvent
|  * @see com.opencms.core.A_OpenCms#addCmsEventListener(I_CmsEventListener)
|  */
`----

So you can get in your class all the files being published _and_ being
exported (EVENT_STATIC_EXPORT). You can access these files by any way
you want. E.g. /folder/your.file.html was exported -> copy it to
different locations on your maching or upload it by FTP to a different
machine. And if the file is gone, delete it. You only need a
configuration for FTP access or the folder you want to copy your files
to.

Maybe Alex can make some comments, too, to this problem. It would be
nice to implement this feature in OpenCMS. Copying by Java is no big
deal, but some FTP servers close their connection and blabla...
Anyway, maybe someone else is using this feature, too.

I would be lucky to help to implement this feature in an upcoming
release or as module; but not alone.

Best Regards,
Thomas März



More information about the opencms-dev mailing list