Skip to content

Commit 0d676a1

Browse files
author
svuillet
committed
Change API calls
1 parent 9a0f5af commit 0d676a1

File tree

3 files changed

+36
-37
lines changed

3 files changed

+36
-37
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<parent>
66
<groupId>com.silverpeas</groupId>
77
<artifactId>parent</artifactId>
8-
<version>26</version>
8+
<version>28-SNAPSHOT</version>
99
</parent>
1010

1111
<groupId>com.silverpeas</groupId>
1212
<artifactId>taglibs</artifactId>
1313
<packaging>jar</packaging>
14-
<version>5.13.4</version>
14+
<version>5.15-SNAPSHOT</version>
1515
<name>taglibs J2EE 1.4 Webapp</name>
1616
<url>http://www.silverpeas.com</url>
1717

@@ -39,7 +39,7 @@
3939
</repositories>
4040

4141
<properties>
42-
<silverpeas.version>5.13.4</silverpeas.version>
42+
<silverpeas.version>5.15-SNAPSHOT</silverpeas.version>
4343
</properties>
4444

4545

src/main/java/com/silverpeas/tags/kmelia/KmeliaTagUtil.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.silverpeas.attachment.model.DocumentType;
3636
import org.silverpeas.attachment.model.SimpleDocument;
3737
import org.silverpeas.attachment.model.SimpleDocumentPK;
38+
import org.silverpeas.rating.RatingPK;
3839
import org.silverpeas.search.SearchEngineFactory;
3940
import org.silverpeas.search.searchEngine.model.MatchingIndexEntry;
4041
import org.silverpeas.search.searchEngine.model.ParseException;
@@ -49,14 +50,12 @@
4950
import com.silverpeas.form.importExport.XMLField;
5051
import com.silverpeas.notation.ejb.NotationBm;
5152
import com.silverpeas.notation.model.Notation;
52-
import com.silverpeas.notation.model.NotationPK;
5353
import com.silverpeas.tags.ComponentTagUtil;
5454
import com.silverpeas.tags.util.SiteTagUtil;
5555
import com.silverpeas.tags.util.VisibilityException;
5656
import com.silverpeas.util.FileUtil;
5757
import com.silverpeas.util.ForeignPK;
5858
import com.silverpeas.util.StringUtil;
59-
6059
import com.stratelia.silverpeas.silvertrace.SilverTrace;
6160
import com.stratelia.webactiv.beans.admin.ComponentInst;
6261
import com.stratelia.webactiv.beans.admin.SpaceInst;
@@ -683,12 +682,12 @@ public Collection getMostPopularPublicationsNotations(String topicIdAndNotations
683682
while (iter.hasNext()) {
684683
publication = (PublicationDetail) iter.next();
685684
publicationPK = publication.getPK();
686-
notationsPks.add(new NotationPK(publicationPK.getId(),
687-
publicationPK.getComponentName(), Notation.TYPE_PUBLICATION));
685+
notationsPks.add(new RatingPK(publicationPK.getId(),
686+
publicationPK.getComponentName(), "Publication"));
688687
}
689688

690689
if (!notationsPks.isEmpty()) {
691-
return getNotationBm().getBestNotations(notationsPks, notationsCount);
690+
return getNotationBm().getBestRatings(notationsPks, notationsCount);
692691
}
693692
}
694693
}

src/main/java/com/silverpeas/tags/notation/NotationTagUtil.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222

2323
import java.util.Collection;
2424

25+
import org.silverpeas.rating.Rating;
26+
import org.silverpeas.rating.RatingPK;
27+
2528
import com.silverpeas.notation.ejb.NotationBm;
2629
import com.silverpeas.notation.ejb.NotationRuntimeException;
2730
import com.silverpeas.notation.model.Notation;
28-
import com.silverpeas.notation.model.NotationDetail;
29-
import com.silverpeas.notation.model.NotationPK;
3031
import com.silverpeas.tags.ComponentTagUtil;
31-
3232
import com.stratelia.webactiv.util.EJBUtilitaire;
3333
import com.stratelia.webactiv.util.JNDINames;
3434
import com.stratelia.webactiv.util.exception.SilverpeasRuntimeException;
@@ -47,38 +47,38 @@ public NotationTagUtil(String componentId, String elementId, String userId, Stri
4747
this.authorId = authorId;
4848
}
4949

50-
public NotationDetail getPublicationNotation() {
51-
return getNotationBm().getNotation(getPublicationNotationPK());
50+
public Rating getPublicationNotation() {
51+
return getNotationBm().getRating(getPublicationNotationPK());
5252
}
5353

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);
5858
}
5959

60-
public NotationDetail getForumNotation() {
61-
return getNotationBm().getNotation(getForumNotationPK());
60+
public Rating getForumNotation() {
61+
return getNotationBm().getRating(getForumNotationPK());
6262
}
6363

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);
6868
}
6969

70-
public NotationDetail getMessageNotation() {
71-
return getNotationBm().getNotation(getMessageNotationPK());
70+
public Rating getMessageNotation() {
71+
return getNotationBm().getRating(getMessageNotationPK());
7272
}
7373

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);
7878
}
7979

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(
8282
notationsCount));
8383
}
8484

@@ -94,15 +94,15 @@ private NotationBm getNotationBm() {
9494
return notationBm;
9595
}
9696

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);
9999
}
100100

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);
103103
}
104104

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);
107107
}
108108
}

0 commit comments

Comments
 (0)