@CSC Online Magazine has moved

Find our latest articles at www.csc.fi/articles.

This site is an archive version and is no longer updated.
 

Go to CSC Articles

Content with @CSC Knowledge Management .

An error occurred while processing the template.
Java method "static com.liferay.asset.publisher.web.util.AssetPublisherHelper.getAssetViewURL(com.liferay.portal.kernel.portlet.LiferayPortletRequest, com.liferay.portal.kernel.portlet.LiferayPortletResponse, com.liferay.asset.kernel.model.AssetEntry)" threw an exception; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign rssURL = assetPublisherHelper...  [in template "10154#10192#229836" at line 3, column 1]
----
1<#assign mainArticle = true/> 
2<#assign makeList = true/> 
3<#assign rssURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, entry) /> 
4 
5<#list entries as entry> 
6    <#assign entry = entry /> 
7    <#assign assetRenderer = entry.getAssetRenderer() /> 
8 
9    <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, entry) /> 
10    <#if assetLinkBehavior != "showFullContent"> 
11        <#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
12    </#if> 
13    <#assign article = entry.getAssetRenderer().getArticle()/> 
14    <#assign document = saxReaderUtil.read(article.getContentByLocale(locale.toString())) /> 
15    <#assign categories = entry.getCategories() /> 
16    <#assign headline = document.valueOf("//dynamic-element[@name='Headline']/dynamic-content/text()") /> 
17    <#assign summary = htmlUtil.escape(assetRenderer.getSummary(locale)) /> 
18    <#assign imageUrl = document.valueOf("//dynamic-element[@name='Main_Image']/dynamic-content/text()") /> 
19    <#assign current_page = paramUtil.getInteger(renderRequest, "cur", 1)> 
20 
21    <#if mainArticle && current_page == 1> 
22    <div class="csc-article-main"> 
23        <div class="csc-article"> 
24            <div class="article-content clearfix"> 
25                <!--<section class="image"> 
26                    <a class="article-img-link" href="${viewURL}"> 
27                        <img class="article-image" src="${imageUrl}"/> 
28                    </a> 
29                </section>--> 
30 
31                <section class="text"> 
32                    <h3>${headline}</h3> 
33 
34                    <small><@getMetadataField fieldName="publish-date" /></small> 
35                    <p class="article-summary">${summary}</p> 
36 
37                    <p class="article-read"><strong><a href="${viewURL}"><@liferay.language key="read-more" /> 
38                        »</a></strong></p> 
39                </section> 
40            </div> 
41 
42            <div class="article-categories clearfix"> 
43                <#list categories as category> 
44                    <#if category.getGroupId() == groupId> <#-- only display categories from current site --> 
45                        <#assign categoryTitle = category.getTitle("en_US", true) /> 
46                        <#assign categoryClass = categoryTitle?lower_case/> 
47                        <#assign categoryClass = categoryClass?replace("[^\\d\\w]", "-", "r")/> 
48                        <div class="atcsc-category ac-${categoryClass}">${category.getTitle(locale.toString(), true)}</div> 
49                    </#if> 
50                </#list> 
51            </div> 
52        </div> 
53    </div> 
54        <#assign mainArticle = false> 
55    <#else> 
56        <#assign liferay_portlet = taglibLiferayHash["/META-INF/liferay-portlet.tld"] /> 
57        <#if makeList> 
58        <div class="csc-article-list <@liferay_portlet.namespace />container"> 
59            <#assign makeList = false> 
60        </#if> 
61 
62        <div class="csc-article"> 
63            <div class="article-content"> 
64                <!--<section class="image"> 
65                    <#assign img = ""/> 
66 
67                    <#if article.getSmallImage()> 
68                        <#assign img = article.getSmallImageURL() > 
69 
70                        <#if img == ""> 
71                            <#assign img = themeDisplay.getPathImage() + "/journal/article?img_id=" + 
72                            article.getSmallImageId() + "&t=" + 
73                            imageToken.getToken(article.getSmallImageId())> 
74                        </#if> 
75                    </#if> 
76 
77                    <#if img == ""> 
78                        <#assign img = "${imageUrl}"/> 
79                    </#if> 
80 
81                    <a class="article-img-link" href="${viewURL}"> 
82                        <img class="article-image" src="${img}"/> 
83                    </a> 
84                </section>--> 
85 
86                <section class="text"> 
87                    <h3>${headline}</h3> 
88 
89                    <small><@getMetadataField fieldName="publish-date" /></small> 
90                    <p class="article-summary">${summary}</p> 
91 
92                    <p class="article-read"><strong><a href="${viewURL}"><@liferay.language key="read-more" /> »</a></strong></p> 
93                </section> 
94            </div> 
95 
96            <div class="article-categories clearfix"> 
97                <#list categories as category> 
98                    <#if category.getGroupId() == groupId> <#-- only display categories from current site --> 
99                        <#assign categoryTitle = category.getTitle("en_US", true) /> 
100                        <#assign categoryClass = categoryTitle?lower_case/> 
101                        <#assign categoryClass = categoryClass?replace("[^\\d\\w]", "-", "r")/> 
102 
103                        <#assign categoryId = category.getCategoryId() /> 
104                        <#assign portletURL = renderResponse.createRenderURL() /> 
105                    ${portletURL.setParameter("resetCur", "TRUE")} 
106                    ${portletURL.setParameter("categoryId", categoryId?string)} 
107 
108                        <a href="${portletURL}"> 
109                            <div class="atcsc-category ac-${categoryClass}">${category.getTitle(locale.toString(), true)}</div> 
110                        </a> 
111                    </#if> 
112                </#list> 
113            </div> 
114        </div> 
115    </#if> 
116</#list> 
117</div> 
118 
119<script type="text/javascript"> 
120    var container = document.querySelector('.csc-article-list'); 
121    var msnry; 
122 
123    // initialize Masonry after all images have loaded 
124    imagesLoaded( container, function() { 
125        msnry = new Masonry( container ); 
126    }); 
127 
128    var viewUrl = "${rssURL}"; 
129    var c = viewUrl.indexOf("/content/"); 
130    if (c > 0) { 
131        var urlStart = viewUrl.substring(0, c); 
132        var rssFeedUrl = urlStart + "/rss?p_p_cacheability=cacheLevelFull"; 
133        if ($('.atcsc-rss-text-container').length) { 
134            $('.atcsc-rss-text-container').children('a[href]').attr('href', rssFeedUrl); 
135
136
137 
138</script> 
139 
140 
141 
142<#macro getMetadataField fieldName> 
143    <#if stringUtil.split(metadataFields)?seq_contains(fieldName)> 
144    <span class="metadata-entry metadata-"${fieldName}"> 
145        <#assign dateFormat = "dd.MM.yyyy" /> 
146 
147        <#if fieldName == "author"> 
148            <@liferay.language key="by" /> ${portalUtil.getUserName(assetRenderer.getUserId(), assetRenderer.getUserName())} 
149        <#elseif fieldName == "categories"> 
150            <@liferay_ui["asset-categories-summary"] 
151            className=entry.getClassName() 
152            classPK=entry.getClassPK() 
153            portletURL=renderResponse.createRenderURL() 
154            /> 
155        <#elseif (fieldName == "create-date" && entry.getCreateDate()??)> 
156        ${dateUtil.getDate(entry.getCreateDate(), dateFormat, locale)} 
157        <#elseif (fieldName == "expiration-date" && entry.getExpirationDate()??)> 
158        ${dateUtil.getDate(entry.getExpirationDate(), dateFormat, locale)} 
159        <#elseif (fieldName == "modified-date" && entry.getModifiedDate()??)> 
160        ${dateUtil.getDate(entry.getModifiedDate(), dateFormat, locale)} 
161        <#elseif fieldName == "priority"> 
162        ${entry.getPriority()} 
163        <#elseif (fieldName == "publish-date" && entry.getPublishDate()??)> 
164        ${dateUtil.getDate(entry.getPublishDate(), dateFormat, locale)} 
165        <#elseif fieldName == "tags"> 
166            <@liferay_ui["asset-tags-summary"] 
167            className=entry.getClassName() 
168            classPK=entry.getClassPK() 
169            portletURL=renderResponse.createRenderURL() 
170            /> 
171        <#elseif fieldName == "view-count"> 
172            <@liferay_ui["icon"] 
173            image="history" 
174            /> 
175 
176        ${entry.getViewCount()} <@liferay.language key="views" /> 
177        </#if> 
178    </span> 
179    </#if> 
180</#macro>