Subversion Repositories SmartDukaan

Rev

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

Rev 8749 Rev 8798
Line 106... Line 106...
106
		/*contentmigrator.touchEntityState(1008423l);
106
		/*contentmigrator.touchEntityState(1008423l);
107
		contentmigrator.touchEntityState(1008424l);
107
		contentmigrator.touchEntityState(1008424l);
108
		contentmigrator.touchEntityState(1008427l);
108
		contentmigrator.touchEntityState(1008427l);
109
		contentmigrator.touchEntityState(1008428l);*/
109
		contentmigrator.touchEntityState(1008428l);*/
110
 
110
 
111
		contentmigrator.migrateToMongo();
111
		contentmigrator.touchEntityStates();
112
	}
112
	}
113
	
113
	
114
	private void migrateToMongo() throws Exception{
114
	private void migrateToMongo() throws Exception{
115
		  Map<String,Map<String,String>> m  = CreationUtils1.getSynonyms();
115
		  Map<String,Map<String,String>> m  = CreationUtils1.getSynonyms();
116
		  CreationUtils.storeSynonyms(m);
116
		  CreationUtils.storeSynonyms(m);
Line 220... Line 220...
220
		EntityState es = CreationUtils.getEntityState(eId);
220
		EntityState es = CreationUtils.getEntityState(eId);
221
		es.setMerkedReadyOn(new Date());
221
		es.setMerkedReadyOn(new Date());
222
		CreationUtils.updateEntityState(es);
222
		CreationUtils.updateEntityState(es);
223
		//System.out.println("Entity touched:" + eId);
223
		//System.out.println("Entity touched:" + eId);
224
	}
224
	}
-
 
225
 
-
 
226
	private void touchEntityStates() throws Exception {
-
 
227
		Map<Long, EntityState> ess = CreationUtils.getEntitiesState();
-
 
228
		Calendar calReady = Calendar.getInstance();
-
 
229
		Calendar cal5daysBack = Calendar.getInstance();
-
 
230
		Date today = new Date();
-
 
231
		cal5daysBack.add(Calendar.DATE, -5);
-
 
232
		for (Map.Entry<Long, EntityState> es : ess.entrySet()) {
-
 
233
			EntityState est = es.getValue();
-
 
234
			if(est.getMerkedReadyOn()!=null){
-
 
235
				calReady.setTime(est.getMerkedReadyOn());
-
 
236
				if(calReady.compareTo(cal5daysBack) > 0){
-
 
237
					est.setMerkedReadyOn(today);
-
 
238
					CreationUtils.updateEntityState(est);
-
 
239
					System.out.println("Entity touched:" + est.getID());
-
 
240
				}
-
 
241
			}
-
 
242
		}
-
 
243
	}
225
	private void updateModelForBBQ10() throws Exception{
244
	private void updateModelForBBQ10() throws Exception{
226
		Long entityId = 1007315l;
245
		Long entityId = 1007315l;
227
		EntityState e1 = CreationUtils.getEntityState(entityId);
246
		EntityState e1 = CreationUtils.getEntityState(entityId);
228
		Entity e2 = CreationUtils.getEntity(entityId);
247
		Entity e2 = CreationUtils.getEntity(entityId);
229
		e1.setModelName("Blackkberry Q10");
248
		e1.setModelName("Blackkberry Q10");
Line 2540... Line 2559...
2540
					touchEntityState(entityId);
2559
					touchEntityState(entityId);
2541
				}
2560
				}
2542
			}
2561
			}
2543
		}
2562
		}
2544
	}
2563
	}
-
 
2564
	
2545
}
2565
}
2546
 
2566