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