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/08/05 11:05:43 UTC

cvs commit: xml-cocoon2/src/scratchpad/webapp/samples/slide description2html4content.xsl description2html4locks.xsl description2html4permissions.xsl description2html4properties.xsl sitemap.xmap slide.xconf rdf2html4content.xsl rdf2html4locks.xsl rdf2html4permissions.xsl rdf2html4properties.xsl

stephan     2002/08/05 02:05:43

  Modified:    src/scratchpad/src/org/apache/cocoon/acting
                        SourceMultiAction.java
               src/scratchpad/src/org/apache/cocoon/components/source
                        TraversableSource.java
               src/scratchpad/src/org/apache/cocoon/components/source/impl
                        SlideSource.java
               src/scratchpad/src/org/apache/cocoon/generation
                        SourceDescriptionGenerator.java
                        TextParserGenerator.java
               src/scratchpad/webapp/samples/slide sitemap.xmap slide.xconf
  Added:       src/scratchpad/webapp/samples/slide
                        description2html4content.xsl
                        description2html4locks.xsl
                        description2html4permissions.xsl
                        description2html4properties.xsl
  Removed:     src/scratchpad/webapp/samples/slide rdf2html4content.xsl
                        rdf2html4locks.xsl rdf2html4permissions.xsl
                        rdf2html4properties.xsl
  Log:
  Renamed method getParent to getparentSource from TraversableSource.
  The SourceDescriptionGenerator doesn't use RDF anymore, because the format
  doesn't have any feature from the Generator profits.
  Improve the support of the SourceMultiAction for user authenfication.
  
  Revision  Changes    Path
  1.4       +26 -3     xml-cocoon2/src/scratchpad/src/org/apache/cocoon/acting/SourceMultiAction.java
  
  Index: SourceMultiAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/acting/SourceMultiAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SourceMultiAction.java	21 Jul 2002 22:50:54 -0000	1.3
  +++ SourceMultiAction.java	5 Aug 2002 09:05:42 -0000	1.4
  @@ -227,10 +227,18 @@
           String value = parameters.getParameter(SOURCE_PROPERTY_VALUE, 
               request.getParameter(SOURCE_PROPERTY_VALUE));
   
  +        String principal = parameters.getParameter(PRINCIPAL,
  +            request.getParameter(PRINCIPAL));
  +        String password = parameters.getParameter(PASSWORD,
  +            request.getParameter(PASSWORD));
  +
           try {
   
               Source source = resolver.resolveURI(uri);
   
  +            if (source instanceof RestrictableSource)
  +                ((RestrictableSource)source).setSourceCredential(new SourceCredential(principal, password));
  +
               if (source instanceof InspectableSource) {
                   InspectableSource inspectablesource = (InspectableSource)source;
   
  @@ -262,10 +270,18 @@
           String name = parameters.getParameter(SOURCE_PROPERTY_NAME,
               request.getParameter(SOURCE_PROPERTY_NAME));
   
  +        String principal = parameters.getParameter(PRINCIPAL,
  +            request.getParameter(PRINCIPAL));
  +        String password = parameters.getParameter(PASSWORD,
  +            request.getParameter(PASSWORD));
  +
           try {
   
               Source source = resolver.resolveURI(uri);
   
  +            if (source instanceof RestrictableSource)
  +                ((RestrictableSource)source).setSourceCredential(new SourceCredential(principal, password));
  +
               if (source instanceof InspectableSource) {
                   InspectableSource inspectablesource = (InspectableSource)source;
   
  @@ -291,7 +307,7 @@
           Request request = ObjectModelHelper.getRequest(objectModel);
   
           String uri = parameters.getParameter(SOURCE_URI, request.getParameter(SOURCE_URI));
  -        String principal = parameters.getParameter(SOURCE_PERMISSION_PRINCIPAL,
  +        String subject = parameters.getParameter(SOURCE_PERMISSION_PRINCIPAL,
               request.getParameter(SOURCE_PERMISSION_PRINCIPAL));
           String privilege = parameters.getParameter(SOURCE_PERMISSION_PRIVILEGE,
               request.getParameter(SOURCE_PERMISSION_PRIVILEGE));
  @@ -300,6 +316,11 @@
           boolean negative = Boolean.getBoolean(parameters.getParameter(SOURCE_PERMISSION_NEGATIVE,
               request.getParameter(SOURCE_PERMISSION_NEGATIVE)));
   
  +        String principal = parameters.getParameter(PRINCIPAL,
  +            request.getParameter(PRINCIPAL));
  +        String password = parameters.getParameter(PASSWORD,
  +            request.getParameter(PASSWORD));
  +
           try {
   
               Source source = resolver.resolveURI(uri);
  @@ -307,8 +328,10 @@
               if (source instanceof RestrictableSource) {
                   RestrictableSource restrictablesource = (RestrictableSource)source;
   
  +                restrictablesource.setSourceCredential(new SourceCredential(principal, password));
  +
                   SourcePermission permission = 
  -                    new PrincipalSourcePermission(principal, privilege, inheritable, negative);
  +                    new PrincipalSourcePermission(subject, privilege, inheritable, negative);
   
                   restrictablesource.setSourcePermission(permission);
               } else
  
  
  
  1.2       +2 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/TraversableSource.java
  
  Index: TraversableSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/TraversableSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TraversableSource.java	24 Jun 2002 16:26:15 -0000	1.1
  +++ TraversableSource.java	5 Aug 2002 09:05:42 -0000	1.2
  @@ -89,6 +89,6 @@
        * Return the system if of the parent source. The method should return
        * null if the source hasn't a parent. 
        */
  -    public String getParent();
  +    public String getParentSource();
   }
   
  
  
  
  1.14      +5 -5      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SlideSource.java	26 Jul 2002 12:43:23 -0000	1.13
  +++ SlideSource.java	5 Aug 2002 09:05:42 -0000	1.14
  @@ -639,7 +639,7 @@
        * Return the system if of the parent source. The method should return
        * null if the source hasn't a parent. 
        */
  -    public String getParent() {
  +    public String getParentSource() {
           if ((this.uri==null) || (this.uri.length()<=1))
               return null;
   
  @@ -665,7 +665,7 @@
               return;
   
           this.sourcecredential = sourcecredential;
  -        this.credToken = new CredentialsToken(this.sourcecredential.getPrincipal());
  +        this.credToken = new CredentialsToken(config.getUsersPath()+"/"+this.sourcecredential.getPrincipal());
           this.slideToken = new SlideTokenImpl(credToken);
       }
   
  @@ -682,7 +682,7 @@
   
           String subject = null;
           if (sourcepermission instanceof PrincipalSourcePermission) {
  -            subject = config.getUsersPath()+((PrincipalSourcePermission)sourcepermission).getPrincipal();
  +            subject = config.getUsersPath()+"/"+((PrincipalSourcePermission)sourcepermission).getPrincipal();
   
               // Test if user exists
               try {
  @@ -694,7 +694,7 @@
               }
   
           } else if (sourcepermission instanceof GroupSourcePermission) {
  -            subject = config.getUsersPath()+((GroupSourcePermission)sourcepermission).getGroup();
  +            subject = config.getUsersPath()+"/"+((GroupSourcePermission)sourcepermission).getGroup();
   
               // Test if group exists
               try {
  
  
  
  1.9       +220 -205  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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SourceDescriptionGenerator.java	8 Jul 2002 08:39:25 -0000	1.8
  +++ SourceDescriptionGenerator.java	5 Aug 2002 09:05:43 -0000	1.9
  @@ -56,15 +56,13 @@
   import org.apache.avalon.framework.activity.Disposable;
   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.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.parameters.Parameters;
   
   import org.apache.cocoon.ProcessingException;
  +import org.apache.cocoon.caching.CacheableProcessingComponent;
   import org.apache.cocoon.components.source.TraversableSource;
   import org.apache.cocoon.components.source.InspectableSource;
   import org.apache.cocoon.components.source.LockableSource;
  @@ -78,61 +76,66 @@
   import org.apache.cocoon.components.source.helpers.SourcePermission;
   import org.apache.cocoon.components.source.helpers.SourceProperty;
   import org.apache.cocoon.components.source.helpers.PrincipalSourcePermission;
  -//import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.xml.EmbeddedXMLPipe;
  +import org.apache.cocoon.xml.IncludeXMLConsumer;
   
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  +import org.apache.excalibur.source.SourceValidity;
  +import org.apache.excalibur.source.impl.validity.AggregatedValidity;
   
   import org.xml.sax.SAXException;
   import org.xml.sax.helpers.AttributesImpl;
   
   import java.io.IOException;
  +import java.io.Serializable;
   import java.net.MalformedURLException;
   import java.util.Enumeration;
   import java.util.Date;
   import java.util.Map;
  +import java.util.Stack;
   
   /**
    * Generates an source description from a source of a repository.
  - * The generator uses RDF(http://www.w3.org/RDF/) for the description.
  + * The generator is a combination of a DirectoryGenerator and a Generator
  + * for retrieving SourceProperties, SourcePermission etc.
    *
  - * @author <a href="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
  + * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version CVS $Id$
    */
   public class SourceDescriptionGenerator extends ComposerGenerator 
  -        implements Recyclable, Configurable{
  +        implements CacheableProcessingComponent, Configurable{
   
  -    /** Namespace of the resource description framework. */
  -    private static final String RDF_NS =
  -      "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
  +    /** Namespace of the source description. */
  +    private static final String SOURCE_NS = "http://xml.apache.org/cocoon/source/2.0";
   
  -    /** The namespace prefix of the resource description framework. */
  -    private static final String RDF_PREFIX             = "rdf";
  -
  -    /** 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. */
  +    /** The namespace prefix of the source description. */
       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 SOURCE_NODE_NAME       = "source";
  +
  +    private static final String NAME_ATTR_NAME           = "name";
  +    private static final String SYSTEMID_ATTR_NAME       = "systemid";
  +    private static final String MIMETYPE_ATTR_NAME       = "mime-type";
  +    private static final String CONTENTLENGTH_ATTR_NAME  = "contentlength";
  +    private static final String LASTMODIFIED_ATTR_NAME   = "lastmodified";
  +    private static final String COLLECTION_ATTR_NAME     = "collection";
  +    private static final String PARENT_ATTR_NAME         = "parent";
  +    private static final String REVISION_ATTR_NAME       = "revision";
  +    private static final String REVISIONBRANCH_ATTR_NAME = "branch";
   
  -    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 PROPERTIES_NODE_NAME    = "properties";
  +    private static final String PROPERTY_TYPE_ATTR_NAME = "type";
   
       private static final String PERMISSIONS_NODE_NAME  = "permissions";
       private static final String PERMISSION_NODE_NAME   = "permission";
  +
       private static final String LOCKS_NODE_NAME        = "locks";
       private static final String LOCK_NODE_NAME         = "lock";
  -    private static final String PARENT_NODE_NAME       = "parent";
  +
       private static final String CHILDREN_NODE_NAME     = "children";
    
  -    private static final String URI_ATTR_NAME          = "about";
  -
       private static final String PRINCIPAL_ATTR_NAME    = "principal";
       private static final String GROUP_ATTR_NAME        = "group";
       private static final String PRIVILEGE_ATTR_NAME    = "privilege";
  @@ -143,13 +146,6 @@
       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.
  @@ -169,6 +165,75 @@
       }
   
       /**
  +     * Generate the unique key.
  +     * This key must be unique inside the space of this component.
  +     *
  +     * @return The generated key hashes the src
  +     */
  +    public Serializable generateKey() {
  +        StringBuffer key = new StringBuffer();
  +        key.append("SDG(");
  +        Stack sources = new Stack();
  +        collectSources(sources, this.source, 1);
  +        Source source;
  +        while (!sources.empty()) {
  +            source = (Source)sources.pop();
  +            key.append(source.getSystemId());
  +            if (!sources.empty())
  +                key.append(";");
  +            this.resolver.release(source);
  +        }
  +        key.append(")");
  +        return key.toString();
  +    }
  +
  +    /**
  +     * Generate the validity object.
  +     *
  +     * @return The generated validity object or <code>null</code> if the
  +     *         component is currently not cacheable.
  +     */
  +    public SourceValidity generateValidity() {
  +        AggregatedValidity validity = new AggregatedValidity();
  +        Stack sources = new Stack();
  +        collectSources(sources, this.source, 1);
  +        Source source;
  +        while (!sources.empty()) {
  +            source = (Source)sources.pop();
  +            validity.add(source.getValidity());
  +            this.resolver.release(source);
  +        }
  +        return validity;
  +    }
  +
  +    /**
  +     * Traverse the source tree and retrieve all sources.
  +     */
  +    private void collectSources(Stack sources, String uri, int deep) {
  +        Source source = null;
  +        try {
  +            source = this.resolver.resolveURI(uri);
  +        } catch (Exception urle) {
  +            // ignore
  +            return;
  +        }
  +
  +        sources.push(source);
  +
  +        if (source instanceof TraversableSource) {
  +            TraversableSource traversablesource = (TraversableSource)source;
  +
  +            try {
  +                if (traversablesource.isSourceCollection() && (deep>0)) 
  +                    for(int i=0; i<traversablesource.getChildSourceCount(); i++)
  +                        collectSources(sources, traversablesource.getChildSource(i), deep-1);
  +            } catch (SourceException se) {
  +                // ignore
  +            }
  +        }
  +    }
  +
  +    /**
        * Generate XML data.
        */
       public void generate() throws IOException, SAXException, ProcessingException {
  @@ -176,155 +241,132 @@
           try
           {
               this.contentHandler.startDocument();
  -            this.contentHandler.startPrefixMapping(RDF_PREFIX,RDF_NS);
  -
  -            this.contentHandler.startElement(RDF_NS, RDF_NODE_NAME,
  -                                             RDF_PREFIX+':'+RDF_NODE_NAME, new AttributesImpl());
  +            this.contentHandler.startPrefixMapping(SOURCE_PREFIX,SOURCE_NS);
   
               pushSourceDescription(this.source, 1);
   
  -            this.contentHandler.endElement(RDF_NS, RDF_NODE_NAME, RDF_PREFIX+':'+RDF_NODE_NAME);
  -
  -            this.contentHandler.endPrefixMapping(RDF_PREFIX);
  +            this.contentHandler.endPrefixMapping(SOURCE_PREFIX);
               this.contentHandler.endDocument();
   
           } catch (SourceException se) {
  -          throw new ProcessingException("Could not get source", se);
  +            throw new ProcessingException("Could not get source", se);
           }
       }
   
  -    private void pushSourceDescription(String location, int deep) 
  +    private void pushSourceDescription(String systemid, int deep) 
           throws SAXException, SourceException, ProcessingException, IOException {
   
           Source source = null;
           try { 
  -            source = this.resolver.resolveURI(location);
  +            source = this.resolver.resolveURI(systemid);
           } catch (MalformedURLException urle) {
               throw new ProcessingException("Could not retrieve a source", urle);
           }
   
           try {
               AttributesImpl attributes = new AttributesImpl();
  -            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);
  +            attributes.addAttribute(SOURCE_NS, SYSTEMID_ATTR_NAME, SYSTEMID_ATTR_NAME, "CDATA", 
  +                                    source.getSystemId());
   
  -            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);
  +            String name = source.getSystemId();
  +            if (name.endsWith("://"))
  +                attributes.addAttribute(SOURCE_NS, NAME_ATTR_NAME, NAME_ATTR_NAME, "CDATA", "");
  +            else if (name.endsWith("/")) {
  +                name = name.substring(1, name.length()-1);
  +                attributes.addAttribute(SOURCE_NS, NAME_ATTR_NAME, NAME_ATTR_NAME, "CDATA",
  +                                        name.substring(name.lastIndexOf("/")+1, name.length()));
  +            } else 
  +                attributes.addAttribute(SOURCE_NS, NAME_ATTR_NAME, NAME_ATTR_NAME, "CDATA", 
  +                                        name.substring(name.lastIndexOf("/")+1, name.length()));
  +
  +            if ((source.getMimeType()!=null) && (source.getMimeType().length()>0));
  +                attributes.addAttribute(SOURCE_NS, MIMETYPE_ATTR_NAME, MIMETYPE_ATTR_NAME, "CDATA",
  +                                        source.getMimeType());
  +
  +            if (source.getContentLength()>=0)
  +                attributes.addAttribute(SOURCE_NS, CONTENTLENGTH_ATTR_NAME, CONTENTLENGTH_ATTR_NAME, "CDATA",
  +                                        String.valueOf(source.getContentLength()));
  +
  +            if (source.getLastModified()>0)
  +                attributes.addAttribute(SOURCE_NS, LASTMODIFIED_ATTR_NAME, LASTMODIFIED_ATTR_NAME, "CDATA",
  +                                        String.valueOf(source.getLastModified()));
   
               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);
  +                    if ((versionablesource.getSourceRevision()!=null) && 
  +                        (versionablesource.getSourceRevision().length()>0))
  +                        attributes.addAttribute(SOURCE_NS, REVISION_ATTR_NAME, REVISION_ATTR_NAME, 
  +                                                "CDATA", versionablesource.getSourceRevision());
  +
  +                    if ((versionablesource.getSourceRevisionBranch()!=null) &&
  +                        (versionablesource.getSourceRevisionBranch().length()>0))
  +                        attributes.addAttribute(SOURCE_NS, REVISIONBRANCH_ATTR_NAME, REVISIONBRANCH_ATTR_NAME,
  +                                                "CDATA", versionablesource.getSourceRevisionBranch());
                   }
               }
   
  -            this.contentHandler.endPrefixMapping(SOURCE_PREFIX);
  +            boolean isCollection = false;
  +            TraversableSource traversablesource = null;
  +            if (source instanceof TraversableSource) {
  +                traversablesource = (TraversableSource)source;
   
  -            if (source instanceof InspectableSource)
  -                pushSourceProperties((InspectableSource)source);
  +                isCollection = traversablesource.isSourceCollection();
  +
  +                attributes.addAttribute(SOURCE_NS, COLLECTION_ATTR_NAME, COLLECTION_ATTR_NAME, "CDATA",
  +                                        String.valueOf(isCollection));
   
  -            SourceInspector inspector = null;
  -            try { 
  -                inspector = (SourceInspector)this.manager.lookup(SourceInspector.ROLE);
  -
  -                SourceProperty[] properties = inspector.getSourceProperties(source);
  -                for (int i=0; i<properties.length; i++) 
  -                    properties[i].toSAX(new EmbeddedXMLPipe(this.contentHandler));
  -            } catch (ComponentException ce) {
  -                getLogger().warn("Could not retrieve source inspector", ce);
  -            } finally {
  -                if (inspector!=null)
  -                    this.manager.release(inspector);
  +                String parent = traversablesource.getParentSource();
  +                if ((parent!=null) && (parent.length()>0))
  +                    attributes.addAttribute(SOURCE_NS, PARENT_ATTR_NAME, PARENT_ATTR_NAME, "CDATA",
  +                                            parent);
               }
   
  -            /*this.contentHandler.startPrefixMapping("prop", property.getNamespace());
  +            /*if (isCollection)
  +                this.contentHandler.startElement(SOURCE_NS, COLLECTION_NODE_NAME,
  +                                                 SOURCE_PREFIX+":"+COLLECTION_NODE_NAME, attributes);
  +            else*/
  +                this.contentHandler.startElement(SOURCE_NS, SOURCE_NODE_NAME,
  +                                                 SOURCE_PREFIX+":"+SOURCE_NODE_NAME, attributes);
   
  -            this.contentHandler.startElement(property.getNamespace(), property.getName(), 
  -                                             property.getName(), new AttributesImpl());
  -            this.contentHandler.characters(property.getValue().toString().toCharArray(), 0,
  -                                           property.getValue().toString().length());
  -            this.contentHandler.endElement(property.getNamespace(), property.getName(), 
  -                                           property.getName());
  +            if (source instanceof InspectableSource)
  +                pushLiveSourceProperties((InspectableSource)source);
   
  -            this.contentHandler.endPrefixMapping("prop");*/
  +            pushComputedSourceProperties(source);
   
               try {
                   if (source instanceof RestrictableSource)
                       pushSourcePermissions((RestrictableSource)source);
               } catch (SourceException se) {
  -                getLogger().warn("Could not retrieve source permissions", se);
  +                if (getLogger().isDebugEnabled())
  +                    getLogger().debug("Could not retrieve source permissions", se);
               }
   
               if (source instanceof LockableSource)
                   pushSourceLocks((LockableSource)source);
  -            if (source instanceof TraversableSource) {
  -
  -                TraversableSource traversablesource = (TraversableSource)source;
  -
  -                if (traversablesource.getParent()!=null) {
  -                    this.contentHandler.startElement(SOURCE_NS, PARENT_NODE_NAME,
  -                        SOURCE_PREFIX+":"+PARENT_NODE_NAME, new AttributesImpl());
  -                    this.contentHandler.characters(traversablesource.getParent().toCharArray(), 0,
  -                                                   traversablesource.getParent().length());
  -                    this.contentHandler.endElement(SOURCE_NS, PARENT_NODE_NAME,
  -                        SOURCE_PREFIX+":"+PARENT_NODE_NAME);
  -                }
   
  -                if (deep>0)
  -                    pushSourceChilds(traversablesource, deep);
  -            }
  -
  -            this.contentHandler.endElement(RDF_NS, DESCRIPTION_NODE_NAME, RDF_PREFIX+':'+DESCRIPTION_NODE_NAME);
  -
  -            if ((source instanceof TraversableSource) && (deep>0)) {
  -                TraversableSource traversablesource  = (TraversableSource)source;
  +            if ((isCollection) && (deep>0)) {
  +                this.contentHandler.startElement(SOURCE_NS, CHILDREN_NODE_NAME,
  +                                                 SOURCE_PREFIX+":"+CHILDREN_NODE_NAME, new AttributesImpl());
                   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);
  +                        if (getLogger().isDebugEnabled())
  +                            getLogger().debug("Could not retrieve source", se);
                       }
                   }
  +                this.contentHandler.endElement(SOURCE_NS, SOURCE_NODE_NAME,
  +                                               SOURCE_PREFIX+":"+SOURCE_NODE_NAME);
               }
   
  +            /*if (isCollection)
  +                this.contentHandler.endElement(SOURCE_NS, COLLECTION_NODE_NAME,
  +                                               SOURCE_PREFIX+":"+COLLECTION_NODE_NAME);
  +            else*/
  +                this.contentHandler.endElement(SOURCE_NS, SOURCE_NODE_NAME,
  +                                               SOURCE_PREFIX+":"+SOURCE_NODE_NAME);
  +
           } catch (SAXException saxe) {
               throw saxe;
           } finally {
  @@ -332,62 +374,54 @@
           }
       }
   
  -    private void pushSourceChilds(TraversableSource source, int deep) 
  -        throws SAXException, SourceException, ProcessingException, IOException {
  -
  -        if (source.isSourceCollection()) {
  -
  -            if (source.getChildSourceCount()>0) {
  -
  -                this.contentHandler.startPrefixMapping(SOURCE_PREFIX, SOURCE_NS);
  -  
  -                this.contentHandler.startElement(SOURCE_NS, CHILDREN_NODE_NAME, 
  -                                                 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++) {
  -
  -                    AttributesImpl attributes = new AttributesImpl();
  -                    attributes.addAttribute(RDF_NS, RESOURCE_ATTR_NAME, RESOURCE_ATTR_NAME, "CDATA",
  -                                            source.getChildSource(i));
  -
  -                    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);
  -                }
  -
  -                this.contentHandler.endElement(RDF_NS, SEQUENCE_NODE_NAME,
  -                                               RDF_PREFIX+':'+SEQUENCE_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 {
  +    private void pushLiveSourceProperties(InspectableSource source) throws SAXException, SourceException {
           SourceProperty[] properties = source.getSourceProperties();
           SourceProperty property;
  +
  +        AttributesImpl attributes = new AttributesImpl();
  +        attributes.addAttribute(SOURCE_NS, PROPERTY_TYPE_ATTR_NAME, PROPERTY_TYPE_ATTR_NAME, "CDATA",
  +                                "live");
  +        this.contentHandler.startElement(SOURCE_NS, PROPERTIES_NODE_NAME,
  +                                         SOURCE_PREFIX+":"+PROPERTIES_NODE_NAME, attributes);
  +
  +        IncludeXMLConsumer consumer = new IncludeXMLConsumer(this.contentHandler);
           for (int i=0; i<properties.length; i++) {
               property = properties[i];
   
  -            /*this.contentHandler.startPrefixMapping("prop", property.getNamespace());
  +            this.contentHandler.startPrefixMapping("", property.getNamespace());
  +            //property.toSAX(new EmbeddedXMLPipe(this.contentHandler));
  +            property.toSAX(consumer);
  +            this.contentHandler.endPrefixMapping("");
  +        }
   
  -            this.contentHandler.startElement(property.getNamespace(), property.getName(), 
  -                                             property.getName(), new AttributesImpl());
  -            this.contentHandler.characters(property.getValue().toString().toCharArray(), 0,
  -                                           property.getValue().toString().length());
  -            this.contentHandler.endElement(property.getNamespace(), property.getName(), 
  -                                           property.getName());
  +        this.contentHandler.endElement(SOURCE_NS, PROPERTIES_NODE_NAME,
  +                                       SOURCE_PREFIX+":"+PROPERTIES_NODE_NAME);
  +    }
   
  -            this.contentHandler.endPrefixMapping("prop");*/
  +    private void pushComputedSourceProperties(Source source) throws SAXException, SourceException {
  +        AttributesImpl attributes = new AttributesImpl();
  +        attributes.addAttribute(SOURCE_NS, PROPERTY_TYPE_ATTR_NAME, PROPERTY_TYPE_ATTR_NAME, "CDATA",
  +                                "computed");
  +        this.contentHandler.startElement(SOURCE_NS, PROPERTIES_NODE_NAME,
  +                                         SOURCE_PREFIX+":"+PROPERTIES_NODE_NAME, attributes);
  +
  +        SourceInspector inspector = null;
  +        try {
  +            inspector = (SourceInspector)this.manager.lookup(SourceInspector.ROLE);
   
  -            property.toSAX(new EmbeddedXMLPipe(this.contentHandler));
  +            SourceProperty[] properties = inspector.getSourceProperties(source);
  +            for (int i=0; i<properties.length; i++)
  +                properties[i].toSAX(new EmbeddedXMLPipe(this.contentHandler));
  +        } catch (ComponentException ce) {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("Could not retrieve source inspector", ce);
  +        } finally {
  +            if (inspector!=null)
  +                this.manager.release(inspector);
           }
  +
  +        this.contentHandler.endElement(SOURCE_NS, PROPERTIES_NODE_NAME,
  +                                       SOURCE_PREFIX+":"+PROPERTIES_NODE_NAME);
       }
   
       private void pushSourcePermissions(RestrictableSource source) throws SAXException, SourceException {
  @@ -396,15 +430,10 @@
           if ((permissions!=null) && (permissions.length>0)) {
   
               this.contentHandler.startElement(SOURCE_NS, PERMISSIONS_NODE_NAME,
  -                                             PERMISSIONS_NODE_NAME, new AttributesImpl());
  -            this.contentHandler.startElement(RDF_NS, SEQUENCE_NODE_NAME,
  -                                             RDF_PREFIX+':'+SEQUENCE_NODE_NAME, new AttributesImpl());
  +                                             SOURCE_PREFIX+':'+PERMISSIONS_NODE_NAME, new AttributesImpl());
   
               for(int i=0; i<permissions.length; i++) {
       
  -                this.contentHandler.startElement(RDF_NS, SEQUENCEITEM_NODE_NAME,
  -                                                 RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME, new AttributesImpl());
  -
                   AttributesImpl attributes = new AttributesImpl();
   
                   if (permissions[i] instanceof PrincipalSourcePermission)
  @@ -422,18 +451,13 @@
                                           String.valueOf(permissions[i].isNegative()));
   
                   this.contentHandler.startElement(SOURCE_NS, PERMISSION_NODE_NAME,
  -                                                 PERMISSION_NODE_NAME, attributes);
  +                                                 SOURCE_PREFIX+':'+PERMISSION_NODE_NAME, attributes);
                   this.contentHandler.endElement(SOURCE_NS, PERMISSION_NODE_NAME, 
  -                                               PERMISSION_NODE_NAME);
  -
  -                this.contentHandler.endElement(RDF_NS, SEQUENCEITEM_NODE_NAME, 
  -                                               RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME);
  +                                               SOURCE_PREFIX+':'+PERMISSION_NODE_NAME);
               }
   
  -            this.contentHandler.endElement(RDF_NS, SEQUENCE_NODE_NAME, 
  -                                           RDF_PREFIX+':'+SEQUENCE_NODE_NAME);
               this.contentHandler.endElement(SOURCE_NS, PERMISSIONS_NODE_NAME, 
  -                                           PERMISSIONS_NODE_NAME);
  +                                           SOURCE_PREFIX+':'+PERMISSIONS_NODE_NAME);
           }
       }
   
  @@ -444,17 +468,12 @@
           if (locks.hasMoreElements()) {
   
               this.contentHandler.startElement(SOURCE_NS, LOCKS_NODE_NAME,
  -                                             LOCKS_NODE_NAME, new AttributesImpl());
  -            this.contentHandler.startElement(RDF_NS, SEQUENCE_NODE_NAME,
  -                                             RDF_PREFIX+':'+SEQUENCE_NODE_NAME, new AttributesImpl());
  +                                             SOURCE_PREFIX+':'+LOCKS_NODE_NAME, new AttributesImpl());
   
               while (locks.hasMoreElements()) {
   
                   lock = (SourceLock) locks.nextElement();
   
  -                this.contentHandler.startElement(RDF_NS, SEQUENCEITEM_NODE_NAME,
  -                                                 RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME, new AttributesImpl());
  -
                   AttributesImpl attributes = new AttributesImpl();
                   attributes = new AttributesImpl();
                   attributes.addAttribute("", PRINCIPAL_ATTR_NAME, PRINCIPAL_ATTR_NAME, "CDATA",
  @@ -469,18 +488,14 @@
                                           String.valueOf(lock.isExclusive()));
   
                   this.contentHandler.startElement(SOURCE_NS, LOCK_NODE_NAME, 
  -                                                 LOCK_NODE_NAME, attributes);
  +                                                 SOURCE_PREFIX+':'+LOCK_NODE_NAME, attributes);
                   this.contentHandler.endElement(SOURCE_NS, LOCK_NODE_NAME, 
  -                                               LOCK_NODE_NAME);
  +                                               SOURCE_PREFIX+':'+LOCK_NODE_NAME);
   
  -                this.contentHandler.endElement(RDF_NS, SEQUENCEITEM_NODE_NAME,
  -                                               RDF_PREFIX+':'+SEQUENCEITEM_NODE_NAME);
               }
   
  -            this.contentHandler.endElement(RDF_NS, SEQUENCE_NODE_NAME,
  -                                           RDF_PREFIX+':'+SEQUENCE_NODE_NAME);
               this.contentHandler.endElement(SOURCE_NS, LOCKS_NODE_NAME,
  -                                           LOCKS_NODE_NAME);
  +                                           SOURCE_PREFIX+':'+LOCKS_NODE_NAME);
           }
       }
   }
  
  
  
  1.6       +59 -8     xml-cocoon2/src/scratchpad/src/org/apache/cocoon/generation/TextParserGenerator.java
  
  Index: TextParserGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/generation/TextParserGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TextParserGenerator.java	2 Aug 2002 07:06:20 -0000	1.5
  +++ TextParserGenerator.java	5 Aug 2002 09:05:43 -0000	1.6
  @@ -1,9 +1,56 @@
   /*
  - *  Copyright (C) Chaperon. All rights reserved.                               
  - *  ------------------------------------------------------------------------- 
  - *  This software is published under the terms of the Apache Software License 
  - *  version 1.1, a copy of which has been included  with this distribution in 
  - *  the LICENSE file.                                                         
  + * 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.generation;
  @@ -61,7 +108,7 @@
   /**
    * A genrator that parse text
    *
  - * @author Stephan Michels
  + * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
    * @version CVS $Id$
    */
   public class TextParserGenerator extends ComposerGenerator
  @@ -196,8 +243,10 @@
       /**
        * Generate the unique key.
        * This key must be unique inside the space of this component.
  +     * This method must be invoked before the generateValidity() method.
        *
  -     * @return The generated key hashes the src
  +     * @return The generated key or <code>null</code> if the component
  +     *              is currently not cacheable.
        */
       public Serializable generateKey() {
           return "TPG("+this.inputSource.getSystemId()+";"+this.grammarSource.getSystemId()+")";
  @@ -205,6 +254,8 @@
   
       /**
        * Generate the validity object.
  +     * Before this method can be invoked the generateKey() method
  +     * must be invoked.
        *
        * @return The generated validity object or <code>null</code> if the
        *         component is currently not cacheable.
  
  
  
  1.9       +12 -12    xml-cocoon2/src/scratchpad/webapp/samples/slide/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/sitemap.xmap,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- sitemap.xmap	21 Jul 2002 22:50:55 -0000	1.8
  +++ sitemap.xmap	5 Aug 2002 09:05:43 -0000	1.9
  @@ -155,7 +155,7 @@
         <map:generate type="sourcedescription" src="slide://{1}?cocoon-source-principal=root">
          <map:parameter name="repository" value="slide"/>
          <map:parameter name="namespace" value="myrepository"/>
  -       <map:parameter name="principal" value="root"/>
  +       <map:parameter name="principal" value="../ID"/>
         </map:generate>
   
         <map:serialize type="xml"/>
  @@ -165,11 +165,11 @@
        <map:match pattern="content/**">
         <map:act type="source-actions">
          <map:parameter name="method" value="{request:method}"/>
  -       <map:parameter name="cocoon-source-principal" value="root"/>
  +       <map:parameter name="cocoon-principal" value="../ID"/>
         </map:act>
   
         <map:generate src="cocoon:/description/{1}"/>
  -      <map:transform src="rdf2html4content.xsl"/>
  +      <map:transform src="description2html4content.xsl"/>
         <map:serialize type="html"/>
        </map:match>
   
  @@ -177,11 +177,11 @@
        <map:match pattern="properties/**">
         <map:act type="source-actions">
          <map:parameter name="method" value="{request:method}"/>
  -       <map:parameter name="cocoon-source-principal" value="root"/>
  +       <map:parameter name="cocoon-principal" value="../ID"/>
         </map:act>
   
         <map:generate src="cocoon:/description/{1}"/>
  -      <map:transform src="rdf2html4properties.xsl"/>
  +      <map:transform src="description2html4properties.xsl"/>
         <map:serialize type="html"/>
        </map:match>
   
  @@ -189,11 +189,11 @@
        <map:match pattern="permissions/**">
         <map:act type="source-actions">
          <map:parameter name="method" value="{request:method}"/>
  -       <map:parameter name="cocoon-source-principal" value="root"/>
  +       <map:parameter name="cocoon-principal" value="../ID"/>
         </map:act>
   
         <map:generate src="cocoon:/description/{1}"/>
  -      <map:transform src="rdf2html4permissions.xsl"/>
  +      <map:transform src="description2html4permissions.xsl"/>
         <map:serialize type="html"/>
        </map:match>
   
  @@ -201,30 +201,30 @@
        <map:match pattern="locks/**">
         <map:act type="source-actions">
          <map:parameter name="method" value="{request:method}"/>
  -       <map:parameter name="cocoon-source-principal" value="root"/>
  +       <map:parameter name="cocoon-principal" value="../ID"/>
         </map:act>
   
         <map:generate src="cocoon:/description/{1}"/>
  -      <map:transform src="rdf2html4locks.xsl"/>
  +      <map:transform src="description2html4locks.xsl"/>
         <map:serialize type="html"/>
        </map:match>
   
        <!-- ============= Source direct ================== -->
   
        <map:match pattern="view/**">
  -      <map:read src="slide://{1}?cocoon-source-principal=root"/>
  +      <map:read src="slide://{1}?cocoon-principal={../ID}"/>
        </map:match>
   
        <!-- ============= Repository users =============== -->
        <map:match pattern="users/**">
         <map:act type="principal-actions">
          <map:parameter name="method" value="{request:method}"/>
  -       <map:parameter name="cocoon-caller-principal-name" value="root"/>
  +       <map:parameter name="cocoon-caller-principal-name" value="../ID"/>
         </map:act>
   
         <map:generate type="principallist">
          <map:parameter name="principalprovider" value="slide"/>
  -       <map:parameter name="principalcaller" value="root"/>
  +       <map:parameter name="principalcaller" value="../ID"/>
         </map:generate>
         <map:transform src="principal2html4users.xsl"/>
         <map:serialize type="html"/>
  
  
  
  1.7       +8 -10     xml-cocoon2/src/scratchpad/webapp/samples/slide/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/slide.xconf,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- slide.xconf	21 Jul 2002 22:50:55 -0000	1.6
  +++ slide.xconf	5 Aug 2002 09:05:43 -0000	1.7
  @@ -39,7 +39,7 @@
           a relational database engine written in Java, for more info:
           http://hsqldb.sourceforge.net/
           -->     
  -        <definition>
  +<!--        <definition>
               <store name="jdbc">
               <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
                   <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
  @@ -67,18 +67,17 @@
               </contentstore>
               </store>
               <scope match="/" store="jdbc" />
  -        </definition>
  +        </definition>-->
           <!-- ### MySQL Configuration ###
           The following jdbc sample configuration uses the MySQL Database.
           -->
  -        <!--
           <definition>
               <store name="jdbc">
               <nodestore classname="slidestore.mysql.MySQLDescriptorsStore">
                   <parameter name="driver">org.gjt.mm.mysql.Driver</parameter>
  -                <parameter name="url">jdbc:mysql://localhost/myDB</parameter>
  -                <parameter name="user">cocoon</parameter>
  -                <parameter name="password">cocoon</parameter>
  +                <parameter name="url">jdbc:mysql://localhost/vscmodules</parameter>
  +                <parameter name="user">vscrun</parameter>
  +                <parameter name="password">vscrun</parameter>
               </nodestore>
               <securitystore>
                   <reference store="nodestore" />
  @@ -94,14 +93,13 @@
               </revisiondescriptorstore>
               <contentstore classname="slidestore.mysql.MySQLContentStore">
                   <parameter name="driver">org.gjt.mm.mysql.Driver</parameter>
  -                <parameter name="url">jdbc:mysql://localhost/myDB</parameter>
  -                <parameter name="user">cocoon</parameter>
  -                <parameter name="password">cocoon</parameter>
  +                <parameter name="url">jdbc:mysql://localhost/vscmodules</parameter>
  +                <parameter name="user">vscrun</parameter>
  +                <parameter name="password">vscrun</parameter>
               </contentstore>
               </store>
               <scope match="/" store="jdbc" />
           </definition>
  -        -->
           <!-- ### Mixed JDBC - Filesystem ###
           stores: slidestore.reference.JDBCDescriptorsStore
                   slidestore.reference.FileContentStore
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/description2html4content.xsl
  
  Index: description2html4content.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:source="http://xml.apache.org/cocoon/source/2.0"
                  xmlns:dav="DAV:">
  
   <xsl:output indent="yes"/>
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Apache Cocoon @version@</title>
      <link rel="SHORTCUT ICON" href="favicon.ico"/>
     </head>
     <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
      <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
       <tr>
        <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
        <td width="40%" align="center"><img border="0" src="/cocoon/samples/images/cocoon.gif"/></td>
        <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
       </tr>
       <tr>
         <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
           <tr>
              <td width="90%" align="left" bgcolor="#0086b2"><font size="+1" face="arial,helvetica,sanserif"
      color="#ffffff"><xsl:value-of select="source:source/@source:systemid"/></font></td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a href="/cocoon/samples/slide/users/">
               <i>users</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/content/{substring-after(source:source/@source:systemid,'://')}">
               <i>content</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/properties/{substring-after(source:source/@source:systemid,'://')}">
               <i>properties</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/permissions/{substring-after(source:source/@source:systemid,'://')}">
               <i>permissions</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/locks/{substring-after(source:source/@source:systemid,'://')}">
               <i>locks</i></a>
              </td>
            </tr>
         </table>
       </tr>
      </table>
  
      <xsl:apply-templates select="source:source"/>
  
      <p align="center">
       <font size="-1">
        Copyright &#169; @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
        All rights reserved.
       </font>
      </p>
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="source:source">
  
    <table width="100%">
     <tr>
      <td width="200" valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Navigation</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <xsl:if test="@source:parent">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <a href="/cocoon/samples/slide/content/{substring-after(@source:parent,'://')}">Back</a>
                 </td>
                </tr>
               </xsl:if>
               <tr>
                <td width="100%" bgcolor="#ffffff" align="left">
                 <br/>
                </td>
               </tr>
               <xsl:for-each select="source:children/source:source">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                   <a href="/cocoon/samples/slide/content/{substring-after(@source:systemid,'://')}"
                    ><xsl:value-of select="@source:name"/></a>
                  </font>
                 </td>
                </tr>
               </xsl:for-each>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
  
      <td valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Content</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
  
              <table width="100%" cellspacing="0" cellpadding="5" align="center">
               <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                <tr>
                 <td align="left"><b>Filename</b></td>
                 <td align="left"><b>Type</b></td>
                 <td align="left"><b>Size</b></td>
                 <td align="left"><b>Last Modified</b></td>
                 <td align="right"></td>
                </tr>
  
                <xsl:for-each select="source:children/source:source">
                 <tr>
                  <td align="left">&#160;&#160;
                   <a href="/cocoon/samples/slide/content/{substring-after(@source:systemid,'://')}"
                    ><xsl:value-of select="@source:name"/></a>
                  </td>
                  <xsl:variable name="location"><xsl:value-of select="@"/></xsl:variable>
                  <td align="left"><xsl:value-of
                    select="@source:mime-type"/></td>
                  <td align="left"><xsl:value-of
                    select="@source:contentlength"/></td>
                  <td align="left"><xsl:value-of
                    select="source:properties/dav:getlastmodified"/></td>
                  <td align="right">
                   <form action="" method="post">
                    <input type="hidden" name="method" value="doDeleteSource"/>
                    <input type="hidden" name="cocoon-source-uri" value="{@source:systemid}"/>
                    <input type="submit" name="cocoon-action-deletesource" value="Delete"/>
                   </form>
                  </td>
                 </tr>
                </xsl:for-each>
      
                <tr>
                 <form method="post" enctype="multipart/form-data">
                  <input type="hidden" name="method" value="doUploadSource"/>
                  <input type="hidden" name="cocoon-source-uri" value="{../../@source:systemid}"/>
                  <td align="left">
                   <input type="text" name="cocoon-source-filename" size="25" maxlength="40"/>
                  </td>
                  <td align="left" colspan="3">
                   File:
                   <input type="file" name="cocoon-upload-file" size="25" maxlength="40"/>
                  </td>
                  <td align="right">
                   <input type="submit" name="cocoon-action-upload" value="Upload File" />
                  </td>
                 </form>
                </tr>
               </font>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
     </tr>
    </table>
  
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/description2html4locks.xsl
  
  Index: description2html4locks.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xmlns:source="http://xml.apache.org/cocoon/source/2.0"
                  xmlns:dav="DAV:">
  
   <xsl:output indent="yes"/>
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Apache Cocoon @version@</title>
      <link rel="SHORTCUT ICON" href="favicon.ico"/>
     </head>
     <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
      <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
       <tr>
        <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
        <td width="40%" align="center"><img border="0" src="/cocoon/samples/images/cocoon.gif"/></td>
        <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
       </tr>
       <tr>
         <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
           <tr>
              <td width="90%" align="left" bgcolor="#0086b2"><font size="+1" face="arial,helvetica,sanserif"
      color="#ffffff"><xsl:value-of select="source:source/@source:systemid"/></font></td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a href="/cocoon/samples/slide/users/">
               <i>users</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/content/{substring-after(source:source/@source:systemid,'://')}">
               <i>content</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/properties/{substring-after(source:source/@source:systemid,'://')}">
               <i>properties</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/permissions/{substring-after(source:source/@source:systemid,'://')}">
               <i>permissions</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/locks/{substring-after(source:source/@source:systemid,'://')}">
               <i>locks</i></a>
              </td>
           </tr>
         </table>
       </tr>
      </table>
  
      <xsl:apply-templates select="source:source"/>
  
      <p align="center">
       <font size="-1">
        Copyright &#169; @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
        All rights reserved.
       </font>
      </p>
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="source:source">
  
    <table width="100%">
     <tr>
      <td width="200" valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Navigation</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <xsl:if test="@source:parent">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <a href="/cocoon/samples/slide/content/{substring-after(@source:parent,'://')}">Back</a>
                 </td>
                </tr>
               </xsl:if>
               <tr>
                <td width="100%" bgcolor="#ffffff" align="left">
                 <br/>
                </td>
               </tr>
               <xsl:for-each select="source:children/source:source">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                   <a href="/cocoon/samples/slide/content/{substring-after(@source:systemid,'://')}"
                    ><xsl:value-of select="@source:name"/></a>
                  </font>
                 </td>
                </tr>
               </xsl:for-each>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
  
      <td valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Locks</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                <tr>
                 <td align="left"><b>Subject</b></td>
                 <td align="left"><b>Type</b></td>
                 <td align="left"><b>Expiration</b></td>
                 <td align="left"><b>Inheritable</b></td>
                 <td align="left"><b>Exclusive</b></td>
                 <td align="right"></td>
                </tr>
  
                <xsl:for-each select="source:locks/source:lock">
                 <tr bgcolor="#eeeeee">
                  <td align="left"><xsl:value-of select="@subject"/></td>
                  <td align="left"><xsl:value-of select="@type"/></td>
                  <td align="left"><xsl:value-of select="@expiration"/></td>
                  <td align="left"><xsl:value-of select="@inheritable"/></td>
                  <td align="left"><xsl:value-of select="@exclusive"/></td>
                  <td align="right">
                   <form action="" method="post">
                    <input type="hidden" name="method" value="doDeleteLock"/>
                    <input type="hidden" name="cocoon-source-uri" value="{../../@source:systemid}"/>
                    <input type="hidden" name="cocoon-lock-subject" value="{@subject}"/>
  
                    <input type="submit" name="cocoon-action-deletelock" value="Delete"/>
                   </form>
                  </td>
                 </tr>
                </xsl:for-each>
  
                <tr>
                 <form action="" method="post">
                  <input type="hidden" name="method" value="doAddLock"/>
                  <input type="hidden" name="cocoon-source-uri" value="{@source:systemid}"/>
                  <td align="left">
                   <input name="cocoon-lock-subject" type="text" size="20" maxlength="40"/>
                  </td>
                  <td align="left">
                   <input name="cocoon-lock-type" type="text" size="15" maxlength="40"/>
                  </td>
                  <td align="left">
                   <input name="cocoon-lock-expiration" type="text" size="15" maxlength="40"/>
                  </td>
                  <td align="left">
                   <select name="cocoon-lock-inheritable">
                    <option>true</option>
                    <option>false</option>
                   </select>
                  </td>
                  <td align="left">
                   <select name="cocoon-lock-exclusive">
                    <option>true</option>
                    <option>false</option>
                   </select>
                  </td>
                  <td align="right">
                   <input type="submit" name="cocoon-action-addlock" value="Add/Modify"/>
                  </td>
                 </form>
                </tr>
               </font>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
     </tr>
    </table>
  
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/description2html4permissions.xsl
  
  Index: description2html4permissions.xsl
  ===================================================================
  <?xml version="1.0"?>
  <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/source/1.0"
                  xmlns:dav="DAV:">
  
   <xsl:output indent="yes"/>
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Apache Cocoon @version@</title>
      <link rel="SHORTCUT ICON" href="favicon.ico"/>
     </head>
     <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
      <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
       <tr>
        <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
        <td width="40%" align="center"><img border="0" src="/cocoon/samples/images/cocoon.gif"/></td>
        <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
       </tr>
       <tr>
         <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
           <tr>
              <td width="90%" align="left" bgcolor="#0086b2"><font size="+1" face="arial,helvetica,sanserif"
      color="#ffffff"><xsl:value-of select="source:source/@source:systemid"/></font></td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a href="/cocoon/samples/slide/users/">
               <i>users</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/content/{substring-after(source:source/@source:systemid,'://')}">
               <i>content</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/properties/{substring-after(source:source/@source:systemid,'://')}">
               <i>properties</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/permissions/{substring-after(source:source/@source:systemid,'://')}">
               <i>permissions</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/locks/{substring-after(source:source/@source:systemid,'://')}">
               <i>locks</i></a>
              </td>
           </tr>
         </table>
       </tr>
      </table>
  
      <xsl:apply-templates select="source:source"/>
  
      <p align="center">
       <font size="-1">
        Copyright &#169; @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
        All rights reserved.
       </font>
      </p>
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="source:source">
  
    <table width="100%">
     <tr>
      <td width="200" valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Navigation</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <xsl:if test="@source:parent">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <a href="/cocoon/samples/slide/content/{substring-after(@source:parent,'://')}">Back</a>
                 </td>
                </tr>
               </xsl:if>
               <tr>
                <td width="100%" bgcolor="#ffffff" align="left">
                 <br/>
                </td>
               </tr>
               <xsl:for-each select="source:children/source:source">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                   <a href="/cocoon/samples/slide/content/{substring-after(@source:systemid,'://')}"
                    ><xsl:value-of select="@source:name"/></a>
                  </font>
                 </td>
                </tr>
               </xsl:for-each>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
  
      <td valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">User permissions</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                <tr>
                 <td align="left"><b>Principal</b></td>
                 <td align="left"><b>Privilege</b></td>
                 <td align="left"><b>Inheritable</b></td>
                 <td align="left"><b>Deny</b></td>
                 <td align="right"></td>
                </tr>
  
                <xsl:for-each select="source:permissions/source:permission[@principal]">
                 <tr>
                  <td align="left"><xsl:value-of select="@principal"/><xsl:value-of select="@group"/></td>
                  <td align="left"><xsl:value-of select="@privilege"/></td>
                  <td align="left"><xsl:value-of select="@inheritable"/></td>
                  <td align="left"><xsl:value-of select="@negative"/></td>
                  <td align="right">
                   <form action="" method="post">
                    <input type="hidden" name="method" value="doDeletePermission"/>
                    <input type="hidden" name="cocoon-source-uri" value="{../../@source:systemid}"/>
                    <input type="hidden" name="cocoon-permission-principal" value="{@subject}"/>
                    <input type="hidden" name="cocoon-permission-privilege" value="{@action}"/>
  
                    <input type="submit" name="cocoon-action-deletepermission" value="Delete"/>
                   </form>
                  </td>
                 </tr>
                </xsl:for-each>
  
                <tr>
                 <form action="" method="post">
                  <input type="hidden" name="method" value="doAddPermission"/>
                  <input type="hidden" name="cocoon-source-uri" value="{@source:systemid}"/>
                  <td align="left">
                   <select name="cocoon-permisson-principal">
                    <option>ALL</option>
                    <option>SELF</option>
                    <option>GUEST</option>
                   </select>
                  </td>
                  <td align="left">
                   <select name="cocoon-permisson-privilege">
                    <option>all</option>
                    <option>read</option>
                    <option>write</option>
                    <option>read-acl</option>
                    <option>write-acl</option>
                    <option>read-source</option>
                    <option>create-source</option>
                    <option>remove-source</option>
                    <option>lock-source</option>
                    <option>read-locks</option>
                    <option>read-property</option>
                    <option>create-property</option>
                    <option>modify-property</option>
                    <option>remove-property</option>
                    <option>read-content</option>
                    <option>create-content</option>
                    <option>modify-content</option>
                    <option>remove-content</option>
                    <option>grant-permission</option>
                    <option>revoke-permission</option>
                   </select>
                  </td>
                  <td align="left">
                   <select name="cocoon-permisson-inheritable">
                    <option>true</option>
                    <option>false</option>
                   </select>
                  </td>
                  <td align="left">
                   <select name="cocoon-permisson-negative">
                    <option>true</option>
                    <option>false</option>
                   </select>
                  </td>
                  <td align="right">
                   <input type="submit" name="cocoon-action-addpermission" value="Add/Modify"/>
                  </td>
                 </form>
                </tr>
               </font>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
  
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Group permissions</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <tr>
                <td align="left"><b>Group</b></td>
                <td align="left"><b>Privilege</b></td>
                <td align="left"><b>Inheritable</b></td>
                <td align="left"><b>Deny</b></td>
                <td align="right"></td>
               </tr>
  
               <xsl:for-each select="source:permissions/source:permission[@group]">
                <tr>
                 <td align="left"><xsl:value-of select="@principal"/><xsl:value-of select="@group"/></td>
                 <td align="left"><xsl:value-of select="@privilege"/></td>
                 <td align="left"><xsl:value-of select="@inheritable"/></td>
                 <td align="left"><xsl:value-of select="@negative"/></td>
                 <td align="right">
                  <form action="" method="post">
                   <input type="hidden" name="uri" value="{../../@source:systemid}"/>
                   <input type="hidden" name="permissionprincipal" value="{@subject}"/>
                   <input type="hidden" name="permissionprivilege" value="{@action}"/>
  
                   <input type="submit" name="cocoon-action-deletepermission" value="Delete"/>
                  </form>
                 </td>
                </tr>
               </xsl:for-each>
  
               <tr>
                <form action="" method="post">
                 <input type="hidden" name="uri" value="{@source:systemid}"/>
                 <td align="left">
                  <select name="permissongroup">
                   <option>groupA</option>
                  </select>
                 </td>
                 <td align="left">
                  <select name="permissonprivilege">
                   <option>all</option>
                   <option>read</option>
                   <option>write</option>
                   <option>read-acl</option>
                   <option>write-acl</option>
                   <option>read-source</option>
                   <option>create-source</option>
                   <option>remove-source</option>
                   <option>lock-source</option>
                   <option>read-locks</option>
                   <option>read-property</option>
                   <option>create-property</option>
                   <option>modify-property</option>
                   <option>remove-property</option>
                   <option>read-content</option>
                   <option>create-content</option>
                   <option>modify-content</option>
                   <option>remove-content</option>
                   <option>grant-permission</option>
                   <option>revoke-permission</option>
                  </select>
                 </td>
                 <td align="left">
                  <select name="permissoninheritable">
                   <option>true</option>
                   <option>false</option>
                  </select>
                 </td>
                 <td align="left">
                  <select name="permissondeny">
                   <option>true</option>
                   <option>false</option>
                  </select>
                 </td>
                 <td align="right">
                  <input type="submit" name="cocoon-action-addpermission" value="Add/Modify"/>
                 </td>
                </form>
               </tr>
              </table>
             </td>
            </tr>
           </table>
          </td>
         </tr>
        </tbody>
       </table>
      </td>
     </tr>
    </table>
  
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/samples/slide/description2html4properties.xsl
  
  Index: description2html4properties.xsl
  ===================================================================
  <?xml version="1.0"?>
  <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/source/1.0"
                  xmlns:dav="DAV:">
  
   <xsl:output indent="yes"/>
  
   <xsl:template match="/">
    <html>
     <head>
      <title>Apache Cocoon @version@</title>
      <link rel="SHORTCUT ICON" href="favicon.ico"/>
     </head>
     <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
      <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
       <tr>
        <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
        <td width="40%" align="center"><img border="0" src="/cocoon/samples/images/cocoon.gif"/></td>
        <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
       </tr>
       <tr>
         <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
           <tr>
              <td width="90%" align="left" bgcolor="#0086b2"><font size="+1" face="arial,helvetica,sanserif"
      color="#ffffff"><xsl:value-of select="source:source/@source:systemid"/></font></td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a href="/cocoon/samples/slide/users/">
               <i>users</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/content/{substring-after(source:source/@source:systemid,'://')}">
               <i>content</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/properties/{substring-after(source:source/@source:systemid,'://')}">
               <i>properties</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/permissions/{substring-after(source:source/@source:systemid,'://')}">
               <i>permissions</i></a>
              </td>
              <td nowrap="nowrap" bgcolor="#ffffff"><a
      href="/cocoon/samples/slide/locks/{substring-after(source:source/@source:systemid,'://')}">
               <i>locks</i></a>
              </td>
           </tr>
         </table>
       </tr>
      </table>
  
      <xsl:apply-templates select="source:source"/>
  
      <p align="center">
       <font size="-1">
        Copyright &#169; @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
        All rights reserved.
       </font>
      </p>
     </body>
    </html>
   </xsl:template>
  
   <xsl:template match="source:source">
  
    <table width="100%">
     <tr>
      <td width="200" valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Navigation</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
               <xsl:if test="@source:parent">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <a href="/cocoon/samples/slide/content/{substring-after(@source:parent,'://')}">Back</a>
                 </td>
                </tr>
               </xsl:if>
               <tr>
                <td width="100%" bgcolor="#ffffff" align="left">
                 <br/>
                </td>
               </tr>
               <xsl:for-each select="source:children/source:source">
                <tr>
                 <td width="100%" bgcolor="#ffffff" align="left">
                  <font size="+0" face="arial,helvetica,sanserif" color="#000000">
                   <a href="/cocoon/samples/slide/content/{substring-after(@source:systemid,'://')}"
                    ><xsl:value-of select="@source:name"/></a>
                  </font>
                 </td>
                </tr>
               </xsl:for-each>
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
  
      <td valign="top">
       <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
        <tbody>
         <tr>
          <td>
           <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
             <td bgcolor="#0086b2" width="100%" align="left">
              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff">Properties</font>
             </td>
            </tr>
            <tr>
             <td width="100%" bgcolor="#ffffff" align="left">
              <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%" align="center">
  
               <font size="+0" face="arial,helvetica,sanserif" color="#000000">
  
               <tr>
                <td align="left"><b>Namespace</b></td>
                <td align="left"><b>Name</b></td>
                <td align="left"><b>Value</b></td>
                <td align="right"></td>
               </tr>
  
               <xsl:for-each select="source:properties/*[local-name()!='children' and 
                  local-name()!='permissions' and local-name()!='locks' and
                  local-name()!='parent']">
                <tr>
                 <td align="left"><xsl:value-of select="namespace-uri(.)"/></td>
                 <td align="left"><xsl:value-of select="local-name(.)"/></td>
                 <td align="left"><xsl:value-of select="."/></td>
                 <td align="right">
                  <form action="" method="post">
                   <input type="hidden" name="method" value="doDeleteProperty"/>
                   <input type="hidden" name="cocoon-source-uri" value="{../../@source:systemid}"/>
                   <input type="hidden" name="cocoon-source-property-namespace" value="{namespace-uri()}"/>
                   <input type="hidden" name="cocoon-source-property-name" value="{local-name()}"/>
   
                   <input type="submit" name="cocoon-action-deleteproperty" value="Delete"/>
                  </form>
                 </td>
                </tr>
               </xsl:for-each>
  
               <tr>
                <form action="" method="post">
                 <input type="hidden" name="method" value="doAddProperty"/>
                 <input type="hidden" name="cocoon-source-uri" value="{@source:systemid}"/>
                  <td align="left">
                   <input name="cocoon-source-property-namespace" type="text" size="25" maxlength="40"/>
                  </td>
                  <td align="left">
                   <input name="cocoon-source-property-name" type="text" size="15" maxlength="40"/>
                  </td>
                  <td align="left">
                   <input name="cocoon-source-property-value" type="text" size="15" maxlength="40"/>
                  </td>
                  <td align="right">
                   <input type="submit" name="cocoon-action-addproperty" value="Add/Modify"/>
                  </td>
                 </form>
                </tr>
  
               </font>
  
              </table>
             </td>
            </tr>
           </table>
  
          </td>
         </tr> 
        </tbody>
       </table>
  
       <br/>
      </td>
     </tr>
    </table>
  
   </xsl:template>
  
  </xsl:stylesheet>
  
  
  

----------------------------------------------------------------------
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