Subversion Repositories SmartDukaan

Rev

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

Rev 7932 Rev 7933
Line 2146... Line 2146...
2146
			ExpandedEntity expEntity = new ExpandedEntity(entity);
2146
			ExpandedEntity expEntity = new ExpandedEntity(entity);
2147
			Slide miscSlide = expEntity.getSlide(130024l);
2147
			Slide miscSlide = expEntity.getSlide(130024l);
2148
			if(miscSlide != null) {
2148
			if(miscSlide != null) {
2149
				List<Feature> miscFeatures = miscSlide.getFeatures();
2149
				List<Feature> miscFeatures = miscSlide.getFeatures();
2150
				if(CollectionUtils.isNotEmpty(miscFeatures)){
2150
				if(CollectionUtils.isNotEmpty(miscFeatures)){
2151
					for (Feature f : miscFeatures) {
2151
					Iterator<Feature> iter = miscFeatures.iterator();
-
 
2152
					while(iter.hasNext()) {
2152
						if (f.getFeatureDefinitionID() == 120484l){
2153
						Feature f =iter.next();
-
 
2154
						if (f.getFeatureDefinitionID() == 120484l || f.getFeatureDefinitionID() == 120483l || f.getFeatureDefinitionID() == 1204821 || f.getFeatureDefinitionID() == 120481l){
2153
							List<Bullet> bulletList  = f.getBullets();
2155
							List<Bullet> bulletList  = f.getBullets();
2154
							PrimitiveDataObject b = (PrimitiveDataObject)bulletList.get(0).getDataObject();
2156
							PrimitiveDataObject b = (PrimitiveDataObject)bulletList.get(0).getDataObject();
2155
							String bulletValue = b.getValue();
2157
							String bulletValue = b.getValue();
2156
							String newString = bulletValue;
2158
							String newString = bulletValue;
2157
							if(bulletValue.startsWith(", ") || bulletValue.contains(",,")){
2159
							if(bulletValue.startsWith(", ") || bulletValue.contains(",,") || bulletValue.contains("<li>")){
2158
								System.out.println(entity.getID());
2160
								System.out.println(entity.getID());
2159
								bulletList = new ArrayList<Bullet>();
2161
								bulletList = new ArrayList<Bullet>();
-
 
2162
								newString = bulletValue.replaceAll("<li>|</li>|<ul>|</ul>", ",").replaceAll(",,", ",").replaceAll(", ,", ", ").replaceAll(", $", "");
-
 
2163
								
2160
								newString = bulletValue.replaceAll(",,", ",");
2164
								System.out.println(newString);
2161
								if(newString.startsWith(", ") ){
2165
								if(newString.startsWith(", ") ){
2162
									newString = newString.replaceFirst(", ", "");
2166
									newString = newString.replaceFirst(", ", "");
2163
								}
2167
								}
2164
								bulletList.add(new Bullet(new PrimitiveDataObject(newString)));
2168
								bulletList.add(new Bullet(new PrimitiveDataObject(newString)));
2165
								f.setBullets(bulletList);
2169
								f.setBullets(bulletList);
2166
								CreationUtils.updateEntity(entity);
-
 
2167
								System.out.println(newString);
2170
								System.out.println(newString);
2168
							}
2171
							}
2169
							if ( newString.equals(" ") || newString.equals("") || newString.equals("  ") || newString.equals("   ")){
2172
							if ( newString.equals(" ") || newString.equals("") || newString.equals("  ") || newString.equals("   ")){
2170
								miscFeatures.remove(f);
2173
								iter.remove();
2171
								System.out.println("removed feature :" + entity.getID());
-
 
2172
								CreationUtils.updateEntity(entity);
-
 
2173
							}
2174
							}
2174
							break;
-
 
2175
						}
2175
						}
2176
					}
2176
					}
-
 
2177
					CreationUtils.updateEntity(entity);
-
 
2178
					touchEntityState(entity.getID());
2177
				}
2179
				}
2178
			}
2180
			}
2179
			//touchEntityState(entity.getID());
2181
			//touchEntityState(entity.getID());
2180
			}
2182
			}
2181
		}
2183
		}