\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
\part{How to show custom event sources in Kronolith}
(<a href="http://stackoverflow.com/questions/1808104/how-to-show-custom-events-to-a-kronolith-calendar">Also posted on Stack Overflow</a>)

You can do this by implementing the \texttt{listTimeObjects} and \texttt{listTimeObjectCategories} API calls. <a href="http://www.horde.org/nag/">Nag</a> (task list) and <a href="http://www.horde.org/whups/">Whups</a> (ticket tracking) do it this way. If you are using the Git version, you can use <a href="http://theupstairsroom.com/93">TimeObjects</a>, which wraps everything up in a nice class.

Kronolith calls these functions in \texttt{initialize()} (when filling \texttt{\$all\_external\_calendars}) and \texttt{listEvents()}. It searches all APIs for this function, so you can register it with your own prefix.

\textit{timeObject} is a generic name for "things that can be shown on a calendar", like events, task due dates, ... A \textit{timeObjectCategory} is a group of \textit{timeObjects}, which can be enabled or disabled in a group by the user. (In the default layout: using the panel in the upper-right corner of the calendar view, "Calendars".)

Your implementation for \texttt{listTimeObjectCategories} should return an array, with a category id as the key, and the user-visible name as the value.

\texttt{listTimeObjects} is called with the currently selected categories (an array of id's), and a start and end date. These dates might already be \texttt{Horde\_Date} objects (to be sure, convert them again: \texttt{\$start = new Horde\_Date(\$start)}).

You should return an array of \textit{timeObjects} that belong to these categories and fall in the specified time range. The keys are event id's, the values are arrays with values for the following keys:

\begin{itemize}
\item \texttt{id}


\item \texttt{title}


\item \texttt{description}


\item \texttt{start} (\texttt{Horde\_Date} or timestamp)


\item \texttt{end} (\texttt{Horde\_Date} or timestamp)


\item \texttt{category} (Horde category, not timeobject category)


\item \texttt{params}


\end{itemize}
If you register the \texttt{show} API call, this will be used for creating the link to the \textit{timeObject} detail.

\end{document}
