You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gc...@apache.org on 2003/10/22 20:53:07 UTC

cvs commit: cocoon-2.1/src/blocks/slide/conf slide-inspector.xroles slide-sourceinspector.xconf

gcasper     2003/10/22 11:53:07

  Modified:    .        gump.xml
  Added:       src/blocks/repository/java/org/apache/cocoon/components/source
                        InspectableSource.java RestrictableSource.java
                        VersionableSource.java
                        ModifiableTraversableSource.java
                        TraversableSource.java LockableSource.java
                        SourceInspector.java
               src/blocks/repository/java/org/apache/cocoon/components/source/helpers
                        PrincipalSourcePermission.java
                        GroupSourcePermission.java
                        AbstractSourcePermission.java SourcePermission.java
                        SourceLock.java SourceProperty.java
               src/blocks/repository/java/org/apache/cocoon/components/source/impl
                        SourceInspectorManager.java GIFSourceInspector.java
                        XPathSourceInspector.java JPEGSourceInspector.java
               src/blocks/repository/conf repository-inspector.xroles
                        repository-sourceinspector.xconf
  Removed:     src/blocks/slide/java/org/apache/cocoon/components/source/helpers
                        SourceProperty.java GroupSourcePermission.java
                        AbstractSourcePermission.java SourceLock.java
                        PrincipalSourcePermission.java
                        SourcePermission.java
               src/blocks/slide/java/org/apache/cocoon/components/source
                        RestrictableSource.java InspectableSource.java
                        SourceInspector.java TraversableSource.java
                        VersionableSource.java LockableSource.java
                        ModifiableTraversableSource.java
               src/blocks/slide/java/org/apache/cocoon/components/source/impl
                        JPEGSourceInspector.java
                        SourceInspectorManager.java
                        XPathSourceInspector.java GIFSourceInspector.java
               src/blocks/slide/conf slide-inspector.xroles
                        slide-sourceinspector.xconf
  Log:
  Added repository block
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/InspectableSource.java
  
  Index: InspectableSource.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.cocoon.components.source.helpers.SourceProperty;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * A source, which owns meta informations in form of properties
   *
   * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
   * @version CVS $Id: InspectableSource.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface InspectableSource extends Source {
  
      /** 
       * To get a meta information from a source 
       */
      public SourceProperty getSourceProperty(String namespace, String name) throws SourceException;
  
      /** 
       * To set a meta information 
       */
      public void setSourceProperty(SourceProperty property) throws SourceException;
  
      /** 
       * Get alll informations 
       */
      public SourceProperty[] getSourceProperties() throws SourceException;
  
      /**
       * Remove property
       */
      public void removeSourceProperty(String namespace, String name) throws SourceException;
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/RestrictableSource.java
  
  Index: RestrictableSource.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.cocoon.components.source.helpers.SourceCredential;
  import org.apache.cocoon.components.source.helpers.SourcePermission;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * A source, which is restrictable, which means you need a username and password.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: RestrictableSource.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface RestrictableSource extends Source {
  
      /** 
       * Get the current credential for the source
       */
      public SourceCredential getSourceCredential() throws SourceException;
  
      /** 
       * Set the credential for the source
       */
      public void setSourceCredential(SourceCredential sourcecredential) throws SourceException;
  
      /**
       * Add a permission to this source
       *
       * @param sourcepermission Permission, which should be set
       *
       * @throws SourceException If an exception occurs during this operation
       **/
      public void addSourcePermission(SourcePermission sourcepermission) throws SourceException;
  
      /**
       * Remove a permission from this source
       *
       * @param sourcepermission Permission, which should be removed
       *
       * @throws SourceException If an exception occurs during this operation
       **/
      public void removeSourcePermission(SourcePermission sourcepermission) throws SourceException;
  
      /**
       * Returns a list of the existing permissions
       *
       * @return Array of SourcePermission
       */
      public SourcePermission[] getSourcePermissions() throws SourceException;
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/VersionableSource.java
  
  Index: VersionableSource.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * A source, which could exist in different versions
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: VersionableSource.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface VersionableSource extends Source {
  
      /** 
       * If this source versioned
       */
      public boolean isVersioned() throws SourceException;
  
      /** 
       * Get the current revision of the source
       */
      public String getSourceRevision() throws SourceException;
  
      /** 
       * Sets the wanted revision of the source
       */
      public void setSourceRevision(String sourcerevision) throws SourceException;
  
      /** 
       * Get the current branch of the revision from the source
       */
      public String getSourceRevisionBranch() throws SourceException;
  
      /** 
       * Sets the wanted branch of the revision from the source
       */
      public void setSourceRevisionBranch(String sourcerevisionbranch) throws SourceException;
  
      /** 
       * Get the latest revision
       */
      public String getLatestSourceRevision() throws SourceException;
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/ModifiableTraversableSource.java
  
  Index: ModifiableTraversableSource.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.excalibur.source.ModifiableSource;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * A source, which can be a directory or collection of sources, which can
   * can be modfied.
   *
   * WARNING: Do not use this interface, it will be removed soon. Use
   *          the version from avalon excalibur instead.
   * 
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: ModifiableTraversableSource.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface ModifiableTraversableSource extends TraversableSource, ModifiableSource {
  
      /**
       * Create a collection of sources.
       *
       * @param collectionname Name of the collectiom, which 
       *                       should be created.
       */
      void createCollection(String collectionname) throws SourceException;
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/TraversableSource.java
  
  Index: TraversableSource.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * A source, which can be a directory or collection of sources.
   *
   * WARNING: Do not use this interface, it will be removed soon. Use
   *          the version from avalon excalibur instead.
   * 
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: TraversableSource.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface TraversableSource extends Source {
  
      /** 
       * If the source a directory or a collection
       */
      public boolean isSourceCollection() throws SourceException;
  
      /**
       * Returns the count of child sources.
       */
      public int getChildSourceCount()  throws SourceException;
  
      /**
       * Return the system id of a child source.
       *
       * @param index Index of the child
       */
      public String getChildSource(int index)  throws SourceException;
  
      /**
       * Return the system if of the parent source. The method should return
       * null if the source hasn't a parent. 
       */
      public String getParentSource();
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/LockableSource.java
  
  Index: LockableSource.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  import org.apache.cocoon.components.source.helpers.SourceLock;
  
  import java.util.Enumeration;
  
  /**
   * A source, which could be locked
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: LockableSource.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface LockableSource extends Source {
  
      /**
       * Add a lock to this source
       *
       * @param sourcelock Lock, which should be added
       *
       * @throws SourceException If an exception occurs during this operation
       */
      public void addSourceLocks(SourceLock sourcelock) throws SourceException;
  
      /**
       * Returns a enumeration of the existing locks
       *
       * @return Enumeration of SourceLock
       */
      public Enumeration getSourceLocks() throws SourceException;
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/SourceInspector.java
  
  Index: SourceInspector.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source;
  
  import org.apache.avalon.framework.component.Component;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  import org.apache.cocoon.components.source.helpers.SourceProperty;
  
  /**
   * A source inspector helps to get properties from sources
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: SourceInspector.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface SourceInspector extends Component {
  
      public final static String ROLE = "org.apache.cocoon.components.source.SourceInspector";
  
      public SourceProperty getSourceProperty(Source source, String namespace, String name) 
          throws SourceException;
  
      public SourceProperty[] getSourceProperties(Source source) throws SourceException;
  
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/PrincipalSourcePermission.java
  
  Index: PrincipalSourcePermission.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.helpers;
  
  /**
   * This class represents a source permission for users
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: PrincipalSourcePermission.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class PrincipalSourcePermission extends AbstractSourcePermission {
  
      public final static String PRINCIPAL_SELF              = "SELF";
      public final static String PRINCIPAL_ALL               = "ALL";
      public final static String PRINCIPAL_GUEST             = "GUEST";
  
      private String principal;
  
      /**
       * Creates a new permission
       *
       * @param principal Principal of the permission
       * @param privilege Privilege of the permission
       * @param inheritable If the permission is inheritable
       * @param negative If the permission is negative
       */
      public PrincipalSourcePermission(String principal, String privilege, 
                                       boolean inheritable, boolean negative) {
  
          this.principal   = principal;
          setPrivilege(privilege);
          setInheritable(inheritable);
          setNegative(negative);
      }
  
      /**
       * Sets the principal of the permission
       *
       * @param principal Principal of the permission
       */
      public void setPrincipal(String principal) {
          this.principal   = principal;
      }
  
      /**
       * Returns the principal of the permission
       * 
       * @return Principal of the permission
       */
      public String getPrincipal() {
          return this.principal;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/GroupSourcePermission.java
  
  Index: GroupSourcePermission.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.helpers;
  
  /**
   * This class represents a source permission for groups
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: GroupSourcePermission.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class GroupSourcePermission extends AbstractSourcePermission {
  
      private String group;
  
      /**
       * Creates a new permission
       *
       * @param group Group of the permission
       * @param privilege Privilege of the permission
       * @param inheritable If the permission is inheritable
       * @param negative If the permission is negative
       */
      public GroupSourcePermission(String group, String privilege, 
                                   boolean inheritable, boolean negative) {
  
          this.group = group;
          setPrivilege(privilege);
          setInheritable(inheritable);
          setNegative(negative);
      }
  
      /**
       * Sets the group of users for the permission
       *
       * @param group Group of users
       */
      public void setGroup(String group) {
          this.group = group;
      }
  
      /**
       * Returns the group of users for the permission
       * 
       * @return Group of users
       */
      public String getGroup() {
          return this.group;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/AbstractSourcePermission.java
  
  Index: AbstractSourcePermission.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.helpers;
  
  /**
   * This class is an abstract implementation of a source permission
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: AbstractSourcePermission.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public abstract class AbstractSourcePermission implements SourcePermission{
  
      private String  privilege;
      private boolean inheritable;
      private boolean negative;
  
      /**
       * Sets the privilege of the permission
       *
       * @param privilege Privilege of the permission
       */
      public void setPrivilege(String privilege) {
          this.privilege   = privilege;
      }
  
      /**
       * Returns the privilege of the permission
       * 
       * @return Privilege of the permission
       */
      public String getPrivilege() {
          return this.privilege;
      }
  
      /**
       * Sets the inheritable flag
       *
       * @param inheritable If the permission is inheritable
       */
      public void setInheritable(boolean inheritable) {
          this.inheritable = inheritable;
      }
  
      /**
       * Returns the inheritable flag
       *
       * @return If the permission is inheritable
       */
      public boolean isInheritable() {
          return this.inheritable;
      }
  
      /**
       * Sets the negative flag
       *
       * @param negative If the permission is a negative permission
       */
      public void setNegative(boolean negative) {
          this.negative = negative;
      }
  
      /**
       * Returns the negative flag
       * 
       * @return If the permission is a negative permission
       */
      public boolean isNegative() {
          return this.negative;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/SourcePermission.java
  
  Index: SourcePermission.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.helpers;
  
  /**
   * This interface represents a permission for a source
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: SourcePermission.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public interface SourcePermission {
  
      public final static String PRIVILEGE_ALL               = "all";
      public final static String PRIVILEGE_READ              = "read";
      public final static String PRIVILEGE_WRITE             = "write";
  
      public final static String PRIVILEGE_READ_ACL          = "read-acl";
      public final static String PRIVILEGE_WRITE_ACL         = "write-acl";
  
      public final static String PRIVILEGE_READ_SOURCE       = "read-source";
      public final static String PRIVILEGE_CREATE_SOURCE     = "create-source";
      public final static String PRIVILEGE_REMOVE_SOURCE     = "remove-source";
  
      public final static String PRIVILEGE_LOCK_SOURCE       = "lock-source";
      public final static String PRIVILEGE_READ_LOCKS        = "read-locks";
  
      public final static String PRIVILEGE_READ_PROPERTY     = "read-property";
      public final static String PRIVILEGE_CREATE_PROPERTY   = "create-property";
      public final static String PRIVILEGE_MODIFY_PROPERTY   = "modify-property";
      public final static String PRIVILEGE_REMOVE_PROPERTY   = "remove-property";
  
      public final static String PRIVILEGE_READ_CONTENT      = "read-content";
      public final static String PRIVILEGE_CREATE_CONTENT    = "create-content";
      public final static String PRIVILEGE_MODIFY_CONTENT    = "modify-content";
      public final static String PRIVILEGE_REMOVE_CONTENT    = "remove-content";
  
      public final static String PRIVILEGE_GRANT_PERMISSION  = "grant-permission";
      public final static String PRIVILEGE_REVOKE_PERMISSION = "revoke-permission";
  
      /**
       * Sets the privilege of the permission
       *
       * @param privilege Privilege of the permission
       */
      public void setPrivilege(String privilege);
  
      /**
       * Returns the privilege of the permission
       * 
       * @return Privilege of the permission
       */
      public String getPrivilege();
  
      /**
       * Sets the inheritable flag
       *
       * @param inheritable If the permission is inheritable
       */
      public void setInheritable(boolean inheritable);
  
      /**
       * Returns the inheritable flag
       *
       * @return If the permission is inheritable
       */
      public boolean isInheritable();
  
      /**
       * Sets the negative flag
       *
       * @param negative If the permission is a negative permission
       */
      public void setNegative(boolean negative);
  
      /**
       * Returns the negative flag
       * 
       * @return If the permission is a negative permission
       */
      public boolean isNegative();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/SourceLock.java
  
  Index: SourceLock.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.helpers;
  
  import java.util.Date;
  
  /**
   * This interface for lock of a source
   *
   * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
   * @version CVS $Id: SourceLock.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class SourceLock {
  
      private String  subject;
      private String  type;
      private Date    expiration;
      private boolean inheritable;
      private boolean exclusive;
  
      /**
       * Creates a new lock for a source
       *
       * @param subject Which user should be locked
       * @param type Type of lock
       * @param expiration When the lock expires
       * @param inheritable If the lock is inheritable
       * @param exclusive If the lock is exclusive
       */
      public SourceLock(String subject, String type, Date expiration,
                        boolean inheritable, boolean exclusive) {
  
          this.subject     = subject;
          this.type        = type;
          this.expiration  = expiration;
          this.inheritable = inheritable;
          this.exclusive   = exclusive;
      }
  
      /**
       *  Sets the subject for this lock
       *
       * @param subject Which user should be locked
       */
      public void setSubject(String subject) {
          this.subject = subject;
      }
  
      /**
       * return the subject of the lock
       * 
       * @return Which user should be locked
       */
      public String getSubject() {
          return this.subject;
      }
  
      /**
       * Sets the type of the lock
       *
       * @param type Type of lock
       */
      public void setType(String type) {
          this.type = type;
      }
  
      /**
       * Return ths type of the lock
       * 
       * @return Type of lock
       */
      public String getType() {
          return this.type;
      }
  
      /**
       * Set the expiration date
       *
       * @param expiration Expiration date
       */
      public void setExpiration(Date expiration) {
          this.expiration = expiration;
      }
  
      /**
       * Returns the expiration date
       * 
       * @return Expiration date
       */
      public Date getExpiration() {
          return this.expiration;
      }
  
      /**
       * Sets the inheritable flag
       *
       * @param inheritable If the lock is inheritable
       */
      public void setInheritable(boolean inheritable) {
          this.inheritable = inheritable;
      }
  
      /**
       * Returns the inheritable flag
       * 
       * @return If the lock is inheritable
       */
      public boolean isInheritable() {
          return this.inheritable;
      }
  
      /**
       * Sets the exclusive flag
       *
       * @param exclusive If the lock is exclusive
       */
      public void setExclusive(boolean exclusive) {
          this.exclusive = exclusive;
      }
  
      /**
       * Returns the exclusive flag
       * 
       * @return If the lock is exclusive
       */
      public boolean isExclusive() {
          return this.exclusive;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/SourceProperty.java
  
  Index: SourceProperty.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.helpers;
  
  import org.apache.cocoon.xml.dom.DOMBuilder;
  import org.apache.cocoon.xml.dom.DOMStreamer;
  import org.apache.excalibur.xml.sax.XMLizable;
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  import org.w3c.dom.Node;
  import org.w3c.dom.NodeList;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  import org.xml.sax.helpers.AttributesImpl;
  
  /**
   * The interface for a property of a source
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @author <a href="mailto:holz@fiz-chemie.de">Martin Holz</a>
   * @version CVS $Id: SourceProperty.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class SourceProperty implements XMLizable {
  
      private String namespace;
      private String name;
      private Element value;
  
      /**  */
      public static final String NS_PREFIX = "property";
      private static final String D_PREFIX = NS_PREFIX+":";
  
      private static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/";
  
      /**
       * Creates a new property for a source
       *
       * @param namespace The namespace of the property
       * @param name The name of the property
       */
      public SourceProperty(String namespace, String name) {
  
          this.namespace = namespace;
          this.name = name;
  
          try {
              // FIXME: There must be an easier way to create a DOM element
              DOMBuilder builder = new DOMBuilder();
  
              builder.startDocument();
              builder.startPrefixMapping(NS_PREFIX, namespace);
              AttributesImpl attrs = new AttributesImpl();
  
              attrs.addAttribute(XMLNS_NS, NS_PREFIX, "xmlns:"+NS_PREFIX,
                                 "NMTOKEN", namespace);
              builder.startElement(namespace, name, D_PREFIX+name, attrs);
              builder.endElement(namespace, name, D_PREFIX+name);
              builder.endPrefixMapping(NS_PREFIX);
  
              Document doc = builder.getDocument();
  
              this.value = doc.getDocumentElement();
          } catch (SAXException se) {
              // do nothing
          }
      }
  
      /**
       * Creates a new property for a source
       *
       * @param namespace The namespace of the property
       * @param name The name of the property
       * @param value The value of the property
       */
      public SourceProperty(String namespace, String name, String value) {
          this.namespace = namespace;
          this.name = name;
          setValue(value);
      }
  
      /**
       * Creates a new property for a source
       *
       * @param property The property in DOM representation
       */
      public SourceProperty(Element property) {
          this.namespace = property.getNamespaceURI();
          this.name = property.getLocalName();
          this.value = property;
      }
  
      /**
       * Sets the namespace for this property
       *
       * @param namespace The namespace of the property
       * @deprecated buggy
       */
      public void setNamespace(String namespace) {
          this.namespace = namespace;
      }
  
      /**
       * Return the namespace of the property
       *
       * @return The namespace of the property
       */
      public String getNamespace() {
          return this.namespace;
      }
  
      /**
       * Sets the name of the property
       *
       * @param name Name of the property
       * @deprecated buggy
       */
      public void setName(String name) {
          this.name = name;
      }
  
      /**
       * Return the name of the property
       *
       * @return Name of the property
       */
      public String getName() {
          return this.name;
      }
  
      /**
       * Sets the value of the property
       *
       * @param value Value of the property
       */
      public void setValue(String value) {
          // this.value = value;
  
          try {
              DOMBuilder builder = new DOMBuilder();
  
              builder.startDocument();
              builder.startPrefixMapping(NS_PREFIX, namespace);
              AttributesImpl attrs = new AttributesImpl();
  
              attrs.addAttribute(XMLNS_NS, NS_PREFIX, "xmlns:"+NS_PREFIX,
                                 "NMTOKEN", namespace);
  
              builder.startElement(namespace, name, D_PREFIX+name, attrs);
  
              builder.characters(value.toCharArray(), 0, value.length());
  
              builder.endElement(namespace, name, D_PREFIX+name);
              builder.endPrefixMapping(NS_PREFIX);
              builder.endDocument();
  
              Document doc = builder.getDocument();
  
              this.value = doc.getDocumentElement();
          } catch (SAXException se) {
              // do nothing
          }
      }
  
      /**
       * Returns the value of the property
       *
       * @return Value of the property
       */
      public String getValueAsString() {
  
          NodeList nodeslist = this.value.getChildNodes();
          StringBuffer buffer = new StringBuffer();
  
          for (int i = 0; i<nodeslist.getLength(); i++)
              if ((nodeslist.item(i).getNodeType()==Node.TEXT_NODE) ||
                  (nodeslist.item(i).getNodeType()==Node.CDATA_SECTION_NODE)) {
                  buffer.append(nodeslist.item(i).getNodeValue());
              }
  
          return buffer.toString();
      }
  
      /**
       * Sets the value of the property
       *
       * @param value Value of the property
       */
      public void setValue(Element value) {
          if ((value.getLocalName().equals(name)) &&
              (value.getNamespaceURI().equals(namespace))) {
              this.value = value;
          }
      }
  
      /**
       * Sets the value of the property
       *
       *
       * @param values
       */
      public void setValue(NodeList values) {
          try {
              DOMBuilder builder = new DOMBuilder();
  
              builder.startDocument();
              builder.startElement(namespace, name, name, new AttributesImpl());
  
              DOMStreamer stream = new DOMStreamer(builder);
  
              for (int i = 0; i<values.getLength(); i++)
                  stream.stream(values.item(i));
  
              builder.endElement(namespace, name, name);
              builder.endDocument();
  
              Document doc = builder.getDocument();
  
              this.value = doc.getDocumentElement();
          } catch (SAXException se) {
              // do nothing
          }
      }
  
      /**
       *
       */
      public Element getValue() {
          return this.value;
      }
  
      /**
       * Generates SAX events representing the object's state.<br/>
       * <b>NOTE</b> : if the implementation can produce lexical events, care should be taken
       * that <code>handler</code> can actually be a {@link org.apache.cocoon.xml.XMLConsumer} that accepts such
       * events.
       *
       * @param handler
       */
      public void toSAX(ContentHandler handler) throws SAXException {
          DOMStreamer stream = new DOMStreamer(handler);
  
          stream.stream(this.value);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/SourceInspectorManager.java
  
  Index: SourceInspectorManager.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.impl;
  
  import java.util.ArrayList;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.logger.LogEnabled;
  import org.apache.avalon.framework.parameters.ParameterException;
  import org.apache.avalon.framework.parameters.Parameterizable;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  
  import org.apache.cocoon.components.source.SourceInspector;
  import org.apache.cocoon.components.source.helpers.SourceProperty;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * This source inspector manage several source inspectors
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: SourceInspectorManager.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class SourceInspectorManager extends AbstractLogEnabled implements 
      SourceInspector, ThreadSafe, Contextualizable, Composable, Configurable, 
      Initializable, Disposable {
  
      private ArrayList inspectors = new ArrayList();
  
      private Context context = null;
      private ComponentManager manager = null;
  
      /**
       * Get the context
       */
      public void contextualize(Context context) throws ContextException {
          this.context = context;
      }
  
      public void compose(ComponentManager manager) {
          this.manager = manager;
      }
  
      /**
       * Pass the Configuration to the Configurable class. This method must 
       * always be called after the constructor and before any other method.
       * 
       * @param configuration the class configurations.
       */
      public void configure(Configuration configuration)
          throws ConfigurationException {
  
          ClassLoader classloader = Thread.currentThread().getContextClassLoader();
  
          final Configuration[] configurations = configuration.getChildren("sourceinspector");
          for(int i=0; i<configurations.length; i++) {
              String className = configurations[i].getAttribute( "class", "" );
  
              SourceInspector inspector = null;
  
              try {
                  final Class inspectorClass = classloader.loadClass(className);
                  inspector = (SourceInspector)inspectorClass.newInstance();
              } catch (InstantiationException ie) {
                  throw new ConfigurationException("Could not instantiate class "+className, ie);
              } catch (ClassNotFoundException cnfe) {
                  throw new ConfigurationException("Could not load class "+className, cnfe);
              } catch (IllegalAccessException iae) {
                   throw new ConfigurationException("Could not load class "+className, iae);
              }
  
              if (inspector instanceof Configurable) 
                  ((Configurable)inspector).configure(configurations[i]);
  
              try {
                  if (inspector instanceof Parameterizable)
                      ((Parameterizable)inspector).parameterize(Parameters.fromConfiguration(configurations[i]));
              } catch (ParameterException pe) {
                  throw new ConfigurationException("Could not parameterize inspector", pe);
              }
  
              inspectors.add(inspector);
          }
      }
  
      /**
       * Initialialize the component. Initialization includes
       * allocating any resources required throughout the
       * components lifecycle.
       *
       * @throws Exception if an error occurs
       */
      public void initialize() throws Exception {
  
          SourceInspector inspector;
          for(int i=0; i<this.inspectors.size(); i++) {
              inspector = (SourceInspector)this.inspectors.get(i);
  
              if (inspector instanceof LogEnabled)
                  ((LogEnabled)inspector).enableLogging(getLogger());
  
              if (inspector instanceof Contextualizable) 
                  ((Contextualizable)inspector).contextualize(this.context);
  
              if (inspector instanceof Composable) 
                  ((Composable)inspector).compose(this.manager);
  
              if (inspector instanceof Initializable) 
                  ((Initializable)inspector).initialize();
          }
      }
  
      /**
       * This method should be implemented to remove all costly resources
       * in object. These resources can be object references, database connections,
       * threads, etc. What is categorised as "costly" resources is determined on
       * a case by case analysis.
       */
      /*public void recycle() {
          SourceInspector inspector;
          for(int i=0; i<this.inspectors.size(); i++) {
              inspector = (SourceInspector)this.inspectors.get(i);
           
              if (inspector instanceof Recyclable)
                  ((Recyclable)inspector).recycle();
          }
      }*/
  
      /**
       * The dispose operation is called at the end of a components lifecycle.
       * This method will be called after Startable.stop() method (if implemented
       * by component). Components use this method to release and destroy any
       * resources that the Component owns.
       */
      public void dispose() {
          SourceInspector inspector;
          for(int i=0; i<this.inspectors.size(); i++) {
              inspector = (SourceInspector)this.inspectors.get(i);
              
              if (inspector instanceof Disposable)
                  ((Disposable)inspector).dispose();
          }
      }
  
      public SourceProperty getSourceProperty(Source source, String namespace, String name) 
          throws SourceException {
  
          SourceInspector inspector;
          SourceProperty property;
          for(int i=0; i<this.inspectors.size(); i++) {
              inspector = (SourceInspector)this.inspectors.get(i);
        
              property = inspector.getSourceProperty(source, namespace, name);
              if (property!=null)
                  return property;
          }
          return null;
      }
  
      public SourceProperty[] getSourceProperties(Source source) throws SourceException {
          ArrayList list = new ArrayList();
  
          SourceInspector inspector;
          SourceProperty[] properties;
          SourceProperty property;
          boolean propertyExists;
          for(int i=0; i<this.inspectors.size(); i++) {
              inspector = (SourceInspector)this.inspectors.get(i);
  
              try {
                  properties = inspector.getSourceProperties(source);
  
                  if (properties!=null)
                      for(int j=0; j<properties.length; j++) {
                          propertyExists = false;
                          for(int k=0; k<list.size() && !propertyExists; k++) {
                              property = (SourceProperty)list.get(k);
                              if ((property.getNamespace().equals(properties[j].getNamespace())) &&
                                  (property.getName().equals(properties[j].getName())))
                                  propertyExists = true;
                      }
                      if (!propertyExists)
                          list.add(properties[j]);
                  }
              } catch (SourceException se) {
                  getLogger().warn("Couldn't get properties from '"+source.getURI()+"'", se);
              }
          }
  
          properties = new SourceProperty[list.size()];
          for(int i=0; i<list.size(); i++)
            properties[i] = (SourceProperty)list.get(i);
  
          return properties;
      }
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/GIFSourceInspector.java
  
  Index: GIFSourceInspector.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.impl;
  
  import java.io.BufferedInputStream;
  import java.io.IOException;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  
  import org.apache.cocoon.components.source.SourceInspector;
  import org.apache.cocoon.components.source.helpers.SourceProperty;
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * This source inspector adds extra attributes for image files.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @author <a href="mailto:balld@webslingerZ.com">Donald A. Ball Jr.</a>
   * @version CVS $Id: GIFSourceInspector.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class GIFSourceInspector extends AbstractLogEnabled implements 
      SourceInspector, ThreadSafe {
  
      private String PROPERTY_NS = "http://apache.org/cocoon/inspector/gif/1.0";
      private static String IMAGE_WIDTH_PROPERTY_NAME = "width";
      private static String IMAGE_HEIGHT_PROPERTY_NAME = "height";
  
      public SourceProperty getSourceProperty(Source source, String namespace, String name) 
          throws SourceException {
  
          if ((namespace.equals(PROPERTY_NS)) && 
              ((name.equals(IMAGE_WIDTH_PROPERTY_NAME)) || (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))) && 
              (source.getURI().endsWith(".gif")) && (isGIFFile(source))) {
  
              if (name.equals(IMAGE_WIDTH_PROPERTY_NAME))
                  return new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, 
                                            String.valueOf(getGifSize(source)[0]));
              if (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))
                  return new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME,
                                            String.valueOf(getGifSize(source)[1]));
          }
          return null;  
      }
  
      public SourceProperty[] getSourceProperties(Source source) throws SourceException {
  
          if ((source.getURI().endsWith(".gif")) &&
              (isGIFFile(source))) {
  
              int[] size = getGifSize(source);
              return new SourceProperty[] {
                  new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, String.valueOf(size[0])),
                  new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME, String.valueOf(size[1]))
              };
          }
          return null;
      }
  
      private boolean isGIFFile(Source source) throws SourceException {
          BufferedInputStream in = null;
          try {
              in = new BufferedInputStream(source.getInputStream());
              byte[] buf = new byte[3];
              int count = in.read(buf, 0, 3);
              if(count < 3) return false;
              if ((buf[0] == (byte)'G') &&
                  (buf[1] == (byte)'I') &&
                  (buf[2] == (byte)'F'))
                  return true;
          } catch (IOException ioe) {
              throw new SourceException("Could not read source", ioe);
          } finally {
              if (in != null) 
                  try { 
                      in.close(); 
                  } catch(Exception e) {}
          }
          return false;
      }
  
      /**
       * Returns width as first element, height as second
       */
      private int[] getGifSize(Source source) throws SourceException {
          BufferedInputStream in = null;
          try {
              in = new BufferedInputStream(source.getInputStream());
              byte[] buf = new byte[10];
              int count = in.read(buf, 0, 10);
              if(count < 10) throw new SourceException("Not a valid GIF file!");
              if((buf[0]) != (byte)'G'
              || (buf[1]) != (byte)'I'
              || (buf[2]) != (byte)'F' )
              throw new SourceException("Not a valid GIF file!");
  
              int w1 = (buf[6] & 0xff) | (buf[6] & 0x80);
              int w2 = (buf[7] & 0xff) | (buf[7] & 0x80);
              int h1 = (buf[8] & 0xff) | (buf[8] & 0x80);
              int h2 = (buf[9] & 0xff) | (buf[9] & 0x80);
  
              int width = w1 + (w2 << 8);
              int height = h1 + (h2 << 8);
  
              int[] dim = { width, height };
              return dim;
          } catch (IOException ioe) {
              throw new SourceException("Could not read source", ioe);
          } finally {
              if (in != null) 
                  try { 
                      in.close(); 
                  } catch (Exception e) {}
          }
      }
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/XPathSourceInspector.java
  
  Index: XPathSourceInspector.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.impl;
  
  import org.apache.excalibur.xml.xpath.XPathProcessor;
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.parameters.Parameterizable;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.components.source.SourceInspector;
  import org.apache.cocoon.components.source.helpers.SourceProperty;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  import org.apache.excalibur.xml.dom.DOMParser;
  import org.w3c.dom.Document;
  import org.w3c.dom.NodeList;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  
  import java.io.IOException;
  
  /**
   * This source inspector inspects XML files with a xpath expression
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: XPathSourceInspector.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class XPathSourceInspector extends AbstractLogEnabled implements 
      SourceInspector, ThreadSafe, Parameterizable {
  
      private String propertynamespace = "http://apache.org/cocoon/inspector/xpath/1.0";
      private String propertyname = "result";
      private String extension = null;
      private String xpath = null;
  
      private ComponentManager manager = null;
  
      public void compose(ComponentManager manager) {
          this.manager = manager;
      }
  
      public void parameterize(Parameters params)  {
          this.propertynamespace = params.getParameter("namespace", 
              "http://apache.org/cocoon/inspector/xpath/1.0");
          this.propertyname = params.getParameter("name", "result");
          this.extension = params.getParameter("extension", ".xml");
          this.xpath = params.getParameter("xpath", "/*");
      }
  
      public SourceProperty getSourceProperty(Source source, String namespace, String name) 
          throws SourceException {
  
          if ((namespace.equals(propertynamespace)) && (name.equals(propertyname)) && 
              (source.getURI().endsWith(extension))) {
  
                  DOMParser parser = null;
              Document doc = null;
              try { 
                  parser = (DOMParser)manager.lookup(DOMParser.ROLE);
  
                  doc = parser.parseDocument(new InputSource(source.getInputStream()));
              } catch (SAXException se) {
                  this.getLogger().error(source.getURI()
                                          + " is not a valid XML file");
              } catch (IOException ioe) {
                  this.getLogger().error("Could not read file", ioe);
              } catch (ComponentException ce) {
                  this.getLogger().error("Could not retrieve component", ce);
              } finally {
                  if (parser!=null)
                      this.manager.release((Component)parser);
              }
  
              if (doc != null) {
  
                  XPathProcessor processor = null;
                  try {
                      processor = (XPathProcessor)manager.lookup(XPathProcessor.ROLE);
  
                      NodeList nodelist = processor.selectNodeList(doc.getDocumentElement(), this.xpath);
  
                      SourceProperty property = new SourceProperty(this.propertynamespace, this.propertyname);
                      property.setValue(nodelist);
  
                      return property;
                  } catch (ComponentException ce) {
                      this.getLogger().error("Could not retrieve component", ce);
                  } finally {
                      if ((processor!=null) && (processor instanceof Component))
                          this.manager.release((Component)processor);
                  }
              }
          } 
          return null;  
      }
  
      public SourceProperty[] getSourceProperties(Source source) throws SourceException {
  
          SourceProperty property = getSourceProperty(source, this.propertynamespace, this.propertyname);
          if (property!=null)
              return new SourceProperty[]{property};
          return null;
      }
  
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/JPEGSourceInspector.java
  
  Index: JPEGSourceInspector.java
  ===================================================================
  /*
   ============================================================================
                     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 Cocoon" 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
   Stefano Mazzocchi  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.source.impl;
  
  import java.io.BufferedInputStream;
  import java.io.IOException;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.components.source.SourceInspector;
  import org.apache.cocoon.components.source.helpers.SourceProperty;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  
  /**
   * This source inspector adds extra attributes for image files.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @author <a href="mailto:balld@webslingerZ.com">Donald A. Ball Jr.</a>
   * @version CVS $Id: JPEGSourceInspector.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $
   */
  public class JPEGSourceInspector extends AbstractLogEnabled implements 
      SourceInspector, ThreadSafe {
  
      private String PROPERTY_NS = "http://apache.org/cocoon/inspector/jpeg/1.0";
      private static String IMAGE_WIDTH_PROPERTY_NAME = "width";
      private static String IMAGE_HEIGHT_PROPERTY_NAME = "height";
  
      public SourceProperty getSourceProperty(Source source, String namespace, String name) 
          throws SourceException {
  
          if ((namespace.equals(PROPERTY_NS)) && 
              ((name.equals(IMAGE_WIDTH_PROPERTY_NAME)) || (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))) && 
              (source.getURI().endsWith(".jpg")) && (isJPEGFile(source))) {
  
              if (name.equals(IMAGE_WIDTH_PROPERTY_NAME))
                  return new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, 
                                            String.valueOf(getJpegSize(source)[0]));
              if (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))
                  return new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME,
                                            String.valueOf(getJpegSize(source)[1]));
          }
          return null;  
      }
  
      public SourceProperty[] getSourceProperties(Source source) throws SourceException {
  
          if ((source.getURI().endsWith(".jpg")) &&
              (isJPEGFile(source))) {
              int[] size = getJpegSize(source);
              return new SourceProperty[] {
                  new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, String.valueOf(size[0])),
                  new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME, String.valueOf(size[1]))
              };
          }
          return null;
      }
  
      private boolean isJPEGFile(Source source) throws SourceException {
          BufferedInputStream in = null;
          try {
              in = new BufferedInputStream(source.getInputStream());
              byte[] buf = new byte[2];
              int count = in.read(buf, 0, 2);
              if (count < 2) 
                  return false;
  
              if ((buf[0] == (byte)0xFF) &&
                  (buf[1] == (byte)0xD8))
                  return true;
          } catch (IOException ioe) {
              throw new SourceException("Could not read source", ioe);
          } finally {
              if (in != null) 
                  try { 
                      in.close(); 
                  } catch(Exception e) {}
          }
          return false;
      }
  
      /**
       * returns width as first element, height as second
       */
      private int[] getJpegSize(Source source) throws SourceException {
          BufferedInputStream in = null;
          try {
              in = new BufferedInputStream(source.getInputStream());
              // check for "magic" header
              byte[] buf = new byte[2];
              int count = in.read(buf, 0, 2);
              if (count < 2) throw new SourceException("Not a valid Jpeg file!");
              if((buf[0]) != (byte)0xFF
              || (buf[1]) != (byte)0xD8 )
              throw new SourceException("Not a valid Jpeg file!");
  
              int width = 0;
              int height = 0;
  
              boolean done = false;
              int ch = 0;
  
              try {
                  while(ch != 0xDA && !done) {
                      /* Find next marker (JPEG markers begin with 0xFF) */
                      while (ch != 0xFF) { ch = in.read(); }
                      /* JPEG markers can be padded with unlimited 0xFF's */
                      while (ch == 0xFF) { ch = in.read(); }
                      /* Now, ch contains the value of the marker. */
                      if(ch >= 0xC0 && ch <= 0xC3) {
                          // skip 3 bytes 
                          in.read();
                          in.read();
                          in.read();
                          height = 256 * in.read();
                          height += in.read();
                          width = 256 * in.read();
                          width += in.read();
                          done = true;
                      } else { 
                          /* We MUST skip variables, since FF's within variable names 
                             are NOT valid JPEG markers */
                          int length = 256 * in.read();
                          length += in.read();
                          if(length < 2) throw new RuntimeException("Erroneous JPEG marker length");
                          for(int foo = 0; foo<length-2; foo++)
                              in.read();
                      }
                  }
              } catch (Exception e) {
                  throw new SourceException("Not a valid Jpeg file!", e);
              }
  
              int[] dim = { width, height };
              return dim;
  
          } catch (IOException ioe) {
              throw new SourceException("Could not read source", ioe);
          } finally {
              if (in != null) 
                  try { 
                      in.close(); 
                  } catch (Exception e) {}
          }
      }
  
  }
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/conf/repository-inspector.xroles
  
  Index: repository-inspector.xroles
  ===================================================================
  <?xml version="1.0"?>
  <xroles xpath="/role-list" unless="role[@name='org.apache.cocoon.components.source.SourceInspector']">
  
    <role name="org.apache.cocoon.components.source.SourceInspector"
          shorthand="source-inspectors"
          default-class="org.apache.cocoon.components.source.impl.SourceInspectorManager"/>
  </xroles>
  
  
  
  1.1                  cocoon-2.1/src/blocks/repository/conf/repository-sourceinspector.xconf
  
  Index: repository-sourceinspector.xconf
  ===================================================================
  <?xml version="1.0"?>
  <xconf xpath="/cocoon" unless="component[@role='org.apache.cocoon.components.source.SourceInspector']">
  
   <!-- Source inspectors:
     Each source inspectors helps to retrieve properties from sources
     -->
   <component role="org.apache.cocoon.components.source.SourceInspector" 
              class="org.apache.cocoon.components.source.impl.SourceInspectorManager"
              logger="core.source.sourceinspector">
  
    <sourceinspector class="org.apache.cocoon.components.source.impl.XPathSourceInspector">
     <parameter name="namespace" value="http://xml.apache.org/cocoon/xdoc/1.0"/>
     <parameter name="name"      value="title"/>
     <parameter name="extension" value=".xdoc"/>
     <parameter name="xpath"     value="/document/header/title"/>
    </sourceinspector>
  
    <sourceinspector class="org.apache.cocoon.components.source.impl.JPEGSourceInspector"/>
    <sourceinspector class="org.apache.cocoon.components.source.impl.GIFSourceInspector"/>
   </component>
  </xconf>
  
  
  
  1.92      +21 -3     cocoon-2.1/gump.xml
  
  Index: gump.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/gump.xml,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- gump.xml	14 Oct 2003 16:40:08 -0000	1.91
  +++ gump.xml	22 Oct 2003 18:53:06 -0000	1.92
  @@ -109,7 +109,7 @@
       <depend project="jakarta-servletapi-4"/>
       <depend project="cocoon-block-velocity"/>
       <depend project="cocoon-block-cron"/>
  -    <depend project="cocoon-block-slide"/>
  +    <depend project="cocoon-block-repository"/>
   
       <work nested="tools/anttasks"/>
       <home nested="build/cocoon-@@DATE@@"/>
  @@ -600,6 +600,7 @@
   
       <depend project="cocoon" inherit="all"/>
       <depend project="cocoon-block-authentication-fw"/>
  +    <depend project="cocoon-block-repository"/>
       <depend project="jta"/>
       <depend project="jakarta-slide"/>
       <depend project="jdom"/>
  @@ -920,7 +921,7 @@
       </ant>
   
       <depend project="cocoon" inherit="all"/>
  -    <depend project="cocoon-block-slide"/>
  +    <depend project="cocoon-block-repository"/>
       <depend project="jakarta-slide"/>
   
       <work nested="build/cocoon-@@DATE@@/blocks/webdav/dest"/>
  @@ -1066,6 +1067,23 @@
       <nag from="Gump" to="dev@cocoon.apache.org"/>
     </project>
   
  +  <project name="cocoon-block-repository" status="unstable">
  +    <package>org.apache.cocoon</package>
  +
  +    <ant target="gump-block">
  +      <property name="block-name" value="repository"/>
  +      <property name="version" value="@@DATE@@"/>
  +    </ant>
  +
  +    <depend project="cocoon" inherit="all"/>
  +
  +    <work nested="tools/anttasks"/>
  +    <home nested="build/cocoon-@@DATE@@"/>
  +
  +    <jar name="blocks/repository-block.jar"/>
  +
  +    <nag from="Gump" to="dev@cocoon.apache.org"/>
  +  </project>
   
     <!--
       ********************************************