Subversion Repositories SmartDukaan

Rev

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

Rev 9171 Rev 9900
Line 120... Line 120...
120
		contentmigrator.touchEntityState(1005505l);
120
		contentmigrator.touchEntityState(1005505l);
121
		contentmigrator.touchEntityState(1006864l);*/
121
		contentmigrator.touchEntityState(1006864l);*/
122
		//contentmigrator.clearEmptyPrimitiveBullets();
122
		//contentmigrator.clearEmptyPrimitiveBullets();
123
		//contentmigrator.migrateSoftCategories();
123
		//contentmigrator.migrateSoftCategories();
124
		//contentmigrator.updateSummaryMediaLabel();
124
		//contentmigrator.updateSummaryMediaLabel();
125
		contentmigrator.updateCommunication();
125
		contentmigrator.migrateReviews();
126
	}
126
	}
127
	
127
	
128
	private void changeKeys() throws Exception {
128
	private void changeKeys() throws Exception {
129
		Map<Long, Entity>  e = CreationUtils.getEntities();
129
		Map<Long, Entity>  e = CreationUtils.getEntities();
130
		for (Map.Entry<Long, Entity> entry : e.entrySet()) {
130
		for (Map.Entry<Long, Entity> entry : e.entrySet()) {
Line 2851... Line 2851...
2851
				}
2851
				}
2852
			}
2852
			}
2853
		}
2853
		}
2854
	}
2854
	}
2855
	
2855
	
-
 
2856
	private void migrateReviews() throws Exception{
-
 
2857
		Map<Long, List<ExpertReview>> a =  CreationUtils.getExpertReviews();
-
 
2858
		for(Map.Entry<Long, List<ExpertReview>> entry : a.entrySet()) {
-
 
2859
			List<ExpertReview> ers = entry.getValue();
-
 
2860
			Iterator<ExpertReview> ersIterator = ers.iterator();
-
 
2861
			while (ersIterator.hasNext()){
-
 
2862
				ExpertReview er = ersIterator.next();
-
 
2863
				String review = er.getReviewContent();
-
 
2864
				String review1 = review.replaceAll("<[^>]+>", "");
-
 
2865
				if(review.equals("")){
-
 
2866
					ersIterator.remove();
-
 
2867
				} else if(!review.equals(review1)) {
-
 
2868
					er.setReviewContent(review1);
-
 
2869
				}
-
 
2870
			}
-
 
2871
			CreationUtils.storeExpertReview(entry.getKey(), ers);
-
 
2872
		}
-
 
2873
	}
-
 
2874
	
2856
}
2875
}
2857
 
2876