Esempio n. 1
0
 def renderPosts(self, addContentToPnl, posts):
     """
     Render posts i a stream
     """
     addContentToPnl.clear()
     addContentToPnl.add(HTML(u"Number of posts: " + java.str(posts.__len__())))
     for post in Util.iterate(posts):
         try:
             GWT.log(u"Render: " + java.str(JSONObject(post).toString()), None)
             postContentPnl = VerticalPanel()
             postContentPnl.addStyleName(u"postContent")
             postContentPnl.add(HTML(java.str(FbName(post.getActorId())) + u" " + post.getMessage()))
             if post.getAttachment().getName() is not None:
                 postContentPnl.add(self.createAttachmentUI(post.getAttachment()))
             if post.getLikes().getCount() > 0:
                 postContentPnl.add(self.createLikesUI(post.getLikes()))
             if post.getComments().getCount() > 0:
                 postContentPnl.add(self.createCommentsUI(post.getComments()))
             p = HorizontalPanel() #  Add profilepic on the left, postcontent on the right
             p.addStyleName(u"post")
             p.add(FbProfilePic(post.getActorId()))
             p.add(postContentPnl)
             addContentToPnl.add(p) #  postPnl.add ( asJson ( "LikesAsJson: ", post.getLikes () ));
         except Exception,e:
             GWT.log(u"Unkown exception ", e)
Esempio n. 2
0
 def renderAlbums(self, addContentToPnl, albums):
     """
     Render list of albums in stream
     """
     addContentToPnl.clear()
     p = VerticalPanel()
     p.getElement().setId(u"ProfilAlbums")
     p.add(HTML(u"<h3>Albums in Stream</h3>"))
     for a in Util.iterate(albums):
         p.add(HTML(java.str(u"<h4>" + java.str(a.getName())) + u"</h4>"))
         if a.hasCover():
             p.add(HTML(u" CoverPid:  " + java.str(a.getCoverPid())))
             p.add(FbPhoto(a.getCoverPid(), FbPhoto.Size.small))
     addContentToPnl.add(p)
     Xfbml.parse(p)
Esempio n. 3
0
 def renderProfiles(self, addContentToPnl, profiles):
     """
     Render profiles in the stream
     """
     addContentToPnl.clear()
     addContentToPnl.add(HTML(u"<h3>Profiles in Strea</h3>"))
     for p in Util.iterate(profiles):
         tmp = FlowPanel() #  Split pic on the left, name on the right
         tmp.addStyleName(u"profiles fbColorLight rounded addSpace")
         tmp.add(Image(p.getPicSquare()))
         a = Anchor(p.getName()) #  Link to profile
         a.addStyleName(u"postContent")
         a.setHref(p.getUrl())
         tmp.add(a)
         addContentToPnl.add(tmp)
Esempio n. 4
0
 def createAttachmentUI(self, attachment):
     """
     Create attachment UI
     """
     p = VerticalPanel()
     p.addStyleName(u"attachment fbColorLight rounded addSpace")
     p.add(HTML(u"<h3>Attachment</h3> "))
     thumbs = HorizontalPanel()
     thumbs.setSpacing(10)
     for m in Util.iterate(attachment.getMedia()):
         p.add(HTML(u"<b>MediaContent:</b> " + java.str(m.getType())))
         if m.getSrc() is not None:
             thumbs.add(Image(m.getSrc()))
         if m.getTypeEnum() == Type.video:
             vLink = Anchor(u"See Video")
             vLink.setHref(m.getVideo().getSourceUrl())
             p.add(vLink)
     p.add(thumbs)
     return p
Esempio n. 5
0
 def getOfficers(self):
     return Util.convertStringArray(self.getOfficersNative())
Esempio n. 6
0
 def getNotReplied(self):
     return Util.convertStringArray(self.getNotRepliedNative())
Esempio n. 7
0
 def getFriends(self):
     return Util.convertNumberArray(self.getFriendsArray())
Esempio n. 8
0
 def getAdmins(self):
     return Util.convertStringArray(self.getAdminsNative())
Esempio n. 9
0
 def getSample(self):
     return Util.convertNumberArray(self.getSampleArray())
Esempio n. 10
0
 def getRecipients(self):
     return Util.convertNumberArray(self.getRecipientsNative())
Esempio n. 11
0
 def getNotReplied(self):
     return Util.convertNumberArray(self.getNotRepliedArray())
Esempio n. 12
0
 def getUnsure(self):
     return Util.convertNumberArray(self.getUnsureArray())
Esempio n. 13
0
 def getAttending(self):
     return Util.convertNumberArray(self.getAttendingArray())