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 61, column 30]

----
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 61, column 9]
----
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 
60<#if assetHelper??> 
61	<#assign firstFile = assetHelper.getFirstFile() > 
62</#if> 
63<#if firstFile?? > 
64	<#-- #assign preview = assetHelper.getPreviewInfo(assetHelper.getFirstFile()) --> 
65<#else> 
66	<#assign preview = false > 
67</#if> 
68 
69<#if renderFromSearch && ((renderFromSearch?is_boolean && renderFromSearch == true) || (!renderFromSearch?is_boolean && renderFromSearch == 'true'))  >  
70	<#assign viewURL = '#'> 
71    <#if request.getAttribute('VIEW_URL')??> 
72	    <#assign viewURL = request.getAttribute('VIEW_URL') > 
73    </#if> 
74     
75	<#assign queryTerms='' > 
76    <#if request.getAttribute('SEARCH_KEYWORDS')??> 
77	    <#assign queryTerms=request.getAttribute('SEARCH_KEYWORDS') > 
78	</#if> 
79	 
80	<#assign selectedCategories='' > 
81	<#if request.getAttribute('categories')??> 
82	    <#assign selectedCategories=request.getAttribute('categories') > 
83	</#if> 
84	 
85	<#if preview?? && preview?is_hash && preview.previewFileURL?? > 
86		<img src="${preview.previewFileURL}1"  
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);" /> 
88	<#else> 
89		<div  
90		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;" > 
91		<div style="padding: 10px;">No preview available</div> 
92		</div> 
93	</#if> 
94	<div style="margin: 0px 0px 0px 120px"> 
95		<#assign title = .vars['reserved-article-title'].data > 
96		<#assign title = htmlUtil.escape(title) > 
97		<#assign title = stringUtil.highlight(title, queryTerms) > 
98		<h1><a href="${viewURL}">${title}</a></h1> 
99		<p>${stringUtil.highlight(content.getData(), queryTerms)}</p> 
100		<p> 
101			<#assign categories=articleHelper.getCategories() > 
102			<#if categories?has_content > 
103				<b>Categories:</b> 
104				<#list articleHelper.getCategories() as cat > 
105					${cat.getTitle(locale)}<#if cat?has_next>,&nbsp; </#if> 
106				</#list> 
107			</#if> 
108		</p> 
109	</div> 
110	 
111<#else> 
112 
113 
114 
115<h1>${.vars['reserved-article-title'].data}</h1> 
116 
117 
118<#assign  last_modified_date_obj = dateUtil.parseDate("EEE, dd MMM yyyy hh:mm:ss Z", .vars['reserved-article-modified-date'].data, localeUtil.getSiteDefault()) > 
119<#assign last_modified_date = dateUtil.getDate(last_modified_date_obj, "dd MMM yyyy z", locale) > 
120 
121<p> 
122	last modified by ${.vars['reserved-article-author-name'].data} 
123	on 
124	${last_modified_date} 
125</p> 
126 
127 
128<p> 
129	<#assign categories=articleHelper.getCategories() > 
130	<#if categories?has_content > 
131	<b>categories:</b> 
132	<#list articleHelper.getCategories() as cat > 
133		${cat.getTitle(locale)}<#if cat?has_next>, </#if> 
134	</#list> 
135	</#if> 
136</p> 
137 
138	<#assign tags=articleHelper.getVisibleTags() > 
139	<#if tags?has_content > 
140	<b>tags:</b> 
141	<#list tags as tag > 
142		${tag.getName()}<#if tag?has_next>, </#if> 
143	</#list> 
144	</#if> 
145</p> 
146 
147<p>${content.getData()}</p> 
148 
149<#if preview?? && preview?is_boolean && preview == true>  
150	<script type="text/javascript"> 
151	AUI().use("liferay-preview", function() { 
152		new Liferay.Preview({ 
153						actionContent: '#${randomNamespace}_previewFileActions', 
154						baseImageURL: '${preview.previewFileURL}', 
155						boundingBox: '#${randomNamespace}_previewFile', 
156						contentBox: '#${randomNamespace}_previewFileContent', 
157						currentPreviewImage: '#${randomNamespace}_previewFileImage', 
158						imageListContent: '#${randomNamespace}_previewImagesContent', 
159						maxIndex: ${preview.previewFileCount}, 
160						previewFileIndexNode: '#${randomNamespace}_previewFileIndex', 
161						toolbar: '#${randomNamespace}_previewToolbar' 
162		}).render(); 
163	}); 
164	</script> 
165	<div class="lfr-preview-file" id="${randomNamespace}_previewFile"> 
166		<div class="lfr-preview-file-content" id="${randomNamespace}_previewFileContent"> 
167			<div class="lfr-preview-file-image-current-column"> 
168				<div class="lfr-preview-file-image-container"> 
169					<img class="lfr-preview-file-image-current" id="${randomNamespace}_previewFileImage" src="${preview.previewFileURL}1" /> 
170				</div> 
171				<span class="lfr-preview-file-actions aui-helper-hidden" id="${randomNamespace}_previewFileActions">  
172					<span class="lfr-preview-file-toolbar" id="${randomNamespace}_previewToolbar"></span>  
173					<span class="lfr-preview-file-info">  
174						<span class="lfr-preview-file-index" id="${randomNamespace}_previewFileIndex">1</span>  
175						of  
176						<span class="lfr-preview-file-count">${preview.previewFileCount}</span> 
177					</span> 
178				</span> 
179			</div> 
180 
181			<div class="lfr-preview-file-images" id="${randomNamespace}_previewImagesContent"> 
182							<div class="lfr-preview-file-images-content"></div> 
183			</div> 
184		</div> 
185	</div> 
186</#if> 
187<br> 
188 
189 
190<p> 
191<#-- 
192## print /eqb original source url if exists, print DL assets else 
193## --> 
194<#if url.getData() != "" > 
195 
196    <#assign url_title="Methodology Book"> 
197	<h3>Download file</h3> 
198	<#list assetHelper.getLinkedFiles() as file > 
199		<#assign url_title=file.getTitle() > 
200	</#list> 
201	<a href="${url.getData()}">${url_title}</a>		 
202 
203<#elseif (assetHelper.getLinkedFiles()?size > 0) > 
204 
205	<h3>Download file</h3> 
206	<#list assetHelper.getLinkedFiles() as file > 
207		<#--${file.getDLFileEntry()} --> 
208		<a target="_blank" href="${themeDisplay.getPortalURL()}${themeDisplay.getPathContext()}/documents/${file.getGroupId()}/${file.getUuid()}">${file.getTitle()}</a>		 
209		<br> 
210	</#list> 
211</#if> 
212</p> 
213<#--themeDisplay: ${themeDisplay}--> 
214<#--<liferay-ui:input-resource url='<%= themeDisplay.getPortalURL() + themeDisplay.getPathContext() + "/documents/" + themeDisplay.getScopeGroupId() + StringPool.SLASH + fileEntry.getUuid() %>'/>--> 
215 
216</#if>