News Archive
An error occurred while processing the template.
Java method "com.liferay.portal.kernel.util.DateUtil_IW.parseDate(String, String, Locale)" threw an exception when invoked on com.liferay.portal.kernel.util.DateUtil_IW object "com.liferay.portal.kernel.util.DateUtil_IW@20041d81"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign DateObj = dateUtil.parseDate(... [in template "20116#20152#153124" at line 295, column 57] ----
1<#--
2 Name: Broker News Archive
3 Type: Asset Search Filter and Browse Template
4 Intended for: Brokers site News Archive
5 Requires: Broker News Article content structure entries
6 Uses content template: No
7 Template intended to be used within an instance of the Asset
8 Search Filter and Browse portlet for displaying a searchable
9 and filterable list of Broker News Article entries.
10-->
11<style>
12 .m-auto{
13 margin: auto;
14 }
15</style>
16<#macro columnSortIcons is_sorted=false sort_direction="">
17 <span class="sort-icons">
18 <i class="fa fa-sort-down${(is_sorted && sort_direction == 'ASC')?string(' active', '')}"></i>
19 <i class="fa fa-sort-up${(is_sorted && sort_direction == 'DESC')?string(' active', '')}"></i>
20 </span>
21</#macro>
22
23<#macro paginationList>
24 <div class="col-12 col-sm-6 text-right">
25 <ul class="pagination">
26 <li class="page-item ${(1 == currentPage)?string('disabled inactive-link', '')}">
27 <a href="${displayContext.getPaginationURL(1,sortField,sortOrder, isDDM)}" class="page-link"
28 aria-label="Previous"><span class="angle-left-icon" aria-hidden="true"></span></a>
29 </li>
30 <#if (totalPages < 10 )>
31 <#list 1.. totalPages as i>
32 <li class="page-item ${(i == currentPage)?string('active', '')}">
33 <a class="page-link" href="${displayContext.getPaginationURL(i,sortField,sortOrder, isDDM)}">${i}</a>
34 </li>
35 </#list>
36 <#else>
37 <li class="page-item ${(1 == currentPage)?string('active', '')}">
38 <a href="${displayContext.getPaginationURL(1,sortField,sortOrder, isDDM)}" class="page-link">
39 <span aria-hidden="true">1</span></a>
40 </li>
41 <#assign initialPage = currentPage - 2>
42 <#assign lastPage = currentPage + 2>
43 <#if (initialPage < 2)>
44 <#assign initialPage= 2>
45 </#if>
46 <#if (lastPage > (totalPages-1))>
47 <#assign lastPage= (totalPages-1)>
48 </#if>
49 <#if (initialPage > 2)>
50 <li class="page-item">
51 <a class="page-link" >
52 <span aria-hidden="true">...</span></a>
53 </li>
54 </#if>
55 <#list initialPage.. lastPage as i>
56 <li class="page-item ${(i == currentPage)?string('active', '')}">
57 <a class="page-link" href="${displayContext.getPaginationURL(i,sortField,sortOrder, isDDM)}">
58 ${i}</a>
59 </li>
60 </#list>
61 <#if (lastPage < (totalPages-1))>
62 <li class="page-item">
63 <a class="page-link">
64 <span aria-hidden="true">...</span></a>
65 </li>
66 </#if>
67 <li class="page-item ${(totalPages == currentPage)?string('active', '')}">
68 <a href="${displayContext.getPaginationURL(totalPages,sortField,sortOrder, isDDM)}"
69 class="page-link">
70 <span aria-hidden="true">${totalPages}</span></a>
71 </li>
72 </#if>
73 <li class="page-item ${(totalPages == currentPage)?string('disabled inactive-link', '')}">
74 <a href="${displayContext.getPaginationURL(totalPages,sortField,sortOrder, isDDM)}"
75 class="page-link" aria-label="Next">
76 <span class="angle-right-icon" aria-hidden="true"></span></a>
77 </li>
78 </ul>
79 </div>
80</#macro>
81
82<#-- Form element variables -->
83<#assign portletId = portletDisplay.getId()?split("_")?last />
84<#assign categorySelectId = "categories-" + portletId>
85<#assign filterFormId = "filter-" + portletId>
86<#assign noRecordsText = "No records found">
87<#assign resetBtnId = "btn-" + portletId>
88<#assign resetBtnText = "Reset">
89<#assign searchFormId = "search-" + portletId>
90<#assign showResetBtn = false>
91<#assign categoryId = renderRequest.getParameter("categoryId")!0>
92<#assign keywords = renderRequest.getParameter("keywords")!"">
93<#assign requestURL = renderResponse.createRenderURL()>
94<#if categoryId?number != 0 || keywords != "">
95 <#assign showResetBtn = true>
96</#if>
97
98<#-- News template variables -->
99<#assign templateTitle = "All News">
100<#assign showAllText = "Read All News">
101<#assign abstractCharCount = 275>
102<#assign linkText = 'Read Article <i class="fa fa-chevron-right"></i>'>
103<#assign articlePage = "../broker-news/article">
104<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()>
105<#assign themeDisplay = serviceContext.getThemeDisplay() />
106<#assign layout = themeDisplay['plid'] />
107<#assign layoutService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")>
108<#assign layoutObject = layoutService.getLayout(layout?number) />
109<#assign page_group = layoutObject.getGroup() />
110<#assign site_title = page_group.getDescriptiveName() />
111
112<#-- Paging and sorting -->
113<#assign currentPage = (renderRequest.getParameter("page")!"1")?number>
114<#assign sortOrder = renderRequest.getParameter("sortOrder")!"">
115<#assign sortField = renderRequest.getParameter("sortField")!"">
116<#assign isDDM = (renderRequest.getParameter("ddm")!"true")?boolean>
117<#if sortField != "">
118 <#assign sortField = sortField?split("_")?last>
119</#if>
120<#if sortOrder=="ASC">
121 <#assign isAscending=false>
122<#else>
123 <#assign isAscending=true>
124</#if>
125
126<#-- Handle dynamic column layouts based on portlet config & filter state -->
127<#assign showSearch = displayContext.isDisplaySearch()>
128<#assign showCategoryFilter = displayContext.isDisplayCategory()>
129<#assign showSearchAndFilter = showSearch && showCategoryFilter>
130<#assign resetColClass = showSearchAndFilter?string("col-4 col-sm-2 col-lg-2", "col-4 col-sm-3 col-md-2 col-lg-2")>
131<#if showResetBtn>
132 <#assign filterColClass = showSearchAndFilter?string("col-8 col-sm-4", "col-8 col-sm-9 col-md-10 col-lg-10")>
133 <#assign searchColClass = showSearchAndFilter?string("col-12 col-sm-5 col-lg-5", "col-8 col-sm-9 col-md-10 col-lg-10")>
134<#else>
135 <#assign filterColClass = showSearchAndFilter?string("col-12 col-sm-4 col-lg-4", "col-12")>
136 <#assign searchColClass = showSearchAndFilter?string("col-12 col-sm-6", "col-12")>
137</#if>
138
139<style>
140 .table>tbody>tr>td {
141 border-top: none;
142 }
143 .table>tbody>tr>td p {
144 font-size: 15px;
145 }
146 .mb-0 {
147 margin-bottom: 0;
148 }
149</style>
150
151<div id="${portletId}" class="container-block search-filter-browse Broker-news-archive">
152 <div class="row search-filter-browse__form">
153 <#if showSearch>
154 <div class="${searchColClass}">
155 <form id="${searchFormId}" action="${renderResponse.createRenderURL()}" method="post">
156 <div class="form-group">
157 <label for="keywords" class="sr-only">Search By Name, Code or Category</label>
158 <i class="fa fa-search"></i>
159 <input id="keywords"
160 class="form-control"
161 type="search"
162 name="${renderResponse.getNamespace()}keywords"
163 value="${keywords}"
164 placeholder="${displayContext.getSearchPlaceholderText()}"/>
165 <input type="submit" value="Submit" style="display: none" />
166 </div>
167 </form>
168 </div>
169 </#if>
170 <#if showSearch && showCategoryFilter>
171 <div class="col-12 col-sm-1 text-center">
172 <strong class="text-large">or</strong>
173 </div>
174 </#if>
175 <#if showCategoryFilter>
176 <div class="${filterColClass}">
177 <form id="${filterFormId}" action="${renderResponse.createRenderURL()}" method="post">
178 <label for="${categorySelectId}" class="sr-only">Select a Category</label>
179 <select class="form-control" id="${categorySelectId}" name="${renderResponse.getNamespace()}categoryId">
180 <option value="0" selected="selected">${displayContext.getCategoryPlaceholderText()}</option>
181 <#if displayContext.getCategories()?has_content>
182 <#list displayContext.getCategories() as category>
183 <#if categoryId?string == category.getCategoryId()?string>
184 <option value="${category.getCategoryId()}" selected="selected">
185 ${category.getName()}
186 </option>
187 <#else>
188 <option value="${category.getCategoryId()}">
189 ${category.getName()}
190 </option>
191 </#if>
192 </#list>
193 </#if>
194 </select>
195 </form>
196 </div>
197 </#if>
198 <#if showResetBtn>
199 <div class="${resetColClass} text-center">
200 <button class="btn btn-sm btn-primary" id="${resetBtnId}">${resetBtnText}</button>
201 </div>
202 </#if>
203 </div>
204 <#if entries?has_content>
205 <#if displayContext.isPagination()>
206 <div class="row pagination-container">
207 <#assign paginationNumber = 1>
208 <#assign pageSize = displayContext.getPageSize()>
209 <#assign totalPages = displayContext.getTotalPages()>
210 <#assign totalRecords = displayContext.getTotalRecords()>
211 <#if pageSize != 0>
212 <#assign paginationNumber = (totalRecords / pageSize)?ceiling>
213 </#if>
214 <div class="col-12 col-sm-6">
215 <#assign initialNo = ((currentPage - 1) * pageSize) + 1>
216 <#assign lastNo = (currentPage * pageSize)>
217 <#if (lastNo > totalRecords)>
218 <#assign lastNo = totalRecords>
219 </#if>
220 <small class="results-summary" tabindex="0">Showing ${initialNo}–
221 ${lastNo} of ${totalRecords} Results</small>
222 </div>
223 <@paginationList />
224 </div>
225 </#if>
226 <div class="row provider-news">
227 <h2 class="provider-news__title">${templateTitle}</h2>
228 <table class="table">
229 <colgroup>
230 <col style="width: 80%;">
231 <col style="width: 20%;">
232 </colgroup>
233 <thead>
234 <tr>
235 <th>
236 Title
237 </th>
238 <th>
239 <a href=" ${displayContext.getSortingURL('Dateline', isAscending, false)}">
240 Issued Date
241 <@columnSortIcons is_sorted=(sortField == "Dateline") sort_direction=sortOrder />
242 </a>
243 </th>
244 </tr>
245 </thead>
246 <tbody>
247 <#list entries as entry>
248 <tr>
249 <td>
250 <div class="provider-news__entry">
251 <h3 class="provider-news__entry__title mb-0">
252 <#assign customURL = entry.getDDMFieldValue("CustomURL")!"">
253 <#if customURL?has_content>
254 <#if customURL?contains("univerahealthcare") || customURL?contains("excellusbcbs") || customURL?contains("documents") || customURL?contains("article") || customURL?contains("lifetimebenefitsolutions")>
255 <#if customURL?contains("pdf")>
256 <a class="provider-news__entry__link pdf-icon"
257 href="${customURL}">
258 ${entry.getDDMFieldValue("Headline")!""}
259 <span class="sr-only">Open a PDF</span>
260 </a>
261 <#else>
262 <a class="provider-news__entry__link"
263 href="${customURL}">
264 ${entry.getDDMFieldValue("Headline")!""}
265 </a>
266 </#if>
267 <#else>
268 <a class="provider-news__entry__link"
269 role="button" tabindex="0" onclick="showNotice('${customURL}');">
270 ${entry.getDDMFieldValue("Headline")!""}
271 </a>
272 </#if>
273 <#else>
274 <a class="provider-news__entry__link"
275 href="${displayContext.getOpenArticleInNewPageFriendlyURL()}?articleId=${entry.getArticleId()}&classPK=${entry.getClassPK()}">
276 ${entry.getDDMFieldValue("Headline")!""}
277 </a>
278 </#if>
279 </h3>
280 <#if site_title == "Excellus Brokers" || site_title == "Univera Brokers">
281 <#assign volNumber = entry.getDDMFieldValue("VolumeNumber"!"")>
282 <p class=" text-muted">${volNumber}</p>
283 </#if>
284 <p class="provider-news__entry__summary">
285 ${stringUtil.shorten(htmlUtil.stripHtml(entry.getBodyContent()!""), abstractCharCount)}
286 </p>
287 </div>
288 <#if displayContext.isViewAll()>
289 <div class="provider-news__show-all">
290 <a href="#" class="btn btn-secondary">${showAllText}</a>
291 </div>
292 </#if>
293 </td>
294 <td>
295 <#assign DateObj = dateUtil.parseDate("yyyy-MM-dd", entry.getDDMFieldValue("Dateline")!"", locale)>
296 <span class="provider-news__entry__dateline text-muted">
297 ${dateUtil.getDate(DateObj, "MMMM d, yyyy", locale)}
298 </span>
299 </td>
300 </tr>
301 </#list>
302 </tbody>
303 </table>
304 <#if displayContext.isPagination()>
305 <div class="row pagination-container">
306 <#assign paginationNumber = 1>
307 <#assign pageSize = displayContext.getPageSize()>
308 <#assign totalPages = displayContext.getTotalPages()>
309 <#assign totalRecords = displayContext.getTotalRecords()>
310 <#if pageSize != 0>
311 <#assign paginationNumber = (totalRecords / pageSize)?ceiling>
312 </#if>
313 <div class="col-12 col-sm-6">
314 <#assign initialNo = ((currentPage - 1) * pageSize) + 1>
315 <#assign lastNo = (currentPage * pageSize)>
316 <#if (lastNo > totalRecords)>
317 <#assign lastNo = totalRecords>
318 </#if>
319 <small class="results-summary">Showing ${initialNo}–
320 ${lastNo} of ${totalRecords} Results</small>
321 </div>
322 <@paginationList />
323 </div>
324 </#if>
325 </div>
326 <#elseif displayContext.isSearchError()>
327 <h3 class="text-center">${displayContext.getSearchErrorMessage()}</h3>
328 <#else>
329 <div class="flex-container">
330 <div class="flex-item-center m-auto">
331 <p><strong>${noRecordsText}</strong> Try a new search term, or reset your search.</p>
332 <p><strong>Suggestions:</strong></p>
333 <ul>
334 <li>Make sure all words are spelled correctly</li>
335 <li>Try different keywords</li>
336 <li>Try more generic keywords</li>
337 <li>Try fewer keywords</li>
338 </ul>
339 </div>
340 </div>
341 </#if>
342</div>
343<script type="text/javascript">
344 $(function () {
345 var $categorySelect = $('#${categorySelectId}');
346 var $filterForm = $('#${filterFormId}');
347 var $resetBtn = $('#${resetBtnId}');
348 var $searchForm = $('#${searchFormId}');
349 var $portletContainer = $('#${portletId}');
350 var $hasCategoryResults = $filterForm.find('select').val();
351 var $hasSearchResults= $searchForm.find('#keywords').val();
352 var $resultsSummary = $portletContainer.find('.results-summary');
353
354 // Handle search form
355 $searchForm.keydown(function(e) {
356 if (e.which === 13) {
357 $(this).submit();
358 }
359 });
360 // Handle category filter
361 $categorySelect.change(function() {
362 $filterForm.trigger('submit');
363 });
364 // Handle reset button
365 $resetBtn.on('click', function() {
366 if ($searchForm.length) {
367 $searchForm.find('input').val('');
368 $searchForm.submit();
369 } else {
370 $categorySelect.val(0);
371 $filterForm.submit();
372 }
373 });
374 // Foxus on summary text if results returned
375 if(($hasSearchResults || ($hasCategoryResults && $hasCategoryResults!=0))
376 && $resultsSummary.length){
377 $portletContainer.find('.results-summary').focus();
378 }
379 }());
380</script>
Script for Univera Healthcare Broker News Archive/Article