1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.lifecycle;
17
18 import java.util.Queue;
19
20 import org.kuali.rice.krad.uif.UifConstants;
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle.LifecycleEvent;
23 import org.kuali.rice.krad.uif.lifecycle.initialize.AssignIdsTask;
24 import org.kuali.rice.krad.uif.lifecycle.initialize.PopulatePathTask;
25 import org.kuali.rice.krad.uif.lifecycle.initialize.PrepareForCacheTask;
26 import org.kuali.rice.krad.uif.lifecycle.initialize.SortContainerTask;
27 import org.kuali.rice.krad.uif.util.LifecycleElement;
28
29
30
31
32
33
34 public class PreProcessElementPhase extends ViewLifecyclePhaseBase {
35
36
37
38
39 @Override
40 public LifecycleEvent getEventToNotify() {
41 return null;
42 }
43
44
45
46
47 @Override
48 public String getStartViewStatus() {
49 return UifConstants.ViewStatus.CREATED;
50 }
51
52
53
54
55 @Override
56 public String getEndViewStatus() {
57 return UifConstants.ViewStatus.CACHED;
58 }
59
60
61
62
63 @Override
64 public String getViewPhase() {
65 return UifConstants.ViewPhases.PRE_PROCESS;
66 }
67
68
69
70
71 @Override
72 protected void initializePendingTasks(Queue<ViewLifecycleTask<?>> tasks) {
73 tasks.offer(LifecycleTaskFactory.getTask(AssignIdsTask.class, this));
74 tasks.offer(LifecycleTaskFactory.getTask(PopulatePathTask.class, this));
75 tasks.offer(LifecycleTaskFactory.getTask(SortContainerTask.class, this));
76 tasks.offer(LifecycleTaskFactory.getTask(PrepareForCacheTask.class, this));
77 }
78
79
80
81
82 @Override
83 protected ViewLifecyclePhase initializeSuccessor(LifecycleElement nestedElement, String nestedPath,
84 Component nestedParent) {
85 if (nestedElement != null && !UifConstants.ViewStatus.CACHED.equals(nestedElement.getViewStatus())) {
86 return LifecyclePhaseFactory.preProcess(nestedElement, nestedPath, nestedParent);
87 }
88
89 return null;
90 }
91
92 }