1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.lum.lu.ui.course.client.configuration; |
17 | |
|
18 | |
import java.util.List; |
19 | |
|
20 | |
import org.kuali.student.common.dto.DtoConstants; |
21 | |
import org.kuali.student.common.ui.client.configurable.mvc.layouts.TabMenuController; |
22 | |
import org.kuali.student.common.ui.client.mvc.Controller; |
23 | |
import org.kuali.student.common.ui.client.mvc.DataModelDefinition; |
24 | |
import org.kuali.student.core.statement.dto.StatementTypeInfo; |
25 | |
import org.kuali.student.lum.common.client.lu.LUUIConstants; |
26 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.base.MetaInfoConstants; |
27 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.base.RichTextInfoConstants; |
28 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.AffiliatedOrgInfoConstants; |
29 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseActivityConstants; |
30 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseConstants; |
31 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseCourseSpecificLOsConstants; |
32 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseDurationConstants; |
33 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseExpenditureInfoConstants; |
34 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseFormatConstants; |
35 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseJointsConstants; |
36 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseLearningResultsConstants; |
37 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseRevenueInfoConstants; |
38 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseVersionsConstants; |
39 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoConstants; |
40 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoFixedRateFeeConstants; |
41 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.LearningObjectiveConstants; |
42 | |
import org.kuali.student.lum.lu.assembly.data.client.constants.orch.SingleUseLoConstants; |
43 | |
import org.kuali.student.lum.lu.ui.course.client.controllers.ViewCourseController; |
44 | |
|
45 | |
import com.google.gwt.core.client.GWT; |
46 | |
import com.google.gwt.user.client.ui.Widget; |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | 0 | public class ViewCourseConfigurer |
56 | |
implements |
57 | |
CreditCourseConstants, |
58 | |
CreditCourseFormatConstants, |
59 | |
CreditCourseActivityConstants, |
60 | |
MetaInfoConstants, |
61 | |
CreditCourseDurationConstants, |
62 | |
FeeInfoConstants, |
63 | |
LearningObjectiveConstants, |
64 | |
CreditCourseCourseSpecificLOsConstants, |
65 | |
SingleUseLoConstants, |
66 | |
CreditCourseRevenueInfoConstants, |
67 | |
CreditCourseExpenditureInfoConstants, |
68 | |
AffiliatedOrgInfoConstants, |
69 | |
CreditCourseVersionsConstants, |
70 | |
CreditCourseJointsConstants, |
71 | |
RichTextInfoConstants, |
72 | |
FeeInfoFixedRateFeeConstants, |
73 | |
CreditCourseLearningResultsConstants |
74 | |
{ |
75 | |
|
76 | |
public static final String COURSE_MODEL = "courseModel"; |
77 | |
|
78 | |
|
79 | |
private static final String STATEMENTS_PATH = "statements"; |
80 | |
private static final String ID_TRANSLATION = "id-translation"; |
81 | |
|
82 | |
public static final String CLU_PROPOSAL_MODEL = "courseProposalModel"; |
83 | |
|
84 | |
|
85 | 0 | private String type = "Course"; |
86 | 0 | private String state = DtoConstants.STATE_DRAFT; |
87 | 0 | private String groupName = LUUIConstants.COURSE_GROUP_NAME; |
88 | |
|
89 | |
private DataModelDefinition modelDefinition; |
90 | |
private List<StatementTypeInfo> stmtTypes; |
91 | |
private CourseSummaryConfigurer summaryConfigurer; |
92 | |
|
93 | 0 | public static enum ViewCourseSections{BRIEF, DETAILED, CATALOG} |
94 | |
|
95 | |
public void setModelDefinition(DataModelDefinition modelDefinition){ |
96 | 0 | this.modelDefinition = modelDefinition; |
97 | 0 | } |
98 | |
|
99 | |
public void setStatementTypes(List<StatementTypeInfo> stmtTypes) { |
100 | 0 | this.stmtTypes = stmtTypes; |
101 | 0 | } |
102 | |
|
103 | |
public void generateLayout(ViewCourseController layoutController) { |
104 | 0 | groupName = LUUIConstants.COURSE_GROUP_NAME; |
105 | |
|
106 | |
|
107 | 0 | this.generateLayout(layoutController, CLU_PROPOSAL_MODEL); |
108 | 0 | layoutController.addContentWidget(layoutController.getStatusLabel()); |
109 | 0 | Widget dropdown = layoutController.generateActionDropDown(); |
110 | 0 | layoutController.addContentWidget(dropdown); |
111 | |
|
112 | |
|
113 | 0 | layoutController.addContentWidget(layoutController.getVersionHistoryWidget()); |
114 | 0 | layoutController.showPrint(true); |
115 | 0 | } |
116 | |
|
117 | |
public void generateLayout(TabMenuController layoutController, String modelId) { |
118 | 0 | groupName = LUUIConstants.COURSE_GROUP_NAME; |
119 | |
|
120 | |
|
121 | 0 | summaryConfigurer = GWT.create(CourseSummaryConfigurer.class); |
122 | 0 | summaryConfigurer.init(type, state, groupName, modelDefinition, stmtTypes, |
123 | |
(Controller)layoutController, modelId); |
124 | 0 | layoutController.addTab(summaryConfigurer.generateCourseBriefSection(), "At a Glance"); |
125 | 0 | layoutController.addTab(summaryConfigurer.generateCourseSummarySection(), "Detailed View"); |
126 | 0 | layoutController.addTab(summaryConfigurer.generateCourseCatalogSection(), "Catalog View"); |
127 | 0 | layoutController.setDefaultView(ViewCourseSections.BRIEF); |
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
|
133 | 0 | } |
134 | |
|
135 | |
public CourseSummaryConfigurer getSummaryConfigurer() { |
136 | 0 | return summaryConfigurer; |
137 | |
} |
138 | |
} |