You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2002/06/26 17:08:16 UTC

cvs commit: xml-cocoon2/src/scratchpad/webapp/mount/slide rdf2html.xsl sitemap.xmap

stephan     2002/06/26 08:08:16

  Modified:    src/scratchpad/src/org/apache/cocoon/components/repository
                        SourceRepository.java
               src/scratchpad/src/org/apache/cocoon/components/repository/impl
                        SlideLoggerAdapter.java SlideSourceRepository.java
                        slide.xconf
               src/scratchpad/src/org/apache/cocoon/components/source
                        InspectableSource.java
               src/scratchpad/src/org/apache/cocoon/components/source/helpers
                        SourceCredential.java
               src/scratchpad/src/org/apache/cocoon/components/source/impl
                        SlideSource.java
               src/scratchpad/src/org/apache/cocoon/generation
                        SourceDescriptionGenerator.java
               src/scratchpad/webapp/mount/slide rdf2html.xsl sitemap.xmap
  Added:       src/scratchpad/src/org/apache/cocoon/components/source/impl
                        SlideSourceFactory.java slide.xconf
  Removed:     src/scratchpad/src/org/apache/cocoon/components/source/impl
                        RepositorySourceFactory.java repository.xconf
  Log:
  Removed the RepositorySourceFactory and use a SlideSourceFactory
  instead. Too many problems while using the new Source interfaces, before
  the intialization by the SourceResolver. Using constructor parameters
  instead.
  Browsing through the slide repository should now working with slide examples
  in the scratchpad.
  
  Revision  Changes    Path
  1.3       +58 -39    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/SourceRepository.java
  
  Index: SourceRepository.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/SourceRepository.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SourceRepository.java	21 Jun 2002 13:39:42 -0000	1.2
  +++ SourceRepository.java	26 Jun 2002 15:08:16 -0000	1.3
  @@ -1,32 +1,61 @@
  -/* * The Apache Software License, Version 1.1 * * * Copyright (c) 2001 The Apache Software Foundation.  All rights *
  -reserved.  * * Redistribution and use in source and binary forms, with or without * modification, 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 (INCLUDING, 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.  For more * information on the
  -Apache Software Foundation, please see * <http://www.apache.org/>.  */
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, 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 (INCLUDING, 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.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
   
   package org.apache.cocoon.components.repository;
   
  -import org.apache.excalibur.source.Source;
  -import org.apache.excalibur.source.SourceException;
  -
  -import java.util.Map;
  +import org.apache.avalon.framework.component.Component;
   
   /**
    * This interface represents a repository for sources. It is very similar
  @@ -34,22 +63,12 @@
    * Also this interface can contain methods, which aren't source orientated,
    * like user management.
    *
  - * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
  + * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version $Id$
    */
  -public interface SourceRepository {
  +public interface SourceRepository extends Component {
   
       /** Role for the component */
       public final static String ROLE = "org.apache.cocoon.components.repository.SourceRepository";
  -
  -    /**
  -     * Returns a source descriptor from a repository
  -     * 
  -     * @param namespace The namespace represents a 'subrepository'
  -     * @param uri The uniform resource identifier for the source
  -     * @param parameters This is optional.
  -     */
  -    public Source getSource(String namespace, String uri, Map parameters)
  -        throws SourceException;
   }
   
  
  
  
  1.2       +2 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlideLoggerAdapter.java
  
  Index: SlideLoggerAdapter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlideLoggerAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SlideLoggerAdapter.java	11 Jun 2002 18:09:12 -0000	1.1
  +++ SlideLoggerAdapter.java	26 Jun 2002 15:08:16 -0000	1.2
  @@ -55,7 +55,7 @@
   
   package org.apache.cocoon.components.repository.impl;
   
  -import org.apache.log.Logger;
  +import org.apache.avalon.framework.logger.Logger;
   
   /**
    * The class represent an adapter for the logger for jakarta slide
  
  
  
  1.5       +21 -35    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlideSourceRepository.java
  
  Index: SlideSourceRepository.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlideSourceRepository.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SlideSourceRepository.java	22 Jun 2002 18:00:01 -0000	1.4
  +++ SlideSourceRepository.java	26 Jun 2002 15:08:16 -0000	1.5
  @@ -56,6 +56,7 @@
   package org.apache.cocoon.components.repository.impl;
   
   import org.apache.avalon.excalibur.xml.Parser;
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  @@ -64,7 +65,11 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
  -import org.apache.avalon.framework.logger.Loggable;
  +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.LogEnabled;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
   import org.apache.cocoon.components.repository.SourceRepository;
  @@ -74,7 +79,7 @@
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceResolver;
   
  -import org.apache.log.Logger;
  +//import org.apache.log.Logger;
   
   import org.apache.slide.authenticate.CredentialsToken;
   import org.apache.slide.common.EmbeddedDomain;
  @@ -90,7 +95,7 @@
    * @version $Id$
    */
   public class SlideSourceRepository implements Component, SourceRepository, ThreadSafe, 
  -                                              Composable, Configurable, Loggable {
  +                                              Composable, Configurable, LogEnabled, Initializable {
   
       /** The component manager instance */
       protected ComponentManager manager = null;
  @@ -98,12 +103,13 @@
       private EmbeddedDomain domain = new EmbeddedDomain();
       private Logger logger;
       private String file;
  -    private boolean initialized = false;
   
       /**
        * Provide component with a logger.
  +     *
  +     * @param logger the logger
        */
  -    public void setLogger(Logger logger) {
  +    public void enableLogging(Logger logger) {
           this.logger = logger;
           domain.setLogger(new SlideLoggerAdapter(this.logger));
       }
  @@ -129,35 +135,13 @@
       }
   
       /**
  -     * Returns a source descriptor from a repository
  -     * 
  -     * @param namespace The namespace represents a 'subrepository'
  -     * @param uri The uniform resource identifier for the source
  -     * @param parameters This is optional.
  +     * Initialialize the component. Initialization includes
  +     * allocating any resources required throughout the
  +     * components lifecycle.
  +     *
  +     * @throws Exception if an error occurs
        */
  -    public Source getSource(String namespace, String uri, Map parameters)
  -        throws SourceException {
  -
  -        if (!initialized)
  -            initialize();
  -
  -        if (!initialized)
  -            throw new SourceException("Could not initialize Slide repository");
  -
  -        if (namespace==null)
  -            namespace = this.domain.getDefaultNamespace();
  -        
  -        if (this.domain.getNamespaceToken(namespace)==null)
  -            throw new SourceException("Repository with the namespace '"+namespace+"' couldn't be found");
  -        
  -        if ((uri==null) || (uri.length()==0))
  -          //return new SlideSource(domain.getNamespaceToken(namespace), "/");
  -          uri = "/";
  -        
  -        return new SlideSource(domain.getNamespaceToken(namespace), uri);
  -    }
  -
  -    private void initialize() {
  +    public void initialize() throws Exception {
           SourceResolver resolver = null;
           Parser parser = null;
           Source source = null;
  @@ -223,8 +207,10 @@
               this.logger.error("Could not configure Slide domain", ce);
               return;
           }
  +    }
   
  -        initialized = true;
  +    public EmbeddedDomain getDomain() {
  +        return this.domain;
       }
   }
   
  
  
  
  1.6       +1 -1      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/slide.xconf,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- slide.xconf	22 Jun 2002 18:00:01 -0000	1.5
  +++ slide.xconf	26 Jun 2002 15:08:16 -0000	1.6
  @@ -4,7 +4,7 @@
    <!-- Source repositories:
      Each source repository handles serveral sources sorted in namspaces. Which
      can be access via the RepositorySourceFactory.
  -  -->
  +   -->
    <component role="org.apache.cocoon.components.repository.SourceRepositorySelector" 
               class="org.apache.cocoon.components.ExtendedComponentSelector"
               logger="core.repositories"
  
  
  
  1.2       +7 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/InspectableSource.java
  
  Index: InspectableSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/InspectableSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InspectableSource.java	21 Jun 2002 13:39:42 -0000	1.1
  +++ InspectableSource.java	26 Jun 2002 15:08:16 -0000	1.2
  @@ -83,6 +83,11 @@
       /** 
        * Get alll informations 
        */
  -    public Enumeration getSourceProperties() throws SourceException;
  +    public SourceProperty[] getSourceProperties() throws SourceException;
  +
  +    /**
  +     * Remove property
  +     */
  +    public void removeSourceProperty(String namespace, String name) throws SourceException;
   }
   
  
  
  
  1.2       +3 -3      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/helpers/SourceCredential.java
  
  Index: SourceCredential.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/helpers/SourceCredential.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SourceCredential.java	21 Jun 2002 13:39:43 -0000	1.1
  +++ SourceCredential.java	26 Jun 2002 15:08:16 -0000	1.2
  @@ -63,8 +63,8 @@
    */
   public class SourceCredential {
   
  -    private String principal;
  -    private String password;
  +    private String principal = "guest";
  +    private String password = "guest";
   
       /**
        * Create a new credential
  
  
  
  1.4       +72 -58    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java
  
  Index: SlideSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SlideSource.java	24 Jun 2002 16:26:15 -0000	1.3
  +++ SlideSource.java	26 Jun 2002 15:08:16 -0000	1.4
  @@ -63,7 +63,7 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
   import org.apache.cocoon.Constants;
  @@ -76,6 +76,7 @@
   import org.apache.cocoon.components.source.helpers.SourceCredential;
   import org.apache.cocoon.components.source.helpers.SourceLock;
   import org.apache.cocoon.components.source.helpers.SourcePermission;
  +import org.apache.cocoon.components.source.helpers.SourceProperty;
   
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  @@ -87,7 +88,6 @@
   import org.apache.slide.authenticate.SecurityToken;
   import org.apache.slide.common.EmbeddedDomain;
   import org.apache.slide.common.NamespaceAccessToken;
  -//import org.apache.slide.common.ServiceAccessException;
   import org.apache.slide.common.SlideException;
   import org.apache.slide.common.SlideToken;
   import org.apache.slide.common.SlideTokenImpl;
  @@ -107,7 +107,6 @@
   //import org.apache.slide.security.AccessDeniedException;
   import org.apache.slide.security.NodePermission;
   import org.apache.slide.security.Security;
  -//import org.apache.slide.structure.LinkedObjectNotFoundException;
   import org.apache.slide.structure.ObjectNode;
   //import org.apache.slide.structure.ObjectNotFoundException;
   import org.apache.slide.structure.Structure;
  @@ -130,9 +129,9 @@
    * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
    * @version $Id$
    */
  -public class SlideSource extends AbstractLoggable implements 
  -      Source, WriteableSource, TraversableSource, RestrictableSource, 
  -      LockableSource/*, InspectableSource*/, VersionableSource {
  +public class SlideSource extends AbstractLogEnabled implements 
  +      Composable, Source, WriteableSource, TraversableSource, RestrictableSource, 
  +      LockableSource, InspectableSource, VersionableSource {
   
       /** Component manager */
       private ComponentManager manager;
  @@ -140,10 +139,6 @@
       /** Sytem id */
       private String systemid;
   
  -    //private String uri;
  -
  -    //private SourceParameters locationParameters;
  -
       /** Namespace access token. */
       private NamespaceAccessToken nat;
   
  @@ -167,6 +162,9 @@
       /** Slide token. */
       private SlideToken slideToken;
   
  +    /** Pseudo protocol */
  +    private String protocol = "slide";
  +
       /** The URI of the source*/
       private String uri;
   
  @@ -187,12 +185,19 @@
   
       private boolean initialized = false;
   
  -    public SlideSource(NamespaceAccessToken nat, String uri)
  +    public SlideSource(NamespaceAccessToken nat, String protocol, String uri, SourceCredential sourcecredential, 
  +                       String sourcerevision, String sourcerevisionbranch)
           throws SourceException {
   
  +        this.sourcecredential = sourcecredential;
  +
           this.credToken = new CredentialsToken(this.sourcecredential.getPrincipal());
           this.nat = nat;
  +        this.protocol = protocol;
           this.uri = uri;
  +        this.systemid = protocol+":/"+uri; // FIXME dirty hack
  +        this.sourcerevision = sourcerevision;
  +        this.sourcerevisionbranch = sourcerevisionbranch;
   
           this.structure = nat.getStructureHelper();
           this.content = nat.getContentHelper();
  @@ -201,7 +206,35 @@
           this.macro = nat.getMacroHelper();
   
           this.slideToken = new SlideTokenImpl(credToken);
  +    }
   
  +    /**
  +     * Pass the ComponentManager to the composer. The Composable implementation
  +     * should use the specified ComponentManager to acquire the components it needs for execution
  +     *
  +     * @param manager The ComponentManager which this Composable uses
  +     *
  +     * @throws ComponentException
  +     */
  +    public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
  +
  +        try {
  +            initialize();// FIXME SourceResolver doesn't handle Initializable
  +        } catch (Exception e) {
  +            throw new ComponentException("Could not initialize component", e);
  +        }
  +    }
  +
  +    /**
  +     * Initialialize the component. Initialization includes
  +     * allocating any resources required throughout the
  +     * components lifecycle.
  +     *
  +     * @throws Exception if an error occurs
  +     */
  +    public void initialize() throws Exception {
  +    
           try {
               this.revisionDescriptors = content.retrieve(this.slideToken, this.uri);
   
  @@ -211,7 +244,9 @@
               this.sourcerevision = this.revisionDescriptor.getRevisionNumber().toString();
               this.sourcerevisionbranch = this.revisionDescriptor.getBranchName();
   
  -        } catch (RevisionDescriptorNotFoundException e) {
  +        } catch (RevisionDescriptorNotFoundException rdnfe) {
  +
  +            getLogger().warn("Could not retrieve revision descriptor", rdnfe); // FIXME SourceResolver doesn't handle
   
               this.revisionDescriptor = null;
               this.sourcerevision = null;
  @@ -223,18 +258,6 @@
       }
   
       /**
  -     * Pass the ComponentManager to the composer. The Composable implementation
  -     * should use the specified ComponentManager to acquire the components it needs for execution
  -     *
  -     * @param manager The ComponentManager which this Composable uses
  -     *
  -     * @throws ComponentException
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -        this.manager = manager;
  -    }
  -
  -    /**
        * Return an <code>InputStream</code> object to read from the source.
        * This is the data at the point of invocation of this method,
        * so if this is Modifiable, you might get different content
  @@ -506,13 +529,13 @@
       public String getChildSource(int index) throws SourceException {
           try {
               int i=0;
  -            ObjectNode node;
  +            String child;
               for(Enumeration children=structure.retrieve(this.slideToken, 
                   this.uri).enumerateChildren(); children.hasMoreElements();i++) {
     
  -                node = ((ObjectNode)children.nextElement());
  +                child = (String)children.nextElement();
                   if (i==index)
  -                    return node.getUri();
  +                    return protocol+":/"+child;
               }
               return null;
           } catch (SlideException se) {
  @@ -529,9 +552,9 @@
               return null;
   
           if (this.uri.endsWith("/"))
  -           return this.uri.substring(0, this.uri.substring(0,this.uri.length()-1).lastIndexOf("/"));
  +           return protocol+":/"+this.uri.substring(0, this.uri.substring(0,this.uri.length()-1).lastIndexOf("/"));
   
  -        return this.uri.substring(0, this.uri.lastIndexOf("/"));
  +        return protocol+":/"+this.uri.substring(0, this.uri.lastIndexOf("/"));
       }
   
       /** 
  @@ -641,15 +664,15 @@
        *
        * @throws SourceException If an exception occurs during this operation
        */
  -    /*public void setProperty(SourceProperty sourceproperty) throws SourceException {
  +    public void setSourceProperty(SourceProperty sourceproperty) throws SourceException {
           try {
               revisionDescriptor.setProperty(sourceproperty.getName(), sourceproperty.getNamespace(),
  -                                           sourceproperty.getValue());
  +                                           sourceproperty.getValueAsString());
               content.store(slideToken, this.uri, revisionDescriptor, null);
           } catch (SlideException se) {
               throw new SourceException("Could not set property", se);
           }
  -    }*/
  +    }
   
       /**
        * Returns a property from a source.
  @@ -657,26 +680,25 @@
        * @param namespace Namespace of the property
        * @param name Name of the property
        */
  -    /*public SourceProperty getProperty(String namespace, String name) throws SourceException {
  -
  -        if (namespace.equals(DEFAULTNAMESPACE)) {
  +    public SourceProperty getSourceProperty(String namespace, String name) throws SourceException {
   
  -            if (name.equals(PROPERTY_URI))
  -                return new SourceProperty(namespace, name, this.uri);
  -            if (name.equals(PROPERTY_REVISION))
  -                return new SourceProperty(namespace, name, revisionDescriptor.getRevisionNumber().toString());
  -        }
  +        if (revisionDescriptor==null)
  +            return null;
   
           return new SourceProperty(namespace, name,
                   revisionDescriptor.getProperty(name, namespace).getValue().toString());
  -    }*/
  +    }
   
       /**
        * Returns a enumeration of the properties
        *
        * @return Enumeration of SourceProperty
        */
  -    /*public Enumeration getSourceProperties() throws SourceException {
  +    public SourceProperty[] getSourceProperties() throws SourceException {
  +
  +        if (revisionDescriptor==null)
  +            return new SourceProperty[0];
  +
           Vector sourceproperties = new Vector();
   
           NodeProperty property;
  @@ -686,21 +708,13 @@
                                                              property.getValue().toString()));
           }
   
  -        sourceproperties.addElement(new SourceProperty(DEFAULTNAMESPACE, PROPERTY_URI, this.uri));
  -
  -        if (revisionDescriptor.getRevisionNumber()!=null)
  -            sourceproperties.addElement(
  -                new SourceProperty(DEFAULTNAMESPACE, PROPERTY_REVISION,
  -                                   revisionDescriptor.getRevisionNumber().toString()));
  -
  -        if (revisionDescriptor.getBranchName()!=null)
  -            sourceproperties.addElement(
  -                new SourceProperty(DEFAULTNAMESPACE, PROPERTY_BRANCH, revisionDescriptor.getBranchName()));
  -
  -        return sourceproperties.elements();
  -    }*/
  +        SourceProperty[] sourcepropertiesArray = new SourceProperty[sourceproperties.size()];
  +        for(int i=0; i<sourceproperties.size(); i++)
  +            sourcepropertiesArray[i] = (SourceProperty)sourceproperties.elementAt(i);
  +        return sourcepropertiesArray;
  +    }
       
  -    /*public void removeProperty(String namespace, String name) throws SourceException {
  +    public void removeSourceProperty(String namespace, String name) throws SourceException {
           try {
               if (revisionDescriptor!=null) {
                   revisionDescriptor.removeProperty(name,namespace);
  @@ -709,7 +723,7 @@
           } catch (SlideException se) {
               throw new SourceException("Could not remove property", se);
           }
  -    }*/
  +    }
   
       /** 
        * If this source versioned
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSourceFactory.java
  
  Index: SlideSourceFactory.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, 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 (INCLUDING, 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.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.cocoon.components.source.impl;
  
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.configuration.Configurable;
  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.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  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.thread.ThreadSafe;
  
  import org.apache.cocoon.Constants;
  import org.apache.cocoon.components.repository.SourceRepository;
  import org.apache.cocoon.components.repository.impl.SlideSourceRepository;
  import org.apache.cocoon.components.source.RestrictableSource;
  import org.apache.cocoon.components.source.VersionableSource;
  import org.apache.cocoon.components.source.helpers.SourceCredential;
  
  
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  import org.apache.excalibur.source.SourceFactory;
  import org.apache.excalibur.source.SourceParameters;
  
  import org.apache.slide.common.Domain;
  
  import java.io.IOException;
  import java.net.MalformedURLException;
  import java.util.Map;
  
  /**
   * A factory for sources from a Jakarta SLide repository. 
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version $Id: SlideSourceFactory.java,v 1.1 2002/06/26 15:08:16 stephan Exp $
   */
  public class SlideSourceFactory extends AbstractLogEnabled
    implements SourceFactory, ThreadSafe, Composable {
  
      /** The component manager instance */
      private ComponentManager manager = null;
  
      /**
       * Set the current <code>ComponentManager</code> instance used by this
       * <code>Composable</code>.
       */
      public void compose(ComponentManager manager) throws ComponentException {
          this.manager = manager;
      }
  
  
      /**
       * Get a <code>Source</code> object.
       * @param parameters This is optional.
       */
      public Source getSource(String location, Map parameters)
          throws MalformedURLException, IOException, SourceException {
          if ((this.getLogger()!=null) && (this.getLogger().isDebugEnabled())) {
              this.getLogger().debug( "Creating source object for " + location );
          }
  
          String protocol = "slide";
          int position = location.indexOf("://");
          if (position >= 0) {
              protocol = location.substring(0, position);
              position += 3;
          } else
              position = 0;
  
          // create the queryString (if available)
          String queryString = null;
          SourceParameters locationParameters = null;
          int queryStringPos = location.indexOf('?');
          if (queryStringPos != -1) {
              queryString = location.substring(queryStringPos + 1);
              location = location.substring(position-1, queryStringPos);
              locationParameters = new SourceParameters(queryString);
  
          } else if (position > 0) {
              location = location.substring(position-1);
              locationParameters = new SourceParameters();
          }
  
          String repository = locationParameters.getParameter("repository", null);
          String namespace = locationParameters.getParameter("namespace", null);
          String principal = locationParameters.getParameter("principal", "guest");
          String password = locationParameters.getParameter("password", null);
          String revision = locationParameters.getParameter("revision", null);
          String branch = locationParameters.getParameter("branch", null);
  
          SourceCredential credential;
          if (password!=null)
              credential = new SourceCredential(principal, password);
          else
              credential = new SourceCredential(principal);
  
          if (location.length()==0)
            location = "/";
  
          ComponentSelector sourcerepositories = null;
          SourceRepository sourcerepository = null;
          try {
              sourcerepositories = (ComponentSelector)this.manager.lookup(SourceRepository.ROLE+"Selector");
  
              sourcerepository = (SourceRepository)sourcerepositories.select(repository);
  
              if (!(sourcerepository instanceof SlideSourceRepository)) {
                  getLogger().error("Can't get Slide source repository"); 
                  return null;
              }
  
              SlideSourceRepository slidesourcerepository = 
                  (SlideSourceRepository)sourcerepository;
  
              if (namespace==null)
                  namespace = slidesourcerepository.getDomain().getDefaultNamespace();
  
              if (slidesourcerepository.getDomain().getNamespaceToken(namespace)==null)
                  throw new SourceException("Repository with the namespace '"+namespace+"' couldn't be found");
  
              return new SlideSource(slidesourcerepository.getDomain().getNamespaceToken(namespace), 
                                     protocol, location, credential, revision, branch);
  
          } catch (ComponentException ce) {
              getLogger().error("Could not lookup for component.", ce);
          } finally {
              if ((sourcerepository!=null) && (sourcerepository instanceof Component))
                  sourcerepositories.release((Component)sourcerepository);
              sourcerepository = null;
  
              if (sourcerepositories!=null)
                  this.manager.release(sourcerepositories);
              sourcerepositories = null;
          }
  
          return null;
      }
  }
  
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  <?xml version="1.0"?>
  <xconf xpath="/cocoon/source-factories" unless="component-instance[@name='slide']">
      <!-- pseudo protocol for Jakarta Slide repositories -->
      <component-instance name="slide" 
                          class="org.apache.cocoon.components.source.impl.SlideSourceFactory"/>
  </xconf>
  
  
  
  1.3       +83 -13    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/generation/SourceDescriptionGenerator.java
  
  Index: SourceDescriptionGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/generation/SourceDescriptionGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SourceDescriptionGenerator.java	24 Jun 2002 16:26:15 -0000	1.2
  +++ SourceDescriptionGenerator.java	26 Jun 2002 15:08:16 -0000	1.3
  @@ -110,11 +110,15 @@
       /** Namespace of the resource description framework. */
       private static final String SOURCE_NS = "http://xml.apache.org/cocoon/source/1.0";
   
  +    /** The namespace prefix of the source properties. */
  +    private static final String SOURCE_PREFIX          = "source";
  +
       private static final String RDF_NODE_NAME          = "RDF";
       private static final String DESCRIPTION_NODE_NAME  = "Description";
   
       private static final String SEQUENCE_NODE_NAME     = "Seq";
       private static final String SEQUENCEITEM_NODE_NAME = "li";
  +    private static final String RESOURCE_ATTR_NAME     = "resource";
   
       private static final String PERMISSIONS_NODE_NAME  = "permissions";
       private static final String PERMISSION_NODE_NAME   = "permission";
  @@ -133,6 +137,13 @@
       private static final String EXPIRATION_ATTR_NAME   = "expiration";
       private static final String EXCLUSIVE_ATTR_NAME    = "exclusive";
   
  +    private static final String MIMETYPE_NODE_NAME       = "mime-type";
  +    private static final String CONTENTLENGTH_NODE_NAME  = "contentlength";
  +    private static final String LASTMODIFIED_NODE_NAME   = "lastmodified";
  +
  +    private static final String REVISION_NODE_NAME       = "revision";
  +    private static final String REVISIONBRANCH_NODE_NAME = "branch";
  +
       /**
        * Pass the Configuration to the Configurable  class. This method must 
        * always be called after the constructor and before any other method.
  @@ -188,11 +199,53 @@
   
           try {
               AttributesImpl attributes = new AttributesImpl();
  -            attributes.addAttribute("", URI_ATTR_NAME, URI_ATTR_NAME, "CDATA", source.getSystemId());
  +            attributes.addAttribute(RDF_NS, URI_ATTR_NAME, URI_ATTR_NAME, "CDATA", source.getSystemId());
   
               this.contentHandler.startElement(RDF_NS, DESCRIPTION_NODE_NAME, 
                                                RDF_PREFIX+':'+DESCRIPTION_NODE_NAME, attributes);
   
  +            this.contentHandler.startPrefixMapping(SOURCE_PREFIX, SOURCE_NS);
  +
  +            if (source.getMimeType()!=null) {
  +                this.contentHandler.startElement(SOURCE_NS, MIMETYPE_NODE_NAME, 
  +                    SOURCE_PREFIX+":"+MIMETYPE_NODE_NAME, new AttributesImpl());
  +                this.contentHandler.characters(source.getMimeType().toCharArray(), 0,
  +                                               source.getMimeType().length());
  +                this.contentHandler.endElement(SOURCE_NS, MIMETYPE_NODE_NAME, 
  +                    SOURCE_PREFIX+":"+MIMETYPE_NODE_NAME);
  +            }
  +
  +            this.contentHandler.startElement(SOURCE_NS, CONTENTLENGTH_NODE_NAME, 
  +                                             SOURCE_PREFIX+":"+CONTENTLENGTH_NODE_NAME, new AttributesImpl());
  +            this.contentHandler.characters(String.valueOf(source.getContentLength()).toCharArray(), 0,
  +                                           String.valueOf(source.getContentLength()).length());
  +            this.contentHandler.endElement(SOURCE_NS, CONTENTLENGTH_NODE_NAME, SOURCE_PREFIX+":"+CONTENTLENGTH_NODE_NAME);
  +
  +            this.contentHandler.startElement(SOURCE_NS, LASTMODIFIED_NODE_NAME, 
  +                                             SOURCE_PREFIX+":"+LASTMODIFIED_NODE_NAME, new AttributesImpl());
  +            this.contentHandler.characters(String.valueOf(source.getLastModified()).toCharArray(), 0,
  +                                           String.valueOf(source.getLastModified()).length());
  +            this.contentHandler.endElement(SOURCE_NS, LASTMODIFIED_NODE_NAME, SOURCE_PREFIX+":"+LASTMODIFIED_NODE_NAME);
  +
  +            if (source instanceof VersionableSource) {
  +                VersionableSource versionablesource = (VersionableSource)source;
  +                if (versionablesource.isVersioned()) {
  +                    this.contentHandler.startElement(SOURCE_NS, REVISION_NODE_NAME, 
  +                                                     SOURCE_PREFIX+":"+REVISION_NODE_NAME, new AttributesImpl());
  +                    this.contentHandler.characters(versionablesource.getSourceRevision().toCharArray(), 0,
  +                                                   versionablesource.getSourceRevision().length());
  +                    this.contentHandler.endElement(SOURCE_NS, REVISION_NODE_NAME, SOURCE_PREFIX+":"+REVISION_NODE_NAME);
  +
  +                    this.contentHandler.startElement(SOURCE_NS, REVISIONBRANCH_NODE_NAME,
  +                                                     SOURCE_PREFIX+":"+REVISIONBRANCH_NODE_NAME, new AttributesImpl());
  +                    this.contentHandler.characters(versionablesource.getSourceRevisionBranch().toCharArray(), 0,
  +                                                   versionablesource.getSourceRevisionBranch().length());
  +                    this.contentHandler.endElement(SOURCE_NS, REVISIONBRANCH_NODE_NAME, SOURCE_PREFIX+":"+REVISIONBRANCH_NODE_NAME);
  +                }
  +            }
  +
  +            this.contentHandler.endPrefixMapping(SOURCE_PREFIX);
  +
               if (source instanceof InspectableSource)
                   pushSourceProperties((InspectableSource)source);
               /*if (source instanceof RestrictableSource)
  @@ -202,6 +255,18 @@
               if ((source instanceof TraversableSource) && (deep>0))
                   pushSourceChilds((TraversableSource)source, deep);
               this.contentHandler.endElement(RDF_NS, DESCRIPTION_NODE_NAME, RDF_PREFIX+':'+DESCRIPTION_NODE_NAME);
  +
  +            if ((source instanceof TraversableSource) && (deep>0)) {
  +                TraversableSource traversablesource  = (TraversableSource)source;
  +                for(int i=0; i<traversablesource.getChildSourceCount(); i++) {
  +                    try {
  +                        pushSourceDescription(traversablesource.getChildSource(i), deep-1);
  +                    } catch (SourceException se) {
  +                        getLogger().warn("Could not retrieve source", se);
  +                    }
  +                }
  +            }
  +
           } catch (SAXException saxe) {
               throw saxe;
           } finally {
  @@ -215,18 +280,22 @@
           if (source.isSourceCollection()) {
   
               if (source.getChildSourceCount()>0) {
  +
  +                this.contentHandler.startPrefixMapping(SOURCE_PREFIX, SOURCE_NS);
     
                   this.contentHandler.startElement(SOURCE_NS, CHILDREN_NODE_NAME, 
  -                                                 CHILDREN_NODE_NAME, new AttributesImpl());
  +                                                 SOURCE_PREFIX+":"+CHILDREN_NODE_NAME, new AttributesImpl());
                   this.contentHandler.startElement(RDF_NS, SEQUENCE_NODE_NAME,
                                                    RDF_PREFIX+':'+SEQUENCE_NODE_NAME, new AttributesImpl());
     
                   for(int i=0; i<source.getChildSourceCount(); i++) {
   
  -                    this.contentHandler.startElement(RDF_NS, SEQUENCEITEM_NODE_NAME,
  -                                                     RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME, new AttributesImpl());
  +                    AttributesImpl attributes = new AttributesImpl();
  +                    attributes.addAttribute(RDF_NS, RESOURCE_ATTR_NAME, RESOURCE_ATTR_NAME, "CDATA",
  +                                            source.getChildSource(i));
   
  -                    pushSourceDescription(source.getChildSource(i), deep-1);
  +                    this.contentHandler.startElement(RDF_NS, SEQUENCEITEM_NODE_NAME,
  +                                                     RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME, attributes);
   
                       this.contentHandler.endElement(RDF_NS, SEQUENCEITEM_NODE_NAME,
                                                      RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME);
  @@ -234,19 +303,20 @@
   
                   this.contentHandler.endElement(RDF_NS, SEQUENCE_NODE_NAME,
                                                  RDF_PREFIX+':'+SEQUENCE_NODE_NAME);
  -                this.contentHandler.endElement(SOURCE_NS, CHILDREN_NODE_NAME, CHILDREN_NODE_NAME);
  +                this.contentHandler.endElement(SOURCE_NS, CHILDREN_NODE_NAME, SOURCE_PREFIX+":"+CHILDREN_NODE_NAME);
  +
  +                this.contentHandler.endPrefixMapping(SOURCE_PREFIX);
               }
           }
       }
   
       private void pushSourceProperties(InspectableSource source) throws SAXException, SourceException {
  -        Enumeration properties = source.getSourceProperties();
  +        SourceProperty[] properties = source.getSourceProperties();
           SourceProperty property;
  -        while (properties.hasMoreElements()) {
  -
  -            property = (SourceProperty) properties.nextElement();
  +        for (int i=0; i<properties.length; i++) {
  +            property = properties[i];
   
  -            this.contentHandler.startPrefixMapping("", property.getNamespace());
  +            this.contentHandler.startPrefixMapping("prop", property.getNamespace());
   
               this.contentHandler.startElement(property.getNamespace(), property.getName(), 
                                                property.getName(), new AttributesImpl());
  @@ -255,7 +325,7 @@
               this.contentHandler.endElement(property.getNamespace(), property.getName(), 
                                              property.getName());
   
  -            this.contentHandler.endPrefixMapping("");
  +            this.contentHandler.endPrefixMapping("prop");
           }
       }
   
  
  
  
  1.2       +29 -8     xml-cocoon2/src/scratchpad/webapp/mount/slide/rdf2html.xsl
  
  Index: rdf2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/mount/slide/rdf2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- rdf2html.xsl	12 Jun 2002 20:07:38 -0000	1.1
  +++ rdf2html.xsl	26 Jun 2002 15:08:16 -0000	1.2
  @@ -2,7 +2,7 @@
   <xsl:stylesheet version="1.0"
                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  -                xmlns:source="http://xml.apache.org/cocoon/repository"
  +                xmlns:source="http://xml.apache.org/cocoon/source/1.0"
                   xmlns:dav="DAV:">
   
    <xsl:output indent="yes"/>
  @@ -19,7 +19,7 @@
       <title>Jakarta Slide Collection</title>
      </head>
      <body>
  -    <xsl:apply-templates select="rdf:RDF/rdf:Description"/>
  +    <xsl:apply-templates select="rdf:RDF/rdf:Description[1]"/>
      </body>
     </html>   
    </xsl:template>
  @@ -44,7 +44,7 @@
      <tr>
       <td  bgcolor="#cccccc" colspan="5">
        <font size="+2">
  -      <strong>Subject&#160;&#160;<xsl:value-of select="source:uri"/>
  +      <strong>Subject&#160;&#160;<xsl:value-of select="@rdf:about"/>
         </strong>
        </font>
       </td>
  @@ -263,12 +263,12 @@
          <td align="right"></td>
         </tr>
   
  -      <xsl:apply-templates select="source:children/rdf:Seq/rdf:li/rdf:Description" mode="enumerate"/>
  +      <xsl:apply-templates select="source:children/rdf:Seq/rdf:li" mode="enumerate"/>
   
         <tr bgcolor="#eeeeee">
          <form action="" method="post">
           <input type="hidden" name="namespace" value="{$namespace}"/>
  -        <input type="hidden" name="uri" value="{source:uri}"/>
  +        <input type="hidden" name="uri" value="{@rdf:about}"/>
           <td align="left">
            <input name="nodename" type="text" size="30" maxlength="40"/>&#160;&#160;
            <!--<select name="nodetype">
  @@ -353,10 +353,31 @@
     </tr>
    </xsl:template>
   
  - <xsl:template match="rdf:Description" mode="enumerate">
  + <xsl:template match="rdf:li" mode="enumerate">
     <tr bgcolor="#eeeeee">
      <td align="left">&#160;&#160;
  -    <a href="/cocoon/mount/slide/browse/{$namespace}{source:uri}"><tt><xsl:value-of select="source:uri"/></tt></a>
  +    <a href="/cocoon/mount/slide/browse/{substring-after(@rdf:resource,'://')}"
  +      ><tt><xsl:value-of select="@rdf:resource"/></tt></a>
  +   </td>
  +   <xsl:variable name="location"><xsl:value-of select="@rdf:resource"/></xsl:variable>
  +   <td align="left"><tt></tt></td>
  +   <td align="left"><tt><xsl:value-of select="/rdf:RDF/rdf:Description[@rdf:about=$location]/dav:getcontentlength"/></tt></td>
  +   <td align="left"><tt><xsl:value-of select="/rdf:RDF/rdf:Description[@rdf:about=$location]/dav:etlastmodified"/></tt></td>
  +   <td align="right">
  +    <form action="" method="post">
  +     <input type="hidden" name="namespace" value="{$namespace}"/>
  +     <input type="hidden" name="uri" value="{../../@rdf:about}"/>
  +     
  +     <input type="submit" name="cocoon-action-deletenode" value="Delete"/>
  +    </form>
  +   </td>
  +  </tr>
  + </xsl:template>
  +
  +<!-- <xsl:template match="rdf:Description" mode="enumerate">
  +  <tr bgcolor="#eeeeee">
  +   <td align="left">&#160;&#160;
  +    <a href="/cocoon/mount/slide/browse/{source:uri}"><tt><xsl:value-of select="source:uri"/></tt></a>
      </td>
      <td align="left"><tt></tt></td>
      <td align="left"><tt><xsl:value-of select="dav:getcontentlength"/></tt></td>
  @@ -370,6 +391,6 @@
       </form>
      </td>
     </tr>
  - </xsl:template>
  + </xsl:template>-->
   
   </xsl:stylesheet>
  
  
  
  1.5       +19 -4     xml-cocoon2/src/scratchpad/webapp/mount/slide/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/mount/slide/sitemap.xmap,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- sitemap.xmap	22 Jun 2002 18:00:01 -0000	1.4
  +++ sitemap.xmap	26 Jun 2002 15:08:16 -0000	1.5
  @@ -103,7 +103,7 @@
        <map:parameter name="handler" value="slidehandler"/>-->
   
        <map:match pattern="browse/**">
  -      <map:generate type="sourcedescription" src="repository://{1}">
  +      <map:generate type="sourcedescription" src="slide://{1}?principal=root">
          <map:parameter name="repository" value="slide"/>
          <map:parameter name="namespace" value="myrepository"/>
          <map:parameter name="principal" value="root"/>
  @@ -111,14 +111,29 @@
   
         <map:transform src="rdf2html.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
  -       <map:parameter name="namespace" value="{1}"/>
  +       <!--<map:parameter name="namespace" value="{1}"/>-->
         </map:transform>
   
  -      <map:serialize type="html"/>							
  +      <map:serialize type="html"/>
  +     </map:match>
  +
  +     <map:match pattern="test">
  +      <map:generate type="sourcedescription" src="slide://?principal=root">
  +       <map:parameter name="repository" value="slide"/>
  +       <map:parameter name="namespace" value="myrepository"/>
  +       <map:parameter name="principal" value="root"/>
  +      </map:generate>
  +
  +      <!--<map:transform src="rdf2html.xsl">
  +       <map:parameter name="use-request-parameters" value="true"/>
  +       <map:parameter name="namespace" value="{1}"/>
  +      </map:transform>-->
  +
  +      <map:serialize type="html"/>
        </map:match>
   
        <map:match pattern="view/**">
  -      <map:read src="repository://{1}?repository=slide&amp;namespace=myrepository&amp;principal=root"/>
  +      <map:read src="slide://{1}?repository=slide&amp;namespace=myrepository&amp;principal=root"/>
        </map:match>
   
   <!--    </map:act>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org