Order Your Lucas Oil World Badge
An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy183.getFileEntryByUuidAndGroupId(String, long)" threw an exception when invoked on com.sun.proxy.$Proxy183 object "com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl@525e164c"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign file = fileEntry.getFileEntry...  [in template "20116#20152#NEWS" at line 52, column 13]
----
1<#import "aqha-theme_SERVLET_CONTEXT_/templates/base22/freemarker-utils.ftl" as utils> 
2<#assign journalArticleId = .vars['reserved-article-id'].data/> 
3<#assign createDate = .vars['reserved-article-display-date'].data /> 
4<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
5<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
6<#assign className = "com.liferay.journal.model.JournalArticle" /> 
7<#-- Start Get Categories --> 
8<#assign topicVocabularyId = utils.getVocabularyId("All Topics") /> 
9<#assign siteVocabularyId = utils.getVocabularyId("All Sites") /> 
10<#assign isControlPanelInURL = (themeDisplay.getURLCurrent()?index_of("control_panel") gte 0)?then(0, 1) /> 
11 
12<#assign siteCategoryHTML = "" /> 
13<#assign topicCategoriesHTML = "" /> 
14 
15<#-- Validate if the Template is being render in a scope out of Site --> 
16<#-- When the template is being render in workflow preview,  
17	the classes imported with staticUtil, localService, objectUtil are not avaliable in that scope --> 
18<#if isControlPanelInURL == 1> 
19	<#--<#assign journalArticleResourceLocalServiceUtil = staticUtil["com.liferay.journal.service.JournalArticleResourceLocalServiceUtil"]>--> 
20	<#assign journalArticleResourceLocalServiceUtil = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService") /> 
21	<#assign articleResourcePK = journalArticleResourceLocalServiceUtil.getArticleResourcePrimKey(groupId, journalArticleId)/> 
22	<#assign siteCategoryHTML> 
23		<@utils.getCategoryByVocabularyId siteVocabularyId false className articleResourcePK/> 
24	</#assign> 
25	<#assign topicCategoriesHTML> 
26		<@utils.getCategoryByVocabularyId topicVocabularyId false className articleResourcePK/> 
27	</#assign> 
28</#if> 
29<#-- End Get Categories --> 
30<#if displayTitle?? && displayTitle.getData() != ""> 
31	<div class="row b-source-title-container"> 
32		<div class="b-resource-title col-sm-12 col-md-12 col-lg-12 col-xl-12"> 
33			<h2 class="b-h1">${displayTitle.getData()}</h2> 
34			<div class="b-subtitles"> 
35                <span> 
36                <#if abstract?? && abstract.getData() != ""> 
37                    ${abstract.getData()} 
38                </#if> 
39				</span> 
40			</div> 
41		</div> 
42	</div> 
43</#if> 
44 
45<#if image?? && image.getData() != ""> 
46<div class="row b-source-image-container"> 
47	<div class="b-resource-image col-sm-12 col-md-12 col-lg-12 col-xl-12"> 
48	<#assign alttext = "" /> 
49	    <#if image.getData()?string?split("/")[5]??> 
50		    <#assign imgID = image.getData()?string?split("/")[5]?split("?")[0]> 
51            <#assign fileEntry = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService')> 
52            <#assign file=fileEntry.getFileEntryByUuidAndGroupId(imgID, groupId) > 
53			<#assign alttext = file.getDescription() /> 
54		</#if> 
55		<#-- Temporal fix to remove versioning issues when use export/import lar files --> 
56		<#-- TODO: Remove this temporal fix once the problem has been resolved --> 
57		<#-- <img datasrc="${utils.cleanPath(image.getData())}" src="" class="image-responsive lazy-load" /> --> 
58		<p><img src="${utils.cleanPath(image.getData())}" datasrc="${utils.cleanPath(image.getData())}" alt="${alttext}" class="image-responsive" /></p> 
59		<p class="b-metadata" > ${image.getAttribute("alt")}</p> 
60	</div> 
61</div> 
62</#if> 
63<div class="row"> 
64	<div class="col-xs-8"> 
65		<@utils.createLinksForSharing displayTitle.getData() /> 
66	</div> 
67	<div class="col-xs-4"> 
68		<@utils.createZoomButtons /> 
69	</div> 
70</div> 
71<div class="row"> 
72    <div class="col-xs-12"> 
73        <p class="b-metadata"> 
74			${createDate?datetime("EEE, d MMM yyyy HH:mm:ss Z")?string(("MMMM d, yyyy"))} | ${siteCategoryHTML} | ${topicCategoriesHTML} 
75        </p> 
76	</div> 
77</div> 
78 
79 
80<#if body?? && body.getData() != ""> 
81<div class="row b-source-summary-container b-zoom-container"> 
82	<div class="b-resource-summary col-sm-12 col-md-12 col-lg-12 col-xl-12"> 
83		<p class="text-line-height-lg"> 
84            ${body.getData()} 
85		</p> 
86		<@utils.getAttachment attachment /> 
87	</div> 
88</div> 
89</#if> 
90<div class="b-web-component__body"> 
91    <div class="b-related-items-list"> 
92        <div class="row"> 
93            <div class="panel panel-default"> 
94				<ul class="list-group"> 
95					<#if isControlPanelInURL == 1><@getRelatedItems /></#if> 
96				</ul> 
97			</div> 
98		</div> 
99	</div> 
100</div> 
101 
102<#--- Start Macros  --> 
103<#macro getRelatedItems> 
104	<#-- Start Get CategoriesIds --> 
105	<#assign classTypeIdsArray = [] /> 
106	<#-- these values for specific structure ID were obtained dynamically --> 
107	<#-- by accessing the developer console in the web browser while logged into --> 
108	<#-- the portal and choosing these structures within an asset publisher configuration --> 
109	<#assign structureCode1 = 83902 /> 
110	<#assign structureCode2 = 83707 /> 
111	<#assign classTypeIdsArray = classTypeIdsArray + [getterUtil.getLong(structureCode1)] /> 
112	<#assign classTypeIdsArray = classTypeIdsArray + [getterUtil.getLong(structureCode2)] /> 
113	<#assign categoriesIdsArray = [] /> 
114	<#assign categoriesIds = utils.getCategoriesIdsByVocabularyId(topicVocabularyId, className, articleResourcePK) /> 
115	<#list categoriesIds as categoryId> 
116		<#assign categoriesIdsArray = categoriesIdsArray + [getterUtil.getLong(categoryId)] /> 
117	</#list> 
118	<#-- End Get CategoriesIds --> 
119	<#assign assetEntryQueryService = objectUtil('com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil') /> 
120	<#assign assetEntryQuery = objectUtil('com.liferay.asset.kernel.service.persistence.AssetEntryQuery') /> 
121	<#assign setStartEntries = assetEntryQuery.setStart(0) /> 
122	<#assign setEndEntries = assetEntryQuery.setEnd(6) /> 
123	<#assign orderedEntries = assetEntryQuery.setOrderByCol1("DisplayDate") /> 
124	<#assign searchQuery = assetEntryQuery.setAnyCategoryIds(categoriesIdsArray) /> 
125	<#assign setclassname = assetEntryQuery.setClassTypeIds(classTypeIdsArray) /> 
126	<#assign entries = assetEntryQueryService.getEntries(assetEntryQuery) /> 
127	<#if entries?has_content>		 
128		<#list entries as entry> 
129			<#if entry.getAssetRenderer()?? && categoriesIdsArray?size gt 0>				 
130				<#assign renderer = entry.getAssetRenderer()> 
131				<#assign relatedClassName = renderer.getClassName() > 
132				<#assign relatedClassPK = renderer.getClassPK() /> 
133				<#if relatedClassName == "com.liferay.journal.model.JournalArticle" > 
134					<#assign journalArticle = renderer.getArticle() > 
135					<#assign document = saxReaderUtil.read(journalArticle. getContentByLocale(locale)) > 
136					<#-- Start build entryViewURL --> 
137					<#-- Build the url dinamicaly because we don't have exposed the Asset Publisher Helper, 
138					Render Request, Render Response variables as the ADT Template --> 
139					<#assign splittedURL = themeDisplay.getURLCurrent()?split("/") /> 
140					<#assign layout = themeDisplay.getLayout() /> 
141					<#assign pageGroup = layout.getGroup() /> 
142					<#assign siteDefaultURL = htmlUtil.escape(pageGroup.getDisplayURL(themeDisplay, false)) /> 
143					<#assign entryViewURL = siteDefaultURL+"/-/"+renderer.getUrlTitle() /> 
144					<#-- Try this approach once we got a way to get a PortletResponse/renderResponse object --> 
145					<#--<#assign entryViewURL = entry.getAssetRenderer().getURLViewInContext(httpServletRequest, portal.getLiferayPortletResponse(themeDisplay.getResponse())) />--> 
146					<#-- End build entryViewURL --> 
147					<#assign entryTitle = entry.getTitle(locale) /> 
148					<#assign entryThumbnail = document.valueOf("//dynamic-element[@name='image']") /> 
149					<#assign relatedTopicVocabularyId = utils.getVocabularyId("All Topics") /> 
150 
151					<div class="col-xs-12 col-sm-4 padding-top-md"> 
152						<li class="b-related-item"> 
153							<div class="b-web-component b-web-component--border"> 
154								<a href="${entryViewURL}"> 
155									<#-- Temporal fix to remove versioning issues when use export/import lar files --> 
156									<#-- TODO: Remove this temporal fix once the problem has been resolved --> 
157									<div class="b-related-item__image lazy-load" datasrc="${utils.cleanPath(entryThumbnail?trim)}"></div> 
158								</a> 
159								<div class="padding-sides padding-top-sm b-news-and-blogs__card-right-date"> 
160									${entry.getPublishDate()?date?string["MMM dd, yyyy"]} |<@utils.getCategoryByVocabularyId relatedTopicVocabularyId false relatedClassName relatedClassPK 3/> 
161								</div> 
162								<div class="padding-sides padding-top-sm padding-bottom-sm b-related-item__title"> 
163									<a class="b-related-item__link" href="${entryViewURL}"><@utils.cutStringByCharacters entryTitle 200 /></a> 
164								</div> 
165							</div> 
166						</li> 
167					</div> 
168				</#if> 
169			</#if> 
170		</#list>		 
171	</#if> 
172</#macro> 
173<#--- End Macros  -->