[CalendarServer-changes] [4084] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 24 20:06:39 PDT 2009


Revision: 4084
          http://trac.macosforge.org/projects/calendarserver/changeset/4084
Author:   sagen at apple.com
Date:     2009-04-24 20:06:37 -0700 (Fri, 24 Apr 2009)
Log Message:
-----------
Added caldav_utility manpage; made resource specification easier -- just put the guid.

Modified Paths:
--------------
    CalendarServer/trunk/bin/caldav_utility
    CalendarServer/trunk/support/Makefile.Apple

Added Paths:
-----------
    CalendarServer/trunk/doc/caldav_utility.8

Modified: CalendarServer/trunk/bin/caldav_utility
===================================================================
--- CalendarServer/trunk/bin/caldav_utility	2009-04-24 19:16:04 UTC (rev 4083)
+++ CalendarServer/trunk/bin/caldav_utility	2009-04-25 03:06:37 UTC (rev 4084)
@@ -145,7 +145,7 @@
     for opt, arg in optargs:
 
         if opt in ("-r", "--resource",):
-            resource = root.getChild(arg)
+            resource = root.lookupResource(arg)
             if resource is not None:
                 print "Found resource %s at %s" % (resource.resource, arg)
             else:
@@ -175,7 +175,7 @@
         elif opt in ("--add-write-delegate", "--add-read-delegate"):
             if resource is None: abort("No current resource.")
 
-            delegate = root.getChild(arg)
+            delegate = root.lookupResource(arg)
             if delegate is None:
                 abort("No delegate found for %s" % (arg,))
 
@@ -185,7 +185,7 @@
         elif opt == "--remove-delegate":
             if resource is None: abort("No current resource.")
 
-            delegate = root.getChild(arg)
+            delegate = root.lookupResource(arg)
             if delegate is None:
                 abort("No delegate found for %s" % (arg,))
 
@@ -220,6 +220,10 @@
     def writeProperty(self, prop):
         return self.resource.writeProperty(prop, FakeRequest())
 
+    def lookupResource(self, specifier):
+        # For now, support GUID lookup
+        return self.getChild("principals/__uids__/%s" % (specifier,))
+
     def getChild(self, path):
         resource = self.resource
         segments = path.strip("/").split("/")

Added: CalendarServer/trunk/doc/caldav_utility.8
===================================================================
--- CalendarServer/trunk/doc/caldav_utility.8	                        (rev 0)
+++ CalendarServer/trunk/doc/caldav_utility.8	2009-04-25 03:06:37 UTC (rev 4084)
@@ -0,0 +1,103 @@
+.\"
+.\" Copyright (c) 2006-2008 Apple Inc. All rights reserved.
+.\"
+.\" 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.
+.\"
+.\" The following requests are required for all man pages.
+.Dd April 24, 2009
+.Dt CALDAV_UTILITY 8
+.Os
+.Sh NAME
+.Nm caldav_utility
+.Nd Darwin Calendar Server Resource Utility
+.Sh SYNOPSIS
+.Nm
+.Op Fl -config Ar config_file
+.Op Fl -resource Ar guid
+.Op Fl -read-property Ar dav_property
+.Op Fl -list-read-delegates
+.Op Fl -list-write-delegates
+.Op Fl -add-read-delegate Ar guid
+.Op Fl -add-write-delegate Ar guid
+.Op Fl -remove-delegate Ar guid
+.Op Fl -set-auto-schedule Ar True|False
+.Op Fl -get-auto-schedule
+.Sh DESCRIPTION
+.Nm
+is a tool for manipulating delegate assignments for resources and
+locations, as well as specifying whether they auto-accept scheduling
+invitations.  It must be run as root on a host with a running
+calendar server.  On the command line you first select a resource
+to use (via the
+.Fl -resource
+argument), and follow that with one or
+more commands.
+.Sh OPTIONS
+.Bl -tag -width flag
+.It Fl h, -help
+Displays usage information
+.It Fl f, -config Ar FILE
+Use the Calendar Server configuration specified in the given file.  Defaults to /etc/caldavd/caldavd.plist.
+.It Fl -resource Ar guid
+Specifies the resource the following operations should be applied to.
+.It Fl -read-property Ar dav_property
+Prints the value of the dav_property on the current resource.  The format of
+the dav_property is "namespace#property".  Examples:
+"DAV:#alternate-URI-set" or "http://calendarserver.org/ns/#record-type".
+.It Fl -list-read-delegates
+Prints the list of principals that have read-only delegate access for the current resource.
+.It Fl -list-write-delegates
+Prints the list of principals that have read-write delegate access for the current resource.
+.It Fl -add-read-delegate Ar guid
+Adds a principal to the group of principals which have read-only delegate access for the current resource.  Adding a principal as a read-only delegate removes read-write access, if read-write access had previously been granted.
+.It Fl -add-write-delegate Ar guid
+Adds a principal to the group of principals which have read-write delegate access for the current resource.
+.It Fl -remove-delegate Ar guid
+Strips a principal of delegate access for the current resource.
+.It Fl -set-auto-schedule Ar True|False
+Setting auto-schedule to True will cause the current resource to automatically
+accept any scheduling invitations.  A False value means it's up to one of the
+read-write delegates for the resource to accept/decline invitations.
+.It Fl -get-auto-schedule
+Prints the current auto-schedule state of the current resource.
+.El
+.Sh USAGE
+.Nm
+processes the command line options in order, allowing you to chain multiple
+operations.  Each time you specify the
+.Fl -resource
+option, that resource becomes the "current" one.  From then on, each subsequent
+option applies to the current resource, until you
+specify the
+.Fl -resource
+option again.
+.Sh EXAMPLES
+.Bl -tag -width flag
+.It Assign two read-write delegates and display the list of read-write delegates:
+caldav_utility --resource 44234B00-5266-11DD-B22C-A07C87F02F6B --add-write-delegate 98248B00-5266-11DD-B22C-A07C87F02F6B --add-write-delegate 39838B00-5266-11DD-B22C-A07C87F02F6B --list-write-delegates
+.It Turn on auto-scheduling for a resource, and confirm the setting:
+caldav_utility --resource 44234B00-5266-11DD-B22C-A07C87F02F6B --set-auto-schedule True --get-auto-schedule
+.It Turn off auto-scheduling for multiple resources:
+caldav_utility --resource 44234B00-5266-11DD-B22C-A07C87F02F6B --set-auto-schedule False --resource 98344B00-5266-11DD-B22C-A07C87F02F6B --set-auto-schedule False
+.El
+.Sh FILES
+.Bl -tag -width flag
+.It /etc/caldavd/caldavd.plist
+The Calendar Server configuration file.
+.It /Library/CalendarServer/Data/calendaruserproxy.sqlite
+The server's proxy database, used to keep track of which principals have read-only and read-write delegate access to other principals/resources.
+.It /Library/CalendarServer/Data/resourceinfo.sqlite
+The server's resource info database, used to store additional resource information such as auto-schedule settings.
+.El
+.Sh SEE ALSO
+.Xr caldavd 8

Modified: CalendarServer/trunk/support/Makefile.Apple
===================================================================
--- CalendarServer/trunk/support/Makefile.Apple	2009-04-24 19:16:04 UTC (rev 4083)
+++ CalendarServer/trunk/support/Makefile.Apple	2009-04-25 03:06:37 UTC (rev 4084)
@@ -104,6 +104,7 @@
 	$(_v) $(INSTALL_FILE) "$(Sources)/doc/caldavd.8" "$(DSTROOT)$(MANDIR)/man8"
 	$(_v) $(INSTALL_FILE) "$(Sources)/doc/caldav_export.8" "$(DSTROOT)$(MANDIR)/man8"
 	$(_v) $(INSTALL_FILE) "$(Sources)/doc/caladmin.8" "$(DSTROOT)$(MANDIR)/man8"
+	$(_v) $(INSTALL_FILE) "$(Sources)/doc/caldav_utility.8" "$(DSTROOT)$(MANDIR)/man8"
 	$(_v) gzip -9 -f "$(DSTROOT)$(MANDIR)/man8/"*.[0-9]
 	$(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(NSLOCALDIR)/$(NSLIBRARYSUBDIR)/$(Project)"
 	$(_v) $(INSTALL_DIRECTORY) -m 0755 "$(DSTROOT)$(VARDIR)/log/caldavd"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090424/965cf169/attachment.html>


More information about the calendarserver-changes mailing list