1 package org.kuali.student.lum.program.client.variation.view;
2
3 import org.kuali.student.common.ui.client.configurable.mvc.Configurer;
4 import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle;
5 import org.kuali.student.common.ui.client.configurable.mvc.sections.HorizontalSection;
6 import org.kuali.student.common.ui.client.configurable.mvc.sections.TableSection;
7 import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView;
8 import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration;
9 import org.kuali.student.lum.program.client.ProgramConstants;
10 import org.kuali.student.lum.program.client.ProgramMsgConstants;
11 import org.kuali.student.lum.program.client.ProgramSections;
12 import org.kuali.student.lum.program.client.major.MajorEditableHeader;
13
14
15
16
17 public class VariationInformationViewConfiguration extends AbstractSectionConfiguration {
18
19 public static VariationInformationViewConfiguration create(Configurer configurer) {
20 return new VariationInformationViewConfiguration(configurer, false);
21 }
22
23 public static VariationInformationViewConfiguration createSpecial(Configurer configurer) {
24 return new VariationInformationViewConfiguration(configurer, true);
25 }
26
27 private VariationInformationViewConfiguration(Configurer configurer, boolean isSpecial) {
28 this.setConfigurer(configurer);
29 String title = getLabel(ProgramMsgConstants.PROGRAM_MENU_SECTIONS_PROGRAMINFORMATION);
30 if (!isSpecial){
31 this.rootSection = new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW,
32 title, ProgramConstants.PROGRAM_MODEL_ID);
33 } else {
34 this.rootSection = new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW,
35 title, ProgramConstants.PROGRAM_MODEL_ID, new MajorEditableHeader(title, ProgramSections.PROGRAM_DETAILS_EDIT));
36 }
37 rootSection.addStyleName("programInformationView");
38 }
39
40 @Override
41 protected void buildLayout() {
42 HorizontalSection section = new HorizontalSection();
43 section.addSection(createIdentifyingDetailsSection());
44 section.addSection(createProgramTitleSection());
45 section.nextRow();
46 section.addSection(createDatesSection());
47 section.addSection(createOtherInformationSection());
48 rootSection.addSection(section);
49 }
50
51 private TableSection createIdentifyingDetailsSection() {
52 TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_IDENTIFYINGDETAILS)));
53 configurer.addReadOnlyField(section, ProgramConstants.CODE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CODE));
54 configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_RUNTIME_PROGRAM_LEVEL, generateMessageInfo(
55 ProgramMsgConstants.PROGRAMINFORMATION_LEVEL));
56 configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_TYPE_NAME, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CREDENTIALPROGRAM));
57 configurer.addReadOnlyField(section, ProgramConstants.PROGRAM_CLASSIFICATION, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CLASSIFICATION));
58 configurer.addReadOnlyField(section, ProgramConstants.DEGREE_TYPE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_DEGREETYPE));
59 return section;
60 }
61
62 private TableSection createProgramTitleSection() {
63 TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_PROGRAMTITLE)));
64 configurer.addReadOnlyField(section, ProgramConstants.LONG_TITLE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLEFULL));
65 configurer.addReadOnlyField(section, ProgramConstants.SHORT_TITLE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLESHORT));
66 configurer.addReadOnlyField(section, ProgramConstants.TRANSCRIPT, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLETRANSCRIPT));
67 configurer.addReadOnlyField(section, ProgramConstants.DIPLOMA, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_TITLEDIPLOMA));
68 return section;
69 }
70
71 private TableSection createDatesSection() {
72 TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_DATES)));
73 configurer.addReadOnlyField(section, ProgramConstants.START_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_STARTTERM));
74 configurer.addReadOnlyField(section, ProgramConstants.END_INSTITUTIONAL_ADMIT_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ADMITTERM));
75 configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENTRY_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ENTRYTERM));
76 configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENROLL_TERM, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_ENROLLTERM));
77 configurer.addReadOnlyField(section, ProgramConstants.PROGRAM_APPROVAL_DATE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_APPROVALDATE));
78 return section;
79 }
80
81 private TableSection createOtherInformationSection() {
82 TableSection section = new TableSection(SectionTitle.generateH4Title(getLabel(ProgramMsgConstants.PROGRAMINFORMATION_OTHERINFORMATION)));
83 configurer.addReadOnlyField(section, ProgramConstants.LOCATION, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_LOCATION));
84 configurer.addReadOnlyField(section, ProgramConstants.CIP_2000, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CIP2000));
85 configurer.addReadOnlyField(section, ProgramConstants.CIP_2010, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_CIP2010));
86 configurer.addReadOnlyField(section, ProgramConstants.HEGIS_CODE, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_HEGIS));
87 configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_INSTITUTION_ID, generateMessageInfo(ProgramMsgConstants.PROGRAMINFORMATION_INSTITUTION));
88 return section;
89 }
90
91 }