You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2004/01/07 19:37:24 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ant MoveSchedulerEntryTask.java

andreas     2004/01/07 10:37:24

  Modified:    src/java/org/apache/lenya/cms/scheduler ServletJob.java
                        SchedulerWrapper.java LoadQuartzServlet.java
                        TaskJob.java
               src/java/org/apache/lenya/cms/scheduler/xml
                        TriggerHelper.java
  Added:       src/java/org/apache/lenya/cms/scheduler JobWrapper.java
                        SchedulerStore.java
               src/java/org/apache/lenya/cms/ant
                        MoveSchedulerEntryTask.java
  Log:
  refactored scheduler, added task to move scheduler entry
  
  Revision  Changes    Path
  1.15      +27 -4     cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/ServletJob.java
  
  Index: ServletJob.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/ServletJob.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ServletJob.java	29 Aug 2003 11:35:21 -0000	1.14
  +++ ServletJob.java	7 Jan 2004 18:37:23 -0000	1.15
  @@ -131,11 +131,34 @@
           jobElement.setAttribute(ATTRIBUTE_ID, jobDetail.getName());
           jobElement.setAttribute(ATTRIBUTE_CLASS, getClass().getName());
   
  +        String documentUrl = getDocumentUrl(jobDetail);
  +        jobElement.setAttribute(ATTRIBUTE_DOCUMENT_URL, documentUrl);
  +        
  +        return jobElement;
  +    }
  +
  +    /**
  +     * Returns the document URL of a certain job.
  +     * @param jobDetail The job detail.
  +     * @return A string.
  +     */
  +    public String getDocumentUrl(JobDetail jobDetail) {
           JobDataMap map = jobDetail.getJobDataMap();
           NamespaceMap wrapper = new NamespaceMap(map, LoadQuartzServlet.PREFIX);
           String documentUrl = (String) wrapper.get(PARAMETER_DOCUMENT_URL);
  -
  -        jobElement.setAttribute(ATTRIBUTE_DOCUMENT_URL, documentUrl);
  -        return jobElement;
  +        return documentUrl;
       }
  +    
  +    /**
  +     * Sets the document URL of a job.
  +     * @param jobDetail The job detail.
  +     * @param url The URL.
  +     */
  +    public void setDocumentUrl(JobDetail jobDetail, String url) {
  +        JobDataMap map = jobDetail.getJobDataMap();
  +        NamespaceMap wrapper = new NamespaceMap(map, LoadQuartzServlet.PREFIX);
  +        wrapper.put(PARAMETER_DOCUMENT_URL, url);
  +        jobDetail.setJobDataMap(map);
  +    }
  +
   }
  
  
  
  1.25      +98 -223   cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java
  
  Index: SchedulerWrapper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SchedulerWrapper.java	26 Oct 2003 17:29:31 -0000	1.24
  +++ SchedulerWrapper.java	7 Jan 2004 18:37:23 -0000	1.25
  @@ -67,7 +67,6 @@
   import org.apache.lenya.cms.publication.PublicationException;
   import org.apache.lenya.cms.publication.PublicationFactory;
   import org.apache.lenya.cms.scheduler.xml.TriggerHelper;
  -import org.apache.lenya.xml.DocumentHelper;
   import org.apache.lenya.xml.NamespaceHelper;
   
   import org.apache.log4j.Category;
  @@ -88,8 +87,10 @@
   
   import java.text.DateFormat;
   import java.text.SimpleDateFormat;
  +import java.util.ArrayList;
   import java.util.Date;
   import java.util.GregorianCalendar;
  +import java.util.List;
   
   import javax.servlet.http.HttpServletRequest;
   
  @@ -99,20 +100,15 @@
    * @author ah
    */
   public class SchedulerWrapper {
  +
       private static Category log = Category.getInstance(SchedulerWrapper.class);
       public static final String JOB_PREFIX = "job";
       public static final String JOB_ID = "id";
       private static int jobId = 0;
  -    public static final String ELEMENT_JOB_GROUP = "job-group";
  -    public static final String ELEMENT_JOB = "job";
  -    public static final String ELEMENT_TRIGGERS = "triggers";
  -    public static final String ELEMENT_TRIGGER = "trigger";
  -    public static final String TITLE_ELEMENT = "title";
  -    public static final String TYPE_ATTRIBUTE = "type";
  -    public static final String CLASS_ATTRIBUTE = "class";
       private Scheduler scheduler = null;
       private String servletContextPath;
       private String schedulerConfigurationPath;
  +    private SchedulerStore store = new SchedulerStore();
   
       /**
        * Creates a new instance of SchedulerWrapper
  @@ -129,8 +125,8 @@
   
           try {
               scheduler = factory.getScheduler();
  -            
  -            scheduler.addSchedulerListener(new AbstractSchedulerListener());         
  +
  +            scheduler.addSchedulerListener(new AbstractSchedulerListener());
               scheduler.start();
           } catch (SchedulerException e) {
               log.error("Can't initialize SchedulerWrapper: ", e);
  @@ -141,6 +137,14 @@
       }
   
       /**
  +     * Returns the store.
  +     * @return A scheduler store.
  +     */
  +    protected SchedulerStore getStore() {
  +        return store;
  +    }
  +
  +    /**
        * Returns the scheduler.
        * @return A scheduler.
        */
  @@ -237,7 +241,7 @@
   
               log.debug("----------------------------------------------");
   
  -            writeSnapshot(jobGroup);
  +            store.writeSnapshot(getPublication(jobGroup), getJobWrappers(jobGroup));
           } catch (Exception e) {
               log.error("Adding job failed: ", e);
               throw new SchedulerException(e);
  @@ -245,6 +249,16 @@
       }
   
       /**
  +     * Returns the publication for a job group.
  +     * @param jobGroup A job group.
  +     * @return A publication.
  +     * @throws PublicationException when the publication does not exist.
  +     */
  +    protected Publication getPublication(String jobGroup) throws PublicationException {
  +        return PublicationFactory.getPublication(jobGroup, getServletContextPath());
  +    }
  +
  +    /**
        * Adds a job.
        * @param detail The job information.
        * @param trigger The trigger to trigger the job.
  @@ -284,68 +298,12 @@
               log.debug("\n Deleting job [" + jobGroup + "/" + jobName + "]");
               log.debug("-----------------------------------");
               getScheduler().deleteJob(jobName, jobGroup);
  -            writeSnapshot(jobGroup);
  +            getStore().writeSnapshot(getPublication(jobGroup), getJobWrappers(jobGroup));
           } catch (Exception e) {
               log.error("Deleting job failed: ", e);
           }
       }
   
  -    public static final String SNAPSHOT_FILE =
  -        "config/scheduler/jobs.xml".replace('/', File.separatorChar);
  -
  -    /**
  -     * Returns the job snapshot file for a job group. If a publication exists
  -     * with publication ID = job group, the file is obtained from the publication
  -     * directory. Otherwise, the generic Lenya snapshot file is used.
  -     * @param jobGroup The job group.
  -     * @return A file.
  -     * @throws SchedulerException when the publication could not be built.
  -     */
  -    public File getJobsFile(String jobGroup) throws SchedulerException {
  -        String publicationId = jobGroup;
  -        File jobsFile;
  -        if (PublicationFactory.existsPublication(publicationId, getServletContextPath())) {
  -            log.debug("Publication [" + publicationId + "] exists.");
  -            Publication publication;
  -            try {
  -                publication =
  -                    PublicationFactory.getPublication(publicationId, getServletContextPath());
  -            } catch (PublicationException e) {
  -                throw new SchedulerException(e);
  -            }
  -            jobsFile = new File(publication.getDirectory(), SNAPSHOT_FILE);
  -        } else {
  -            jobsFile = new File(getServletContextPath(), "lenya" + File.separator + SNAPSHOT_FILE);
  -        }
  -        log.debug("Resolved job snapshot file: [" + jobsFile.getAbsolutePath() + "]");
  -        return jobsFile;
  -    }
  -
  -    /**
  -     * Writes a job snapshot.
  -     * @param jobGroup The job group.
  -     * @throws SchedulerException when something went wrong.
  -     */
  -    protected void writeSnapshot(String jobGroup) throws SchedulerException {
  -
  -        log.debug("Writing job snapshot for group [" + jobGroup + "]");
  -        File jobsFile = getJobsFile(jobGroup);
  -
  -        try {
  -            File directory = jobsFile.getParentFile();
  -
  -            if (!directory.exists()) {
  -                directory.mkdirs();
  -                log.debug("Creating job snapshot directory: " + directory.getPath());
  -            }
  -
  -            jobsFile.createNewFile();
  -            DocumentHelper.writeDocument(getSnapshot(jobGroup), jobsFile);
  -        } catch (Exception e) {
  -            log.error("Writing job snapshot failed: ", e);
  -        }
  -    }
  -
       /**
        * Reads the scheduler configuration.
        * @return A configuration.
  @@ -367,6 +325,11 @@
           }
       }
   
  +    public static final String ELEMENT_TRIGGERS = "triggers";
  +    public static final String ELEMENT_TRIGGER = "trigger";
  +    public static final String TYPE_ATTRIBUTE = "type";
  +    public static final String CLASS_ATTRIBUTE = "class";
  +
       /**
        * Returns an XML element containing the trigger types.
        * @param helper The namespace helper of the document that shall contain the element.
  @@ -431,28 +394,6 @@
       }
   
       /**
  -     * Return an xml description of all scheduled jobs.
  -     * @return DOCUMENT ME!
  -     * @exception SchedulerException if an error occurs
  -     */
  -    public Document getSnapshot() throws SchedulerException {
  -        String[] jobGroupNames = getScheduler().getJobGroupNames();
  -        return getSnapshot(jobGroupNames);
  -    }
  -
  -    /**
  -     * Return an xml description of all scheduled jobs for the given job group.
  -     *
  -     * @param jobGroup a<code>PrintWriter</code> value
  -     * @return DOCUMENT ME!
  -     * @exception SchedulerException if an error occurs
  -     */
  -    public Document getSnapshot(String jobGroup) throws SchedulerException {
  -        String[] jobGroupNames = { jobGroup };
  -        return getSnapshot(jobGroupNames);
  -    }
  -
  -    /**
        * Return an XML description certain job groups.
        * @param jobGroupNames The job group names.
        * @return An XML document.
  @@ -461,7 +402,7 @@
       public Document getSnapshot(String[] jobGroupNames) throws SchedulerException {
           log.debug("Creating job snapshot");
   
  -        NamespaceHelper helper = getNamespaceHelper();
  +        NamespaceHelper helper = SchedulerStore.getNamespaceHelper();
           Document document = helper.getDocument();
           Element root = document.getDocumentElement();
   
  @@ -470,42 +411,60 @@
   
           for (int groupIndex = 0; groupIndex < jobGroupNames.length; groupIndex++) {
               log.debug("Creating job snapshot for group [" + jobGroupNames[groupIndex] + "]");
  -            root.appendChild(createSnapshot(helper, jobGroupNames[groupIndex]));
  +            root.appendChild(getSnapshot(helper, jobGroupNames[groupIndex]));
           }
   
           return document;
       }
  -
  +    
       /**
  -     * Creates an XML element containting a snapshot of a job group.
  -     * @param helper The namespace helper to use.
  -     * @param jobGroup The job group.
  -     * @return An XMl element.
  +     * Returns the snapshot of a certain job group.
  +     * @param helper The namespace helper.
  +     * @param group The job group.
  +     * @return An XML element.
        * @throws SchedulerException when something went wrong.
        */
  -    protected Element createSnapshot(NamespaceHelper helper, String jobGroup)
  -        throws SchedulerException {
  -        Element jobGroupElement = helper.createElement(ELEMENT_JOB_GROUP);
  -        jobGroupElement.setAttribute("name", jobGroup);
  -
  -        String[] jobNames = getScheduler().getJobNames(jobGroup);
  +    protected Element getSnapshot(NamespaceHelper helper, String group) throws SchedulerException {
  +        JobWrapper[] jobs = getJobWrappers(group);
  +        Element element;
  +        try {
  +            element = getStore().createSnapshot(helper, getPublication(group), jobs);
  +        } catch (SchedulerException e) {
  +            throw e;
  +        } catch (PublicationException e) {
  +            throw new SchedulerException(e);
  +        }
  +        return element;
  +    }
  +    
  +    /**
  +     * Returns the job wrappers for a certain job group.
  +     * @param jobGroupName The job group.
  +     * @return An array of job wrappers.
  +     * @throws SchedulerException when something went wrong.
  +     */
  +    protected JobWrapper[] getJobWrappers(String jobGroupName) throws SchedulerException {
  +        
  +        List wrappers = new ArrayList();
  +        String[] jobNames = getScheduler().getJobNames(jobGroupName);
   
           for (int nameIndex = 0; nameIndex < jobNames.length; nameIndex++) {
  -            JobDetail jobDetail = getScheduler().getJobDetail(jobNames[nameIndex], jobGroup);
  -
  -            ServletJob job = ServletJobFactory.createJob(jobDetail.getJobClass());
  -            Element jobElement = job.save(helper, jobDetail);
  -            jobGroupElement.appendChild(jobElement);
  -
  -            Trigger trigger = getTrigger(jobNames[nameIndex], jobGroup);
  -
  -            if (trigger != null) {
  -                Element triggerElement = TriggerHelper.createElement(helper, trigger);
  -                jobElement.appendChild(triggerElement);
  -            }
  +            JobDetail jobDetail = getScheduler().getJobDetail(jobNames[nameIndex], jobGroupName);
  +            Trigger trigger = getTrigger(jobNames[nameIndex], jobGroupName);
  +            wrappers.add(new JobWrapper(jobDetail, trigger));
           }
  +        
  +        return (JobWrapper[]) wrappers.toArray(new JobWrapper[wrappers.size()]);
  +    }
   
  -        return jobGroupElement;
  +    /**
  +     * Return an xml description of all scheduled jobs.
  +     * @return DOCUMENT ME!
  +     * @exception SchedulerException if an error occurs
  +     */
  +    public Document getSnapshot() throws SchedulerException {
  +        String[] jobGroupNames = getScheduler().getJobGroupNames();
  +        return getSnapshot(jobGroupNames);
       }
   
       /**
  @@ -514,121 +473,30 @@
        * @throws SchedulerException when something went wrong.
        */
       public void restoreJobs(String jobGroup) throws SchedulerException {
  +        
           log.debug("--------------------------------------------------");
           log.debug("Restoring jobs for job group [" + jobGroup + "]");
           log.debug("--------------------------------------------------");
  -
  -        File jobsFile = getJobsFile(jobGroup);
  -
  -        if (jobsFile.exists()) {
  -            try {
  -                Document document = DocumentHelper.readDocument(jobsFile);
  -                Element schedulerElement = document.getDocumentElement();
  -                NamespaceHelper helper = getNamespaceHelper(document);
  -
  -                Element jobGroupElement = helper.getFirstChild(schedulerElement, ELEMENT_JOB_GROUP);
  -                if (jobGroupElement == null) {
  -                    throw new SchedulerException("No <job-group> element found!");
  -                }
  -
  -                String jobGroupAttribute = jobGroupElement.getAttribute("name");
  -
  -                if (!jobGroupAttribute.equals(jobGroup)) {
  -                    throw new SchedulerException(
  -                        "The jobs.xml file contains a wrong job group: ["
  -                            + jobGroupAttribute
  -                            + "]");
  +        
  +        try {
  +            JobWrapper[] jobs = getStore().restoreJobs(getPublication(jobGroup));
  +            for (int i = 0; i < jobs.length; i++) {
  +                if (jobs[i].getTrigger() != null) {
  +                    if (log.isDebugEnabled()) {
  +                        log.debug("    Trigger time in future - scheduling job.");
  +                    }
  +                    addJob(jobs[i].getJobDetail(), jobs[i].getTrigger());
                   } else {
  -                    Element[] jobElements = helper.getChildren(jobGroupElement, ELEMENT_JOB);
  -
  -                    for (int i = 0; i < jobElements.length; i++) {
  -                        restoreJob(jobElements[i], jobGroup);
  +                    if (log.isDebugEnabled()) {
  +                        log.debug("    Trigger time has expired - adding job without scheduling.");
                       }
  +                    addJob(jobs[i].getJobDetail());
                   }
  -            } catch (Exception e) {
  -                log.error("Restoring jobs failed: ", e);
  -            }
  -        }
  -    }
  -
  -    /**
  -     * Restores the jobs from a certain XML element.
  -     * @param jobElement The XML element.
  -     * @param jobGroup The job group the job belongs to.
  -     */
  -    protected void restoreJob(Element jobElement, String jobGroup) {
  -        log.debug("Restoring job ");
  -
  -        NamespaceHelper helper = getNamespaceHelper();
  -
  -        try {
  -            String jobClassName = jobElement.getAttribute(ServletJob.ATTRIBUTE_CLASS);
  -            ServletJob job = ServletJobFactory.createJob(jobClassName);
  -            JobDetail jobDetail = job.load(jobElement, jobGroup, getServletContextPath());
  -
  -            Trigger trigger = null;
  -
  -            Element triggerElement = helper.getFirstChild(jobElement, "trigger");
  -            if (triggerElement != null) {
  -                trigger =
  -                    TriggerHelper.createTrigger(
  -                        triggerElement,
  -                        jobDetail.getName(),
  -                        jobDetail.getGroup());
  -
  -                Date now = new GregorianCalendar().getTime();
  -                if (log.isDebugEnabled()) {
  -                    DateFormat format = new SimpleDateFormat();
  -                    log.debug("    Trigger time: [" + format.format(trigger.getFinalFireTime()) + "]");
  -                    log.debug("    Current time: [" + format.format(now) + "]");
  -                }
  -                if (!trigger.getFinalFireTime().after(now)) {
  -                    trigger = null;
  -                }
  -            }
  -
  -            // FIXME: In the case of CronTrigger, getFinalFireTime does not make sense!
  -            if (trigger != null) {
  -                if (log.isDebugEnabled()) {
  -                    log.debug("    Trigger time in future - scheduling job.");
  -                }
  -                addJob(jobDetail, trigger);
  -            } else {
  -                if (log.isDebugEnabled()) {
  -                    log.debug("    Trigger time has expired - adding job without scheduling.");
  -                }
  -                addJob(jobDetail);
               }
           } catch (Exception e) {
  -            log.error("Could not restore job: ", e);
  +            log.error("Restoring jobs failed: ", e);
           }
  -    }
  -
  -    /** The namespace for the <code>jobs.xml</code> file. */
  -    public static final String NAMESPACE = "http://apache.org/cocoon/lenya/scheduler/1.0";
   
  -    /**
  -     * Returns a scheduler namespace helper for a document.
  -     * @param document The XML document.
  -     * @return a namespace helper.
  -     */
  -    public static NamespaceHelper getNamespaceHelper(Document document) {
  -        return new NamespaceHelper(NAMESPACE, "sch", document);
  -    }
  -
  -    /**
  -     * Returns a new scheduler namespace helper with an document containing
  -     * a &lt;sch:scheduler&gt; element.
  -     * @return a namespace helper.
  -     */
  -    public static NamespaceHelper getNamespaceHelper() {
  -        try {
  -            return new NamespaceHelper(NAMESPACE, "sch", "scheduler");
  -        } catch (Exception e) {
  -            log.error("Could not create namespace helper: ", e);
  -
  -            return null;
  -        }
       }
   
       /**
  @@ -662,7 +530,14 @@
                   log.debug("    Start time has already expired - deleting job.");
                   getScheduler().deleteJob(jobId, jobGroup);
               }
  -            writeSnapshot(jobGroup);
  +            try {
  +                getStore().writeSnapshot(getPublication(jobGroup), getJobWrappers(jobGroup));
  +            } catch (SchedulerException e) {
  +                throw e;
  +            } catch (PublicationException e) {
  +                throw new SchedulerException(e);
  +            }
           }
       }
  +
   }
  
  
  
  1.34      +14 -3     cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java
  
  Index: LoadQuartzServlet.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- LoadQuartzServlet.java	29 Aug 2003 17:14:43 -0000	1.33
  +++ LoadQuartzServlet.java	7 Jan 2004 18:37:23 -0000	1.34
  @@ -55,6 +55,7 @@
   */
   package org.apache.lenya.cms.scheduler;
   
  +import org.apache.lenya.cms.publication.PublicationFactory;
   import org.apache.lenya.cms.publishing.PublishingEnvironment;
   import org.apache.lenya.cms.scheduler.xml.TriggerHelper;
   import org.apache.lenya.util.NamespaceMap;
  @@ -332,6 +333,7 @@
        * @throws SchedulerException when something went wrong.
        */
       public void restoreJobs() throws SchedulerException {
  +
           File publicationsDirectory =
               new File(getServletContextDirectory(), PublishingEnvironment.PUBLICATION_PREFIX);
   
  @@ -341,10 +343,19 @@
               }
           });
   
  +        log.debug("=========================================");
  +        log.debug("  Restoring jobs.");
  +        log.debug("    servlet context: [" + getServletContextDirectory() + "]");
  +        log.debug("    publications directory: [" + publicationsDirectory + "]");
  +        log.debug("=========================================");
  +
           for (int i = 0; i < publicationDirectories.length; i++) {
               File directory = publicationDirectories[i];
               String publicationId = directory.getName();
  -            getScheduler().restoreJobs(publicationId);
  +            if (PublicationFactory
  +                .existsPublication(publicationId, getServletContextDirectory().getAbsolutePath())) {
  +                getScheduler().restoreJobs(publicationId);
  +            }
           }
       }
   }
  
  
  
  1.35      +2 -2      cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/TaskJob.java
  
  Index: TaskJob.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/TaskJob.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- TaskJob.java	26 Oct 2003 17:29:31 -0000	1.34
  +++ TaskJob.java	7 Jan 2004 18:37:23 -0000	1.35
  @@ -180,7 +180,7 @@
       public JobDetail load(Element jobElement, String jobGroup, String servletContextPath) throws SchedulerException {
           JobDetail jobDetail = super.load(jobElement, jobGroup, servletContextPath);
           
  -        NamespaceHelper helper = SchedulerWrapper.getNamespaceHelper();
  +        NamespaceHelper helper = SchedulerStore.getNamespaceHelper();
           DefaultTaskWrapper wrapper = new DefaultTaskWrapper(helper, jobElement);
           wrapper.getTaskParameters().setServletContextPath(servletContextPath);
           
  
  
  
  1.1                  cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/JobWrapper.java
  
  Index: JobWrapper.java
  ===================================================================
  /*
  $Id: JobWrapper.java,v 1.1 2004/01/07 18:37:23 andreas Exp $
  <License>
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Lenya" and  "Apache Software Foundation"  must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
   ware Foundation, please see <http://www.apache.org/>.
  
   Lenya includes software developed by the Apache Software Foundation, W3C,
   DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
  </License>
  */
  package org.apache.lenya.cms.scheduler;
  
  import org.quartz.JobDetail;
  import org.quartz.Trigger;
  
  /**
   * Wrapper for job information.
   *
   * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
   * @version CVS $Id: JobWrapper.java,v 1.1 2004/01/07 18:37:23 andreas Exp $
   */
  public class JobWrapper {
      
      private JobDetail jobDetail;
      private Trigger trigger;
      private String jobName;
      
      /**
       * Ctor.
       * @param detail The job detail.
       * @param trigger The trigger.
       */
      public JobWrapper(JobDetail detail, Trigger trigger) {
          this.jobDetail = detail;
          this.trigger = trigger;
      }
      
      /**
       * Returns the job detail.
       * @return A job detail object.
       */
      public JobDetail getJobDetail() {
          return jobDetail;
      }
      
      /**
       * Returns the servlet job.
       * @return A servlet job.
       */
      public ServletJob getJob() {
          ServletJob job = ServletJobFactory.createJob(jobDetail.getJobClass());
          return job;
      }
      
      /**
       * Returns the trigger.
       * @return A trigger.
       */
      public Trigger getTrigger() {
          return trigger;
      }
  
  }
  
  
  
  1.1                  cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/SchedulerStore.java
  
  Index: SchedulerStore.java
  ===================================================================
  /*
  $Id: SchedulerStore.java,v 1.1 2004/01/07 18:37:23 andreas Exp $
  <License>
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Lenya" and  "Apache Software Foundation"  must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Michael Wechner <mi...@apache.org>. For more information on the Apache Soft-
   ware Foundation, please see <http://www.apache.org/>.
  
   Lenya includes software developed by the Apache Software Foundation, W3C,
   DOM4J Project, BitfluxEditor, Xopus, and WebSHPINX.
  </License>
  */
  package org.apache.lenya.cms.scheduler;
  
  import java.io.File;
  import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.GregorianCalendar;
  import java.util.List;
  
  import org.apache.lenya.cms.publication.Publication;
  import org.apache.lenya.cms.scheduler.xml.TriggerHelper;
  import org.apache.lenya.xml.DocumentHelper;
  import org.apache.lenya.xml.NamespaceHelper;
  import org.apache.log4j.Category;
  import org.quartz.JobDetail;
  import org.quartz.SchedulerException;
  import org.quartz.Trigger;
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  
  /**
   * Store for scheduler jobs.
   *
   * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
   * @version CVS $Id: SchedulerStore.java,v 1.1 2004/01/07 18:37:23 andreas Exp $
   */
  public class SchedulerStore {
  
      public static final String ELEMENT_JOB_GROUP = "job-group";
      public static final String ELEMENT_JOB = "job";
      public static final String TITLE_ELEMENT = "title";
  
      private static final Category log = Category.getInstance(SchedulerStore.class);
  
      public static final String SNAPSHOT_FILE =
          "config/scheduler/jobs.xml".replace('/', File.separatorChar);
  
      /**
       * Ctor.
       * @param publication The publication.
       */
      public SchedulerStore() {
      }
  
      /**
       * Returns the job snapshot file for a publication..
       * @param Publication The publication.
       * @return A file.
       * @throws SchedulerException when the publication could not be built.
       */
      protected File getJobsFile(Publication publication) throws SchedulerException {
          File jobsFile;
          jobsFile = new File(publication.getDirectory(), SNAPSHOT_FILE);
          log.debug("Resolved job snapshot file: [" + jobsFile.getAbsolutePath() + "]");
          return jobsFile;
      }
  
      /**
       * Writes a job snapshot.
       * @param publication The publication.
       * @throws SchedulerException when something went wrong.
       */
      protected void writeSnapshot(Publication publication, JobWrapper[] jobs)
          throws SchedulerException {
  
          log.debug("Writing job snapshot for publication [" + publication.getId() + "]");
          File jobsFile = getJobsFile(publication);
  
          try {
              File directory = jobsFile.getParentFile();
  
              if (!directory.exists()) {
                  directory.mkdirs();
                  log.debug("Creating job snapshot directory: " + directory.getPath());
              }
  
              jobsFile.createNewFile();
              DocumentHelper.writeDocument(getSnapshot(publication, jobs), jobsFile);
          } catch (Exception e) {
              log.error("Writing job snapshot failed: ", e);
          }
      }
  
      /**
       * Return an xml description of all scheduled jobs for the given publication.
       *
       * @param publication The publication.
       * @return An XML document.
       * @exception SchedulerException if an error occurs
       */
      public Document getSnapshot(Publication publication, JobWrapper[] jobs)
          throws SchedulerException {
          NamespaceHelper helper = SchedulerStore.getNamespaceHelper();
          Document document = helper.getDocument();
          Element root = document.getDocumentElement();
  
          log.debug("Creating job snapshot for publication [" + publication.getId() + "]");
          root.appendChild(createSnapshot(helper, publication, jobs));
  
          return document;
      }
  
      /** The namespace for the <code>jobs.xml</code> file. */
      public static final String NAMESPACE = "http://apache.org/cocoon/lenya/scheduler/1.0";
  
      /**
       * Returns a scheduler namespace helper for a document.
       * @param document The XML document.
       * @return a namespace helper.
       */
      public static NamespaceHelper getNamespaceHelper(Document document) {
          return new NamespaceHelper(NAMESPACE, "sch", document);
      }
  
      /**
       * Returns a new scheduler namespace helper with an document containing
       * a &lt;sch:scheduler&gt; element.
       * @return a namespace helper.
       */
      public static NamespaceHelper getNamespaceHelper() {
          try {
              return new NamespaceHelper(NAMESPACE, "sch", "scheduler");
          } catch (Exception e) {
              log.error("Could not create namespace helper: ", e);
  
              return null;
          }
      }
  
      /**
       * Creates an XML element containting a snapshot of a job group.
       * @param helper The namespace helper to use.
       * @param jobGroup The job group.
       * @return An XMl element.
       * @throws SchedulerException when something went wrong.
       */
      protected Element createSnapshot(
          NamespaceHelper helper,
          Publication publication,
          JobWrapper[] jobs)
          throws SchedulerException {
          Element jobGroupElement = helper.createElement(ELEMENT_JOB_GROUP);
          jobGroupElement.setAttribute("name", publication.getId());
  
          for (int i = 0; i < jobs.length; i++) {
  
              ServletJob job = jobs[i].getJob();
              Element jobElement = job.save(helper, jobs[i].getJobDetail());
              jobGroupElement.appendChild(jobElement);
  
              Trigger trigger = jobs[i].getTrigger();
  
              if (trigger != null) {
                  Element triggerElement = TriggerHelper.createElement(helper, trigger);
                  jobElement.appendChild(triggerElement);
              }
          }
  
          return jobGroupElement;
      }
  
      /**
       * Restores the jobs of a certain job group from the snapshot file.
       * @param jobGroup The job group.
       * @throws SchedulerException when something went wrong.
       */
      public JobWrapper[] restoreJobs(Publication publication) throws SchedulerException {
          
          log.debug("Restoring jobs for publication [" + publication.getId() + "]");
  
          List wrappers = new ArrayList();
          File jobsFile = getJobsFile(publication);
          
          if (jobsFile.exists()) {
              Element[] jobElements = getJobElements(publication);
              Document document;
              try {
                  document = DocumentHelper.readDocument(jobsFile);
              } catch (Exception e) {
                  throw new SchedulerException(e);
              }
              Element schedulerElement = document.getDocumentElement();
              NamespaceHelper helper = SchedulerStore.getNamespaceHelper(document);
  
              for (int i = 0; i < jobElements.length; i++) {
                  wrappers.add(restoreJob(helper, jobElements[i], publication));
              }
          }
          else {
              log.debug("Could not restore jobs for publication [" + publication.getId() + "] - jobs file does not exist.");
          }
  
          return (JobWrapper[]) wrappers.toArray(new JobWrapper[wrappers.size()]);
      }
  
      /**
       * Restores the jobs from a certain XML element.
       * @param jobElement The XML element.
       * @param jobGroup The job group the job belongs to.
       */
      protected JobWrapper restoreJob(
          NamespaceHelper helper,
          Element jobElement,
          Publication publication)
          throws SchedulerException {
          log.debug("Restoring job ");
          JobWrapper wrapper;
  
          try {
              String jobClassName = jobElement.getAttribute(ServletJob.ATTRIBUTE_CLASS);
              ServletJob job = ServletJobFactory.createJob(jobClassName);
              JobDetail jobDetail =
                  job.load(
                      jobElement,
                      publication.getId(),
                      publication.getServletContext().getAbsolutePath());
  
              Trigger trigger = null;
  
              Element triggerElement = helper.getFirstChild(jobElement, "trigger");
              if (triggerElement != null) {
                  trigger =
                      TriggerHelper.createTrigger(
                          triggerElement,
                          jobDetail.getName(),
                          jobDetail.getGroup());
  
                  Date now = new GregorianCalendar().getTime();
                  if (log.isDebugEnabled()) {
                      DateFormat format = new SimpleDateFormat();
                      log.debug(
                          "    Trigger time: [" + format.format(trigger.getFinalFireTime()) + "]");
                      log.debug("    Current time: [" + format.format(now) + "]");
                  }
                  if (!trigger.getFinalFireTime().after(now)) {
                      trigger = null;
                  }
              }
              wrapper = new JobWrapper(jobDetail, trigger);
  
          } catch (Exception e) {
              throw new SchedulerException(e);
          }
          return wrapper;
      }
  
      /**
       * Called when a document has moved. This updates the corresponding
       * entry in the scheduler store.
       * @param source The source document.
       * @param destination The destination document.
       */
      public void documentMoved(
          org.apache.lenya.cms.publication.Document source,
          org.apache.lenya.cms.publication.Document destination)
          throws SchedulerException {
  
          Publication publication = source.getPublication();
          if (!publication.equals(destination.getPublication())) {
              throw new SchedulerException("Source and destination document must be in the same publication!");
          }
  
          JobWrapper[] wrappers = restoreJobs(publication);
          boolean changed = false;
          for (int i = 0; i < wrappers.length; i++) {
              ServletJob job = wrappers[i].getJob();
              String documentUrl = job.getDocumentUrl(wrappers[i].getJobDetail());
              if (documentUrl.equals(source.getCompleteURL())) {
                  job.setDocumentUrl(wrappers[i].getJobDetail(), destination.getCompleteURL());
                  changed = true;
              }
          }
          if (changed) {
              writeSnapshot(publication, wrappers);
          }
      }
  
      /**
       * Returns the job elements of a publication.
       * @param publication
       * @return
       * @throws SchedulerException when something went wrong.
       */
      protected Element[] getJobElements(Publication publication) throws SchedulerException {
          Element[] jobElements;
          try {
              File jobsFile = getJobsFile(publication);
              if (jobsFile.exists()) {
                  Document document = DocumentHelper.readDocument(jobsFile);
                  Element schedulerElement = document.getDocumentElement();
                  NamespaceHelper helper = SchedulerStore.getNamespaceHelper(document);
  
                  Element jobGroupElement =
                      helper.getFirstChild(schedulerElement, SchedulerStore.ELEMENT_JOB_GROUP);
                  if (jobGroupElement == null) {
                      throw new SchedulerException("No <job-group> element found!");
                  }
  
                  String jobGroupAttribute = jobGroupElement.getAttribute("name");
  
                  if (!jobGroupAttribute.equals(publication.getId())) {
                      throw new SchedulerException(
                          "The jobs.xml file contains a wrong job group: ["
                              + jobGroupAttribute
                              + "]");
                  } else {
                      jobElements = helper.getChildren(jobGroupElement, SchedulerStore.ELEMENT_JOB);
  
                  }
              } else {
                  throw new SchedulerException(
                      "The jobs file [" + jobsFile.getAbsolutePath() + "] does not exist!");
              }
          } catch (SchedulerException e) {
              throw e;
          } catch (Exception e) {
              throw new SchedulerException(e);
          }
          return jobElements;
      }
  }
  
  
  
  1.17      +3 -3      cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/xml/TriggerHelper.java
  
  Index: TriggerHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/scheduler/xml/TriggerHelper.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TriggerHelper.java	28 Aug 2003 10:12:35 -0000	1.16
  +++ TriggerHelper.java	7 Jan 2004 18:37:23 -0000	1.17
  @@ -55,7 +55,7 @@
   */
   package org.apache.lenya.cms.scheduler.xml;
   
  -import org.apache.lenya.cms.scheduler.SchedulerWrapper;
  +import org.apache.lenya.cms.scheduler.SchedulerStore;
   import org.apache.lenya.util.NamespaceMap;
   import org.apache.lenya.xml.NamespaceHelper;
   
  @@ -118,7 +118,7 @@
   
           String triggerType = element.getAttribute(TRIGGER_TYPE);
   
  -        NamespaceHelper helper = SchedulerWrapper.getNamespaceHelper();
  +        NamespaceHelper helper = SchedulerStore.getNamespaceHelper();
   
           // SimpleTrigger
           if (triggerType.equals(ONCE)) {
  
  
  
  1.1                  cocoon-lenya/src/java/org/apache/lenya/cms/ant/MoveSchedulerEntryTask.java
  
  Index: MoveSchedulerEntryTask.java
  ===================================================================
  /*
   * $Id: MoveSchedulerEntryTask.java,v 1.1 2004/01/07 18:37:24 andreas Exp $ <License>
   * 
   * ============================================================================ The Apache Software
   * License, Version 1.1
   * ============================================================================
   * 
   * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   * 
   * Redistribution and use in source and binary forms, with or without modifica- tion, are permitted
   * provided that the following conditions are met: 1. Redistributions of source code must retain
   * the above copyright notice, this list of conditions and the following disclaimer. 2.
   * Redistributions in binary form must reproduce the above copyright notice, this list of
   * conditions and the following disclaimer in the documentation and/or other materials provided
   * with the distribution. 3. The end-user documentation included with the redistribution, if any,
   * must include the following acknowledgment: "This product includes software developed by the
   * Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may
   * appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4.
   * The names "Apache Lenya" and "Apache Software Foundation" must not be used to endorse or promote
   * products derived from this software without prior written permission. For written permission,
   * please contact apache@apache.org. 5. Products derived from this software may not be called
   * "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache
   * Software Foundation.
   * 
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR
   * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT
   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
   * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   * 
   * This software consists of voluntary contributions made by many individuals on behalf of the
   * Apache Software Foundation and was originally created by Michael Wechner <mi...@apache.org> .
   * For more information on the Apache Soft- ware Foundation, please see <http://www.apache.org/> .
   * 
   * Lenya includes software developed by the Apache Software Foundation, W3C, DOM4J Project,
   * BitfluxEditor, Xopus, and WebSHPINX. </License>
   */
  package org.apache.lenya.cms.ant;
  
  import org.apache.lenya.cms.publication.Document;
  import org.apache.lenya.cms.publication.DocumentBuilder;
  import org.apache.lenya.cms.publication.DocumentException;
  import org.apache.lenya.cms.publication.Label;
  import org.apache.lenya.cms.publication.Publication;
  import org.apache.lenya.cms.publication.SiteTree;
  import org.apache.lenya.cms.publication.SiteTreeNode;
  import org.apache.lenya.cms.publication.SiteTreeNodeVisitor;
  import org.apache.lenya.cms.scheduler.SchedulerStore;
  import org.apache.tools.ant.BuildException;
  
  /**
   * Moves the scheduler entry for a document.
   * 
   * @author <a href="andreas@apache.org">Andreas Hartmann</a>
   */
  public class MoveSchedulerEntryTask extends PublicationTask implements SiteTreeNodeVisitor {
  
      /**
       * @see org.apache.tools.ant.Task#execute()
       */
      public void execute() throws BuildException {
          try {
              log("document id for the source: " + sourceDocumentId);
              log("area for the source: " + sourceArea);
              log("document id for the destination: " + destinationDocumentId);
              log("area for the destination: " + destinationArea);
  
              Publication publication = getPublication();
              SiteTree tree = publication.getSiteTree(sourceArea);
              SiteTreeNode node = tree.getNode(sourceDocumentId);
  
              node.acceptSubtree(this);
          } catch (Exception e) {
              throw new BuildException(e);
          }
      }
  
      private String sourceArea, destinationArea, sourceDocumentId, destinationDocumentId;
  
      /**
       * @param string The area of the source.
       */
      public void setSourceArea(String string) {
          sourceArea = string;
      }
  
      /**
       * @param string The document-id corresponding to the source.
       */
      public void setSourceDocumentId(String string) {
          sourceDocumentId = string;
      }
  
      /**
       * @param string The area of the destination.
       */
      public void setDestinationArea(String string) {
          destinationArea = string;
      }
  
      /**
       * @param string The document-id corresponding to the destination.
       */
      public void setDestinationDocumentId(String string) {
          destinationDocumentId = string;
      }
  
      /**
       * @see org.apache.lenya.cms.publication.SiteTreeNodeVisitor#visitSiteTreeNode(org.apache.lenya.cms.publication.SiteTreeNode)
       */
      public void visitSiteTreeNode(SiteTreeNode node) throws DocumentException {
          Publication publication = getPublication();
  
          Label[] labels = node.getLabels();
          for (int i = 0; i < labels.length; i++) {
              
              String language = labels[i].getLanguage();
              DocumentBuilder builder = publication.getDocumentBuilder();
              
              try {
                  String sourceUrl = builder.buildCanonicalUrl(publication, sourceArea, sourceDocumentId, language);
                  Document sourceDocument = builder.buildDocument(publication, sourceUrl);
                  
                  String destinationUrl = builder.buildCanonicalUrl(publication, destinationArea, destinationDocumentId, language);
                  Document destinationDocument = builder.buildDocument(publication, destinationUrl);
                  
                  log("move scheduler entry");
                  
                  SchedulerStore store = new SchedulerStore();
                  store.documentMoved(sourceDocument, destinationDocument);
                  
              } catch (Exception e) {
                  throw new DocumentException(e);
              }
  
          }
      }
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org