Subversion Repositories SmartDukaan

Rev

Rev 9280 | Rev 10187 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9280 Rev 10168
Line 606... Line 606...
606
        return relatedAccessoriesList;
606
        return relatedAccessoriesList;
607
 
607
 
608
    }
608
    }
609
 
609
 
610
    /**
610
    /**
611
     * Get most compared phones
-
 
612
     *
-
 
613
     * @param expEntity
-
 
614
     * @param exportPath
-
 
615
     * @throws Exception
-
 
616
     */
-
 
617
    private void getMostComparedProducts(ExpandedEntity expEntity,
-
 
618
            String exportPath) throws Exception {
-
 
619
        long catalogId = expEntity.getID();
-
 
620
 
-
 
621
        Map<Long, Long> comparedPhones = CreationUtils.getComparisonStats().get(catalogId);
-
 
622
 
-
 
623
        StringBuffer sb = new StringBuffer();
-
 
624
        int maxCount = 10;
-
 
625
        int count = 0;
-
 
626
        if (comparedPhones != null) {
-
 
627
            for (Long entityID : comparedPhones.keySet()) {
-
 
628
                if (count > maxCount) {
-
 
629
                    break;
-
 
630
                }
-
 
631
                sb.append(entityID + "\n");
-
 
632
                count++;
-
 
633
            }
-
 
634
        }
-
 
635
 
-
 
636
        String exportFileName = exportPath + catalogId + File.separator
-
 
637
                + "MostComparedProducts.vm";
-
 
638
        File exportFile = new File(exportFileName);
-
 
639
        if (!exportFile.exists()) {
-
 
640
            exportFile.createNewFile();
-
 
641
        }
-
 
642
 
-
 
643
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
-
 
644
                new FileOutputStream(exportFile)));
-
 
645
 
-
 
646
        writer.write(sb.toString());
-
 
647
        writer.flush();
-
 
648
        writer.close();
-
 
649
    }
-
 
650
 
-
 
651
    /**
-
 
652
     * Get the required parameters for generating velocity content.
611
     * Get the required parameters for generating velocity content.
653
     *
612
     *
654
     * @param expEntity
613
     * @param expEntity
655
     * @return
614
     * @return
656
     * @throws Exception
615
     * @throws Exception
Line 856... Line 815...
856
        getSlidenamesSnippet(expEntity, exportPath);
815
        getSlidenamesSnippet(expEntity, exportPath);
857
        filenames.add("MyResearchSnippet");
816
        filenames.add("MyResearchSnippet");
858
        if(isComparable){
817
        if(isComparable){
859
        	filenames.add("CompareProductSummarySnippet");
818
        	filenames.add("CompareProductSummarySnippet");
860
        	filenames.add("MostComparedSnippet");
819
        	filenames.add("MostComparedSnippet");
861
        	getMostComparedProducts(expEntity, exportPath);
-
 
862
        }
820
        }
863
        if(parentCategory.isHasAccessories()){
821
        if(parentCategory.isHasAccessories()){
864
        	RelatedAccessoriesPojo rap =  new RelatedAccessoriesPojo();
822
        	RelatedAccessoriesPojo rap =  new RelatedAccessoriesPojo();
865
        	rap.setAccessories(getRelatedAccessories(expEntity, exportPath));
823
        	rap.setAccessories(getRelatedAccessories(expEntity, exportPath));
866
        	rap.setId(catalogId);
824
        	rap.setId(catalogId);