cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From step...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/slide/samples/styles content2html.xsl
Date Tue, 13 Apr 2004 14:25:24 GMT
stephan     2004/04/13 07:25:24

  Modified:    src/blocks/slide/WEB-INF slide.xconf
               src/blocks/slide/conf slide-servlet.xweb
               src/blocks/slide/samples flow.js sitemap.xmap
               src/blocks/slide/samples/screens locks.jx permissions.jx
                        users.jx
               src/blocks/slide/samples/styles content2html.xsl
  Added:       src/blocks/slide/java/org/apache/cocoon/components/source
                        SourceDTO.java
               src/blocks/slide/samples/screens content.jx properties.jx
  Log:
  Using jx templates instead of a
  TraversableSourceGenerator and Stylesheet combo
  
  Revision  Changes    Path
  1.11      +17 -4     cocoon-2.1/src/blocks/slide/WEB-INF/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/WEB-INF/slide.xconf,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- slide.xconf	6 Mar 2004 02:26:19 -0000	1.10
  +++ slide.xconf	13 Apr 2004 14:25:23 -0000	1.11
  @@ -226,13 +226,26 @@
                       </objectnode>
                   </objectnode>
                   <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/files">
  +                    <permission action="all" subject="unauthenticated" inheritable="true"/>
                       <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
                       <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
                   </objectnode>
                   <!-- DeltaV: default history and workspace paths -->
  -                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/history"/>
  -                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/workspace"/>
  -                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/workingresource"/>
  +                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/history">
  +                    <permission action="all" subject="unauthenticated" inheritable="true"/>
  +                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
  +                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
  +                </objectnode>
  +                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/workspace">
  +                    <permission action="all" subject="unauthenticated" inheritable="true"/>
  +                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
  +                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
  +                </objectnode>
  +                <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/workingresource">
  +                    <permission action="all" subject="unauthenticated" inheritable="true"/>
  +                    <permission action="/actions/write" subject="/roles/user" inheritable="true"/>
  +                    <permission action="/actions/read-acl" subject="owner" inheritable="true"/>
  +                </objectnode>
               </objectnode>
           </data>
       </namespace>
  @@ -298,7 +311,7 @@
       <parameter name="workspacepath">/workspace</parameter>
       <parameter name="workingresourcepath">/workingresource</parameter>
       <parameter name="auto-version">checkout-checkin</parameter>
  -    <parameter name="auto-version-control">false</parameter>
  +    <parameter name="auto-version-control">true</parameter>
       <parameter name="versioncontrol-exclude"/>
       <parameter name="checkout-fork">forbidden</parameter>
       <parameter name="checkin-fork">forbidden</parameter>
  
  
  
  1.9       +1 -3      cocoon-2.1/src/blocks/slide/conf/slide-servlet.xweb
  
  Index: slide-servlet.xweb
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/conf/slide-servlet.xweb,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- slide-servlet.xweb	6 Mar 2004 06:16:52 -0000	1.8
  +++ slide-servlet.xweb	13 Apr 2004 14:25:23 -0000	1.9
  @@ -19,7 +19,6 @@
     insert-after="servlet[servlet-name = 'Cocoon']">
   
       <!-- Definition and configuration of Slide's WebDAV servlet. -->
  -    <!--
       <servlet>
           <servlet-name>Slide</servlet-name>
           <display-name>Slide DAV Server</display-name>
  @@ -167,6 +166,5 @@
           <servlet-name>Slide</servlet-name>
           <url-pattern>/webdav/*</url-pattern>
       </servlet-mapping>
  -    -->
   
  -</xweb>
  \ No newline at end of file
  +</xweb>
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/components/source/SourceDTO.java
  
  Index: SourceDTO.java
  ===================================================================
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.cocoon.components.source;
  
  import java.io.*;
  import java.util.*;
  
  import org.apache.cocoon.components.source.*;
  import org.apache.cocoon.components.source.helpers.*;
  import org.apache.excalibur.source.*;
  
  /**
   * Data transfer object for a Source object.
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
   * @version CVS $Id: SourceDTO.java,v 1.1 2004/04/13 14:25:23 stephan Exp $
   */
  public class SourceDTO implements Source, ModifiableTraversableSource, 
             MoveableSource, LockableSource, InspectableSource, 
             VersionableSource {
  
      private String uri;
      private String scheme;
      private SourceValidity validity;
      private String mimetype;
      private boolean exists;
      private long contentlength;
      private long lastmodified;
      private ArrayList children = new ArrayList();
      private String name;
      private SourceDTO parent;
      private boolean iscollection;
      private SourceProperty[] properties;
      private boolean isversioned;
      private String revision;
      private String revisionbranch;
      private String lastrevision;
  
      /**
       * Create a data transfer object for a Source.
       *
       * @param source Source
       */
      public SourceDTO(Source source) {
          this(source, true);
      }
  
      /**
       * Create a data transfer object for a Source.
       *
       * @param source Source
       */
      public SourceDTO(Source source, boolean deep) {
          uri = source.getURI();
          scheme = source.getScheme();
          exists = source.exists();
          if (exists) {
              validity = source.getValidity();
              mimetype = source.getMimeType();
              contentlength = source.getContentLength();
              lastmodified = source.getLastModified();
  
              if (source instanceof TraversableSource) {
                  TraversableSource traversablesource = (TraversableSource) source;
    
                  iscollection = traversablesource.isCollection();
  
                  name = traversablesource.getName();
  
                  try {
                      if (iscollection && deep) 
                          for(Iterator i = traversablesource.getChildren().iterator(); i.hasNext(); )
                              children.add(new SourceDTO((Source)i.next(), false));
                  } catch (SourceException se) {}
  
                  try {
                      if (deep && (traversablesource.getParent()!=null))
                          parent = new SourceDTO(traversablesource.getParent(), false);
                  } catch (SourceException se) {}
              }
  
              if (source instanceof InspectableSource) {
                  InspectableSource inspectablesource = (InspectableSource) source;
  
                  try {
                      properties = inspectablesource.getSourceProperties();
                  } catch (SourceException se) {}
              }
  
              if (source instanceof VersionableSource) {
                  VersionableSource versionablesource = (VersionableSource) source;
  
                  try {
                      isversioned = versionablesource.isVersioned();
      
                      if (isversioned) {
                          revision = versionablesource.getSourceRevision();
                          revisionbranch = versionablesource.getSourceRevisionBranch();
                          lastrevision = versionablesource.getLatestSourceRevision();
                      }
                  } catch (SourceException se) {}
              }
          }  
      }
      
      /**
       * Return an <code>InputStream</code> object to read from the source.
       * This is the data at the point of invocation of this method,
       * so if this is Modifiable, you might get different content
       * from two different invocations.
       *
       * @return Input stream for the source.
       *
       * @throws IOException If an IO excepetion occurs.
       * @throws SourceException If an exception occurs.
       */
      public InputStream getInputStream() throws IOException, SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Return the unique identifer for this source
       *
       * @return System identifier for the source.
       */
      public String getURI() {
          return uri;
      }
  
      /**
       * @see org.apache.excalibur.source.Source#getScheme()
       *
       * @return Scheme of the source.
       */
      public String getScheme() {
          return scheme;
      }
  
      /**
       * Return the authority of a URI. This authority is
       * typically defined by an Internet-based server or a scheme-specific
       * registry of naming authorities
       * (see <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>).
       *
       * @return Scheme of the URI.
       */
      public String getAuthority() {
          return SourceUtil.getAuthority(uri);
      }
  
      /**
       * Return the path of a URI. The path contains data, specific to the
       * authority (or the scheme if there is no authority component),
       * identifying the resource within the scope of that scheme and authority
       * (see <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>).
       *
       * @return Path of the URI.
       */
      public String getPath() {
          return SourceUtil.getPath(uri);
      }
  
      /**
       * Return the query of a URI. The query is a string of information to
       * be interpreted by the resource
       * (see <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>).
       *
       * @return Query of the URI.
       */
      public String getQuery() {
          return SourceUtil.getQuery(uri);
      }
  
      /**
       * Return the fragment of a URI. When a URI reference is used to perform
       * a retrieval action on the identified resource, the optional fragment
       * identifier, consists of additional reference information to be
       * interpreted by the user agent after the retrieval action has been
       * successfully completed
       * (see <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>).
       *
       * @return Fragment of the URI.
       */
      public String getFragment() {
          return SourceUtil.getFragment(uri);
      }
  
      /**
       *  Get the Validity object. This can either wrap the last modification
       *  date or the expires information or...
       *  If it is currently not possible to calculate such an information
       *  <code>null</code> is returned.
       *
       * @return Validity for the source.
       */
      public SourceValidity getValidity() {
          return validity;
      }
  
      /**
       * Refresh the content of this object after the underlying data
       * content has changed.
       */
      public void refresh() {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * The mime-type of the content described by this object.
       * If the source is not able to determine the mime-type by itself
       * this can be null.
       *
       * @return Mime type of the source.
       */
      public String getMimeType() {
          return mimetype;
      }
  
      /**
       * Does this source actually exist ?
       *
       * @return true if the resource exists.
       */
      public boolean exists() {
          return exists;
      }
  
      /**
       * Return the content length of the content or -1 if the length is
       * unknown.
       *
       * @return Content length of the source.
       */
      public long getContentLength() {
          return contentlength;
      }
  
      /**
       * Get the last modification date of the source or 0 if it
       * is not possible to determine the date.
       *
       * @return Last modified date of the source.
       */
      public long getLastModified() {
          return lastmodified;
      }
      
      // ---------------------------------------------------- ModifiableTraversableSource
      
      /**
       * Get an <code>OutputStream</code> where raw bytes can be written to.
       * The signification of these bytes is implementation-dependent and
       * is not restricted to a serialized XML document.
       *
       * @return a stream to write to
       *
       * @throws IOException
       * @throws SourceException
       */
      public OutputStream getOutputStream()
        throws IOException, SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Can the data sent to an <code>OutputStream</code> returned by
       * {@link #getOutputStream()} be cancelled ?
       *
       * @param stream The ouput stream, which should be cancelled.
       * @return true if the stream can be cancelled
       */
      public boolean canCancel(OutputStream stream) {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Cancel the data sent to an <code>OutputStream</code> returned by
       * {@link #getOutputStream()}.
       * <p>
       * After cancel, the stream should no more be used.
       *
       * @param stream The ouput stream, which should be cancelled.
       *
       * @throws SourceException If the ouput stream can't be cancelled.
       */
      public void cancel(OutputStream stream) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
      
      /**
       * Delete the source.
       */
      public void delete() {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
      
      public void makeCollection() throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
      
      public Source getChild(String name) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
      
      private Source getChildByPath(String path) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      public Collection getChildren() throws SourceException {
          return children;
      }
      
      public String getName() {
          return name;
      }
      
      public Source getParent() throws SourceException {
          return parent;
  
      }
      
      public boolean isCollection() {
          //System.out.println("uri="+uri+" isCollection="+iscollection);
          return iscollection;
      }
      
      // ---------------------------------------------------- MoveableSource
      
      /**
       * Move the current source to a specified destination.
       *
       * @param source
       *
       * @throws SourceException If an exception occurs during the move.
       */
      public void moveTo(Source source) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Copy the current source to a specified destination.
       *
       * @param source
       *
       * @throws SourceException If an exception occurs during the copy.
       */
      public void copyTo(Source source) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      // ---------------------------------------------------- InspectableSource
      
      /**
       * Returns a property from a source.
       *
       * @param namespace Namespace of the property
       * @param name Name of the property
       *
       * @return Property of the source.
       *
       * @throws SourceException If an exception occurs.
       */
      public SourceProperty getSourceProperty(String namespace, String name) 
          throws SourceException {
          for (int i = 0; i<properties.length; i++)
              if (properties[i].getNamespace().equals(namespace) &&
                  properties[i].getName().equals(name))
                  return properties[i];
          return null;
      }
      
      /**
       * Sets a property for a source.
       *
       * @param property Property of the source
       *
       * @throws SourceException If an exception occurs during this operation
       */
      public void setSourceProperty(SourceProperty property)
            throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Returns a enumeration of the properties
       *
       * @return Enumeration of SourceProperty
       *
       * @throws SourceException If an exception occurs.
       */
      public SourceProperty[] getSourceProperties() throws SourceException {
          //System.out.println("getProperties()");
          //for(int i=0; i<properties.length; i++)
          //  System.out.println(i+". namespace="+properties[i].getNamespace()+" name="+properties[i].getName()+" value="+properties[i].getValue());
          return properties;
      }
  
      /**
       * Remove a specified source property.
       *
       * @param namespace Namespace of the property.
       * @param name Name of the property.
       *
       * @throws SourceException If an exception occurs.
       */
      public void removeSourceProperty(String namespace, String name) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
      
      // ---------------------------------------------------- LockableSource
      
      /**
       * Add a lock to this source
       *
       * @param sourcelock Lock, which should be added
       *
       * @throws SourceException If an exception occurs during this operation
       */
      public void addSourceLocks(SourceLock sourcelock) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Returns a enumeration of the existing locks
       *
       * @return Enumeration of SourceLock
       *
       * @throws SourceException If an exception occurs.
       */
      public SourceLock[] getSourceLocks() throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      // ---------------------------------------------------- VersionableSource
      
      /**
       * If this source versioned
       *
       * @return True if the current source is versioned.
       *
       * @throws SourceException If an exception occurs.
       */
      public boolean isVersioned() throws SourceException {
          return isversioned;
      }
  
      /**
       * Get the current revision of the source
       *
       * @return The current revision of the source
       *
       */
      public String getSourceRevision() {
          return revision;
      }
  
      /**
       * Not implemented.
       * 
       * @param revision The revision, which should be used.
       *
       * @throws SourceException If an exception occurs.
       */
      public void setSourceRevision(String revision) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Get the current branch of the revision from the source
       * 
       * @return The branch of the revision
       *
       * @throws SourceException If an exception occurs.
       */
      public String getSourceRevisionBranch() throws SourceException {
          return revisionbranch;
      }
  
      /**
       * Not implemented.
       * 
       * @param branch The branch, which should be used.
       *
       * @throws SourceException If an exception occurs.
       */
      public void setSourceRevisionBranch(String branch) throws SourceException {
          throw new IllegalStateException("Data transfer object does not support this operation");
      }
  
      /**
       * Get the latest revision
       *
       * @return Last revision of the source.
       *
       * @throws SourceException If an exception occurs.
       */
      public String getLatestSourceRevision() throws SourceException {
          return lastrevision;
      }
  
  }
  
  
  
  
  1.17      +171 -94   cocoon-2.1/src/blocks/slide/samples/flow.js
  
  Index: flow.js
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/flow.js,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- flow.js	17 Mar 2004 22:53:57 -0000	1.16
  +++ flow.js	13 Apr 2004 14:25:23 -0000	1.17
  @@ -16,6 +16,7 @@
   
   importPackage(Packages.org.apache.cocoon.components.modules.input);
   importPackage(Packages.org.apache.cocoon.components.slide);
  +importPackage(Packages.org.apache.cocoon.components.source);
   importPackage(Packages.org.apache.cocoon.components.source.helpers);
   importPackage(Packages.org.apache.cocoon.samples.slide);
   importPackage(Packages.org.apache.excalibur.source);
  @@ -31,27 +32,7 @@
   
   // ---------------------------------------------- authentication
   
  -function protect() {
  -  var path = cocoon.parameters["path"];
  -  if (principal == undefined){
  -    login(path);
  -  }
  -  else {
  -    invoke(path);
  -  }
  -}
  -
  -function invoke(path) {
  -  var func = this["protected_" + path];
  -  if (func != undefined) {
  -    func.apply(this);
  -  }
  -  else {
  -    cocoon.sendPage(path,null);
  -  }
  -}
  -
  -function login(path) {
  +function login() {
     cocoon.session;
     var userid = "";
     while (principal == undefined) {
  @@ -64,78 +45,133 @@
         cocoon.session.setAttribute("slide-principal",principal);
       }
     }
  -  cocoon.redirectTo(path);
   }
   
   function logout() {
     cocoon.session.invalidate();
  -  cocoon.redirectTo("content/");
  +  cocoon.redirectTo(".");
   }
   
   // ---------------------------------------------- file management
   
  +function viewcontent() {
  +  var path     = cocoon.request.getParameter("path");
  +
  +  login();
  +
  +  var location = "slide://" + principal + "@" + namespace + path;
  +  var sourceDTO = null;
  +  var source = null;
  +  try {
  +    source = resolver.resolveURI(location);
  +    sourceDTO = new SourceDTO(source);
  +  }  finally {
  +    if (source != null) {
  +      resolver.release(source);
  +    }
  +  }
  +  cocoon.sendPage("screens/content.html",{source:sourceDTO});
  +}
  +
   // make a new collection
  -function protected_mkcol() {
  -  var baseUri        = "slide://" + principal + "@" + namespace + "/";
  +function makecollection() {
     var parentPath     = cocoon.request.getParameter("parentPath");
     var collectionName = cocoon.request.getParameter("collectionName");
  +
  +  login();
  +
  +  var baseUri        = "slide://" + principal + "@" + namespace + "/";
     var location = baseUri + parentPath + "/" + collectionName;
     var status = repository.makeCollection(location);
   
  -  cocoon.redirectTo("content/" + parentPath);
  +  cocoon.redirectTo("viewcontent.do?path=" + parentPath);
   }
   
   // upload a file
  -function protected_upload() {
  -  var baseUri      = "slide://" + principal + "@" + namespace + "/";
  +function uploadsource() {
     var parentPath   = cocoon.request.getParameter("parentPath");
     var resourceName = cocoon.request.getParameter("resourceName");
  +
  +  //FIXME: retrieve upload object before login
  +  login();
  +
  +  var baseUri      = "slide://" + principal + "@" + namespace + "/";
     var dest = baseUri + parentPath + "/" + resourceName;
     var src  = "upload://uploadFile";
  -  
     var status = repository.save(src,dest);
  -  cocoon.redirectTo("content/" + parentPath);
  +
  +  cocoon.redirectTo("viewcontent.do?path=" + parentPath);
   }
   
   // delete a resource
  -function protected_delete() {
  -  var baseUri = "slide://" + principal + "@" + namespace + "/";
  +function deletesource() {
     var parentPath = cocoon.request.getParameter("parentPath");
     var resourceName = cocoon.request.getParameter("resourceName");
  -  var location = baseUri + parentPath + "/" + resourceName;
     
  +  login();
  +  
  +  var baseUri = "slide://" + principal + "@" + namespace + "/";
  +  var location = baseUri + parentPath + "/" + resourceName;
     var status = repository.remove(location);
  -  cocoon.redirectTo("content/" + parentPath);
  +
  +  cocoon.redirectTo("viewcontent.do?path=" + parentPath);
   }
   
   // ---------------------------------------------- property management
   
  -function protected_addproperty() {
  -  var baseUri      = "slide://" + principal + "@" + nat.getName() + "/";
  +function viewproperties() {
  +  var path     = cocoon.request.getParameter("path");
  +                                                                                                                                                             
  +  login();
  +                                                                                                                                                             
  +  var location = "slide://" + principal + "@" + namespace + path;
  +  var sourceDTO = null;
  +  var source = null;
  +  try {
  +    source = resolver.resolveURI(location);
  +    sourceDTO = new SourceDTO(source);
  +  }  finally {
  +    if (source != null) {
  +      resolver.release(source);
  +    }
  +  }
  +  cocoon.sendPage("screens/properties.html",{source:sourceDTO});
  +}
  +
  +function addproperty() {
     var resourcePath = cocoon.request.getParameter("resourcePath");
  -  var location     = baseUri + resourcePath;
  +  var name         = cocoon.request.getParameter("name");
  +  var namespace    = cocoon.request.getParameter("namespace");
  +  var value        = cocoon.request.getParameter("value");
  +
  +  login();
  +
  +  var baseUri  = "slide://" + principal + "@" + nat.getName() + "/";
  +  var location = baseUri + resourcePath;
  +  var property = new SourceProperty(namespace,name,value);
     var source = null;
     try {
       source = resolver.resolveURI(location);
  -    var name      = cocoon.request.getParameter("name");
  -    var namespace = cocoon.request.getParameter("namespace");
  -    var value     = cocoon.request.getParameter("value");
  -    var property = new SourceProperty(namespace,name,value);
  -    
       source.setSourceProperty(property);
  -  }
  -  finally {
  +  } finally {
       if (source != null) {
         resolver.release(source);
       }
     }
  -  cocoon.redirectTo("properties/" + resourcePath);
  +  cocoon.redirectTo("viewproperties.do?path=" + resourcePath);
   }
   
  -function protected_removeproperty() {
  -  var baseUri = "slide://" + principal + "@" + nat.getName() + "/";
  +function removeproperty() {
     var resourcePath = cocoon.request.getParameter("resourcePath");
  +  var name         = cocoon.request.getParameter("name");
  +  var namespace    = cocoon.request.getParameter("namespace");
  +
  +  login();
  +
  +  var baseUri  = "slide://" + principal + "@" + nat.getName() + "/";
     var location = baseUri + resourcePath;
  +  if (namespace.equals("DAV:"))
  +      throw new IllegalArgumentException("Cannot remove webdav property");
     var source = null;
     try {
       source = resolver.resolveURI(location);
  @@ -148,26 +184,53 @@
         resolver.release(source);
       }
     }
  -  cocoon.redirectTo("properties/" + resourcePath);
  +  cocoon.redirectTo("viewproperties.do?path=" + resourcePath);
   }
   
   // ---------------------------------------------- permission management
   
  -function protected_removePermission() {
  +function viewpermissions() {
  +  var path     = cocoon.request.getParameter("path");
  +                                                                                                                                                             
  +  login();
  +                                                                                                                                                             
  +  var location = "slide://" + principal + "@" + namespace + path;
  +  var sourceDTO = null;
  +  var source = null;
  +  try {
  +    source = resolver.resolveURI(location);
  +    sourceDTO = new SourceDTO(source);
  +  }  finally {
  +    if (source != null) {
  +      resolver.release(source);
  +    }
  +  }
  +                                                                                                                                                             
  +  var roles = AdminHelper.listGroups(nat,principal,"/roles");
  +  var users = AdminHelper.listUsers(nat,principal);
  +  var privileges = AdminHelper.listPrivileges(nat,principal);
  +  cocoon.sendPage("screens/permissions.html",{source:sourceDTO, roles:roles, users:users, privileges:privileges});
  +}
  +
  +function removePermission() {
     var resourcePath = cocoon.request.getParameter("resourcePath");
     var subject      = cocoon.request.getParameter("subject");
     var privilege    = cocoon.request.getParameter("privilege");
  +
  +  login();
     
     AdminHelper.removePermission(nat,principal,resourcePath,subject,privilege);
     cocoon.redirectTo("permissions/" + resourcePath);
   }
   
  -function protected_addPermission() {
  +function addPermission() {
     var resourcePath = cocoon.request.getParameter("resourcePath");
     var subject      = cocoon.request.getParameter("subject");
     var action       = cocoon.request.getParameter("action");
     var inheritable  = cocoon.request.getParameter("inheritable");
     var negative     = cocoon.request.getParameter("negative");
  +
  +  login();
     
     AdminHelper.addPermission(nat,principal,resourcePath,subject,action,inheritable,negative);
     cocoon.redirectTo("permissions/" + resourcePath);
  @@ -175,76 +238,123 @@
   
   // ---------------------------------------------- lock management
   
  -function protected_removelock() {
  +function viewlocks() {
  +  var path     = cocoon.request.getParameter("path");
  +                                                                                                                                                             
  +  login();
  +                                                                                                                                                             
  +  var location = "slide://" + principal + "@" + namespace + path;
  +  var sourceDTO = null;
  +  var source = null;
  +  try {
  +    source = resolver.resolveURI(location);
  +    sourceDTO = new SourceDTO(source);
  +  }  finally {
  +    if (source != null) {
  +      resolver.release(source);
  +    }
  +  }
  +
  +  var roles = AdminHelper.listGroups(nat,principal,"/roles");
  +  var users = AdminHelper.listUsers(nat,principal);
  +  var privileges = AdminHelper.listPrivileges(nat,principal);
  +  cocoon.sendPage("screens/locks.html",{source:sourceDTO, roles:roles, users:users, privileges:privileges});
  +}
  +
  +function removelock() {
     var resourcePath = cocoon.request.getParameter("resourcePath");
     var objectUri    = cocoon.request.getParameter("objectUri");
     var lockId       = cocoon.request.getParameter("lockId");
  +
  +  login();
     
     AdminHelper.removeLock(nat,principal,objectUri,lockId);
  -  cocoon.redirectTo("locks/" + resourcePath);
  +
  +  cocoon.redirectTo("viewlocks.do?path=" + resourcePath);
   }
   
  -function protected_addlock() {
  +function addlock() {
     var resourcePath = cocoon.request.getParameter("resourcePath");
     var subject      = cocoon.request.getParameter("subject");
     var type         = cocoon.request.getParameter("type");
     var exclusive    = cocoon.request.getParameter("exclusive");
     var expiration   = cocoon.request.getParameter("expiration");
     var inheritable  = cocoon.request.getParameter("inheritable");
  +
  +  login();
     
     AdminHelper.addLock(nat,principal,resourcePath,subject,type,expiration,exclusive,inheritable);
     
  -  cocoon.redirectTo("locks/" + resourcePath);
  +  cocoon.redirectTo("viewlocks.do?path=" + resourcePath);
   }
   
   // ---------------------------------------------- user management
   
  -function protected_adduser() {
  +function viewusers() {
  +                                                                                                                                                             
  +  login();
  +                                                                                                                                                             
  +  var roles = AdminHelper.listGroups(nat,principal,"/roles");
  +  var users = AdminHelper.listUsers(nat,principal);
  +  cocoon.sendPage("screens/users.html",{roles:roles, users:users});
  +}
  +
  +function adduser() {
     var username = cocoon.request.getParameter("username");
     var password = cocoon.request.getParameter("password");
  +
  +  login();
     
     AdminHelper.addUser(nat,principal,username,password);
     cocoon.redirectTo("users");
   }
   
  -function protected_addrole () {
  +function addrole () {
     var rolename = cocoon.request.getParameter("rolename");
     
     AdminHelper.addRole(nat,principal,rolename);
     cocoon.redirectTo("users");
   }
   
  -function protected_addgroup () {
  +function addgroup () {
     var groupname = cocoon.request.getParameter("groupname");
  +
  +  login();
     
     AdminHelper.addGroup(nat,principal,groupname);
     cocoon.redirectTo("users");
   }
   
  -function protected_removeobject() {
  +function removeobject() {
     var objecturi = cocoon.request.getParameter("objecturi");
  +
  +  login();
     
     AdminHelper.removeObject(nat,principal,objecturi);
     cocoon.redirectTo("users");
   }
   
  -function protected_addmember() {
  +function addmember() {
     var objecturi  = cocoon.request.getParameter("objecturi");
     var subjecturi = cocoon.request.getParameter("subjecturi");
  +
  +  login();
     
     AdminHelper.addMember(nat,principal,objecturi,subjecturi);
     cocoon.redirectTo("users");
   }
   
  -function protected_removemember() {
  +function removemember() {
     var objecturi  = cocoon.request.getParameter("objecturi");
     var subjecturi = cocoon.request.getParameter("subjecturi");
  +
  +  login();
     
     AdminHelper.removeMember(nat,principal,objecturi,subjecturi);
     cocoon.redirectTo("users");
   }
   
  -function protected_changepwd() {
  +function changepwd() {
     var username = cocoon.request.getParameter("username");
     var password = cocoon.request.getParameter("password");
     
  @@ -252,36 +362,3 @@
     cocoon.redirectTo("users");
   }
   
  -// ---------------------------------------------- screens
  -
  -function screen_permissions() {
  -  var path   = cocoon.parameters["path"];
  -  var permissions = AdminHelper.listPermissions(nat,principal,path);
  -  cocoon.sendPage("screens/permissions.jx",{permissions:permissions});
  -}
  -
  -function screen_locks() {
  -  var path   = cocoon.parameters["path"];
  -  var locks = AdminHelper.listLocks(nat,principal,path);
  -  cocoon.sendPage("screens/locks.jx",{locks:locks});
  -}
  -
  -function screen_privileges() {
  -  var privileges = AdminHelper.listPrivileges(nat,principal);
  -  cocoon.sendPage("screens/privileges.jx",{privileges:privileges});
  -}
  -
  -function screen_groups() {
  -  var groups = AdminHelper.listGroups(nat,principal,"/groups");
  -  cocoon.sendPage("screens/groups.jx",{groups:groups});
  -}
  -
  -function screen_roles() {
  -  var roles = AdminHelper.listGroups(nat,principal,"/roles");
  -  cocoon.sendPage("screens/roles.jx",{roles:roles});
  -}
  -
  -function screen_users() {
  -  var users = AdminHelper.listUsers(nat,principal);
  -  cocoon.sendPage("screens/users.jx",{users:users});
  -}
  
  
  
  1.26      +13 -144   cocoon-2.1/src/blocks/slide/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/sitemap.xmap,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- sitemap.xmap	27 Mar 2004 22:41:58 -0000	1.25
  +++ sitemap.xmap	13 Apr 2004 14:25:24 -0000	1.26
  @@ -17,19 +17,6 @@
   
   <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   
  -<!-- =========================== Components =================================== -->
  -
  -  <map:components>
  -    <map:generators default="file">
  -      <map:generator 
  -        name="traverse" 
  -        src="org.apache.cocoon.generation.TraversableSourceDescriptionGenerator" 
  -        logger="sitemap.generator.traverse"
  -        label="content"
  -      />
  -    </map:generators>
  -  </map:components>
  -
   <!-- ========================== Flowscript ================================= -->
   
     <map:flow language="javascript">
  @@ -55,160 +42,42 @@
      <map:component-configurations>
        <global-variables>
          <namespace>cocoon</namespace>
  -       <base>/samples/slide</base>
  +       <base>/samples/blocks/slide</base>
        </global-variables>
      </map:component-configurations>
  +
  +<!-- =========================== Screens ================================= -->
      
      <map:pipeline internal-only="false" type="noncaching">
  -     <map:match pattern="screens/*/**">
  -       <map:call function="screen_{1}">
  -         <map:parameter name="path" value="{2}" />
  -       </map:call>
  -     </map:match>
        
  -     <map:match pattern="screens/*.jx">
  +     <map:match pattern="screens/*.html">
          <map:generate type="jx" src="screens/{1}.jx" />
  -       <map:serialize type="xml" />
  -     </map:match>
  -     
  -     <map:match pattern="screens/login.html">
  -       <map:generate type="jx" src="screens/login.jx"/>
          <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
            <map:parameter name="contextPath" value="{request:contextPath}"/>
          </map:transform>
  -       <map:serialize/>
  -     </map:match>
  -   </map:pipeline>
  -   
  -   <map:pipeline internal-only="true" type="noncaching">
  -     <!-- ========== general description ========== -->
  -     <map:match pattern="description/**">
  -       <map:generate type="traverse" src="slide://{session-attr:slide-principal}@{global:namespace}/{1}">
  -         <map:parameter name="properties" value="true"/>
  -         <map:parameter name="permissions" value="false"/>
  -         <map:parameter name="locks" value="false"/>
  -         <map:parameter name="version" value="false"/>
  -         <map:parameter name="depth" value="1"/>
  -       </map:generate>
  -       <map:serialize type="xml"/>
  -     </map:match>
  -     
  -     <!-- ============= content ================== -->
  -     <map:match pattern="content/**">
  -       <map:aggregate element="document" label="content">
  -         <map:part src="cocoon:/description/{1}" />
  -       </map:aggregate>
  -       <map:transform src="styles/content2html.xsl">
  -         <map:parameter name="base" value="{request:contextPath}{global:base}"/>
  -         <map:parameter name="path" value="{1}" />
  -         <map:parameter name="namespace" value="{global:namespace}" />
  -         <map:parameter name="principal" value="{session-attr:slide-principal}"/>
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -         <map:parameter name="base" value="{global:base}"/>
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -       </map:transform>
          <map:transform type="xinclude"/>
  -       <map:serialize type="html"/>
  -     </map:match>
  -     
  -     <!-- ============= properties =============== -->
  -     <map:match pattern="properties/**">
  -       <map:aggregate element="document" label="content">
  -         <map:part src="cocoon:/description/{1}" />
  -       </map:aggregate>
  -       <map:transform src="styles/properties2html.xsl">
  -         <map:parameter name="base" value="{request:contextPath}{global:base}"/>
  -         <map:parameter name="path" value="{1}" />
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -       </map:transform>
  -       <map:serialize type="html"/>
  -     </map:match>
  -     
  -     <!-- ============= permissions ============== -->
  -     <map:match pattern="permissions/**">
  -       <map:aggregate element="document" label="content">
  -         <map:part src="cocoon:/screens/permissions/{1}" />
  -         <map:part src="cocoon:/screens/privileges/{1}" />
  -         <map:part src="cocoon:/screens/users/{1}" />
  -         <map:part src="cocoon:/screens/roles/{1}" />
  -         <map:part src="cocoon:/description/{1}" />
  -       </map:aggregate>
  -       <map:transform src="styles/permissions2html.xsl">
  -         <map:parameter name="base" value="{request:contextPath}{global:base}"/>
  -         <map:parameter name="path" value="{1}" />
  -         <map:parameter name="userspath" value="{slide-config:/userspath}" />
  -         <map:parameter name="rolespath" value="{slide-config:/rolespath}" />
  -         <map:parameter name="actionspath" value="{slide-config:/actionspath}" />
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -       </map:transform>
  -       <map:serialize type="html"/>
  -     </map:match>
  -     
  -     <!-- ============= locks ==================== -->
  -     <map:match pattern="locks/**">
  -       <map:aggregate element="document" label="content">
  -         <map:part src="cocoon:/screens/locks/{1}" />
  -         <map:part src="cocoon:/screens/privileges/{1}" />
  -         <map:part src="cocoon:/screens/users/{1}" />
  -         <map:part src="cocoon:/screens/roles/{1}" />
  -         <map:part src="cocoon:/description/{1}" />
  -       </map:aggregate>
  -       <map:transform src="styles/locks2html.xsl">
  -         <map:parameter name="base" value="{request:contextPath}{global:base}"/>
  -         <map:parameter name="path" value="{1}" />
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -       </map:transform>
  -       <map:serialize type="html"/>
  -     </map:match>
  -     
  -     <!-- ============= users ==================== -->
  -     <map:match pattern="users">
  -       <map:aggregate element="document" label="content">
  -         <map:part src="cocoon:/screens/users/"/>
  -         <map:part src="cocoon:/screens/roles/" />
  -       </map:aggregate>
  -       <map:transform src="styles/users2html.xsl">
  -         <map:parameter name="base" value="{request:contextPath}{global:base}"/>
  -         <map:parameter name="userspath" value="{slide-config:/userspath}" />
  -         <map:parameter name="rolespath" value="{slide-config:/rolespath}" />
  -       </map:transform>
  -       <map:transform src="context://samples/common/style/xsl/html/complex-page2html.xsl">
  -         <map:parameter name="contextPath" value="{request:contextPath}"/>
  -       </map:transform>
  -       <map:serialize type="html"/>
  -     </map:match>
  -     
  -     <!-- catch unmatched sendpage -->
  -     <map:match pattern="**">
  -       <map:read src="none" status-code="404" />
  +       <map:serialize/>
        </map:match>
        
      </map:pipeline>
  +
  +<!-- ======================== Flow handling ============================== -->
      
      <map:pipeline type="noncaching">
        <map:match pattern="">
  -       <map:redirect-to uri="content/"/>
  +       <map:redirect-to uri="viewcontent.do?path=/"/>
        </map:match>
        
  -     <map:match pattern="**.cont">
  +     <map:match pattern="*.cont">
          <map:call continuation="{request-param:continuationId}" />
        </map:match>
        
  -     <map:match pattern="logout">
  -       <map:call function="logout"/>
  +     <map:match pattern="*.do">
  +       <map:call function="{1}"/>
        </map:match>
  -          
  +
        <map:match pattern="**">
  -       <map:call function="protect">
  -         <map:parameter name="path" value="{1}" />
  -       </map:call>
  +      <map:read src="slide://{session-attr:slide-principal}@{global:namespace}/{1}"/>
        </map:match>
      </map:pipeline>
      
  
  
  
  1.3       +141 -13   cocoon-2.1/src/blocks/slide/samples/screens/locks.jx
  
  Index: locks.jx
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/screens/locks.jx,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- locks.jx	6 Mar 2004 06:16:52 -0000	1.2
  +++ locks.jx	13 Apr 2004 14:25:24 -0000	1.3
  @@ -14,16 +14,144 @@
     See the License for the specific language governing permissions and
     limitations under the License.
   -->
  -<locks xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
  -  <jx:forEach var="lock" items="${locks}">
  -    <lock>
  -      <id>${lock.getLockId()}</id>
  -      <object>${lock.getObjectUri()}</object>
  -      <type>${lock.getTypeUri()}</type>
  -      <subject>${lock.getSubjectUri()}</subject>
  -      <expiration>${lock.getExpirationDate()}</expiration>
  -      <exclusive>${lock.isExclusive()}</exclusive>
  -      <inheritable>${lock.isInheritable()}</inheritable>
  -    </lock>
  -  </jx:forEach>
  -</locks>
  +<document xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
  +          xmlns:xi="http://www.w3.org/2001/XInclude">
  +  <header>
  +    <title>Jakarta Slide example</title>
  +    <tab title="users"       href="viewusers.do"/>
  +    <tab title="content"     href="viewcontent.do?path=${source.path}"/>
  +    <tab title="properties"  href="viewproperties.do?path=${source.path}"/>
  +    <tab title="permissions" href="viewpermissions.do?path=${source.path}"/>
  +    <tab title="locks"       href="viewlocks.do?path=${source.path}"/>
  +    <tab title="logout"      href="logout.do"/>
  +  </header>
  +  <body>
  +    <row> 
  +      <column title="Navigation">
  +        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  +          <jx:forEach var="source" items="${source.children}">
  +            <tr>
  +              <td width="100%" align="left">
  +                <a href="viewlocks.do?path=${source.path}">
  +                  ${source.name}
  +                </a>
  +              </td>
  +            </tr>
  +          </jx:forEach>
  +          <jx:if test="${source.parent}">
  +            <tr>
  +              <td width="100%" align="left">
  +                <br/>
  +                  <a href="viewlocks.do?path=${source.parent.path}">
  +                    ..
  +                  </a>
  +              </td>
  +            </tr>
  +          </jx:if>
  +        </table>
  +      </column>
  +      <column title="Locks">
  +        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  +          <tr>
  +            <td align="left">
  +              <b>Subject</b>
  +            </td>
  +            <td align="left">
  +              <b>Type</b>
  +            </td>
  +            <td align="left">
  +              <b>Expiration (mins)</b>
  +            </td>
  +            <td align="left">
  +              <b>Inheritable</b>
  +            </td>
  +            <td align="left">
  +              <b>Exclusive</b>
  +            </td>
  +            <td align="right"/>
  +          </tr>
  +          <jx:forEach var="lock" items="${source.locks}">
  +            <tr bgcolor="#eeeeee">
  +              <td align="left">
  +                ${lock.subject}
  +              </td>
  +              <td align="left">
  +                ${lock.type}
  +              </td>
  +              <td align="left">
  +                ${lock.expiration}
  +              </td>
  +              <td align="left">
  +                ${lock.inheritable}
  +              </td>
  +              <td align="left">
  +                ${lock.exclusive}
  +              </td>
  +              <td align="right">
  +                <form action="removelock.do" method="post">
  +                  <input type="hidden" name="resourcePath" value="${source.path}"/>
  +                  <input type="hidden" name="objectUri" value="${lock.object}"/>
  +                  <input type="hidden" name="lockId" value="${lock.id}"/>
  +                  <input type="submit" name="doRemoveLock" value="Delete"/>
  +                </form>
  +              </td>
  +            </tr>
  +          </jx:forEach>
  +          <tr>
  +            <form action="addlock.do" method="post">
  +              <input type="hidden" name="resourcePath" value="${source.path}"/>
  +              <td align="left">
  +                <select name="subject">
  +                  <option>self</option>
  +                  <option>owner</option>
  +                  <option>authenticated</option>
  +                  <option>unauthenticated</option>
  +                  <option>all</option>
  +                  <jx:forEach var="role" items="${roles}">
  +                    <option value="{$role.uri}">
  +                      role: ${role.uri}
  +                    </option>
  +                  </jx:forEach>
  +                  <jx:forEach var="user" items="${users}">
  +                    <option value="{$user}">
  +                      user: ${user}
  +                    </option>
  +                  </jx:forEach>
  +                </select>
  +              </td>
  +              <td align="left">
  +                <select name="type">
  +                  <option>all</option>
  +                  <option>default</option>
  +                  <jx:forEach var="privilege" items="${privileges}">
  +                    <option value="{$privilege}">
  +                      ${privilege}
  +                    </option>
  +                  </jx:forEach>
  +                </select>
  +              </td>
  +              <td align="left">
  +                <input name="expiration" type="text" size="15" maxlength="40" value="1"/>
  +              </td>
  +              <td align="left">
  +                <select name="inheritable">
  +                  <option>false</option>
  +                  <option>true</option>
  +                </select>
  +              </td>
  +              <td align="left">
  +                <select name="exclusive">
  +                  <option>false</option>
  +                  <option>true</option>
  +                </select>
  +              </td>
  +              <td align="right">
  +                <input type="submit" name="doAddLock" value="Add/Modify"/>
  +              </td>
  +            </form>
  +          </tr>
  +        </table>
  +      </column>
  +    </row>
  +  </body>
  +</document>  
  
  
  
  1.4       +134 -11   cocoon-2.1/src/blocks/slide/samples/screens/permissions.jx
  
  Index: permissions.jx
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/screens/permissions.jx,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- permissions.jx	6 Mar 2004 06:16:52 -0000	1.3
  +++ permissions.jx	13 Apr 2004 14:25:24 -0000	1.4
  @@ -14,14 +14,137 @@
     See the License for the specific language governing permissions and
     limitations under the License.
   -->
  -<permissions xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
  -  <jx:forEach var="permission" items="${permissions}">
  -    <permission>
  -      <privilege>${permission.actionUri}</privilege>
  -      <object>${permission.objectUri}</object>
  -      <subject>${permission.subjectUri}</subject>
  -      <inheritable>${permission.inheritable}</inheritable>
  -      <negative>${permission.negative}</negative>
  -    </permission>
  -  </jx:forEach>
  -</permissions>
  +<document xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
  +          xmlns:xi="http://www.w3.org/2001/XInclude">
  +  <header>
  +    <title>Jakarta Slide example</title>
  +    <tab title="users"       href="viewusers.do"/>
  +    <tab title="content"     href="viewcontent.do?path=${source.path}"/>
  +    <tab title="properties"  href="viewproperties.do?path=${source.path}"/>
  +    <tab title="permissions" href="viewpermissions.do?path=${source.path}"/>
  +    <tab title="locks"       href="viewlocks.do?path=${source.path}"/>
  +    <tab title="logout"      href="logout.do"/>
  +  </header>
  +  <body>
  +    <row> 
  +      <column title="Navigation">
  +        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  +          <jx:forEach var="source" items="${source.children}">
  +            <tr>
  +              <td width="100%" align="left">
  +                <a href="viewpermissions.do?path=${source.path}">
  +                  ${source.name}
  +                </a>
  +              </td>
  +            </tr>
  +          </jx:forEach>
  +          <jx:if test="${source.parent}">
  +            <tr>
  +              <td width="100%" align="left">
  +                <br/>
  +                  <a href="viewpermissions.do?path=${source.parent.path}">
  +                    ..
  +                  </a>
  +              </td>
  +            </tr>
  +          </jx:if>
  +        </table>
  +      </column>
  +      <column title="Permissions">
  +        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  +          <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"/>
  +          </tr>
  +          <jx:forEach var="permission" items="${source.permissions}">
  +            <tr>
  +              <td align="left">
  +                ${permission.subject}
  +              </td>
  +              <td align="left">
  +                ${permission.privilege}
  +              </td>
  +              <td align="left">
  +                ${permission.inheritable}
  +              </td>
  +              <td align="left">
  +                ${permission.negative}
  +              </td>
  +              <td align="right">
  +                <form action="removePermission.do" method="post">
  +                  <input type="hidden" name="resourcePath" value="${source.path}"/>
  +                  <input type="hidden" name="subject" value="${permission.subject}"/>
  +                  <input type="hidden" name="privilege" value="{permission.privilege}"/>
  +                  <input type="hidden" name="inheritable" value="{permission.inheritable}"/>
  +                  <input type="hidden" name="negative" value="{permission.negative}"/>
  +                  <input type="submit" name="doRemovePermission" value="Delete"/>
  +                </form>
  +              </td>
  +            </tr>
  +          </jx:forEach>
  +          <tr>
  +            <form action="addPermission.do" method="post">
  +              <input type="hidden" name="resourcePath" value="${source.path}"/>
  +              <td align="left">
  +                <select name="subject">
  +                  <option>self</option>
  +                  <option>owner</option>
  +                  <option>authenticated</option>
  +                  <option>unauthenticated</option>
  +                  <option>all</option>
  +                  <jx:forEach var="role" items="${roles}">
  +                    <option value="{$role.uri}">
  +                      role: ${role.uri}
  +                    </option>
  +                  </jx:forEach>
  +                  <jx:forEach var="user" items="${users}">
  +                    <option value="{$user}">
  +                      user: ${user}
  +                    </option>
  +                  </jx:forEach>
  +                </select>
  +              </td>
  +              <td align="left">
  +                <select name="action">
  +                  <option>all</option>
  +                  <option>default</option>
  +                  <jx:forEach var="privilege" items="${privileges}">
  +                    <option value="{$privilege}">
  +                      ${privilege}
  +                    </option>
  +                  </jx:forEach>
  +                </select>
  +              </td>
  +              <td align="left">
  +                <select name="inheritable">
  +                  <option>false</option>
  +                  <option>true</option>
  +                </select>
  +              </td>
  +              <td align="left">
  +                <select name="negative">
  +                  <option>false</option>
  +                  <option>true</option>
  +                </select>
  +              </td>
  +              <td align="right">
  +                <input type="submit" name="doAddPermission" value="Add/Modify"/>
  +              </td>
  +            </form>
  +          </tr>
  +        </table>
  +      </column>
  +    </row>
  +  </body>
  +</document>  
  
  
  
  1.4       +141 -10   cocoon-2.1/src/blocks/slide/samples/screens/users.jx
  
  Index: users.jx
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/screens/users.jx,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- users.jx	6 Mar 2004 06:16:52 -0000	1.3
  +++ users.jx	13 Apr 2004 14:25:24 -0000	1.4
  @@ -1,23 +1,154 @@
   <?xml version="1.0"?>
   <!--
     Copyright 1999-2004 The Apache Software Foundation
  -
  +                                                                                                                                                             
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  -
  +                                                                                                                                                             
         http://www.apache.org/licenses/LICENSE-2.0
  -
  +                                                                                                                                                             
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
   -->
  -<users xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
  -  <jx:forEach var="user" items="${users}">
  -    <user>
  -      <uri>${user}</uri>
  -    </user>
  -  </jx:forEach>
  -</users>
  +<document xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
  +          xmlns:xi="http://www.w3.org/2001/XInclude">
  +  <header>
  +    <title>Jakarta Slide example</title>
  +    <tab title="users"       href="viewusers.do"/>
  +    <tab title="content"     href="viewcontent.do?path=${source.path}"/>
  +    <tab title="properties"  href="viewproperties.do?path=${source.path}"/>
  +    <tab title="permissions" href="viewpermissions.do?path=${source.path}"/>
  +    <tab title="locks"       href="viewlocks.do?path=${source.path}"/>
  +    <tab title="logout"      href="logout.do"/>
  +  </header>
  +  <body>
  +    <row>
  +      <column title="Users">
  +        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  +          <tr>
  +            <td align="left">
  +              <b>User</b>
  +            </td>
  +            <td/>
  +            <td align="left">
  +              <b>Password</b>
  +            </td>
  +            <td/>
  +            <td align="left">
  +              <b>Roles</b>
  +            </td>
  +            <td align="right"/>
  +          </tr>
  +          <jx:forEach var="user" items="${users}">
  +            <tr>
  +              <td align="left">
  +                ${user}<br/>
  +              </td>
  +              <td align="left">
  +                <form action="removeobject.do">
  +                  <input type="hidden" name="objecturi" value="${user}"/>
  +                  <input type="submit" name="doRemoveUser" value="Delete"/>
  +                </form>
  +              </td>
  +              <form action="changepwd.do" method="post">
  +                <input type="hidden" name="username" value="${user}"/>
  +                <td align="left">
  +                  <input type="password" name="password" size="10" maxlength="40"/>
  +                </td>
  +                <td>
  +                  <input type="submit" name="doSetPassword" value="Change"/>
  +                </td>
  +              </form>
  +              <form action="removemember.do" method="post">
  +                <input type="hidden" name="subjecturi" value="${user}"/>
  +                <td align="left">
  +                  <select name="objecturi">
  +                    <jx:forEach var="role" items="#{roles[member = $user]}">
  +                      <option value="{$role.uri}">
  +                        ${role.uri}
  +                      </option>
  +                    </jx:forEach> 
  +                  </select>
  +                </td>
  +                <td align="left">
  +                  <input type="submit" name="doRemoveRoleMember" value="Remove role"/>
  +                </td>
  +              </form>
  +            </tr>
  +            <tr>
  +              <td colspan="4"/>
  +              <form action="addmember.do" method="post">
  +                <input type="hidden" name="subjecturi" value="{$user}"/>
  +                <td align="left">
  +                  <select name="objecturi" size="1">
  +                    <jx:forEach var="role" items="${roles}">
  +                      <option value="{$role.uri}">
  +                        ${role.uri}
  +                      </option>
  +                    </jx:forEach>
  +                  </select>
  +                </td>
  +                <td align="left">
  +                  <input type="submit" name="doAddRoleMember" value="Add role"/>
  +                </td>
  +                <td align="left"/>
  +              </form>
  +            </tr>
  +          </jx:forEach>
  +          <tr>
  +            <form action="adduser.do" method="post">
  +              <td align="left">
  +                <input name="username" type="text" size="10" maxlength="40"/>
  +              </td>
  +              <td align="left"/>
  +              <td align="left">
  +                <input name="password" type="password" size="10" maxlength="40"/>
  +              </td>
  +              <td colspan="2"/>
  +              <td align="right">
  +                <input type="submit" name="doAddUser" value="Add user"/>
  +              </td>
  +            </form>
  +          </tr>
  +        </table>
  +      </column>
  +      <column title="Roles">
  +        <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
  +          <tr>
  +            <td align="left">
  +              <b>Role</b>
  +            </td>
  +            <td align="right"/>
  +          </tr>
  +          <jx:forEach var="role" items="${roles}">
  +            <tr>
  +              <form action="removeobject.do" method="post">
  +                <input type="hidden" name="objecturi" value="{$roleuri}"/>
  +                <td align="left">
  +                  ${role.uri}
  +                </td>
  +                <td align="right">
  +                  <input type="submit" name="doRemovePrincipalRole" value="Remove role"/>
  +                </td>
  +              </form>
  +            </tr>
  +          </jx:forEach>
  +          <tr>
  +            <form action="addrole.do" method="post">
  +              <td align="left">
  +                <input name="rolename" type="text" size="15" maxlength="40"/>
  +              </td>
  +              <td align="right">
  +                <input type="submit" name="doAddPrincipalRole" value="Add role"/>
  +              </td>
  +            </form>
  +          </tr>
  +        </table>
  +      </column>
  +    </row>
  +  </body>
  +</document>
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/samples/screens/content.jx
  
  Index: content.jx
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <document xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
            xmlns:xi="http://www.w3.org/2001/XInclude">
    <header>
      <title>Jakarta Slide example</title>
      <tab title="users"       href="viewusers.do"/>
      <tab title="content"     href="viewcontent.do?path=${source.path}"/>
      <tab title="properties"  href="viewproperties.do?path=${source.path}"/>
      <tab title="permissions" href="viewpermissions.do?path=${source.path}"/>
      <tab title="locks"       href="viewlocks.do?path=${source.path}"/>
      <tab title="logout"      href="logout.do"/>
    </header>
    <body>
      <row> 
        <column title="Navigation">
          <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
            <jx:forEach var="source" items="${source.children}">
              <tr>
                <td width="100%" align="left">
                  <a href="viewcontent.do?path=${source.path}">
                    ${source.name}
                  </a>
                </td>
              </tr>
            </jx:forEach>
            <jx:if test="${source.parent}">
              <tr>
                <td width="100%" align="left">
                  <br/>
                    <a href="viewcontent.do?path=${source.parent.path}">
                      ..
                    </a>
                </td>
              </tr>
            </jx:if>
          </table>
        </column>
        <column title="Content">
          <jx:choose>
            <jx:when test="${source.collection}">
              <table width="100%" cellspacing="0" cellpadding="5" align="center">
                <tr>
                  <td align="left">
                    <b>Filename</b>
                  </td>
                  <td align="left">
                    <b>Version</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"/>
                </tr>
                <jx:forEach var="source" items="${source.children}">
                  <tr>
                    <td align="left">&#xA0;&#xA0;
                      <jx:choose>
                        <jx:when test="$path != ''">
                          <a href="viewcontent.do?path=${source.path}">
                            ${source.name}
                          </a>
                        </jx:when>
                        <jx:otherwise>
                          <a href="viewcontent.do?path=${source.path}">
                            ${source.name}
                          </a>
                        </jx:otherwise>
                      </jx:choose>
                    </td>
                    <td align="left">
                      ${source.sourceRevision}
                    </td>
                    <td align="left">
                      ${source.mimeType}
                    </td>
                    <td align="left">
                      ${source.contentLength}
                    </td>
                    <td align="left">
                      ${source.lastModified}
                    </td>
                    <td align="right">
                      <form action="deletesource.do" method="post">
                        <input type="hidden" name="parentPath" value="${source.parent.path}" />
                        <input type="hidden" name="resourceName" value="${source.name}"/>
                        <input type="submit" name="doDeleteSource" value="Delete"/>
                      </form>
                    </td>
                  </tr>
                </jx:forEach>
                <tr>
                  <form action="uploadsource.do" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="parentPath" value="${source.path}"/>
                    <td align="left"><input type="text" name="resourceName" size="15" maxlength="40"/></td>
                    <td align="left" colspan="3">
                     File:
                     <input type="file" name="uploadFile" size="15" maxlength="40"/>
                    </td>
                    <td align="right">
                      <input type="submit" name="doUploadSource" value="Upload File"/>
                    </td>
                  </form>
                </tr>
                <tr>
                  <form action="makecollection.do" method="post">
                    <input type="hidden" name="parentPath" value="${source.path}"/>
                    <td align="left" colspan="5">
                      <input type="text" name="collectionName" size="15" maxlength="40"/>
                    </td>
                    <td align="right">
                      <input type="submit" name="doCreateCollection" value="Create collection"/>
                    </td>
                  </form>
                </tr>
              </table>
            </jx:when>
            <jx:when test="${source.mimeType == 'text/plain'}">
              <pre><xi:include href="${source.uRI}" parse="text"/></pre>
            </jx:when>
            <jx:when test="${source.mimeType == 'text/xml'}">
              <pre><xi:include href="${source.uRI}" parse="text"/></pre>
            </jx:when>
            <jx:when test="${source.mimeType == 'image/jpeg'}">
              <img src="/samples/blocks/slide/${source.path}"/>
            </jx:when>
            <jx:when test="${source.mimeType == 'image/gif'}">
              <img src="/samples/blocks/slide/${source.path}"/>
            </jx:when>
            <jx:otherwise>
              <h3>Could not display content(${source.mimeType}).</h3>
            </jx:otherwise>
          </jx:choose>
        </column>
      </row>
    </body>
  </document>  
  
  
  
  1.1                  cocoon-2.1/src/blocks/slide/samples/screens/properties.jx
  
  Index: properties.jx
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <document xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
            xmlns:xi="http://www.w3.org/2001/XInclude">
    <header>
      <title>Jakarta Slide example</title>
      <tab title="users"       href="viewusers.do"/>
      <tab title="content"     href="viewcontent.do?path=${source.path}"/>
      <tab title="properties"  href="viewproperties.do?path=${source.path}"/>
      <tab title="permissions" href="viewpermissions.do?path=${source.path}"/>
      <tab title="locks"       href="viewlocks.do?path=${source.path}"/>
      <tab title="logout"      href="logout.do"/>
    </header>
    <body>
      <row> 
        <column title="Navigation">
          <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
            <jx:forEach var="source" items="${source.children}">
              <tr>
                <td width="100%" align="left">
                  <a href="viewproperties.do?path=${source.path}">
                    ${source.name}
                  </a>
                </td>
              </tr>
            </jx:forEach>
            <jx:if test="${source.parent}">
              <tr>
                <td width="100%" align="left">
                  <br/>
                    <a href="viewproperties.do?path=${source.parent.path}">
                      ..
                    </a>
                </td>
              </tr>
            </jx:if>
          </table>
        </column>
        <column title="Properties">
          <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
            <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"/>
            </tr>
            <jx:forEach var="property" items="${source.sourceProperties}">
              <tr>
                <td align="left">
                  ${property.namespace}
                </td>
                <td align="left">
                  ${property.name}
                </td>
                <td align="left">
                  ${property.value}
                </td>
                <td align="right">
                  <jx:if test="${property.namespace != 'DAV:'}">
                    <form action="removeproperty.do" method="post">
                      <input type="hidden" name="resourcePath" value="${source.path}"/>
                      <input type="hidden" name="namespace" value="${property.namespace}"/>
                      <input type="hidden" name="name" value="${property.name}"/>
                      <input type="submit" name="doDeleteProperty" value="Delete"/>
                    </form>
                  </jx:if>
                </td>
              </tr>
            </jx:forEach>
            <tr>
              <form action="addproperty.do" method="post">
                <input type="hidden" name="resourcePath" value="${source.path}"/>
                <td align="left">
                  <input name="namespace" type="text" size="15" maxlength="40"/>
                </td>
                <td align="left">
                  <input name="name" type="text" size="15" maxlength="40"/>
                </td>
                <td align="left">
                  <input name="value" type="text" size="15" maxlength="40"/>
                </td>
                <td align="right">
                  <input type="submit" name="doAddProperty" value="Add/Modify"/>
                </td>
              </form>
            </tr>
          </table>
        </column>
      </row>
    </body>
  </document>  
  
  
  
  1.4       +2 -2      cocoon-2.1/src/blocks/slide/samples/styles/content2html.xsl
  
  Index: content2html.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/styles/content2html.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- content2html.xsl	17 Mar 2004 17:27:59 -0000	1.3
  +++ content2html.xsl	13 Apr 2004 14:25:24 -0000	1.4
  @@ -93,7 +93,7 @@
                 </tr>
               </xsl:for-each>
               <tr>
  -              <form action="{$base}/upload" method="post" enctype="multipart/form-data">
  +              <form action="{$base}/uploadsource" method="post" enctype="multipart/form-data">
                   <input type="hidden" name="parentPath" value="{$path}"/>
                   <td align="left"><input type="text" name="resourceName" size="15" maxlength="40"/></td>
                   <td align="left" colspan="3">
  @@ -106,7 +106,7 @@
                 </form>
               </tr>
               <tr>
  -              <form action="{$base}/mkcol" method="post">
  +              <form action="{$base}/makecollection" method="post">
                   <input type="hidden" name="parentPath" value="{$path}"/>
                   <td align="left" colspan="4">
                     <input type="text" name="collectionName" size="15" maxlength="40"/>
  
  
  

Mime
View raw message