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.r2.common.dto.DtoConstants;
21 import org.kuali.student.r1.core.statement.dto.StatementTypeInfo;
22 import org.kuali.student.common.ui.client.configurable.mvc.layouts.TabMenuController;
23 import org.kuali.student.common.ui.client.mvc.Controller;
24 import org.kuali.student.common.ui.client.mvc.DataModelDefinition;
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 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 protected String type = "Course";
86 protected String state = DtoConstants.STATE_DRAFT;
87 protected String groupName = LUUIConstants.COURSE_GROUP_NAME;
88
89 protected DataModelDefinition modelDefinition;
90 protected List<StatementTypeInfo> stmtTypes;
91 protected CourseSummaryConfigurer summaryConfigurer;
92
93 public static enum ViewCourseSections{BRIEF, DETAILED, CATALOG}
94
95 public void setModelDefinition(DataModelDefinition modelDefinition){
96 this.modelDefinition = modelDefinition;
97 }
98
99 public void setStatementTypes(List<StatementTypeInfo> stmtTypes) {
100 this.stmtTypes = stmtTypes;
101 }
102
103 public void generateLayout(ViewCourseController layoutController) {
104 groupName = LUUIConstants.COURSE_GROUP_NAME;
105
106
107 this.generateLayout(layoutController, CLU_PROPOSAL_MODEL);
108 layoutController.addContentWidget(layoutController.getStatusLabel());
109 Widget dropdown = layoutController.generateActionDropDown();
110 layoutController.addContentWidget(dropdown);
111
112
113 layoutController.addContentWidget(layoutController.getVersionHistoryWidget());
114 layoutController.showPrint(true);
115 }
116
117 public void generateLayout(TabMenuController layoutController, String modelId) {
118 groupName = LUUIConstants.COURSE_GROUP_NAME;
119
120
121 summaryConfigurer = GWT.create(CourseSummaryConfigurer.class);
122 summaryConfigurer.init(type, state, groupName, modelDefinition, stmtTypes,
123 (Controller)layoutController, modelId);
124 layoutController.addTab(summaryConfigurer.generateCourseBriefSection(), "At a Glance");
125 layoutController.addTab(summaryConfigurer.generateCourseSummarySection(), "Detailed View");
126 layoutController.addTab(summaryConfigurer.generateCourseCatalogSection(), "Catalog View");
127 layoutController.setDefaultView(ViewCourseSections.BRIEF);
128
129
130
131
132
133 }
134
135 public CourseSummaryConfigurer getSummaryConfigurer() {
136 return summaryConfigurer;
137 }
138 }