| 242 |
naveen |
1 |
/**
|
|
|
2 |
*
|
|
|
3 |
*/
|
|
|
4 |
package in.shop2020.creation.controllers;
|
|
|
5 |
|
| 480 |
rajveer |
6 |
import in.shop2020.metamodel.util.CreationUtils;
|
| 242 |
naveen |
7 |
import in.shop2020.metamodel.core.Entity;
|
| 249 |
naveen |
8 |
import in.shop2020.metamodel.core.Slide;
|
| 480 |
rajveer |
9 |
import in.shop2020.metamodel.definitions.Catalog;
|
| 242 |
naveen |
10 |
import in.shop2020.metamodel.definitions.Category;
|
|
|
11 |
import in.shop2020.metamodel.definitions.CategorySlideDefinition;
|
|
|
12 |
import in.shop2020.metamodel.definitions.DefinitionsContainer;
|
|
|
13 |
|
|
|
14 |
import java.util.ArrayList;
|
|
|
15 |
import java.util.Arrays;
|
|
|
16 |
import java.util.HashMap;
|
| 250 |
naveen |
17 |
import java.util.LinkedHashMap;
|
| 242 |
naveen |
18 |
import java.util.List;
|
|
|
19 |
import java.util.Map;
|
|
|
20 |
|
|
|
21 |
import org.apache.juli.logging.Log;
|
|
|
22 |
import org.apache.juli.logging.LogFactory;
|
| 1051 |
rajveer |
23 |
import org.apache.struts2.convention.annotation.InterceptorRef;
|
|
|
24 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
| 242 |
naveen |
25 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
26 |
import org.apache.struts2.convention.annotation.Results;
|
|
|
27 |
|
| 1051 |
rajveer |
28 |
@InterceptorRefs({
|
|
|
29 |
@InterceptorRef("myDefault"),
|
|
|
30 |
@InterceptorRef("login")
|
|
|
31 |
})
|
|
|
32 |
|
| 242 |
naveen |
33 |
@Results({
|
|
|
34 |
@Result(name="success", type="redirectAction",
|
|
|
35 |
params = {"actionName" , "slides"}),
|
|
|
36 |
@Result(name="redirect", location="${url}", type="redirect")
|
|
|
37 |
})
|
|
|
38 |
|
| 1051 |
rajveer |
39 |
public class SlidesController extends BaseController {
|
| 242 |
naveen |
40 |
|
|
|
41 |
/**
|
|
|
42 |
*
|
|
|
43 |
*/
|
|
|
44 |
private static final long serialVersionUID = 1L;
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
*
|
|
|
48 |
*/
|
|
|
49 |
private static Log log = LogFactory.getLog(SlidesController.class);
|
|
|
50 |
|
|
|
51 |
/**
|
|
|
52 |
*
|
|
|
53 |
*/
|
|
|
54 |
private String id;
|
|
|
55 |
private String redirectURL;
|
|
|
56 |
private Map<String, String[]> reqparams;
|
| 1051 |
rajveer |
57 |
private DefinitionsContainer defs = Catalog.getInstance().getDefinitionsContainer();
|
|
|
58 |
private List<List<String[]>> allSlidesData = new ArrayList<List<String[]>>();
|
| 242 |
naveen |
59 |
|
| 953 |
chandransh |
60 |
/**
|
|
|
61 |
* Key: Slide Definition Id
|
|
|
62 |
* Value: Category Slide Definition
|
|
|
63 |
*/
|
| 250 |
naveen |
64 |
private Map<Long, CategorySlideDefinition> mapAllCatSlideDefs =
|
| 242 |
naveen |
65 |
new HashMap<Long, CategorySlideDefinition>();
|
|
|
66 |
|
| 250 |
naveen |
67 |
private Entity entity;
|
| 242 |
naveen |
68 |
/**
|
|
|
69 |
*
|
|
|
70 |
* @return
|
|
|
71 |
*/
|
|
|
72 |
public String edit() {
|
|
|
73 |
log.info("SlidesController.edit");
|
|
|
74 |
|
|
|
75 |
long entityID = Long.parseLong(this.getId());
|
|
|
76 |
log.info("entityID:" + entityID);
|
|
|
77 |
|
|
|
78 |
try {
|
| 1051 |
rajveer |
79 |
entity = CreationUtils.getEntity(entityID);
|
| 242 |
naveen |
80 |
|
| 1051 |
rajveer |
81 |
//List<Long> selection = CreationUtils.getSlideSequence(entityID, entity.getCategoryID());
|
|
|
82 |
List<Long> selection = entity.getSlideSequence();
|
|
|
83 |
if(selection == null){
|
|
|
84 |
entity.setSlideSequence(Catalog.getInstance().getDefinitionsContainer().getCategorySlideSequence(entity.getCategoryID()));
|
|
|
85 |
CreationUtils.updateEntity(entity);
|
|
|
86 |
selection = entity.getSlideSequence();
|
|
|
87 |
}
|
| 242 |
naveen |
88 |
log.info("selection:" + selection);
|
|
|
89 |
|
|
|
90 |
// Entity's category first
|
|
|
91 |
long catID = entity.getCategoryID();
|
|
|
92 |
List<String[]> slidesData = this.getSlidesData(catID, selection,
|
|
|
93 |
true);
|
|
|
94 |
|
|
|
95 |
this.allSlidesData.add(slidesData);
|
|
|
96 |
|
|
|
97 |
// Get slides for rest of the categories
|
| 499 |
rajveer |
98 |
long parentCatID = (defs.getCategory(catID)).getParentCategory().getID();
|
|
|
99 |
|
|
|
100 |
List<Category> cats = defs.getChildrenCategories(parentCatID);
|
| 242 |
naveen |
101 |
for(Category cat : cats) {
|
|
|
102 |
if(cat.getID() != catID) {
|
|
|
103 |
List<String[]> thisSlidesData =
|
|
|
104 |
this.getSlidesData(cat.getID(), selection, false);
|
| 953 |
chandransh |
105 |
if(!thisSlidesData.isEmpty()){
|
|
|
106 |
this.allSlidesData.add(thisSlidesData);
|
|
|
107 |
}
|
| 242 |
naveen |
108 |
}
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
} catch (Exception e) {
|
|
|
112 |
log.error(CreationUtils.getStackTrace(e));
|
|
|
113 |
this.setErrorString(CreationUtils.getStackTrace(e));
|
|
|
114 |
return "fatal";
|
|
|
115 |
}
|
|
|
116 |
return "edit";
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
/**
|
|
|
120 |
*
|
|
|
121 |
* @return
|
|
|
122 |
*/
|
|
|
123 |
public String update() {
|
|
|
124 |
log.info("SlidesController.update");
|
| 480 |
rajveer |
125 |
for(String reqparam: this.reqparams.keySet()){
|
|
|
126 |
String[] values = this.reqparams.get(reqparam);
|
|
|
127 |
for(String value: values){
|
|
|
128 |
System.out.println("Param: " + reqparam + "Value: " + value);
|
|
|
129 |
}
|
|
|
130 |
}
|
| 1051 |
rajveer |
131 |
if(this.reqparams.get("reorder") != null){
|
|
|
132 |
long entityID = Long.parseLong(this.getId());
|
|
|
133 |
try {
|
|
|
134 |
List<Long> slideSequence = new ArrayList<Long>();
|
|
|
135 |
|
|
|
136 |
} catch (Exception e) {
|
|
|
137 |
// TODO Auto-generated catch block
|
|
|
138 |
e.printStackTrace();
|
|
|
139 |
}
|
|
|
140 |
this.redirectURL = "/slides/" + this.getId() + "/edit";
|
|
|
141 |
return "redirect";
|
|
|
142 |
}
|
|
|
143 |
//FIXME
|
|
|
144 |
/* Need to fix me while reordering
|
| 480 |
rajveer |
145 |
if(this.reqparams.get("slideid") != null){
|
|
|
146 |
long slideId = Long.parseLong(this.reqparams.get("slideid")[0]);
|
|
|
147 |
long afterSlideId = Long.parseLong(this.reqparams.get("afterslide")[0]);
|
|
|
148 |
long entityID = Long.parseLong(this.getId());
|
|
|
149 |
|
|
|
150 |
// List<Long> slideSequence = CreationUtils.getSlideSequence(entityID);
|
|
|
151 |
// List<Long> newSlideSequence = new ArrayList<Long>();
|
|
|
152 |
//
|
|
|
153 |
// for(Long slide: slideSequence){
|
|
|
154 |
// newSlideSequence.add(slide);
|
|
|
155 |
// if(slide.equals(new Long(afterSlideId))){
|
|
|
156 |
// newSlideSequence.add(new Long(slideId));
|
|
|
157 |
// }
|
|
|
158 |
// }
|
|
|
159 |
|
|
|
160 |
try{
|
| 1051 |
rajveer |
161 |
entity = CreationUtils.getEntity(entityID);
|
| 480 |
rajveer |
162 |
|
| 1051 |
rajveer |
163 |
//Map<Long, List<Long>> catSlideSequence = CreationUtils.getRawSlideSequence(entityID);
|
|
|
164 |
|
|
|
165 |
Map<Long, List<Long>> catSlideSequence = defs.getCategorySlideSequence();
|
| 480 |
rajveer |
166 |
|
|
|
167 |
List<Long> allSlideSequence = catSlideSequence.get(new Long(-1));
|
|
|
168 |
List<Long> newAllSlideSequence = new ArrayList<Long>();
|
|
|
169 |
|
|
|
170 |
catSlideSequence.remove(new Long(-1));
|
|
|
171 |
Map<Long, List<Long>> newCatSlideSequence = new HashMap<Long, List<Long>>();
|
|
|
172 |
|
|
|
173 |
for(Long slide: allSlideSequence){
|
|
|
174 |
newAllSlideSequence.add(slide);
|
|
|
175 |
if(slide.equals(new Long(afterSlideId))){
|
|
|
176 |
newAllSlideSequence.add(new Long(slideId));
|
|
|
177 |
}
|
|
|
178 |
}
|
| 1051 |
rajveer |
179 |
|
| 480 |
rajveer |
180 |
for(Long cat: catSlideSequence.keySet()){
|
|
|
181 |
List<Long> newSlideSequence = new ArrayList<Long>();
|
|
|
182 |
List<Long> slides = catSlideSequence.get(cat);
|
|
|
183 |
|
|
|
184 |
boolean contains = false;
|
|
|
185 |
List<CategorySlideDefinition> catdefs = defs.getCategorySlideDefinitions(cat);
|
|
|
186 |
for(CategorySlideDefinition catdef: catdefs){
|
|
|
187 |
if(catdef.getSlideDefintionID()==slideId){
|
|
|
188 |
contains = true;
|
|
|
189 |
}
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
|
|
|
193 |
|
|
|
194 |
for(Long slide: slides){
|
|
|
195 |
newSlideSequence.add(slide);
|
|
|
196 |
}
|
|
|
197 |
if(contains){
|
|
|
198 |
newSlideSequence.add(new Long(slideId));
|
|
|
199 |
}
|
|
|
200 |
|
|
|
201 |
newCatSlideSequence.put(cat, newSlideSequence);
|
|
|
202 |
}
|
|
|
203 |
|
|
|
204 |
newCatSlideSequence.put(new Long(-1), newAllSlideSequence);
|
|
|
205 |
|
| 1051 |
rajveer |
206 |
//CreationUtils.storeSlideSequence(entityID, newCatSlideSequence);
|
|
|
207 |
|
|
|
208 |
entity.setSlideSequence(newAllSlideSequence);
|
|
|
209 |
|
| 480 |
rajveer |
210 |
}catch(Exception e){
|
|
|
211 |
e.printStackTrace();
|
|
|
212 |
}
|
|
|
213 |
this.redirectURL = "/slides/" + this.getId() + "/edit";
|
|
|
214 |
return "redirect";
|
|
|
215 |
}
|
|
|
216 |
|
| 1051 |
rajveer |
217 |
*/
|
| 480 |
rajveer |
218 |
|
| 242 |
naveen |
219 |
try {
|
| 250 |
naveen |
220 |
long entityID = Long.parseLong(this.getId());
|
| 1051 |
rajveer |
221 |
entity = CreationUtils.getEntity(entityID);
|
| 480 |
rajveer |
222 |
Long catId = new Long(entity.getCategoryID());
|
| 250 |
naveen |
223 |
// Slides of entity's category
|
|
|
224 |
String[] strSlideDefIDs = this.reqparams.get(
|
|
|
225 |
new Long(entity.getCategoryID()).toString());
|
|
|
226 |
|
|
|
227 |
log.info("strSlideDefIDs:" + Arrays.toString(strSlideDefIDs));
|
|
|
228 |
|
| 1051 |
rajveer |
229 |
List<Long> sequence= entity.getSlideSequence();
|
|
|
230 |
log.info("S1"+sequence);
|
| 480 |
rajveer |
231 |
if(sequence == null){
|
|
|
232 |
sequence = new ArrayList<Long>();
|
| 1051 |
rajveer |
233 |
entity.setSlideSequence(sequence);
|
| 480 |
rajveer |
234 |
}
|
|
|
235 |
|
| 250 |
naveen |
236 |
|
| 1051 |
rajveer |
237 |
|
| 250 |
naveen |
238 |
// Add entity's category slides first
|
| 242 |
naveen |
239 |
List<Long> slideDefIDs = new ArrayList<Long>();
|
|
|
240 |
for(String strSlideDefID : strSlideDefIDs) {
|
|
|
241 |
slideDefIDs.add(new Long(Long.parseLong(strSlideDefID)));
|
| 480 |
rajveer |
242 |
if(!sequence.contains(new Long(Long.parseLong(strSlideDefID)))){
|
|
|
243 |
sequence.add(new Long(Long.parseLong(strSlideDefID)));
|
|
|
244 |
}
|
| 242 |
naveen |
245 |
}
|
|
|
246 |
|
| 1051 |
rajveer |
247 |
log.info("S2"+sequence);
|
| 499 |
rajveer |
248 |
long parentCatID = (defs.getCategory(entity.getCategoryID())).getParentCategory().getID();
|
|
|
249 |
|
|
|
250 |
List<Category> cats = defs.getChildrenCategories(parentCatID);
|
|
|
251 |
|
| 250 |
naveen |
252 |
// Add slides borrowed from other categories
|
|
|
253 |
for(Category cat : cats) {
|
|
|
254 |
Long lCat = new Long(cat.getID());
|
| 1051 |
rajveer |
255 |
String[] strCatSlideDefIDs = this.reqparams.get(lCat.toString());
|
| 250 |
naveen |
256 |
if(strCatSlideDefIDs != null && strCatSlideDefIDs.length > 0) {
|
|
|
257 |
for(String strCatSlideDefID : strCatSlideDefIDs) {
|
| 480 |
rajveer |
258 |
if(!lCat.equals(catId) && !sequence.contains(new Long(Long.parseLong(strCatSlideDefID)))){
|
|
|
259 |
sequence.add(new Long(Long.parseLong(strCatSlideDefID)));
|
| 1051 |
rajveer |
260 |
log.info("S3"+sequence);
|
| 480 |
rajveer |
261 |
}
|
| 250 |
naveen |
262 |
}
|
|
|
263 |
}
|
|
|
264 |
}
|
| 480 |
rajveer |
265 |
|
| 1051 |
rajveer |
266 |
|
|
|
267 |
//FIXME To remove not required slide ids and slides
|
| 499 |
rajveer |
268 |
// to remove obsolete elements
|
| 1051 |
rajveer |
269 |
/*
|
| 499 |
rajveer |
270 |
List<Long> removeList = new ArrayList<Long>();
|
| 480 |
rajveer |
271 |
|
| 499 |
rajveer |
272 |
for(Long slideId: sequence){
|
|
|
273 |
boolean isContains = false;
|
|
|
274 |
for(List<Long> catwiseList: this.catSlides.values()){
|
|
|
275 |
if(catwiseList.contains(slideId)){
|
|
|
276 |
isContains = true;
|
|
|
277 |
}
|
|
|
278 |
}
|
|
|
279 |
if(!isContains){
|
|
|
280 |
removeList.add(slideId);
|
|
|
281 |
}
|
|
|
282 |
}
|
| 1051 |
rajveer |
283 |
log.info("To remove"+removeList);
|
| 499 |
rajveer |
284 |
for(Long slideId: removeList){
|
|
|
285 |
sequence.remove(slideId);
|
|
|
286 |
}
|
| 1051 |
rajveer |
287 |
*/
|
| 499 |
rajveer |
288 |
// end
|
|
|
289 |
|
| 250 |
naveen |
290 |
|
| 249 |
naveen |
291 |
// Delete slides no longer present in the list
|
|
|
292 |
List<Slide> slides = entity.getSlides();
|
| 250 |
naveen |
293 |
if(slides != null) {
|
|
|
294 |
List<Slide> deletedSlides = new ArrayList<Slide>();
|
|
|
295 |
for(Slide slide : slides) {
|
|
|
296 |
Long lSlideDefID = new Long(slide.getSlideDefinitionID());
|
| 1051 |
rajveer |
297 |
|
|
|
298 |
log.info(sequence);
|
|
|
299 |
if(!sequence.contains(lSlideDefID)) {
|
| 250 |
naveen |
300 |
log.info("deleted lSlideDefID:" + lSlideDefID);
|
|
|
301 |
deletedSlides.add(slide);
|
|
|
302 |
}
|
|
|
303 |
}
|
|
|
304 |
|
|
|
305 |
for(Slide deletedSlide : deletedSlides) {
|
|
|
306 |
slides.remove(deletedSlide);
|
|
|
307 |
}
|
| 249 |
naveen |
308 |
}
|
|
|
309 |
|
| 1051 |
rajveer |
310 |
CreationUtils.updateEntity(entity);
|
|
|
311 |
|
| 250 |
naveen |
312 |
if(this.reqparams.containsKey("save")) {
|
|
|
313 |
this.redirectURL = "/entity";
|
| 249 |
naveen |
314 |
}
|
| 250 |
naveen |
315 |
else {
|
|
|
316 |
this.redirectURL = "/entity/" + this.getId() + "/edit" +
|
|
|
317 |
"?slideDefID=" + slideDefIDs.get(0);
|
|
|
318 |
}
|
| 249 |
naveen |
319 |
|
| 242 |
naveen |
320 |
return "redirect";
|
|
|
321 |
} catch (Exception e) {
|
|
|
322 |
log.error(CreationUtils.getStackTrace(e));
|
|
|
323 |
this.setErrorString(CreationUtils.getStackTrace(e));
|
|
|
324 |
return "fatal";
|
|
|
325 |
}
|
|
|
326 |
}
|
|
|
327 |
|
|
|
328 |
/**
|
|
|
329 |
*
|
|
|
330 |
*/
|
|
|
331 |
@Override
|
|
|
332 |
public void setParameters(Map<String, String[]> reqmap) {
|
|
|
333 |
log.info("setParameters:" + reqmap);
|
|
|
334 |
|
|
|
335 |
this.reqparams = reqmap;
|
|
|
336 |
}
|
|
|
337 |
|
|
|
338 |
/**
|
|
|
339 |
* @param id the id to set
|
|
|
340 |
*/
|
|
|
341 |
public void setId(String id) {
|
|
|
342 |
this.id = id;
|
|
|
343 |
}
|
|
|
344 |
|
|
|
345 |
/**
|
|
|
346 |
* @return the id
|
|
|
347 |
*/
|
|
|
348 |
public String getId() {
|
|
|
349 |
return id;
|
|
|
350 |
}
|
|
|
351 |
|
|
|
352 |
/**
|
|
|
353 |
*
|
|
|
354 |
* @return
|
|
|
355 |
*/
|
|
|
356 |
public List<List<String[]>> getAllSlidesData() {
|
|
|
357 |
return this.allSlidesData;
|
|
|
358 |
}
|
|
|
359 |
|
|
|
360 |
/**
|
|
|
361 |
*
|
|
|
362 |
* @return
|
|
|
363 |
*/
|
|
|
364 |
public String getUrl() {
|
|
|
365 |
return this.redirectURL;
|
|
|
366 |
}
|
|
|
367 |
|
|
|
368 |
/**
|
|
|
369 |
* @param errorString the exceptionString to set
|
|
|
370 |
*/
|
|
|
371 |
public void setErrorString(String errorString) {
|
|
|
372 |
}
|
|
|
373 |
|
|
|
374 |
/**
|
|
|
375 |
*
|
|
|
376 |
* @return
|
|
|
377 |
*/
|
|
|
378 |
public List<String> getMandatorySlideLabels() {
|
|
|
379 |
List<String[]> slidesdata = this.allSlidesData.get(0);
|
|
|
380 |
|
|
|
381 |
List<String> mandatorySlideLabels = new ArrayList<String>();
|
|
|
382 |
for(String[] data : slidesdata) {
|
|
|
383 |
if("Mandatory".equals(data[4])) {
|
|
|
384 |
mandatorySlideLabels.add(data[3]);
|
|
|
385 |
}
|
|
|
386 |
}
|
|
|
387 |
|
|
|
388 |
return mandatorySlideLabels;
|
|
|
389 |
}
|
|
|
390 |
|
|
|
391 |
/**
|
|
|
392 |
*
|
|
|
393 |
* @param catID
|
|
|
394 |
* @param selection
|
|
|
395 |
* @return
|
|
|
396 |
* @throws Exception
|
|
|
397 |
*/
|
|
|
398 |
private List<String[]> getSlidesData(long catID, List<Long> selection,
|
|
|
399 |
boolean isEntityCategory) throws Exception {
|
| 250 |
naveen |
400 |
log.info("catID:" + catID);
|
| 242 |
naveen |
401 |
List<Long> slideDefIDs = defs.getCategorySlideSequence(catID);
|
| 250 |
naveen |
402 |
log.info("slideDefIDs:" + slideDefIDs);
|
| 242 |
naveen |
403 |
|
|
|
404 |
List<CategorySlideDefinition> catSlideDefs =
|
|
|
405 |
defs.getCategorySlideDefinitions(catID);
|
| 250 |
naveen |
406 |
log.info("catSlideDefs:" + catSlideDefs);
|
| 242 |
naveen |
407 |
|
|
|
408 |
// Convert it into Map, this will help put CategorySlideDefinition
|
|
|
409 |
// objects in sequence
|
|
|
410 |
// FIXME - Quick and dirty
|
|
|
411 |
List<Long> excludeList = new ArrayList<Long>();
|
|
|
412 |
for(CategorySlideDefinition catSlideDef : catSlideDefs) {
|
|
|
413 |
Long slideDefID = new Long(catSlideDef.getSlideDefintionID());
|
|
|
414 |
|
|
|
415 |
if(!this.mapAllCatSlideDefs.containsKey(slideDefID)) {
|
|
|
416 |
this.mapAllCatSlideDefs.put(slideDefID, catSlideDef);
|
|
|
417 |
}
|
|
|
418 |
else {
|
|
|
419 |
excludeList.add(slideDefID);
|
|
|
420 |
}
|
|
|
421 |
}
|
| 250 |
naveen |
422 |
log.info("excludeList:" + excludeList);
|
| 242 |
naveen |
423 |
|
|
|
424 |
List<String[]> slidesData = new ArrayList<String[]>();
|
|
|
425 |
|
|
|
426 |
String categoryLabel = defs.getCategory(catID).getLabel();
|
|
|
427 |
|
|
|
428 |
for(Long slideDefID : slideDefIDs) {
|
|
|
429 |
// Do not repeat if already covered
|
|
|
430 |
if(excludeList.contains(slideDefID)) {
|
|
|
431 |
continue;
|
|
|
432 |
}
|
|
|
433 |
|
| 953 |
chandransh |
434 |
// Category slide definition for the slide def id.
|
|
|
435 |
CategorySlideDefinition catSlideDef = this.mapAllCatSlideDefs.get(slideDefID);
|
|
|
436 |
log.info("catSlideDef: " + catSlideDef);
|
| 242 |
naveen |
437 |
|
| 953 |
chandransh |
438 |
String slideLabel = defs.getSlideDefinition(catSlideDef.getSlideDefintionID()).getLabel();
|
| 242 |
naveen |
439 |
|
|
|
440 |
Long lSlideDefID = new Long(catSlideDef.getSlideDefintionID());
|
|
|
441 |
|
|
|
442 |
String selected = "0";
|
|
|
443 |
if(selection != null) {
|
|
|
444 |
selected = selection.contains(lSlideDefID) ? "1" : "0";
|
|
|
445 |
}
|
|
|
446 |
else if(isEntityCategory) {
|
|
|
447 |
String edImp = catSlideDef.getEditorialImportance().toString();
|
|
|
448 |
selected = (edImp.equals("Mandatory") ||
|
|
|
449 |
edImp.endsWith("Recommended")) ? "1" : "0";
|
|
|
450 |
}
|
|
|
451 |
|
|
|
452 |
String[] data = new String[] {
|
|
|
453 |
new Long(catID).toString(),
|
|
|
454 |
categoryLabel,
|
|
|
455 |
lSlideDefID.toString(),
|
|
|
456 |
slideLabel,
|
|
|
457 |
catSlideDef.getEditorialImportance().toString(),
|
|
|
458 |
selected
|
|
|
459 |
};
|
|
|
460 |
|
|
|
461 |
slidesData.add(data);
|
|
|
462 |
}
|
|
|
463 |
|
|
|
464 |
return slidesData;
|
|
|
465 |
}
|
| 1051 |
rajveer |
466 |
|
|
|
467 |
public List<Long> getSlideSequence(){
|
|
|
468 |
return this.entity.getSlideSequence();
|
|
|
469 |
}
|
| 242 |
naveen |
470 |
|
|
|
471 |
}
|