Military Life Cycle | Your Life in the Military

Confidently navigate life in the military – from basic training to separation and transition and all the steps in between.

An error occurred while processing the template.
Java method "com.liferay.portal.json.JSONFactoryImpl.createJSONObject(String)" threw an exception when invoked on com.liferay.portal.json.JSONFactoryImpl object "com.liferay.portal.json.JSONFactoryImpl@36b0d7d8"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign imgJson = jsonFactoryUtil.cre...  [in template "20155#20195#3749413" at line 22, column 29]
----
1<div class="article-list page-width padding-large" multi-app="portal" data-ng-controller="ViewMore" ng-init="initialize(${entries?size})"> 
2    <#--Getting current page for view more URL--> 
3    <#assign curLay = themeDisplay.getLayout().getNameCurrentValue()> 
4    <#assign keyword = curLay?replace(" ", "%20")?replace("&", "%26")?replace("+", "%20")> 
5    <#assign currentPortalUrl = themeDisplay.getPortalURL()> 
6    <#assign searchURL = "${currentPortalUrl}/search#!/${keyword}?searchText=${keyword}"> 
7 
8    <h2 class="section-heading"><span class="red-line"></span>Latest Content</h2> 
9    <#if entries?has_content> 
10        <#assign viewIterator = 0> 
11        <#list entries as curEntry> 
12                <#assign renderer=curEntry.getAssetRenderer() /> 
13                <#assign className=renderer.getClassName() /> 
14                <#if className=="com.liferay.journal.model.JournalArticle"> 
15                    <#assign journalArticle=renderer.getArticle() /> 
16                    <#assign document=saxReaderUtil.read(journalArticle.getContent()) /> 
17                    <#assign rootElement=document.getRootElement() /> 
18                    <#if rootElement?has_content> 
19                        <#assign xPathSelector=saxReaderUtil.createXPath("dynamic-element[@name='Image']") /> 
20                        <#if xPathSelector.selectSingleNode(rootElement)?has_content> 
21                            <#assign imgNews=xPathSelector.selectSingleNode(rootElement).getStringValue() /> 
22                            <#assign imgJson = jsonFactoryUtil.createJSONObject(imgNews)> 
23                            <#assign image = "/documents/"+ imgJson.groupId +"/"+ imgJson.title +"/"+imgJson.uuid > 
24                            <#assign altText = ""> 
25                            <#if image??> 
26                                <#assign imgID = imgJson.uuid> 
27                                <#assign fileEntry = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"]> 
28                                <#assign metadata2 = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryMetadataLocalServiceUtil"]> 
29                                <#assign type = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryTypeLocalServiceUtil"]> 
30                                <#assign file = fileEntry.getFileEntryByUuidAndGroupId(imgID, groupId) > 
31                                <#assign dlFileEntryType = type.getFileEntryType(file.fileEntryTypeId) > 
32                                <#assign ddmStructures = dlFileEntryType.getDDMStructures()> 
33                                <#assign valuesMap = file.getDDMFormValuesMap(file.getLatestFileVersion(true).getFileVersionId())> 
34                                <#assign keys = valuesMap?keys> 
35                                <#if valuesMap.containsKey("documentSource")> 
36                                     <#if valuesMap.get("documentSource")?has_content> 
37                                        <#assign source = valuesMap.get("documentSource")> 
38                                        <#assign sourceExists = true> 
39                                     </#if> 
40                                     <#elseif valuesMap.containsKey("altText") && valuesMap.get("altText")??> 
41                                        <#assign altText = 'alt="' + valuesMap.get("altText") + '"'> 
42                                </#if>	 
43                                <#assign image = "/documents/"+ imgJson.groupId +"/"+ file.getFileEntryId() +"/" + file.getFileName() + "/"+imgJson.uuid > 
44                            </#if> 
45                            <#assign xPathSelector=saxReaderUtil.createXPath("dynamic-element[@name='Text']") /> 
46                            <#assign text=xPathSelector.selectSingleNode(rootElement).getStringValue() /> 
47                            <#assign title = curEntry.getTitle(locale)/> 
48                            <#assign summary = curEntry.getDescription(locale)/> 
49                            <#assign viewCount = curEntry.getViewCount()> 
50                            <#assign modifyDate = curEntry.getModifiedDate()?date> 
51                            <#assign modifyTime = curEntry.getModifiedDate()?time> 
52                            <#assign totalWords = text?length / 5> 
53                            <#assign wordsPerMin = totalWords/250?round> 
54                            <#if viewIterator < 5> 
55                                <#assign viewGroup = 0> 
56                            <#elseif viewIterator < 15> 
57                                <#assign viewGroup = 1> 
58                            <#elseif viewIterator < 25> 
59                                <#assign viewGroup = 2> 
60                            <#elseif viewIterator < 35> 
61                                <#assign viewGroup = 3> 
62                            <#elseif viewIterator < 45> 
63                                <#assign viewGroup = 4> 
64                            <#elseif viewIterator < 55> 
65                                <#assign viewGroup = 5> 
66                            <#elseif viewIterator < 65> 
67                                <#assign viewGroup = 6> 
68                            <#else> 
69                                <#assign viewGroup = 7> 
70                            </#if> 
71                            <div class="article" ng-if="displayAmount[${viewGroup}]"> 
72                                <a href="${assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry, true)}"> 
73                                    <div class="row grid"> 
74                                        <div class="col-sm-3 col-xs-12"> 
75                                            <div class="circular-image" style='background-image:url("${image}")'> 
76                                                <img src="${image}" ${altText}> 
77                                            </div> 
78                                        </div> 
79                                        <div class="col-sm-1 col-xs-12 empty"></div> 
80                                        <div class="col-xs-12 col-sm-8"> 
81                                            <div class="article-info"> 
82                                                <h3>${title}</h3> 
83                                                <div class="metadata"> 
84                                                    ${modifyDate?string.long} @ ${modifyTime?string.short}<span class="seperator"> | </span>${wordsPerMin?string["0"]} Min Read<span class="seperator"> | </span>${viewCount} Views 
85                                                </div> 
86                                                <p>${summary}</p> 
87                                            </div> 
88                                        </div> 
89                                    </div> 
90                                </a> 
91                                <div class="clearfix"></div> 
92                                <#assign assetRenderer = curEntry.getAssetRenderer()> 
93                                <#assign article = assetRenderer.getArticle()> 
94                                <#assign entryTitle = htmlUtil.escape(assetRenderer.getTitle(locale))/> 
95                                <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())> 
96                                    <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("NORMAL"), themeDisplay.getURLCurrent())!"" /> 
97 
98                                    <#if validator.isNotNull(editPortletURL)> 
99                                        <#assign title = languageUtil.format(locale, "edit-x", entryTitle, false) /> 
100 
101                                        <@liferay_ui["icon"] 
102                                            cssClass="icon-monospaced visible-interaction" 
103                                            icon="pencil" 
104                                            markupView="lexicon" 
105                                            message=title 
106                                            url=editPortletURL.toString() 
107                                        /> 
108                                    </#if> 
109                                </#if> 
110                            </div> 
111                        </#if> 
112                    </#if> 
113                </#if> 
114            <#assign viewIterator = viewIterator + 1> 
115        </#list> 
116    </#if> 
117    <button class="filled-button blue" data-event="active" data-category="latest content" data-action="click button" data-label="view more" ng-click="viewMoreClicked()" ng-if="displayViewMoreButton"> 
118        View More 
119    </button> 
120    <a role="button" class="filled-button blue search-all" href="${searchURL}" ng-if="viewSearchButton"> 
121        <div>Search All</div> 
122    </a> 
123</div> 
124<script> 
125    $(window).on('beforeunload', function() { 
126        $('body').hide(); 
127        $(window).scrollTop(0); 
128    }); 
129</script>