pnever      2004/06/18 09:07:12

  Modified:    src/webdav/server/org/apache/slide/webdav/method Tag:
                        SLIDE_2_0_RELEASE_BRANCH AbstractWebdavMethod.java
                        CopyMethod.java PutMethod.java
                        VersionControlMethod.java
               src/share/org/apache/slide/common Tag:
                        SLIDE_2_0_RELEASE_BRANCH Domain.java
               src/webdav/server/org/apache/slide/webdav/util Tag:
                        SLIDE_2_0_RELEASE_BRANCH PropertyHelper.java
                        VersioningHelper.java
  Log:
  Added means for specifying certain DeltaV parameters at store-level:
  - auto-version
  - auto-version-control
  - versioncontrol-exclude  (now takes multiple paths separated by ';')
  - checkout-fork
  - checkin-fork
  If the store configuration doesn't contain the parameter, the global value
  takes effect
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.20.2.7  +42 -7     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
  
  Index: AbstractWebdavMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
  retrieving revision 1.20.2.6
  retrieving revision 1.20.2.7
  diff -u -r1.20.2.6 -r1.20.2.7
  --- AbstractWebdavMethod.java 28 May 2004 11:49:56 -0000      1.20.2.6
  +++ AbstractWebdavMethod.java 18 Jun 2004 16:07:10 -0000      1.20.2.7
  @@ -71,6 +71,7 @@
   import org.apache.slide.webdav.util.DeltavConstants;
   import org.apache.slide.webdav.util.PreconditionViolationException;
   import org.apache.slide.webdav.util.UnlockListenerImpl;
  +import org.apache.slide.webdav.util.UriHandler;
   import org.apache.slide.webdav.util.ViolatedPrecondition;
   import org.apache.slide.webdav.util.WebdavConstants;
   import org.apache.slide.webdav.util.WebdavUtils;
  @@ -317,14 +318,14 @@
               
               // clear expired lock-tokens
               if (transactionIsStarted) {
  -                // XXX we can only write if the transaction actually is started     
                       
  +                // XXX we can only write if the transaction actually is started
                   try {
                       UnlockListener listener = new UnlockListenerImpl(slideToken, 
token, config, req, resp);
                       lock.clearExpiredLocks(slideToken, requestUri, listener);
  -
  +                    
                       // if the URI has no more locks associated to it and is
                       // a lock-null resource, we must attempt to delete it
  -
  +                    
                       Enumeration locks = lock.enumerateLocks(slideToken, requestUri);
                       if (!locks.hasMoreElements()) {
                           try {
  @@ -341,7 +342,7 @@
                               // XXX do not report as there might simply be no 
resource here
                           }
                       }
  -
  +                    
                   } catch (SlideException e) {
                       token.getLogger().log(e, LOG_CHANNEL, Logger.WARNING);
                   }
  @@ -947,6 +948,40 @@
       
       protected boolean isLockNull( NodeRevisionDescriptor nrd ) {
           return nrd.propertyValueContains(P_RESOURCETYPE, E_LOCKNULL);
  +    }
  +    
  +    protected boolean isAutoVersionControl(String resourcePath) {
  +        return new Boolean(Domain.getParameter(I_AUTO_VERSION_CONTROL,
  +                                               I_AUTO_VERSION_CONTROL_DEFAULT,
  +                                               token.getUri(slideToken, 
resourcePath).getStore()))
  +            .booleanValue();
  +    }
  +    
  +    protected boolean isExcludedForVersionControl(String resourcePath) {
  +        String versionControlExcludePaths =
  +            Domain.getParameter(I_VERSIONCONTROL_EXCLUDEPATH,
  +                                I_VERSIONCONTROL_EXCLUDEPATH_DEFAULT,
  +                                token.getUri(slideToken, resourcePath).getStore());
  +        if (versionControlExcludePaths != null && 
versionControlExcludePaths.length() > 0) {
  +            StringTokenizer st = new StringTokenizer(versionControlExcludePaths, 
";");
  +            while (st.hasMoreTokens()) {
  +                if (isExcluded(resourcePath, st.nextToken())) {
  +                    return true;
  +                }
  +            }
  +        }
  +        return false;
  +    }
  +    
  +    private boolean isExcluded(String resourcePath, String excludePath) {
  +        UriHandler uh = UriHandler.getUriHandler(resourcePath);
  +        if (excludePath != null && excludePath.length() > 0) {
  +            UriHandler exUh = UriHandler.getUriHandler(excludePath);
  +            if (exUh.isAncestorOf(uh)) {
  +                return true;
  +            }
  +        }
  +        return false;
       }
       
       protected SlideToken readonlySlideToken() {
  
  
  
  1.58.2.3  +11 -15    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java
  
  Index: CopyMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java,v
  retrieving revision 1.58.2.2
  retrieving revision 1.58.2.3
  diff -u -r1.58.2.2 -r1.58.2.3
  --- CopyMethod.java   17 Jun 2004 10:49:35 -0000      1.58.2.2
  +++ CopyMethod.java   18 Jun 2004 16:07:10 -0000      1.58.2.3
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 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.
  @@ -31,6 +31,7 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  +import org.apache.slide.common.Domain;
   import org.apache.slide.common.NamespaceAccessToken;
   import org.apache.slide.common.ServiceAccessException;
   import org.apache.slide.common.SlideException;
  @@ -55,6 +56,7 @@
   import org.apache.slide.structure.ObjectNode;
   import org.apache.slide.structure.ObjectNotFoundException;
   import org.apache.slide.util.Configuration;
  +import org.apache.slide.util.XMLValue;
   import org.apache.slide.webdav.WebdavException;
   import org.apache.slide.webdav.WebdavServletConfig;
   import org.apache.slide.webdav.util.AclConstants;
  @@ -67,7 +69,6 @@
   import org.apache.slide.webdav.util.VersioningHelper;
   import org.apache.slide.webdav.util.ViolatedPrecondition;
   import org.apache.slide.webdav.util.WebdavUtils;
  -import org.apache.slide.util.XMLValue;
   import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
   import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlled;
   import org.apache.slide.webdav.util.resourcekind.ResourceKind;
  @@ -109,7 +110,6 @@
        */
       protected String labelHeader = null;
       
  -    private boolean isInVersioncontrolExcludePath = false;
       private MacroParameters macroParameters = null;
       
       
  @@ -171,11 +171,6 @@
           
           // check destination URI
           UriHandler destUh = UriHandler.getUriHandler(destinationUri);
  -        if( VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH != null && 
VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH.length() > 0 ) {
  -            UriHandler exUh = UriHandler.getUriHandler( 
VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH );
  -            if( exUh.isAncestorOf(destUh) )
  -                isInVersioncontrolExcludePath = true;
  -        }
           
           if (destUh.isRestrictedUri()) {
               boolean sendError = true;
  @@ -378,13 +373,13 @@
        * @param      revisionDescriptor  the NodeRevisionDescriptor whose DeltaV
        *                                 properties should be reset.
        */
  -    private void resetDeltavProperties(NodeRevisionDescriptor revisionDescriptor) {
  +    private void resetDeltavProperties(NodeRevisionDescriptor revisionDescriptor, 
String resourcePath) {
           
           // use initial values for DeltaV properties
           PropertyHelper propertyHelper = 
PropertyHelper.getPropertyHelper(slideToken, token, getConfig());
           ResourceKind resourceKind = VersionableImpl.getInstance();
           Iterator initialPropertyIterator =
  -            propertyHelper.createInitialProperties(resourceKind).iterator();
  +            propertyHelper.createInitialProperties(resourceKind, 
resourcePath).iterator();
           NodeProperty property = null;
           List initialDeltavProperties = new ArrayList();
           while (initialPropertyIterator.hasNext()) {
  @@ -564,7 +559,7 @@
               else {
                   
                   // DAV:must-not-copy-versioning-property
  -                resetDeltavProperties(destinationNrd);
  +                resetDeltavProperties(destinationNrd, destinationUri);
               }
               
               // set <workspace> property
  @@ -591,7 +586,7 @@
               }
               
               // check if the resource should be put under version-control
  -            if( PutMethod.AUTO_VERSION_CONTROL && !isCollection(destinationUri) && 
!isInVersioncontrolExcludePath ) {
  +            if( isAutoVersionControl(destinationUri) && 
!isCollection(destinationUri) && !isExcludedForVersionControl(destinationUri) ) {
                   versioningHelper.versionControl(destinationUri);
               }
               
  @@ -733,6 +728,7 @@
       
       
   }
  +
   
   
   
  
  
  
  1.69.2.4  +7 -16     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
  
  Index: PutMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
  retrieving revision 1.69.2.3
  retrieving revision 1.69.2.4
  diff -u -r1.69.2.3 -r1.69.2.4
  --- PutMethod.java    17 Jun 2004 10:49:35 -0000      1.69.2.3
  +++ PutMethod.java    18 Jun 2004 16:07:10 -0000      1.69.2.4
  @@ -65,11 +65,7 @@
       extends AbstractWebdavMethod
       implements DeltavConstants {
       
  -    
  -    // -------------------------------------------------------------- Constants
  -    public final static boolean AUTO_VERSION_CONTROL = new Boolean(
  -        Domain.getParameter(I_AUTO_VERSION_CONTROL, I_AUTO_VERSION_CONTROL_DEFAULT) 
).booleanValue();
  -    
  +
       // ----------------------------------------------------- Instance Variables
       
       /**
  @@ -81,7 +77,6 @@
        * Resource to be written.
        */
       protected String resourcePath;
  -    private boolean isInVersioncontrolExcludePath = false;
       
       // ----------------------------------------------------------- Constructors
       
  @@ -132,11 +127,6 @@
           
           // check destination URI
           UriHandler destUh = UriHandler.getUriHandler(resourcePath);
  -        if( VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH != null && 
VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH.length() > 0 ) {
  -            UriHandler exUh = UriHandler.getUriHandler( 
VersionControlMethod.VERSIONCONTROL_EXCLUDEPATH );
  -            if( exUh.isAncestorOf(destUh) )
  -                isInVersioncontrolExcludePath = true;
  -        }
           
           if (destUh.isRestrictedUri()) {
               boolean sendError = true;
  @@ -278,7 +268,7 @@
                   // Changed for DeltaV --start--
                   // check if the resource should be put under version-control
                   if ( isLockedNullResource ) {
  -                    if ( Configuration.useVersionControl() && AUTO_VERSION_CONTROL 
&& !isInVersioncontrolExcludePath ) {
  +                    if ( Configuration.useVersionControl() && 
isAutoVersionControl(resourcePath) && !isExcludedForVersionControl(resourcePath) ) {
                           versioningHelper.versionControl(resourcePath);
                       }
                   }
  @@ -397,7 +387,7 @@
                                  revisionContent);
                   
                   // check if the resource should be put under version-control
  -                if ( Configuration.useVersionControl() && AUTO_VERSION_CONTROL && 
!isInVersioncontrolExcludePath ) {
  +                if ( Configuration.useVersionControl() && 
isAutoVersionControl(resourcePath) && !isExcludedForVersionControl(resourcePath) ) {
                       versioningHelper.versionControl(resourcePath);
                   }
                   
  @@ -516,6 +506,7 @@
       
       
   }
  +
   
   
   
  
  
  
  1.23.2.2  +10 -15    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java
  
  Index: VersionControlMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v
  retrieving revision 1.23.2.1
  retrieving revision 1.23.2.2
  diff -u -r1.23.2.1 -r1.23.2.2
  --- VersionControlMethod.java 5 Feb 2004 16:11:23 -0000       1.23.2.1
  +++ VersionControlMethod.java 18 Jun 2004 16:07:10 -0000      1.23.2.2
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 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.
  @@ -47,9 +47,6 @@
   public class VersionControlMethod extends AbstractWebdavMethod
       implements DeltavConstants {
       
  -    final static String VERSIONCONTROL_EXCLUDEPATH =
  -        Domain.getParameter( I_VERSIONCONTROL_EXCLUDEPATH, 
I_VERSIONCONTROL_EXCLUDEPATH_DEFAULT );
  -    
       /**
        * Resource to be written.
        */
  @@ -82,7 +79,7 @@
        * @exception WebdavException
        */
       protected void parseRequest() throws WebdavException {
  -//        readRequestContent();
  +        //        readRequestContent();
           
           resourcePath = requestUri;
           if (resourcePath == null) {
  @@ -149,15 +146,13 @@
               sendError( statusCode, e );
               throw new WebdavException( statusCode );
           }
  -
  +        
           try {
               UriHandler rUh = UriHandler.getUriHandler( resourcePath );
  -            if( VERSIONCONTROL_EXCLUDEPATH != null && 
VERSIONCONTROL_EXCLUDEPATH.length() > 0 ) {
  -                UriHandler exUh = UriHandler.getUriHandler( 
VERSIONCONTROL_EXCLUDEPATH );
  -                if( exUh.isAncestorOf(rUh) )
  -                    throw new ForbiddenException(
  -                        resourcePath,
  -                        new Exception("The resource path has been excluded from 
version-control") );
  +            if (isExcludedForVersionControl(resourcePath)) {
  +                throw new ForbiddenException(
  +                    resourcePath,
  +                    new Exception("The resource path has been excluded from 
version-control") );
               }
               
               VersioningHelper vh = VersioningHelper.getVersioningHelper(
  
  
  
  No                   revision
  No                   revision
  1.42.2.4  +32 -9     jakarta-slide/src/share/org/apache/slide/common/Domain.java
  
  Index: Domain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
  retrieving revision 1.42.2.3
  retrieving revision 1.42.2.4
  diff -u -r1.42.2.3 -r1.42.2.4
  --- Domain.java       29 Mar 2004 12:35:33 -0000      1.42.2.3
  +++ Domain.java       18 Jun 2004 16:07:11 -0000      1.42.2.4
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 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.
  @@ -29,11 +29,10 @@
   import java.util.Hashtable;
   import java.util.Properties;
   import java.util.Vector;
  -
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
  -
   import org.apache.slide.authenticate.SecurityToken;
  +import org.apache.slide.store.Store;
   import org.apache.slide.util.conf.Configuration;
   import org.apache.slide.util.conf.ConfigurationElement;
   import org.apache.slide.util.conf.ConfigurationException;
  @@ -387,7 +386,7 @@
           String loggerClass = configuration.getAttribute
               ("logger", "org.apache.slide.util.logger.SimpleLogger");
           parameters.put("logger", loggerClass);
  -
  +        
           try {
               logger = (Logger) (Class.forName(loggerClass).newInstance());
               int loggerLevel = configuration.getAttributeAsInt("logger-level", 
Logger.INFO);
  @@ -402,7 +401,7 @@
               }
               throw new DomainInitializationFailedError("Logger Problem: " + 
e.toString());
           }
  -            
  +        
           info("Initializing Domain");
           
           namespaces = new Hashtable();
  @@ -667,6 +666,26 @@
       }
       
       /**
  +     * Get a domain parameter - possibly overlaid by a store specific value.
  +     *
  +     * @param    name                the parameter name
  +     * @param    defaultValue        the default value
  +     * @param    store               the store to check for store-specific values
  +     *
  +     * @return   the parameter value
  +     *
  +     */
  +    public static String getParameter(String name, String defaultValue, Store 
store) {
  +        String result = (String)store.getParameter(name);
  +        if (result == null) {
  +            result = (String)parameters.get(name);
  +            if (result == null)
  +                result = defaultValue;
  +        }
  +        return result;
  +    }
  +    
  +    /**
        * Set the specified parameters
        *
        * @param    parameters          the parameters
  @@ -858,5 +877,9 @@
       }
       
       
  +    /**
  +     * Constructor
  +     *
  +     */
   }
   
  
  
  
  No                   revision
  No                   revision
  1.63.2.6  +27 -21    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java
  
  Index: PropertyHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
  retrieving revision 1.63.2.5
  retrieving revision 1.63.2.6
  diff -u -r1.63.2.5 -r1.63.2.6
  --- PropertyHelper.java       12 May 2004 12:38:03 -0000      1.63.2.5
  +++ PropertyHelper.java       18 Jun 2004 16:07:11 -0000      1.63.2.6
  @@ -106,15 +106,6 @@
   
   public class PropertyHelper extends AbstractWebdavHelper implements 
WebdavConstants, DeltavConstants, AclConstants, DaslConstants, BindConstants {
       
  -    public final static String DEFAULT_AUTO_VERSION =
  -        Domain.getParameter( I_AUTO_VERSION, I_AUTO_VERSION_DEFAULT );
  -    
  -    public final static String DEFAULT_CHECKOUT_FORK =
  -        Domain.getParameter( I_CHECKOUT_FORK, I_CHECKOUT_FORK_DEFAULT );
  -    
  -    public final static String DEFAULT_CHECKIN_FORK =
  -        Domain.getParameter( I_CHECKIN_FORK, I_CHECKIN_FORK_DEFAULT );
  -    
       public final static String LOCKDISCOVERY_INCL_PRINCIPAL =
           "lockdiscoveryIncludesPrincipalURL";
       
  @@ -186,7 +177,7 @@
        * @post result != null
        * @return a list of initial non-transient properties (empty list if none)
        */
  -    public List createInitialProperties( ResourceKind resourceKind ) {
  +    public List createInitialProperties( ResourceKind resourceKind, String 
resourcePath ) {
           
           Set sp = resourceKind.getSupportedLiveProperties();
           List result = null;
  @@ -200,7 +191,7 @@
                   String propName = (String)i.next();
                   if( AbstractResourceKind.isComputedProperty(propName) )
                       continue;
  -                Object pvalue = createDefaultValue( propName, resourceKind );
  +                Object pvalue = createDefaultValue( propName, resourceKind, 
resourcePath );
                   if (pvalue != null) {
                       result.add( new NodeProperty(propName, pvalue) );
                   }
  @@ -213,7 +204,22 @@
        * Create a default value for the specified property name and resource
        * kind
        */
  -    Object createDefaultValue( String propName, ResourceKind resourceKind ) {
  +    Object createDefaultValue( String propName, ResourceKind resourceKind, String 
resourcePath ) {
  +        
  +        String autoVersion =
  +            Domain.getParameter(I_AUTO_VERSION,
  +                                I_AUTO_VERSION_DEFAULT,
  +                                nsaToken.getUri(sToken, resourcePath).getStore());
  +        
  +        String checkoutFork =
  +            Domain.getParameter(I_CHECKOUT_FORK,
  +                                I_CHECKOUT_FORK_DEFAULT,
  +                                nsaToken.getUri(sToken, resourcePath).getStore());
  +        
  +        String checkinFork =
  +            Domain.getParameter(I_CHECKIN_FORK,
  +                                I_CHECKIN_FORK_DEFAULT,
  +                                nsaToken.getUri(sToken, resourcePath).getStore());
           
           String result = null;
           
  @@ -291,8 +297,8 @@
               
               XMLValue xmlValue = new XMLValue();
               
  -            if (DEFAULT_AUTO_VERSION.length() > 0) {
  -                xmlValue.add(new Element(DEFAULT_AUTO_VERSION, DNSP));
  +            if (autoVersion.length() > 0) {
  +                xmlValue.add(new Element(autoVersion, DNSP));
               }
               
               if( ! resourceKind.isSupportedPropertyValue(P_AUTO_VERSION, xmlValue) ) 
{
  @@ -307,8 +313,8 @@
               
               XMLValue xmlValue = new XMLValue();
               
  -            if (DEFAULT_CHECKOUT_FORK.length() > 0) {
  -                xmlValue.add(new Element(DEFAULT_CHECKOUT_FORK, DNSP));
  +            if (checkoutFork.length() > 0) {
  +                xmlValue.add(new Element(checkoutFork, DNSP));
               }
               
               if( ! resourceKind.isSupportedPropertyValue(P_CHECKOUT_FORK, xmlValue) 
) {
  @@ -323,8 +329,8 @@
               
               XMLValue xmlValue = new XMLValue();
               
  -            if (DEFAULT_CHECKIN_FORK.length() > 0) {
  -                xmlValue.add(new Element(DEFAULT_CHECKIN_FORK, DNSP));
  +            if (checkinFork.length() > 0) {
  +                xmlValue.add(new Element(checkinFork, DNSP));
               }
               
               if( ! resourceKind.isSupportedPropertyValue(P_CHECKIN_FORK, xmlValue) ) 
{
  
  
  
  1.95.2.4  +15 -13    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java
  
  Index: VersioningHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
  retrieving revision 1.95.2.3
  retrieving revision 1.95.2.4
  diff -u -r1.95.2.3 -r1.95.2.4
  --- VersioningHelper.java     17 Jun 2004 10:49:35 -0000      1.95.2.3
  +++ VersioningHelper.java     18 Jun 2004 16:07:11 -0000      1.95.2.4
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 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.
  @@ -247,10 +247,14 @@
               return;
           }
           
  +        // Create new history URI
  +        UriHandler vhrUh = UriHandler.createNextHistoryUri( sToken, nsaToken, rUh );
  +        String vhrUri = String.valueOf(vhrUh);
  +        
           // Set initial VR properties
           NodeRevisionDescriptor vrNrd =
               new NodeRevisionDescriptor(req.getContentLength());
  -        i = pHelp.createInitialProperties(VersionImpl.getInstance()).iterator();
  +        i = pHelp.createInitialProperties(VersionImpl.getInstance(), 
vhrUri).iterator();
           while( i.hasNext() )
               vrNrd.setProperty( (NodeProperty)i.next() );
           
  @@ -281,12 +285,12 @@
           String vhrBranch = NodeRevisionDescriptors.MAIN_BRANCH;
           NodeRevisionDescriptor vhrNrd =
               new NodeRevisionDescriptor( NodeRevisionNumber.HIDDEN_0_0, vhrBranch, 
vhrLabels, vhrProps );
  -        i = 
pHelp.createInitialProperties(VersionHistoryImpl.getInstance()).iterator();
  +        i = pHelp.createInitialProperties(VersionHistoryImpl.getInstance(), 
vhrUri).iterator();
           while( i.hasNext() )
               vhrNrd.setProperty( (NodeProperty)i.next() );
           
           // Set initial VCR properties (do not overwrite existing!!)
  -        i = 
pHelp.createInitialProperties(VersionControlledImpl.getInstance()).iterator();
  +        i = pHelp.createInitialProperties(VersionControlledImpl.getInstance(), 
resourcePath).iterator();
           while( i.hasNext() ) {
               NodeProperty p = (NodeProperty)i.next();
               if( !rNrd.exists(p.getName()) )
  @@ -294,8 +298,6 @@
           }
           
           // Create VHR/VR
  -        UriHandler vhrUh = UriHandler.createNextHistoryUri( sToken, nsaToken, rUh );
  -        String vhrUri = String.valueOf( vhrUh );
           SubjectNode vhrNode = new SubjectNode();
           structure.create( sToken, vhrNode, String.valueOf(vhrUh) );
           content.create( sToken, vhrUri, true ); //isVersioned=true
  @@ -393,7 +395,7 @@
           String evUri = String.valueOf(evUh);
           UriHandler vcrUh = UriHandler.getUriHandler( vcrUri );
           vcrNrd = new NodeRevisionDescriptor(0);
  -        i = 
pHelp.createInitialProperties(VersionControlledImpl.getInstance()).iterator();
  +        i = pHelp.createInitialProperties(VersionControlledImpl.getInstance(), 
resourcePath).iterator();
           while( i.hasNext() )
               vcrNrd.setProperty( (NodeProperty)i.next() );
           
  @@ -629,7 +631,7 @@
           String wsUri = String.valueOf(rUh);
           NodeRevisionDescriptor wsNrd =
               new NodeRevisionDescriptor(0);
  -        i = pHelp.createInitialProperties(WorkspaceImpl.getInstance()).iterator();
  +        i = pHelp.createInitialProperties(WorkspaceImpl.getInstance(), 
resourcePath).iterator();
           while( i.hasNext() )
               wsNrd.setProperty( (NodeProperty)i.next() );
           
  @@ -866,7 +868,7 @@
               
               // set WR props
               NodeRevisionDescriptor wrNrd = new NodeRevisionDescriptor();
  -            i = pHelp.createInitialProperties(WorkingImpl.getInstance()).iterator();
  +            i = pHelp.createInitialProperties(WorkingImpl.getInstance(), 
wrUri).iterator();
               while( i.hasNext() )
                   wrNrd.setProperty( (NodeProperty)i.next() );
               //            content.create( sToken, wrUri, wrNrd, rNrc );
  @@ -1191,7 +1193,7 @@
                   vrNrdNew = new NodeRevisionDescriptor( rNrd.getContentLength() );
               }
               
  -            i = pHelp.createInitialProperties(VersionImpl.getInstance()).iterator();
  +            i = pHelp.createInitialProperties(VersionImpl.getInstance(), 
vhrUri).iterator();
               while( i.hasNext() )
                   vrNrdNew.setProperty( (NodeProperty)i.next() );
               
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to