There was a problem with a Velocity script
Pagebio-network-template
ErrorInvocation of method 'includeAgain' in class com.prestosports.render.ContentEngineInvoker threw exception javax.servlet.ServletException: javax.servlet.ServletException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections" at bio-network-template[line 60, column 12]
Page source:
1: ## PICK UP OPTIONS
2: $website.include("options")
3: #set ($options = $request.getAttribute("options"))
4: #set ($locale = "en_us")
5: #set ($locale = $options.get("locale"))
6: 
7: #set ($showconf = true)
8: #if ($options.get("stats_hide_conference") and $options.get("stats_hide_conference").equalsIgnoreCase("hide"))
9:   #set ($showconf = false)
10: #end
11: 
12: #set ($showCareer = $wiki.valid() && $seasons)
13: #if ("yes" == $options.get("stats_show_career") && $seasons)
14:   #set ($showCareer = "yes")
15: #end
16: 
17: #if ($locale == "en_us")
18:   #set ($defLabel = "Defense")
19: #elseif ($locale == "en_gb")
20:   #set ($defLabel = "Defence")
21: #end
22: 
23: #set ($pos = "")
24: #set ($pos = $attributes.get("position"))
25: #set ($posVec = $pos.split("/"))
26: #set ($pos = $posVec[0])
27: #set ($pos = $pos.toLowerCase())
28: 
29: #set ($statPos = $positions.get($pos))
30: #set ($paramPos = $request.getParameter("pos").toLowerCase())
31: 
32: #*
33: $positions
34: $positions.keySet()
35: $positions.entrySet()
36: $statPos
37: $paramPos
38: *#
39: 
40: #set ($highlights = $highlights.get($statPos))
41: 
42: #set ($url = ${page.url})
43: #set ($playerId = $attributes.get("playerId"))
44: #set ($stats = $splits.overall)
45: 
46: #set ($hasEvents = $events.size() > 0)
47: #set ($hasSynopsis = $synopsis.length() > 1 && $synopsis.indexOf("<center>") == -1)
48: #set ($htmlStatsURL = "${page.url}-stats")
49: #set ($hasHTMLStats = $website.exists($htmlStatsURL))
50: #set ($bioBriefURL = "${page.url}-brief")
51: #set ($hasBioBrief = $website.exists("$bioBriefURL"))
52: 
53: $request.setAttribute("careerTotals", $career)
54: ## We track a map of the careers to see if we are missing any seasons
55: #set ($careerMap = {})
56: $request.setAttribute("careerMap", $careerMap)
57: #foreach ($season in $seasons)
58:   ## We need to include this season stats
59:   #set ($path = "${season.path}?tmpl=bio-career-template&name=${season.seasonName}&pos=${statPos}&print=no")
60:   $website.includeAgain($path)
61: #end
62: 
63: #set ($view = "profile")
64: #if ($request.getParameter("view"))
65:   #set ($view = $request.getParameter("view"))
66: #end
67: 
68: #macro (printResultAriaLabel $event)
69:     #set ($ariaLabel = "${event.sport} event: ${formatter.formatDate($event.date, 'MMMM d hh:mm a:')}")
70:     #if ($event.neutralSite.length() > 0 || $event.home) 
71:     	#set ($ariaLabel = "${ariaLabel} vs.")
72:     #else
73:     	#set ($ariaLabel = "${ariaLabel} at")
74:     #end
75:     #set ($ariaLabel = "${ariaLabel} ${event.opponent.name}:")
76:     #if ($event.neutralSite.length() > 0)
77:     	#set ($ariaLabel = "${ariaLabel} @ ${event.neutralSite}:")
78:     #end
79:     #set ($ariaLabel = "${ariaLabel} Box Score")
80:     aria-label="$ariaLabel"
81: #end
82: 
83: #macro (printHighlights)
84: #if ($highlights)
85:   <div class="highlights highlights-standalone accent-bg">
86:     #foreach ($highlight in $highlights.keySet())
87:       #set ($value = "-")
88:       #set ($value = $formatter.formatNumber($stats.get($highlight), $formats.get($highlight)))
89:       <div class="stat clearfix">
90:         <span class="stat-title">$!highlights.get($highlight)</span>
91:         <span class="stat-value">$value</span>
92:       </div>
93:     #end
94:   </div>
95: #end ## has highlights
96: #end ## macro printHighlights
97: 
98: #macro (split $statPosBriefs $label $stats)
99:   <tr>
100:     <td class="pinned-col text">${label}</td>
101:     #foreach ($brief in $statPosBriefs.keySet())
102:       #set ($value = "-")
103:       #set ($value = $!formatter.formatNumber($stats.get($brief), $formats.get($brief)))
104:       <td>#if ($value.length() > 0) $value #else - #end</td>
105:     #end
106:   </tr>
107: #end ## marco split
108: 
109: #macro (printCategories $briefCategoryLabels $v $ariaLabel)
110:   
111: <div class="tab-container secondary clearfix" data-module="stats/tabs" data-type="secondary">
112: <div class="tab-nav" data-module="jscroll" data-momentum="false">
113: <div>
114: <ul class="clearfix">
115: #foreach($briefCat in $briefCategoryLabels.entrySet())
116:   #set ($briefCatLabel = $briefCat.value)
117:   #set ($briefCatKey = $briefCat.key)
118:     
119:   #if ($locale == "en_gb" && $briefCatLabel == "Defense")
120:     #set ($briefCatLabel = "Defence")
121:   #end  
122:   
123:   <li #if ($activePos == $briefCatKey) class="active" #end><a href="${page.url}?view=${v}&pos=${briefCatKey}" role="button" aria-label="${ariaLabel}: ${briefCatLabel}">$briefCatLabel</a></li>
124: #end
125: </ul>
126: </div>
127: </div>
128: <div class="tab-panels">
129: #foreach ($briefCat in $briefCategoryLabels.entrySet())
130:   #set ($class = "tab-panel clearfix")
131:   #if ($briefCat.key == $activePos)
132:     #set ($class = "tab-panel active clearfix")
133:   #end
134:   <div class="$class">
135:     <div class="stats-wrap clearfix">
136:     #if ($v == "splits")
137:       #splitsData($briefCat.key)
138:     #elseif ($v == "career")
139:       #careerData($briefCat.key)
140:     #end
141:     </div>
142:   </div>
143: #end  
144: </div>
145: </div> ## tab-container
146: 
147: #end ## macro printCategories
148: 
149: #macro (splitsData $p)
150: 
151: #set ($p = $positions.get($p))
152: #set ($statPosBriefs = $briefs.get($p))
153: #set ($colspan = $statPosBriefs.size())  
154:   
155: <div class="stats-box full clearfix">
156: <div class="scrollable">
157: <div>
158: <table>
159:   <tr class="accent-bg">
160:     <th class="pinned-col">&nbsp;</th>
161:     #foreach ($brief in $statPosBriefs)
162:       <th>$brief</th>
163:     #end
164:   </tr>
165: 
166: #split($statPosBriefs, "Total", $splits.overall)
167: #if ($showconf)
168:   #split($statPosBriefs, "Conference", $splits.conference)
169: #end
170: #split($statPosBriefs, "Exhibition", $splits.exhibition)
171: 
172: <tr class="empty-row">
173: 	<td class="pinned-col">&nbsp;</td>
174: 	<td colspan="$colspan"><div class="empty-cell">-</div></td>
175: </tr>
176: 
177: #split($statPosBriefs, "Home", $splits.home)
178: #split($statPosBriefs, "Away", $splits.away)
179: #split($statPosBriefs, "Neutral", $splits.neutral)
180: 
181: <tr class="empty-row">
182: 	<td class="pinned-col">&nbsp;</td>
183: 	<td colspan="$colspan"><div class="empty-cell">-</div></td>
184: </tr>
185: 
186: #foreach($gameResult in $gamesResults.entrySet())
187:   #if ($gameResult.key == "wins")
188:     #set ($splitGameResult = $splits.inWins)
189:   #elseif ($gameResult.key == "losses")
190:     #set ($splitGameResult = $splits.inLosses)
191:   #elseif ($gameResult.key == "ties")
192:     #set ($splitGameResult = $splits.inTies)
193:   #end
194:   
195:   #split($statPosBriefs, $gameResult.value, $splitGameResult)
196: #end
197: 
198: <tr class="empty-row">
199: 	<td class="pinned-col">&nbsp;</td>
200: 	<td colspan="$colspan"><div class="empty-cell">-</div></td>
201: </tr>
202: 
203: #if ($monthsPlayed and $monthsPlayed.size() > 0)
204:   #foreach($month in $monthsPlayed)
205:     #if ($month == 'January')
206:       #set ($splitMonth = $splits.january)
207:     #elseif ($month == 'February')
208:       #set ($splitMonth = $splits.february)
209:     #elseif ($month == 'March')
210:       #set($splitMonth = $splits.march)
211:     #elseif ($month == 'April')
212:       #set($splitMonth = $splits.april)
213:     #elseif ($month == 'May')
214:       #set ($splitMonth = $splits.may)
215:     #elseif ($month == 'June')
216:       #set ($splitMonth = $splits.june)
217:     #elseif ($month == 'July')
218:       #set($splitMonth = $splits.july)
219:     #elseif ($month == 'August')
220:       #set ($splitMonth = $splits.august)
221:     #elseif ($month == 'September')
222:       #set($splitMonth = $splits.september)
223:     #elseif ($month == 'October')
224:       #set($splitMonth = $splits.october)
225:     #elseif ($month == 'November')
226:       #set ($splitMonth = $splits.november)
227:     #elseif ($month == 'December')
228:       #set($splitMonth = $splits.december)
229:     #end
230:     
231:     #split($statPosBriefs, $month, $splitMonth)
232:   #end ## foreach
233: #end
234: </table>
235: </div>
236: </div> ## scrollable
237: </div> ## srollable-table
238: 
239: #end ## macro splitsData
240: 
241: #macro (printRecentGames)
242: <table>
243:     <tr class="thead accent-bg"><th colspan="3" class="text">Recent Games</th></tr>
244: 
245:     #set ($eventEnd = -1)
246:     #foreach ($event in $events)
247:     #if ($event.event.result.resolved)
248:     #set ($eventEnd = $velocityCount)
249:     #end
250:     #end
251: 
252:     #set ($eventStart = $eventEnd - 5)
253:     #if ($eventStart < 0) #set ($eventStart = 0) #end
254: 
255:     #foreach ($event in $events)
256:     #if ($velocityCount >= $eventStart and $velocityCount <= $eventEnd)
257:     <tr>
258:         <td class="text">$formatter.formatDate($event.event.date, "MMM d")</td>
259:         <td class="text">
260:             #if ($event.event.neutralSite.length() > 0) vs.
261:             #elseif (!$event.event.home) at
262:             #else ## nothing for a home game
263:             #end
264:             $event.event.opponent.name
265:         </td>
266:         <td class="text">
267:             #if ($event.event.statusCode >= 0)
268:             #if ($event.event.eventId.length() > 0 && $event.stats.size() > 0)
269:                 <a #printResultAriaLabel($event.event) href="../boxscores/${formatter.formatBoxScoreLink($event.event)}">${event.event.APResult}</a>
270:             #else
271:             ${event.event.APResult}
272:             #end
273:             #end
274:         </td>
275:     </tr>
276:     #end ## if
277:     #end
278: </table>
279: #end ## macro printRecentGames
280: 
281: #macro (gamelogData $p)
282: 
283: #set ($p = $positions.get($p))
284: #set ($gamelogs = $gamelogs.get($p))
285: #set ($atLeastOneNotOverall = false)
286: 
287: <div class="stats-box full clearfix">
288:     <div class="scrollable">
289:         <div>
290:             <table>
291:               <tr class="thead accent-bg">
292:                   <th class="text">Date</th>
293:                   <th class="pinned-col text">Opponent</th>
294:                   <th>Score</th>
295: 				  #set ($colspan = 3)
296:                   #if ($p == 'goalie' && ($sport.enumCode == 9 || $sport.enumCode == 3)) ## field hockey: 9   soccer:3
297: 					#set ($colspan = $colspan + 1)
298: 					<th>Dec</th>
299:                   #end
300:                   #foreach ($gamelog in $gamelogs)
301: 					#set ($colspan = $colspan + 1)
302: 					<th>$gamelog</th>
303:                   #end
304:               </tr>
305:               #foreach ($event in $events)
306:               <tr>
307:                   <td class="text">$formatter.formatDate($event.event.date, "MMM d") #if (!$event.event.overall) #set ($atLeastOneNotOverall = true) # #end</</td>
308:                   <td class="pinned-col text">
309:                       #if ($event.event.neutralSite.length() > 0) vs. #elseif (!$event.event.home) at #end
310:                       $event.event.opponent.name
311:                   </td>
312:                   <td>
313:                       #if ($event.event.statusCode >= 0)
314:                       #if ($event.event.eventId.length() > 0 && $event.stats.size() > 0)
315:                           <a #printResultAriaLabel($event.event) href="../boxscores/${formatter.formatBoxScoreLink($event.event)}">${event.event.APResult}</a>
316:                       #else
317:                       ${event.event.APResult}
318:                       #end
319:                       #else &nbsp; #end
320:                   </td>
321:                   #if ($p == 'goalie' && ($sport.enumCode == 9 || $sport.enumCode == 3)) ## field hockey: 9   soccer:3
322:                       #if ($event.stats.get('gow') == 1)
323:                           <td>W</td>
324:                       #elseif ($event.stats.get('gol') == 1)
325:                           <td>L</td>
326:                       #elseif ($event.stats.get('got') == 1)
327:                           <td>T</td>
328:                       #else
329:                           <td>-</td>
330:                       #end
331:                   #end
332:                   #foreach ($gamelog in $gamelogs.keySet())
333:                   #set ($value = "-")
334:                   #set ($value = $formatter.formatNumber($event.stats.get($gamelog), $formats.get($gamelog)))
335:                   <td>$value</td>
336:                   #end
337:               </tr>
338:               #end
339:               #if ($atLeastOneNotOverall)
340:                 <tr><td colspan="$colspan"># Stats don't count towards season totals</td></tr>
341:               #end
342:             </table>
343:         </div>
344:     </div> ## scrollable
345: </div> ## stats-box
346: 
347: #end ## macro gamelogData
348: 
349: #macro (split $statPosBriefs $label $stats)
350:   <tr>
351:     <td class="pinned-col text">${label}</td>
352:     #foreach ($brief in $statPosBriefs.keySet())
353:       #set ($value = "-")
354:       #set ($value = $!formatter.formatNumber($stats.get($brief), $formats.get($brief)))
355:       <td>#if ($value.length() > 0) $value #else - #end</td>
356:     #end
357:   </tr>
358: #end
359: 
360: #macro (careerData $p)
361: #set ($p = $positions.get($p))
362: #set ($statPosBriefs = $briefs.get($p))
363: 
364: <div class="stats-box full clearfix">
365: <div class="scrollable">
366: <div>
367: <table>
368: <tr class="thead accent-bg">
369:   <th class="pinned-col">&nbsp;</th>
370:   #foreach ($brief in $statPosBriefs)
371:     <th>$brief</th>
372:   #end
373: </tr>
374: 
375: #foreach ($season in $seasons)
376:   #if ($careerMap.get($season.seasonName))
377:     #set ($label = "<a href='${season.path}?view=profile'>$season.seasonName</a>")
378:     #split($statPosBriefs, $label, $careerMap[$season.seasonName])
379:   #elseif ($wiki.valid())
380:     <tr>
381:       <td class="pinned-col text">${season.seasonName}</td>
382:       <td colspan="${briefs.size()}">We could not find the "players" page in the ${season.seasonName} section.</td>
383:     </tr>
384:   #end
385: #end
386: 
387: #split($statPosBriefs, "Total", $request.getAttribute("careerTotals").overall)
388: 
389: </table>
390: </div>
391: </div> ## scrollable
392: </div> ## stats-box
393: 
394: #end ## macro careerData
395: 
396: ################################################## END MACROS  #############################################################
397: 
398: <head>
399: <title>
400:     $!attributes.get("first_name") $!attributes.get("last_name") | #if ($attributes.get("number"))#$!attributes.get("number") | #end #if($attributes.get("position_abbr") && !$attributes.get("position_abbr").empty)$!attributes.get("position_abbr") | #elseif ($attributes.get("position"))$!attributes.get("position") | #end  $attributes.get("team")
401: </title>
402: </head>
403: 
404: <div class="bio-wrap bio-wrap-network clearfix" data-module="stats/responsive-container">
405: 
406:     #if ($page.title.length() > 0)
407:     <h1>$page.title</h1>
408:     #end
409: 
410:     <h2 class="player-name">
411:         <span>$!attributes.get("first_name") $!attributes.get("last_name")</span>
412:         #if (!$attributes.get("number").empty)<span>#$!attributes.get("number")</span>#end
413:         #if($attributes.get("position_abbr") && !$attributes.get("position_abbr").empty)
414: 			<span>$!attributes.get("position_abbr")</span>
415: 		#elseif ($attributes.get("position"))
416: 			<span>$!attributes.get("position")</span>
417: 		#end 
418:         <a href="../teams?id=$!{attributes.get("teamId")}">$attributes.get("team")</a>
419:     </h2>
420: 	
421:     #printHighlights
422: 
423:     <div class="body clearfix">
424:         <div class="tab-container primary clearfix" data-module="stats/tabs" data-type="primary">
425:             <div class="tab-nav" data-module="jscroll" data-momentum="false">
426:                 <div>
427:                     <ul class="clearfix">
428:                         <li #if ($view == "profile") class="active" #end><a href="${page.url}?view=profile">Player Profile</a></li>
429:                         <li #if ($view == "gamelog")class="active"#end><a href="${page.url}?view=gamelog">Game Log</a></li>
430:                         #if ($showCareer)
431:                         <li #if ($view == "career")class="active"#end><a href="${page.url}?view=career">Career Stats</a></li>
432:                         #end
433:                         <li #if ($view == "splits")class="active"#end><a href="${page.url}?view=splits">Split Stats</a></li>
434:                     </ul>
435:                 </div>
436:             </div> ## tab-nav
437: 
438:             <div class="tab-panels clearfix">
439: 
440:                 ## PROFILE
441:                 #set ($class = "tab-panel clearfix")
442:                 #if ($view == "profile")
443:                 #set ($class = "tab-panel active clearfix")
444:                 #end
445:                 <div class="${class}">
446: 
447:                     ## Player profile
448:                     <div class="clearfix stats-wrap">
449: 
450:                         ## LAST SIX GAMES
451:                         <div class="stats-box half">
452:                             #printRecentGames()
453:                         </div>
454: 
455:                         ## RANKING
456:                         <div class="stats-box half">
457:                             $website.include("../players?tmpl=stats-bios-rank-template&rank=${playerId}&pos=${statPos}")
458:                         </div>
459: 
460:                     </div> ## clearfix
461: 
462:                     #if ($hasSynopsis)
463:                     <div class="clearfix">$!synopsis</div>
464:                     #end
465: 
466:                     #if ($hasBioBrief)
467:                     <div class="clearfix">$website.include($htmlStatsURL)</div>
468:                     #end
469: 
470:                     #if ($htmlStatsURL)
471:                     <div class="clearfix">$website.include($bioBriefURL)</div>
472:                     #end
473: 
474:                 </div>
475:                 ## PROFILE
476: 
477:                 ## GAMELOG
478:                 #set ($class = "tab-panel clearfix")
479:                 #if ($view == "gamelog")
480:                 #set ($class = "tab-panel active clearfix")
481:                 #end
482: 
483:                 #set ($activePos = $statPos)
484:                 #if ($view == "gamelog" && $paramPos.length() > 0)
485:                   #if ($positions.get($paramPos).length() > 0)
486:                     #set ($activePos = $positions.get($paramPos))
487:                   #end
488:                 #end
489: 
490:                 <div class="${class}">
491: 
492:                     #if ($gamelogsCategoriesLabels)
493:                     <div class="tab-container secondary clearfix" data-module="stats/tabs" data-type="secondary">
494:                         <div class="tab-nav" data-module="jscroll" data-momentum="false">
495:                             <div>
496:                                 <ul class="clearfix">
497:                                     #foreach($gamelogsCatLabel in $gamelogsCategoriesLabels.entrySet())
498:                                       #set($gamelogsCatLabelVal = $gamelogsCatLabel.value)
499: 
500:                                   #if ($locale == "en_gb" && $gamelogsCatLabelVal == "Defense")
501:                       #set($gamelogsCatLabelVal = "Defence")
502:                     #end
503: 
504:                     <li #if ($activePos == $gamelogsCatLabel.key) class="active" #end>
505:                       <a href="${page.url}?view=gamelog&pos=${gamelogsCatLabel.key}" role="button" aria-label="Game Log: ${gamelogsCatLabelVal}">$gamelogsCatLabelVal</a>
506:                     </li>
507:                                     #end
508:                                 </ul>
509:                             </div>
510:                         </div>
511:                         <div class="tab-panels">
512:                 #foreach($gamelogsCatLabel in $gamelogsCategoriesLabels.entrySet())
513:                 #set ($class = "tab-panel clearfix")
514:                 #if ($gamelogsCatLabel.key == $activePos)
515:                   #set ($class = "tab-panel active clearfix")
516:                 #end
517:                 <div class="${class}">
518:                   <div class="stats-wrap clearfix">#gamelogData($gamelogsCatLabel.key)</div>
519:                 </div>
520:               #end
521:                         </div>
522:                     </div>
523:                     #else
524:                       <div class="stats-wrap clearfix">#gamelogData($pos)</div>
525:                     #end
526: 
527:                 </div> ## tab-panel
528:                 ## GAMELOG
529: 
530:         ## CAREER
531:         #if ($showCareer)
532: 
533:         #set ($activePos = $statPos)
534:         #if ($view == "career" && $paramPos.length() > 0)
535:           #if ($positions.get($paramPos).length() > 0)
536:           #set ($activePos = $positions.get($paramPos))
537:           #end
538:         #end
539: 
540:         #set ($class = "tab-panel clearfix")
541:         #if ($view == "career")
542:           #set ($class = "tab-panel active clearfix")
543:         #end
544: 
545:         <div class="${class}">
546: 
547:         #if ($briefsCategoriesLabels)
548:           #printCategories($briefsCategoriesLabels "career" "Career Stats")
549:         #else
550:           <div class="stats-wrap clearfix">#careerData($activePos)</div>
551:         #end    
552: 
553:         </div> ## tab-panel
554:         #end ## CAREER
555:         
556:         ## SPLITS
557:         #set ($class = "tab-panel clearfix")
558:         #if ($view == "splits")
559:           #set ($class = "tab-panel active clearfix")
560:         #end
561: 
562:         #set ($activePos = $statPos)
563:         #if ($view == "splits" && $paramPos.length() > 0)
564:           #if ($positions.get($paramPos).length() > 0)
565:           #set ($activePos = $positions.get($paramPos))
566:           #end
567:         #end
568: 
569:         <div class="${class}">
570: 
571:         #if ($briefsCategoriesLabels)
572:           #printCategories($briefsCategoriesLabels "splits" "Splits Stats")
573:         #else
574:           <div class="stats-wrap clearfix">#splitsData($pos)</div>
575:         #end    
576: 
577:         </div> ## tab-panel
578:         ## SPLITS
579:         
580:             </div> ##tab-panels
581: 
582:         </div> ## tab-container
583:     </div> ## body
584: 
585: 
586: </div> ## bio-wrapper
587: $wiki.su