1 | |
package org.kuali.student.lum.program.client.major.view; |
2 | |
|
3 | |
import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptor; |
4 | |
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
5 | |
import org.kuali.student.common.ui.client.configurable.mvc.binding.ListToTextBinding; |
6 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.HorizontalSection; |
7 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.TableSection; |
8 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection; |
9 | |
import org.kuali.student.common.ui.client.configurable.mvc.views.SectionView; |
10 | |
import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView; |
11 | |
import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo; |
12 | |
import org.kuali.student.lum.common.client.configuration.AbstractSectionConfiguration; |
13 | |
import org.kuali.student.lum.program.client.ProgramConstants; |
14 | |
import org.kuali.student.lum.program.client.ProgramSections; |
15 | |
import org.kuali.student.lum.program.client.major.MajorEditableHeader; |
16 | |
import org.kuali.student.lum.program.client.properties.ProgramProperties; |
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
public class MajorInformationViewConfiguration extends AbstractSectionConfiguration { |
22 | |
|
23 | |
public static MajorInformationViewConfiguration create() { |
24 | 0 | MajorInformationViewConfiguration instance = new MajorInformationViewConfiguration(new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW, ProgramProperties.get().program_menu_sections_programInformation(), ProgramConstants.PROGRAM_MODEL_ID)); |
25 | 0 | return instance; |
26 | |
} |
27 | |
|
28 | |
public static MajorInformationViewConfiguration createSpecial() { |
29 | 0 | MajorInformationViewConfiguration instance = new MajorInformationViewConfiguration(new VerticalSectionView(ProgramSections.PROGRAM_DETAILS_VIEW, ProgramProperties.get().program_menu_sections_programInformation(), ProgramConstants.PROGRAM_MODEL_ID, new MajorEditableHeader(ProgramProperties.get().program_menu_sections_programInformation(), ProgramSections.PROGRAM_DETAILS_EDIT))); |
30 | 0 | return instance; |
31 | |
} |
32 | |
|
33 | 0 | private MajorInformationViewConfiguration(SectionView sectionView) { |
34 | 0 | rootSection = sectionView; |
35 | 0 | rootSection.addStyleName("programInformationView"); |
36 | 0 | } |
37 | |
|
38 | |
@Override |
39 | |
protected void buildLayout() { |
40 | 0 | HorizontalSection section = new HorizontalSection(); |
41 | 0 | section.addSection(createIdentifyingDetailsSection()); |
42 | 0 | section.addSection(createProgramTitleSection()); |
43 | 0 | section.nextRow(); |
44 | 0 | section.addSection(createDatesSection()); |
45 | 0 | section.addSection(createOtherInformationSection()); |
46 | 0 | rootSection.addSection(section); |
47 | 0 | } |
48 | |
|
49 | |
private TableSection createIdentifyingDetailsSection() { |
50 | 0 | TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_identifyingDetails())); |
51 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CODE, new MessageKeyInfo(ProgramProperties.get().programInformation_code())); |
52 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_LEVEL, new MessageKeyInfo(ProgramProperties.get().programInformation_level())); |
53 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_TYPE_NAME, new MessageKeyInfo(ProgramProperties.get().programInformation_credentialProgram())); |
54 | 0 | configurer.addReadOnlyField(section, ProgramConstants.PROGRAM_CLASSIFICATION, new MessageKeyInfo(ProgramProperties.get().programInformation_classification())); |
55 | 0 | configurer.addReadOnlyField(section, ProgramConstants.DEGREE_TYPE, new MessageKeyInfo(ProgramProperties.get().programInformation_degreeType())); |
56 | 0 | return section; |
57 | |
} |
58 | |
|
59 | |
private TableSection createProgramTitleSection() { |
60 | 0 | TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_programTitle())); |
61 | 0 | configurer.addReadOnlyField(section, ProgramConstants.LONG_TITLE, new MessageKeyInfo(ProgramProperties.get().programInformation_titleFull())); |
62 | 0 | configurer.addReadOnlyField(section, ProgramConstants.SHORT_TITLE, new MessageKeyInfo(ProgramProperties.get().programInformation_titleShort())); |
63 | 0 | configurer.addReadOnlyField(section, ProgramConstants.TRANSCRIPT, new MessageKeyInfo(ProgramProperties.get().programInformation_titleTranscript())); |
64 | 0 | configurer.addReadOnlyField(section, ProgramConstants.DIPLOMA, new MessageKeyInfo(ProgramProperties.get().programInformation_titleDiploma())); |
65 | 0 | return section; |
66 | |
} |
67 | |
|
68 | |
private TableSection createDatesSection() { |
69 | 0 | TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_dates())); |
70 | 0 | configurer.addReadOnlyField(section, ProgramConstants.START_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_startTerm())); |
71 | 0 | configurer.addReadOnlyField(section, ProgramConstants.END_INSTITUTIONAL_ADMIT_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_admitTerm())); |
72 | 0 | configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENTRY_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_entryTerm())); |
73 | 0 | configurer.addReadOnlyField(section, ProgramConstants.END_PROGRAM_ENROLL_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_enrollTerm())); |
74 | 0 | configurer.addReadOnlyField(section, ProgramConstants.PROGRAM_APPROVAL_DATE, new MessageKeyInfo(ProgramProperties.get().programInformation_approvalDate())); |
75 | 0 | return section; |
76 | |
} |
77 | |
|
78 | |
private TableSection createOtherInformationSection() { |
79 | 0 | TableSection section = new TableSection(SectionTitle.generateH4Title(ProgramProperties.get().programInformation_otherInformation())); |
80 | 0 | configurer.addReadOnlyField(section, ProgramConstants.LOCATION, new MessageKeyInfo(ProgramProperties.get().programInformation_location())); |
81 | 0 | FieldDescriptor fd = configurer.addReadOnlyField(section, ProgramConstants.ACCREDITING_AGENCY, new MessageKeyInfo(ProgramProperties.get().programInformation_accreditation())); |
82 | 0 | fd.setWidgetBinding(new ListToTextBinding(ProgramConstants.ACCREDITING_AGENCY_ORG_ID_TRANSLATION)); |
83 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CIP_2000, new MessageKeyInfo(ProgramProperties.get().programInformation_cip2000())); |
84 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CIP_2010, new MessageKeyInfo(ProgramProperties.get().programInformation_cip2010())); |
85 | 0 | configurer.addReadOnlyField(section, ProgramConstants.HEGIS_CODE, new MessageKeyInfo(ProgramProperties.get().programInformation_hegis())); |
86 | 0 | configurer.addReadOnlyField(section, ProgramConstants.CREDENTIAL_PROGRAM_INSTITUTION_ID, new MessageKeyInfo(ProgramProperties.get().programInformation_institution())); |
87 | 0 | return section; |
88 | |
} |
89 | |
|
90 | |
public VerticalSection createActivateProgramSection(){ |
91 | 0 | VerticalSection section = new VerticalSection(SectionTitle.generateH2Title(ProgramProperties.get().programInformation_activateProgram())); |
92 | 0 | section.setInstructions("<br>" + ProgramProperties.get().programInformation_activateInstructions() + "<br><br>"); |
93 | 0 | configurer.addField(section, ProgramConstants.PREV_END_PROGRAM_ENTRY_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_entryTerm())); |
94 | 0 | configurer.addField(section, ProgramConstants.PREV_END_PROGRAM_ENROLL_TERM, new MessageKeyInfo(ProgramProperties.get().programInformation_enrollTerm())); |
95 | 0 | return section; |
96 | |
} |
97 | |
|
98 | |
|
99 | |
} |