From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Schlemmer Subject: Revised iCalendar visibility Date: Tue, 26 Jun 2018 11:00:05 +0200 Message-ID: <6e29594c-744b-6fd6-6136-97f0c76a01d2@gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------71E4A994F2A99ECDE7CD669F" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXjpl-0006ki-35 for emacs-orgmode@gnu.org; Tue, 26 Jun 2018 05:00:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXjpe-0000k6-Jo for emacs-orgmode@gnu.org; Tue, 26 Jun 2018 05:00:21 -0400 Received: from mailout5.zih.tu-dresden.de ([141.30.67.74]:58788) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXjpe-0000iu-51 for emacs-orgmode@gnu.org; Tue, 26 Jun 2018 05:00:14 -0400 Received: from mail.zih.tu-dresden.de ([141.76.14.4]) by mailout5.zih.tu-dresden.de with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fXjpb-0007M1-Iz for emacs-orgmode@gnu.org; Tue, 26 Jun 2018 11:00:11 +0200 Received: from x4e339d88.dyn.telefonica.de ([78.51.157.136] helo=[192.168.2.205]) by server-50.mailclusterdns.zih.tu-dresden.de with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (envelope-from ) id 1fXjpa-0003OB-O5 for emacs-orgmode@gnu.org; Tue, 26 Jun 2018 11:00:11 +0200 Content-Language: de-DE List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org >> emacs-orgmode" This is a multi-part message in MIME format. --------------71E4A994F2A99ECDE7CD669F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, some time ago sent pull request from GitHub to support per-entry visibility in iCalendar export. I attach the patch and some short documentation of the feature in the attaced files. They have been updated to honour the timezone patch and the documentation switch from texinfo to org-mode. Regards, Tobias --------------71E4A994F2A99ECDE7CD669F Content-Type: text/x-patch; name="0001-Add-support-for-the-iCalendar-CLASS-property.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Add-support-for-the-iCalendar-CLASS-property.patch" >From fb3bd3b3a953569af6bb3e41c7d4338b41c4a1fc Mon Sep 17 00:00:00 2001 From: Tobias Schlemmer Date: Fri, 11 Aug 2017 22:18:06 +0200 Subject: [PATCH 1/2] Add support for the iCalendar CLASS property * ox-icalendar.el (org-icalendar-entry): Pick the CLASS property and pass it to `org-icalendar--vevent' and `org-icalendar--vtodo'. (org-icalendar--vevent,org-icalendar--vtodo): Add a new parameter `class' and use it to generate a `CLASS' field in the `VEVENT' entry. TINYCHANGE --- lisp/ox-icalendar.el | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 7d7c85004..e410fa2ed 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -540,6 +540,10 @@ inlinetask within the section." (org-export-get-node-property :LOCATION entry (org-property-inherit-p "LOCATION")))) + (class (org-icalendar-cleanup-string + (org-export-get-node-property + :CLASS entry + (org-property-inherit-p "CLASS")))) ;; Build description of the entry from associated section ;; (headline) or contents (inlinetask). (desc @@ -568,14 +572,14 @@ inlinetask within the section." org-icalendar-use-deadline) (org-icalendar--vevent entry deadline (concat "DL-" uid) - (concat "DL: " summary) loc desc cat tz))) + (concat "DL: " summary) loc desc cat tz class))) (let ((scheduled (org-element-property :scheduled entry))) (and scheduled (memq (if todo-type 'event-if-todo 'event-if-not-todo) org-icalendar-use-scheduled) (org-icalendar--vevent entry scheduled (concat "SC-" uid) - (concat "S: " summary) loc desc cat tz))) + (concat "S: " summary) loc desc cat tz class))) ;; When collecting plain timestamps from a headline and its ;; title, skip inlinetasks since collection will happen once ;; ENTRY is one of them. @@ -593,7 +597,7 @@ inlinetask within the section." ((t) t))) (let ((uid (format "TS%d-%s" (cl-incf counter) uid))) (org-icalendar--vevent - entry ts uid summary loc desc cat tz)))) + entry ts uid summary loc desc cat tz class)))) info nil (and (eq type 'headline) 'inlinetask)) "")) ;; Task: First check if it is appropriate to export it. If @@ -607,7 +611,7 @@ inlinetask within the section." (not (org-icalendar-blocked-headline-p entry info)))) ((t) (eq todo-type 'todo)))) - (org-icalendar--vtodo entry uid summary loc desc cat tz)) + (org-icalendar--vtodo entry uid summary loc desc cat tz class)) ;; Diary-sexp: Collect every diary-sexp element within ENTRY ;; and its title, and transcode them. If ENTRY is ;; a headline, skip inlinetasks: they will be handled @@ -638,7 +642,7 @@ inlinetask within the section." contents)))) (defun org-icalendar--vevent - (entry timestamp uid summary location description categories timezone) + (entry timestamp uid summary location description categories timezone class) "Create a VEVENT component. ENTRY is either a headline or an inlinetask element. TIMESTAMP @@ -648,7 +652,9 @@ summary or subject for the event. LOCATION defines the intended venue for the event. DESCRIPTION provides the complete description of the event. CATEGORIES defines the categories the event belongs to. TIMEZONE specifies a time zone for this event -only. +only. CLASS contains the visibility attribute. Three of them +(PUBLIC, CONFIDENTIAL and PRIVATE) are predefined, others +should be treated as PRIVATE if they are unknown to the iCalendar server. Return VEVENT component as a string." (org-icalendar-fold-string @@ -669,6 +675,7 @@ Return VEVENT component as a string." (org-element-property :repeater-value timestamp))) "SUMMARY:" summary "\n" (and (org-string-nw-p location) (format "LOCATION:%s\n" location)) + (and (org-string-nw-p class) (format "CLASS:%s\n" class)) (and (org-string-nw-p description) (format "DESCRIPTION:%s\n" description)) "CATEGORIES:" categories "\n" @@ -677,7 +684,7 @@ Return VEVENT component as a string." "END:VEVENT")))) (defun org-icalendar--vtodo - (entry uid summary location description categories timezone) + (entry uid summary location description categories timezone class) "Create a VTODO component. ENTRY is either a headline or an inlinetask element. UID is the @@ -712,6 +719,7 @@ Return VTODO component as a string." "\n")) "SUMMARY:" summary "\n" (and (org-string-nw-p location) (format "LOCATION:%s\n" location)) + (and (org-string-nw-p class) (format "CLASS:%s\n" class)) (and (org-string-nw-p description) (format "DESCRIPTION:%s\n" description)) "CATEGORIES:" categories "\n" -- 2.18.0.rc2 --------------71E4A994F2A99ECDE7CD669F Content-Type: text/x-patch; name="0002-Add-support-for-the-iCalendar-CLASS-property.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-Add-support-for-the-iCalendar-CLASS-property.patch" >From 128d45bf1c7f9b2b01009f9a8f87862aaaf934c0 Mon Sep 17 00:00:00 2001 From: Tobias Schlemmer Date: Tue, 26 Jun 2018 10:05:41 +0200 Subject: [PATCH 2/2] Add support for the iCalendar CLASS property * doc/org-manual.org (iCalendar export): Document the CLASS tag TINYCHANGE --- doc/org-manual.org | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index ee25fc78b..68da3adff 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -15029,18 +15029,20 @@ connections. #+cindex: @samp{DESCRIPTION}, property #+cindex: @samp{LOCATION}, property #+cindex: @samp{TIMEZONE}, property +#+cindex: @samp{CLASS}, property The iCalendar export back-end includes =SUMMARY=, =DESCRIPTION=, -=LOCATION= and =TIMEZONE= properties from the Org entries when -exporting. To force the back-end to inherit the =LOCATION= and -=TIMEZONE= properties, configure the ~org-use-property-inheritance~ -variable. +=LOCATION=, =TIMEZONE= and =CLASS= properties from the Org entries +when exporting. To force the back-end to inherit the =LOCATION=, +=TIMEZONE= and =CLASS= properties, configure the +~org-use-property-inheritance~ variable. #+vindex: org-icalendar-include-body -When Org entries do not have =SUMMARY=, =DESCRIPTION= and =LOCATION= -properties, the iCalendar export back-end derives the summary from the -headline, and derives the description from the body of the Org item. -The ~org-icalendar-include-body~ variable limits the maximum number of -characters of the content are turned into its description. +When Org entries do not have =SUMMARY=, =DESCRIPTION=, =LOCATION= and +=CLASS= properties, the iCalendar export back-end derives the summary +from the headline, and derives the description from the body of the +Org item. The ~org-icalendar-include-body~ variable limits the +maximum number of characters of the content are turned into its +description. The =TIMEZONE= property can be used to specify a per-entry time zone, and is applied to any entry with timestamp information. Time zones @@ -15048,6 +15050,16 @@ should be specified as per the IANA time zone database format, e.g., =Asia/Almaty=. Alternately, the property value can be =UTC=, to force UTC time for this entry only. +The =CLASS= property can be used to specify a per-entry visibility +class or access restrictions, and is applied to any entry with class +information. The iCalendar standard defines three visibility classes: +- PUBLIC :: The entry is publicly visible (this is the default). +- CONFIDENTIAL :: Only a limited group of clients get access to the + event. +- PRIVATE :: The entry can be retrieved only by its owner. +The server should treat unknown class +properties the same as PRIVATE. + Exporting to iCalendar format depends in large part on the capabilities of the destination application. Some are more lenient than others. Consult the Org mode FAQ for advice on specific -- 2.18.0.rc2 --------------71E4A994F2A99ECDE7CD669F--