Blog Details - Magma Insurance
テンプレート処理中にエラーが発生しました。
Java method "com.sun.proxy.$Proxy1098.fetchArticleByUrlTitle(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy1098 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@1a7adacc"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: article = journalArticleLocalService... [in template "20100#20136#5625088" at line 16, column 9]
----
1<#-- Service Locators -->
2<#assign
3 journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4 journalArticleResourceLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")
5 assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")
6/>
7<#assign blogName = "" />
8<div class="container container_exp_details">
9 <#-- Fetching Article by URL title -->
10
11<#assign groupId = themeDisplay.getScopeGroupId() />
12
13<#if request.getParameter("blogid")?? && request.getParameter("blogid")?has_content>
14 <#assign
15 blogid = request.getParameter("blogid")
16 article = journalArticleLocalService.fetchArticleByUrlTitle(groupId, blogid)
17 />
18</#if>
19
20 <#if article??>
21 <#-- Fetch the AssetEntry for the JournalArticle -->
22 <#assign
23 assetEntry = assetEntryLocalService.fetchEntry("com.liferay.journal.model.JournalArticle", article.getResourcePrimKey())
24 />
25 <#if assetEntry??>
26 <#-- Get JournalArticleResource using AssetEntry -->
27 <#assign
28 journalArticleResourceObj = journalArticleResourceLocalService.getJournalArticleResource(assetEntry.getClassPK())
29 currentArticleId = getterUtil.getString(journalArticleResourceObj.getArticleId())
30 journalArticle = journalArticleLocalService.getArticle(groupId, currentArticleId)
31 />
32 <#if journalArticle??>
33 <#-- Extract Content -->
34 <#assign
35 document = saxReaderUtil.read(journalArticle.getContent())
36 fieldNodes = document.selectNodes("/root/dynamic-element")
37 />
38 <#list fieldNodes as fieldNode>
39 <#assign
40 fieldName = fieldNode.valueOf("@field-reference")
41 fieldValue = fieldNode.selectSingleNode("dynamic-content").getText()
42 />
43 <#if fieldName == "BannerImage">
44 <div class="card p-0">
45 <#assign
46 imageUrlStart = fieldValue?index_of("\"url\":\"") + 7
47 imageUrlEnd = fieldValue?index_of("\",", imageUrlStart)
48 />
49 <#if imageUrlStart != -1 && imageUrlEnd != -1>
50 <img src="${fieldValue?substring(imageUrlStart, imageUrlEnd)}" alt="BannerImage" class="img-fluid"/>
51 </#if>
52 </div>
53 <#-- Define function to get ordinal suffix -->
54 <#function getOrdinalSuffix(number)>
55 <#if number % 10 == 1 && number % 100 != 11>
56 <#return "st">
57 <#elseif number % 10 == 2 && number % 100 != 12>
58 <#return "nd">
59 <#elseif number % 10 == 3 && number % 100 != 13>
60 <#return "rd">
61 <#else>
62 <#return "th">
63 </#if>
64 </#function>
65
66 <#-- ... other parts of your code -->
67
68 <#elseif fieldName == "Title">
69 <div class="ex-health-head">
70 <h1 class="h4">
71 <b>${fieldValue}</b>
72 <#assign blogName = fieldValue + " - Magma HDI" />
73 <#elseif fieldName == "DateOfPublish">
74 <#-- Parse the date -->
75 <#assign parsedDate = fieldValue?date("yyyy-MM-dd")>
76 <#-- Format the date -->
77 <span class="gray font_16 thin">
78 ${parsedDate?string("d")}<sup>${getOrdinalSuffix(parsedDate?string("d")?number)}</sup> ${parsedDate?string("MMMM yyyy")}
79 </span>
80 </h1>
81 </div>
82
83 <#elseif fieldName == "Content">
84 <div class="p_40_0 exp-content-details thin">
85 ${fieldValue}
86 </div>
87 </#if>
88 </#list>
89 <#else>
90 Journal article not found.
91 </#if>
92 <#else>
93 Asset entry not found.
94 </#if>
95 <#else>
96 Article with the provided URL title not found.
97 </#if>
98 </div>
99
100<style>
101 .ex-health-head b{
102 border-right: 1px solid gray;
103 padding-right: 20px;
104 }
105</style>
106
107<script type="text/javascript">
108 document.addEventListener("DOMContentLoaded", function() {
109 var blogName = "${htmlUtil.escapeJS(blogName)}";
110 document.title = blogName;
111 });
112</script>