ZGARNI Lemia - CH-Côte de lumiere
Une erreur s'est produite lors du traitement du modèle.
For "." left-hand operand: Expected a hash, but this has evaluated to a sequence (Collections$UnmodifiableRandomAccessList wrapped into f.t.DefaultListAdapter): ==> assetEntries [in template "20101#20127#ODS_PROFESSIONNEL" at line 71, column 31] ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign nombrePlan = assetEntries.size() [in template "20101#20127#ODS_PROFESSIONNEL" at line 71, column 9] ----
1<#assign requestedCat = request.getParameter('categoryId')!0>
2<#assign requestedCat = requestedCat?number>
3<#-- Structure et template du type d'articles que je veux récupérer -->
4<#assign ddmStructureKey = "ODS_SERVICE_INFORMATIONS">
5<#assign ddmTemplateKey = "ODS_SERVICE_INFORMATIONS">
6
7<#-- Déclaration des services -->
8<#assign assetVocabularyLocalServiceUtil = objectUtil("com.liferay.asset.kernel.service.AssetVocabularyLocalServiceUtil")>
9<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
10<#assign journalArticleResourceLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService") />
11<#assign OrderByComparatorFactoryUtil = staticUtil["com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil"]>
12<#assign classNameLocalServiceUtil = staticUtil["com.liferay.portal.kernel.service.ClassNameLocalServiceUtil"]>
13<#assign assetEntryQuery = objectUtil("com.liferay.asset.kernel.service.persistence.AssetEntryQuery")>
14<#assign assetEntryLocalServiceUtil = objectUtil("com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil")>
15<#assign dLAppLocalServiceUtil = objectUtil("com.liferay.document.library.kernel.service.DLAppLocalServiceUtil")>
16<#assign assetEntryCatRelLocalServiceUtil = serviceLocator.findService("com.liferay.asset.entry.rel.service.AssetEntryAssetCategoryRelLocalService")>
17<#assign assetCategoryPropertyLocalServiceUtil = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService")>
18<#assign DDMStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService")>
19<#assign layoutLocalServiceUtil = objectUtil("com.liferay.portal.kernel.service.LayoutLocalServiceUtil")>
20
21<#assign structureClassName = classNameLocalServiceUtil.getClassName("com.liferay.journal.model.JournalArticle")>
22<#assign structureClassNameId= structureClassName.getClassNameId()?number>
23<#assign structure = DDMStructureLocalService.getStructure(themeDisplay.getCompanyGroupId(), structureClassNameId, ddmStructureKey)![] >
24<#assign classTypeId=structure.getStructureId()>
25<#-- Récupération du vocabulaire et de la liste des spécialités -->
26<#assign vocabulary = assetVocabularyLocalServiceUtil.getGroupVocabulary(themeDisplay.getScopeGroupId(), "Offres de soins")>
27<#assign specialites = assetCategoryLocalService.getVocabularyCategories(vocabulary.getVocabularyId(), -1, -1, null)>
28
29<#-- Id de l'article -->
30<#assign journalArticleId = .vars['reserved-article-id'].data>
31<#-- Ressource PK de l'article -->
32<#assign articleResourcePK = journalArticleResourceLocalService.getArticleResourcePrimKey(groupId, journalArticleId)/>
33<#-- Liste des catégories de l'article -->
34<#assign categoryList=assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle",articleResourcePK)>
35
36<#list categoryList as cur_cat>
37 <#if cur_cat.getVocabularyId() == vocabulary.getVocabularyId()>
38 <#if cur_cat.getCategoryId() == requestedCat>
39 <#assign catToFetch = cur_cat>
40 <#assign className = classNameLocalServiceUtil.getClassName("com.liferay.journal.model.JournalArticle") />
41 <#assign classNameId = className.getClassNameId()?number />
42 <#assign void = assetEntryQuery.setAllCategoryIds([requestedCat])>
43 <#assign void = assetEntryQuery.setClassNameIds([classNameId])>
44 <#--assign assetEntries = assetEntryLocalServiceUtil.getEntries(assetEntryQuery)-->
45 <#assign void = assetEntryQuery.setClassTypeIds([classTypeId])>
46 <#assign assetEntries = assetEntryLocalServiceUtil.getEntries(assetEntryQuery)>
47 <#-- Récupération de l'article du bloc d'information -->
48 <#list assetEntries as cur_entry>
49 <#assign renderer = cur_entry.getAssetRenderer() >
50 <#assign journalArticle = renderer.getArticle() >
51 </#list>
52 </#if>
53 </#if>
54</#list>
55
56<#assign images = {} >
57
58<#-- Initialisation des variables utilisées dans le JavaScript -->
59<#assign googleMapsAPIKey = 0>
60<#assign images_front_path = "">
61<#assign googleMapsAPIKey = themeDisplay.getScopeGroup().getTypeSettingsProperty("googleMapsAPIKey")!0>
62<#assign images_front_path = themeDisplay.getPathThemeImages()>
63
64<#if catToFetch??>
65 <#assign className = classNameLocalServiceUtil.getClassName("com.liferay.document.library.kernel.model.DLFileEntry") >
66 <#assign classNameId = className.getClassNameId()?number >
67 <#assign assetEntryQuery = objectUtil("com.liferay.asset.kernel.service.persistence.AssetEntryQuery")>
68 <#assign void = assetEntryQuery.setAllCategoryIds([catToFetch.getCategoryId()])>
69 <#assign void = assetEntryQuery.setClassNameIds([classNameId])>
70 <#assign assetEntries = assetEntryLocalServiceUtil.getEntries(assetEntryQuery)>
71 <#assign nombrePlan = assetEntries.size()>
72 <#-- Boucle sur chaque assetEntry pour récupérer l'url et la localisation -->
73 <#list assetEntries as assetEntry>
74 <#-- Récupération de l'URL -->
75 <#assign dlFileEntryId = assetEntry.getClassPK()>
76 <#assign fileEntry = dLAppLocalServiceUtil.getFileEntry(dlFileEntryId)>
77 <#-- Filtre sur le type de contenu -->
78 <#if fileEntry.getMimeType() =="image/jpeg" ||fileEntry.getMimeType() == "image/png" || fileEntry.getMimeType() =="image/jpg" >
79 <#assign url="/documents/"+fileEntry.getRepositoryId()+"/"+fileEntry.getFolderId()+"/"+fileEntry.getFileName()+"/"+fileEntry.getUuid()>
80 </#if>
81 <#if url??>
82 <#-- Recherche des categories du vocabulaire "Localisations" -->
83 <#assign vocabulary = assetVocabularyLocalServiceUtil.getGroupVocabulary(layout.getGroupId(),"Localisations")>
84 <#assign categoriesFile = assetEntryCatRelLocalServiceUtil.getAssetEntryAssetCategoryRelsByAssetEntryId(assetEntry.getEntryId())>
85 <#list categoriesFile as categorieFile>
86 <#assign cat = assetCategoryLocalService.getCategory(categorieFile.getAssetCategoryId())>
87 <#if cat.getVocabularyId()==vocabulary.getVocabularyId()>
88 <#assign latitude = "46.663889812571426">
89 <#assign longitude = "-1.2996525449218552">
90 <#assign tooltip = "Site de " + cat.getName()>
91 <#-- Recherche des propriétés associées à la position -->
92 <#assign catProperty = assetCategoryPropertyLocalServiceUtil.fetchCategoryProperty(cat.getCategoryId(), "Latitude")![]>
93 <#if catProperty?size gt 0>
94 <#assign latitude = catProperty.getValue()>
95 </#if>
96 <#assign catProperty = assetCategoryPropertyLocalServiceUtil.fetchCategoryProperty(cat.getCategoryId(), "Longitude")![]>
97 <#if catProperty?size gt 0>
98 <#assign longitude = catProperty.getValue()>
99 </#if>
100 <#assign catProperty = assetCategoryPropertyLocalServiceUtil.fetchCategoryProperty(cat.getCategoryId(), "InfoBulle")![]>
101 <#if catProperty?size gt 0>
102 <#assign tooltip = catProperty.getValue()>
103 </#if>
104 <#assign images = images + { cat.getName() : {"url": url, "Lat": latitude, "Lng": longitude, "Tooltip": tooltip }} >
105 </#if>
106 </#list>
107 </#if>
108 </#list>
109</#if>
110
111<#-- Nom et prénom du professionnel -->
112<div class="row professionnel-result">
113 <div class="col-md-12">
114 <div class="ods-detail-container">
115 <h2>${Nom.getData()} ${Prenom.getData()}</h2>
116 </div>
117 </div>
118</div>
119
120<#if catToFetch??>
121 <#-- ############### AFFICHAGE DE LA CARTE ET DES PLANS ##################################### -->
122 <div class="row no-gutters">
123 <div class="col-md-6">
124 <div id="map_canvas" style="height: 622px; position: relative; overflow: hidden;"></div>
125 </div>
126
127 <div class="col-md-6" style="height: 100%; overflow:hidden;" >
128 <div class="item-adress">
129 <#-- Liste des images à afficher en lien avec un POI -->
130 <#list images?values as poi>
131 <div class="active-link" id="address-${poi?index}">
132 <div class="address-container hide">
133 <div class="address">
134 <div class="row">
135 <div class="col-md-12">
136 <img src="${poi.url}" style="max-width: 100%; max-height: 400px;">
137 </div>
138 </div>
139 </div>
140 </div>
141 </div>
142 </#list>
143 </div>
144 </div>
145 </div>
146<#else>
147 <div class="professionnel-col">
148 <div class="linkPro resultTitle">Medecin</div>
149 </div>
150 <div class="professionnel-col">
151 <#assign portletId = themeDisplay.getPortletDisplay().getId()?remove_beginning("com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE")>
152 <#list categoryList as cur_category>
153 <#assign color = "">
154 <#assign ll = themeDisplay.getLayout()>
155 <#if cur_category.getVocabularyId() == vocabulary.getVocabularyId()>
156
157 <#if cur_category.getParentCategoryId() == 0>
158 <#assign parentCategorie=cur_category>
159 <#else>
160 <#assign parentCategorie=assetCategoryLocalService.getCategory(cur_category.getParentCategoryId())>
161 </#if>
162 <#assign catName = parentCategorie.getName()>
163 <#assign catProperty = assetCategoryPropertyLocalServiceUtil.fetchCategoryProperty(parentCategorie.getCategoryId(), "CSS")![]>
164 <#if catProperty?size gt 0>
165 <#assign catName = catProperty.getValue()>
166 </#if>
167 <#assign url = themeDisplay.getURLCurrent()>
168 <#if url?index_of("?") gt 0 >
169 <#assign url = url + "&categoryId=" + cur_category.getCategoryId()>
170 <#else>
171 <#assign url = url + "?categoryId=" + cur_category.getCategoryId()>
172 </#if>
173 <#assign catProperty = assetCategoryPropertyLocalServiceUtil.fetchCategoryProperty(parentCategorie.getCategoryId(), "COLOR")![]>
174 <#if catProperty?size gt 0>
175 <#assign color = catProperty.getValue()>
176 </#if>
177 <#assign cssColor = "">
178 <#if (color?has_content)>
179 <#assign cssColor= "color" + portletId + cur_category?index>
180 <style>
181 .professionnel-col .service-item.${cssColor}
182 {
183 background-color: #${color};
184 }
185 </style>
186 </#if>
187 <#if catName?lower_case == "custom">
188 <#assign assetEntries = assetEntryCatRelLocalServiceUtil.getAssetEntryAssetCategoryRelsByAssetCategoryId(parentCategorie.getCategoryId()) >
189 <#assign layoutClassName = classNameLocalServiceUtil.getClassName("com.liferay.portal.kernel.model.Layout")>
190 <#assign layoutClassNameId= layoutClassName.getClassNameId()?number>
191 <#list assetEntries as ae>
192 <#attempt>
193 <#assign assetEntry = assetEntryLocalServiceUtil.getEntry(ae.getAssetEntryId()) />
194 <#if assetEntry.getClassNameId() == layoutClassNameId>
195 <#assign ll = layoutLocalServiceUtil.getLayout(assetEntry.classPK)>
196 </#if>
197 <#recover>
198 </#attempt>
199 </#list>
200 </#if>
201
202 <div class="service-item ${catName?lower_case} ${cssColor}">
203 <@liferay_theme["layout-icon"] layout=ll />
204 <a href="${url}">${cur_category.getName()}</a>
205 </div>
206 </#if>
207 </#list>
208 </div>
209</#if>
210
211<#-- Métier et nom du service-->
212<div class="ods-detail-container detail-pro-result">
213 <#if catToFetch??>
214 <hr>
215 <div class="row">
216 <#assign catUrl = "/web" + themeDisplay.getScopeGroup().getFriendlyURL()+"/"+catToFetch.getName()?lower_case>
217 <#assign assetEntries = assetEntryCatRelLocalServiceUtil.getAssetEntryAssetCategoryRelsByAssetCategoryId(catToFetch.getCategoryId()) >
218 <#assign layoutClassName = classNameLocalServiceUtil.getClassName("com.liferay.portal.kernel.model.Layout")>
219 <#assign layoutClassNameId= layoutClassName.getClassNameId()?number>
220 <#list assetEntries as ae>
221 <#attempt>
222 <#assign assetEntry = assetEntryLocalServiceUtil.getEntry(ae.getAssetEntryId()) />
223 <#if assetEntry.getClassNameId() == layoutClassNameId>
224 <#assign ll = layoutLocalServiceUtil.getLayout(assetEntry.classPK)>
225 <#assign catUrl = "/web" + themeDisplay.getScopeGroup().getFriendlyURL() + ll.getFriendlyURL()>
226 </#if>
227 <#recover>
228 </#attempt>
229 </#list>
230 <div class="ods-detail-header col-md-12">
231 <div class="professionnel-col">
232 <div class="linkPro resultTitle">Medecin</div>
233 </div>
234 <h5><a href="${catUrl}">${catToFetch.getName()}</a></h5>
235 </div>
236 </div>
237 </#if>
238 <#-- Article d'information -->
239 <#if journalArticle?? && journalArticle.getDDMTemplateKey()== ddmTemplateKey && journalArticle.getDDMStructureKey()==ddmStructureKey>
240 <hr>
241 <div class="row">
242 <div class="col-md-12">
243 <@liferay_journal["journal-article"] articleId=journalArticle.getArticleId() groupId=journalArticle.getGroupId() ddmTemplateKey=ddmTemplateKey />
244 </div>
245 </div>
246 </#if>
247</div>
248
249<#if catToFetch??>
250 <#-- ############### JS POUR AFFICHAGE DE LA CARTE ET DES PLANS ##################################### -->
251 <script data-senna-track="permanent">
252 Liferay.namespace('Maps').onGMapsReady = function(event) {
253 Liferay.Maps.gmapsReady = true;
254
255 Liferay.fire('gmapsReady');
256 };
257 </script>
258 <script data-senna-track="permanent" src="https://maps.googleapis.com/maps/api/js?callback=Liferay.Maps.onGMapsReady&key=${googleMapsAPIKey}" type="text/javascript"></script>
259 <script type="text/javascript">
260 var map;
261 var bounds = new google.maps.LatLngBounds();
262 var myPoints = [];
263 var markers = [];
264
265 <#if themeDisplay??>
266 var gsKmlUrl = '${themeDisplay.getPathThemeImages()}/google-map/85.kml';
267 </#if>
268 var images_front_path = '${images_front_path}';
269
270 function isBreakpoint(e) {
271 return $(".device-" + e).is(":visible")
272 }
273
274 function isMobile() {
275 return isBreakpoint("xs")
276 }
277
278 function isMD() {
279 return isBreakpoint("md")
280 }
281
282 function isLG() {
283 return isBreakpoint("lg")
284 }
285
286 function setMapHomeHeight() {
287 var i = 56,
288 n = $(".map-home .address-container");
289 n.each(function(e, t) {
290 e == n.length - 1 ? i += $(t).outerHeight(!1) : i += $(t).outerHeight(!0)
291 });
292 var e = $("#map_canvas");
293 isMD() || isLG() ? (e.height(i), e.closest(".row").find(".col-md-2").height(i)) : (e.height("400px"), e.closest(".row").find(".col-md-2").height("400px"))
294 }
295
296 function createMap() {
297 setMapHomeHeight();
298
299 var zoomNum;
300 if (isBreakpoint('sm')) {
301 zoomNum = 8;
302 } else if (isBreakpoint('xs')) {
303 zoomNum = 6;
304 } else {
305 zoomNum = 9;
306 }
307
308 var mapConfig = {
309 // How zoomed in you want the map to start at (always required)
310 zoom: zoomNum,
311 scrollwheel: false,
312 streetViewControl: false,
313 mapTypeControl: false,
314 fullscreenControl: true,
315 fullscreenControlOptions: {
316 position: google.maps.ControlPosition.LEFT_TOP
317 },
318 zoomControl: true,
319 zoomControlOptions: {
320 position: google.maps.ControlPosition.LEFT_BOTTOM
321 },
322 center: {lat: 46.663889812571426, lng: -1.2996525449218552}, // CHD Vendée, La Roche/Yon
323 styles: [{
324 "featureType": "landscape",
325 "elementType": "geometry",
326 "stylers": [{
327 "saturation": "-100"
328 }]
329 }, {
330 "featureType": "poi",
331 "elementType": "labels",
332 "stylers": [{
333 "visibility": "off"
334 }]
335 }, {
336 "featureType": "poi",
337 "elementType": "labels.text.stroke",
338 "stylers": [{
339 "visibility": "off"
340 }]
341 }, {
342 "featureType": "road",
343 "elementType": "labels.text",
344 "stylers": [{
345 "color": "#545454"
346 }]
347 }, {
348 "featureType": "road",
349 "elementType": "labels.text.stroke",
350 "stylers": [{
351 "visibility": "off"
352 }]
353 }, {
354 "featureType": "road.highway",
355 "elementType": "geometry.fill",
356 "stylers": [{
357 "saturation": "-87"
358 }, {
359 "lightness": "-40"
360 }, {
361 "color": "#ffffff"
362 }]
363 }, {
364 "featureType": "road.highway",
365 "elementType": "geometry.stroke",
366 "stylers": [{
367 "visibility": "off"
368 }]
369 }, {
370 "featureType": "road.highway.controlled_access",
371 "elementType": "geometry.fill",
372 "stylers": [{
373 "color": "#f0f0f0"
374 }, {
375 "saturation": "-22"
376 }, {
377 "lightness": "-16"
378 }]
379 }, {
380 "featureType": "road.highway.controlled_access",
381 "elementType": "geometry.stroke",
382 "stylers": [{
383 "visibility": "off"
384 }]
385 }, {
386 "featureType": "road.highway.controlled_access",
387 "elementType": "labels.icon",
388 "stylers": [{
389 "visibility": "on"
390 }]
391 }, {
392 "featureType": "road.arterial",
393 "elementType": "geometry.stroke",
394 "stylers": [{
395 "visibility": "off"
396 }]
397 }, {
398 "featureType": "road.local",
399 "elementType": "geometry.stroke",
400 "stylers": [{
401 "visibility": "off"
402 }]
403 }, {
404 "featureType": "water",
405 "elementType": "geometry.fill",
406 "stylers": [{
407 "saturation": "-52"
408 }, {
409 "hue": "#00e4ff"
410 }, {
411 "lightness": "-16"
412 }]
413 }]
414 };
415
416 map = new google.maps.Map(document.getElementById('map_canvas'), mapConfig);
417 var xs = {
418 url: images_front_path + '/google-map/pinpoint-xs.png',
419 size: new google.maps.Size(54, 52),
420 origin: new google.maps.Point(0, 0),
421 anchor: new google.maps.Point(27, 52)
422 };
423
424 var xl = {
425 url: images_front_path + '/google-map/pinpoint-xl.png',
426 size: new google.maps.Size(110, 103),
427 origin: new google.maps.Point(0, 0),
428 anchor: new google.maps.Point(55, 103)
429 };
430
431 var ctaLayer = new google.maps.KmlLayer({
432 url: gsKmlUrl,
433 map: map,
434 clickableIcons: false,
435 preserveViewport: true
436 });
437
438 <#-- Liste des POI à afficher en lien avec une image -->
439 <#list images?values as poi>
440 var iconSize = xl;
441 markers[ ${poi?index} ] = new google.maps.Marker({
442 position: new google.maps.LatLng( ${poi.Lat}, ${poi.Lng} ),
443 map: map,
444 icon: iconSize,
445 title: "${poi.Tooltip}"
446 });
447
448 markers[ ${poi?index} ].addListener('click', function() {
449 clearMarkers(markers);
450 markers[ ${poi?index} ].setIcon(images_front_path + '/google-map/pinpoint-xl.png');
451
452 $('.address-container').addClass('hide');
453 $('#address-${poi?index}').find('.address-container').removeClass('hide');
454 });
455 </#list>
456
457 myPoints.push(new google.maps.LatLng(46.6684334, -1.4121495));
458 myPoints.push(new google.maps.LatLng(46.970508, -1.310356));
459 myPoints.push(new google.maps.LatLng(46.451894, -1.170386));
460 for (var i = 0; i < myPoints.length; i++) {
461 bounds.extend(myPoints[i]);
462 }
463 map.fitBounds(bounds);
464 google.maps.event.addListenerOnce(map, 'tilesloaded', fixMyPageOnce);
465 }
466
467 if (Liferay.Maps.gmapsReady) {
468 createMap();
469 }
470 else {
471 Liferay.once('gmapsReady', createMap);
472 }
473
474 function fixMyPageOnce() {
475 for (var i = 0; i < markers.length; i++) {
476 if (markers[i] !== undefined) {
477 google.maps.event.trigger(markers[i], 'click');
478 break;
479 }
480 }
481 }
482
483 function clearMarkers(pointers) {
484 for (var i = 0; i < pointers.length; i++) {
485 if (pointers[i] !== undefined) {
486 pointers[i].setIcon(images_front_path + '/google-map/pinpoint-xs.png');
487 }
488 }
489 }
490
491 $(window).resize(function() {
492 setMapHomeHeight();
493 });
494 </script>
495</#if>