l5m-tools 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,653 +1,659 @@
1
- package com.l5m.!REPLACE_STYLE!.engine.worker;
2
-
3
- import static com.l5m.common.util.ActionConstants.DISPLAY_REFRESH;
4
- import static com.l5m.common.util.ActionConstants.EXPORT_EXCEL;
5
- import static com.l5m.common.util.ActionConstants.EXPORT_PDF;
6
- import static com.l5m.common.util.ActionConstants.FILTER_REFRESH;
7
- import static com.l5m.common.util.ActionConstants.SORT_RERESH;
8
- import static com.l5m.common.util.ActionConstants.SUBMIT;
9
- import static com.l5m.common.util.dcnds.QHTCommonUtil.AA_REFRESH_ZONES_NAME;
10
- import static com.l5m.common.util.dcnds.QHTCommonUtil.JSON_REFRESH_TYPE;
11
- import static com.l5m.common.util.dcnds.QHTCommonUtil.PROGRESS_PAGE_POSTBACK;
12
- import static com.l5m.common.util.dcnds.QHTCommonUtil.REFRESH_TYPE;
13
- import static com.l5m.customtags.tags.utils.GenerateTagUtil.parseModuleStateBean;
14
-
15
- import java.io.IOException;
16
- import java.util.HashMap;
17
- import java.util.HashSet;
18
- import java.util.Map;
19
- import java.util.Set;
20
-
21
- import javax.servlet.ServletException;
22
- import javax.servlet.http.HttpServletRequest;
23
- import javax.servlet.http.HttpSession;
24
-
25
- import org.apache.commons.lang.StringEscapeUtils;
26
-
27
- import com.l5m.common.bean.NavigationBean;
28
- import com.l5m.common.bean.NavigationItemBean;
29
- import com.l5m.common.bean.StatusMessageBean;
30
- import com.l5m.common.engine.exporter.ExportInformationBean;
31
- import com.l5m.common.engine.servicer.ServicerType;
32
- import com.l5m.common.engine.worker.AbstractWorker;
33
- import com.l5m.common.util.ActionConstants;
34
- import com.l5m.common.util.AppConfig;
35
- import com.l5m.common.util.AppLog;
36
- import com.l5m.common.util.CommonProperty;
37
- import com.l5m.common.util.DataUtil;
38
- import com.l5m.customtags.beans.BaseServicerParaBean;
39
- import com.l5m.customtags.module.statebean.MultipleSelectStateBean;
40
- import com.l5m.customtags.module.statebean.PaginatorStateBean;
41
- import com.l5m.customtags.module.statebean.SortingKeysModuleStateBean;
42
- import com.l5m.customtags.module.statebean.TopBar2StateBean;
43
- import com.l5m.customtags.tags.Paginator2Tag;
44
- import com.l5m.customtags.tags.utils.GenerateTagUtil;
45
- import com.l5m.customtags.tags.utils.IconStatus;
46
- import com.l5m.customtags.tags.utils.TopBarIcon;
47
- import com.l5m.!REPLACE_STYLE!.engine.servicer.!REPLACE_ME_FILE!ServicerImpl;
48
- import com.l5m.!REPLACE_STYLE!.engine.servicer.!REPLACE_ME_FILE!ServicerImpl.PANEL;
49
-
50
- public class !REPLACE_ME_FILE!Worker extends AbstractWorker{
51
-
52
-
53
-
54
- public static enum Descriptions{
55
- Initializing("Initializing") , RetrievingData("Retrieving Data"), CreatingReport("Creating Report"), Finalize("Finalize")
56
- ;
57
- private final String label;
58
- Descriptions(){
59
- this.label = this.name();
60
- }
61
- Descriptions(String label){
62
- this.label = label;
63
- }
64
- public String getLabel() {
65
- return label;
66
- }
67
- }
68
- public static final String JSP_TOGO_PERIX = "!REPLACE_ME_FILE!"; /*worker name w/o "Worker"*/
69
- public static final String JSP_TOGO = JSP_TOGO_PERIX+".jsp";
70
- public static final String WORKER_NAME = JSP_TOGO_PERIX+"Worker";
71
-
72
-
73
-
74
- public static final String FORM_NAME = JSP_TOGO_PERIX+"Form";
75
- public static final String packageLowerCase = "!REPLACE_STYLE!";
76
-
77
- public static final String packageUpperCase = packageLowerCase.toUpperCase();
78
-
79
-
80
- public static StatusMessageBean initStatusMessageBean(HttpSession session,Descriptions [] descriptions , String extra){
81
-
82
- StatusMessageBean messageBean = new StatusMessageBean();
83
- for (int i = 0; i < descriptions.length; i++) {
84
- messageBean.addStep((i==0?extra:"")+descriptions[i].getLabel());
85
- }
86
- StringBuffer messageBuffer = new StringBuffer();
87
- messageBean.setMessageBuffer(messageBuffer);
88
- session.setAttribute(CommonProperty.IntermediaMessage, messageBuffer);
89
-
90
- return messageBean;
91
- }
92
-
93
- public static StatusMessageBean initStatusMessageBean(HttpSession session, String [] descriptions, String extra) {
94
- StatusMessageBean messageBean = new StatusMessageBean();
95
- for (int i = 0; i < descriptions.length; i++) {
96
- messageBean.addStep((i == 0 ? extra : "") + descriptions[i]);
97
- }
98
-
99
- StringBuffer messageBuffer = new StringBuffer();
100
- messageBean.setMessageBuffer(messageBuffer);
101
- session.setAttribute(CommonProperty.IntermediaMessage, messageBuffer);
102
-
103
- return messageBean;
104
- }
105
- public static void main(String[] x) {
106
- //System.out.println(StringEscapeUtils.escapeHtml( "NETWORKPROGRAM"));
107
- }
108
- @ServicerType("com.l5m.!REPLACE_STYLE!.engine.servicer.!REPLACE_ME_FILE!ServicerImpl")
109
- private !REPLACE_ME_FILE!ServicerImpl servicer;
110
- protected String btnClicked;
111
-
112
- protected boolean needForwordToJsp = true;
113
-
114
- protected NavigationBean navigationBean;
115
-
116
- private boolean showDialog = false;
117
-
118
-
119
- public !REPLACE_ME_FILE!Worker() {
120
- this.navigationBean = new NavigationBean();
121
- this.navigationBean.setJSPGoTo(JSP_TOGO);
122
-
123
-
124
- }
125
-
126
- protected void bindParams(HttpServletRequest request) {
127
- this.btnClicked = (super.getParamValueString(AppConfig.getProperty("butOption"), "N/A"));
128
- String refresh = request.getParameter(REFRESH_TYPE);
129
- this.needForwordToJsp = !(refresh != null && refresh.equals(JSON_REFRESH_TYPE));
130
- if (this.btnClicked.equals(PROGRESS_PAGE_POSTBACK) || (refresh != null && refresh.equals(JSON_REFRESH_TYPE))) {
131
- return;
132
- }
133
-
134
- BaseServicerParaBean baseServicerParameterBean = this.servicer.getBaseServicerParameterBean();
135
- try {
136
- baseServicerParameterBean.setPanelIndex(Integer.parseInt(request.getParameter("panelIndex")));
137
- } catch (Exception e) {
138
- baseServicerParameterBean.setPanelIndex(0);
139
- }
140
- baseServicerParameterBean.setSelectedTab(StringEscapeUtils.unescapeHtml( super.getParamValueString("accordionTestTop:selected", "SOURCE" )));
141
- this.servicer.getBaseServicerParameterBean().getTopBarStateBean().setId("TopBar").parseOnlyStartStatus(request);
142
-
143
- // use method from GenerateTagUtil to parse tags
144
-
145
-
146
-
147
- }
148
- private void bindParamsDisplayAndSort(HttpServletRequest request) {
149
- this.servicer.getBaseServicerParameterBean().bindTopBart(request, "TopBar");
150
- }
151
-
152
-
153
-
154
-
155
- private void changeDecimalAction() {
156
- this.setRefreshZones("result");
157
- this.servicer.setReportDecimalControlList(TopBar2StateBean.parseOnlyDecimal(this.getRequest(), "TopBar" ).getValue());
158
-
159
- }
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
- private void changePaginatorAction() {
170
- PaginatorStateBean stateBean = this.servicer.getPaginatorStateBean();
171
- stateBean.parse(this.getRequest());
172
- this.servicer.handlePaginator(this.servicer.getPanelIndex());
173
- this.setRefreshZones("panelZone,result");
174
-
175
- }
176
-
177
-
178
-
179
-
180
- private void changePanelAction() {
181
- this.setRefreshZones("result,topNavigationZone,sortDialogZone,filterDialogZone,displayDialogZone");
182
-
183
- }
184
-
185
-
186
-
187
-
188
-
189
- public void changeSortDisplayModeAction() {
190
- String sortBy = this.servicer.getBaseServicerParameterBean().getSelectedSortBy();
191
- this.bindParamsDisplayAndSort(this.getRequest());
192
-
193
- Set<String> displayBy = this.servicer.getBaseServicerParameterBean().getSelectedDisplayBy();
194
-
195
- if(!this.servicer.getBaseServicerParameterBean().getSelectedDisplayBy().equals( displayBy)){
196
- this.servicer.updateDisplay();
197
- }
198
- if(!this.servicer.getBaseServicerParameterBean().getSelectedSortBy().equals(sortBy) ){
199
- this.servicer.sort();
200
- }
201
-
202
- this.setRefreshZones("result,sourcePanelZone");
203
-
204
- }
205
-
206
-
207
-
208
- /* private String baseDir(String subLevel) {
209
- return getCurvePath() + "" + this.servicer.getUserId() + "/" + navigationBean.getProgramKey() + "/" + subLevel+"/";
210
- }
211
-
212
-
213
- */
214
-
215
-
216
-
217
-
218
-
219
- public void changeTimeAction() {
220
- this.servicer.getBaseServicerParameterBean().changeTime(this.getRequest());
221
- this.setRefreshZones("sourcePanelZone");
222
-
223
- if(this.servicer.isDisplayStage()){
224
- this.clearResultAction();
225
- }
226
- }
227
-
228
-
229
-
230
- public void clearResultAction() {
231
- this.servicer.clearCache();
232
- this.servicer.getBaseServicerParameterBean().setPanelIndex(PANEL.Help.panelIndex());
233
- this.servicer.getBaseServicerParameterBean().setDisplayStage(false);
234
- this.setRefreshZones("result,sourcePanelZone");
235
- }
236
-
237
- @SuppressWarnings("unchecked")
238
- public void displayRefreshAction() {
239
- MultipleSelectStateBean messuare = new MultipleSelectStateBean();
240
- messuare.setSelectedValues(new HashSet<String>());
241
- messuare.setId("multipleColumnsController");
242
- messuare.parse(this.getRequest());
243
- if(servicer.getColumnsMap() != null){
244
- boolean[] displayControllerMeasurement = new boolean[servicer.getColumnsMap().size()];
245
- if (messuare.getSelectedValues() != null) {
246
- displayControllerMeasurement = messuare.getSelectedValueBoolean(servicer.getColumnsMap());
247
- this.servicer.setDisplayController(displayControllerMeasurement);
248
- }
249
- this.servicer.setSelectedColumns(messuare.getSelectedValues() == null ? (new HashSet<String>()) : (HashSet<String>) messuare.getSelectedValues());
250
- }
251
-
252
-
253
- this.servicer.updateDisplay();
254
- this.setRefreshZones("result");
255
- }
256
-
257
-
258
-
259
- public void exportExcelAction() {
260
- this.needForwordToJsp = false;
261
- @SuppressWarnings("unused")
262
- ExportInformationBean informationBean = this.getExportInformationBean();
263
-
264
- }
265
-
266
- public void exportPDFAction() {
267
- this.needForwordToJsp = false;
268
- }
269
-
270
- public void filterRefreshAction() {
271
- this.servicer.processFilter();
272
- this.setRefreshZones("result");
273
- //
274
- }
275
-
276
-
277
-
278
- /**
279
- * @return the aPP_NAME
280
- */
281
- public String getAPP_NAME() {
282
- @SuppressWarnings("unchecked")
283
- Map<String, NavigationItemBean> navBarAccessMap = (Map<String, NavigationItemBean>) this.getRequest().getSession().getAttribute("navAccessBean");
284
- String displayName = null;
285
- try {
286
- displayName = navBarAccessMap.get(this.navigationBean.getProgramKey()).getDisplayName();
287
- } catch (Exception e) {
288
- }
289
- if (displayName != null)
290
- return displayName;
291
- return "";
292
- }
293
-
294
-
295
-
296
- /**
297
- * @return the btnClicked
298
- */
299
- public String getBtnClicked() {
300
- return btnClicked;
301
- }
302
-
303
-
304
-
305
-
306
- public int getDataAvailability() {
307
- return PANEL.DataAvailability.panelIndex();
308
- }
309
-
310
-
311
-
312
- @SuppressWarnings({ "unchecked"})
313
- private ExportInformationBean getExportInformationBean(){
314
- ExportInformationBean informationBean = null;
315
- try {
316
- informationBean = new ExportInformationBean(this.navigationBean, (HashMap) this.getSession().getAttribute(UserCompanyWorker.NAV_ACCESS_BEAN), DataUtil.getCompanyName(this.servicer.getDbHandler(), this.servicer.getCompanyId()), DataUtil.getUserFullName(this.servicer.getDbHandler(), this.servicer.getUserId()));
317
- }
318
- catch (Exception e) {
319
- e.printStackTrace();
320
- }
321
- return informationBean;
322
- }
323
-
324
- /**
325
- * @return the fORM_NAME
326
- */
327
- public String getFORM_NAME() {
328
- return FORM_NAME;
329
- }
330
-
331
- public int getHelp() {
332
- return PANEL.Help.panelIndex();
333
- }
334
-
335
-
336
-
337
- /**
338
- * @return the jSP_TOGO
339
- */
340
- public String getJSP_TOGO() {
341
- return JSP_TOGO;
342
- }
343
-
344
- public String getJspGoto() {
345
- return JSP_TOGO;
346
- }
347
-
348
- /**
349
- * @return the navigationBean
350
- */
351
- public NavigationBean getNavigationBean() {
352
- return navigationBean;
353
- }
354
-
355
- public String getPackageLowerCase() {
356
- return packageLowerCase;
357
- }
358
-
359
- public String getPackageUpperCase() {
360
- return packageUpperCase;
361
- }
362
-
363
- public PANEL[] getPANEL(){
364
- return PANEL.values();
365
- }
366
-
367
-
368
- public String getRenderHTML() {
369
- if(! hasData()) return "";
370
- try{
371
- }catch(Exception e){
372
- e.printStackTrace();
373
- }
374
- return "";
375
-
376
- }
377
-
378
-
379
-
380
- public String getRenderPaginatorHTML() {
381
- if(!hasData()) return "";
382
- Paginator2Tag paginatorTag = GenerateTagUtil.getPaginator2Tag("PaginatorStateBeanTag", "pageAction.changePaginator();", this.servicer.getPaginatorStateBean());
383
- paginatorTag.setStyle(packageLowerCase);
384
- try {
385
- return paginatorTag.renderHTML();
386
- } catch (Exception e) {
387
- e.printStackTrace();
388
- }
389
- return "";
390
- }
391
-
392
- public !REPLACE_ME_FILE!ServicerImpl getServicer() {
393
- return servicer;
394
- }
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
- public String getUrl() {
403
- String workerParamName = AppConfig.getProperty("requestAction");
404
- String jspSrcParamName = AppConfig.getProperty("srcPage");
405
- String companyId = this.servicer.getCompanyId();
406
- StringBuilder url = new StringBuilder();
407
- //url.append(this.getRequest().getContextPath()+"/servlet/L5MOnline/").append(AppConfig.getProperty("appL5MOnline")).append("?");
408
- url.append(workerParamName).append("=").append(this.getRequest().getParameter(workerParamName)).append("&");
409
- url.append(jspSrcParamName).append("=" + JSP_TOGO + "&companyid=").append(companyId);
410
- url.append("&1stnavbar=").append(this.getRequest().getParameter("1stnavbar"));
411
- url.append("&").append(REFRESH_TYPE).append("=").append(JSON_REFRESH_TYPE);
412
-
413
- return url.toString();
414
- }
415
-
416
- /**
417
- * @return the wORKER_NAME
418
- */
419
- public String getWORKER_NAME() {
420
- return WORKER_NAME;
421
- }
422
-
423
- public boolean hasData(){
424
- final int panelIndex = this.servicer.getPanelIndex();
425
- if(panelIndex == PANEL.Help.panelIndex() || panelIndex == PANEL.DataAvailability.panelIndex()){
426
- return false;
427
- }
428
- return true;
429
- }
430
-
431
- protected void initWorker() {
432
- this.servicer.getBaseServicerParameterBean().setPanelIndex(PANEL.Help.panelIndex());
433
-
434
- }
435
-
436
- public boolean isShowDialog() {
437
- return showDialog;
438
- }
439
-
440
- private void popupDialogAction(String dialog) {
441
- this.showDialog = true;
442
- this.setRefreshZones(dialog+"Zone,"+dialog+"BottomZone");
443
- }
444
-
445
-
446
-
447
-
448
- /**
449
- * this method only dispatch btnClicked action, don't write another logic in this method.
450
- * all method should be use Action as suffix w/o or with btnClick as parameter as neccersy.
451
- * @param btnClicked
452
- */
453
- public void processButtonClickedAction(String btnClicked) {
454
- if (btnClicked.equals(SUBMIT)) {
455
- this.submitAction();
456
- } else if (btnClicked.equals(EXPORT_EXCEL)) {
457
- this.exportExcelAction();
458
- }
459
- else if (btnClicked.equals(EXPORT_PDF)) {
460
- this.exportPDFAction();
461
- } else if (btnClicked.equals(DISPLAY_REFRESH)) {
462
- this.displayRefreshAction();
463
- } else if (btnClicked.equals(SORT_RERESH)) {
464
- this.sortRefreshAction();
465
- } else if (btnClicked.equals(FILTER_REFRESH)) {
466
- this.filterRefreshAction();
467
- } else if (btnClicked.equals("changeSortDisplayMode")) {
468
- this.changeSortDisplayModeAction();
469
- } else if (btnClicked.equals("clearResult")) {
470
- this.clearResultAction();
471
- } else if (btnClicked.equals("changeTime")) {
472
- this.changeTimeAction();
473
- } else if (btnClicked.equals("changeDecimal")) {
474
- this.changeDecimalAction();
475
- } else if ("resetDialog".equals(btnClicked)) {
476
- this.resetDialogAction();
477
- } else if ("changePanel".equals(btnClicked)) {
478
- this.changePanelAction();
479
- } else if ("changePaginator".equals(btnClicked)) {
480
- this.changePaginatorAction();
481
- }
482
- else if(btnClicked.endsWith("Dialog")){
483
- this.popupDialogAction(btnClicked);
484
- }
485
- else {
486
-
487
- }
488
-
489
- }
490
-
491
- @Override
492
- public void processRequest() {
493
-
494
- this.getResponse().setContentType("text/html");
495
- this.getRequest().setAttribute(AA_REFRESH_ZONES_NAME, getRequest().getParameter(AA_REFRESH_ZONES_NAME));
496
- this.getSession().setAttribute(CommonProperty.JobDoneIndicator, "N");
497
- this.getSession().setAttribute(CommonProperty.EndJspPageName, JSP_TOGO_PERIX);
498
- this.needForwordToJsp = true;
499
-
500
- if (isFromOtherPages(JSP_TOGO)) {
501
- this.initWorker();
502
- } else {
503
- this.bindParams(getRequest());
504
- if (this.btnClicked != null && this.btnClicked != "" && (!this.btnClicked.equals(""))) {
505
- this.processButtonClickedAction(this.btnClicked);
506
- }
507
- }
508
- if (this.needForwordToJsp && (!getResponse().isCommitted())) {
509
- try {
510
- this.getSession().setAttribute(CommonProperty.JobDoneIndicator, "Y");
511
- forwardToJsp(JSP_TOGO);
512
- } catch (IOException e) {
513
- e.printStackTrace();
514
- AppLog.error(this + ":Exception " + e.getMessage());
515
- } catch (ServletException e) {
516
- e.printStackTrace();
517
- AppLog.error(this + ":Exception " + e.getMessage());
518
- }
519
- }
520
-
521
-
522
- }
523
-
524
- private void resetDialogAction() {
525
- this.setRefreshZones("sourcePanelZone,topNavigationZone,sortDialogZone,filterDialogZone,displayDialogZone");
526
- }
527
-
528
- public void setRefreshZones(String zones) {
529
- this.getRequest().setAttribute(AA_REFRESH_ZONES_NAME, zones);
530
- }
531
-
532
-
533
- public void setServicer(!REPLACE_ME_FILE!ServicerImpl servicer) {
534
- this.servicer = servicer;
535
- }
536
-
537
-
538
-
539
- public void setShowDialog(boolean showDialog) {
540
- this.showDialog = showDialog;
541
- }
542
-
543
-
544
-
545
- public void sortRefreshAction() {
546
-
547
- try{
548
- SortingKeysModuleStateBean sortingKeysModuleStateBean = parseModuleStateBean(this.servicer.getSortingKeysModuleStateBean(),
549
- this.servicer.getSortingKeysModuleStateBean().getId(), this .getRequest());
550
- this.servicer.setSortingKeysModuleStateBean(sortingKeysModuleStateBean);
551
- }catch(Exception e){
552
- }
553
-
554
- this.servicer.sort();
555
- this.setRefreshZones("result");
556
-
557
- }
558
-
559
- public void submitAction() {
560
- this.servicer.getBaseServicerParameterBean().changeTime(this.getRequest());
561
-
562
-
563
- StatusMessageBean messageBean = initStatusMessageBean( this.getSession(), Descriptions.values(),"");
564
- this.servicer.getBaseServicerParameterBean().setSelectionPanelStatusOpen(false);
565
- this.servicer.getBaseServicerParameterBean().setMessageBean(messageBean);
566
-
567
- messageBean.reset();
568
- this.getAppStatusServicer().setStatusMessageBean(messageBean);
569
- messageBean.setCurrentStep(Descriptions.Initializing.ordinal());
570
-
571
- this.servicer.clearCache();
572
- this.servicer.getBaseServicerParameterBean().setPanelIndex(0);
573
-
574
- messageBean.setCurrentStep(Descriptions.RetrievingData.ordinal());
575
- try {
576
-
577
- this.servicer.retrieveData();
578
- } catch (Exception e) {
579
- e.printStackTrace();
580
- }
581
- messageBean.setCurrentStep(Descriptions.CreatingReport.ordinal());
582
-
583
-
584
- this.servicer.sort();
585
- this.servicer.updateDisplay();
586
-
587
-
588
- messageBean.setCurrentStep(Descriptions.Finalize.ordinal());
589
- this.servicer.getBaseServicerParameterBean().setDisplayStage(true);
590
- this.servicer.getBaseServicerParameterBean().setSelectionPanelStatusOpen(false);
591
- this.setRefreshZones("");
592
- messageBean.setStepCompleted(Descriptions.Finalize.ordinal() );
593
- this.getAppStatusServicer().setCompleted(true);
594
-
595
- }
596
-
597
-
598
-
599
-
600
- public String[] getActions() {
601
- return new String[] {
602
- "",
603
- "pageAction.showDialog('filterDialog')", // filter
604
- "", // search
605
- "", // highlight
606
- "pageAction.showDialog('sortDialog')", // sort
607
- "pageAction.showDialog('displayDialog')", // display
608
- "pageAction.clickButton('changeDecimal')", // decimal
609
- "pageAction.clickExportButton('" + ActionConstants.EXPORT_EXCEL + "')", // excel
610
- "pageAction.clickExportButton('" + ActionConstants.EXPORT_PDF + "')", // pdf
611
- "pageAction.showDialog('optionDialog')", // options
612
- "pageAction.showDialogDirectly('emailDialog')", // email
613
- "pageAction.clickButton('changeSortDisplayMode')", // inc
614
-
615
- };
616
- }
617
- public TopBarIcon[] getTopBarIcons() {
618
- return new TopBarIcon[] {
619
- TopBarIcon.Start,
620
- TopBarIcon.Filter,
621
- TopBarIcon.Search,
622
- TopBarIcon.Highlight,
623
- TopBarIcon.Sort,
624
- TopBarIcon.Display,
625
- TopBarIcon.Decimal,
626
- TopBarIcon.Excel,
627
- TopBarIcon.PDF,
628
- TopBarIcon.Options,
629
- TopBarIcon.Email,
630
- TopBarIcon.IncIcon ,
631
- };
632
-
633
- }
634
-
635
- public IconStatus[] getIconsStatus() {
636
- final boolean hasData = this.hasData();
637
- return new IconStatus[] {
638
- this.servicer.getBaseServicerParameterBean().isSelectionPanelStatusOpen() ? IconStatus.open : IconStatus.close,
639
- hasData? IconStatus.active :IconStatus.inactive, // filter
640
- IconStatus.inactive, // search
641
- IconStatus.inactive, // highlight
642
- hasData? IconStatus.active :IconStatus.inactive, // sort
643
- hasData? IconStatus.active :IconStatus.inactive, // display
644
- hasData? IconStatus.active :IconStatus.inactive, // decimal
645
- hasData? IconStatus.active :IconStatus.inactive, // excel
646
- IconStatus.inactive, // pdf
647
- IconStatus.inactive, // options
648
- hasData? IconStatus.active :IconStatus.inactive, // email
649
- IconStatus.active, // inc
650
- };
651
-
652
- }
653
- }
1
+ package com.l5m.!REPLACE_STYLE!.engine.worker;
2
+
3
+ import static com.l5m.common.util.ActionConstants.DISPLAY_REFRESH;
4
+ import static com.l5m.common.util.ActionConstants.EXPORT_EXCEL;
5
+ import static com.l5m.common.util.ActionConstants.EXPORT_PDF;
6
+ import static com.l5m.common.util.ActionConstants.FILTER_REFRESH;
7
+ import static com.l5m.common.util.ActionConstants.SORT_RERESH;
8
+ import static com.l5m.common.util.ActionConstants.SUBMIT;
9
+ import static com.l5m.common.util.dcnds.QHTCommonUtil.AA_REFRESH_ZONES_NAME;
10
+ import static com.l5m.common.util.dcnds.QHTCommonUtil.JSON_REFRESH_TYPE;
11
+ import static com.l5m.common.util.dcnds.QHTCommonUtil.PROGRESS_PAGE_POSTBACK;
12
+ import static com.l5m.common.util.dcnds.QHTCommonUtil.REFRESH_TYPE;
13
+ import static com.l5m.customtags.tags.utils.GenerateTagUtil.parseModuleStateBean;
14
+
15
+ import java.io.IOException;
16
+ import java.util.HashMap;
17
+ import java.util.HashSet;
18
+ import java.util.Map;
19
+ import java.util.Set;
20
+
21
+ import javax.servlet.ServletException;
22
+ import javax.servlet.http.HttpServletRequest;
23
+ import javax.servlet.http.HttpSession;
24
+
25
+ import org.apache.commons.lang.StringEscapeUtils;
26
+
27
+ import com.l5m.common.bean.NavigationBean;
28
+ import com.l5m.common.bean.NavigationItemBean;
29
+ import com.l5m.common.bean.StatusMessageBean;
30
+ import com.l5m.common.engine.exporter.ExportInformationBean;
31
+ import com.l5m.common.engine.servicer.ServicerType;
32
+ import com.l5m.common.engine.worker.AbstractWorker;
33
+ import com.l5m.common.util.ActionConstants;
34
+ import com.l5m.common.util.AppConfig;
35
+ import com.l5m.common.util.AppLog;
36
+ import com.l5m.common.util.CommonProperty;
37
+ import com.l5m.common.util.DataUtil;
38
+ import com.l5m.customtags.beans.BaseServicerParaBean;
39
+ import com.l5m.customtags.module.statebean.MultipleSelectStateBean;
40
+ import com.l5m.customtags.module.statebean.PaginatorStateBean;
41
+ import com.l5m.customtags.module.statebean.SortingKeysModuleStateBean;
42
+ import com.l5m.customtags.module.statebean.TopBar2StateBean;
43
+ import com.l5m.customtags.tags.Paginator2Tag;
44
+ import com.l5m.customtags.tags.utils.GenerateTagUtil;
45
+ import com.l5m.customtags.tags.utils.IconStatus;
46
+ import com.l5m.customtags.tags.utils.TopBarIcon;
47
+ import com.l5m.!REPLACE_STYLE!.engine.servicer.!REPLACE_ME_FILE!ServicerImpl;
48
+ import com.l5m.!REPLACE_STYLE!.engine.servicer.!REPLACE_ME_FILE!ServicerImpl.PANEL;
49
+
50
+ public class !REPLACE_ME_FILE!Worker extends AbstractWorker{
51
+
52
+
53
+
54
+ public static enum Descriptions{
55
+ Initializing("Initializing") , RetrievingData("Retrieving Data"), CreatingReport("Creating Report"), Finalize("Finalize")
56
+ ;
57
+ private final String label;
58
+ Descriptions(){
59
+ this.label = this.name();
60
+ }
61
+ Descriptions(String label){
62
+ this.label = label;
63
+ }
64
+ public String getLabel() {
65
+ return label;
66
+ }
67
+ }
68
+ public static final String JSP_TOGO_PERIX ; /*worker name w/o "Worker"*/
69
+ public static final String packageLowerCase;
70
+
71
+ static{
72
+ String clazzNames[] = Thread.currentThread().getStackTrace()[2].getClassName().split("\\.");
73
+ JSP_TOGO_PERIX = clazzNames[5].substring(0, clazzNames[5].length - "Worker".length);
74
+ packageLowerCase = clazzNames[2];
75
+ }
76
+ public static final String JSP_TOGO = JSP_TOGO_PERIX+".jsp";
77
+ public static final String WORKER_NAME = JSP_TOGO_PERIX+"Worker";
78
+
79
+
80
+
81
+ public static final String FORM_NAME = JSP_TOGO_PERIX+"Form";
82
+
83
+ public static final String packageUpperCase = packageLowerCase.toUpperCase();
84
+
85
+
86
+ public static StatusMessageBean initStatusMessageBean(HttpSession session,Descriptions [] descriptions , String extra){
87
+
88
+ StatusMessageBean messageBean = new StatusMessageBean();
89
+ for (int i = 0; i < descriptions.length; i++) {
90
+ messageBean.addStep((i==0?extra:"")+descriptions[i].getLabel());
91
+ }
92
+ StringBuffer messageBuffer = new StringBuffer();
93
+ messageBean.setMessageBuffer(messageBuffer);
94
+ session.setAttribute(CommonProperty.IntermediaMessage, messageBuffer);
95
+
96
+ return messageBean;
97
+ }
98
+
99
+ public static StatusMessageBean initStatusMessageBean(HttpSession session, String [] descriptions, String extra) {
100
+ StatusMessageBean messageBean = new StatusMessageBean();
101
+ for (int i = 0; i < descriptions.length; i++) {
102
+ messageBean.addStep((i == 0 ? extra : "") + descriptions[i]);
103
+ }
104
+
105
+ StringBuffer messageBuffer = new StringBuffer();
106
+ messageBean.setMessageBuffer(messageBuffer);
107
+ session.setAttribute(CommonProperty.IntermediaMessage, messageBuffer);
108
+
109
+ return messageBean;
110
+ }
111
+ public static void main(String[] x) {
112
+ //System.out.println(StringEscapeUtils.escapeHtml( "NETWORKPROGRAM"));
113
+ }
114
+ @ServicerType("com.l5m.!REPLACE_STYLE!.engine.servicer.!REPLACE_ME_FILE!ServicerImpl")
115
+ private !REPLACE_ME_FILE!ServicerImpl servicer;
116
+ protected String btnClicked;
117
+
118
+ protected boolean needForwordToJsp = true;
119
+
120
+ protected NavigationBean navigationBean;
121
+
122
+ private boolean showDialog = false;
123
+
124
+
125
+ public !REPLACE_ME_FILE!Worker() {
126
+ this.navigationBean = new NavigationBean();
127
+ this.navigationBean.setJSPGoTo(JSP_TOGO);
128
+
129
+
130
+ }
131
+
132
+ protected void bindParams(HttpServletRequest request) {
133
+ this.btnClicked = (super.getParamValueString(AppConfig.getProperty("butOption"), "N/A"));
134
+ String refresh = request.getParameter(REFRESH_TYPE);
135
+ this.needForwordToJsp = !(refresh != null && refresh.equals(JSON_REFRESH_TYPE));
136
+ if (this.btnClicked.equals(PROGRESS_PAGE_POSTBACK) || (refresh != null && refresh.equals(JSON_REFRESH_TYPE))) {
137
+ return;
138
+ }
139
+
140
+ BaseServicerParaBean baseServicerParameterBean = this.servicer.getBaseServicerParameterBean();
141
+ try {
142
+ baseServicerParameterBean.setPanelIndex(Integer.parseInt(request.getParameter("panelIndex")));
143
+ } catch (Exception e) {
144
+ baseServicerParameterBean.setPanelIndex(0);
145
+ }
146
+ baseServicerParameterBean.setSelectedTab(StringEscapeUtils.unescapeHtml( super.getParamValueString("accordionTestTop:selected", "SOURCE" )));
147
+ this.servicer.getBaseServicerParameterBean().getTopBarStateBean().setId("TopBar").parseOnlyStartStatus(request);
148
+
149
+ // use method from GenerateTagUtil to parse tags
150
+
151
+
152
+
153
+ }
154
+ private void bindParamsDisplayAndSort(HttpServletRequest request) {
155
+ this.servicer.getBaseServicerParameterBean().bindTopBart(request, "TopBar");
156
+ }
157
+
158
+
159
+
160
+
161
+ private void changeDecimalAction() {
162
+ this.setRefreshZones("result");
163
+ this.servicer.setReportDecimalControlList(TopBar2StateBean.parseOnlyDecimal(this.getRequest(), "TopBar" ).getValue());
164
+
165
+ }
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ private void changePaginatorAction() {
176
+ PaginatorStateBean stateBean = this.servicer.getPaginatorStateBean();
177
+ stateBean.parse(this.getRequest());
178
+ this.servicer.handlePaginator(this.servicer.getPanelIndex());
179
+ this.setRefreshZones("panelZone,result");
180
+
181
+ }
182
+
183
+
184
+
185
+
186
+ private void changePanelAction() {
187
+ this.setRefreshZones("result,topNavigationZone,sortDialogZone,filterDialogZone,displayDialogZone");
188
+
189
+ }
190
+
191
+
192
+
193
+
194
+
195
+ public void changeSortDisplayModeAction() {
196
+ String sortBy = this.servicer.getBaseServicerParameterBean().getSelectedSortBy();
197
+ this.bindParamsDisplayAndSort(this.getRequest());
198
+
199
+ Set<String> displayBy = this.servicer.getBaseServicerParameterBean().getSelectedDisplayBy();
200
+
201
+ if(!this.servicer.getBaseServicerParameterBean().getSelectedDisplayBy().equals( displayBy)){
202
+ this.servicer.updateDisplay();
203
+ }
204
+ if(!this.servicer.getBaseServicerParameterBean().getSelectedSortBy().equals(sortBy) ){
205
+ this.servicer.sort();
206
+ }
207
+
208
+ this.setRefreshZones("result,sourcePanelZone");
209
+
210
+ }
211
+
212
+
213
+
214
+ /* private String baseDir(String subLevel) {
215
+ return getCurvePath() + "" + this.servicer.getUserId() + "/" + navigationBean.getProgramKey() + "/" + subLevel+"/";
216
+ }
217
+
218
+
219
+ */
220
+
221
+
222
+
223
+
224
+
225
+ public void changeTimeAction() {
226
+ this.servicer.getBaseServicerParameterBean().changeTime(this.getRequest());
227
+ this.setRefreshZones("sourcePanelZone");
228
+
229
+ if(this.servicer.isDisplayStage()){
230
+ this.clearResultAction();
231
+ }
232
+ }
233
+
234
+
235
+
236
+ public void clearResultAction() {
237
+ this.servicer.clearCache();
238
+ this.servicer.getBaseServicerParameterBean().setPanelIndex(PANEL.Help.panelIndex());
239
+ this.servicer.getBaseServicerParameterBean().setDisplayStage(false);
240
+ this.setRefreshZones("result,sourcePanelZone");
241
+ }
242
+
243
+ @SuppressWarnings("unchecked")
244
+ public void displayRefreshAction() {
245
+ MultipleSelectStateBean messuare = new MultipleSelectStateBean();
246
+ messuare.setSelectedValues(new HashSet<String>());
247
+ messuare.setId("multipleColumnsController");
248
+ messuare.parse(this.getRequest());
249
+ if(servicer.getColumnsMap() != null){
250
+ boolean[] displayControllerMeasurement = new boolean[servicer.getColumnsMap().size()];
251
+ if (messuare.getSelectedValues() != null) {
252
+ displayControllerMeasurement = messuare.getSelectedValueBoolean(servicer.getColumnsMap());
253
+ this.servicer.setDisplayController(displayControllerMeasurement);
254
+ }
255
+ this.servicer.setSelectedColumns(messuare.getSelectedValues() == null ? (new HashSet<String>()) : (HashSet<String>) messuare.getSelectedValues());
256
+ }
257
+
258
+
259
+ this.servicer.updateDisplay();
260
+ this.setRefreshZones("result");
261
+ }
262
+
263
+
264
+
265
+ public void exportExcelAction() {
266
+ this.needForwordToJsp = false;
267
+ @SuppressWarnings("unused")
268
+ ExportInformationBean informationBean = this.getExportInformationBean();
269
+
270
+ }
271
+
272
+ public void exportPDFAction() {
273
+ this.needForwordToJsp = false;
274
+ }
275
+
276
+ public void filterRefreshAction() {
277
+ this.servicer.processFilter();
278
+ this.setRefreshZones("result");
279
+ //
280
+ }
281
+
282
+
283
+
284
+ /**
285
+ * @return the aPP_NAME
286
+ */
287
+ public String getAPP_NAME() {
288
+ @SuppressWarnings("unchecked")
289
+ Map<String, NavigationItemBean> navBarAccessMap = (Map<String, NavigationItemBean>) this.getRequest().getSession().getAttribute("navAccessBean");
290
+ String displayName = null;
291
+ try {
292
+ displayName = navBarAccessMap.get(this.navigationBean.getProgramKey()).getDisplayName();
293
+ } catch (Exception e) {
294
+ }
295
+ if (displayName != null)
296
+ return displayName;
297
+ return "";
298
+ }
299
+
300
+
301
+
302
+ /**
303
+ * @return the btnClicked
304
+ */
305
+ public String getBtnClicked() {
306
+ return btnClicked;
307
+ }
308
+
309
+
310
+
311
+
312
+ public int getDataAvailability() {
313
+ return PANEL.DataAvailability.panelIndex();
314
+ }
315
+
316
+
317
+
318
+ @SuppressWarnings({ "unchecked"})
319
+ private ExportInformationBean getExportInformationBean(){
320
+ ExportInformationBean informationBean = null;
321
+ try {
322
+ informationBean = new ExportInformationBean(this.navigationBean, (HashMap) this.getSession().getAttribute(UserCompanyWorker.NAV_ACCESS_BEAN), DataUtil.getCompanyName(this.servicer.getDbHandler(), this.servicer.getCompanyId()), DataUtil.getUserFullName(this.servicer.getDbHandler(), this.servicer.getUserId()));
323
+ }
324
+ catch (Exception e) {
325
+ e.printStackTrace();
326
+ }
327
+ return informationBean;
328
+ }
329
+
330
+ /**
331
+ * @return the fORM_NAME
332
+ */
333
+ public String getFORM_NAME() {
334
+ return FORM_NAME;
335
+ }
336
+
337
+ public int getHelp() {
338
+ return PANEL.Help.panelIndex();
339
+ }
340
+
341
+
342
+
343
+ /**
344
+ * @return the jSP_TOGO
345
+ */
346
+ public String getJSP_TOGO() {
347
+ return JSP_TOGO;
348
+ }
349
+
350
+ public String getJspGoto() {
351
+ return JSP_TOGO;
352
+ }
353
+
354
+ /**
355
+ * @return the navigationBean
356
+ */
357
+ public NavigationBean getNavigationBean() {
358
+ return navigationBean;
359
+ }
360
+
361
+ public String getPackageLowerCase() {
362
+ return packageLowerCase;
363
+ }
364
+
365
+ public String getPackageUpperCase() {
366
+ return packageUpperCase;
367
+ }
368
+
369
+ public PANEL[] getPANEL(){
370
+ return PANEL.values();
371
+ }
372
+
373
+
374
+ public String getRenderHTML() {
375
+ if(! hasData()) return "";
376
+ try{
377
+ }catch(Exception e){
378
+ e.printStackTrace();
379
+ }
380
+ return "";
381
+
382
+ }
383
+
384
+
385
+
386
+ public String getRenderPaginatorHTML() {
387
+ if(!hasData()) return "";
388
+ Paginator2Tag paginatorTag = GenerateTagUtil.getPaginator2Tag("PaginatorStateBeanTag", "pageAction.changePaginator();", this.servicer.getPaginatorStateBean());
389
+ paginatorTag.setStyle(packageLowerCase);
390
+ try {
391
+ return paginatorTag.renderHTML();
392
+ } catch (Exception e) {
393
+ e.printStackTrace();
394
+ }
395
+ return "";
396
+ }
397
+
398
+ public !REPLACE_ME_FILE!ServicerImpl getServicer() {
399
+ return servicer;
400
+ }
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+ public String getUrl() {
409
+ String workerParamName = AppConfig.getProperty("requestAction");
410
+ String jspSrcParamName = AppConfig.getProperty("srcPage");
411
+ String companyId = this.servicer.getCompanyId();
412
+ StringBuilder url = new StringBuilder();
413
+ //url.append(this.getRequest().getContextPath()+"/servlet/L5MOnline/").append(AppConfig.getProperty("appL5MOnline")).append("?");
414
+ url.append(workerParamName).append("=").append(this.getRequest().getParameter(workerParamName)).append("&");
415
+ url.append(jspSrcParamName).append("=" + JSP_TOGO + "&companyid=").append(companyId);
416
+ url.append("&1stnavbar=").append(this.getRequest().getParameter("1stnavbar"));
417
+ url.append("&").append(REFRESH_TYPE).append("=").append(JSON_REFRESH_TYPE);
418
+
419
+ return url.toString();
420
+ }
421
+
422
+ /*
423
+ * @return the wORKER_NAME
424
+ */
425
+ public String getWORKER_NAME() {
426
+ return WORKER_NAME;
427
+ }
428
+
429
+ public boolean hasData(){
430
+ final int panelIndex = this.servicer.getPanelIndex();
431
+ if(panelIndex == PANEL.Help.panelIndex() || panelIndex == PANEL.DataAvailability.panelIndex()){
432
+ return false;
433
+ }
434
+ return true;
435
+ }
436
+
437
+ protected void initWorker() {
438
+ this.servicer.getBaseServicerParameterBean().setPanelIndex(PANEL.Help.panelIndex());
439
+
440
+ }
441
+
442
+ public boolean isShowDialog() {
443
+ return showDialog;
444
+ }
445
+
446
+ private void popupDialogAction(String dialog) {
447
+ this.showDialog = true;
448
+ this.setRefreshZones(dialog+"Zone,"+dialog+"BottomZone");
449
+ }
450
+
451
+
452
+
453
+
454
+ /**
455
+ * this method only dispatch btnClicked action, don't write another logic in this method.
456
+ * all method should be use Action as suffix w/o or with btnClick as parameter as neccersy.
457
+ * @param btnClicked
458
+ */
459
+ public void processButtonClickedAction(String btnClicked) {
460
+ if (btnClicked.equals(SUBMIT)) {
461
+ this.submitAction();
462
+ } else if (btnClicked.equals(EXPORT_EXCEL)) {
463
+ this.exportExcelAction();
464
+ }
465
+ else if (btnClicked.equals(EXPORT_PDF)) {
466
+ this.exportPDFAction();
467
+ } else if (btnClicked.equals(DISPLAY_REFRESH)) {
468
+ this.displayRefreshAction();
469
+ } else if (btnClicked.equals(SORT_RERESH)) {
470
+ this.sortRefreshAction();
471
+ } else if (btnClicked.equals(FILTER_REFRESH)) {
472
+ this.filterRefreshAction();
473
+ } else if (btnClicked.equals("changeSortDisplayMode")) {
474
+ this.changeSortDisplayModeAction();
475
+ } else if (btnClicked.equals("clearResult")) {
476
+ this.clearResultAction();
477
+ } else if (btnClicked.equals("changeTime")) {
478
+ this.changeTimeAction();
479
+ } else if (btnClicked.equals("changeDecimal")) {
480
+ this.changeDecimalAction();
481
+ } else if ("resetDialog".equals(btnClicked)) {
482
+ this.resetDialogAction();
483
+ } else if ("changePanel".equals(btnClicked)) {
484
+ this.changePanelAction();
485
+ } else if ("changePaginator".equals(btnClicked)) {
486
+ this.changePaginatorAction();
487
+ }
488
+ else if(btnClicked.endsWith("Dialog")){
489
+ this.popupDialogAction(btnClicked);
490
+ }
491
+ else {
492
+
493
+ }
494
+
495
+ }
496
+
497
+ @Override
498
+ public void processRequest() {
499
+
500
+ this.getResponse().setContentType("text/html");
501
+ this.getRequest().setAttribute(AA_REFRESH_ZONES_NAME, getRequest().getParameter(AA_REFRESH_ZONES_NAME));
502
+ this.getSession().setAttribute(CommonProperty.JobDoneIndicator, "N");
503
+ this.getSession().setAttribute(CommonProperty.EndJspPageName, JSP_TOGO_PERIX);
504
+ this.needForwordToJsp = true;
505
+
506
+ if (isFromOtherPages(JSP_TOGO)) {
507
+ this.initWorker();
508
+ } else {
509
+ this.bindParams(getRequest());
510
+ if (this.btnClicked != null && this.btnClicked != "" && (!this.btnClicked.equals(""))) {
511
+ this.processButtonClickedAction(this.btnClicked);
512
+ }
513
+ }
514
+ if (this.needForwordToJsp && (!getResponse().isCommitted())) {
515
+ try {
516
+ this.getSession().setAttribute(CommonProperty.JobDoneIndicator, "Y");
517
+ forwardToJsp(JSP_TOGO);
518
+ } catch (IOException e) {
519
+ e.printStackTrace();
520
+ AppLog.error(this + ":Exception " + e.getMessage());
521
+ } catch (ServletException e) {
522
+ e.printStackTrace();
523
+ AppLog.error(this + ":Exception " + e.getMessage());
524
+ }
525
+ }
526
+
527
+
528
+ }
529
+
530
+ private void resetDialogAction() {
531
+ this.setRefreshZones("sourcePanelZone,topNavigationZone,sortDialogZone,filterDialogZone,displayDialogZone");
532
+ }
533
+
534
+ public void setRefreshZones(String zones) {
535
+ this.getRequest().setAttribute(AA_REFRESH_ZONES_NAME, zones);
536
+ }
537
+
538
+
539
+ public void setServicer(!REPLACE_ME_FILE!ServicerImpl servicer) {
540
+ this.servicer = servicer;
541
+ }
542
+
543
+
544
+
545
+ public void setShowDialog(boolean showDialog) {
546
+ this.showDialog = showDialog;
547
+ }
548
+
549
+
550
+
551
+ public void sortRefreshAction() {
552
+
553
+ try{
554
+ SortingKeysModuleStateBean sortingKeysModuleStateBean = parseModuleStateBean(this.servicer.getSortingKeysModuleStateBean(),
555
+ this.servicer.getSortingKeysModuleStateBean().getId(), this .getRequest());
556
+ this.servicer.setSortingKeysModuleStateBean(sortingKeysModuleStateBean);
557
+ }catch(Exception e){
558
+ }
559
+
560
+ this.servicer.sort();
561
+ this.setRefreshZones("result");
562
+
563
+ }
564
+
565
+ public void submitAction() {
566
+ this.servicer.getBaseServicerParameterBean().changeTime(this.getRequest());
567
+
568
+
569
+ StatusMessageBean messageBean = initStatusMessageBean( this.getSession(), Descriptions.values(),"");
570
+ this.servicer.getBaseServicerParameterBean().setSelectionPanelStatusOpen(false);
571
+ this.servicer.getBaseServicerParameterBean().setMessageBean(messageBean);
572
+
573
+ messageBean.reset();
574
+ this.getAppStatusServicer().setStatusMessageBean(messageBean);
575
+ messageBean.setCurrentStep(Descriptions.Initializing.ordinal());
576
+
577
+ this.servicer.clearCache();
578
+ this.servicer.getBaseServicerParameterBean().setPanelIndex(0);
579
+
580
+ messageBean.setCurrentStep(Descriptions.RetrievingData.ordinal());
581
+ try {
582
+
583
+ this.servicer.retrieveData();
584
+ } catch (Exception e) {
585
+ e.printStackTrace();
586
+ }
587
+ messageBean.setCurrentStep(Descriptions.CreatingReport.ordinal());
588
+
589
+
590
+ this.servicer.sort();
591
+ this.servicer.updateDisplay();
592
+
593
+
594
+ messageBean.setCurrentStep(Descriptions.Finalize.ordinal());
595
+ this.servicer.getBaseServicerParameterBean().setDisplayStage(true);
596
+ this.servicer.getBaseServicerParameterBean().setSelectionPanelStatusOpen(false);
597
+ this.setRefreshZones("");
598
+ messageBean.setStepCompleted(Descriptions.Finalize.ordinal() );
599
+ this.getAppStatusServicer().setCompleted(true);
600
+
601
+ }
602
+
603
+
604
+
605
+
606
+ public String[] getActions() {
607
+ return new String[] {
608
+ "",
609
+ "pageAction.showDialog('filterDialog')", // filter
610
+ "", // search
611
+ "", // highlight
612
+ "pageAction.showDialog('sortDialog')", // sort
613
+ "pageAction.showDialog('displayDialog')", // display
614
+ "pageAction.clickButton('changeDecimal')", // decimal
615
+ "pageAction.clickExportButton('" + ActionConstants.EXPORT_EXCEL + "')", // excel
616
+ "pageAction.clickExportButton('" + ActionConstants.EXPORT_PDF + "')", // pdf
617
+ "pageAction.showDialog('optionDialog')", // options
618
+ "pageAction.showDialogDirectly('emailDialog')", // email
619
+ "pageAction.clickButton('changeSortDisplayMode')", // inc
620
+
621
+ };
622
+ }
623
+ public TopBarIcon[] getTopBarIcons() {
624
+ return new TopBarIcon[] {
625
+ TopBarIcon.Start,
626
+ TopBarIcon.Filter,
627
+ TopBarIcon.Search,
628
+ TopBarIcon.Highlight,
629
+ TopBarIcon.Sort,
630
+ TopBarIcon.Display,
631
+ TopBarIcon.Decimal,
632
+ TopBarIcon.Excel,
633
+ TopBarIcon.PDF,
634
+ TopBarIcon.Options,
635
+ TopBarIcon.Email,
636
+ TopBarIcon.IncIcon ,
637
+ };
638
+
639
+ }
640
+
641
+ public IconStatus[] getIconsStatus() {
642
+ final boolean hasData = this.hasData();
643
+ return new IconStatus[] {
644
+ this.servicer.getBaseServicerParameterBean().isSelectionPanelStatusOpen() ? IconStatus.open : IconStatus.close,
645
+ hasData? IconStatus.active :IconStatus.inactive, // filter
646
+ IconStatus.inactive, // search
647
+ IconStatus.inactive, // highlight
648
+ hasData? IconStatus.active :IconStatus.inactive, // sort
649
+ hasData? IconStatus.active :IconStatus.inactive, // display
650
+ hasData? IconStatus.active :IconStatus.inactive, // decimal
651
+ hasData? IconStatus.active :IconStatus.inactive, // excel
652
+ IconStatus.inactive, // pdf
653
+ IconStatus.inactive, // options
654
+ hasData? IconStatus.active :IconStatus.inactive, // email
655
+ IconStatus.active, // inc
656
+ };
657
+
658
+ }
659
+ }