Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ProcessPocPopulationServiceDecorator |
|
| 2.0;2 |
1 | /* | |
2 | * To change this template, choose Tools | Templates | |
3 | * and open the template in the editor. | |
4 | */ | |
5 | package org.kuali.student.process.poc; | |
6 | ||
7 | import org.kuali.student.r2.common.dto.ContextInfo; | |
8 | import org.kuali.student.r2.common.util.constants.PopulationServiceConstants; | |
9 | import org.kuali.student.r2.core.hold.dto.IssueInfo; | |
10 | import org.kuali.student.r2.core.population.dto.PopulationInfo; | |
11 | import org.kuali.student.r2.core.population.service.PopulationService; | |
12 | import org.kuali.student.r2.core.population.service.PopulationServiceDecorator; | |
13 | ||
14 | /** | |
15 | * | |
16 | * @author nwright | |
17 | */ | |
18 | public class ProcessPocPopulationServiceDecorator extends PopulationServiceDecorator { | |
19 | ||
20 | public ProcessPocPopulationServiceDecorator(PopulationService nextDecorator) { | |
21 | 0 | super(); |
22 | 0 | this.setNextDecorator(nextDecorator); |
23 | 0 | initializeData(); |
24 | 0 | } |
25 | ||
26 | private void initializeData() { | |
27 | 0 | ContextInfo context = new ContextInfo(); |
28 | 0 | context.setPrincipalId("POC-Initializer"); |
29 | ||
30 | 0 | PopulationInfo summerOnly = new PopulationInfo(); |
31 | 0 | summerOnly.setName("summer only students"); |
32 | 0 | summerOnly.setTypeKey(PopulationServiceConstants.SUMMER_ONLY_STUDENTS_POPULATION_KEY); |
33 | // summerOnly.setStateKey(PopulationServiceConstants.); | |
34 | try { | |
35 | 0 | summerOnly = this.createPopulation(summerOnly, context); |
36 | 0 | } catch (Exception ex) { |
37 | 0 | throw new RuntimeException("error creating hold", ex); |
38 | 0 | } |
39 | ||
40 | 0 | IssueInfo overdueBookIssue = new IssueInfo(); |
41 | 0 | overdueBookIssue.setName("Overdue Library Issue"); |
42 | // overdueBookIssue.setTypeKey(PopulationServiceConstants.OVERDUE_LIBRARY_MATERIALS_ISSUE_TYPE_KEY); | |
43 | // overdueBookIssue.setStateKey(PopulationServiceConstants.ISSUE_ACTIVE_STATE_KEY); | |
44 | // try { | |
45 | // overdueBookIssue = this.createIssue(overdueBookIssue, context); | |
46 | // } catch (Exception ex) { | |
47 | // throw new RuntimeException("error creating hold", ex); | |
48 | // } | |
49 | ||
50 | ||
51 | // PopulationInfo hold = new PopulationInfo(); | |
52 | // hold.setTypeKey(PopulationServiceConstants.STUDENT_HOLD_TYPE_KEY); | |
53 | // hold.setStateKey(PopulationServiceConstants.HOLD_ACTIVE_STATE_KEY); | |
54 | // hold.setName(summerOnly.getName()); | |
55 | // hold.setIsOverridable(true); | |
56 | // hold.setIsWarning(false); | |
57 | // hold.setEffectiveDate(new Date()); | |
58 | // hold.setIssueId(summerOnly.getId()); | |
59 | // hold.setPersonId(ProcessPocConstants.PERSON_ID_CLIFFORD_RIDDLE_2397); | |
60 | // try { | |
61 | // this.createPopulation(hold, context); | |
62 | // } catch (Exception ex) { | |
63 | // throw new RuntimeException("error creating hold", ex); | |
64 | // } | |
65 | // hold.setPersonId(ProcessPocConstants.PERSON_ID_NINA_WELCH_2166); | |
66 | // try { | |
67 | // this.createPopulation(hold, context); | |
68 | // } catch (Exception ex) { | |
69 | // throw new RuntimeException("error creating hold", ex); | |
70 | // } | |
71 | // | |
72 | // | |
73 | // hold.setTypeKey(PopulationServiceConstants.STUDENT_HOLD_TYPE_KEY); | |
74 | // hold.setStateKey(PopulationServiceConstants.HOLD_ACTIVE_STATE_KEY); | |
75 | // hold.setName(overdueBookIssue.getName()); | |
76 | // hold.setIsOverridable(true); | |
77 | // hold.setIsWarning(false); | |
78 | // hold.setEffectiveDate(new Date()); | |
79 | // hold.setIssueId(overdueBookIssue.getId()); | |
80 | // hold.setPersonId(ProcessPocConstants.PERSON_ID_BETTY_MARTIN_2005); | |
81 | // try { | |
82 | // this.createPopulation(hold, context); | |
83 | // } catch (Exception ex) { | |
84 | // throw new RuntimeException("error creating hold", ex); | |
85 | // } | |
86 | // hold.setPersonId(ProcessPocConstants.PERSON_ID_NINA_WELCH_2166); | |
87 | // try { | |
88 | // this.createPopulation(hold, context); | |
89 | // } catch (Exception ex) { | |
90 | // throw new RuntimeException("error creating hold", ex); | |
91 | // } | |
92 | ||
93 | 0 | } |
94 | } |