@@ -27,6 +27,7 @@ public class ValidateEntry {
2727 public static final String RATING_OUT_OF_RANGE = "rating-out-of-range" ;
2828 public static final String INVALID_RATING_VALUE = "invalid-rating" ;
2929 public static final String TARGET_MUST_BE_IN_SAME_THREAD = "target-outside-thread" ;
30+ public static final String CAN_ONLY_RATE_A_POST = "invalid-rating-request" ;
3031
3132 public static final String CONTENT_TEXT = "text" ;
3233 public static final String CONTENT_XHTML = "xhtml" ;
@@ -44,6 +45,7 @@ public class ValidateEntry {
4445 public static final String POST_TYPE_COMMENT = "comment" ;
4546
4647 public static final String ACTIVITY_VERB_POST = "post" ;
48+ public static final String ACTIVITY_VERB_RATED = "rated" ;
4749
4850 private static Logger LOGGER = Logger .getLogger (ValidateEntry .class );
4951
@@ -181,11 +183,7 @@ public Element getPayload() {
181183 "tag:" + channelServerDomain + "," + node + "," + id );
182184
183185 String title = this .params .get ("title" );
184-
185- Element content = entry .addElement ("content" );
186- content .setText (this .params .get ("content" ));
187- content .addAttribute ("type" , this .params .get ("content-type" ));
188-
186+ String itemContent = this .params .get ("content" );
189187 String publishedDate = Conf .formatDate (new Date ());
190188
191189 entry .addElement ("published" ).setText (publishedDate );
@@ -213,11 +211,6 @@ public Element getPayload() {
213211
214212 this .geoloc = this .entry .element ("geoloc" );
215213
216- entry .addElement ("activity:verb" ).setText (activityVerb );
217-
218- Element activityObject = entry .addElement ("activity:object" );
219- activityObject .addElement ("activity:object-type" ).setText (postType );
220-
221214 if (null != meta ) {
222215 entry .add (meta .createCopy ());
223216 }
@@ -240,10 +233,21 @@ public Element getPayload() {
240233 String rating = String .format ("%d.0" , itemRating );
241234 entry .addElement ("review:rating" ).setText (rating );
242235 title = "Rating" ;
236+ itemContent = "rating:" + rating ;
237+ activityVerb = ACTIVITY_VERB_RATED ;
243238 }
244239
245240 entry .addElement ("title" ).setText (title );
246241
242+ Element content = entry .addElement ("content" );
243+ content .setText (itemContent );
244+ content .addAttribute ("type" , this .params .get ("content-type" ));
245+
246+ entry .addElement ("activity:verb" ).setText (activityVerb );
247+ Element activityObject = entry .addElement ("activity:object" );
248+ activityObject .addElement ("activity:object-type" ).setText (postType );
249+
250+
247251 return entry ;
248252 }
249253
0 commit comments