You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by pn...@apache.org on 2003/05/02 18:05:44 UTC

cvs commit: jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav MultistatusResponse.java ProppatchRequest.java ReportRequest.java

pnever      2003/05/02 09:05:44

  Modified:    proposals/wvcm/src/org/apache/wvcm/store/webdav
                        MultistatusResponse.java ProppatchRequest.java
                        ReportRequest.java
  Log:
  Special handling for non-WebDAV properties
  
  Revision  Changes    Path
  1.5       +23 -5     jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/MultistatusResponse.java
  
  Index: MultistatusResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/MultistatusResponse.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MultistatusResponse.java	30 Apr 2003 16:28:13 -0000	1.4
  +++ MultistatusResponse.java	2 May 2003 16:05:44 -0000	1.5
  @@ -222,7 +222,6 @@
               while( i.hasNext() ) {
                   // fetch next property
                   Element p = (Element)i.next();
  -                Object propvalue = p.getText();
                   webdavProperties.put( p.getName(), p );
                   PropertyName propname =
                       Properties.propertyNameForWebdavName( p.getName() );
  @@ -238,6 +237,7 @@
                       }
                   }
                   
  +                Object propvalue = null;
                   PropertyDescriptor propdescriptor = PropertyDescriptor.getInstance(propname);
                   if( propdescriptor != null ) {
                       if( propdescriptor.isHref() ) {
  @@ -271,6 +271,9 @@
                       else if( propdescriptor.basetype() == Integer.class && propdescriptor.collectiontype() == null ) {
                           propvalue = new Integer( (String)propvalue );
                       }
  +                    else {
  +                        propvalue = p.getText();
  +                    }
                   }
                   wantedProperties.put( propname, propvalue );
                   
  @@ -280,6 +283,21 @@
                   }
                   // TODO: more handling for non-WebDAV properties
               }
  +            
  +            // special handling for non-WebDAV properties
  +            if( webdavProperties.get("supported-method-set") != null ) {
  +                Element supportedmethods = (Element)webdavProperties.get("supported-method-set");
  +                xp = XPath.newInstance("d:supported-method[@name=\"VERSION-CONTROL\"]");
  +                xp.addNamespace(dnsp);
  +                boolean versioncontrollable = (xp.selectNodes(supportedmethods).size() > 0);
  +                xp = XPath.newInstance("d:supported-method[@name=\"BASELINE-CONTROL\"]");
  +                xp.addNamespace(dnsp);
  +                boolean baselinecontrollable = (xp.selectNodes(supportedmethods).size() > 0);
  +                wantedProperties.put( PropertyName.VERSION_CONTROLLABLE, new Boolean(versioncontrollable) );
  +                wantedProperties.put( PropertyName.BASELINE_CONTROLLABLE, new Boolean(baselinecontrollable) );
  +            }
  +            // TODO: more handling for non-WebDAV properties
  +            
               if( cls == null )
                   cls = determineResourceType( webdavProperties );
               ResourceImpl result = (ResourceImpl)loc.resource( cls );
  
  
  
  1.3       +5 -4      jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ProppatchRequest.java
  
  Index: ProppatchRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ProppatchRequest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProppatchRequest.java	2 May 2003 11:54:50 -0000	1.2
  +++ ProppatchRequest.java	2 May 2003 16:05:44 -0000	1.3
  @@ -109,6 +109,7 @@
                       }
                       else {
                           // TODO: handle non-WebDAV properties
  +                        throw new UnsupportedOperationException("Non-WebDAV property "+propupd.pname+" not yet supported - PLEASE REPORT !!");
                       }
                   }
                   
  
  
  
  1.5       +11 -6     jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ReportRequest.java
  
  Index: ReportRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ReportRequest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReportRequest.java	30 Apr 2003 16:28:14 -0000	1.4
  +++ ReportRequest.java	2 May 2003 16:05:44 -0000	1.5
  @@ -149,11 +149,16 @@
               }
               else {
                   if( pname == PropertyName.IS_CHECKED_OUT ) {
  +                    // check whether checked-out is present
                       if( !Arrays.asList(pnames).contains(PropertyName.CHECKED_OUT) ) {
  -                        webdavname = Properties.webdavNameForPropertyName( PropertyName.CHECKED_OUT );
                           propElm = new Element( "property", dnsp );
  -                        propElm.setAttribute( "name", webdavname );
  +                        propElm.setAttribute( "name", "checked-out" );
                       }
  +                    }
  +                else if( pname == PropertyName.VERSION_CONTROLLABLE || pname == PropertyName.BASELINE_CONTROLLABLE ) {
  +                    // check whether VERSION-CONTROL is in the supported-method-set
  +                    propElm = new Element( "property", dnsp );
  +                    propElm.setAttribute( "name", "supported-method-set" );
                   }
                   // TODO: special handling for other non-WebDAV properties
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org