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 e25cac9..3d456d4 100644 (file)
@@ -16,6 +16,7 @@
                <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>
@@ -30,7 +31,7 @@
                <%foreach currentSone.posts post>
                <post>
                        <id><% post.id|xml></id>
-                       <recipient><%ifnull !post.recipient><% post.recipient.id|xml><%/if></recipient>
+                       <recipient><%if post.recipientId.present><% post.recipientId.get|xml><%/if></recipient>
                        <time><% post.time></time>
                        <text><% post.text|xml></text>
                </post>
@@ -41,7 +42,7 @@
                <%foreach currentSone.replies reply>
                <reply>
                        <id><% reply.id></id>
-                       <post-id><% reply.post.id|xml></post-id>
+                       <post-id><% reply.postId|xml></post-id>
                        <time><% reply.time></time>
                        <text><% reply.text|xml></text>
                </reply>
                <%/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>