There was a problem with a Velocity script
Pagerich-template
ErrorInvocation of method 'getSchedule' in class com.prestosports.render.storage.database.DatabasePage threw exception java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections at rich-template[line 360, column 38]
Page source:
1: #set ($showMobile = false)
2: #if ($request.getParameter('showMobile').length() > 0)
3:   #set ($showMobile = true)    
4: #end
5: 
6: ## Front Row legacy code for verions prior to 2.3
7: #if ($showMobile)
8:     ##MOBILE TEMPLATE
9:     $website.include("options")
10:     #set ($options = $request.getAttribute("options"))
11: 
12:     ## DEFAULT VALUES
13:     #set ($showDate = true)
14:     #set ($facebookLike = false)
15:     #set ($showThumb = true)
16:     #set ($showCaption = true)
17:     #set ($thumbWidth = 150)
18: 
19:     #set ($showDate = $options.get("article_show_date"))
20:     #set ($facebookLike = $options.get("article_facebook_like"))
21:     #set ($showThumb = $options.get("article_show_thumb"))
22:     #set ($showCaption = $options.get("article_show_caption"))
23:     #set ($thumbWidth = $options.get("article_mobile_thumb_width"))
24: 
25:     ## ADD THIS
26:     #if ($page.date && $facebookLike == true)
27: 
28:     #end
29: 
30: 	## STYLES
31: 	<style>
32: 		.mobile-article iframe { max-width:100% }
33: 	</style>
34: 
35:     <div class="mobile-article">
36:         ## PAGE TITLE
37:         <h1>$!page.title</h1>
38: 
39:         #if ($showDate == true and $page.date)
40:             <span class="page-date">$formatter.formatLongDate($!page.date)</span>
41:         #end
42: 
43:         <div class="clear"></div>
44: 
45:         #if ($page.thumbnailURL && $showThumb == true)
46:            <div class="thumb">
47:                 <img src="$page.thumbnailURL" alt="$!page.thumbnailPage.altText" />
48:                 #set ($buyPhotoURL = "")
49:                 #set ($buyPhotoURL = $website.storeURL($page.thumbnailPage))
50:                 #if ($page.thumbnailPage.buyURL && $buyPhotoURL.length() > 0)
51:                     <a href="$buyPhotoURL" class="buynow-button" title="Buy Now"></a>
52:                 #end
53:                 #if ($showCaption == true && $page.thumbnailPage.title.length() > 0)
54:                     <h5 class="thumb-title">$!page.thumbnailPage.title</h5>
55:                 #end
56:             </div> ## ends thumb
57:          #end
58: 
59:         ## PAGE BODY
60:         $body.replace('src="//www.youtube.com', 'src="https://www.youtube.com'))
61: 
62:         <div class="clear"></div>
63: 
64:         #if ($facebookLike == true)
65:             ## FACEBOOK LIKE
66:             ##<div class="mobile-facebook-like">
67:                 ##<fb:like href="http://${request.serverName}${page.url}" show_faces="false" width="300" height="30" />
68:             ##</div>
69:         #end
70: 
71:         #if ($wiki.valid())
72:             <div class="wiki">$wiki</div>
73:         #end
74:     </div>
75: $wiki
76: 
77: #else
78: 
79: #######################################
80: ## SUPPORT RESPONSIVE LAYOUT         ##
81: #######################################
82: 
83: #set ($ajax = false)
84: #if ($request.getParameter("ajax") == true)
85:   #set ($ajax = true)
86:   $website.decorate("")
87: #end
88: 
89: #set ($isMobile = false)
90: #if ($browser.getIphone() || $browser.getMobile())
91:   #set ($isMobile = true)
92: #end
93: 
94: #set ($isFrontrow = false)
95: #if ($request.getParameter("frontrow") == true)
96:   #set ($isFrontrow = true)
97: #end
98: 
99: ## DEFAULT VALUES
100: #set ($layoutStyle = "standard")
101: #set ($showDate = true)
102: #set ($facebookLike = true)
103: #set ($tweetButton = true)
104: #set ($showBannerScore = true)
105: #set ($showThumb = true)
106: #set ($showVideo = true)
107: #set ($videoOverlay = true)
108: #set ($showBoxscore = true)
109: #set ($showGallery = true)
110: #set ($showCaption = true)
111: #set ($showOnlyBody = false)
112: #set ($showRelatedLinks = true)
113: #set ($headlineStyle = "h1")
114: #set ($thumbWidth = 450)
115: #set ($infiniteScroll = false)
116: #set ($shareButtons = true)
117: 
118: ## PICK UP OPTIONS
119: $website.include("options")
120: #set ($options = $request.getAttribute("options"))
121: 
122: ## SET VARIABLES FROM OPTIONS
123: #if ($options.get("article_layout_style") == "modern") #set ($layoutStyle = "modern") #end
124: #if ($options.get("article_layout_style") == "classic") #set ($layoutStyle = "classic") #end
125: #if ($options.get("article_show_date") == false) #set ($showDate = false) #end
126: #if ($options.get("article_facebook_like") == false) #set ($facebookLike = false) #end
127: #if ($options.get("article_tweet_button") == false) #set ($tweetButton = false) #end
128: #if ($options.get("article_banner_score") == false) #set ($showBannerScore = false) #end
129: #if ($options.get("article_show_thumb") == false) 
130:   #set ($showThumb = false)
131:   #set ($showVideo = false)
132: #end
133: #if ($options.get("article_show_video") == false) #set ($showVideo = false) #end
134: #if ($options.get("article_video_overlay") == false || $isMobile) #set ($videoOverlay = false) #end
135: #if ($options.get("article_show_boxscore") == false) #set ($showBoxscore = false) #end
136: #if ($options.get("article_show_gallery") == false) #set ($showGallery = false) #end
137: #if ($options.get("article_show_caption") == false) #set ($showCaption = false) #end
138: #if ($options.get("article_show_body") == true) #set ($showOnlyBody = true) #end
139: #if ($tool.math.toInteger($options.get("article_thumb_width"))) #set ($thumbWidth = $tool.math.toInteger($options.get("article_thumb_width"))) #end
140: #set ($headlineStyle = $options.get("article_headline_style"))
141: 
142: ## GRAB RELATED ARTICLES
143: #set ($relatedArticles = [])
144: #set ($relatedHeadline = "")
145: #foreach ($headline in $page.headlinesFeatured)
146:     #if ($headline.name == "news" && $relatedHeadline.length() == 0)
147:         #set ($relatedHeadline = $headline.url)
148:         #foreach ($article in $headline.allHeadlines)
149:             #if ($article.contentType == "loki/tinymce" && ($article.date && $article.title.length() > 0))
150:                 #set ($bool = $relatedArticles.add($article))
151:             #end
152:         #end
153:     #end
154: #end
155: 
156: ## ONLY TURN ON INFINITY SCROLL WHEN THE PAGE IS A STANDALONE PAGE, AND RELATED ARTICLES FOUND IN ABOVE BLOCK
157: #if ($options.get("article_infinite_scroll") == true && !$website.isIncluded() && $relatedArticles.size() > 0) 
158:     #set ($infiniteScroll = true)
159:     #set ($layoutStyle = "modern")
160: #end
161: 
162: ## IF MOBILE TURN OFF INFINITY SCROLL
163: #if ($isMobile)
164:   #set ($infiniteScroll = false)
165:   #set ($layoutStyle = "classic")
166: #end
167: 
168: ## IF FRONTROW TURN OFF DECORATOR, SHARE BUTTONS AND INFINITY SCROLL
169: #if ($isFrontrow)
170: 	$website.decorate("")
171: 	#set ($infiniteScroll = false)
172: 	#set ($shareButtons = false)
173: #end
174: 
175: ## OVERRIDE OPTIONS FOR PRINTER FRIENDLY VIEW
176: #if ($request.getParameter("dec") == "printer-decorator")
177:   #set ($infiniteScroll = false)
178:   #set ($layoutStyle = "standard")
179:   #set ($thumbWidth = 450)
180:   #set ($showRelatedLinks = false)
181:   #set ($facebookLike = false)
182:   #set ($tweetButton = false)
183: #end
184: 
185: ## WHEN THE FOLLOWING ATTRIBUTE IS SET, TURN OFF THE RELATED LINKS
186: #if ($request.getAttribute("disable_related_links") == "y")
187:   #set ($showRelatedLinks = false)
188: #end
189: 
190: #if ($showOnlyBody == true)
191: 
192: $body
193: 
194: #else
195: 
196: #set ($relatedPages = $page.relatedInSchedule)
197: #set ($hasSidebar = false)
198: #set ($boxscores = [])
199: #set ($relatedVideo = "")
200: #set ($relatedVideoType = "")
201: #set ($relatedGallery = "")
202: 
203: #if ($relatedPages.size() > 0)
204: #foreach ($related in $relatedPages)
205:   #if ($showBoxscore)
206:     #if ($related.contentType.startsWith("statcrew") && $related.mapType == "BS" && $website.exists($related.url))
207:       #set ($r = $boxscores.add($related.url))
208:       #set ($hasSidebar = true)
209:     #end
210:   #end
211: 
212:   #if ($showVideo)
213:     #if (($related.contentType == "video/x-flv" || $related.contentType == "loki/video" || $related.contentType == "loki/youtube") && $related.id != $page.id && $website.exists($related.url) && $relatedVideo.length() == 0)
214:       #if ($related.contentType == "video/x-flv")
215:         #set ($relatedVideo = "${related.url}?dec=")
216:         #set ($relatedVideoType = "video/x-flv")
217:       #elseif ($related.contentType == "loki/video")
218:         #set ($relatedVideo = "${related.url}?dec=")
219:         #set ($relatedVideoType = "video/mp4")
220:       #else
221:         #set ($relatedVideo = "${related.dataAsString}")
222:         #set ($relatedVideoType = "video/youtube")
223:       #end
224:       
225:       ## VIDEOJS PLAYER CSS
226:       $website.addCss($website.cdn("/info/videojs/css/video-js.min.css"))
227:     #end
228:   #end
229:  
230:   #if ($showGallery)
231:     #if ($related.mapType == "GA" && !$website.isExternalLink($related.url) && $website.exists($related.url))
232:       #set ($relatedGallery = $related)
233:     #end
234:   #end
235: #end
236: #end
237: 
238: ## MACROS
239: #macro (printSidebar)
240: #if ($hasSidebar)
241: <div class="sidebar">
242: #foreach ($boxscore in $boxscores)
243:   #set ($includeURL = "${boxscore}?tmpl=brief-stats-template")
244:   #if ($showBannerScore)
245:     #set ($includeURL = "${includeURL}&showLinescore=false")
246:   #end
247:   #if ($foreach.count > 1)
248:     <br />
249:   #end
250:   <div class="widget">
251:     $website.includeAgain("${includeURL}")
252:     <a href="${boxscore}" class="more">full stats</a>
253:   </div>
254: #end
255: </div>
256: #end
257: #end ## printSidebar
258: 
259: ## PAGE TITLE
260: #macro (printTitle)
261: #if ($page.title.length() > 0)
262:   #if ($headlineStyle == "none")
263:     <div class="article-title">$!page.title</div>
264:   #else
265:     <${headlineStyle} class="article-title">$!page.title</${headlineStyle}>
266:   #end
267: #end
268: #end ## printTitle
269: 
270: ## PAGE DATE
271: #macro (printDate)
272: #if ($page.date && $showDate)
273: <div class="article-date">
274:     <div class="date">$formatter.formatDate($page.date, "MMM dd, yyyy")</div>
275:   
276:   #if ($shareButtons && ($facebookLike || $tweetButton))
277: 	<div class="like-buttons" data-module="share-buttons">
278:     #if ($facebookLike)
279:       <div class="fb-like-btn"><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a></div>
280:     #end
281:     #if ($tweetButton)
282:       <div class="tweet-btn"><a class="addthis_button_tweet"></a></div>
283:     #end
284:     </div>
285:   #end
286: </div>
287: #end
288: #end ## printDate
289: 
290: ## ARTICLE THUMBNAIL
291: #macro (printThumbnail)
292: #if (!$videoOverlay && $relatedVideo.length() > 0)
293:   <div class="article-image" style="width:${thumbWidth}px">
294:     <div data-module="init-video" data-file="$relatedVideo" data-type="$relatedVideoType" data-image="$!page.thumbnailURL"></div>
295:   </div>
296: #else
297:   #if ($showThumb && $page.thumbnailURL)
298:     #set ($buyPhotoURL = "")
299:     #set ($buyPhotoURL = $website.storeURL($page.thumbnailPage))
300: 
301:     #set ($thumbSrc = $page.thumbnailURL)
302:     #if ($layoutStyle == "standard" || ($layoutStyle == "classic" && !$hasSidebar))
303:       #set ($thumbSrc = "${thumbSrc}?max_width=${thumbWidth}")
304:     #end
305: 
306:     <div class="article-image">
307:       <div class="image">
308: 
309:         #if ($page.thumbnailPage.altText.length() > 0)
310:             <img src="$thumbSrc" alt="$page.thumbnailPage.altText" />
311:         #else
312:             <img src="$thumbSrc" alt="$!page.title" />
313:         #end
314:   
315:         #if ($page.thumbnailPage.buyURL && $buyPhotoURL.length() > 0)
316:           <a href="$buyPhotoURL" class="buynow-btn">Buy Now</a>
317:         #end
318:   
319:         #if ($showCaption == true && $page.thumbnailPage.title.length() > 0)
320:           <div class="thumb-caption">$page.thumbnailPage.title</div>
321:         #end
322:   
323:         #if ($relatedVideo.length() > 0)
324:           <a href="${relatedVideo}" class="play-btn" data-module="init-video" data-module-binding="always" data-trigger="true" data-overlay="true" data-file="$relatedVideo" data-type="$relatedVideoType">Play Video</a>
325:         #end
326:       </div>
327:     </div>
328:   #end
329: #end
330: #end ## printThumbnail
331: 
332: ## ARIA LABEL FOR RELATED LINK
333: #macro (printLinkAriaLabel $event $label)
334:     #if (!$event)
335:     	#set ($ariaLabel = $label)
336:     #else
337: 		#set ($ariaLabel = "${event.sport} event: ${formatter.formatDate($event.date, 'MMMM d hh:mm a:')}")
338: 		#if ($event.neutralSite.length() > 0 || $event.home)
339: 			#set ($vsOrAt = "vs.")
340: 		#else
341: 			#set ($vsOrAt = "at")
342: 		#end
343: 		#if ($event.teams.size() > 1)
344: 			#set ($ariaLabel = "${ariaLabel} ${event.teams.get(0).name} ${vsOrAt} ${event.teams.get(1).name}:")
345: 		#elseif ($event.teams.size() == 1)
346: 			#set ($ariaLabel = "${ariaLabel} ${event.teams.get(0).name}:")
347: 		#end
348: 		#if ($event.neutralSite.length() > 0)
349: 			#set ($ariaLabel = "${ariaLabel} @ ${event.neutralSite}:")
350: 		#end
351: 		#set ($ariaLabel = "${ariaLabel} ${label}")
352: 	#end
353: 	aria-label="$ariaLabel"
354: #end
355: 
356: ## RELATED LINKS
357: #macro (printRelatedLinks)	
358: 	#if ($showRelatedLinks && $relatedPages.size() > 0)
359:     	#set ($printedLinks = {})
360:     	#set ($relatedEvents = $page.schedule.getEventsWithLink($page.url))
361:     	#if (!$relatedEvents.isEmpty())
362:     		#set ($relatedEvent = $relatedEvents[0])
363:     	#end		
364: 		$request.setAttribute("disable_related_links", "y")
365:     	<div class="related-links" data-module="jscroll" data-momentum="false">
366: 			<div>
367:         	<ul class="clearfix">
368:         	#foreach ($related in $relatedPages)
369: 				#if ($related.id != $page.id)
370:     				<li>
371:             		#set ($linkTypeCounter = 1)
372:             		#set ($linkTypeLabel = $related.mapLabel)
373:             		#if ($printedLinks.containsKey("${related.mapLabel}"))
374:             			#set ($linkTypeCounter = $printedLinks.get("${related.mapLabel}") + 1)
375:             			#set ($linkTypeLabel = "$related.mapLabel${linkTypeCounter}")				
376:             		#end
377:             		#set ($ignore = $printedLinks.put($related.mapLabel, $linkTypeCounter))
378:             		
379:                 	<a #printLinkAriaLabel($relatedEvent, $linkTypeLabel) href="$related.url" #if ($website.isExternalLink($related.url))target="_blank"#end>
380:                 		<span class="gicon-${related.mapType.toLowerCase()}"></span>
381:     					${related.mapLabel}
382:                 	</a>
383:     				</li>
384: 				#end
385:         	#end
386:         	</ul>
387: 			</div>
388:     	</div>
389: 	#end	
390: #end ## printRelatedLinks
391: 
392: #macro (printRelatedArticles)
393:     #set ($relatedArticles = $tool.sorter.sort($relatedArticles, "date:desc"))
394:     <div class="rel-articles">
395:         <div class="container">
396:         #foreach ($article in $relatedArticles)
397:             <div #if ($article.url == $page.url) class="preview active loaded" #else class="preview" #end>
398:                 <div class="thumb">
399:                 #if ($article.thumbnailURL)
400:                     <img data-src="$article.thumbnailURL?max_width=280&max_height=160&crop=true" alt="$!article.title" class="lazyload" />
401:                 #else
402:                     <img data-src="/images/setup/thumbnail_default.jpg?max_width=280&max_height=160&crop=true" alt="$!article.title" class="lazyload" />
403:                 #end
404:                 </div>
405:                 <div class="info">
406:                     <span class="date">$formatter.formatLongDate($article.date)</span>
407:                     <a href="$article.url" class="title">$article.title</a>
408:                 </div>
409:             </div>
410:         #end
411:         </div>
412:     </div>
413: #end ## printRelatedArticles
414: 
415: #macro (printArticleLayout)
416: 	
417: #set ($sidebarClass = "no-sidebar")
418: #if ($hasSidebar)
419:   #set ($sidebarClass = "has-sidebar")
420: #end
421: 
422: <div class="rich-v2 ${layoutStyle} ${sidebarClass} clearfix" data-module="article-rich" data-title="$!page.title" data-url="$page.url">
423:   
424: ## RELATED LINKS
425: #printRelatedLinks
426: 	
427: ## PAGE TITLE
428: #printTitle
429: 
430: ## BANNER SCORE
431: #if ($showBannerScore && $boxscores.size() > 0)
432:   #foreach ($boxscore in $boxscores)
433:     <div class="banner-score">$website.include("${boxscore}?tmpl=brief-stats-template&showLinescore=true&extended=false")</div>
434:   #end
435: #end
436: 	
437: ## BANNER IMAGE
438: #if ($layoutStyle == "modern")
439: 	#printThumbnail
440: #end
441: 
442: <div class="article-body clearfix">
443: 	
444: #if ($layoutStyle == "modern")
445: 	#if (!$isMobile)
446: 		#printSidebar
447: 	#end
448: 	
449: #elseif ($layoutStyle == "classic")
450: 	#if (!$isMobile)
451: 		#printSidebar
452: 	#end
453: 	
454: 	#printThumbnail
455: 
456: #elseif ($layoutStyle == "standard")
457: 	#printThumbnail
458: 	
459: 	#if (!$isMobile)
460: 		#printSidebar
461: 	#end
462: #end
463: 
464: <div class="article-text">
465: 	
466: ## PAGE DATE
467: #printDate
468: 	
469: ## ARTICLE BODY
470: $body
471: 
472: ## ARTICLE FOOTER
473: #if (!$request.getAttribute("disable_article_footer"))
474: 	<div class="article-footer clearfix">$website.include("article-footer")</div>
475: #end
476: 
477: ## SHARE BUTTONS
478: #if ($shareButtons && $infiniteScroll && !$website.isIncluded())
479:   $!request.setAttribute("showBookmark", false)
480:   $website.include("share-buttons")
481: #end
482: 
483: </div>
484: 
485: ## SIDEBAR (for mobile print here)
486: #if ($isMobile)
487:   #printSidebar
488: #end
489:   
490: </div> ## article-body
491: 
492: #if ($isMobile)
493:   #printRelatedLinks
494: #end
495: 
496: ## RELATED PHOTO GALLERY
497: #if ($relatedGallery.url)
498: 	#set ($photos = $relatedGallery.allHeadlines)
499: 	#if ($photos.size() > 0)
500:     <div class="related-gallery">
501:     	<h2 class="related-title">Related Photos</h2>
502: 		<div class="photos">
503:         	<div class="photo-slider" data-module="jscroll" data-snap=".item" data-show-prev-next="true">
504:         		<div>
505:         		#foreach ($photo in $photos)
506:                     #set ($imgAlt = "")
507:                     #if ($photo.title.length() > 0)
508:   	                    #set ($imgAlt = $photo.title)
509:                      #else
510:                          #set ($imgAlt = "Photo for $page.title image $velocityCount")
511:                     #end
512:         			<div class="item">
513:         				<a href="${relatedGallery.url}"><img data-src="${photo.url}?max_height=140" alt="$!{imgAlt}" class="lazyload" /></a>
514:         			</div>
515:         		#end
516:         		</div>
517:         	</div>
518: 		</div>
519:     </div>
520: 	#end
521: #end
522: 
523: $wiki
524: 
525: </div> ## rich-v2
526: #end ## printArticleLayout
527:   
528: ######### END MACROS  ####################
529: 
530: #if ($infiniteScroll && !$ajax)
531:     $!request.setAttribute("pageClass", "release-page")
532:     <div class="infinite-articles" data-module="infinite-articles">
533:         <div class="articles">
534:             #printArticleLayout
535:         </div>
536:         
537:         #printRelatedArticles
538:     </div>
539: #else
540:     #printArticleLayout
541: #end
542: 
543: #end ## ends only-body check
544: #end ## showMobile check
545: 
546: $!request.setAttribute("icl-videojs-script", true)
547: $!request.setAttribute("icl-videojs-flash-script", true)