22
22
23
23
import java .util .Collection ;
24
24
25
+ import org .silverpeas .rating .Rating ;
26
+ import org .silverpeas .rating .RatingPK ;
27
+
25
28
import com .silverpeas .notation .ejb .NotationBm ;
26
29
import com .silverpeas .notation .ejb .NotationRuntimeException ;
27
30
import com .silverpeas .notation .model .Notation ;
28
- import com .silverpeas .notation .model .NotationDetail ;
29
- import com .silverpeas .notation .model .NotationPK ;
30
31
import com .silverpeas .tags .ComponentTagUtil ;
31
-
32
32
import com .stratelia .webactiv .util .EJBUtilitaire ;
33
33
import com .stratelia .webactiv .util .JNDINames ;
34
34
import com .stratelia .webactiv .util .exception .SilverpeasRuntimeException ;
@@ -47,38 +47,38 @@ public NotationTagUtil(String componentId, String elementId, String userId, Stri
47
47
this .authorId = authorId ;
48
48
}
49
49
50
- public NotationDetail getPublicationNotation () {
51
- return getNotationBm ().getNotation (getPublicationNotationPK ());
50
+ public Rating getPublicationNotation () {
51
+ return getNotationBm ().getRating (getPublicationNotationPK ());
52
52
}
53
53
54
- public NotationDetail getPublicationUpdatedNotation (String note ) {
55
- NotationPK pk = getPublicationNotationPK ();
56
- getNotationBm ().updateNotation (pk , Integer .parseInt (note ));
57
- return getNotationBm ().getNotation (pk );
54
+ public Rating getPublicationUpdatedNotation (String note ) {
55
+ RatingPK pk = getPublicationNotationPK ();
56
+ getNotationBm ().updateRating (pk , Integer .parseInt (note ));
57
+ return getNotationBm ().getRating (pk );
58
58
}
59
59
60
- public NotationDetail getForumNotation () {
61
- return getNotationBm ().getNotation (getForumNotationPK ());
60
+ public Rating getForumNotation () {
61
+ return getNotationBm ().getRating (getForumNotationPK ());
62
62
}
63
63
64
- public NotationDetail getForumUpdatedNotation (String note ) {
65
- NotationPK pk = getForumNotationPK ();
66
- getNotationBm ().updateNotation (pk , Integer .parseInt (note ));
67
- return getNotationBm ().getNotation (pk );
64
+ public Rating getForumUpdatedNotation (String note ) {
65
+ RatingPK pk = getForumNotationPK ();
66
+ getNotationBm ().updateRating (pk , Integer .parseInt (note ));
67
+ return getNotationBm ().getRating (pk );
68
68
}
69
69
70
- public NotationDetail getMessageNotation () {
71
- return getNotationBm ().getNotation (getMessageNotationPK ());
70
+ public Rating getMessageNotation () {
71
+ return getNotationBm ().getRating (getMessageNotationPK ());
72
72
}
73
73
74
- public NotationDetail getMessageUpdatedNotation (String note ) {
75
- NotationPK pk = getMessageNotationPK ();
76
- getNotationBm ().updateNotation (pk , Integer .parseInt (note ));
77
- return getNotationBm ().getNotation (pk );
74
+ public Rating getMessageUpdatedNotation (String note ) {
75
+ RatingPK pk = getMessageNotationPK ();
76
+ getNotationBm ().updateRating (pk , Integer .parseInt (note ));
77
+ return getNotationBm ().getRating (pk );
78
78
}
79
79
80
- public Collection <NotationDetail > getPublicationsBestNotations (String notationsCount ) {
81
- return getNotationBm ().getBestNotations (getPublicationNotationPK (), Integer .parseInt (
80
+ public Collection <Rating > getPublicationsBestNotations (String notationsCount ) {
81
+ return getNotationBm ().getBestRatings (getPublicationNotationPK (), Integer .parseInt (
82
82
notationsCount ));
83
83
}
84
84
@@ -94,15 +94,15 @@ private NotationBm getNotationBm() {
94
94
return notationBm ;
95
95
}
96
96
97
- private NotationPK getPublicationNotationPK () {
98
- return new NotationPK (elementId , componentId , Notation . TYPE_PUBLICATION , authorId );
97
+ private RatingPK getPublicationNotationPK () {
98
+ return new RatingPK (elementId , componentId , "Publication" , authorId );
99
99
}
100
100
101
- private NotationPK getForumNotationPK () {
102
- return new NotationPK (elementId , componentId , Notation . TYPE_FORUM , authorId );
101
+ private RatingPK getForumNotationPK () {
102
+ return new RatingPK (elementId , componentId , "Forum" , authorId );
103
103
}
104
104
105
- private NotationPK getMessageNotationPK () {
106
- return new NotationPK (elementId , componentId , Notation . TYPE_MESSAGE , authorId );
105
+ private RatingPK getMessageNotationPK () {
106
+ return new RatingPK (elementId , componentId , "Message" , authorId );
107
107
}
108
108
}
0 commit comments