An error occurred while processing the template.
Method public static com.liferay.portal.model.User com.liferay.portal.service.UserLocalServiceUtil.getUserByEmailAddress(long,java.lang.String) throws com.liferay.portal.kernel.exception.PortalException,com.liferay.portal.kernel.exception.SystemException threw an exception
1<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext()> 
2<#assign journalArticleResourceLocalServiceUtil = staticUtil["com.liferay.portlet.journal.service.JournalArticleResourceLocalServiceUtil"]> 
3<#assign catPropertyLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService") /> 
4<#assign userLocalServiceUtil = staticUtil["com.liferay.portal.service.UserLocalServiceUtil"]> 
5<#assign assetCategoryLocalServiceUtil = staticUtil["com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil"]> 
6<#assign bookmarkLocalServiceUtil = serviceLocator.findService("sstc-solution-portlet","org.ifad.sstc.service.BookmarkLocalService")> 
7 
8<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
9<#assign httpServletRequest = serviceContext.getRequest()> 
10 
11<#assign show_contact_solution = (httpServletRequest.getParameter("show_contact_solution")?xhtml)!''> 
12 
13<#assign journalArticleId = .vars['reserved-article-id'].data> 
14 
15<#assign regionVocId = getterUtil.getLong(propsUtil.get("org.ifad.sstc.solutions.region_vocabularyId")) /> 
16<#assign topicVocId = getterUtil.getLong(propsUtil.get("org.ifad.sstc.solutions.topic_vocabularyId")) /> 
17<#assign typeVocId = getterUtil.getLong(propsUtil.get("org.ifad.sstc.solutions.type_vocabularyId")) /> 
18<#assign articleResourcePK = journalArticleResourceLocalServiceUtil.getArticleResourcePrimKey(groupId, journalArticleId)/> 
19<#assign categories = assetCategoryLocalServiceUtil.getCategories("com.liferay.portlet.journal.model.JournalArticle",articleResourcePK) > 
20<#assign topics = [] /> 
21<#assign types = [] /> 
22 
23 
24<#assign reg_title = languageUtil.get(locale, "no-region-title") /> 
25<#assign reg_map = "no-region-map.jpg" /> 
26<#assign reg_css = "no-reg" /> 
27 
28<#list categories as category >  
29	<#if category.getVocabularyId() == regionVocId && category.getParentCategoryId() == 0> 
30		<#assign reg_map = catPropertyLocalService.getCategoryProperty(category.categoryId, "map").getValue() /> 
31		<#assign reg_css = catPropertyLocalService.getCategoryProperty(category.categoryId, "cssClass").getValue() /> 
32		<#assign reg_title = category.getName() /> 
33	</#if> 
34	<#if category.getVocabularyId() == topicVocId > 
35		<#assign topics = topics + [category.getName()] /> 
36	</#if> 
37	<#if category.getVocabularyId() == typeVocId > 
38		<#assign types = types + [category.getName()] /> 
39	</#if>	 
40</#list> 
41<#if Solution_Provider_Email?has_content> 
42	<#assign userTo = userLocalServiceUtil.getUserByEmailAddress(themeDisplay.getCompanyId(),Solution_Provider_Email.getData()) /> 
43	<#assign messageRenderURL = portletURLFactory.create(httpServletRequest,"sstcmessage_WAR_sstcsolutionportlet", themeDisplay.getPlid() ,"RENDER_PHASE") /> 
44	${messageRenderURL.setParameter("redirect", "${themeDisplay.getPortalURL()}${themeDisplay.getURLCurrent()}")} 
45	${messageRenderURL.setParameter("to", "${userTo.getFullName()} <${userTo.getScreenName()}>")} 
46	${messageRenderURL.setWindowState("POP_UP")}	 
47</#if> 
48 
49<#assign loginRenderURL = portletURLFactory.create(httpServletRequest,"58", themeDisplay.getPlid() ,"RENDER_PHASE") /> 
50${loginRenderURL.setParameter("redirect", "${themeDisplay.getPortalURL()}${themeDisplay.getURLCurrent()}?show_contact_solution=true")} 
51${loginRenderURL.setParameter("fromSolution","${.vars['reserved-article-id'].data}")} 
52${loginRenderURL.setWindowState("POP_UP")} 
53 
54<#assign loginRender_2URL = themeDisplay.getURLSignIn()/> 
55 
56<#assign loginBookmarkRenderURL = portletURLFactory.create(httpServletRequest,"58", themeDisplay.getPlid() ,"RENDER_PHASE") /> 
57${loginBookmarkRenderURL.setParameter("redirect", "${themeDisplay.getPortalURL()}${themeDisplay.getURLCurrent()}")} 
58${loginBookmarkRenderURL.setParameter("fromSolution","${.vars['reserved-article-id'].data}")} 
59${loginBookmarkRenderURL.setWindowState("POP_UP")} 
60 
61<#assign bookmarkSwithURL = portletURLFactory.create(httpServletRequest,"sstcbookmarkadmin_WAR_sstcsolutionportlet", themeDisplay.getPlid() ,"RESOURCE_PHASE") /> 
62${bookmarkSwithURL.setParameter("action", "switchBookmark")} 
63${bookmarkSwithURL.setParameter("redirect", "${themeDisplay.getPortalURL()}${themeDisplay.getURLCurrent()}")} 
64${bookmarkSwithURL.setParameter("solutionId", "${.vars['reserved-article-id'].data}")} 
65 
66<#assign bookmarked = false> 
67<#if themeDisplay.isSignedIn()> 
68		<#attempt> 
69		<#assign aux = bookmarkLocalServiceUtil.findByEntryAndUser(.vars['reserved-article-id'].data?number, themeDisplay.getUserId())!> 
70		<#assign bookmarked = true> 
71	<#recover> 
72		<#assign bookmarked = false> 
73	</#attempt> 
74</#if> 
75 
76<div class="solution-detail"> 
77	<!-- banner starts here--> 
78      <div class="banner"> 
79         <ul> 
80             <li> 
81                 <figure> 
82                     <img src="${Main_Image.getData()}" width="1440" height="480" alt="banner"> 
83                 </figure> 
84                 <div class="banner_cnt"> 
85                     <div class="tbl"> 
86                         <div class="tbl_cell"> 
87                             <h1>${Heading.getData()}</h1> 
88                             <p>${Intro.getData()}</p> 
89                         </div> 
90                     </div> 
91                 </div> 
92             </li> 
93         </ul> 
94      </div> 
95      <!-- banner ends here--> 
96 
97      <!-- topics starts here--> 
98      <div class="tags"> 
99      	<div class="container"> 
100        	<div class="row-fluid"> 
101            	<div class="span8 reg"> 
102                	<div class="sltn_tags"> 
103                    	<div class="row-fluid"> 
104                        	<div class="span4 type1"> 
105                                <div class="topics_lt ${reg_css}"> 
106                                </div> 
107                                <div class="topics_rt ${reg_css}"> 
108                                	<h4>TOPICS</h4> 
109                                    <p> 
110                                    	${stringUtil.merge(topics,", ")} 
111                                    </p> 
112                                </div> 
113                                <div class="clearfix"></div>       
114                            </div> 
115                            <div class="span4 type1"> 
116                                <div class="type_lt ${reg_css}"> 
117                                </div> 
118                                <div class="type_rt ${reg_css}"> 
119                                	<h4>SOLUTION TYPE</h4> 
120                                	<p>${stringUtil.merge(types,", ")}</p> 
121                                </div> 
122                                <div class="clearfix"></div> 
123                            </div> 
124                            <div class="span4 type1"> 
125                                <div class="region_lt ${reg_css}"> 
126                                </div> 
127                                <div class="region_rt ${reg_css}"> 
128                                	<h4>REGION</h4> 
129                                    <p>${reg_title}</p> 
130                                </div> 
131                                <div class="clearfix"></div> 
132                            </div> 
133                            <div class="clearfix"></div> 
134                        </div> 
135                    </div> 
136                </div> 
137                <div class="span4 reg1"> 
138                </div> 
139                <div class="clearfix"></div> 
140            </div> 
141        </div> 
142      </div> 
143      <!-- topics ends here--> 
144      <div class="main_section"> 
145      	<div class="container"> 
146        	<div class="row-fluid"> 
147            	<div class="main_section_cnt"> 
148                	<div class="span8"> 
149                    <div class="main_section_lt ${reg_css}"> 
150                    	<#if Quote.getData()!=""> 
151                    	<div class="quote"> 
152                        	<p>${Quote.data}</p> 
153							<span>${Quote.Author.data}</span> 
154                        </div> 
155                        </#if> 
156                        <#if Background.getData()!=""> 
157                        <div class="text_block"> 
158                        	<h2>BACKGROUND</h2> 
159                            <p>${Background.data}</p> 
160                        </div> 
161                        </#if> 
162                        <#if What_s_involved.getData()!=""> 
163                        <div class="text_block"> 
164                        	<h2>WHAT’S INVOLVED</h2> 
165                            <p>${What_s_involved.getData()}</p> 
166                        </div> 
167                        </#if> 
168                        <#if Find_out_more.getData()!=""> 
169                        <div class="text_block"> 
170                        	<h2>EXPLORE THIS SOLUTION</h2> 
171                            <p>${Find_out_more.getData()}</p> 
172                        </div> 
173                        </#if> 
174                    </div> 
175                </div> 
176                	<div class="span4 cnt_lnth_1"> 
177                	<div class="main_section_rt"> 
178                    	<div class="map"> 
179                            	<figure> 
180                                	<img src="${themeDisplay.getPathThemeImages()}/custom/regions/${reg_map}" width="190" height="260" alt="img_4"> 
181                                </figure> 
182                        </div> 
183                        <#if Countries_Involved?has_content && Countries_Involved.getData()!=""> 
184                        <div class="stats"> 
185                        	<h5>Countries involved</h5> 
186                            <p>${Countries_Involved.getData()!""}</p> 
187                        </div> 
188                        </#if> 
189                        <#if Project_Partners?has_content && Project_Partners.getData()!=""> 
190                        <div class="stats partners"> 
191                        	<h5>Project partners</h5> 
192                            <p>${Project_Partners.getData()!""}</p> 
193                        </div> 
194                        </#if> 
195                        <#if Project_Dates?has_content && Project_Dates.getData()!=""> 
196                        <div class="stats"> 
197                        	<h5>Project dates</h5> 
198                            <p>${Project_Dates.getData()}</p> 
199                        </div> 
200                        </#if> 
201                        <div class="stats share"> 
202                        	<h5>Solution Provider</h5> 
203                        	   <#if !SolutionProvider?has_content || (SolutionProvider?has_content && !SolutionProvider.data?has_content) > 
204	                        	<figure> 
205	                        		<a href="https://www.ifad.org" target="_blank"> 
206	                        			<img class="provider-logo" src="${themeDisplay.getPathThemeImages()}/custom/ifadshort.jpg" title="IFAD/FIDA"  /> 
207	                        		</a> 
208	                        	</figure> 
209							<#else> 
210		                        <figure> 
211		                        	<a href="${SolutionProvider.Link.getData()}" target="_blank"> 
212		                        		<img class="provider-logo" src="${SolutionProvider.Logo.getData()}" title="${SolutionProvider.getData()}"  /> 
213		                        	</a> 
214		                        </figure>								 
215							</#if> 
216                        </div> 
217                        <div class="stats share"> 
218                        	<h5>Share this solution</h5> 
219                        	<!-- 
220                            <ul> 
221                            	<li> 
222                                	<a id="facebook" href="http://www.facebook.com/share.php?u=${themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()}"> 
223                                    	<i class="fa fa-facebook" aria-hidden="true"></i> 
224                                    </a> 
225                                </li> 
226								<li> 
227                                    <a href="http://twitter.com/share?url=${themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()}" > 
228                                    	<i class="fa fa-twitter" aria-hidden="true"></i> 
229                                	</a>                                	    
230                                </li> 
231                                <li> 
232                                	<a id="googleplus" target="blank_" href="https://plus.google.com/share?url=${themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()}"> 
233                                    	<i class="fa fa-google-plus" aria-hidden="true"></i> 
234                                    </a>    
235                                </li> 
236 
237                            </ul> 
238                            --> 
239                            <div id="shareIcons"></div> 
240                            <div class="clearfix"></div> 
241                        </div> 
242                        <div class="stats bookmark"> 
243                        	<h5>Bookmark this solution</h5> 
244                        	<#if themeDisplay.isSignedIn() > 
245	                            <a class="btn" id="bookmarkButton"></a> 
246	                        <#else> 
247	                        	<a href="${loginBookmarkRenderURL}" data-redirect="false" class="btn" rel="nofollow" id="sign-in-bookmark" ><i class="fa fa-bookmark-o" aria-hidden="true"></i>Bookmark</a>	                        	 
248							</#if>                             
249                            <div class="clearfix"></div> 
250                        </div> 
251                        <!-- 
252                         <div class="stats download"> 
253                        	<h5>Download this solution</h5> 
254                            <a href="#" class="btn ${reg_css}"><i class="fa fa-fw fa-download"></i>Download</a> 
255                            <div class="clearfix"></div> 
256                        </div> 
257                        --> 
258                    </div> 
259                </div> 
260                <div class="clearfix"></div> 
261                	<#if Solution_Provider_Email?has_content> 
262	                	<#if themeDisplay.isSignedIn() > 
263	            			<a onclick="showPopup('Contact Provider', '${messageRenderURL}')" class="btn btn-large btn-primary" rel="nofollow" >CONTACT SOLUTION PROVIDER</a> 
264	        			<#else> 
265	            			<#assign contactURL = loginRender_2URL /> 
266	            			<a href="${loginRenderURL}" data-redirect="false" class="btn btn-large btn-primary" id="sign-in-provider" rel="nofollow" >CONTACT SOLUTION PROVIDER</a> 
267	        			</#if>                	                		 
268                	</#if> 
269                </div>                 
270           	</div> 
271        </div> 
272      </div> 
273      <#if Full_solution_description?has_content && Full_solution_description.getData()!=""> 
274      <div class="media_section"> 
275      	<div class="container"> 
276            <div class="row-fluid"> 
277				<div class="solution_dtls" id="full_solution_toggler"> 
278					<div class="solution_dtls_1 bookmark" > 
279						<h3 class="header toggler-header-collapsed">Show Full Solution   
280								<a class="btn btn-full-solution expanded">  <span class="btn-label hidden-phone">Expand</span>   <i class="icon-chevron-down"></i></a> 
281								<a class="btn btn-full-solution collapsed">  <span class="btn-label hidden-phone">Collapse</span>   <i class="icon-chevron-up"></i></a> 
282						</h3> 
283						<div class="content toggler-content-collapsed"> 
284							<p>${.vars['Full_solution_description'].getData()}</p> 
285						</div> 
286					</div> 
287				</div> 
288			</div> 
289		</div> 
290	</div> 
291    </#if> 
292    <#if (Video?has_content && Video.getSiblings()?first.getData()!="")  
293    	|| (Images?has_content && Images.getSiblings()?first.getData()!="")  
294    	|| (Audios.getSiblings()?has_content && Audios.getSiblings()?first.getData()!="") 
295    	|| (Documents.getSiblings()?has_content && Documents.getSiblings()?first.getData()!="") 
296    	|| (External_Title?? && External_Title.getSiblings()?has_content && External_Title.getSiblings()?first.getData()!="")>  
297      <div class="media_section main-media-section"> 
298      	<div class="container"> 
299            <div class="row-fluid"> 
300            	<div class="solution_dtls"> 
301            	<#if Video?has_content && Video.getSiblings()?first.getData()!=""> 
302                <div class="solution_dtls_1"> 
303                	<h3>Solution Video</h3> 
304 
305					<#list Video.getSiblings() as cur_Video> 
306                        <div class="span6 video" > 
307                            <div class="media ${["", "media_rt"][cur_Video_index%2]}"> 
308                                <img class="youtube" data-video-url="${cur_Video.getData()}" id="video-${cur_Video_index}" width="480" height="359" alt="img_5" /> 
309                                <div class="mvpo ${["", "mvpo-r"][cur_Video_index%2]}"> 
310                                    <a href="#"> 
311                                    </a> 
312                                </div> 
313                                <div class="media_cnt"> 
314                                    <h4 id="video-${cur_Video_index}-title"></h4> 
315                                    <p>Video Author:<a id="video-${cur_Video_index}-author"> <span>IFAD TV</span></a></p> 
316                                    <p>Video Resolution:<span id="video-${cur_Video_index}-resolution">1280 x 720</span></p> 
317                                </div> 
318                            </div> 
319                        </div> 
320                        </#list> 
321                        <div class="clearfix"></div> 
322                  	</div> 
323                </#if> 
324                <#if Images?has_content && Images.getSiblings()?first.getData()!=""> 
325                <div class="solution_dtls_2"> 
326                	<h3>Solution Image</h3> 
327						<#list Images.getSiblings() as cur_item> 
328                        <div class="span6 images"> 
329                            <div class="media ${["", "media_rt"][cur_item_index%2]}"> 
330                                <div class="media-box-img-wrapper"> 
331                                    <a href="${cur_item.Image_File.getData()}" data-lightbox="solution-images" data-title="${cur_item.getData()}"> 
332                                    	<div class="media-box-img" style="background-image: url('${cur_item.Image_File.getData()}')" ></div>  
333                                    </a> 
334                                </div> 
335                                <div class="mizoom ${["", "mizoom-r"][cur_item_index%2]}"> 
336                                    <a href="${cur_item.Image_File.getData()}" data-lightbox="solution-images_box" ></a> 
337                                </div> 
338                                <div class="media_cnt"> 
339                                    <h4 title="${cur_item.data}" >${truncEllipsis (cur_item.getData(), 100)}</h4> 
340                                    <p>Image Author:<span>${cur_item.Image_Author.getData()}</span></p> 
341                                </div> 
342                            </div> 
343                        </div> 
344                        </#list> 
345                        <div class="clearfix"></div> 
346                </div> 
347                </#if> 
348                <#if Audios.getSiblings()?has_content && Audios.getSiblings()?first.getData()!=""> 
349                <div class="solution_dtls_3"> 
350                	<h3>Solution Audio</h3> 
351                	<#list Audios.getSiblings() as cur_item> 
352                	<div class="document"> 
353                		<div class="reaf_rt"> 
354                			<p><span>${cur_item.getData()}</span></p> 
355                		</div> 
356                		<div class="audio" id="audio-${cur_item_index}" data-audio-src="${cur_item.Audio_Link.getData()}"></div> 
357                	</div> 
358                	</#list> 
359                </div> 
360                </#if> 
361                <#if Documents.getSiblings()?has_content && Documents.getSiblings()?first.getData()!=""> 
362                <div class="solution_dtls_4"> 
363                	<h3>Solution Document Downloads</h3> 
364                	<#list Documents.getSiblings() as cur_item> 
365                	<div class="document"> 
366						<div class="document_lt"> 
367							<div class="document_link_lt"> 
368								<figure> 
369                                	<img src="${themeDisplay.getPathThemeImages()}/custom/img_7.png" width="33" height="42" alt="document icon"> 
370                               	</figure> 
371                            </div> 
372                            <#if cur_item.Document_Link.getData()?has_content> 
373                            	<#assign docLink = cur_item.Document_Link.getData() > 
374                            <#else> 
375                             	<#assign docLink = cur_item.Document_File.getData() > 
376                            </#if> 
377                            <div class="document_link_rt"> 
378								<a href="${docLink}" target="_blank"><span>${cur_item.getData()}</span></a> 
379                            </div> 
380                            <div class="clearfix"></div> 
381                        </div> 
382                        <div class="document_rt"> 
383                         	<div class="pdf"> 
384                            	<small>${cur_item.Document_Type.getData()}</small> 
385                            </div> 
386                            <div class="download_1"> 
387                             	<a href="${docLink}" class="btn" download><i class="fa fa-fw fa-download"></i>Download</a> 
388                            </div> 
389                            <div class="clearfix"></div> 
390                        </div> 
391                        <div class="clearfix"></div> 
392                    </div> 
393                    </#list> 
394                 </div> 
395				</#if> 
396				<#if External_Title.getSiblings()?has_content && External_Title.getSiblings()?first.getData()!=""> 
397                <div class="solution_dtls_1 solution_dtls_5"> 
398                	<h3>Solution Additional Resources</h3> 
399                	<#list External_Title.getSiblings() as cur_item> 
400                    <a href="${cur_item.External_Link.getData()}" target="_blank">${cur_item.getData()}</a> 
401                    </#list> 
402                  	</div> 
403                </div> 
404				</#if> 
405            </div> 
406        </div> 
407      </div> 
408      </#if> 
409       
410		<#assign displaydate = .vars['reserved-article-modified-date'].data> 
411		<#assign originalLocale = .locale> 
412		<#setting locale = localeUtil.getDefault()> 
413		<#assign displaydate = displaydate?datetime("EEE, d MMM yyyy HH:mm:ss Z")> 
414		<#assign locale = originalLocale> 
415       
416      <div class="container"> 
417      	<div class="row-fluid"> 
418	      <div class="last-update"> 
419	      	<p class="muted pull-right"><i class="icon-calendar"></i> Last update: ${displaydate?string["dd/MM/yyyy"]}</p> 
420	      </div> 
421	    </div> 
422	  </div> 
423</div> 
424 
425 
426<script> 
427 
428$(function() { 
429    $(".youtube").each(function() { 
430        // Based on the YouTube ID, we can easily find the thumbnail image 
431        var url = $(this).attr("data-video-url"); 
432        var id = getYoutubeId(url); 
433        var youtubeImgId = $(this).attr('id'); 
434        if (id!=null){ 
435	        $(this).attr('src', 'https://img.youtube.com/vi/' + id + '/0.jpg'); 
436	     
437	        // Overlay the Play icon to make it look like a video player 
438	        $(this).append($('<div/>', {'class': 'mvpo'})); 
439			 
440			$.getJSON('https://noembed.com/embed', 
441			    {format: 'json', url: url}, function (data) { 
442			    	$('#'+youtubeImgId+"-title").html(data.title); 
443			    	$('#'+youtubeImgId+"-author").html("<span>"+data.author_name+"</span>"); 
444			    	$('#'+youtubeImgId+"-author").attr("href", data.author_url); 
445					$('#'+youtubeImgId+"-resolution").html(data.width + " x " + data.height); 
446			}); 
447
448		 
449		$(this).click(function(){ 
450			playVideo($(this), id); 
451		}); 
452		 
453		$(this).siblings(".mvpo").click(function(){ 
454			playVideo($(this).siblings(".youtube"), id); 
455		}); 
456		 
457	}); 
458 }); 
459 
460function playVideo(node, id){ 
461			//node.parentsUntil(".media").find(".mvpo").hide(); 
462			node.siblings(".mvpo").hide(); 
463            var iframe_url = "https://www.youtube.com/embed/" + id + "?autoplay=1&autohide=1"; 
464            if (node.data('params'))  
465            	iframe_url+='&'+$node.data('params'); 
466     
467            // The height and width of the iFrame should be the same as parent 
468            var iframe = $('<iframe/>', {'frameborder': '0', 'src': iframe_url, 'width': node.width(), 'height': node.height() }) 
469     
470            // Replace the YouTube thumbnail with YouTube HTML5 Player 
471            node.replaceWith(iframe); 
472 
473
474 
475 
476function getYoutubeId(url){ 
477	var videoid = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/); 
478	if(videoid != null) { 
479	   return videoid[1]; 
480	} else {  
481	    return null; 
482
483
484 
485// this is one of creating function 
486function showPopup(title, url) { 
487 
488    var url = url; 
489    var title = title; 
490    var randomNamespace = 'SSTCNewMessageDialog_'; 
491 
492    Liferay.Util.openWindow( 
493
494                dialog: { 
495                    cache: false, 
496                    width:650, 
497                    height:400, 
498                    modal: true, 
499                    destroyOnHide: true 
500/*                     
501                    after: { 
502						 
503						visibleChange: function(e){ 
504//							console.log(e); 
505//							if(!e.newVal){ 
506//								window.document.getElementById('<portlet:namespace />contact').style.display = 'none';; 
507//								window.document.getElementById('<portlet:namespace />messageContainer').innerHTML = '<span class="portlet-msg-success">Message Sent Successfully</span>'; 
508//							} 
509
510						 
511					}, 
512*/ 
513                }, 
514                id: 'SSTCNewMessageDialog_', 
515                title: title, 
516                uri: url 
517            });  
518
519 
520var show_contact_solution = "${show_contact_solution}"; 
521 
522if (show_contact_solution && themeDisplay.isSignedIn()){ 
523	showPopup('Contact Solution Provider', '${messageRenderURL}'); 
524
525 
526AUI().use( 
527  'aui-toggler', 
528  function(A) { 
529  	if (A.one('#full_solution_toggler')){ 
530	    new A.Toggler( 
531
532	      	animated: true, 
533	        container: '#full_solution_toggler', 
534	        content: '#full_solution_toggler .content', 
535	        expanded: false, 
536	        header: '#full_solution_toggler .header', 
537	        transition: { 
538	          duration: 0.2, 
539	          easing: 'cubic-bezier(0, 0.1, 0, 1)' 
540
541
542	   ); 
543
544
545); 
546 
547AUI().use( 
548  'aui-audio', 
549  function(A) { 
550  	var audios = A.all('.audio'); 
551  	if (!audios.isEmpty()){ 
552  		audios.each(function (v, index){ 
553		    new A.Audio( 
554
555		        boundingBox: '#audio-'+index, 
556		        url: v.getAttribute('data-audio-src'), 
557		        oggUrl: v.getAttribute('data-audio-src') 
558				 
559
560		    ).render(); 
561		}); 
562
563
564); 
565 
566/** bookmark **/ 
567var bookmarked = ${bookmarked?string}; 
568var inactive = "<i class='fa fa-bookmark-o' aria-hidden='true'></i>Bookmark"; 
569var active = "<i class='fa fa-check' aria-hidden='true'></i> Bookmarked"; 
570 
571$(function() { 
572	$('#bookmarkButton').click(function(){ 
573		 	_swithBookMark(); 
574	}); 
575 
576	$('#bookmarkButton').html(bookmarked?active:inactive); 
577	if (bookmarked){ 
578		$('#bookmarkButton').addClass("active");	 
579
580}); 
581 
582 
583function _swithBookMark(){ 
584    var url = '${bookmarkSwithURL}'; 
585    $('#bookmarkButton').toggleClass("bookmark-active"); 
586//    $('#bookmarkButton').prop('disabled', true); 
587    jQuery.ajax({ 
588	    type : "POST", 
589	    url : url, 
590	    cache:false, 
591	    dataType: "json", 
592	    success : function(data){ 
593//			$('#bookmarkButton').prop('disabled', false); 
594			bookmarked = !bookmarked; 
595			$('#bookmarkButton').html(bookmarked?active:inactive); 
596			$('#bookmarkButton').toggleClass("active"); 
597	    }, 
598	    error : function(XMLHttpRequest, textStatus, errorThrown){ 
599//	       alert(errorThrown); 
600	       alert(textStatus); 
601//			$('#bookmarkButton').prop('disabled', false);		 
602
603	}); 
604
605 
606    //jsocials 
607    $("#shareIcons").jsSocials({ 
608    	shareIn: "popup", 
609	    showLabel: false, 
610	    showCount: false, 
611	    shares: ["twitter", "facebook", "googleplus", "email", "linkedin"] 
612	}); 
613 
614</script> 
615 
616<#function truncEllipsis text length> 
617    <#if text?length <= length> 
618        <#return text> 
619    <#else> 
620        <#return text?substring(0,length) + "..." > 
621    </#if> 
622</#function>