Our Team

An error occurred while processing the requested resource.
An error occurred while processing the template.
Error on line 65, column 9 in 10153#10191#7998722
PersonaLocalService.getPersona(personaId) is undefined.
It cannot be assigned to persona
1<#-- ### CONSTANTES - IMPORTS - FUNCIONES ### --> 
2<#include "${templatesPath}/TEMPLATE_INIT" /> 
3<#include "${templatesPath}/TEMPLATE_FUNCTIONS" /> 
4 
5 
6<#-- ### CONSTANTES CUSTOM ### --> 
7<#assign VOCABULARY_INFO_NAMES = [CATEGORIES_VOCABULARY_NAME] /> 
8<#assign DATE_PATTERN = "dd.MM.yyyy" /> 
9<#assign URL_CURRENT = THEME_DISPLAY.getURLCurrent() /> 
10 
11<#-- ### SPECIAL LIBS ### --> 
12<#attempt> 
13	<#assign BlogsEntryLocalServiceUtil = staticUtil["com.liferay.portlet.blogs.service.BlogsEntryLocalServiceUtil"] /> 
14	<#assign i18nblogsentryLocalService = serviceLocator.findService("custom-blog-portlet", "com.isoco.customblog.service.i18nblogsentryLocalService") /> 
15	<#assign ExternalPersonnelLocalService = serviceLocator.findService("custom-blog-portlet", "com.isoco.customblog.service.ExternalPersonnelLocalService") /> 
16	<#assign PersonaLocalService = serviceLocator.findService("isglobal-people-portlet", "org.isglobal.people.service.PersonaLocalService") /> 
17	<#assign DynamicQueryFactoryUtil = staticUtil["com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil"] /> 
18	<#assign RestrictionsFactoryUtil = staticUtil["com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil"] /> 
19	<#assign PropertyFactoryUtil = staticUtil["com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil"] /> 
20	<#assign BlogsEntry = staticUtil["com.liferay.portal.kernel.util.ClassResolverUtil"].resolveByPortalClassLoader("com.liferay.portlet.blogs.model.BlogsEntry") /> 
21	 
22	<#assign CUSTOM_LIBS_OK =  true /> 
23<#recover> 
24	<#assign ERROR_LIST =  ERROR_LIST + [ "Error getting libs from custom-blog-portlet and isglobal-people-portlet" ] /> 
25	<#assign CUSTOM_LIBS_OK =  false /> 
26</#attempt> 
27 
28<#function _getPersonaIdFromRequest request > 
29	<#attempt> 
30		<#local originalServletRequest = portalUtil.getOriginalServletRequest(request) /> 
31		<#local parameterMap = originalServletRequest.getParameterNames() /> 
32		<#list parameterMap as parameterKey > 
33			<#if parameterKey?matches(".*_personaId$") > 
34				<#return originalServletRequest.getParameter(parameterKey)?number > 
35			</#if> 
36		</#list> 
37	<#recover> 
38	</#attempt> 
39	<#return -1 > 
40</#function> 
41 
42 
43<#-- ### INFORMACION ### --> 
44 
45<#-- Estructura JSON ejemplo 
46	{"blogs" : [ 
47
48			"title" : ${}, 
49			"content" : ${}, 
50			"description" : ${}, 
51			"date" : ${}, 
52			"url" : ${}, 
53			"image" : ${}, 
54			"image_alt" : ${}, 
55			"categoryListName" : [], 
56			"categoriesString" : ${} 
57
58	]} 
59--> 
60 
61<#-- Get related posts from file author --> 
62<#assign listPosts = [] /> 
63<#assign personaId = _getPersonaIdFromRequest(request) /> 
64<#if (personaId > 0) > 
65	<#assign persona = PersonaLocalService.getPersona(personaId) /> 
66	<#assign blogUserId = persona.getUserId() /> 
67	<#if (blogUserId > 0) > 
68		<#assign dynamicQuery = DynamicQueryFactoryUtil.forClass(BlogsEntry) /> 
69		<#assign VOID = dynamicQuery.add(RestrictionsFactoryUtil.eq("userId", blogUserId)) /> 
70		<#assign VOID = dynamicQuery.addOrder(PropertyFactoryUtil.forName("displayDate").desc()) /> 
71		<#assign personaBlogs = BlogsEntryLocalServiceUtil.dynamicQuery(dynamicQuery) /> 
72		<#list personaBlogs as personaBlog > 
73			<#assign personaBlogId = personaBlog.getEntryId() /> 
74			<#attempt> 
75				<#if personaBlog.getStatus() == 0 > 
76					<#assign i18nBlog = i18nblogsentryLocalService.geti18nblogsentry(personaBlogId, locale) /> 
77					<#if i18nBlog?has_content > 
78						<#assign i18nBlogId = i18nBlog.getEntryId() /> 
79						<#if !(ExternalPersonnelLocalService.findBlogId(i18nBlogId)?has_content) > 
80							<#-- El autor es interno (de ISGlobal) --> 
81							<#assign listPosts = listPosts + [personaBlog] /> 
82						</#if> 
83					</#if> 
84				</#if> 
85			<#recover> 
86			</#attempt> 
87		</#list> 
88	</#if> 
89</#if> 
90 
91<#assign blogs = [] /> 
92<#if listPosts?has_content > 
93 
94	<#-- Get Blog Info --> 
95	<#list listPosts as blogEntry> 
96 
97		<#-- creacion del objeto JSON a rellenar --> 
98			<#assign data = {} /> 
99			<#assign title = "" /> 
100			<#assign content = "" /> 
101			<#assign description = "" /> 
102			<#assign date = "" /> 
103			<#assign url = "" /> 
104			<#assign image = "" /> 
105 
106		<#-- Extraccion de informacion --> 
107			 
108			<#-- Blog info --> 
109			<#assign blogEntryId = blogEntry.getEntryId() /> 
110			<#assign blogEntryUrl = blogEntry.getUrlTitle() /> 
111			 
112			<#assign title = blogEntry.getTitle() /> 
113			<#assign content = blogEntry.getContent() /> 
114			<#attempt> 
115				<#assign i18nEntry = i18nblogsentryLocalService.geti18nblogsentry(blogEntryId, locale.toString()) /> 
116				<#if i18nEntry.getTitle()?has_content > 
117					<#assign title = i18nEntry.getTitle() /> 
118				</#if> 
119				<#if i18nEntry.getContent()?has_content > 
120					<#assign content = i18nEntry.getContent() /> 
121				</#if> 
122			<#recover> 
123				<#assign ERROR_LIST =  ERROR_LIST + [ "Error getting i18n Blog Title" ] /> 
124			</#attempt> 
125			<#assign description = stringUtil.shorten(htmlUtil.stripHtml(content), 150) /> 
126			 
127			<#assign date = dateUtil.getDate(blogEntry.getDisplayDate(), DATE_PATTERN, locale) /> 
128			 
129			<#assign blogUserExternalId = 0 /> 
130			<#assign url = "${HEALTH_BLOG_PATH}/${blogEntryUrl}/${blogUserId}/${blogUserExternalId}" /> 
131			 
132			<#assign image = DEFAULT_BLOG_IMAGE /> 
133			<#if blogEntry.getSmallImageURL()?has_content > 
134				<#assign image = blogEntry.getSmallImageURL() /> 
135			</#if> 
136			 
137		<#-- Guardado de la informacion modo JSON --> 
138		 
139			<#assign data = data + {"title" : "${title}"} /> 
140			<#assign data = data + {"content" : "${content}"} /> 
141			<#assign data = data + {"description" : "${description}"} /> 
142			<#assign data = data + {"date" : "${date}"} /> 
143			<#assign data = data + {"url" : "${url}"} /> 
144			<#assign data = data + {"image" : "${image}"} /> 
145			<#assign data = data + {"image_alt" : _getAltImage(image)} /> 
146			 
147		<#-- JSON añadido a la lista de elementos --> 
148			<#assign blogs = blogs + [data] /> 
149		 
150	</#list> 
151</#if> 
152 
153<#-- ### HTML ### --> 
154<#if blogs?has_content > 
155	<aside class="interesting-items llista-blog"> 
156		<h2 class="h3"><@liferay.language key="blog-posts"/></h2> 
157		<section class="ultimes-noticies container-fluid"> 
158			<div class="container"> 
159				<div class="row slider-mixed "> 
160					<div class="slider-noticies owl-carousel owl-theme noticies-state"> 
161						 
162						<#list blogs as elem> 
163							<article class="item item-list item-post text-center col-xs-12" data-link="${elem.url}"> 
164								<div class="wrap-image wrap-image-icon"> 
165									<img class="img-responsive" src="${elem.image}" alt="${elem.image_alt}"> 
166								</div> 
167								<div class=""> 
168									<h3 class="title"> 
169										<a href="${elem.url}">${elem.title}</a> 
170									</h3> 
171									<p class="description">${elem.description}</p> 
172									<span class="info-date">${elem.date}</span> 
173								</div> 
174							</article> 
175						</#list> 
176						 
177					</div> 
178				</div> 
179			</div> 
180		</section> 
181	</aside> 
182</#if> 
183 
184<#-- Error control --> 
185<@_errorMessage hasPermission=VIEW_ERROR_PERMISSION msgList=ERROR_LIST /> 
186<@_jsonInfo hasPermission=ADMIN_PERMISSION info=blogs />