Subversion Repositories SmartDukaan

Rev

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

Rev 8014 Rev 8077
Line 93... Line 93...
93
		ContentMigrator contentmigrator = new ContentMigrator(sourceDbPath,destinationDbPath);
93
		ContentMigrator contentmigrator = new ContentMigrator(sourceDbPath,destinationDbPath);
94
		/*List<Long> entityId = Arrays.asList(1001674l,1002575l,1005331l,1005165l,1005164l,1005111l,1005109l,1004952l,1004940l,1004871l,1004701l,1004429l,1004197l,1006174l,1006077l,1005901l,1005757l,1005754l,1005724l,1005704l,1005598l,1005576l,1005558l,1007394l,1007230l,1007226l,1007218l,1007089l,1006925l,1006822l,1006814l,1006175l);
94
		/*List<Long> entityId = Arrays.asList(1001674l,1002575l,1005331l,1005165l,1005164l,1005111l,1005109l,1004952l,1004940l,1004871l,1004701l,1004429l,1004197l,1006174l,1006077l,1005901l,1005757l,1005754l,1005724l,1005704l,1005598l,1005576l,1005558l,1007394l,1007230l,1007226l,1007218l,1007089l,1006925l,1006822l,1006814l,1006175l);
95
		for (Long eId : entityId){
95
		for (Long eId : entityId){
96
			contentmigrator.touchEntityState(eId);
96
			contentmigrator.touchEntityState(eId);
97
		}*/
97
		}*/
98
		contentmigrator.step6();
98
		contentmigrator.reorderPhones();
99
		//System.out.println(contentmigrator.getItems().size());
99
		//System.out.println(contentmigrator.getItems().size());
100
 
100
 
101
	}
101
	}
102
	
102
	
103
	private void updateSources() throws Exception{
103
	private void updateSources() throws Exception{
Line 120... Line 120...
120
	}
120
	}
121
	private void touchEntityState(Long eId) throws Exception {
121
	private void touchEntityState(Long eId) throws Exception {
122
		EntityState es = CreationUtils.getEntityState(eId);
122
		EntityState es = CreationUtils.getEntityState(eId);
123
		es.setMerkedReadyOn(new Date());
123
		es.setMerkedReadyOn(new Date());
124
		CreationUtils.updateEntityState(es);
124
		CreationUtils.updateEntityState(es);
-
 
125
		System.out.println("Entity touched:" + eId);
125
	}
126
	}
126
	private void updateModelForBBQ10() throws Exception{
127
	private void updateModelForBBQ10() throws Exception{
127
		Long entityId = 1007315l;
128
		Long entityId = 1007315l;
128
		EntityState e1 = CreationUtils.getEntityState(entityId);
129
		EntityState e1 = CreationUtils.getEntityState(entityId);
129
		Entity e2 = CreationUtils.getEntity(entityId);
130
		Entity e2 = CreationUtils.getEntity(entityId);
Line 2423... Line 2424...
2423
		} catch (FileNotFoundException e) {
2424
		} catch (FileNotFoundException e) {
2424
			e.printStackTrace();
2425
			e.printStackTrace();
2425
			return new HashMap<Long, Long>();
2426
			return new HashMap<Long, Long>();
2426
		}
2427
		}
2427
	}
2428
	}
-
 
2429
	
-
 
2430
	private void reorderPhones() throws Exception {
-
 
2431
		DefinitionsContainer defc = Catalog.getInstance().getDefinitionsContainer();
-
 
2432
		List<Long> slideSequence = defc.getCategorySlideSequence().get(10003l);
-
 
2433
		Map <Long, Entity> allEntities = CreationUtils.getEntities();
-
 
2434
		for (Map.Entry<Long, Entity> entry:allEntities.entrySet()){
-
 
2435
			Long entityId = entry.getKey();
-
 
2436
			Entity entity = entry.getValue(); 
-
 
2437
			Long categoryId = entity.getCategoryID();
-
 
2438
			//System.out.println("entity : " + entity.getID());
-
 
2439
			EntityState es = CreationUtils.getEntityState(entity.getID());
-
 
2440
			if(!es.getStatus().equals(EntityStatus.UNASSIGNED)) {
-
 
2441
				if ((categoryId == 10002 || categoryId == 10003 || categoryId == 10004 || categoryId == 10005) 
-
 
2442
						&& es != null) {
-
 
2443
					entity.setSlideSequence(slideSequence);
-
 
2444
					CreationUtils.updateEntity(entity);
-
 
2445
					touchEntityState(entityId);
-
 
2446
				}
-
 
2447
			}
-
 
2448
		}
-
 
2449
	}
2428
}
2450
}
2429
 
2451