Repository navigation
Expand file tree
/
Copy pathproduct_amana_info.jsp
More file actions
1062 lines (950 loc) · 34 KB
/
Copy pathproduct_amana_info.jsp
File metadata and controls
1062 lines (950 loc) · 34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<%@ page import="com.fry.ocp.catalog.Category,
com.fry.ocp.catalog.Product,
com.fry.ocp.catalog.ProductManager,
com.fry.ocp.util.StringUtil,
com.fry.wp.multisite.catalog.WhirlpoolProductAttributeGroupManager,
com.fry.wp.multisite.catalog.WhirlpoolProductManager,
com.fry.wp.multisite.catalog.ProductFeature,
com.fry.wp.multisite.site.SiteManager,
com.fry.wp.multisite.util.ProductFeaturesKeyComparator,
com.fry.wp.multisite.utils.CatalogUtils,
com.fry.wp.multisite.util.i18n.I18NUtil,
com.fry.wp.multisite.utils.MultiSiteWebUtil,
java.util.LinkedHashMap,
com.fry.ocp.cms.CMSManager,
com.fry.wp.multisite.site.SiteUtil,
com.fry.ocp.cms.PageManager,
com.fry.ocp.cms.Page,
com.fry.ocp.cms.Section" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Set" %>
<%@ page import="java.util.SortedSet" %>
<%@ page import="java.util.TreeSet" %>
<%@ page import="java.util.Comparator" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.fry.wp.multisite.util.ProductUtil" %>
<%@ page import="com.fry.wp.multisite.util.SEOUtil" %>
<%@ page import="com.fry.ocp.catalog.CategoryManager" %>
<%
/*
Copyright (C) 2005 Fry Inc., All Rights Reserved.
Purpose:
To display additional product information using Tab Component such as:
Description, Features, etc.
*/
%>
<%@ taglib uri="/WEB-INF/ocp-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/ocp-catalog.tld" prefix="catalog" %>
<%@ taglib uri="/WEB-INF/ocp-command.tld" prefix="command" %>
<%@ taglib uri="/WEB-INF/ocp-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/ocp-util.tld" prefix="util" %>
<%@ taglib uri="/WEB-INF/ocp-user.tld" prefix="user" %>
<%@ taglib uri="/WEB-INF/ocp-site.tld" prefix="site" %>
<%@ taglib uri="/WEB-INF/ocp-cms.tld" prefix="cms" %>
<%@ taglib uri="/WEB-INF/ocp-i18n.tld" prefix="i18n" %>
<site:site id="currentSite"/>
<i18n:bundle base="com.fry.wp.multisite.i18n.WPResourceBundle"
locale='<%=SiteManager.getLocale(currentSite, request)%>'/>
<user:user id="user"/>
<%
/*
Constants
*/
final String PANEL1 = "panel1";
final String PANEL2 = "panel2";
final String PANEL3 = "panel3";
final String PANEL4 = "panel4";
final String PANEL5 = "panel5";
final String PANEL6 = "panel6";
final String PANEL7 = "panel7";
String baseImagePath = currentSite.getImagePath(); //storefront image directory, preceded by domain //
/*
Get product
*/
String productId = (request.getParameter("productId") == null) ? "" : request.getParameter("productId");
LinkedHashMap specifications = (LinkedHashMap)request.getAttribute("specifications");
LinkedHashMap specifications1 = (LinkedHashMap)request.getAttribute("specifications1");
/*
Get category and parent category
*/
String parentCategoryId = (request.getParameter("parentCategoryId") == null) ? "" : request.getParameter("parentCategoryId");
String categoryId = (request.getParameter("categoryId") == null) ? "" : request.getParameter("categoryId");
//Category parentCategory = StringUtil.isLong(parentCategoryId) ? CategoryManager.getCategory(Long.parseLong(parentCategoryId)) : null;
//Category category = StringUtil.isLong(categoryId) ? CategoryManager.getCategory(Long.parseLong(categoryId)) : null;
Product product;
if (!StringUtil.isEmpty(productId) && StringUtil.isLong(productId)) {
try {
product = ProductManager.getProduct(Long.parseLong(productId));
} catch (Exception ex) {
product = null;
System.out.println(ex.getMessage());
}
} else {
throw new javax.servlet.jsp.JspException("The productId was invalid. It's value was " + productId);
}
String prodLongDesc;
LinkedHashMap features;
//LinkedHashMap specifications;
//LinkedHashMap specifications1;
List entityFiles;
List relatedProducts;
List productAccessories;
String defaultTab = "";
boolean showDesciptionTab = true;
boolean showFeaturesTab = true;
boolean showSpecificationsTab = true;
boolean showLiteratureTab = true;
boolean showReviewsTab = false;//Commented out the reviews tab.
boolean showRelatedTab = true;
boolean showAccessoriesTab = true;
boolean showVideosTab = false;
com.fry.ocp.catalog.EntityFile useCareFile = null;
if (product != null) {
/*
Get long product description
*/
prodLongDesc = product.getString("LONG_DESCRIPTION");
/*
Get Features list
*/
try {
features = (LinkedHashMap)WhirlpoolProductAttributeGroupManager.findProductAttributeGroupsSorted(Long.parseLong(productId), "SF1", true);
} catch (Exception ex) {
features = null;
System.out.println(ex.getMessage());
}
/*
Get Literature and videos for product
*/
try {
entityFiles = product.getEntityFiles(true);
} catch (Exception ex) {
entityFiles = null;
System.out.println(ex.getMessage());
}
/*
Get Related Product list
*/
relatedProducts = WhirlpoolProductManager.getRelatedProducts(Long.parseLong(productId), true);
/*
Get Accessories for product
*/
productAccessories = WhirlpoolProductManager.getProductAccessories(Long.parseLong(productId), true);
/*
Check whether or not show Features Tab
*/
if (features == null || features.size() == 0 || (features.keySet().iterator().hasNext() && features.keySet().iterator().next() == null)) {
showFeaturesTab = false;
} else if ("".equals(defaultTab)) {
defaultTab = PANEL1;
}
/*
Check whether or not show Literature Tab
*/
if (entityFiles == null || entityFiles.size() == 0) {
showLiteratureTab = false;
} else if ("".equals(defaultTab)) {
defaultTab = PANEL2;
}
if (entityFiles != null){
for(int i=0;i<entityFiles.size();i++){
com.fry.ocp.catalog.EntityFile entityFile = (com.fry.ocp.catalog.EntityFile) entityFiles.get(i);
String referenceKey = entityFile.getString("REFERENCE_KEY");
if (WhirlpoolProductManager.REF_KEY_VIDEO.equals(referenceKey)) {
showVideosTab = true;
} else if ("USECARE".equals(referenceKey)) {
useCareFile = entityFile;
}
}
}
/*
Check whether or not show accessories Tab
*/
if (productAccessories == null || productAccessories.size() == 0) {
showAccessoriesTab = false;
} else if ("".equals(defaultTab)) {
defaultTab = PANEL3;
}
/*
Check whether or not show relatedProducts Tab
*/
if (relatedProducts == null || relatedProducts.size() == 0) {
showRelatedTab = false;
} else if ("".equals(defaultTab)) {
defaultTab = PANEL4;
}
/*
Check whether or not show Description Tab
*/
if (StringUtil.isEmpty(prodLongDesc)) {
showDesciptionTab = false;
} else if ("".equals(defaultTab)) {
defaultTab = PANEL5;
}
/*
Check whether or not show Specifications Tab
*/
if ((specifications == null || specifications.size() == 0 || (specifications.keySet().iterator().hasNext() && specifications.keySet().iterator().next() == null)) &&
(specifications1 == null || specifications1.size() == 0 || (specifications1.keySet().iterator().hasNext() && specifications1.keySet().iterator().next() == null))) {
showSpecificationsTab = false;
} else if ("".equals(defaultTab)) {
defaultTab = PANEL6;
}
List listCategory = product.getCategories();
Category parentCategory = CatalogUtils.getRootCategoryFromProduct(product);
Category category = null;
if (listCategory != null && listCategory.size() > 0) {
category = (Category) listCategory.get(0);
}
String pageTitle = (String) request.getAttribute("pageTitle");
String categoryName = MultiSiteWebUtil.replaceHtmlCharacters(category == null ? "" : category.getString("DESCRIPTION"));
String parentCategoryName = MultiSiteWebUtil.replaceHtmlCharacters(parentCategory == null ? "" : parentCategory.getString("DESCRIPTION"));
String productModel = product.getString("STYLE");
String productName = product.getString("NAME");
%>
<% final String baseImagePathEx = request.getContextPath() + baseImagePath; %>
<% String devBaseImagePath = "/assets/amana/images/sitesection/product/"; %>
<% String warrantyContent = ""; %>
<!-- START Features panel -->
<% if (showFeaturesTab) {
%>
<!-- "add-features" just a tem. solution until rebuilfd is complete. will change to "key-features" for top five and then add-features will follow. -->
<jsp:include page="product_amana_key_features.jsp">
<jsp:param name="productId" value="<%=productId%>"/>
</jsp:include>
<div id="add-features" class="section">
<h2>Explore Key Features</h2>
<table cellpadding=0 cellspacing=0 border=0 class="features"><tr>
<%
// TSK0085: The 'Warranty' features should always be last
// Set keySetFeatures = new TreeSet(new ProductFeaturesKeyComparator());
// keySetFeatures.addAll(features.keySet());
Set keySetFeatures = features.keySet();
%>
<logic:iterator id="keyIter" type="java.lang.Object" collection="<%=keySetFeatures%>" >
<%
SortedSet prodFeatures = (SortedSet) features.get(keyIter);
boolean isWarranty = false;
if("Warranty".equals(keyIter)) {
isWarranty = true;
}
// Get the product feature list
Iterator it = prodFeatures.iterator();
List longDescList = new ArrayList();
while (it.hasNext()) {
ProductFeature pf = (ProductFeature)it.next();
if(isWarranty){
warrantyContent = pf.getDisplayName();
}
if ("Benefit".equals(pf.getType()) && !StringUtil.isEmpty(pf.getValue())){
longDescList.add(pf);
}
}
int counter = -1;
%>
<logic:iterator id="prodFeature" type="com.fry.wp.multisite.catalog.ProductFeature"
collection="<%=prodFeatures%>" >
<%if (!"Benefit".equals(prodFeature.getType())) {
boolean showMoreHref = false;
String moreHref = "";
String longDesc = "";
for (int i = 0; i < longDescList.size(); ++i) {
ProductFeature pf = (ProductFeature)longDescList.get(i);
longDesc = pf.getValue();
if (prodFeature.getDisplayName().equals(pf.getDisplayName())) {
showMoreHref = true;
moreHref = "javascript:openWindow('/catalog/product_amana_feature_popup.jsp?parentCategoryId="+parentCategoryId+"&categoryId="+categoryId+"&productId="+productId+"&featureKey="+ pf.getProductAttributeId() +"','product_popup',440,300)";
break;
}
}
%>
<%if (!isWarranty) {
counter++;
if(counter == 3) {
counter=0;
%>
</tr><tr>
<%
}
%>
<td valign="top">
<h4><%=prodFeature.getDisplayName()%></h4>
<%if (showMoreHref) { %>
<p><%=longDesc%></p>
<%}%>
</td>
<%}%>
<%
}
%>
</logic:iterator>
</logic:iterator>
</tr></table>
</div>
<% } %>
<!-- END Features panel -->
<!-- START Specifications panel -->
<% if (showSpecificationsTab) { %>
<div id="specifications" class="section">
<h2>Specifications Guide</h2>
<div id="table-wrapper">
<%
Set keySetSpecs = specifications.keySet();
Set keySetSpecs1 = specifications1.keySet();
%>
<logic:iterator id="keySpec" type="java.lang.Object" collection="<%=keySetSpecs%>">
<%
SortedSet prodSpecs = (SortedSet) specifications.get(keySpec);
int index = 0;
%>
<table cellpadding="0" cellspacing="0" class="spec-table">
<thead>
<tr>
<th colspan="2"><%=keySpec%></th>
</tr>
</thead>
<tbody>
<logic:iterator id="prodSpec" type="com.fry.wp.multisite.catalog.ProductFeature" collection="<%=prodSpecs%>">
<tr>
<td class="row-title"><%=prodSpec.getDisplayName()%></td>
<td><%=prodSpec.getValue()%></td>
<%
index++;
%>
</tr>
</logic:iterator>
</tbody>
</table>
</logic:iterator>
<!--Electrical Requirements.-->
<logic:iterator id="keySpec" type="java.lang.Object" collection="<%=keySetSpecs1%>">
<%
SortedSet prodSpecs = (SortedSet) specifications1.get(keySpec);
int index = 0;
%>
<h5><%=keySpec%></h5>
<ul>
<logic:iterator id="prodSpec" type="com.fry.wp.multisite.catalog.ProductFeature" collection="<%=prodSpecs%>">
<li><%=prodSpec.getValue()%></li>
<%
index++;
%>
</logic:iterator>
</ul>
</logic:iterator>
</div>
<div id="spec-right-col">
<% String warrantyDocumentUrl = "";
String warrantyOnClick = "";
String warrantyDisplayName = "";
boolean isWarranty = false;
%>
<div id="guides">
<h5>Guides</h5>
<ul class="guides">
<logic:iterator id="file" type="com.fry.ocp.catalog.EntityFile" collection="<%=entityFiles%>">
<%
String referenceKey = file.getString("REFERENCE_KEY");
String dirPrefix = "/";
String docType = "";
boolean hasDocument = false;
if ("USECARE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_USECARE + "/";
docType = "Use and Care";
hasDocument = true;
} else if ("INSTALLGUIDE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_INSTALLGUIDE + "/";
docType = "Installation Instructions";
hasDocument = true;
} else if ("ENERGYGUIDE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_ENERGYGUIDE + "/";
docType = "Energy Guide";
hasDocument = true;
} else if ("DIMENSIONGUIDE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_DIMENSIONGUIDE + "/";
docType = "Dimension Guide";
hasDocument = true;
}
// TSK0030 Added by Phuong Ngo Thi Bich on 10/04/07
else if ("COMMERCIALSPECIFICATIONS".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_COMMERCIALSPECIFICATIONS + "/";
docType = "Commercial Specifications";
hasDocument = true;
}
// End TSK0030 Added by Phuong Ngo Thi Bich on 10/04/07
// Start "Show WARRANTY" Added by Chuong Nguyen on 09/09/08
else if ("WARRANTY".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_WARRANTY + "/";
docType = "Warranty";
isWarranty = true;
}
// End "Show WARRANTY" Added by Chuong Nguyen on 09/09/08
//Additional Document Types: Buy Guide, Specification Sheet
else if (WhirlpoolProductManager.REF_KEY_BUYGUIDE.equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_BUYGUIDE + "/";
docType = "Buy Guide";
hasDocument = true;
}
else if (WhirlpoolProductManager.REF_KEY_SPECIFICATION_SHEET.equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_SPECIFICATION_SHEET + "/";
docType = "Specification Sheet";
hasDocument = true;
}
String documentUrl = currentSite.getBaseAssetsDir() + currentSite.getString("PRODUCT_DOCS_PATH") + dirPrefix + file.getString("FILE_URL");
String dcsuri = "/assets/" + currentSite.getString("PRODUCT_DOCS_PATH") + dirPrefix + file.getString("FILE_URL");
String displayName = file.getString("DISPLAY_NAME");
String pdfName = (String) product.get("STYLE");
if (displayName == null || "".equals(displayName)) {
displayName = file.getString("FILE_URL");
}
if (StringUtil.isEmpty(pdfName)) {
pdfName = categoryName;
}
else {
pdfName += " - " + categoryName;
}
displayName += " (" + file.getString("FILE_SIZE") + ")";
String onclick = "dcsMultiTrack('WT.pn','','WT.pn_sc','','WT.pc','','WT.si_n','','WT.si_p','','DCS.dcsuri','" + dcsuri + "','WT.ti', 'PDF From Product Page','WT.cg_n','PDF From Product Page', 'WT.cg_s', '" + docType + "','DCSext.pdforigin','From Product Page','DCSext.pdftype','" + docType + "','DCSext.pdfname','" + pdfName + "');";
if(isWarranty){
isWarranty = false;
warrantyDisplayName = displayName;
warrantyOnClick = onclick;
warrantyDocumentUrl = documentUrl;
}
//TSK0030 Modified by Phuong Ngo Thi Bich on 10/04/07
if (hasDocument) {
%>
<li>
<span class="icon"></span>
<html:a href='<%=documentUrl%>' onClick="<%=onclick%>" ><%=displayName%></html:a>
</li>
<%
}
%>
</logic:iterator>
</ul>
</div>
<div id="warranty">
<h5>Warranty</h5>
<p><%=warrantyContent%></p>
<ul class="guides">
<li>
<span class="icon"></span>
<html:a href='<%=warrantyDocumentUrl%>' onClick='<%=warrantyOnClick %>'><%=warrantyDisplayName%></html:a>
</li>
</ul>
</div>
</div>
</div>
<% } %>
<!-- END Specifications panel -->
<!-- START Product Literature panel -->
<% if (showLiteratureTab) { %>
<div class="panel" id="panel2" style='display: <%=defaultTab.equals(PANEL2)?"block":"none"%>'>
<table cellspacing="0" cellpadding="0" id="lit-table">
<logic:iterator id="file" type="com.fry.ocp.catalog.EntityFile" collection="<%=entityFiles%>">
<%
String referenceKey = file.getString("REFERENCE_KEY");
String dirPrefix = "/";
String docType = "";
boolean hasDocument = false;
if ("USECARE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_USECARE + "/";
docType = "Use and Care";
hasDocument = true;
} else if ("INSTALLGUIDE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_INSTALLGUIDE + "/";
docType = "Installation Instructions";
hasDocument = true;
} else if ("ENERGYGUIDE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_ENERGYGUIDE + "/";
docType = "Energy Guide";
hasDocument = true;
} else if ("DIMENSIONGUIDE".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_DIMENSIONGUIDE + "/";
docType = "Dimension Guide";
hasDocument = true;
}
// TSK0030 Added by Phuong Ngo Thi Bich on 10/04/07
else if ("COMMERCIALSPECIFICATIONS".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_COMMERCIALSPECIFICATIONS + "/";
docType = "Commercial Specifications";
hasDocument = true;
}
// End TSK0030 Added by Phuong Ngo Thi Bich on 10/04/07
// Start "Show WARRANTY" Added by Chuong Nguyen on 09/09/08
else if ("WARRANTY".equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_WARRANTY + "/";
docType = "Warranty";
hasDocument = true;
}
// End "Show WARRANTY" Added by Chuong Nguyen on 09/09/08
//Additional Document Types: Buy Guide, Specification Sheet
else if (WhirlpoolProductManager.REF_KEY_BUYGUIDE.equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_BUYGUIDE + "/";
docType = "Buy Guide";
hasDocument = true;
}
else if (WhirlpoolProductManager.REF_KEY_SPECIFICATION_SHEET.equals(referenceKey)) {
dirPrefix = "/" + WhirlpoolProductManager.DIRECTORY_PREFIX_SPECIFICATION_SHEET + "/";
docType = "Specification Sheet";
hasDocument = true;
}
String documentUrl = currentSite.getBaseAssetsDir() + currentSite.getString("PRODUCT_DOCS_PATH") + dirPrefix + file.getString("FILE_URL");
String dcsuri = "/assets/" + currentSite.getString("PRODUCT_DOCS_PATH") + dirPrefix + file.getString("FILE_URL");
String displayName = file.getString("DISPLAY_NAME");
String pdfName = (String) product.get("STYLE");
if (displayName == null || "".equals(displayName)) {
displayName = file.getString("FILE_URL");
}
if (StringUtil.isEmpty(pdfName)) {
pdfName = categoryName;
}
else {
pdfName += " - " + categoryName;
}
displayName += " (" + file.getString("FILE_SIZE") + ")";
String onclick = "dcsMultiTrack('WT.pn','','WT.pn_sc','','WT.pc','','WT.si_n','','WT.si_p','','DCS.dcsuri','" + dcsuri + "','WT.ti', 'PDF From Product Page','WT.cg_n','PDF From Product Page', 'WT.cg_s', '" + docType + "','DCSext.pdforigin','From Product Page','DCSext.pdftype','" + docType + "','DCSext.pdfname','" + pdfName + "');";
//TSK0030 Modified by Phuong Ngo Thi Bich on 10/04/07
if (hasDocument) {
%>
<tr>
<td><html:img src='<%=devBaseImagePath + "/img-pdf-icon.gif"%>' alt="PDF" /></td>
<td><html:a href='<%=documentUrl%>' onClick="<%=onclick%>" ><%=displayName%></html:a></td>
</tr>
<%
}
%>
</logic:iterator>
</table>
<dl id="get-reader">
<dt>
<html:a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">
<html:img src='<%=devBaseImagePath + "/img-acrobat-icon.gif"%>' alt='<%=I18NUtil.getString(SiteManager.getLocale(currentSite, request), "product_info.Get_Adobe_Reader", "Get Adobe Reader")%>' />
</html:a>
</dt>
<dd>You may need to install Adobe Acrobat Reader to view these documents.</dd>
</dl>
</div>
<% } %>
<!-- END Product Literature panel -->
<!-- START Reviews panel -->
<% if (showReviewsTab) { %>
<div class="panel" id="panel5" style='display: <%=defaultTab.equals(PANEL5)?"block":"none"%>;'>
</div>
<% } %>
<!-- END Description panel -->
<%
int acsSize = productAccessories.size();
boolean event = (acsSize % 2 == 0);
Product prod1;
Product prod2;
String productName1;
String productName2;
String productModel1;
String productModel2;
boolean showMSRP;
Category relatedCat1;
Category relatedCat2;
Category relatedParentCat1 = null;
Category relatedParentCat2 = null;
String thumbnailImage1;
String thumbnailImage2;
String productUrl1;
String productUrl2;
String productMSRP1;
String productMSRP2;
%>
<!-- START Related Products panel -->
<% if (showRelatedTab) { %>
<div id="relatedProduct" class="section">
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding:0 10px;">
<%
int relatedSize = relatedProducts.size();
event = (relatedSize % 2 == 0);
/*
Check whether or not show MSRP
*/
showMSRP = "Y".equals(currentSite.getString("PROD_BROWSE_DISPLAY_MSRP"));
for (int i = 0; i < relatedSize - 1; i = i + 2) {
/*
Get product from Product list
*/
prod1 = (Product) relatedProducts.get(i);
prod2 = (Product) relatedProducts.get(i + 1);
/*
Get product name
*/
productName1 = prod1.getString("NAME");
productName2 = prod2.getString("NAME");
/*
Get product Model
*/
productModel1 = prod1.getString("STYLE");
productModel2 = prod2.getString("STYLE");
/*
Product link point to Product Detail page
*/
Category[] categories = CatalogUtils.getCategoriesFromProduct(prod1);
productUrl1 = SEOUtil.buildProductURL(prod1, categories[2], categories[1], null);
categories = CatalogUtils.getCategoriesFromProduct(prod2);
productUrl2 = SEOUtil.buildProductURL(prod2, categories[2], categories[1], null);
/*
Get product thumnail image
*/
thumbnailImage1 = MultiSiteWebUtil.getThumbnailImage(currentSite, prod1);
thumbnailImage2 = MultiSiteWebUtil.getThumbnailImage(currentSite, prod2);
/*
Get product MSRP
*/
productMSRP1 = MultiSiteWebUtil.getProductPrice(prod1);
productMSRP2 = MultiSiteWebUtil.getProductPrice(prod2);
%>
<tr valign="top">
<td class="rel-prod-image">
<html:a href="<%=productUrl1%>">
<html:img src="<%=thumbnailImage1%>" alt="<%=productName1%>" border="0"/>
</html:a>
</td>
<td>
<html:a href="<%=productUrl1%>"><b><%=productName1%>
</b></html:a>
<br/>
<i18n:message key="product_info.Model">Model</i18n:message>
<html:a href="<%=productUrl1%>" styleClass="dark"><%=productModel1%>
</html:a>
<br/>
<logic:if expression="<%=showMSRP%>">
<i18n:message key="product_compare.MSRP">MSRP*</i18n:message>
<%=productMSRP1 == null ? "" : productMSRP1%><br />
</logic:if>
<html:a href="<%=productUrl1%>" styleClass="view-prod-link">View product</html:a>
</td>
<td class="rel-prod-image">
<html:a href="<%=productUrl2%>">
<html:img src="<%=thumbnailImage2%>" alt="<%=productName2%>" border="0"/>
</html:a>
</td>
<td>
<html:a href="<%=productUrl2%>"><b><%=productName2%></b></html:a><br/>
<i18n:message key="product_info.Model">Model</i18n:message>
<html:a href="<%=productUrl2%>" styleClass="dark"><%=productModel2%>
</html:a>
<br/>
<logic:if expression="<%=showMSRP%>">
<i18n:message key="product_compare.MSRP">MSRP*</i18n:message>
<%=productMSRP2 == null ? "" : productMSRP2%><br />
</logic:if>
<html:a href="<%=productUrl2%>" styleClass="view-prod-link">View product</html:a>
</td>
</tr>
<%
if (event && i != (relatedSize - 2)) {
%>
<tr>
<td colspan="4"><br/><br/></td>
</tr>
<%
}
if (!event && relatedSize != 1) {
%>
<tr>
<td colspan="4"><br/><br/></td>
</tr>
<%
}
}
%>
<%
if (!event) {
/*
Get product from Product list
*/
prod1 = (Product) relatedProducts.get(relatedSize - 1);
/*
Get product name
*/
productName1 = prod1.getString("NAME");
/*
Get product Model
*/
productModel1 = prod1.getString("STYLE");
/*
Product link point to Product Detail page
*/
Category[] categories = CatalogUtils.getCategoriesFromProduct(prod1);
productUrl1 = SEOUtil.buildProductURL(prod1, categories[2], categories[1], null);
/*
Get product thumnail image
*/
thumbnailImage1 = MultiSiteWebUtil.getThumbnailImage(currentSite, prod1);
/*
Get product MSRP
*/
productMSRP1 = MultiSiteWebUtil.getProductPrice(prod1);
%>
<tr valign="top">
<td width="25%">
<html:a href="<%=productUrl1%>">
<html:img src="<%=thumbnailImage1%>" alt="<%=productName1%>" border="0"/>
</html:a>
</td>
<td width="25%">
<html:a href="<%=productUrl1%>"><b><%=productName1%>
</b></html:a>
<br/>
<i18n:message key="product_info.Model">Model</i18n:message>
<html:a href="<%=productUrl1%>" styleClass="dark"><%=productModel1%>
</html:a>
<br/>
<logic:if expression="<%=showMSRP%>">
<i18n:message key="product_compare.MSRP">MSRP*</i18n:message>
<%=productMSRP1 == null ? "" : productMSRP1%><br/>
</logic:if>
<html:a href="<%=productUrl1%>" styleClass="view-prod-link">View product</html:a>
</td>
<td> </td>
<td> </td>
</tr>
<%
}
%>
</table>
</div>
<% } %>
<!-- END Related Products panel -->
<!-- START Accessories panel -->
<% if (showAccessoriesTab) { %>
<%
String topRow = "";
String midRow = "";
String bottomRow = "";
%>
<div id="accessories" class="section">
<h2>Parts and Accessories</h2>
<table border="0" cellspacing="0" cellpadding="0" id="zoomViewProductSlider">
<tbody>
<tr>
<td>
<div id="mpLeftArrow" class="iconSprite leftArrow mouseout"></div>
</td>
<td align="center">
<div align="center" class="sliderView" id="miniProductViewPort">
<table cellpadding=0 cellspacing=0 border=0>
<%
showMSRP = "Y".equals(currentSite.getString("PROD_BROWSE_DISPLAY_MSRP"));
for (int i = 0; i < acsSize - 1; i = i + 2) {
/*
Get product from Product list
*/
prod1 = (Product) productAccessories.get(i);
prod2 = (Product) productAccessories.get(i + 1);
/*
Get product name
*/
productName1 = prod1.getString("NAME");
productName2 = prod2.getString("NAME");
/*
Get product Model
*/
productModel1 = prod1.getString("STYLE");
productModel2 = prod2.getString("STYLE");
/*
Get category & parent category
*/
//prod 1
try {
List relatedCats1 = prod1.getCategories(true);
if (relatedCats1 != null && relatedCats1.size() != 0) {
relatedCat1 = (Category) relatedCats1.get(0);
} else {
relatedCat1 = null;
}
Set relatedParentCats1;
if (relatedCat1 != null) {
relatedParentCats1 = relatedCat1.getAllParentCategories(true);
if (relatedParentCats1 != null && relatedParentCats1.size() != 0) {
relatedParentCat1 = (Category) relatedParentCats1.iterator().next();
} else {
relatedParentCat1 = null;
}
}
} catch (Exception ex) {
relatedCat1 = null;
relatedParentCat1 = null;
}
//prod 2
try {
List relatedCats2 = prod2.getCategories(true);
if (relatedCats2 != null && relatedCats2.size() != 0) {
relatedCat2 = (Category) relatedCats2.get(0);
} else {
relatedCat2 = null;
}
Set relatedParentCats2;
if (relatedCat2 != null) {
relatedParentCats2 = relatedCat2.getAllParentCategories(true);
if (relatedParentCats2 != null && relatedParentCats2.size() != 0) {
relatedParentCat2 = (Category) relatedParentCats2.iterator().next();
} else {
relatedParentCat2 = null;
}
}
} catch (Exception ex) {
relatedCat2 = null;
relatedParentCat2 = null;
}
/*
Product link point to Product Detail page
*/
Category[] accessoryCategories = CatalogUtils.getCategoriesFromProduct(prod1);
productUrl1 = SEOUtil.buildAccessoryProductURL(prod1, accessoryCategories[1], accessoryCategories[0], "");
accessoryCategories = CatalogUtils.getCategoriesFromProduct(prod2);
productUrl2 = SEOUtil.buildAccessoryProductURL(prod2, accessoryCategories[1], accessoryCategories[0], "");
/*
Get product thumnail image
*/
thumbnailImage1 = MultiSiteWebUtil.getThumbnailImage(currentSite, prod1);
thumbnailImage2 = MultiSiteWebUtil.getThumbnailImage(currentSite, prod2);
/*
Get product MSRP
*/
productMSRP1 = MultiSiteWebUtil.getProductPrice(prod1);
productMSRP2 = MultiSiteWebUtil.getProductPrice(prod2);
%>
<%
topRow += "<td valign='top'><div><a href='"+productUrl2+"'><img class='miniProductSliderImg' src='"+thumbnailImage2+"' alt='"+productName2+"' border=0></a></div></td>";
midRow += "<td valign='top'><div><a href='"+productUrl2+"' class='prodName'>"+productName2+"</a></div></td>";
if(showMSRP){
bottomRow += "<td><div><p class='acc-price'>"+productMSRP2+"</p></div></td>";
} else {
bottomRow += "<td> </td>";
}
/**
topRow += '<td><div><a href="'+productUrl2+'"><img src="'+thumbnailImage2+'" alt="'+productName2+'" border=0/></a></td>';
midRow += '<td><a href="'+productUrl2+'" class="prodNam">"'+productName2+'"</a></td>';
if(showMSRP){
bottomRow += '<td><p class="acc-price">"'+productUrl2+'"</p></td>';
} else {
bottomRow += '<td> </td>';
}
**/
%>
<%--
<td>
<div>
<html:a href="<%=productUrl2%>">
<html:img src="<%=thumbnailImage2%>" alt="<%=productName2%>" border="0"/>
</html:a>
<html:a styleClass="prodName" href="<%=productUrl2%>"><%=productName2%></html:a>
</div>
<p class="acc-price">
<logic:if expression="<%=showMSRP%>">
<%=productMSRP2 == null ? "" : productMSRP2%>
</logic:if>
</p>
</td>
--%>
<% } %>
<tr><%=topRow%></tr>
<tr><%=midRow%></tr>
<tr><%=bottomRow%></tr>
</table>
</div>
</td>
<td>
<div id="mpRightArrow" class="iconSprite rightArrow mouseout"></div>
</td>
</tr>
</tbody>
</table>
</div>
<% } %>
<script type="text/javascript">
binder.extend();
document.ready
binder.group_arrows_simpleXslider.create(
"group_arrows_simpleXslider",
{}
);
</script>
<!-- END Accessories panel -->
<!-- START Product Videos panel -->
<% if (showVideosTab) { %>
<style>
#pdp_Wrapper #pop-outs li #vid {
display:block;
}
</style>
<%--
<div class="panel" id="panel7" style='display: <%=defaultTab.equals(PANEL7)?"block":"none"%>'>
<table cellspacing="0" cellpadding="0" id="lit-table">
<logic:iterator id="fileVideos" type="com.fry.ocp.catalog.EntityFile" collection="<%=entityFiles%>">
<%
String referenceKey = fileVideos.getString("REFERENCE_KEY");
String fileUrl = currentSite.getBaseAssetsDir() + currentSite.getString("VIDEOS_DIR") + fileVideos.getString("FILE_URL");
String displayName = fileVideos.getString("DISPLAY_NAME");
boolean hasFile = false;
if (WhirlpoolProductManager.REF_KEY_VIDEO.equals(referenceKey)) {
hasFile = true;
}
if (displayName == null || "".equals(displayName)) {
displayName = fileVideos.getString("FILE_URL");
}