@@ -93,6 +93,14 @@ public int countNewsLinksByGroupId(String sakaiUserId,
93
93
*/
94
94
@ Override
95
95
public List <NewsLink > getCurrentNewsLinks (String sakaiId , String siteId ) {
96
+ return getCurrentNewsLinks (sakaiId , siteId , false );
97
+ }
98
+ /*
99
+ * This method is used for getting CurrentNewsLinks, if 'includeInfoLinkUrl`= true directUrl of a particular source type will be included
100
+ * part of the list. For EntityBroker feed call we are including this infolinkUrl as part of the list. For the Dashboard UI call we are not as this has
101
+ * some performance issues.
102
+ */
103
+ public List <NewsLink > getCurrentNewsLinks (String sakaiId , String siteId , boolean includeInfoLinkUrl ) {
96
104
List <NewsLink > links = dao .getCurrentNewsLinks (sakaiId , siteId );
97
105
98
106
if (links != null ) {
@@ -110,10 +118,12 @@ public List<NewsLink> getCurrentNewsLinks(String sakaiId, String siteId) {
110
118
} else {
111
119
item .setTitle (typeObj .getGroupTitle (itemCount , item .getContext ().getContextTitle (), item .getNewsTimeLabelKey ()));
112
120
}
121
+ }else {
122
+ logger .debug ("The source type is null" );
113
123
}
114
124
}else {
115
- //When getItemCount() > 1 the infoLinkUrl is null and hence we don't need to run this call.
116
- if (item !=null ){
125
+ //When getItemCount() > 1 the infoLinkUrl is null and hence we don't get the InfoLinkUrl and we are running this call only for entity broker feed .
126
+ if (item !=null && includeInfoLinkUrl ){
117
127
setItemInfoLinkUrl (item );
118
128
}
119
129
}
@@ -189,10 +199,22 @@ private void setItemInfoLinkUrl(CalendarItem item) {
189
199
*/
190
200
@ Override
191
201
public List <CalendarLink > getFutureCalendarLinks (String sakaiUserId , String contextId , boolean hidden ) {
202
+ return getFutureCalendarLinks (sakaiUserId , contextId , hidden ,false );
203
+ }
204
+
205
+ /*
206
+ * This method is used for getting FutureCalendarLinks, if 'includeInfoLinkUrl`= true directUrl of a particular source type will be included
207
+ * part of the list. For EntityBroker feed call we are including this infolinkUrl as part of the list. For the Dashboard UI call we are not as this has
208
+ * some performance issues.
209
+ */
210
+ public List <CalendarLink > getFutureCalendarLinks (String sakaiUserId , String contextId , boolean hidden , boolean includeInfoLinkUrl ) {
192
211
List <CalendarLink > futureCalendarLinks = dao .getFutureCalendarLinks (sakaiUserId , contextId , hidden );
212
+ if (!includeInfoLinkUrl ){
213
+ return futureCalendarLinks ;
214
+ }
193
215
for (CalendarLink calendarLink : futureCalendarLinks ) {
194
- CalendarItem calendarItem = calendarLink .getCalendarItem ();
195
- setItemInfoLinkUrl (calendarItem );
216
+ CalendarItem calendarItem = calendarLink .getCalendarItem ();
217
+ setItemInfoLinkUrl (calendarItem );
196
218
}
197
219
return futureCalendarLinks ;
198
220
}
@@ -202,7 +224,18 @@ public List<CalendarLink> getFutureCalendarLinks(String sakaiUserId, String cont
202
224
*/
203
225
@ Override
204
226
public List <NewsLink > getHiddenNewsLinks (String sakaiId , String siteId ) {
227
+ return getHiddenNewsLinks (sakaiId ,siteId ,false );
228
+ }
229
+ /*
230
+ * This method is used for getting HiddenNewsLinks, if 'includeInfoLinkUrl`= true directUrl of a particular source type will be included
231
+ * part of the list. For EntityBroker feed call we are including this infolinkUrl as part of the list. For the Dashboard UI call we are not as this has
232
+ * some performance issues.
233
+ */
234
+ public List <NewsLink > getHiddenNewsLinks (String sakaiId , String siteId , boolean includeInfoLinkUrl ) {
205
235
List <NewsLink > hiddenNewsLinks = dao .getHiddenNewsLinks (sakaiId , siteId );
236
+ if (!includeInfoLinkUrl ){
237
+ return hiddenNewsLinks ;
238
+ }
206
239
for (NewsLink newsLink : hiddenNewsLinks ) {
207
240
NewsItem item = newsLink .getNewsItem ();
208
241
setItemInfoLinkUrl (item );
@@ -224,7 +257,18 @@ public List<NewsLink> getNewsLinksByGroupId(String sakaiUserId,
224
257
*/
225
258
@ Override
226
259
public List <CalendarLink > getPastCalendarLinks (String sakaiUserId , String contextId , boolean hidden ) {
260
+ return getPastCalendarLinks (sakaiUserId , contextId , hidden ,false );
261
+ }
262
+ /*
263
+ * This method is used for getting PastCalendarLinks, if 'includeInfoLinkUrl`= true directUrl of a particular source type will be included
264
+ * part of the list. For EntityBroker feed call we are including this infolinkUrl as part of the list. For the Dashboard UI call we are not as this has
265
+ * some performance issues.
266
+ */
267
+ public List <CalendarLink > getPastCalendarLinks (String sakaiUserId , String contextId , boolean hidden , boolean includeInfoLinkUrl ) {
227
268
List <CalendarLink > pastCalendarLinks = dao .getPastCalendarLinks (sakaiUserId , contextId , hidden );
269
+ if (!includeInfoLinkUrl ){
270
+ return pastCalendarLinks ;
271
+ }
228
272
for (CalendarLink calendarLink : pastCalendarLinks ) {
229
273
CalendarItem calendarItem = calendarLink .getCalendarItem ();
230
274
setItemInfoLinkUrl (calendarItem );
@@ -237,7 +281,19 @@ public List<CalendarLink> getPastCalendarLinks(String sakaiUserId, String contex
237
281
*/
238
282
@ Override
239
283
public List <CalendarLink > getStarredCalendarLinks (String sakaiUserId , String contextId ) {
284
+ return getStarredCalendarLinks (sakaiUserId , contextId ,false );
285
+ }
286
+
287
+ /*
288
+ * This method is used for getting StarredCalendarLinks, if 'includeInfoLinkUrl`= true directUrl of a particular source type will be included
289
+ * part of the list. For EntityBroker feed call we are including this infolinkUrl as part of the list. For the Dashboard UI call we are not as this has
290
+ * some performance issues.
291
+ */
292
+ public List <CalendarLink > getStarredCalendarLinks (String sakaiUserId , String contextId , boolean includeInfoLinkUrl ) {
240
293
List <CalendarLink > starredCalendarLinks = dao .getStarredCalendarLinks (sakaiUserId , contextId );
294
+ if (!includeInfoLinkUrl ){
295
+ return starredCalendarLinks ;
296
+ }
241
297
for (CalendarLink calendarLink : starredCalendarLinks ) {
242
298
CalendarItem calendarItem = calendarLink .getCalendarItem ();
243
299
setItemInfoLinkUrl (calendarItem );
@@ -250,7 +306,20 @@ public List<CalendarLink> getStarredCalendarLinks(String sakaiUserId, String con
250
306
*/
251
307
@ Override
252
308
public List <NewsLink > getStarredNewsLinks (String sakaiId , String siteId ) {
309
+ return getStarredNewsLinks (sakaiId , siteId , false );
310
+ }
311
+
312
+ /*
313
+ * This method is used for getting StarredNewsLinks, if 'includeInfoLinkUrl`= true directUrl of a particular source type will be included
314
+ * part of the list. For EntityBroker feed call we are including this infolinkUrl as part of the list. For the Dashboard UI call we are not as this has
315
+ * some performance issues.
316
+ */
317
+
318
+ public List <NewsLink > getStarredNewsLinks (String sakaiId , String siteId , boolean includeInfoLinkUrl ) {
253
319
List <NewsLink > starredNewsLinks = dao .getStarredNewsLinks (sakaiId , siteId );
320
+ if (!includeInfoLinkUrl ){
321
+ return starredNewsLinks ;
322
+ }
254
323
for (NewsLink newsLink : starredNewsLinks ) {
255
324
NewsItem item = newsLink .getNewsItem ();
256
325
setItemInfoLinkUrl (item );
0 commit comments