S'ha produït un error mentre es processava la plantilla.
Java method "com.sun.proxy.$Proxy921.getArticle(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy921 object "com.liferay.journal.service.impl.JournalArticleServiceImpl@2aeb30cb"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign journal = JournalArticleServi... [in template "20116#20152#" at line 115, column 1] ----
1<#-- $Id: COMERCIO_INGENIUM_DETALLE.ftl 2736 2021-12-02 17:23:49Z patricia.hevia $ -->
2<div class="detalleComercioCompleto">
3
4 <div class="seccionTop row">
5
6 <div class="containerImagenComercioPeq col-12 col-md-4 col-lg-3">
7 <#if imageSmall.getData()?? &&
8 imageSmall.getData() != "">
9 <img data-fileentryid="${imageSmall.getAttribute("fileEntryId")}"
10 alt="${imageSmall.getAttribute("alt")}"
11 src="${imageSmall.getData()}" />
12 </#if>
13 </div>
14
15 <div class="detail col-12 col-md-8 col-lg-6">
16 <#if brandName?? && brandName.getData() !="">
17 <h1 class="title">${brandName.getData()}</h1>
18 </#if>
19
20 <#if shortDescription?? && shortDescription.getData() !="">
21 <p>${shortDescription.getData()}</p>
22 </#if>
23 </div>
24
25 <div class="links col-12 col-md-12 col-lg-3">
26 <#if externalLink?? && externalLink.getData() !="">
27 <a target="_blank" href="${externalLink.getData()}"
28 title="${languageUtil.format(locale, "opens-new-window", "Abre en
29 nueva ventana", false)}" aria-label="${languageUtil.format(locale,
30 "aria-label-ingenium-external-store", "Navega al comercio Ingenium.", false)} <@liferay.language "opens-new-window"/>">
31 <@liferay.language "ingenium.store.visitstore"/>
32 </a>
33 </#if>
34
35 <#if storeList?? && storeList.getData() !="">
36 <a class="btn btn-primary" target="#" data-toggle="modal"
37 data-target="#modalMaps">
38 <span class="icon-map-marker"></span>
39 <@liferay.language "ingenium.store.detail.findstore"/>
40 </a>
41 </#if>
42
43 </div>
44 </div>
45
46 <div class="containerImagenComercioGrande">
47 <#if imageLarge.getData()?? &&
48 imageLarge.getData() != "">
49 <img data-fileentryid="${imageLarge.
50 getAttribute("fileEntryId")}" alt="
51 ${imageLarge.getAttribute("alt")}"
52 src="${imageLarge.getData()}"/>
53 </#if>
54
55 <#if promotionMultiText?? && promotionMultiText.getData() !="">
56 <div class="textoPromocion">
57 ${promotionMultiText.getData()}
58 </div>
59 </#if>
60
61 </div>
62
63 <div class="seccionBottom">
64
65 <div class="descripcionCompleta">
66 <#if fullDescription?? && fullDescription.getData() !="">
67 ${fullDescription.getData()}
68 </#if>
69 </div>
70 <#if cecaTransaction?? && cecaTransaction.getData() !="">
71 <div class="cuponButton">
72 <#if cecaTransaction.cecaLightbox.getData()?has_content>
73 <#assign article = cecaTransaction.cecaLightbox.getData()?eval />
74 <@liferay_asset["asset-display"]
75 className=article.className
76 classPK=getterUtil.getLong(article.classPK, 0)
77 template="full_content"/>
78 </#if>
79 </div>
80 <#elseif cecaTransaction?? && cecaTransaction.externalOfferUrl?? && cecaTransaction.externalOfferUrl.getData() != "">
81 <div class="row">
82 <div class="col-12">
83 <div class="cupon">
84 <a target="_blank" href="${cecaTransaction.externalOfferUrl.getData()}"
85 title="${languageUtil.format(locale,
86 "aria-label-ingenium-login-ceca", "Accede a la oferta.", false)} ${languageUtil.format(locale, "opens-new-window", "Abre en
87 nueva ventana", false)}" aria-label="${languageUtil.format(locale,
88 "aria-label-ingenium-login-ceca", "Accede a la oferta.", false)}
89 <@liferay.language "opens-new-window"/>" class="btn btn-primary pull-right">
90 <@liferay.language "ingenium.store.detail.offer.link"/>
91 </a>
92 </div>
93 </div>
94 </div>
95
96 </#if>
97
98 <#if searchPage?? && searchPage.getFriendlyUrl() != "">
99 <div class="row">
100 <div class="col-12">
101 <div class="backButton">
102 <a class="backButton pull-right"
103 href="${searchPage.getFriendlyUrl()}"><@liferay.language key="ingenium.store.detail.search.more" /></a>
104 </div>
105 </div>
106 </div>
107 </#if>
108 </div>
109</div>
110<#assign articleId = .vars['reserved-article-id'].data />
111<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()>
112<#assign themeDisplay = serviceContext.getThemeDisplay() />
113<#assign JournalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleService")>
114
115<#assign journal = JournalArticleService.getArticle(themeDisplay.getScopeGroupId(), articleId) />
116<#assign iconDefaultValue = journal.getDDMStructure().getDDMFormField("mapIcon").getPredefinedValue().getString(themeDisplay.getLocale()) />
117
118<#assign mapsApiKey = themeDisplay.getScopeGroup().getTypeSettingsProperties().getProperty("googleMapsAPIKey") />
119<#assign imageJson = iconDefaultValue?eval>
120<#assign imageIconSrc = imageJson.data />
121
122<#if mapIcon?? && mapIcon.getData() != "">
123 <#assign imageIconSrc = mapIcon.getData() />
124</#if>
125
126<div id="modalMaps" class="modal fade" role="dialog" style="display: none;">
127 <div class="modal-dialog">
128 <div class="modal-content">
129 <div class="modal-header">
130 <button type="button" class="close" data-dismiss="modal">×</button>
131 <h4 class="modal-title"></h4>
132 </div>
133 <div class="modal-body">
134 <input id="mapSearchTextField" class="controls" type="text"
135 placeholder="<@liferay.language "ingenium.store.detail.map.search.input.placeholder"/>"/>
136
137 <div id="map" style="min-height:400px;"></div>
138 </div>
139 </div>
140 </div>
141</div>
142
143<#if mapsApiKey !="">
144
145 <script type="text/javascript">
146
147 var brandId = '${articleId}';
148
149 var latitud = "41.386009";
150 latitud = parseFloat(latitud);
151 var longitud = "2.175850";
152 longitud = parseFloat(longitud);
153
154 var originalMapCenter = {lat: latitud, lng: longitud};
155
156 map;
157 var infowindow;
158 markers = [];
159 var lastPlaceSelection = '';
160 var iconImg = '${imageIconSrc}';
161
162
163 function initMap() {
164 map = new google.maps.Map(document.getElementById('map'), {
165 center: originalMapCenter,
166 zoom: 15,
167 mapTypeControl: false
168 });
169
170 infowindow = new google.maps.InfoWindow();
171
172 var defaultBounds = new google.maps.LatLngBounds(
173 new google.maps.LatLng(latitud, longitud));
174
175 var input = document.getElementById('mapSearchTextField');
176 var searchBox = new google.maps.places.SearchBox(input, {
177 bounds: defaultBounds
178 });
179
180 map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
181 // Bias the SearchBox results towards current map's viewport.
182 map.addListener('bounds_changed', function () {
183 searchBox.setBounds(map.getBounds());
184 });
185
186 //search event handler
187 searchBox.addListener('places_changed', function () {
188 var places = searchBox.getPlaces();
189 if (places.length == 0) {
190 return;
191 }
192 deleteMarkers();
193
194 // For each place, get the icon, name and location.
195 var bounds = new google.maps.LatLngBounds();
196
197 places.forEach(function (place) {
198 if (!place.geometry) {
199 return;
200 }
201
202 if (place.geometry.viewport) {
203 // Only geocodes have viewport.
204 bounds.union(place.geometry.viewport);
205 } else {
206 bounds.extend(place.geometry.location);
207 }
208 });
209
210 //detailIngeniumNS and detailIngeniumResourceUrl declared in module detail-ingenium-web view.jsp
211 //CDI stores AJAX serveResource search
212 var center = bounds.getCenter();
213 var latitude = center.lat();
214 var longitude = center.lng();
215
216 var formData = new FormData();
217 formData.append(detailIngeniumNS + "latitude", latitude);
218 formData.append(detailIngeniumNS + "longitude", longitude);
219 formData.append(detailIngeniumNS + "radius", getMapRadius(bounds));
220 formData.append(detailIngeniumNS + "brands", brandId);
221
222 $.ajax({
223 type: 'POST',
224 url: "'" + detailIngeniumResourceUrl + "'",
225 dataType: "json",
226 data: formData,
227 processData: false,
228 contentType: false,
229 success: function (data) {
230 for (var i = 0; i < data.response.length; i++) {
231 var responseBrand = data.response[i];
232 createBrandMarkers(parseFloat(responseBrand.latitude), parseFloat(responseBrand.longitude), responseBrand.googleAddress);
233 }
234
235 },
236 error: function (data, status, error) {
237 console.log("error");
238 }
239 });
240
241 map.fitBounds(bounds);
242 });
243 }
244
245 function getMapRadius(bounds) {
246 var center = bounds.getCenter();
247 var ne = bounds.getNorthEast();
248
249 // r = radius of the earth in km
250 var r = 6371;
251
252 // Convert lat or lng from decimal degrees into radians (divide by 57.2958)
253 var lat1 = center.lat() / 57.2958;
254 var lon1 = center.lng() / 57.2958;
255 var lat2 = ne.lat() / 57.2958;
256 var lon2 = ne.lng() / 57.2958;
257
258 // distance = circle radius from center to Northeast corner of bounds
259 var dis = r * Math.acos(Math.sin(lat1) * Math.sin(lat2) +
260 Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1));
261
262 //return distance in km. 1.2 is a multiplier cause the Map center coords have a little padding by default.
263 return dis * 1.2;
264 }
265
266 function createBrandMarkers(lat, lng, text) {
267 createBrandMarker(lat, lng, text);
268 }
269
270 function createBrandMarker(lat, lng, text) {
271
272 var marker = new google.maps.Marker({
273 map: map,
274 position: {lat: lat, lng: lng},
275 icon: iconImg,
276 animation: google.maps.Animation.DROP,
277 draggable: false
278 });
279 google.maps.event.addListener(marker, 'click', function () {
280 infowindow.setContent(text);
281 infowindow.open(map, this);
282 });
283
284 markers.push(marker);
285 }
286
287 function drawPlaces(type) {
288 clearMarkers2();
289 if (type[0] !== '') {
290 lastPlaceSelection = type;
291 }
292 if (lastPlaceSelection[0] !== '') {
293 var service = new google.maps.places.PlacesService(map);
294 service.nearbySearch({
295 location: map.center,
296 radius: 1000,
297 types: lastPlaceSelection
298 }, callback);
299 }
300 }
301
302 function callback(results, status) {
303 if (status === google.maps.places.PlacesServiceStatus.OK) {
304 for (var i = 0; i < results.length; i++) {
305 createMarker(results[i]);
306 }
307 }
308 }
309
310 function createMarker(place) {
311 var placeLoc = place.geometry.location;
312 var marker = new google.maps.Marker({
313 map: map,
314 position: place.geometry.location
315 });
316 markers.push(marker);
317
318 google.maps.event.addListener(marker, 'click', function () {
319 infowindow.setContent(place.name);
320 infowindow.open(map, this);
321 });
322 }
323
324 // Sets the map on all markers in the array.
325 function setMapOnAll2(map) {
326 for (var i = 0; i < markers.length; i++) {
327 markers[i].setMap(map);
328 }
329 }
330
331 // Removes the markers from the map, but keeps them in the array.
332 function clearMarkers2() {
333 setMapOnAll2(null);
334 }
335
336 function deleteMarkers() {
337 clearMarkers2();
338 markers = [];
339 markers.length = 0
340 }
341
342
343 </script>
344
345 <script src="https://maps.googleapis.com/maps/api/js?key=${mapsApiKey}&libraries=places&callback=initMap" async
346 defer></script>
347</#if>
348
349
350<script type="text/javascript">
351 safeInit(function () {
352 $(".cuponButton .cecaTrigger").unbind("click");
353
354 $(".cuponButton .cecaTrigger").click(function (ev) {
355
356 if (document.URL.indexOf('op=') != -1) {
357 $(ev.target).closest(".lightboxCecaWrapper").find(".modalCeca").modal("show");
358 } else {
359 location.href = document.URL + '?op=${cecaTransaction.getData()}';
360 }
361 });
362
363 function initialTrigger() {
364 if (document.URL.indexOf('op=') != -1) {
365 $(".cuponButton").find(".lightboxCecaWrapper").find(".modalCeca").modal("show");
366 }
367 }
368
369 initialTrigger();
370 });
371</script>
Per beneficiar-se dels avantatges d'Ingenium Shopping i Ingenium Shopping PRO cal ser soci de la Cooperativa Consumidors i Usuaris i fer el pagament amb les targetes de Caixa Enginyers en els comerços adherits.