pnever      2004/05/07 09:11:30

  Modified:    proposals/wvcm/src/org/apache/wvcm/store/webdav
                        WorkspaceWebdavAccessor.java
                        FolderWebdavAccessor.java
                        ControllableFolderWebdavAccessor.java
               proposals/wvcm/src/org/apache/wvcm WorkspaceImpl.java
                        ControllableFolderImpl.java
               proposals/wvcm/src/org/apache/wvcm/store
                        WorkspaceAccessor.java FolderAccessor.java
                        ControllableFolderAccessor.java
               proposals/wvcm/src/org/apache/wvcm/store/webdav/response
                        PropertiesFactory.java
               proposals/wvcm/src/javax/wvcm ControllableFolder.java
  Log:
  Pushed method doLocateByHistory up from Workspace to ControllableFolder
  (This is non-Standard ... but the DeltaV report applies to collections and
  not only to Workspaces ... so will try to convince the EG).
  
  Revision  Changes    Path
  1.13      +4 -58     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/WorkspaceWebdavAccessor.java
  
  Index: WorkspaceWebdavAccessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/WorkspaceWebdavAccessor.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WorkspaceWebdavAccessor.java      8 Dec 2003 17:14:23 -0000       1.12
  +++ WorkspaceWebdavAccessor.java      7 May 2004 16:11:29 -0000       1.13
  @@ -74,7 +74,6 @@
   import org.apache.wvcm.LocationImpl;
   import org.apache.wvcm.store.WorkspaceAccessor;
   import org.apache.wvcm.store.webdav.request.ReportRequest;
  -import 
org.apache.wvcm.store.webdav.request.ReportRequest.LocateByHistoryReportRequest;
   import org.apache.wvcm.store.webdav.response.ErrorResponse;
   import org.apache.wvcm.store.webdav.response.MultistatusResponse;
   
  @@ -128,59 +127,6 @@
           catch (java.io.IOException e) {
               throw new WvcmException(
                   "Write failed", resourcepath, ReasonCode.WRITE_FAILED, new 
Exception[]{e});
  -        }
  -        finally {
  -            method.releaseConnection();
  -        }
  -    }
  -    
  -    /**
  -     * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  -     * that identify the controllable resources that are members of
  -     * this [EMAIL PROTECTED] Workspace} and whose versionHistory property 
identifies
  -     * a member of the <code>versionHistoryList</code> parameter.
  -     * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} 
objects that
  -     * are being located.
  -     * @param wantedPropertyList The properties to be retrieved for the
  -     * returned version-controlled resources.
  -     */
  -    public List doLocateByHistoryReport(List versionHistoryList, PropertyNameList 
wantedPropertyList) throws WvcmException {
  -        LocationImpl loc = (LocationImpl)resource().location();
  -        String resourcepath = loc.path();
  -        ReportMethod method = new ReportMethod(loc.escapedPath());
  -        ReportRequest req = new LocateByHistoryReportRequest( versionHistoryList, 
wantedPropertyList );
  -        method.setRequestBody( req.reqBodyAsString() );
  -        method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
  -        method.addRequestHeader( "Depth", "infinity" );
  -        
  -        try {
  -            client().executeMethod( method );
  -            int sc = method.getStatusCode();
  -            String st = method.getStatusText();
  -            switch( sc ) {
  -                case HttpStatus.SC_MULTI_STATUS:
  -                    MultistatusResponse resp =
  -                        new MultistatusResponse( resource(), 
method.getResponseBodyAsStream(),wantedPropertyList );
  -                    return resp.createResourceProxies();
  -                case HttpStatus.SC_FORBIDDEN:
  -                case HttpStatus.SC_CONFLICT:
  -                    ErrorResponse errorRsp = new ErrorResponse( 
method.getResponseBodyAsStream() );
  -                    throw new WvcmException(
  -                        st, resourcepath, errorRsp.getWvcmReasonCode(), null);
  -                case HttpStatus.SC_NOT_FOUND:
  -                    throw new WvcmException(
  -                        st, resourcepath, ReasonCode.NOT_FOUND, null);
  -                case HttpStatus.SC_UNAUTHORIZED:
  -                    throw new WvcmException(
  -                        st, resourcepath, ReasonCode.UNAUTHORIZED, null);
  -                default:
  -                    throw new WvcmException(
  -                        st, resourcepath, ReasonCode.FORBIDDEN, null);
  -            }
  -        }
  -        catch (java.io.IOException e) {
  -            throw new WvcmException(
  -                "Read failed", resourcepath, ReasonCode.READ_FAILED, new 
Exception[]{e});
           }
           finally {
               method.releaseConnection();
  
  
  
  1.13      +58 -4     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/FolderWebdavAccessor.java
  
  Index: FolderWebdavAccessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/FolderWebdavAccessor.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- FolderWebdavAccessor.java 8 Dec 2003 17:14:22 -0000       1.12
  +++ FolderWebdavAccessor.java 7 May 2004 16:11:29 -0000       1.13
  @@ -79,6 +79,7 @@
   import org.apache.wvcm.store.webdav.request.RebindRequest;
   import org.apache.wvcm.store.webdav.request.ReportRequest;
   import 
org.apache.wvcm.store.webdav.request.ReportRequest.ExpandPropertyReportRequest;
  +import 
org.apache.wvcm.store.webdav.request.ReportRequest.LocateByHistoryReportRequest;
   import org.apache.wvcm.store.webdav.request.UnbindRequest;
   import org.apache.wvcm.store.webdav.response.ErrorResponse;
   import org.apache.wvcm.store.webdav.response.MultistatusResponse;
  @@ -336,6 +337,59 @@
                       else {
                           break;
                       }
  +                default:
  +                    throw new WvcmException(
  +                        st, resourcepath, ReasonCode.FORBIDDEN, null);
  +            }
  +        }
  +        catch (java.io.IOException e) {
  +            throw new WvcmException(
  +                "Read failed", resourcepath, ReasonCode.READ_FAILED, new 
Exception[]{e});
  +        }
  +        finally {
  +            method.releaseConnection();
  +        }
  +    }
  +    
  +    /**
  +     * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  +     * that identify the controllable resources that are members of
  +     * this [EMAIL PROTECTED] ControllableFolder} and whose versionHistory property 
identifies
  +     * a member of the <code>versionHistoryList</code> parameter.
  +     * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} 
objects that
  +     * are being located.
  +     * @param wantedPropertyList The properties to be retrieved for the
  +     * returned version-controlled resources.
  +     */
  +    public List doLocateByHistoryReport(List versionHistoryList, PropertyNameList 
wantedPropertyList) throws WvcmException {
  +        LocationImpl loc = (LocationImpl)resource().location();
  +        String resourcepath = loc.path();
  +        ReportMethod method = new ReportMethod(loc.escapedPath());
  +        ReportRequest req = new LocateByHistoryReportRequest( versionHistoryList, 
wantedPropertyList );
  +        method.setRequestBody( req.reqBodyAsString() );
  +        method.addRequestHeader( "Content-Type", "text/xml; charset=\"utf-8\"" );
  +        method.addRequestHeader( "Depth", "infinity" );
  +        
  +        try {
  +            client().executeMethod( method );
  +            int sc = method.getStatusCode();
  +            String st = method.getStatusText();
  +            switch( sc ) {
  +                case HttpStatus.SC_MULTI_STATUS:
  +                    MultistatusResponse resp =
  +                        new MultistatusResponse( resource(), 
method.getResponseBodyAsStream(),wantedPropertyList );
  +                    return resp.createResourceProxies();
  +                case HttpStatus.SC_FORBIDDEN:
  +                case HttpStatus.SC_CONFLICT:
  +                    ErrorResponse errorRsp = new ErrorResponse( 
method.getResponseBodyAsStream() );
  +                    throw new WvcmException(
  +                        st, resourcepath, errorRsp.getWvcmReasonCode(), null);
  +                case HttpStatus.SC_NOT_FOUND:
  +                    throw new WvcmException(
  +                        st, resourcepath, ReasonCode.NOT_FOUND, null);
  +                case HttpStatus.SC_UNAUTHORIZED:
  +                    throw new WvcmException(
  +                        st, resourcepath, ReasonCode.UNAUTHORIZED, null);
                   default:
                       throw new WvcmException(
                           st, resourcepath, ReasonCode.FORBIDDEN, null);
  
  
  
  1.3       +10 -4     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ControllableFolderWebdavAccessor.java
  
  Index: ControllableFolderWebdavAccessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/ControllableFolderWebdavAccessor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControllableFolderWebdavAccessor.java     8 Dec 2003 17:14:22 -0000       1.2
  +++ ControllableFolderWebdavAccessor.java     7 May 2004 16:11:29 -0000       1.3
  @@ -63,14 +63,20 @@
   
   package org.apache.wvcm.store.webdav;
   
  +import java.util.List;
  +import javax.wvcm.PropertyNameList;
   import javax.wvcm.Resource;
   import javax.wvcm.WvcmException;
   import javax.wvcm.WvcmException.ReasonCode;
   import org.apache.commons.httpclient.HttpMethod;
   import org.apache.commons.httpclient.HttpStatus;
   import org.apache.webdav.methods.MkcolMethod;
  +import org.apache.webdav.methods.ReportMethod;
   import org.apache.wvcm.LocationImpl;
   import org.apache.wvcm.store.ControllableFolderAccessor;
  +import org.apache.wvcm.store.webdav.request.ReportRequest;
  +import org.apache.wvcm.store.webdav.response.ErrorResponse;
  +import org.apache.wvcm.store.webdav.response.MultistatusResponse;
   
   /**
    * WebDAV-based implementation of FolderResourceAccessor.
  
  
  
  1.13      +4 -18     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/WorkspaceImpl.java
  
  Index: WorkspaceImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/WorkspaceImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WorkspaceImpl.java        8 Dec 2003 17:14:26 -0000       1.12
  +++ WorkspaceImpl.java        7 May 2004 16:11:29 -0000       1.13
  @@ -189,20 +189,6 @@
       }
       
       /**
  -     * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  -     * that identify the controllable resources that are members of
  -     * this [EMAIL PROTECTED] Workspace} and whose versionHistory property 
identifies
  -     * a member of the <code>versionHistoryList</code> parameter.
  -     * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} 
objects that
  -     * are being located.
  -     * @param wantedPropertyList The properties to be retrieved for the
  -     * returned version-controlled resources.
  -     */
  -    public List doLocateByHistoryReport(List versionHistoryList, PropertyNameList 
wantedPropertyList) throws WvcmException {
  -        return ((WorkspaceAccessor)accessor()).doLocateByHistoryReport( 
versionHistoryList, wantedPropertyList );
  -    }
  -    
  -    /**
        * Return a list of [EMAIL PROTECTED] Activity} objects that identify
        * the activities that will initialize the ActivityList property
        * of a version-controlled member of this [EMAIL PROTECTED] Workspace} when 
that member
  
  
  
  1.3       +18 -4     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ControllableFolderImpl.java
  
  Index: ControllableFolderImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/ControllableFolderImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControllableFolderImpl.java       8 Dec 2003 17:14:26 -0000       1.2
  +++ ControllableFolderImpl.java       7 May 2004 16:11:29 -0000       1.3
  @@ -221,5 +221,19 @@
           return folderAccessor().doReadMemberList( wantedPropertyList, deep);
       }
       
  +    /**
  +     * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  +     * that identify the controllable resources that are members of
  +     * this [EMAIL PROTECTED] Workspace} and whose versionHistory property 
identifies
  +     * a member of the <code>versionHistoryList</code> parameter.
  +     * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} 
objects that
  +     * are being located.
  +     * @param wantedPropertyList The properties to be retrieved for the
  +     * returned version-controlled resources.
  +     */
  +    public List doLocateByHistoryReport(List versionHistoryList, PropertyNameList 
wantedPropertyList) throws WvcmException {
  +        return folderAccessor().doLocateByHistoryReport( versionHistoryList, 
wantedPropertyList );
  +    }
  +    
   }
   
  
  
  
  1.13      +4 -16     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/WorkspaceAccessor.java
  
  Index: WorkspaceAccessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/WorkspaceAccessor.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WorkspaceAccessor.java    8 Dec 2003 17:14:24 -0000       1.12
  +++ WorkspaceAccessor.java    7 May 2004 16:11:29 -0000       1.13
  @@ -74,17 +74,5 @@
    * @version $Revision$
    */
   public interface WorkspaceAccessor extends ControllableFolderAccessor {
  -    
  -    /**
  -     * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  -     * that identify the controllable resources that are members of
  -     * this [EMAIL PROTECTED] Workspace} and whose versionHistory property 
identifies
  -     * a member of the <code>versionHistoryList</code> parameter.
  -     * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} 
objects that
  -     * are being located.
  -     * @param wantedPropertyList The properties to be retrieved for the
  -     * returned version-controlled resources.
  -     */
  -    public List doLocateByHistoryReport(List versionHistoryList, PropertyNameList 
wantedPropertyList) throws WvcmException;
   }
   
  
  
  
  1.13      +17 -4     
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/FolderAccessor.java
  
  Index: FolderAccessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/FolderAccessor.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- FolderAccessor.java       8 Dec 2003 17:14:24 -0000       1.12
  +++ FolderAccessor.java       7 May 2004 16:11:29 -0000       1.13
  @@ -64,6 +64,7 @@
   package org.apache.wvcm.store;
   
   import java.util.Iterator;
  +import java.util.List;
   import javax.wvcm.PropertyNameList;
   import javax.wvcm.Resource;
   import javax.wvcm.WvcmException;
  @@ -122,4 +123,16 @@
        * @throws   WvcmException
        */
       public void doUnbind( String bindingName ) throws WvcmException;
  +    
  +    /**
  +     * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  +     * that identify the controllable resources that are members of
  +     * this [EMAIL PROTECTED] ControllableFolder} and whose versionHistory property 
identifies
  +     * a member of the <code>versionHistoryList</code> parameter.
  +     * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} 
objects that
  +     * are being located.
  +     * @param wantedPropertyList The properties to be retrieved for the
  +     * returned version-controlled resources.
  +     */
  +    public List doLocateByHistoryReport(List versionHistoryList, PropertyNameList 
wantedPropertyList) throws WvcmException;
   }
  
  
  
  1.3       +6 -2      
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ControllableFolderAccessor.java
  
  Index: ControllableFolderAccessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/ControllableFolderAccessor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControllableFolderAccessor.java   8 Dec 2003 17:14:24 -0000       1.2
  +++ ControllableFolderAccessor.java   7 May 2004 16:11:29 -0000       1.3
  @@ -71,5 +71,9 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Peter Nevermann</a>
    * @version $Revision$
    */
  +import java.util.List;
  +import javax.wvcm.PropertyNameList;
  +import javax.wvcm.WvcmException;
  +
   public interface ControllableFolderAccessor extends ControllableResourceAccessor {
   }
  
  
  
  1.2       +7 -4      
jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/response/PropertiesFactory.java
  
  Index: PropertiesFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/org/apache/wvcm/store/webdav/response/PropertiesFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PropertiesFactory.java    8 Dec 2003 17:14:23 -0000       1.1
  +++ PropertiesFactory.java    7 May 2004 16:11:29 -0000       1.2
  @@ -347,6 +347,9 @@
           if( propname == PropertyName.CHECKED_OUT && 
propertiesContainer.containsKey(PropertyName.IS_CHECKED_OUT)) {
               propertiesContainer.put( PropertyName.IS_CHECKED_OUT, new Boolean(true) 
);
           }
  +        else if( propname == PropertyName.CHECKED_IN && 
propertiesContainer.containsKey(PropertyName.IS_CHECKED_OUT)) {
  +            propertiesContainer.put( PropertyName.IS_CHECKED_OUT, new 
Boolean(false) );
  +        }
           else if( propname == PropertyName.CONTENT_TYPE ) {
               String[] ctTokens = tokenizeContentType( (String)propvalue );
               if (propertiesContainer.containsKey(PropertyName.CONTENT_TYPE)) {
  
  
  
  1.2       +22 -7     
jakarta-slide/proposals/wvcm/src/javax/wvcm/ControllableFolder.java
  
  Index: ControllableFolder.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/wvcm/src/javax/wvcm/ControllableFolder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ControllableFolder.java   26 Sep 2003 13:35:23 -0000      1.1
  +++ ControllableFolder.java   7 May 2004 16:11:30 -0000       1.2
  @@ -24,7 +24,7 @@
       * without communicating with the server.
       * @see #doReadMemberList
       * @param wantedPropertyList The list of properties to be retrieved.
  -    * @param deep Whether to retrieve properties for all members of this [EMAIL 
PROTECTED] Folder}. 
  +    * @param deep Whether to retrieve properties for all members of this [EMAIL 
PROTECTED] Folder}.
       */
      public Iterator readMemberList(
         PropertyNameList wantedPropertyList,
  @@ -36,15 +36,15 @@
       * <p>
       * A version-controlled configuration resource is associated with
       * this [EMAIL PROTECTED] ControllableFolder}, which allows versions of the 
configuration rooted at
  -    * this [EMAIL PROTECTED] ControllableFolder} to be created by checking out and 
checking in the 
  +    * this [EMAIL PROTECTED] ControllableFolder} to be created by checking out and 
checking in the
       * version-controlled configuration resource. </p>
       * <p>
       * A version of a configuration is called a "baseline". </p>
  -    * 
  +    *
       * @throws WvcmException Preconditions:
       * <br>(controlled-configuration-must-not-exist): The ControlledConfiguration 
property
       *  of the folder identified by this ControllableFolder MUST NOT exist.
  -    * 
  +    *
       * @throws WvcmException Postconditions:
       * <br>(create-controlled-configuration): A new version-controlled configuration 
is created,
       *  whose RootFolder property identifies the folder.
  @@ -62,13 +62,13 @@
       * Put this [EMAIL PROTECTED] ControllableFolder} under baseline control and 
initialize
       * it with the contents of the specified baseline.
       * @param baseline The baseline used to initialize the folder.
  -    * 
  +    *
       * @throws WvcmException Preconditions:
       * <br>(cannot-add-to-existing-history): This ControllableFolder MUST NOT 
identify an existing resource.
       * <br>(one-baseline-controlled-folder-per-history-per-workspace): There MUST 
NOT be another folder
       *  in the workspace of this ControllableFolder whose ControlledConfiguration 
property
  -    *  identifies a version-controlled configuration for the baseline history of 
that baseline. 
  -    * 
  +    *  identifies a version-controlled configuration for the baseline history of 
that baseline.
  +    *
       * @throws WvcmException Postconditions:
       * <br>(create-controlled-configuration): A new folder is created at the 
location of this ControllableFolder,
       *  and a new version-controlled configuration is created, whose RootFolder 
property
  @@ -101,5 +101,20 @@
       * @see #doBaselineControl
       */
      public boolean getBaselineControllable() throws WvcmException;
  +
  +   /**
  +     * NOT YET STANDARD *** This method is normally retricted to Workspace ***
  +    * Return a list of [EMAIL PROTECTED] ControllableResource} objects
  +    * that identify the controllable resources that are members of
  +    * this [EMAIL PROTECTED] ControllableFolder} and whose versionHistory property 
identifies
  +    * a member of the <code>versionHistoryList</code> parameter.
  +    * @param versionHistoryList A list of [EMAIL PROTECTED] VersionHistory} objects 
that
  +    * are being located.
  +    * @param wantedPropertyList The properties to be retrieved for the
  +    * returned version-controlled resources.
  +    */
  +   public List doLocateByHistoryReport(
  +      List versionHistoryList,
  +      PropertyNameList wantedPropertyList) throws WvcmException;
   
   }
  
  
  

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

Reply via email to