From: Chris Hanson Date: Thu, 24 May 2001 01:18:45 +0000 (+0000) Subject: Rename the following server operations, then add methods to them to X-Git-Tag: 20090517-FFI~2795 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=948a3fce055713fbc3d40cd4c5ddb6606db42705;p=mit-scheme.git Rename the following server operations, then add methods to them to support containers as well as folders: create-folder => create-resource delete-folder => delete-resource rename-folder => rename-resource --- diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index b4b134900..cb2aefc5f 100644 --- a/v7/src/imail/imail-core.scm +++ b/v7/src/imail/imail-core.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-core.scm,v 1.131 2001/05/24 01:13:39 cph Exp $ +;;; $Id: imail-core.scm,v 1.132 2001/05/24 01:18:45 cph Exp $ ;;; ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology ;;; @@ -258,7 +258,7 @@ ;;;; Server operations ;; ------------------------------------------------------------------- -;; Create a new folder named URL. Signal an error if the folder +;; Create a new resource named URL. Signal an error if the resource ;; already exists or can't be created. (define (create-resource url) @@ -269,8 +269,8 @@ (define-generic %create-resource (url)) ;; ------------------------------------------------------------------- -;; Delete the folder named URL. Signal an error if the folder doesn't -;; exist or if it can't be deleted. +;; Delete the resource named URL. Signal an error if the resource +;; doesn't exist or if it can't be deleted. (define (delete-resource url) (%delete-resource url) @@ -280,11 +280,11 @@ (define-generic %delete-resource (url)) ;; ------------------------------------------------------------------- -;; Rename the folder named URL to NEW-URL. Signal an error if the -;; folder doesn't exist, if NEW-URL already refers to a folder, or if +;; Rename the resource named URL to NEW-URL. Signal an error if the +;; resource doesn't exist, if NEW-URL already refers to a resource, or if ;; the rename can't be performed for some reason. This operation does -;; NOT do format conversion, or move a folder from one place to -;; another. It only allows changing the name of an existing folder. +;; NOT do format conversion, or move a resource from one place to +;; another. It only allows changing the name of an existing resource. (define (rename-resource url new-url) (%rename-resource url new-url) @@ -295,8 +295,8 @@ (define-generic %rename-resource (url new-url)) ;; ------------------------------------------------------------------- -;; Insert a copy of MESSAGE in FOLDER at the end of the existing -;; messages. Unspecified result. +;; Insert a copy of MESSAGE in the folder referenced by URL at the end +;; of the existing messages. Unspecified result. (define (append-message message url) (if (%append-message message url) @@ -344,6 +344,9 @@ (define-method resource-type-name ((r )) r 'FOLDER) (define-method resource-type-name ((r )) r 'CONTAINER) +(define-method %append-message (message (folder )) + (%append-message message (resource-locator folder))) + (define-method make-child-url ((container ) name) (make-child-url (resource-locator container) name)) diff --git a/v7/src/imail/imail-umail.scm b/v7/src/imail/imail-umail.scm index 5f59e324b..edb0941db 100644 --- a/v7/src/imail/imail-umail.scm +++ b/v7/src/imail/imail-umail.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-umail.scm,v 1.47 2001/05/23 23:23:48 cph Exp $ +;;; $Id: imail-umail.scm,v 1.48 2001/05/24 01:14:10 cph Exp $ ;;; ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology ;;; @@ -40,9 +40,9 @@ (error:bad-range-argument url 'OPEN-RESOURCE)) (make-umail-folder url)) -(define-method %create-folder ((url )) +(define-method %create-resource ((url )) (if (file-exists? (pathname-url-pathname url)) - (error:bad-range-argument url 'CREATE-FOLDER)) + (error:bad-range-argument url 'CREATE-RESOURCE)) (let ((folder (make-umail-folder url))) (set-file-folder-messages! folder '#()) (set-file-folder-file-modification-time! folder (get-universal-time))