Subversion Repositories SmartDukaan

Rev

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

Rev 7966 Rev 7971
Line 1632... Line 1632...
1632
    public String getFormattedDate(Date date){
1632
    public String getFormattedDate(Date date){
1633
    	return sdf.format(date);
1633
    	return sdf.format(date);
1634
    }
1634
    }
1635
    
1635
    
1636
    public Map<Long, Double> getScores() throws Exception{
1636
    public Map<Long, Double> getScores() throws Exception{
-
 
1637
    	Long entityId = Long.parseLong(this.id);
1637
    	EntityState es = CreationUtils.getEntityState(entityId);
1638
    	EntityState es = CreationUtils.getEntityState(entityId);
1638
    	if (es!=null && es.getCategoryID() > 0) {
1639
    	if (es!=null && es.getCategoryID() > 0) {
1639
	    	Category c = Catalog.getInstance().getDefinitionsContainer().getCategory(es.getCategoryID());
1640
	    	Category c = Catalog.getInstance().getDefinitionsContainer().getCategory(es.getCategoryID());
1640
	    	if(c.isComparable() &&(es.equals(EntityStatus.COMPLETE) || es.equals(EntityStatus.READY))){
1641
	    	if(c.isComparable() &&(es.getStatus().equals(EntityStatus.COMPLETE) || es.getStatus().equals(EntityStatus.READY))){
1641
		    	NewCMP cmp = new NewCMP(Arrays.asList(this.entity));
1642
		    	NewCMP cmp = new NewCMP(Arrays.asList(this.entity));
1642
		    	Map<Long, Double> score = null;
1643
		    	Map<Long, Double> score = null;
1643
				try {
1644
				try {
1644
					Map<Long, Map<Long, Double>> scoreMap = cmp.getSlideScores();
1645
					Map<Long, Map<Long, Double>> scoreMap = cmp.getSlideScores();
1645
					score = scoreMap.get(Long.parseLong(this.id));
1646
					score = scoreMap.get(entityId);
1646
					score.put(130054L, cmp.getFinalScores(scoreMap).get(Long.parseLong(this.id))/10);
1647
					score.put(130054L, cmp.getFinalScores(scoreMap).get(entityId)/10);
1647
					
1648
					
1648
				} catch (Exception e) {
1649
				} catch (Exception e) {
1649
					System.out.println("Some error occurred");
1650
					System.out.println("Some error occurred");
1650
					e.printStackTrace();
1651
					e.printStackTrace();
1651
				}
1652
				}