1 | ;;+----------------------------------------------------------------------------- |
---|
2 | ;;+ Isidorus |
---|
3 | ;;+ (c) 2008-2010 Marc Kuester, Christoph Ludwig, Lukas Georgieff |
---|
4 | ;;+ |
---|
5 | ;;+ Isidorus is freely distributable under the LLGPL license. |
---|
6 | ;;+ You can find a detailed description in trunk/docs/LLGPL-LICENSE.txt and |
---|
7 | ;;+ trunk/docs/LGPL-LICENSE.txt. |
---|
8 | ;;+----------------------------------------------------------------------------- |
---|
9 | |
---|
10 | (in-package :atom) |
---|
11 | |
---|
12 | (defclass collection-feed (feed) |
---|
13 | ((dependency :accessor dependency |
---|
14 | :initarg :dependency :initform nil |
---|
15 | :type list |
---|
16 | :documentation "URLs of the feeds that this feed depends on") |
---|
17 | (source-locator-prefix |
---|
18 | :accessor source-locator-prefix |
---|
19 | :initarg :source-locator-prefix)) |
---|
20 | (:documentation "abstract class for atom feeds")) |
---|
21 | |
---|
22 | (defmethod feed-to-elem ((feed collection-feed)) |
---|
23 | (setf (updated feed) (get-most-recent-datetime-for-tm (id feed))) |
---|
24 | (dolist (dependency (dependency feed)) |
---|
25 | (to-elem "e:dependency" dependency))) |
---|
26 | |
---|
27 | (defclass collection-entry (entry) |
---|
28 | ((link-type :accessor link-type |
---|
29 | :initarg :link-type |
---|
30 | :type symbol |
---|
31 | :documentation "one of 'fragments-feed or 'snapshots-feed") |
---|
32 | (tm-id :accessor tm-id |
---|
33 | :initarg :tm-id |
---|
34 | :type string)) |
---|
35 | (:documentation "Class that represents an entry for a fragments feed or snapshots feed in a collection feed")) |
---|
36 | |
---|
37 | (defmethod entry-to-elem ((entry collection-entry)) |
---|
38 | (setf (updated entry) (get-most-recent-datetime-for-tm (tm-id entry))) |
---|
39 | (to-link (link entry) |
---|
40 | (if (eq 'snapshots-feed (link-type entry)) |
---|
41 | "http://www.egovpt.org/sdshare/snapshotsfeed" |
---|
42 | "http://www.egovpt.org/sdshare/fragmentsfeed") "application/atom+xml")) |
---|
43 | |
---|