cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From step...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/webapp/mount/slide slide.xconf sitemap.xmap collection2html.xsl
Date Sat, 22 Jun 2002 18:00:02 GMT
stephan     2002/06/22 11:00:01

  Modified:    src/scratchpad/src/org/apache/cocoon/components/repository
                        repository.roles
               src/scratchpad/src/org/apache/cocoon/components/repository/impl
                        SlideSourceRepository.java slide.xconf
               src/scratchpad/src/org/apache/cocoon/components/source/impl
                        RepositorySourceFactory.java SlideSource.java
                        repository.xconf webdav.xconf
               src/scratchpad/webapp/mount/slide sitemap.xmap
  Added:       src/scratchpad/webapp/mount/slide slide.xconf
  Removed:     src/scratchpad/webapp/mount/slide collection2html.xsl
  Log:
  The Slide repository will be now configured by
  an extra file slide.xconf instead of the cocoon.xconf.
  The configuration now uses the hsql db for the
  structure nodes and the content.
  Solved most of the bugs. But there is still a bug by resolving
  a repository source.
  
  Revision  Changes    Path
  1.4       +0 -1      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/repository.roles
  
  Index: repository.roles
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/repository.roles,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- repository.roles	21 Jun 2002 13:39:42 -0000	1.3
  +++ repository.roles	22 Jun 2002 18:00:00 -0000	1.4
  @@ -1,5 +1,4 @@
   <?xml version="1.0"?>
  -
   <xroles xpath="/role-list" unless="role[@name='org.apache.cocoon.components.repository.SourceRepositorySelector']">
     <role name="org.apache.cocoon.components.repository.SourceRepositorySelector"
           shorthand="repositories"
  
  
  
  1.4       +106 -35   xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlideSourceRepository.java
  
  Index: SlideSourceRepository.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlideSourceRepository.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SlideSourceRepository.java	21 Jun 2002 13:39:42 -0000	1.3
  +++ SlideSourceRepository.java	22 Jun 2002 18:00:01 -0000	1.4
  @@ -55,10 +55,15 @@
   
   package org.apache.cocoon.components.repository.impl;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   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.Composable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
   import org.apache.avalon.framework.logger.Loggable;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  @@ -67,12 +72,15 @@
   
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
  +import org.apache.excalibur.source.SourceResolver;
   
   import org.apache.log.Logger;
   
   import org.apache.slide.authenticate.CredentialsToken;
   import org.apache.slide.common.EmbeddedDomain;
   
  +import org.xml.sax.InputSource;
  +
   import java.util.Map;
   
   /**
  @@ -82,10 +90,15 @@
    * @version $Id$
    */
   public class SlideSourceRepository implements Component, SourceRepository, ThreadSafe,

  -                                              Configurable, Loggable {
  +                                              Composable, Configurable, Loggable {
  +
  +    /** The component manager instance */
  +    protected ComponentManager manager = null;
   
       private EmbeddedDomain domain = new EmbeddedDomain();
       private Logger logger;
  +    private String file;
  +    private boolean initialized = false;
   
       /**
        * Provide component with a logger.
  @@ -96,6 +109,14 @@
       }
   
       /**
  +     * Set the current <code>ComponentManager</code> instance used by this
  +     * <code>Composable</code>.
  +     */
  +    public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
  +    }
  +
  +    /**
        * Pass the Configuration to the Configurable class. This method must 
        * always be called after the constructor and before any other method.
        *
  @@ -104,37 +125,7 @@
       public void configure(Configuration configuration)
           throws ConfigurationException {
   
  -        domain.setDefaultNamespace(configuration.getAttribute("default", "slide"));
  -
  -        this.logger.info("Initializing Domain");
  -
  -        Configuration[] namespaceDefinitions = configuration.getChildren("namespace");
  -
  -        for (int i=0; i<namespaceDefinitions.length; i++) {
  -
  -            // Initializes a new namespace based on the given configuration data.
  -
  -            this.logger.info("Initializing namespace : "
  -                             + namespaceDefinitions[i].getAttribute("name"));
  -
  -            String name = namespaceDefinitions[i].getAttribute("name");
  -
  -            Configuration namespaceDefinition =
  -                namespaceDefinitions[i].getChild("definition");
  -
  -            Configuration namespaceConfigurationDefinition =
  -                namespaceDefinitions[i].getChild("configuration");
  -
  -            Configuration namespaceBaseDataDefinition =
  -                namespaceDefinitions[i].getChild("data");
  -
  -            domain.addNamespace(name, new SlideLoggerAdapter(this.logger.getChildLogger(name)),
  -                                      new SlideConfigurationAdapter(namespaceDefinition),
  -                                      new SlideConfigurationAdapter(namespaceConfigurationDefinition),
  -                                      new SlideConfigurationAdapter(namespaceBaseDataDefinition));
  -
  -            this.logger.info("Namespace configuration complete");
  -        }
  +        this.file = configuration.getAttribute("file", "WEB-INF/slide.xconf");
       }
   
       /**
  @@ -146,14 +137,94 @@
        */
       public Source getSource(String namespace, String uri, Map parameters)
           throws SourceException {
  +
  +        if (!initialized)
  +            initialize();
  +
  +        if (!initialized)
  +            throw new SourceException("Could not initialize Slide repository");
  +
  +        if (namespace==null)
  +            namespace = this.domain.getDefaultNamespace();
           
  -        if (domain.getNamespaceToken(namespace)==null)
  +        if (this.domain.getNamespaceToken(namespace)==null)
               throw new SourceException("Repository with the namespace '"+namespace+"' couldn't
be found");
           
           if ((uri==null) || (uri.length()==0))
  -          return new SlideSource(domain.getNamespaceToken(namespace), "/");
  +          //return new SlideSource(domain.getNamespaceToken(namespace), "/");
  +          uri = "/";
           
           return new SlideSource(domain.getNamespaceToken(namespace), uri);
  +    }
  +
  +    private void initialize() {
  +        SourceResolver resolver = null;
  +        Parser parser = null;
  +        Source source = null;
  +        Configuration configuration = null;
  +
  +        try {
  +            resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
  +
  +            parser = (Parser)this.manager.lookup(Parser.ROLE);
  +            SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
  +
  +            source = resolver.resolveURI(this.file);
  +
  +            parser.parse(new InputSource(source.getInputStream()), confighandler);
  +
  +            configuration = confighandler.getConfiguration();
  +
  +        } catch (Exception e) {
  +            this.logger.error("Could not load slide configuration file", e);
  +            return;
  +        } finally {
  +            if (source!=null)
  +                resolver.release(source);
  +            if (parser!=null) 
  +                this.manager.release(parser);
  +            if (resolver!=null)
  +                this.manager.release(resolver);
  +        }
  +
  +        try {
  +            domain.setDefaultNamespace(configuration.getAttribute("default", "slide"));
  +
  +            this.logger.info("Initializing Domain");
  +
  +            Configuration[] namespaceDefinitions = configuration.getChildren("namespace");
  +
  +            for (int i=0; i<namespaceDefinitions.length; i++) {
  +
  +                // Initializes a new namespace based on the given configuration data.
  +    
  +                this.logger.info("Initializing namespace : "
  +                                 + namespaceDefinitions[i].getAttribute("name"));
  +
  +                String name = namespaceDefinitions[i].getAttribute("name");
  +
  +                Configuration namespaceDefinition =
  +                      namespaceDefinitions[i].getChild("definition");
  +
  +                Configuration namespaceConfigurationDefinition =
  +                    namespaceDefinitions[i].getChild("configuration");
  +
  +                Configuration namespaceBaseDataDefinition =
  +                    namespaceDefinitions[i].getChild("data");
  +
  +                domain.addNamespace(name, new SlideLoggerAdapter(this.logger.getChildLogger(name)),
  +                                          new SlideConfigurationAdapter(namespaceDefinition),
  +                                          new SlideConfigurationAdapter(namespaceConfigurationDefinition),
  +                                          new SlideConfigurationAdapter(namespaceBaseDataDefinition));
  +
  +                this.logger.info("Namespace configuration complete");
  +            }
  +        } catch (ConfigurationException ce) {
  +            this.logger.error("Could not configure Slide domain", ce);
  +            return;
  +        }
  +
  +        initialized = true;
       }
   }
   
  
  
  
  1.5       +6 -159    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/slide.xconf,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- slide.xconf	21 Jun 2002 13:39:42 -0000	1.4
  +++ slide.xconf	22 Jun 2002 18:00:01 -0000	1.5
  @@ -1,172 +1,19 @@
   <?xml version="1.0"?>
  -
   <xconf xpath="/cocoon" unless="component[@role='org.apache.cocoon.components.repository.SourceRepositorySelector']">
   
  + <!-- Source repositories:
  +   Each source repository handles serveral sources sorted in namspaces. Which
  +   can be access via the RepositorySourceFactory.
  +  -->
    <component role="org.apache.cocoon.components.repository.SourceRepositorySelector"

               class="org.apache.cocoon.components.ExtendedComponentSelector"
               logger="core.repositories"
               default="slide">
  -  <!--<repositories logger="core.repositories" 
  -                    default="ownrepository">-->
   
  +  <!-- Default implementation via Jakarta Slide -->
     <component-instance class="org.apache.cocoon.components.repository.impl.SlideSourceRepository"

                         name="slide"
                         logger="core.repositories.slide"
  -                      default="myrepository">
  -   <namespace name="myrepository">
  -
  -    <definition>
  -     <store name="jdbc">
  -      <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
  -       <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
  -       <parameter name="url">jdbc:hsqldb:slidestructure</parameter>
  -       <parameter name="user">sa</parameter>
  -       <parameter name="password"></parameter>
  -      </nodestore>
  -      <securitystore>
  -        <reference store="nodestore" />
  -      </securitystore>
  -      <lockstore>
  -        <reference store="nodestore" />
  -      </lockstore>
  -      <revisiondescriptorsstore>
  -        <reference store="nodestore" />
  -      </revisiondescriptorsstore>
  -      <revisiondescriptorstore>
  -        <reference store="nodestore" />
  -      </revisiondescriptorstore>
  -      <contentstore classname="slidestore.reference.FileContentStore">
  -        <parameter name="rootpath">contentstore</parameter>
  -        <parameter name="version">true</parameter>
  -        <parameter name="resetBeforeStarting">false</parameter>
  -      </contentstore>
  -     </store>
  -     <scope match="/" store="jdbc" />
  -    </definition>
  -
  -    <configuration>
  -     <!-- Actions mapping -->
  -     <default-action>/actions</default-action>
  -     <read-object>/actions/read</read-object>
  -     <create-object>/actions/write</create-object>
  -     <remove-object>/actions/write</remove-object>
  -     <grant-permission>/actions/manage</grant-permission>
  -     <revoke-permission>/actions/manage</revoke-permission>
  -     <read-permissions>/actions/manage</read-permissions>
  -     <lock-object>/actions/write</lock-object>
  -     <kill-lock>/actions/manage</kill-lock>
  -     <read-locks>/actions/read</read-locks>
  -     <read-revision-metadata>/actions/read</read-revision-metadata>
  -     <create-revision-metadata>/actions/write</create-revision-metadata>
  -     <modify-revision-metadata>/actions/write</modify-revision-metadata>
  -     <remove-revision-metadata>/actions/write</remove-revision-metadata>
  -     <read-revision-content>/actions/read</read-revision-content>
  -     <create-revision-content>/actions/write</create-revision-content>
  -     <modify-revision-content>/actions/write</modify-revision-content>
  -     <remove-revision-content>/actions/write</remove-revision-content>
  -
  -     <!-- Paths configuration -->
  -     <userspath>/users</userspath>
  -     <guestpath>guest</guestpath>
  -     <filespath>/files</filespath>
  -     <parameter name="dav">true</parameter>
  -     <parameter name="standalone">true</parameter>
  -
  -     <!-- Roles definition -->
  -     <role name="root">slideroles.basic.RootRole</role>
  -     <role name="user">slideroles.basic.UserRole</role>
  -     <role name="guest">slideroles.basic.GuestRole</role>
  -
  -     <!-- Users management -->
  -     <auto-create-users>false</auto-create-users>
  -    </configuration>
  -   
  -    <data>
  -     <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
  -        
  -      <permission action="/actions" subject="root"/>
  -      <permission action="/actions/read" subject="user"
  -       inheritable="false"/>
  -      <permission action="/actions/read" subject="nobody"
  -       inheritable="false"/>
  -        
  -      <!-- /users represents the unauthenticated user -->
  -        
  -      <objectnode classname="org.apache.slide.structure.SubjectNode" 
  -       uri="/users">
  -          
  -        <permission action="/actions" subject="~"/>
  -        <permission action="/actions" subject="guest" inheritable="true" negative="true"/>
  -        <permission action="/actions/read" subject="user" inheritable="false"/>
  -
  -        <!-- Permission group example -->
  -          
  -        <objectnode classname="org.apache.slide.structure.GroupNode" 
  -          uri="/users/writer">
  -           <objectnode classname="org.apache.slide.structure.LinkNode" 
  -              uri="/users/writer/stephan" linkedUri="/users/stephan" />
  -           <objectnode classname="org.apache.slide.structure.LinkNode" 
  -              uri="/users/writer/root" linkedUri="/users/root" />
  -        </objectnode>
  -
  -        <!-- /users/root represents the administrator -->
  -        <objectnode classname="slideroles.basic.RootRoleImpl" uri="/users/root">
  -          <!-- Uncomment and change the password to allow login as root to
  -           edit the namespace -->
  -          <revision>
  -            <property name="password" 
  -             namespace="http://jakarta.apache.org/slide/">root</property>
  -          </revision>
  -        </objectnode>
  -          
  -        <!-- /users/john represents an authenticated user -->
  -        <objectnode classname="slideroles.basic.UserRoleImpl" 
  -         uri="/users/john" >
  -        
  -         <revision>
  -          <property name="password" 
  -             namespace="http://jakarta.apache.org/slide/">john</property>
  -         </revision>
  -        </objectnode>
  -
  -      </objectnode>
  -
  -      <objectnode classname="org.apache.slide.structure.ActionNode" 
  -       uri="/actions">
  -
  -        <objectnode classname="org.apache.slide.structure.ActionNode" 
  -         uri="/actions/read"/>
  -
  -        <objectnode classname="org.apache.slide.structure.ActionNode" 
  -         uri="/actions/write"/>
  -
  -        <objectnode classname="org.apache.slide.structure.ActionNode" 
  -         uri="/actions/manage"/>
  -
  -      </objectnode>
  -
  -      <objectnode classname="org.apache.slide.structure.SubjectNode" 
  -       uri="/files">
  -
  -        <!-- ### Give read/write/manage permission to guest ### 
  -             Uncomment the following line to give permission to do
  -             all actions on /files to guest (unauthenticated users) -->
  -        <permission action="/actions" subject="/users/guest"/>
  -
  -        <permission action="/actions/manage" subject="/users/root"/>
  -        <permission action="/actions/write" subject="+/users/writer"/>
  -        <permission action="/actions/read" subject="nobody"/>
  -
  -      </objectnode>
  -     </objectnode>
  -
  -    </data>
  -
  -   </namespace>
  - 
  -  </component-instance>
  -
  - <!--</repositories>-->
  +                      file="context://mount/slide/slide.xconf"/>
    </component>
  -
   </xconf>
  
  
  
  1.2       +4 -3      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/RepositorySourceFactory.java
  
  Index: RepositorySourceFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/RepositorySourceFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RepositorySourceFactory.java	21 Jun 2002 13:39:43 -0000	1.1
  +++ RepositorySourceFactory.java	22 Jun 2002 18:00:01 -0000	1.2
  @@ -94,7 +94,7 @@
    * @version $Id$
    */
   public class RepositorySourceFactory extends AbstractLoggable
  -  implements SourceFactory, ThreadSafe {
  +  implements SourceFactory, ThreadSafe, Composable {
   
       /** The component manager instance */
       private ComponentManager manager = null;
  @@ -181,7 +181,8 @@
                   sourcerepositories.release((Component)sourcerepository);
               sourcerepository = null;
   
  -            this.manager.release(sourcerepositories);
  +            if (sourcerepositories!=null)
  +                this.manager.release(sourcerepositories);
               sourcerepositories = null;
           }
   
  
  
  
  1.2       +25 -7     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SlideSource.java	21 Jun 2002 13:39:43 -0000	1.1
  +++ SlideSource.java	22 Jun 2002 18:00:01 -0000	1.2
  @@ -97,7 +97,7 @@
   import org.apache.slide.content.NodeRevisionDescriptor;
   import org.apache.slide.content.NodeRevisionDescriptors;
   //import org.apache.slide.content.RevisionContentNotFoundException;
  -//import org.apache.slide.content.RevisionDescriptorNotFoundException;
  +import org.apache.slide.content.RevisionDescriptorNotFoundException;
   //import org.apache.slide.content.RevisionNotFoundException;
   import org.apache.slide.content.NodeRevisionNumber;
   import org.apache.slide.lock.Lock;
  @@ -211,6 +211,12 @@
               this.sourcerevision = this.revisionDescriptor.getRevisionNumber().toString();
               this.sourcerevisionbranch = this.revisionDescriptor.getBranchName();
   
  +        } catch (RevisionDescriptorNotFoundException e) {
  +
  +            this.revisionDescriptor = null;
  +            this.sourcerevision = null;
  +            this.sourcerevisionbranch = null;
  +
           } catch (SlideException se) {
               throw new SourceException("Could not retrieve revision descriptor", se);
           }
  @@ -239,8 +245,8 @@
           try {
               ObjectNode object = structure.retrieve(this.slideToken, this.uri);
   
  -            return content.retrieve(slideToken, revisionDescriptors,
  -                       revisionDescriptor).streamContent();
  +            return content.retrieve(slideToken, this.revisionDescriptors,
  +                       this.revisionDescriptor).streamContent();
           } catch (SlideException se) {
               throw new SourceException("Could not get source", se);
           }
  @@ -261,9 +267,9 @@
        */
       public SourceValidity getValidity() {
           try {
  -            if (validity!=null) {
  +            if ((validity!=null) && (this.revisionDescriptor!=null)) {
                   this.validity = new TimeStampValidity(
  -                    revisionDescriptor.getLastModifiedAsDate().getTime());
  +                    this.revisionDescriptor.getLastModifiedAsDate().getTime());
               }
           } catch (Exception e) {
               return null;
  @@ -285,7 +291,9 @@
        * this can be null.
        */
       public String getMimeType() {
  -        return revisionDescriptor.getContentType();
  +        if (this.revisionDescriptor!=null)
  +            return this.revisionDescriptor.getContentType();
  +        return null;
       }
   
       /**
  @@ -356,6 +364,16 @@
   
                   byte[] bytes = toByteArray();
                   revisionContent.setContent(bytes);
  +
  +                if (revisionDescriptor==null) {
  +                    revisionDescriptor = new NodeRevisionDescriptor(0);
  +
  +                    String resourceName = uri;
  +                    int lastSlash = resourceName.lastIndexOf('/');
  +                    if (lastSlash != -1)
  +                        resourceName = resourceName.substring(lastSlash + 1);
  +                    revisionDescriptor.setName(resourceName);
  +                }
   
                   revisionDescriptor.setContentLength(bytes.length);
   
  
  
  
  1.2       +2 -3      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/repository.xconf
  
  Index: repository.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/repository.xconf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- repository.xconf	21 Jun 2002 13:39:43 -0000	1.1
  +++ repository.xconf	22 Jun 2002 18:00:01 -0000	1.2
  @@ -1,7 +1,6 @@
   <?xml version="1.0"?>
  -
   <xconf xpath="/cocoon/source-factories" unless="component-instance[@name='repository']">
  -
       <!-- repository pseudo protocol -->
  -    <component-instance name="repository" class="org.apache.cocoon.components.source.impl.RepositorySourceFactory"/>
  +    <component-instance name="repository" 
  +                        class="org.apache.cocoon.components.source.impl.RepositorySourceFactory"/>
   </xconf>
  
  
  
  1.2       +2 -3      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/webdav.xconf
  
  Index: webdav.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/webdav.xconf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- webdav.xconf	21 Jun 2002 13:39:43 -0000	1.1
  +++ webdav.xconf	22 Jun 2002 18:00:01 -0000	1.2
  @@ -1,7 +1,6 @@
   <?xml version="1.0"?>
  -
   <xconf xpath="/cocoon/source-factories" unless="component-instance[@name='dav']">
  -
       <!-- WebDAV pseudo protocol -->
  -    <component-instance name="dav" class="org.apache.cocoon.components.source.impl.WebDAVSourceFactory"/>
  +    <component-instance name="dav" 
  +                        class="org.apache.cocoon.components.source.impl.WebDAVSourceFactory"/>
   </xconf>
  
  
  
  1.4       +3 -22     xml-cocoon2/src/scratchpad/webapp/mount/slide/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/mount/slide/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap	12 Jun 2002 20:07:38 -0000	1.3
  +++ sitemap.xmap	22 Jun 2002 18:00:01 -0000	1.4
  @@ -3,13 +3,9 @@
   <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
    <map:components>
     <map:generators default="file">
  -<!--   <map:generator name="slidecollection" 
  -                  src="org.apache.cocoon.generation.SlideCollectionGenerator" 
  -                  logger="sitemap.generator.slidecollection"/>-->
  -
      <map:generator name="sourcedescription" 
  -                  src="org.apache.cocoon.generation.RepositorySourceDescriptionGenerator"

  -                  logger="sitemap.generator.repositorysourcedescriptiongenerator"/>
  +                  src="org.apache.cocoon.generation.SourceDescriptionGenerator" 
  +                  logger="sitemap.generator.sourcedescriptiongenerator"/>
     </map:generators>
   
     <map:serializers default="html"/>
  @@ -18,8 +14,6 @@
                       src="org.apache.cocoon.webapps.session.transformation.SessionTransformer"/>
      <map:transformer logger="sitemap.transformer.write-source" name="write-source"
                       src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
  -<!--   <map:transformer logger="sitemap.transformer.slidetransformer" name="slidetransformer"
  -                    src="org.apache.cocoon.transformation.SlideTransformer"/>-->
     </map:transformers>
   
     <map:readers default="resource"/>
  @@ -109,34 +103,21 @@
        <map:parameter name="handler" value="slidehandler"/>-->
   
        <map:match pattern="browse/**">
  -
  -<!--      <map:generate type="slidecollection" src="{1}/{2}">
  -       <map:parameter name="username" value="root"/>
  -      </map:generate>-->
  -
  -      <map:generate type="sourcedescription" src="{1}">
  +      <map:generate type="sourcedescription" src="repository://{1}">
          <map:parameter name="repository" value="slide"/>
          <map:parameter name="namespace" value="myrepository"/>
          <map:parameter name="principal" value="root"/>
         </map:generate>
   
  -<!--      <map:transform src="collection2html.xsl">
  -       <map:parameter name="use-request-parameters" value="true"/>
  -       <map:parameter name="namespace" value="{1}"/>
  -      </map:transform>-->
  -
         <map:transform src="rdf2html.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
          <map:parameter name="namespace" value="{1}"/>
         </map:transform>
   
  -<!--      <map:transform type="slidetransformer"/>-->
  -
         <map:serialize type="html"/>							
        </map:match>
   
        <map:match pattern="view/**">
  -<!--      <map:read src="slide://{1}/{2}"/>-->
         <map:read src="repository://{1}?repository=slide&amp;namespace=myrepository&amp;principal=root"/>
        </map:match>
   
  
  
  
  1.1                  xml-cocoon2/src/scratchpad/webapp/mount/slide/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  <?xml version="1.0"?>
  <slide default="myrepository">
  
   <namespace name="myrepository">
  
    <definition>
     <store name="jdbc">
  
      <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
       <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
       <parameter name="url">jdbc:hsqldb:slidestructure</parameter>
       <parameter name="user">sa</parameter>
       <parameter name="password"></parameter>
      </nodestore>
  
      <securitystore>
       <reference store="nodestore" />
      </securitystore>
  
      <lockstore>
       <reference store="nodestore" />
      </lockstore>
  
      <revisiondescriptorsstore>
       <reference store="nodestore" />
      </revisiondescriptorsstore>
  
      <revisiondescriptorstore>
       <reference store="nodestore" />
      </revisiondescriptorstore>
  
      <contentstore classname="slidestore.reference.JDBCContentStore">
       <parameter name="driver">org.hsqldb.jdbcDriver</parameter>
       <parameter name="url">jdbc:hsqldb:slidecontent</parameter>
       <parameter name="user">sa</parameter>
       <parameter name="password"></parameter>
      </contentstore>
  
     </store>
     <scope match="/" store="jdbc" />
    </definition>
  
    <configuration>
     <!-- Actions mapping -->
     <default-action>/actions</default-action>
     <read-object>/actions/read</read-object>
     <create-object>/actions/write</create-object>
     <remove-object>/actions/write</remove-object>
     <grant-permission>/actions/manage</grant-permission>
     <revoke-permission>/actions/manage</revoke-permission>
     <read-permissions>/actions/manage</read-permissions>
     <lock-object>/actions/write</lock-object>
     <kill-lock>/actions/manage</kill-lock>
     <read-locks>/actions/read</read-locks>
     <read-revision-metadata>/actions/read</read-revision-metadata>
     <create-revision-metadata>/actions/write</create-revision-metadata>
     <modify-revision-metadata>/actions/write</modify-revision-metadata>
     <remove-revision-metadata>/actions/write</remove-revision-metadata>
     <read-revision-content>/actions/read</read-revision-content>
     <create-revision-content>/actions/write</create-revision-content>
     <modify-revision-content>/actions/write</modify-revision-content>
     <remove-revision-content>/actions/write</remove-revision-content>
  
     <!-- Paths configuration -->
     <userspath>/users</userspath>
     <guestpath>guest</guestpath>
     <filespath>/files</filespath>
     <parameter name="dav">true</parameter>
     <parameter name="standalone">true</parameter>
  
     <!-- Roles definition -->
     <role name="root">slideroles.basic.RootRole</role>
     <role name="user">slideroles.basic.UserRole</role>
     <role name="guest">slideroles.basic.GuestRole</role>
  
     <!-- Users management -->
     <auto-create-users>false</auto-create-users>
    </configuration>
     
    <data>
  
     <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
      <!-- Subject can be: self  "~"
                           all   "nobody"
                           user  "/users/john"
                           group "+/users/groupA"
                           role  "root"
        -->
      <!-- Uncomment the following line to give all permissions to
           principals have the root role -->
      <!-- <permission action="/actions" subject="root"/> -->
      <permission action="/actions" subject="/users/root"/>
      <permission action="/actions/read" subject="/users" inheritable="false"/>
      <permission action="/actions/read" subject="nobody" inheritable="false"/>
  
      <!-- /users -->
      <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/users">
       <permission action="/actions" subject="~"/>
       <permission action="/actions" subject="/users/guest" inheritable="true" negative="true"/>
       <permission action="/actions/read" subject="/users" inheritable="false"/>
  
       <!-- Permission group example -->
       <objectnode classname="org.apache.slide.structure.GroupNode" uri="/users/groupA">
        <objectnode classname="org.apache.slide.structure.LinkNode" uri="/users/groupA/john"

                    linkedUri="/users/john"/>
        <objectnode classname="org.apache.slide.structure.LinkNode" uri="/users/groupA/root"
                    linkedUri="/users/root"/>
        <objectnode classname="org.apache.slide.structure.SubjectNode"
                    uri="/users/groupA/singleGroupMember"/>
       </objectnode>
  
       <!-- /users/root represents the administrator -->
       <objectnode classname="slideroles.basic.RootRoleImpl" uri="/users/root">
        <revision>
         <property name="password">root</property>
        </revision>
       </objectnode>
   
       <!-- /users/john represents an authenticated user -->
       <objectnode classname="slideroles.basic.UserRoleImpl" uri="/users/john">
        <revision>
         <property name="password">john</property>
        </revision>
       </objectnode>
  
       <!-- /users/guest represents an authenticated or unauthenticated guest user -->
       <objectnode classname="slideroles.basic.GuestRoleImpl" uri="/users/guest">
        <revision>
         <property name="password"/>
        </revision>
       </objectnode>
      </objectnode>
  
      <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions">
       <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/read"/>
       <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/write"/>
       <objectnode classname="org.apache.slide.structure.ActionNode" uri="/actions/manage"/>
      </objectnode>
   
      <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/files">
       <permission action="/actions" subject="/users/guest"/> 
       <permission action="/actions/manage" subject="/users/john"/>
       <permission action="/actions/write" subject="+/users/groupA"/>
       <permission action="/actions/read" subject="nobody"/>
      </objectnode>
     </objectnode>
  
    </data>
  
   </namespace>
   
  </slide>
  
  
  

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


Mime
View raw message