Store and parse replies in/from inserted Sone.
[Sone.git] / src / main / resources / templates / insert / sone.xml
index a0fc281..229ac42 100644 (file)
@@ -2,22 +2,56 @@
 <sone>
 
        <id><% currentSone.id></id>
-       <name><% currentSone.name|html></name>
+       <name><% currentSone.name|xml></name>
+       <time><% currentSone.time></time>
 
        <profile>
-               <first-name><% currentSone.profile.firstName|html></first-name>
-               <middle-name><% currentSone.profile.middleName|html></middle-name>
-               <last-name><% currentSone.profile.lastName|html></last-name>
+               <first-name><% currentSone.profile.firstName|xml></first-name>
+               <middle-name><% currentSone.profile.middleName|xml></middle-name>
+               <last-name><% currentSone.profile.lastName|xml></last-name>
        </profile>
 
        <posts>
                <%foreach currentSone.posts post>
                <post>
-                       <id><% post.id></id>
+                       <id><% post.id|xml></id>
                        <time><% post.time></time>
-                       <text><% post.text|html></text>
+                       <text><% post.text|xml></text>
                </post>
                <%/foreach>
        </posts>
 
+       <replies>
+               <%foreach currentSone.replies reply>
+               <reply>
+                       <id><% reply.id></id>
+                       <post-id><% reply.post.id|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>
+
+       <known-sones>
+               <%foreach knownSones sone>
+               <known-sone>
+                       <sone-id><% sone.id|xml></sone-id>
+                       <sone-key><% sone.requestUri|xml></sone-key>
+                       <sone-name><% sone.name|xml></sone-name>
+               </known-sone>
+               <%/foreach>
+       </known-sones>
+
 </sone>