Include album and image XML in Sone XML.
[Sone.git] / src / main / resources / templates / insert / sone.xml
1 <?xml version="1.0" encoding="utf-8" ?>
2 <sone>
3
4         <time><% currentSone.time></time>
5         <protocol-version>0</protocol-version>
6
7         <client>
8                 <name>Sone</name>
9                 <version><% version|xml></version>
10         </client>
11
12         <profile>
13                 <first-name><% currentSone.profile.firstName|xml></first-name>
14                 <middle-name><% currentSone.profile.middleName|xml></middle-name>
15                 <last-name><% currentSone.profile.lastName|xml></last-name>
16                 <birth-day><% currentSone.profile.birthDay|xml></birth-day>
17                 <birth-month><% currentSone.profile.birthMonth|xml></birth-month>
18                 <birth-year><% currentSone.profile.birthYear|xml></birth-year>
19                 <fields>
20                         <%foreach currentSone.profile.fields field>
21                         <field>
22                                 <field-name><% field.name|xml></field-name>
23                                 <field-value><% field.value|xml></field-value>
24                         </field>
25                         <%/foreach>
26                 </fields>
27         </profile>
28
29         <posts>
30                 <%foreach currentSone.posts post>
31                 <post>
32                         <id><% post.id|xml></id>
33                         <recipient><%ifnull !post.recipient><% post.recipient.id|xml><%/if></recipient>
34                         <time><% post.time></time>
35                         <text><% post.text|xml></text>
36                 </post>
37                 <%/foreach>
38         </posts>
39
40         <replies>
41                 <%foreach currentSone.replies reply>
42                 <reply>
43                         <id><% reply.id></id>
44                         <post-id><% reply.post.id|xml></post-id>
45                         <time><% reply.time></time>
46                         <text><% reply.text|xml></text>
47                 </reply>
48                 <%/foreach>
49         </replies>
50
51         <post-likes>
52                 <%foreach currentSone.likedPostIds postId>
53                 <post-like><% postId|xml></post-like>
54                 <%/foreach>
55         </post-likes>
56
57         <reply-likes>
58                 <%foreach currentSone.likedReplyIds replyId>
59                 <reply-like><% replyId|xml></reply-like>
60                 <%/foreach>
61         </reply-likes>
62
63         <%foreach currentSone.albums album>
64         <%first>
65         <albums>
66                 <%/first>
67                 <album>
68                         <id><%album.id|xml></id>
69                         <%ifnull !album.parent>
70                         <parent><%album.parent.id|xml></parent>
71                         <%/if>
72                         <title><%album.title|xml></title>
73                         <description><%album.description|xml></description>
74                         <%foreach album.images image>
75                         <%first>
76                         <images>
77                                 <%/first>
78                                 <image>
79                                         <id><%image.id|xml></id>
80                                         <creation-time><%image.creationTime|xml></creation-time>
81                                         <key><%image.key|xml></key>
82                                         <title><%image.title|xml></title>
83                                         <description><%image.description|xml></description>
84                                         <width><%image.width|xml></width>
85                                         <height><%image.height|xml></height>
86                                 </image>
87                                 <%last>
88                         </images>
89                         <%/last>
90                         <%/foreach>
91                 </album>
92                 <%last>
93         </albums>
94         <%/last>
95         <%/foreach>
96
97 </sone>