Student Research Reports
An error occurred while processing the template.
Failed to "?eval_json" string with this error: ---begin-message--- Empty JSON (contains no value) Error location: At the end of text. ---end-message--- The failing expression: ==> (authOrg.getData())?eval_json [in template "10132#10165#GLOBE-PROJECT-TEMPLATE" at line 30, column 24] ---- FTL stack trace ("~" means nesting-related): - Failed at: dataJson = (authOrg.getData())?eval_json [in template "10132#10165#GLOBE-PROJECT-TEMPLATE" at line 30, column 13] ----
1<#assign
2 orgArray = []
3 countryArray = []
4 userArray = []
5 badgeArray = []
6 languageArray = []
7 protocolArray = []
8 reportTypesArray = []
9 orgLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
10 userLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")
11 groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")
12 userGroupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserGroupLocalService")
13 idLocalService = serviceLocator.findService("gov.globe.util.idlookup.service.IDLookupLocalService")
14 assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
15 globeDataService = serviceLocator.findService("gov.globe.util.services.GLOBE_DataServiceUtil")
16 globeMemberId = idLocalService.getId("globe.usergroupid.globe_members")
17 approvedUSId = idLocalService.getId("globe.usergroupid.account_approved_us")
18 preCandidateUSId = idLocalService.getId("globe.usergroupid.precandidate_us")
19 candidateId = idLocalService.getId("globe.usergroupid.candidates")
20 projectDate = getterUtil.getString(project_date.getData())
21 reportType = ""
22 accountType = ""
23 videoLink = ""
24 presentationLink = ""
25/>
26
27<#if (project_authororganization.getSiblings()?has_content)>
28 <#list project_authororganization.getSiblings() as authOrg >
29 <#assign
30 dataJson = (authOrg.getData())?eval_json
31 accountType = "regular"
32 organizationId = dataJson.organizationid
33 orgTeacherJsonArray = dataJson.teachers
34 />
35 <#if (dataJson.account_type??)>
36 <#if (dataJson.account_type?length > 0)>
37 <#assign accountType = dataJson.account_type />
38 </#if>
39 </#if>
40
41 <#if (organizationId?length > 0)>
42 <#assign
43 organizationId = organizationId?eval
44 org = orgLocalService.getOrganization(organizationId)
45 orgName = org.getName()
46 group = org.getGroup()
47 orgURL = group.getFriendlyURL()
48 orgLink = "<a href='/web${orgURL}' target='_blank'>${orgName}</a>"
49 />
50 <#if (!orgArray?seq_contains(orgLink))>
51 <#assign orgArray = orgArray + [orgLink] />
52 </#if>
53 <#attempt >
54 <#list orgLocalService.getParentOrganizations(organizationId) as parentOrg >
55 <#if parentOrg.getType() == "country_organization" >
56 <#assign countryLink = "<a href='/web${parentOrg.getGroup().getFriendlyURL()}' target='_blank'>${parentOrg.getName()}</a>" />
57 <#if (!countryArray?seq_contains(countryLink))>
58 <#assign countryArray = countryArray + [countryLink] />
59 </#if>
60 <#break >
61 </#if>
62 </#list>
63 <#recover >
64 </#attempt>
65 </#if>
66
67 <#list orgTeacherJsonArray as teacher>
68 <#attempt >
69 <#assign
70 userid = teacher.userid?eval
71 user = userLocalService.getUser(userid)
72 userLink = "${user.getFullName()} (inactive)"
73 />
74
75 <#if user.isActive() >
76 <#assign userLink = "${user.getFullName()}" />
77 <#if (userGroupLocalService.hasUserUserGroup(user.getUserId(), globeMemberId)
78 || userGroupLocalService.hasUserUserGroup(user.getUserId(), approvedUSId)
79 || userGroupLocalService.hasUserUserGroup(user.getUserId(), preCandidateUSId)
80 || userGroupLocalService.hasUserUserGroup(user.getUserId(), candidateId)) >
81
82 <#assign
83 groupUser = groupLocalService.getGroup(user.getGroup().getGroupId())
84 userLink = "<a href='/web${groupUser.getFriendlyURL()}' target='_blank'>${user.getFullName()}</a>"
85 />
86 </#if>
87 </#if>
88 <#if userArray?? >
89 <#if !userArray?seq_contains(userLink) >
90 <#assign userArray = userArray + [userLink] />
91 </#if>
92 </#if>
93
94 <#recover >
95 <#-- No user found - use name instead -->
96 <#assign userArray = userArray + [teacher.name?trim] />
97 </#attempt>
98 </#list>
99 </#list>
100</#if>
101
102<#if (project_badges?has_content && project_badges.getChildren()?has_content)>
103 <#list project_badges.getChildren() as badge >
104 <#if (badge.getData()?has_content && badge.getData()?eval) >
105 <#assign badgeArray = badgeArray + [languageUtil.get(locale, badge.getName())] />
106 </#if>
107 </#list>
108</#if>
109
110<#if (project_report_type_2?has_content) >
111 <#-- this is the NEW way of specifying report types -->
112 <#list project_report_type_2.getChildren() as reportTypeObj >
113 <#if (reportTypeObj.getData()?has_content && (reportTypeObj.getName() == "ivss_report" || reportTypeObj.getName() == "mission_earth_report")) >
114 <#assign reportType = reportTypeObj.getName() />
115 </#if>
116 <#if (reportTypeObj.getData()?has_content && reportTypeObj.getData()?eval) >
117 <#switch reportTypeObj.getName() >
118 <#case "ivss_report">
119 <#assign reportTypesArray = reportTypesArray + ["International Virtual Science Symposium Report"] />
120 <#break >
121 <#case "standard_research_report">
122 <#assign reportTypesArray = reportTypesArray + ["Standard Research Report"] />
123 <#break >
124 <#case "mission_earth_report">
125 <#assign reportTypesArray = reportTypesArray + ["Mission Earth Report"] />
126 <#break >
127 <#case "mission_mosquito_report">
128 <#assign reportTypesArray = reportTypesArray + ["Mission Mosquito Report"] />
129 <#break >
130 <#case "student_research_symposia_report">
131 <#assign reportTypesArray = reportTypesArray + ["U.S. Student Research Symposia (SRS)"] />
132 <#break >
133 </#switch>
134 </#if>
135 </#list>
136
137<#elseif (type_student_report?has_content) >
138 <#-- this is the OLD way of specifying the report type -->
139 <#assign project_report_type = type_student_report.getChild("project_report_type") />
140 <#if (project_report_type.getData() == "science_fair_report") >
141 <#assign
142 reportType = "ivss_report"
143 reportTypesArray = reportTypesArray + ["International Virtual Science Symposium Report"]
144 />
145 <#elseif (project_report_type.getData() == "standard_report") >
146 <#assign
147 reportType = "standard_research_report"
148 reportTypesArray = reportTypesArray + ["Standard Research Report"]
149 />
150 <#elseif (project_report_type.getData() == "mission_earth_report") >
151 <#assign
152 reportType = "mission_earth_report"
153 reportTypesArray = reportTypesArray + ["Mission Earth Report"]
154 />
155 </#if>
156</#if>
157
158<#if report_language?has_content >
159 <#list report_language.getChildren() as language>
160 <#if (language.getData()?has_content && language.getData()?eval) >
161 <#if (language.getName() == "other") >
162 <#assign otherLanguage = language.getChild("other_string") />
163 <#if (otherLanguage.getData()?has_content) >
164 <#assign languageArray = languageArray +
165 [stringUtil.upperCaseFirstLetter(language.getName()) +
166 " (" + otherLanguage.getData() + ")"] />
167 </#if>
168 <#else>
169 <#assign languageArray = languageArray + [stringUtil.upperCaseFirstLetter(language.getName())] />
170 </#if>
171 </#if>
172 </#list>
173</#if>
174
175<#if protocol_checkboxes?has_content && protocol_checkboxes.getData()?has_content >
176 <#assign protocolIdsJsonArray = (protocol_checkboxes.getData())?eval_json />
177 <#list protocolIdsJsonArray as protocolId >
178 <#attempt>
179 <#assign
180 category = assetCategoryLocalService.getCategory(protocolId?eval)
181 protocolArray = protocolArray + [category.getName()]
182 />
183 <#recover>
184 <#-- if the protocol doesn't exist, check the deactivated list -->
185 <#assign deactivatedName = globeDataService.getDeactivatedProtocolName(protocolId?eval) />
186 <#if deactivatedName?? >
187 <#assign protocolArray = protocolArray + [deactivatedName + " (Deactivated)"] />
188 </#if>
189 </#attempt>
190 </#list>
191</#if>
192
193<#if (proejct_video_url??) >
194 <#if (proejct_video_url.getData()?has_content) >
195 <#assign videoLink = proejct_video_url.getData() />
196 </#if>
197</#if>
198
199<#if (project_poster_presentation??) >
200 <#if (project_poster_presentation.getData()?has_content) >
201 <#assign presentationLink = project_poster_presentation.getData() />
202 </#if>
203</#if>
204
205<#if (project_presentation?has_content) >
206 <#if project_presentation.getChild("proejct_video_url")??>
207 <#assign
208 proejct_video_url = project_presentation.getChild("proejct_video_url")
209 videoLink = proejct_video_url.getData()
210 />
211 </#if>
212 <#if project_presentation.getChild("project_poster_presentation")??>
213 <#assign
214 project_poster_presentation = project_presentation.getChild("project_poster_presentation")
215 presentationLink = project_poster_presentation.getData()
216 />
217 </#if>
218</#if>
219
220<#assign
221 organizations = stringUtil.merge(orgArray, ", ")
222 countries = stringUtil.merge(countryArray, ", ")
223 users = stringUtil.merge(userArray, ", ")
224 badges = stringUtil.merge(badgeArray, ", ")
225 languages = stringUtil.merge(languageArray, ", ")
226 reportTypes = stringUtil.merge(reportTypesArray, ", ")
227 protocols = stringUtil.merge(protocolArray, ", ")
228 projectImageUrl = project_thumbnail_image.getData()
229/>
230<#if (validator.isNull(projectImageUrl)) >
231 <#assign
232 projectImageUrl = "/o/gov-globe-main-theme/images/GLOBE_student_reports_thumbnail.jpg"
233 />
234</#if>
235
236<style type="text/css" >
237 #report-container #report-details-container {
238 display: flex;
239 }
240 #report-container #report-details-container #report-details {
241 flex: 1;
242 }
243 #report-container #report-details-container .report-data-row {
244 padding-bottom: 7px;
245 }
246 #report-container #report-details-container .report-data-row .report-data-title {
247 font-weight: 700;
248 }
249 #report-container #report-details-container .report-data-row .report-data-value {
250 padding:0px 10px;
251 }
252 #report-container #report-image img {
253 width: 100%;
254 height: auto;
255 }
256 #report-container #report-url-description {
257 margin: 20px 0 0;
258 }
259 #report-container #report-url-description #report-description {
260 margin-top: 20px;
261 }
262</style>
263
264<div id="report-container">
265 <h2 style="padding-bottom:10px;">${project_title.getData()}</h2>
266 <div id="report-details-container" class="row">
267 <div id="report-details" class="col-12 col-sm order-2 order-sm-0">
268 <div class="report-data-row" ><span class="report-data-title" >Organization(s):</span><span class="report-data-value" >${organizations}</span></div>
269 <div class="report-data-row" ><span class="report-data-title" >Country:</span><span class="report-data-value" >${countries}</span></div>
270 <div class="report-data-row" ><span class="report-data-title" >Student(s):</span><span class="report-data-value" >${project_authors.getData()}</span></div>
271 <div class="report-data-row" ><span class="report-data-title" >Grade Level:</span><span class="report-data-value" >${languageUtil.get(locale, project_grade.getData())}</span></div>
272
273 <div class="report-data-row" ><span class="report-data-title" >
274 <#if (accountType == 'obs_cs' || accountType == 'obs_school')>
275 Educator(s):</span><span class="report-data-value">${users}</span></div>
276 <#else>
277 GLOBE Educator(s):</span><span class="report-data-value">${users}</span></div>
278 </#if>
279
280 <div class="report-data-row" ><span class="report-data-title" >Contributors:</span><span class="report-data-value" >${project_additional_authors.getData()}</span></div>
281 <div class="report-data-row" ><span class="report-data-title" >Report Type(s):</span><span class="report-data-value" >${reportTypes}</span></div>
282 <div class="report-data-row" ><span class="report-data-title" >Protocols:</span><span class="report-data-value" >${protocols}</span></div>
283
284 <#if (reportType == "ivss_report" || reportType == "mission_earth_report") >
285 <#if (videoLink?has_content && videoLink?length > 0) >
286 <#if (!stringUtil.startsWith(videoLink, "http://") && !stringUtil.startsWith(videoLink, "https://")) >
287 <#assign videoLink = "http://" + videoLink />
288 </#if>
289 <div class="report-data-row">
290 <span class="report-data-title">Presentation Video:</span><span
291 class="report-data-value" >
292 <a href="${videoLink}" target="_blank">View Video</a>
293 </span>
294 </div>
295 </#if>
296
297 <#if (presentationLink?has_content && presentationLink?length > 0) >
298 <div class="report-data-row">
299 <span class="report-data-title">Presentation Poster:</span><span
300 class="report-data-value">
301 <a href="${presentationLink}" target="_blank">View Document</a>
302 </span>
303 </div>
304 </#if>
305 </#if>
306 <#-- GLOBE-7038: Hide Optional Badges from SRR Detail Page -->
307<#-- <#if (reportType == "ivss_report") >-->
308<#-- <div class="report-data-row">-->
309<#-- <span class="report-data-title">Optional Badges:</span><span -->
310<#-- class="report-data-value" >${badges}</span>-->
311<#-- </div>-->
312<#-- </#if>-->
313 <div class="report-data-row" >
314 <span class="report-data-title" >Language(s):</span><span
315 class="report-data-value" >${languages}</span>
316 </div>
317 <div class="report-data-row" >
318 <span class="report-data-title" >Date Submitted:</span><span
319 class="report-data-value" >${projectDate}</span>
320 </div>
321 </div>
322 <div id="report-image" class="col-12 col-sm-5 col-md-4 order-1 text-center pb-4">
323 <img src="${projectImageUrl}" alt="${project_thumbnail_alt_tag.getData()}" onerror="this.src='/o/gov-globe-main-theme/images/GLOBE_news_and_events_thumbnail.jpg'">
324 </div>
325 </div>
326 <div id="report-url-description">
327 <#if (project_linkto_document.getData() != "")>
328 <div >
329 <a href="${project_linkto_document.getData()}" target="_blank"><b>View Research Report</b></a><br>
330 </div>
331 </#if>
332 <div id="report-description">
333 ${project_description.getData()}
334 </div>
335 </div>
336</div>