org.apache.lenya.cms.publishing
Class DefaultFilePublisher

java.lang.Object
  extended by org.apache.lenya.cms.task.AbstractTask
      extended by org.apache.lenya.cms.publishing.AbstractPublisher
          extended by org.apache.lenya.cms.publishing.AbstractFilePublisher
              extended by org.apache.lenya.cms.publishing.DefaultFilePublisher
All Implemented Interfaces:
org.apache.avalon.framework.parameters.Parameterizable, Publisher, Task
Direct Known Subclasses:
ResourceFilePublisher

public class DefaultFilePublisher
extends AbstractFilePublisher

The DefaultFilePublisher is a task that copies XML source files from the authoring directory to another location, usually the live directory. The following task parameters must be provided:
publication-id: the publication ID
authoring-path: the authoring path
tree-authoring-path: the location of the tree.xml file
live-path: the live path
tree-live-path: the location of the tree.xml file
replication-path: the replication path, where sources are waiting for replication
sources: a comma-separated list of files to publish
* @deprecated use the publish ant task instead.


Field Summary
static java.lang.String PARAMETER_SOURCES
           
 
Fields inherited from interface org.apache.lenya.cms.task.Task
DEFAULT_PREFIX, FAILURE, NAMESPACE, PARAMETER_CONTEXT_PREFIX, PARAMETER_PUBLICATION_ID, PARAMETER_SERVER_PORT, PARAMETER_SERVER_URI, PARAMETER_SERVLET_CONTEXT, SUCCESS
 
Constructor Summary
DefaultFilePublisher()
           
 
Method Summary
 void execute(java.lang.String contextPath)
          Default implementation of execute (to implement the Task interface) which basically parses the parameters and invokes the publish method.
 void publish(java.lang.String publicationPath, java.lang.String authoringPath, java.lang.String treeAuthoringPath, java.lang.String resourcesAuthoringPath, java.lang.String livePath, java.lang.String treeLivePath, java.lang.String resourcesLivePath, java.lang.String replicationPath, java.lang.String[] sources)
          Default implementation of publish which simply copies the files from the absoluteAuthoringPath to the absoluteLivePath.
protected  void publishResources(java.lang.String publicationPath, java.lang.String resourcesAuthoringPath, java.lang.String resourcesLivePath, java.lang.String[] sources)
          A template method to publish the resources.
 
Methods inherited from class org.apache.lenya.cms.publishing.AbstractFilePublisher
copyFile
 
Methods inherited from class org.apache.lenya.cms.task.AbstractTask
getParameters, getResult, parameterize, setLabel, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_SOURCES

public static final java.lang.String PARAMETER_SOURCES
See Also:
Constant Field Values
Constructor Detail

DefaultFilePublisher

public DefaultFilePublisher()
Method Detail

publish

public void publish(java.lang.String publicationPath,
                    java.lang.String authoringPath,
                    java.lang.String treeAuthoringPath,
                    java.lang.String resourcesAuthoringPath,
                    java.lang.String livePath,
                    java.lang.String treeLivePath,
                    java.lang.String resourcesLivePath,
                    java.lang.String replicationPath,
                    java.lang.String[] sources)
             throws PublishingException
Default implementation of publish which simply copies the files from the absoluteAuthoringPath to the absoluteLivePath.

Parameters:
publicationPath - DOCUMENT ME!
authoringPath - DOCUMENT ME!
treeAuthoringPath - DOCUMENT ME!
resourcesAuthoringPath - path to authoring resources base directory
livePath - DOCUMENT ME!
treeLivePath - DOCUMENT ME!
resourcesLivePath - path to live resources base directory
replicationPath - DOCUMENT ME!
sources - DOCUMENT ME!
Throws:
PublishingException - if an error occurs

execute

public void execute(java.lang.String contextPath)
             throws ExecutionException
Default implementation of execute (to implement the Task interface) which basically parses the parameters and invokes the publish method.

Parameters:
contextPath - a String value
Throws:
ExecutionException - if an error occurs

publishResources

protected void publishResources(java.lang.String publicationPath,
                                java.lang.String resourcesAuthoringPath,
                                java.lang.String resourcesLivePath,
                                java.lang.String[] sources)
                         throws PublishingException
A template method to publish the resources. The default implementation doesn't deal with resources. It simply ignores them and assumes that they end up in the live directory be some other means.

Parameters:
publicationPath - path to the publication
resourcesAuthoringPath - authoring path for the resources
resourcesLivePath - live path for the resources
sources - array of docIds
Throws:
PublishingException - if the publishing of resources fails


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.