Add isRoot() method to Album, only dump album ID in sone.xml if the parent is not...
[Sone.git] / src / main / resources / templates / insert / sone.xml
index 0bb35b0..3d456d4 100644 (file)
@@ -1,6 +1,99 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <sone>
 
-       <name><% currentSone.name|html></name>
+       <time><% currentSone.time></time>
+       <protocol-version>0</protocol-version>
+
+       <client>
+               <name>Sone</name>
+               <version><% version|xml></version>
+       </client>
+
+       <profile>
+               <first-name><% currentSone.profile.firstName|xml></first-name>
+               <middle-name><% currentSone.profile.middleName|xml></middle-name>
+               <last-name><% currentSone.profile.lastName|xml></last-name>
+               <birth-day><% currentSone.profile.birthDay|xml></birth-day>
+               <birth-month><% currentSone.profile.birthMonth|xml></birth-month>
+               <birth-year><% currentSone.profile.birthYear|xml></birth-year>
+               <avatar><%currentSone.profile.avatar|xml></avatar>
+               <fields>
+                       <%foreach currentSone.profile.fields field>
+                       <field>
+                               <field-name><% field.name|xml></field-name>
+                               <field-value><% field.value|xml></field-value>
+                       </field>
+                       <%/foreach>
+               </fields>
+       </profile>
+
+       <posts>
+               <%foreach currentSone.posts post>
+               <post>
+                       <id><% post.id|xml></id>
+                       <recipient><%if post.recipientId.present><% post.recipientId.get|xml><%/if></recipient>
+                       <time><% post.time></time>
+                       <text><% post.text|xml></text>
+               </post>
+               <%/foreach>
+       </posts>
+
+       <replies>
+               <%foreach currentSone.replies reply>
+               <reply>
+                       <id><% reply.id></id>
+                       <post-id><% reply.postId|xml></post-id>
+                       <time><% reply.time></time>
+                       <text><% reply.text|xml></text>
+               </reply>
+               <%/foreach>
+       </replies>
+
+       <post-likes>
+               <%foreach currentSone.likedPostIds postId>
+               <post-like><% postId|xml></post-like>
+               <%/foreach>
+       </post-likes>
+
+       <reply-likes>
+               <%foreach currentSone.likedReplyIds replyId>
+               <reply-like><% replyId|xml></reply-like>
+               <%/foreach>
+       </reply-likes>
+
+       <%foreach currentSone.albums album>
+       <%first>
+       <albums>
+               <%/first>
+               <album>
+                       <id><%album.id|xml></id>
+                       <%if !album.parent.root>
+                       <parent><%album.parent.id|xml></parent>
+                       <%/if>
+                       <title><%album.title|xml></title>
+                       <description><%album.description|xml></description>
+                       <album-image><%album.albumImage.id|xml></album-image>
+                       <%foreach album.images image>
+                       <%first>
+                       <images>
+                               <%/first>
+                               <image>
+                                       <id><%image.id|xml></id>
+                                       <creation-time><%image.creationTime|xml></creation-time>
+                                       <key><%image.key|xml></key>
+                                       <title><%image.title|xml></title>
+                                       <description><%image.description|xml></description>
+                                       <width><%image.width|xml></width>
+                                       <height><%image.height|xml></height>
+                               </image>
+                               <%last>
+                       </images>
+                       <%/last>
+                       <%/foreach>
+               </album>
+               <%last>
+       </albums>
+       <%/last>
+       <%/foreach>
 
 </sone>