Extended Viewer

An error occurred while processing the template.
The following has evaluated to null or missing:
==> assetHelper.getFirstFile()  [in template "10159#10199#337672" at line 59, column 22]

----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign firstFile = assetHelper.getFi...  [in template "10159#10199#337672" at line 59, column 1]
----
1<#-- 
2## Velocity Transform Template 
3## 
4## All dynamic elements in a structure can be accessed as a Velocity variable. 
5## 
6## The given structure: 
7## 
8## <root> 
9##   <dynamic-element name="main-text" type="text_area"> 
10##     <dynamic-element name="sub-image" type="image"></dynamic-element> 
11##     <dynamic-element name="sub-text" type="text"></dynamic-element> 
12##   </dynamic-element> 
13##   <dynamic-element name="more-text" type="text_area"></dynamic-element> 
14##   <dynamic-element name="ms-list" type="multi-list"> 
15##     <dynamic-element name="chocolate" type="Chocolate"></dynamic-element> 
16##     <dynamic-element name="strawberry" type="Strawberry"></dynamic-element> 
17##     <dynamic-element name="vanilla" type="Vanilla"></dynamic-element> 
18##   </dynamic-element> 
19## </root> 
20## 
21## The dynamic element "main-text" can be accessed in the following ways: 
22## 
23## $main-text.getName()     - The name "main-text" 
24## $main-text.getData()     - The data in the article for main-text 
25## $main-text.getType()     - The type "text-area" 
26## $main-text.getChildren() - A collection with two nodes (sub-image and 
27##                            sub-text) that can be used in the #foreach clause 
28## $main-text.getSiblings() - A collection of elements with the name 
29##                            "main-text". This will only return more than one 
30##                            element if this element is repeatable. 
31## 
32## One special accessor exists for elements of type "multi-list": 
33## 
34## $ms-list.getOptions() - A collection with up to three string entries 
35##                         (chocolate, strawberry, or vanilla) that can be used 
36##                         in the #foreach clause 
37## 
38## Another special accessor exists for elements of type "link_to_layout": 
39## 
40## $linkToPage.getUrl() - The URL that links to the selected page in the current 
41##                        site. 
42## 
43## The variable $journalTemplatesPath can be used to include another Journal 
44## template, e.g. #parse ("$journalTemplatesPath/LAYOUT-PARENT") 
45## 
46## The variable $viewMode specifies which mode the article is being viewed in. 
47## For example, if $viewMode evaluates to "print", that means the user clicked 
48## the print icon to view this article. 
49## --> 
50 
51<#assign user_Id = getterUtil.getLong(themeDisplay["user-id"]) > 
52<#assign renderFromSearch = false > 
53<#if request.getAttribute('RENDER_FROM_SEARCH')??> 
54    <#assign renderFromSearch = request.getAttribute('RENDER_FROM_SEARCH') > 
55</#if> 
56 
57<#assign articleHelper = journalArticleTool.getArticleHelper(.vars['reserved-article-id'].data) > 
58<#assign assetHelper = articleHelper.createAssetHelper() > 
59<#assign firstFile = assetHelper.getFirstFile() > 
60<#if firstFile?? > 
61	<#-- #assign preview = assetHelper.getPreviewInfo(assetHelper.getFirstFile()) --> 
62<#else> 
63	<#assign preview = false > 
64</#if> 
65 
66<#if renderFromSearch && ((renderFromSearch?is_boolean && renderFromSearch == true) || (!renderFromSearch?is_boolean && renderFromSearch == 'true'))  >  
67	<#assign viewURL = '#'> 
68    <#if request.getAttribute('VIEW_URL')??> 
69	    <#assign viewURL = request.getAttribute('VIEW_URL') > 
70    </#if> 
71     
72	<#assign queryTerms='' > 
73    <#if request.getAttribute('SEARCH_KEYWORDS')??> 
74	    <#assign queryTerms=request.getAttribute('SEARCH_KEYWORDS') > 
75	</#if> 
76	 
77	<#assign selectedCategories='' > 
78	<#if request.getAttribute('categories')??> 
79	    <#assign selectedCategories=request.getAttribute('categories') > 
80	</#if> 
81	 
82	<#if preview?? && preview?is_hash && preview.previewFileURL?? > 
83		<img src="${preview.previewFileURL}1"  
84		style="width: 100px; float: left; border: 1px solid silver; -webkit-box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.8); -moz-box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.8); box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.8);" /> 
85	<#else> 
86		<div  
87		style="width: 100px; float: left; border: 1px solid silver; -webkit-box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.8); -moz-box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.8); box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.8); text-align: center; color: silver;" > 
88		<div style="padding: 10px;">No preview available</div> 
89		</div> 
90	</#if> 
91	<div style="margin: 0px 0px 0px 120px"> 
92		<#assign title = .vars['reserved-article-title'].data > 
93		<#assign title = htmlUtil.escape(title) > 
94		<#assign title = stringUtil.highlight(title, queryTerms) > 
95		<h1><a href="${viewURL}">${title}</a></h1> 
96		<p>${stringUtil.highlight(content.getData(), queryTerms)}</p> 
97		<p> 
98			<#assign categories=articleHelper.getCategories() > 
99			<#if categories?has_content > 
100				<b>Categories:</b> 
101				<#list articleHelper.getCategories() as cat > 
102					${cat.getTitle(locale)}<#if cat?has_next>,&nbsp; </#if> 
103				</#list> 
104			</#if> 
105		</p> 
106	</div> 
107	 
108<#else> 
109 
110 
111 
112<h1>${.vars['reserved-article-title'].data}</h1> 
113 
114 
115<#assign  last_modified_date_obj = dateUtil.parseDate("EEE, dd MMM yyyy hh:mm:ss Z", .vars['reserved-article-modified-date'].data, localeUtil.getSiteDefault()) > 
116<#assign last_modified_date = dateUtil.getDate(last_modified_date_obj, "dd MMM yyyy z", locale) > 
117 
118<p> 
119	last modified by ${.vars['reserved-article-author-name'].data} 
120	on 
121	${last_modified_date} 
122</p> 
123 
124 
125<p> 
126	<#assign categories=articleHelper.getCategories() > 
127	<#if categories?has_content > 
128	<b>categories:</b> 
129	<#list articleHelper.getCategories() as cat > 
130		${cat.getTitle(locale)}<#if cat?has_next>, </#if> 
131	</#list> 
132	</#if> 
133</p> 
134 
135	<#assign tags=articleHelper.getVisibleTags() > 
136	<#if tags?has_content > 
137	<b>tags:</b> 
138	<#list tags as tag > 
139		${tag.getName()}<#if tag?has_next>, </#if> 
140	</#list> 
141	</#if> 
142</p> 
143 
144<p>${content.getData()}</p> 
145 
146<#if preview?? && preview?is_boolean && preview == true>  
147	<script type="text/javascript"> 
148	AUI().use("liferay-preview", function() { 
149		new Liferay.Preview({ 
150						actionContent: '#${randomNamespace}_previewFileActions', 
151						baseImageURL: '${preview.previewFileURL}', 
152						boundingBox: '#${randomNamespace}_previewFile', 
153						contentBox: '#${randomNamespace}_previewFileContent', 
154						currentPreviewImage: '#${randomNamespace}_previewFileImage', 
155						imageListContent: '#${randomNamespace}_previewImagesContent', 
156						maxIndex: ${preview.previewFileCount}, 
157						previewFileIndexNode: '#${randomNamespace}_previewFileIndex', 
158						toolbar: '#${randomNamespace}_previewToolbar' 
159		}).render(); 
160	}); 
161	</script> 
162	<div class="lfr-preview-file" id="${randomNamespace}_previewFile"> 
163		<div class="lfr-preview-file-content" id="${randomNamespace}_previewFileContent"> 
164			<div class="lfr-preview-file-image-current-column"> 
165				<div class="lfr-preview-file-image-container"> 
166					<img class="lfr-preview-file-image-current" id="${randomNamespace}_previewFileImage" src="${preview.previewFileURL}1" /> 
167				</div> 
168				<span class="lfr-preview-file-actions aui-helper-hidden" id="${randomNamespace}_previewFileActions">  
169					<span class="lfr-preview-file-toolbar" id="${randomNamespace}_previewToolbar"></span>  
170					<span class="lfr-preview-file-info">  
171						<span class="lfr-preview-file-index" id="${randomNamespace}_previewFileIndex">1</span>  
172						of  
173						<span class="lfr-preview-file-count">${preview.previewFileCount}</span> 
174					</span> 
175				</span> 
176			</div> 
177 
178			<div class="lfr-preview-file-images" id="${randomNamespace}_previewImagesContent"> 
179							<div class="lfr-preview-file-images-content"></div> 
180			</div> 
181		</div> 
182	</div> 
183</#if> 
184<br> 
185 
186 
187<p> 
188<#-- 
189## print /eqb original source url if exists, print DL assets else 
190## --> 
191<#if url.getData() != "" > 
192 
193    <#assign url_title="Methodology Book"> 
194	<h3>Download file</h3> 
195	<#list assetHelper.getLinkedFiles() as file > 
196		<#assign url_title=file.getTitle() > 
197	</#list> 
198	<a href="${url.getData()}">${url_title}</a>		 
199 
200<#elseif (assetHelper.getLinkedFiles()?size > 0) > 
201 
202	<h3>Download file</h3> 
203	<#list assetHelper.getLinkedFiles() as file > 
204		<#--${file.getDLFileEntry()} --> 
205		<a target="_blank" href="${themeDisplay.getPortalURL()}${themeDisplay.getPathContext()}/documents/${file.getGroupId()}/${file.getUuid()}">${file.getTitle()}</a>		 
206		<br> 
207	</#list> 
208</#if> 
209</p> 
210<#--themeDisplay: ${themeDisplay}--> 
211<#--<liferay-ui:input-resource url='<%= themeDisplay.getPortalURL() + themeDisplay.getPathContext() + "/documents/" + themeDisplay.getScopeGroupId() + StringPool.SLASH + fileEntry.getUuid() %>'/>--> 
212 
213</#if>