This page contains description of various issues I've come across when I migrated my application from Slide 2.0 Beta to Slide 2.0 Release and Slide 2.1 Milestone 1 along with solutions I've used.

1. When creating a new folder using WebFolders Windows Explorer creates a folder named "New Folder". I then rename it and it works just fine. But when I refresh the IE window the name "New Folder" reappears instead of the new name. There is one more issue that probably have the same cause: when I save a new file to the Slide store using MacOS's MS Word and then view it using PC WebFolders, I see some strange string instead of the name I entered. Actually, it's the value of the "displayname" property... In Slide 2.0 Beta1 the value of "displayname" was always equal to the last portion of the resource URI so this problem never happened.

Solution - provided by James Mason:

This is only necessary for the 2.0 Release. 2.1 implements similar functionality using the event framework --JamesMason

I worked around this by using a ContentInterceptor that sets the displayname property of a resource every time it is added/moved/etc (the code implements preStoreContent()). It's worked well so far, but basically makes the displayname property useless as a separate property. You'll need to add this line to the <configuration> node of your Domain.xml file: <content-interceptor class="org.apache.slide.content.WebFolderContentInterceptor"/> The code of the org.apache.slide.content.WebFolderContentInterceptor class:

/*
 * 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.slide.content;

import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.SlideToken;

/**
 * Performs some cleanup of content to help work around bugs in Microsoft's
 * WebFolders.
 *
 * @author James Mason
*/
public class WebFolderContentInterceptor extends
AbstractContentInterceptor {
        
        private static String DAV_NAMESPACE = "DAV:";
        
        private NamespaceAccessToken nat;

        public WebFolderContentInterceptor() {
        }
        
        /**
         * Sets the DAV:displayname property equal to the name of the content being stored. 
         */
        public void preStoreContent(
                        SlideToken token,
                        NodeRevisionDescriptors revisionDescriptors,
                        NodeRevisionDescriptor revisionDescriptor,
                        NodeRevisionContent revisionContent ) {
                
                // Set displayname property equal to name of resource.
                String uriString = revisionDescriptors.getUri();
                String name = "";
                int index = uriString.lastIndexOf( "/" );
                if ( index > -1 && index < uriString.length() ) {
                        name = uriString.substring(uriString.lastIndexOf( "/" ) + 1, uriString.length() );
                } else {
                        // FIXME handle this better
                        name = revisionDescriptor.getName();
                }
                String oldName = revisionDescriptor.getProperty(
                        "displayname", DAV_NAMESPACE).getValue().toString();
                if ( !name.equals( oldName ) ) {
                        revisionDescriptor.setProperty( "displayname",DAV_NAMESPACE, name );
                }
        }
        
        public void setNamespace(NamespaceAccessToken nat) {
                this.nat = nat;
        }
}

2. If one uses the Slide server API directly (not the WebDAV client) then starting from 2.0 Release one must set a lock owner info (at least an empty string :) ) when storing a new instance of the org.apache.slide.lock.NodeLock class. Use the setOwnerInfo(java.lang.String ownerInfo) method.

3. A NullPointerException occurs when one tries to call the create(slideToken, subject, resourcePath) method of the org.apache.slide.structure.Structure interface. The cause is that a new statement namespace.getUri(token,parentObject.getUri()).getStore().exclusiveTransientLock(parentObject.getUri().toString()) has been added to the org.apache.slide.structure.StructureImpl class.

The following solution has been provided by Oliver Zeigermann:

So, I recommend to simply add an

if (txId != null) {
...
}

to the exclusiveTransientLock or simply take that method from the current CVS Head.

This error is specific to the Slide 2.1 Milestone 1 and is fixed in the current CVS head.

4. The If-None-Match header is not handled correctly. See http://issues.apache.org/bugzilla/show_bug.cgi?id=29626

Therefore in the org.apache.slide.webdav.method.AbstractWebdavMethod.java

                if (conditionSatisfied) {
                    
                  // For GET and HEAD, we should respond with
                  // 304 Not Modified.

should be replaced by

                if (!conditionSatisfied) {
                    
                  // For GET and HEAD, we should respond with
                  // 304 Not Modified.

This error has been fixed in Slide2.1

MigrationIssues (last edited 2009-09-20 22:02:35 by localhost)