Subversion Repositories SmartDukaan

Rev

Rev 480 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 480 Rev 499
Line 85... Line 85...
85
					true);
85
					true);
86
 
86
 
87
			this.allSlidesData.add(slidesData);
87
			this.allSlidesData.add(slidesData);
88
			
88
			
89
			// Get slides for rest of the categories
89
			// Get slides for rest of the categories
-
 
90
			long parentCatID  = (defs.getCategory(catID)).getParentCategory().getID();
-
 
91
			
90
			List<Category> cats = defs.getChildrenCategories(10001);
92
			List<Category> cats = defs.getChildrenCategories(parentCatID);
91
			for(Category cat : cats) {
93
			for(Category cat : cats) {
92
				if(cat.getID() != catID) {
94
				if(cat.getID() != catID) {
93
					List<String[]> thisSlidesData = 
95
					List<String[]> thisSlidesData = 
94
						this.getSlidesData(cat.getID(), selection, false);
96
						this.getSlidesData(cat.getID(), selection, false);
95
					
97
					
Line 221... Line 223...
221
    		}
223
    		}
222
    		this.catSlides.put(new Long(entity.getCategoryID()), slideDefIDs);
224
    		this.catSlides.put(new Long(entity.getCategoryID()), slideDefIDs);
223
    		allSlideDefIDs.addAll(slideDefIDs);
225
    		allSlideDefIDs.addAll(slideDefIDs);
224
    		
226
    		
225
        	DefinitionsContainer defs = this.getDefinitionsContainer();
227
        	DefinitionsContainer defs = this.getDefinitionsContainer();
-
 
228
        	
-
 
229
			long parentCatID  = (defs.getCategory(entity.getCategoryID())).getParentCategory().getID();
-
 
230
 
226
        	List<Category> cats = defs.getChildrenCategories(10001L);
231
        	List<Category> cats = defs.getChildrenCategories(parentCatID);
227
        	
232
        	
228
        	// Add slides borrowed from other categories
233
        	// Add slides borrowed from other categories
229
        	for(Category cat : cats) {
234
        	for(Category cat : cats) {
230
        		Long lCat = new Long(cat.getID());
235
        		Long lCat = new Long(cat.getID());
231
        		
236
        		
Line 246... Line 251...
246
        		this.catSlides.put(lCat, catSlideDefIDs);
251
        		this.catSlides.put(lCat, catSlideDefIDs);
247
        		
252
        		
248
        	}
253
        	}
249
        	this.catSlides.remove(new Long(-1));
254
        	this.catSlides.remove(new Long(-1));
250
        	
255
        	
-
 
256
        	// to remove obsolete elements
-
 
257
        	List<Long> removeList = new ArrayList<Long>();
-
 
258
        	
-
 
259
        	for(Long slideId: sequence){
-
 
260
        		boolean isContains = false;
-
 
261
        		for(List<Long> catwiseList: this.catSlides.values()){
-
 
262
        			if(catwiseList.contains(slideId)){
-
 
263
        				isContains = true;
-
 
264
        			}
-
 
265
        		}
-
 
266
        		if(!isContains){
-
 
267
        			removeList.add(slideId);
-
 
268
        		}
-
 
269
        	}
-
 
270
        	for(Long slideId: removeList){
-
 
271
        		sequence.remove(slideId);
-
 
272
        	}
-
 
273
        	// end 
251
        	
274
        	
252
        	this.catSlides.put(new Long(-1), sequence);
275
        	this.catSlides.put(new Long(-1), sequence);
253
        	log.info("this.catSlides:" + this.catSlides);
276
        	log.info("this.catSlides:" + this.catSlides);
254
        	
277
        	
255
    		// Store for sequence reference
278
    		// Store for sequence reference