1 package org.musicontroller.gui.components;
2
3 import java.util.Set;
4
5 import org.apache.tapestry.BaseComponent;
6 import org.musicontroller.core.Band;
7 import org.musicontroller.core.Playlist;
8 import org.musicontroller.service.McService;
9 import org.varienaja.comments.Comment;
10 import org.varienaja.comments.CommentElement;
11
12
13 public abstract class PlaylistReviews extends BaseComponent {
14
15 public abstract McService getMcService();
16
17 public abstract Playlist getPlaylist();
18 public abstract void setPlaylist(Playlist playlist);
19 public abstract Band getBand();
20 public abstract void setBand(Band band);
21
22 public abstract Comment getReview();
23 public abstract void setReview(Comment review);
24
25 public abstract CommentElement getElement();
26 public abstract void setElement(CommentElement element);
27
28 public Set<Comment> getReviews() {
29 if (getPlaylist()==null) {
30 return getMcService().getReviews(getBand());
31 } else {
32 return getMcService().getReviews(getPlaylist());
33 }
34 }
35
36 public int getReviewtitlelenght() {
37 String title = getReview().getTitle();
38 return title==null ? 0 : getReview().getTitle().length();
39 }
40
41
42 }