emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* UIDs in icalendar export (exporting my agenda)
@ 2009-07-15 17:58 aldrin d'souza
  2009-07-15 19:17 ` Nick Dokos
  2009-07-15 19:43 ` Magnus Henoch
  0 siblings, 2 replies; 4+ messages in thread
From: aldrin d'souza @ 2009-07-15 17:58 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1224 bytes --]

hello,

i want to export my org-agenda as an icalendar file so that i can load it
into some online calendar and access it on my phone. however, i'm facing
some issues with the iCalendar files which org is generating. i can
reproduce the problem by using org-export-icalendar-this-file on the
following (simple) org file

---<test.org>----
* <2009-05-24 +1y> bob dylan
* <2009-01-27 +1y> mozart
---</test.org>----

here's the test.ics that gets generated:

---<test.ics>----
BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:test
PRODID:-//my-name//Emacs with Org-mode//EN
X-WR-TIMEZONE:+0530
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID: TS-c7g0uc40uoe0
DTSTART;VALUE=DATE:20090524
DTEND;VALUE=DATE:20090525
RRULE:FREQ=YEARLY;INTERVAL=1
SUMMARY: bob dylan
CATEGORIES:test
END:VEVENT
BEGIN:VEVENT
UID: TS-c7g0uc40uoe0
DTSTART;VALUE=DATE:20090127
DTEND;VALUE=DATE:20090128
RRULE:FREQ=YEARLY;INTERVAL=1
SUMMARY: mozart
CATEGORIES:test
END:VEVENT
END:VCALENDAR
---</test.ics>----

if you notice, the UIDs in both the events are same. aren't they supposed to
be different? when i import this file into an online calendar (like google)
one of the event is dropped.
am i missing something? i'm using org 6.28trans on emacs 23.0.94.

thanks,
--
ajd.

[-- Attachment #1.2: Type: text/html, Size: 1500 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UIDs in icalendar export (exporting my agenda)
  2009-07-15 17:58 UIDs in icalendar export (exporting my agenda) aldrin d'souza
@ 2009-07-15 19:17 ` Nick Dokos
  2009-07-15 19:43 ` Magnus Henoch
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2009-07-15 19:17 UTC (permalink / raw)
  To: aldrin d'souza; +Cc: emacs-orgmode

aldrin d'souza <aldrindsouza@gmail.com> wrote:

> i want to export my org-agenda as an icalendar file so that i can load it into some online calendar and access it on my phone. however, i'm facing some
> issues with the iCalendar files which org is generating. i can reproduce the problem by using org-export-icalendar-this-file on the following (simple)
> org file
> 
> ---<test.org>----
> * <2009-05-24 +1y> bob dylan
> * <2009-01-27 +1y> mozart
> ---</test.org>----
> 
> here's the test.ics that gets generated:
> 
> ---<test.ics>----
 ....
> ---</test.ics>----
> 
> if you notice, the UIDs in both the events are same. aren't they supposed to be different? when i import this file into an online calendar (like google)
> one of the event is dropped.
> am i missing something? i'm using org 6.28trans on emacs 23.0.94.
> 

I tried your test.org and my test.ics has different UIDs for the two events.
They also have a different format:

UID: TS-01503584-f7a0-4b1d-b826-6a573852c4f7
UID: TS-891e3508-5228-4101-84dd-72f509a4b757

so we must be using different methods of UID generation. What is the value
of org-id-method in your setup? Mine says:

   C-h v org-id-method<RET>

,----
| org-id-method is a variable defined in `org-id.el'.
| Its value is uuidgen
| ...
`----

Then, looking at the code, the UID is set through this expression:

		(if org-icalendar-store-UID
			(org-id-get-create)
		      (or (org-id-get) (org-id-new)))

I presume (but you should check) that you have org-icalendar-store-UID
set to t (mine is defaulted to nil) which means that it gets the UID
stored in an ID property in the item (with the variable set to nil, a
new UID is generated every time, which is OK for experimentation, but
probably not OK for synchronizing: you'd want the ID of an item to
remain constant in that case).

Could it be that both your items have the same value for this property?
What happens if you delete the ID value from one (or both) and then try
the export again?

HTH,
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UIDs in icalendar export (exporting my agenda)
  2009-07-15 17:58 UIDs in icalendar export (exporting my agenda) aldrin d'souza
  2009-07-15 19:17 ` Nick Dokos
@ 2009-07-15 19:43 ` Magnus Henoch
  2009-07-16  5:29   ` aldrin d'souza
  1 sibling, 1 reply; 4+ messages in thread
From: Magnus Henoch @ 2009-07-15 19:43 UTC (permalink / raw)
  To: emacs-orgmode

"aldrin d'souza" <aldrindsouza@gmail.com> writes:

> if you notice, the UIDs in both the events are same. aren't they supposed to be
> different? when i import this file into an online calendar (like google) one of
> the event is dropped.
> am i missing something? i'm using org 6.28trans on emacs 23.0.94.

My guess: you're running on a system where current-time always returns
zero micro-seconds (Windows?); try with M-: (current-time).  In the
ideal case the output in the echo area looks like (19038 12367 114552),
but yours is probably like (19038 12367 0).

Since you don't have the uuidgen utility installed, the function
`org-id-time-to-b36' is being called to generate the id, but since it's
called twice in the same second and depends on current-time, it returns
the same value twice.

So someone should make `org-id-time-to-b36' return unique values in this
case.  (Append a random number?)

Magnus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: UIDs in icalendar export (exporting my agenda)
  2009-07-15 19:43 ` Magnus Henoch
@ 2009-07-16  5:29   ` aldrin d'souza
  0 siblings, 0 replies; 4+ messages in thread
From: aldrin d'souza @ 2009-07-16  5:29 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 514 bytes --]

Thanks a lot Magnus - your suggestions were helpful. Basically, I didn't
have uuidgen on my machine and that caused the same ID to be generated for
all timestamps. I'm not sure if that's a bug because even though I'm on
Windows, when I evaluate (current-time) it gives me the time up to
milliseconds - something like (19038 42793 57000)

Nick, thanks to you too for pointing out that I need to set
org-icalendar-store-UID. That's exactly what I need to ensure I don't upload
the same event twice.

thanks,
--
ajd.

[-- Attachment #1.2: Type: text/html, Size: 576 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-16  5:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-15 17:58 UIDs in icalendar export (exporting my agenda) aldrin d'souza
2009-07-15 19:17 ` Nick Dokos
2009-07-15 19:43 ` Magnus Henoch
2009-07-16  5:29   ` aldrin d'souza

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).