Subversion Repositories SmartDukaan

Rev

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

Rev 7975 Rev 7984
Line 86... Line 86...
86
		ContentMigrator contentmigrator = new ContentMigrator(sourceDbPath,destinationDbPath);
86
		ContentMigrator contentmigrator = new ContentMigrator(sourceDbPath,destinationDbPath);
87
		/*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);
87
		/*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);
88
		for (Long eId : entityId){
88
		for (Long eId : entityId){
89
			contentmigrator.touchEntityState(eId);
89
			contentmigrator.touchEntityState(eId);
90
		}*/
90
		}*/
91
		contentmigrator.step2();
91
		contentmigrator.step4();
92
 
92
 
93
	}
93
	}
94
	
94
	
95
	private void updateSources() throws Exception{
95
	private void updateSources() throws Exception{
96
		Map<Long,List<ExpertReview>> erMap = CreationUtils.getExpertReviews();
96
		Map<Long,List<ExpertReview>> erMap = CreationUtils.getExpertReviews();
Line 2238... Line 2238...
2238
					Iterator<Feature> iter = keyBoardFeatures.iterator();
2238
					Iterator<Feature> iter = keyBoardFeatures.iterator();
2239
					while(iter.hasNext()){
2239
					while(iter.hasNext()){
2240
						Feature feature = iter.next();
2240
						Feature feature = iter.next();
2241
						if(feature.getFeatureDefinitionID() == 120010l){
2241
						if(feature.getFeatureDefinitionID() == 120010l){
2242
							if(slSummary!=null){
2242
							if(slSummary!=null){
2243
								slSummary.getFeatures().add(feature);
2243
							slSummary.getFeatures().add(feature);
2244
							}
2244
							}
2245
							iter.remove();
2245
							iter.remove();
2246
						}
2246
						}
2247
						if(feature.getFeatureDefinitionID() == 120082l){
2247
						if(feature.getFeatureDefinitionID() == 120082l){
2248
							slDisplay.getFeatures().add(feature);
2248
							slDisplay.getFeatures().add(feature);
Line 2283... Line 2283...
2283
				//touchEntityState(entity.getID());
2283
				//touchEntityState(entity.getID());
2284
			}
2284
			}
2285
		}
2285
		}
2286
			
2286
			
2287
	}
2287
	}
-
 
2288
	
-
 
2289
	private void step4() throws Exception {
-
 
2290
		//Get All Enum Values of Communication facilities 70114;
-
 
2291
		Map <Long, Entity> allEntities = CreationUtils.getEntities();
-
 
2292
		/*Map <Long, Entity> allEntities = new HashMap<Long, Entity>();
-
 
2293
		allEntities.put(1002529l, CreationUtils.getEntity(1002529l));
-
 
2294
		allEntities.put(1007932l, CreationUtils.getEntity(1007932l));
-
 
2295
		allEntities.put(1007930l, CreationUtils.getEntity(1007930l));
-
 
2296
		allEntities.put(1007934l, CreationUtils.getEntity(1007934l));
-
 
2297
		allEntities.put(1007936l, CreationUtils.getEntity(1007936l));
-
 
2298
		allEntities.put(1007935l, CreationUtils.getEntity(1007935l));*/
-
 
2299
		for (Map.Entry<Long, Entity> entry:allEntities.entrySet()){
-
 
2300
			Entity entity = entry.getValue();
-
 
2301
			Long categoryId = entity.getCategoryID();
-
 
2302
			EntityState es = CreationUtils.getEntityState(entity.getID());
-
 
2303
			if ((categoryId == 10002 || categoryId == 10003 || categoryId == 10004 || categoryId == 10005) && es != null && !es.getStatus().equals(EntityStatus.UNASSIGNED)) {
-
 
2304
				List<Slide> allSlides = entity.getSlides();
-
 
2305
				if(allSlides != null){
-
 
2306
					for(Slide slide:allSlides) {
-
 
2307
						if(slide!=null){
-
 
2308
							List <Feature> features = slide.getFeatures();
-
 
2309
							Iterator<Feature> fIterator = features.iterator();
-
 
2310
							while (fIterator.hasNext()){
-
 
2311
								Feature f = fIterator.next();
-
 
2312
								long fId = f.getFeatureDefinitionID();
-
 
2313
								if(fId == 120011 || fId == 120020 || fId == 120051 || fId == 120025 || fId == 120056 || fId == 120216 || fId == 120045 || fId == 120010){
-
 
2314
									fIterator.remove();
-
 
2315
								}
-
 
2316
								if(fId==120144){
-
 
2317
									String  value = "Adobe flash player";
-
 
2318
									List<Bullet> flashb = f.getBullets();
-
 
2319
									if(flashb !=null && flashb.size() > 0){
-
 
2320
										value = ((PrimitiveDataObject)flashb.get(0).getDataObject()).getValue();
-
 
2321
									}
-
 
2322
									Slide miscSlide1 = entity.getSlide(130024l);
-
 
2323
									if(miscSlide1 != null){
-
 
2324
										List <Feature> mfeatures = miscSlide1.getFeatures();
-
 
2325
										Iterator<Feature> mIterator = mfeatures.iterator();
-
 
2326
										while (mIterator.hasNext()){
-
 
2327
											Feature mf = mIterator.next();
-
 
2328
											if(mf != null){
-
 
2329
												if(mf.getFeatureDefinitionID() == 120484l){
-
 
2330
													Bullet b = mf.getBullets().get(0);
-
 
2331
													String finalValue = ((PrimitiveDataObject)b.getDataObject()).getValue() + ", " + value;
-
 
2332
													b.setDataObject(new PrimitiveDataObject(finalValue));
-
 
2333
												}
-
 
2334
											}
-
 
2335
										}
-
 
2336
									} else {
-
 
2337
										System.out.println("no misc for entity : " + entity.getID());
-
 
2338
									}
-
 
2339
									fIterator.remove();
-
 
2340
								}
-
 
2341
							}
-
 
2342
						}
-
 
2343
					}
-
 
2344
					try{
-
 
2345
						CreationUtils.updateEntity(entity);
-
 
2346
					}catch (Exception e){
-
 
2347
						System.out.println("Could not update entity : " + entity.getID());
-
 
2348
					}
-
 
2349
					touchEntityState(entity.getID());
-
 
2350
				}
-
 
2351
			}
-
 
2352
		}
-
 
2353
	}
2288
}
2354
}
2289
 
2355