MÜŞTERİLERİMİZ

Fagor Professional olarak, ihtiyaçlarınıza göre uyarlanmış alanlar yaratma konusunda uzmanız. En ilginç projelerimizden bazılarını keşfedin.
​​​
DEVAMINI GÖR
Şablon işlenirken bir hata oluştu.
Java method "com.sun.proxy.$Proxy165.getFileEntryMetadata(long, long)" threw an exception when invoked on com.sun.proxy.$Proxy165 object "com.liferay.portlet.documentlibrary.service.impl.DLFileEntryMetadataLocalServiceImpl@699607f5"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign fileEntryMetadata = dLFileEnt...  [in template "20101#20127#94735" in macro "showEntry" at line 183, column 61]
	- Reached through: @showEntry entry=entries[2] blockSize...  [in template "20101#20127#94735" in macro "par" at line 79, column 21]
	- Reached through: @par entries=entries3  [in template "20101#20127#94735" at line 28, column 21]
----
1<!-- VARIABLES --> 
2 
3 
4<!-- SERVICES --> 
5<#assign dlAppServiceUtil = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService") /> 
6<#assign dLFileEntryMetadataService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryMetadataLocalService") /> 
7 
8<#assign storageEngineManagerUtil = staticUtil["com.liferay.dynamic.data.mapping.kernel.StorageEngineManagerUtil"] /> 
9 
10 
11<#assign entriesAll = [] /> 
12<#if entries?has_content> 
13    <#assign entries3 = [] /> 
14    <#list entries as entry> 
15        <#assign entries3 = entries3 + [ entry ] /> 
16        <#if (entry?index+1)%3 == 0 || !entries[entry?index+1]?has_content > 
17            <#assign entriesAll = entriesAll + [ entries3 ] /> 
18            <#assign entries3 = [] /> 
19        </#if> 
20    </#list> 
21</#if> 
22 
23<div class="container"> 
24    <div class="clients-main"> 
25   	    <#if entriesAll?has_content> 
26            <#list entriesAll as entries3> 
27                <#if (entries3?index+1)%2 == 0 > 
28                    <@par entries=entries3 />  
29                <#else> 
30                    <@impar entries=entries3 /> 
31                </#if> 
32            </#list> 
33        </#if> 
34    </div> 
35</div> 
36 
37<#macro impar entries> 
38	<div class="row"> 
39	    <div class="col-md-6"> 
40	        <#if entries[0]?has_content> 
41	            <@showEntry entry=entries[0] blockSize="large" /> 
42	        </#if>     
43	    </div> 
44	    <div class="col-md-6"> 
45	        <div class="row"> 
46	            <div class="col-md-12"> 
47	                <#if entries[1]?has_content> 
48	                    <@showEntry entry=entries[1] blockSize="small" /> 
49	                </#if> 
50	            </div> 
51	            <div class="col-md-12"> 
52	                <#if entries[2]?has_content> 
53	                    <@showEntry entry=entries[2] blockSize="small" /> 
54	                </#if> 
55	            </div> 
56	        </div> 
57	    </div> 
58	</div> 
59</#macro> 
60 
61<#macro par entries> 
62	<div class="row"> 
63	    <div class="col-md-6"> 
64	        <div class="row"> 
65	            <div class="col-md-12"> 
66	                <#if entries[0]?has_content> 
67	                    <@showEntry entry=entries[0] blockSize="small" /> 
68	                </#if>     
69	            </div> 
70	            <div class="col-md-12"> 
71	                <#if entries[1]?has_content> 
72	                    <@showEntry entry=entries[1] blockSize="small" /> 
73	                </#if> 
74	            </div> 
75	        </div> 
76	    </div> 
77	    <div class="col-md-6"> 
78	        <#if entries[2]?has_content> 
79	            <@showEntry entry=entries[2] blockSize="large" /> 
80	        </#if> 
81	    </div> 
82	</div> 
83</#macro> 
84 
85<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> 
86    <div class="pswp__bg"></div> 
87    <div class="pswp__scroll-wrap"> 
88        <div class="pswp__container"> 
89            <div class="pswp__item"></div> 
90            <div class="pswp__item"></div> 
91            <div class="pswp__item"></div> 
92        </div> 
93        <div class="pswp__ui pswp__ui--hidden"> 
94            <div class="pswp__top-bar"> 
95                <div class="pswp__counter"></div> 
96                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button> 
97                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button> 
98                <div class="pswp__preloader"> 
99                    <div class="pswp__preloader__icn"> 
100                      <div class="pswp__preloader__cut"> 
101                        <div class="pswp__preloader__donut"></div> 
102                      </div> 
103                    </div> 
104                </div> 
105            </div> 
106            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"> 
107                <div class="pswp__share-tooltip"></div>  
108            </div> 
109            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"> 
110            </button> 
111            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"> 
112            </button> 
113            <div class="pswp__caption"> 
114                <div class="pswp__caption__center"></div> 
115            </div> 
116        </div> 
117    </div> 
118</div> 
119 
120 
121<#macro showEntry entry blockSize> 
122     
123    <#if entry?has_content> 
124     
125        <#assign renderer = entry.getAssetRenderer() /> 
126        <#assign journalArticle = renderer.getArticle() /> 
127        <#assign articleId = journalArticle.getArticleId() /> 
128        <#assign document = saxReaderUtil.read(journalArticle.getContentByLocale(locale)) /> 
129        <#assign rootElement = document.getRootElement() /> 
130        <#assign nombre = saxReaderUtil.createXPath("dynamic-element[@name='nombre']").selectSingleNode(rootElement).getStringValue() /> 
131        <#assign imgData = saxReaderUtil.createXPath("dynamic-element[@name='imageMain']").selectSingleNode(rootElement).getStringValue() /> 
132        <#assign videoData = saxReaderUtil.createXPath("dynamic-element[@name='video']").selectSingleNode(rootElement).getStringValue() /> 
133        <#assign imgGalleryNodes = saxReaderUtil.createXPath("dynamic-element[@name='image']").selectNodes(rootElement) /> 
134         
135        <#if !validator.equals(imgData?trim, "") > 
136         
137			<#assign imgDataJson = jsonFactoryUtil.createJSONObject(imgData) /> 
138            <#assign imgFileEntry = dlAppServiceUtil.getFileEntry(getterUtil.getLong(imgDataJson.getString("fileEntryId"))) /> 
139         
140	        <#assign galleryFileEntries = [] /> 
141	        <#if imgGalleryNodes?has_content> 
142	            <#list imgGalleryNodes as imgGalleryNode> 
143	                <#if !validator.equals(imgGalleryNode.getStringValue()?trim, "") > 
144	                    <#assign galleryImgData = imgGalleryNode.getStringValue() /> 
145	                    <#assign galleryImgDataJson = jsonFactoryUtil.createJSONObject(galleryImgData) /> 
146	                    <#assign galleryFileEntry = dlAppServiceUtil.getFileEntry(getterUtil.getLong(galleryImgDataJson.getString("fileEntryId"))) /> 
147	                    <#assign galleryFileEntries = galleryFileEntries + [ galleryFileEntry ] /> 
148	                </#if> 
149	            </#list> 
150	        </#if> 
151	         
152	        <#if galleryFileEntries?has_content> 
153	             
154	            <article class="client-article"> 
155		            <a href="#" id="gallery${articleId}"> 
156		            	<div class="img-overlay"> 
157				            <div class="background"></div> 
158				            <div class="text"> 
159				            	<p>${nombre}</p> 
160				            </div> 
161				            <div class="fas fa-arrow-right icon"></div> 
162				        </div> 
163		            	<#assign imgClass = "img-fluid img-short" /> 
164			            <#if blockSize == "large" > 
165			                <#assign imgClass = "img-fluid img-large" /> 
166			            </#if> 
167		            	<@adaptive_media_image["img"] class=imgClass fileVersion=imgFileEntry.getFileVersion() /> 
168		            </a> 
169	            </article> 
170	             
171	            <script type="text/javascript"> 
172 
173					$("#gallery${articleId}").click(function(event) { 
174						var pswpElement = document.querySelectorAll('.pswp')[0]; 
175 
176						//build items array 
177						var items = [ 
178							<#list galleryFileEntries as fileEntry> 
179							 
180							    <#assign imageWidth = "800" /> 
181                                <#assign imageHeight = "500" /> 
182							 
183							    <#assign fileEntryMetadata = dLFileEntryMetadataService.getFileEntryMetadata(25597, fileEntry.getFileVersion().getFileVersionId()) /> 
184	                            <#assign dDMFormValues = storageEngineManagerUtil.getDDMFormValues(fileEntryMetadata.getDDMStorageId()) /> 
185                                <#list dDMFormValues.getDDMFormFieldValuesMap().get("TIFF_IMAGE_WIDTH") as dDMFormFieldValue>   
186                                    <#assign imageWidth = dDMFormFieldValue.getValue().getString(locale) />   
187                                </#list>  
188                                <#list dDMFormValues.getDDMFormFieldValuesMap().get("TIFF_IMAGE_LENGTH") as dDMFormFieldValue> 
189                                    <#assign imageHeight = dDMFormFieldValue.getValue().getString(locale) /> 
190                                </#list>   
191                                 
192                              <!-- Aqui -->   
193                               
194                               
195                                
196                                <#assign imageHeight =  imageHeight?number * 1000 / imageWidth?number /> 
197                                 
198                                <#assign imageWidth = "1000"/> 
199                                 
200                                <#if imageHeight?number gt 1000 > 
201                                 
202                                    <#assign imageHeight =  imageHeight?number * 700 / imageWidth?number /> 
203                                    <#assign imageWidth = "700"/> 
204                                 
205                                </#if> 
206                                                     
207 
208								<#assign galleryImgUrl = "/documents/"+20127+"/"+fileEntry.getFolderId()+"/"+fileEntry.getTitle()+"/"+fileEntry.getUuid()> 
209
210								     src: "${galleryImgUrl}", 
211								     w: ${imageWidth}, 
212								     h: ${imageHeight} 
213								 }, 
214							</#list> 
215						]; 
216						//define options (if needed) 
217						var options = { 
218						 // optionName: 'option value' 
219						 // for example: 
220						 index: 0 // start at first slide 
221						}; 
222						//Initializes and opens PhotoSwipe 
223						var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options); 
224						gallery.init(); 
225						 
226						event.preventDefault(); 
227					});  
228				</script> 
229	             
230	        <#elseif !validator.equals(videoData?trim, "") > 
231	         
232	            <#assign videoDataJson = jsonFactoryUtil.createJSONObject(videoData) /> 
233	            <#assign videoFileEntry = dlAppServiceUtil.getFileEntryByUuidAndGroupId(videoDataJson.getString("uuid"), getterUtil.getLong(videoDataJson.getString("groupId"))) /> 
234	            <#assign videoUrl = "/documents/"+20127+"/"+videoFileEntry.getFolderId()+"/"+videoFileEntry.getTitle()+"/"+videoFileEntry.getUuid()> 
235	 
236	            <#assign poster = "" /> 
237	            <#assign imageUrl = "/documents/"+20127+"/"+imgFileEntry.getFolderId()+"/"+imgFileEntry.getTitle()+"/"+imgFileEntry.getUuid() /> 
238	            <#assign poster = 'poster="' + imageUrl + '"' /> 
239	             
240	            <article class="client-article"> 
241		            <a data-toggle="modal" href="#modal${articleId}"> 
242		            	<#assign imgClass = "img-fluid img-short" /> 
243			            <#if blockSize == "large" > 
244			                <#assign imgClass = "img-fluid img-large" /> 
245			            </#if> 
246		            	<@adaptive_media_image["img"] class=imgClass fileVersion=imgFileEntry.getFileVersion() /> 
247		            	<div class="icon-right"> 
248				              <img class="img-fluid" src="/o/fagor-industrial-portal-theme/images/video-icon.png"> 
249				        </div> 
250		            </a> 
251		            <div class="text-left"><p>${nombre}</p></div> 
252		             
253					<div id="modal${articleId}" class="modal fade clients-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> 
254						<div class="fagor-modal-dialog modal-dialog modal-dialog-centered modal-lg" role="document"> 
255					    	<div class="modal-content"> 
256						      	<div class="modal-body"> 
257						        	<video id="video${articleId}" controls ${poster}> 
258						                <source src="${videoUrl}" type="video/mp4"> 
259						                Your browser does not support the video tag. 
260						            </video> 
261						      	</div> 
262					    	</div> 
263					  	</div> 
264					</div> 
265				</article> 
266				<script type="text/javascript"> 
267					$("#modal${articleId}").on("hidden.bs.modal", function () { 
268						var vid = document.getElementById("video${articleId}"); 
269						vid.pause();  
270					}); 
271				</script> 
272	        	 
273	        <#else> 
274	         
275	        	<article class="client-article"> 
276	        		<#assign imgClass = "img-fluid img-short" /> 
277		            <#if blockSize == "large" > 
278		                <#assign imgClass = "img-fluid img-large" /> 
279		            </#if> 
280	            	<@adaptive_media_image["img"] class=imgClass fileVersion=imgFileEntry.getFileVersion() /> 
281	            	<div class="text-left"><p>${nombre}</p></div> 
282	            </article> 
283	             
284	        </#if> 
285         
286        </#if> 
287    </#if> 
288</#macro>