Publications MISC - TITLE

Articles in the scientific literature: Miscellaneous

Asset Publisher

An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy107.getUser(long)" threw an exception when invoked on com.sun.proxy.$Proxy107 object "com.liferay.message.boards.internal.service.MBMessageUserLocalServiceWrapper@7079cce4"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${userLocalService.getUser(assetLink...  [in template "20099#20135#34911045" at line 96, column 155]
----
1<#function getFieldValue key valuesList> 
2    <#local result = ""/> 
3    <#list valuesList as value> 
4        <#if key == value.getName()> 
5            <#local result = value.getValue().getString(locale) /> 
6        </#if> 
7    </#list> 
8    <#return result> 
9</#function> 
10 
11<#function getReference valuesList> 
12    <#local result = ""/> 
13    <#local publication = getFieldValue("publication",valuesList)/> 
14    <#local datePublication = getFieldValue("date_pub",valuesList)/> 
15    <#local page = getFieldValue("page",valuesList)/> 
16    <#local result = publication + " (" + datePublication + ") " + page /> 
17    <#return result> 
18</#function> 
19 
20<#assign namespace = randomNamespace /> 
21 
22<div class="bipm-reports"> 
23    <div class="row documents_filter" > 
24        <div class="col-12 col-md-auto"> 
25            <p class="bipm-reports__label-filter"><@liferay.language key="documents.filter.search.filter" /> :</p> 
26        </div> 
27        <div class="col-12 col-sm-auto"> 
28            <div class="form-group"> 
29                <label class="bipm-reports__label"><@liferay.language key="documents.filter.year" /></label> 
30                <select class="bipm-reports__select documents_filter_date_pub" data-col-def-name="date_pub" data-col-def-reverse="true"> 
31                    <option value=""></option> 
32                </select> 
33            </div> 
34        </div> 
35        <div class="col-12 col-sm-auto"> 
36            <div class="form-group"> 
37                <label class="bipm-reports__label"><@liferay.language key="documents.filter.department" /></label> 
38                <select  class="bipm-reports__select documents_filter_dept_code" data-col-def-name="dept_code"> 
39                    <option value=""></option> 
40                </select> 
41            </div> 
42        </div> 
43    </div> 
44 
45    <div class="documents_list publications"> 
46        <#if entries?has_content> 
47            <#assign entityAssetsService = serviceLocator.findService("org.bipm.portal.service.entity.assets.service.BipmEntityAssetsService")/> 
48            <#assign bipmCommonsService = serviceLocator.findService("org.bipm.portal.service.commons.asset.service.BipmAssetService")/> 
49            <#assign assetLinkLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService")/> 
50            <#assign userLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")/> 
51            <#assign sortedEntries = bipmCommonsService.sortEntriesByFields(entries,"date_pub,publication",locale,true,portletPreferences)/> 
52            <#list sortedEntries as entry> 
53                <#assign assetRenderer = entry.getAssetRenderer() /> 
54                <#assign className = assetRenderer.getClassName() /> 
55                <#assign 
56                ddmFormValuesReader = assetRenderer.getDDMFormValuesReader() 
57                ddmFormValues = ddmFormValuesReader.getDDMFormValues() 
58                /> 
59                <#assign typeCategories = entityAssetsService.getBipmPublicationCategories(themeDisplay,entry,"bipm publication types")/> 
60                <#assign type = ""/> 
61                <#if typeCategories?has_content> 
62                    <#assign type = typeCategories[0]/> 
63                </#if> 
64                <#assign dataAttribute = ""/> 
65                <#list ddmFormValues.getDDMFormFieldValues() as formValue> 
66                    <#assign dataAttribute = dataAttribute + " data-"+formValue.getName()+"=\""+ htmlUtil.escape(formValue.getValue().getString(locale))+"\""   /> 
67                </#list> 
68                <#assign 
69                fileUrl = getFieldValue("url",ddmFormValues.getDDMFormFieldValues()) 
70                target = " target=\"blank\"" 
71                /> 
72 
73                <#if !fileUrl?has_content > 
74                    <#assign 
75                    fileUrl = assetRenderer.getURLDownload(themeDisplay) 
76                    target = "" 
77                    /> 
78                </#if> 
79 
80                <#assign infoUserUrl = propsUtil.get("bipm.layout.people.friendly.url") /> 
81 
82                <div ${dataAttribute} class="publications__content"> 
83                    <a class="publication-card_reference title-third" href="${fileUrl}" ${target}> 
84                        ${type} ${getReference(ddmFormValues.getDDMFormFieldValues())} 
85                    </a> 
86                    <p class="publications__body"> 
87                        ${getFieldValue("titre",ddmFormValues.getDDMFormFieldValues())} 
88                    </p> 
89                    <div class="d-none d-lg-block"> 
90                        <p class="publications__subtitle"><@liferay.language key="documents.authors" /></p> 
91                        <#assign renderedObject = assetRenderer.getAssetObject() /> 
92                        <#assign assetAuthorsLinks = assetLinkLocalService.getDirectLinks(renderedObject.getFileEntryId(),2,false) /> 
93                        <#if assetAuthorsLinks?has_content> 
94                            <p class="publications__body mt-0"> 
95                                <#assign number = 0/> 
96                                <#list assetAuthorsLinks as assetLink><a href="${infoUserUrl}?userId=${assetLink.getEntryId2()}"><#if number != 0>, </#if>${userLocalService.getUser(assetLink.getEntryId2()).getFullName()}</a><#assign number = number + 1/></#list> 
97                            </p> 
98                        <#else> 
99                            <p class="publications__body mt-0">${getFieldValue("author",ddmFormValues.getDDMFormFieldValues())}</p> 
100                        </#if> 
101                    </div> 
102                </div> 
103            </#list> 
104        </#if> 
105    </div> 
106    <div class="pagination documents_pagination" data-items-size="10"> 
107 
108    </div> 
109 
110</div> 
111 
112<@liferay_aui.script use="aui-base,liferay-pagination,bipm-list-filter"> 
113    A.all('.bipm-reports').each(function(item){ 
114        var plugin = item.hasPlugin('bipm-list-filter'); 
115        if(plugin){ 
116            return; 
117
118        var filter = item.plug(Liferay.ListFilter, 
119
120                        itemsNodesSelector:'.publications__content', 
121                        parentContainerSelector:'.documents_list', 
122                        filterSelectSelector:'.bipm-reports__select', 
123                        filterContainerSelector:'.documents_filter', 
124                        filterFieldPrefix:'.documents_filter_', 
125                        filterFieldNames:['date_pub','dept_code'], 
126                        filterFieldDefs:[{name:'date_pub',reverse:true}], 
127                        paginationContainerSelector:'.documents_pagination', 
128                        namespace:'${namespace}' 
129                    }); 
130    }); 
131</@>