Composting Horse Manure
An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy175.getFileEntryByUuidAndGroupId(String, long)" threw an exception when invoked on com.sun.proxy.$Proxy175 object "com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl@46f1a6dd"; see cause exception in the Java stack trace.

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