Subversion Repositories SmartDukaan

Rev

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

Rev 7471 Rev 9253
Line 1... Line 1...
1
package in.shop2020.creation.controllers;
1
package in.shop2020.creation.controllers;
2
 
2
 
3
import in.shop2020.content.security.UserManager;
3
import in.shop2020.content.security.UserManager;
4
import in.shop2020.creation.util.ContentValidator;
4
import in.shop2020.creation.util.ContentValidator;
-
 
5
import in.shop2020.metamodel.core.Bullet;
5
import in.shop2020.metamodel.core.Entity;
6
import in.shop2020.metamodel.core.Entity;
6
import in.shop2020.metamodel.core.EntityState;
7
import in.shop2020.metamodel.core.EntityState;
7
import in.shop2020.metamodel.core.EntityStatus;
8
import in.shop2020.metamodel.core.EntityStatus;
-
 
9
import in.shop2020.metamodel.core.EnumDataObject;
-
 
10
import in.shop2020.metamodel.core.Feature;
8
import in.shop2020.metamodel.core.FreeformContent;
11
import in.shop2020.metamodel.core.FreeformContent;
9
import in.shop2020.metamodel.core.Media;
12
import in.shop2020.metamodel.core.Media;
10
import in.shop2020.metamodel.core.Media.Type;
13
import in.shop2020.metamodel.core.Media.Type;
11
import in.shop2020.metamodel.core.Slide;
14
import in.shop2020.metamodel.core.Slide;
-
 
15
import in.shop2020.metamodel.definitions.Catalog;
12
import in.shop2020.metamodel.util.CreationUtils;
16
import in.shop2020.metamodel.util.CreationUtils;
13
import in.shop2020.thrift.clients.CatalogClient;
17
import in.shop2020.thrift.clients.CatalogClient;
14
import in.shop2020.util.Utils;
18
import in.shop2020.util.Utils;
15
 
19
 
16
import java.io.ByteArrayInputStream;
20
import java.io.ByteArrayInputStream;
Line 193... Line 197...
193
					return "success";	
197
					return "success";	
194
				}
198
				}
195
				try {
199
				try {
196
				    EntityState state = CreationUtils.getEntityState(entityId);
200
				    EntityState state = CreationUtils.getEntityState(entityId);
197
				    
201
				    
-
 
202
				    //For all android phones in mobile category, we should enable data pack. 
-
 
203
				    boolean isAndroid = false;
-
 
204
				    if(state.getCategoryID() == 10006){
-
 
205
				    	Entity e = CreationUtils.getEntity(entityId);
-
 
206
				    	Slide slide = e.getSlide(130020);
-
 
207
				    	if(slide != null)  {
-
 
208
				    		List<Feature> fs = slide.getFeatures();
-
 
209
				    		if (fs!=null){
-
 
210
				    			for (Feature f1 : fs){
-
 
211
				    				if(f1.getFeatureDefinitionID()==120043l){
-
 
212
				    					List <Bullet> bullets = f1.getBullets();
-
 
213
				    					if(bullets != null) {
-
 
214
				    						for(Bullet b : bullets){
-
 
215
				    							String bulletString = Catalog.getInstance().getDefinitionsContainer().getEnumValue(((EnumDataObject)b.getDataObject()).getEnumValueID()).getValue();
-
 
216
				    							if (bulletString.contains("Android")){
-
 
217
				    								isAndroid = true;
-
 
218
				    								break;
-
 
219
				    							}
-
 
220
				    						}
-
 
221
				    					}
-
 
222
				    				}
-
 
223
				    			}
-
 
224
				    		}
-
 
225
				    	}
-
 
226
				    }
-
 
227
				    
198
					CatalogClient csc = new CatalogClient();
228
					CatalogClient csc = new CatalogClient();
199
					in.shop2020.model.v1.catalog.CatalogService.Client iclient = csc.getClient();
229
					in.shop2020.model.v1.catalog.CatalogService.Client iclient = csc.getClient();
200
					iclient.markItemAsContentComplete(entityId, state.getCategoryID(), state.getBrand(), state.getModelName(), state.getModelNumber());	
230
					iclient.markItemAsContentComplete(entityId, state.getCategoryID(), state.getBrand(), state.getModelName(), state.getModelNumber(), isAndroid);	
201
					
231
					
202
                    List<Long> inconsistentEntities = CreationUtils.getInconsistentEntities();
232
                    List<Long> inconsistentEntities = CreationUtils.getInconsistentEntities();
203
                    if(inconsistentEntities != null){
233
                    if(inconsistentEntities != null){
204
                        inconsistentEntities.remove(state.getID());
234
                        inconsistentEntities.remove(state.getID());
205
                        CreationUtils.storeInconsistentEntities(inconsistentEntities);
235
                        CreationUtils.storeInconsistentEntities(inconsistentEntities);