%3 ::caldav::calitem ::caldav::calitem add_ical_var as_ical_calendar as_ical_event debug ::xo::ical::VEVENT ::xo::ical::VEVENT finish ::caldav::calitem->::xo::ical::VEVENT ::xo::ical::VCALITEM ::xo::ical::VCALITEM add_recurrence as_ical edit_recurrence get ical_body parse RRULE start_end tag ::xo::ical::VEVENT->::xo::ical::VCALITEM

Class ::caldav::calitem

::caldav::calitem[i] create ... \
           [ -creation_date creation_date ] \
           [ -description description ] \
           [ -dtend dtend ] \
           [ -dtstamp dtstamp ] \
           [ -dtstart dtstart ] \
           [ -etag etag ] \
           [ -formatted_recurrences formatted_recurrences ] \
           [ -geo geo ] \
           [ -ical_vars (default "") ] \
           [ -is_day_item (default "false") ] \
           [ -last-modified last-modified ] \
           [ -last_modified last_modified ] \
           [ -location location ] \
           [ -priority priority ] \
           [ -sequence sequence ] \
           [ -status status ] \
           [ -summary summary ] \
           [ -transp transp ] \
           [ -uid uid ] \
           [ -url url ]

"calitem" is a specialization of a ::xoical::VEVENTV providinig extra functionality. GN TODO: check, what else of this could go into VEVENT.
Defined in packages/caldav/tcl/caldav-item-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::xo::ical::VEVENT[i]
::nx::Class create ::caldav::calitem \
     -superclass ::xo::ical::VEVENT

Methods (to be applied on instances)

  • add_ical_var (scripted, public)

     <instance of caldav::calitem[i]> add_ical_var tag param value

    add tag/param/value to the property ical_vars which are variables treated separately.

    Parameters:
    tag (required)
    param (required)
    value (required)

    Testcases:
    No testcase defined.
    lappend :ical_vars $tag $param $value
  • as_ical_calendar (scripted, public)

     <instance of caldav::calitem[i]> as_ical_calendar \
        [ -calendar_name calendar_name ]

    Output a ::caldav::calitem in the form of a full calendar. For now, without timezone [::caldav::calendars timezone]

    Switches:
    -calendar_name (optional)

    Testcases:
    No testcase defined.
    #
    # TODO: why is not "header" and "footer" a method like
    # as_ical_event but from :caldav::calendars?
    #
    append result  [::caldav::calendars header -calendar_name $calendar_name]  [:as_ical_event]  [::caldav::calendars footer]
    return $result
  • as_ical_event (scripted, public)

     <instance of caldav::calitem[i]> as_ical_event

    Output a ::caldav::calitem into ical VEVENT notation. It differs from standard as_ical in the following aspects: - it hard-codes the item_type to VEVENT - it handles the VALARM block handed in via ical_vars TODO: probably not the best way. - it imports the attributes of the ical_vars into instance attributes. TODO: this is dangerous - it flags entries as all day events

    Testcases:
    No testcase defined.
    set extra_block ""
    foreach {tag param value} ${:ical_vars} {
        #:debug "attribute $tag value <$value>"
        
        if {$tag eq "OPAQUE-VALARM"} {
            #
            # This is a full block, already correctly encoded
            
            append extra_block $value
            
        } else {
            #
            # standard case
            #
            append extra_block  [:tag -tag $tag -param $param -value $value ""]
        }
    }
    
    #
    # Check for all day events (start time and end time are
    # equal) and convert them
    #
    if {${:dtstart} eq ${:dtend}
        && [clock format [clock scan ${:dtstart}] -format %H%M] eq "0000"
    } {
        set :is_day_item true
        :debug "this is an all day event ${:dtstart}"
    } else {
        :debug "no day event ${:dtstart} ${:dtend} SCAN [clock format [clock scan ${:dtstart}] -format %H%M]"
    }
    return "BEGIN:VEVENT\r\n[:ical_body]${extra_block}END:VEVENT\r\n"