Coverage Report - org.kuali.student.lum.lu.ui.course.client.configuration.CourseAdminWithoutVersionConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
CourseAdminWithoutVersionConfigurer
0%
0/50
0%
0/2
1
 
 1  
 package org.kuali.student.lum.lu.ui.course.client.configuration;
 2  
 
 3  
 import org.kuali.student.common.dto.DtoConstants;
 4  
 import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptor;
 5  
 import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle;
 6  
 import org.kuali.student.common.ui.client.configurable.mvc.sections.Section;
 7  
 import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection;
 8  
 import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView;
 9  
 import org.kuali.student.common.ui.client.mvc.View;
 10  
 import org.kuali.student.lum.common.client.lu.LUUIConstants;
 11  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.RichTextInfoConstants;
 12  
 import org.kuali.student.lum.lu.ui.course.client.controllers.CourseAdminWithoutVersionController;
 13  
 import org.kuali.student.lum.lu.ui.course.client.controllers.CourseProposalController;
 14  
 
 15  
 /**
 16  
  * This is the screen configuration and layout for the modify without version admin screens
 17  
  * 
 18  
  * @author Will
 19  
  *
 20  
  */
 21  0
 public class CourseAdminWithoutVersionConfigurer extends CourseProposalConfigurer{
 22  
 
 23  
     /**
 24  
      * Sets up all the views, sections, and views of the CourseAdminController.  This should be called
 25  
      * once for initialization and setup per CourseAdminController instance.
 26  
      * 
 27  
      * @param layout
 28  
      */
 29  
     @Override
 30  
         public void configure(final CourseProposalController layout) {
 31  0
             type = "course";
 32  0
         state = DtoConstants.STATE_APPROVED;
 33  0
         nextState = DtoConstants.STATE_ACTIVE;
 34  
         
 35  0
             groupName = LUUIConstants.COURSE_GROUP_NAME;
 36  
 
 37  0
             layout.addView(generateCourseAdminView((CourseAdminWithoutVersionController)layout));
 38  0
     }
 39  
 
 40  
         /**
 41  
          * Configuration for the course admin screens
 42  
          * 
 43  
          * @return view 
 44  
          */
 45  
     protected View generateCourseAdminView(final CourseAdminWithoutVersionController layout) {
 46  0
         VerticalSectionView view = 
 47  
                 new VerticalSectionView(CourseSections.COURSE_INFO, getLabel(LUUIConstants.INFORMATION_LABEL_KEY), COURSE_PROPOSAL_MODEL, false);
 48  0
         view.addStyleName(LUUIConstants.STYLE_SECTION);
 49  
 
 50  
         // Create course admin sections
 51  0
         Section courseSection = generateCourseInfoSection(initSection(LUUIConstants.INFORMATION_LABEL_KEY)); 
 52  0
         Section governanceSection = generateGovernanceSection(initSection(LUUIConstants.GOVERNANCE_LABEL_KEY));
 53  0
         Section logisticsSection = generateCourseLogisticsSection(initSection(LUUIConstants.LOGISTICS_LABEL_KEY));
 54  0
         Section loSection = initSection(LUUIConstants.LEARNING_OBJECTIVES_LABEL_KEY);
 55  0
         loSection.addSection(generateLearningObjectivesNestedSection());
 56  0
         Section activeDatesSection = generateActiveDatesSection(initSection(LUUIConstants.ACTIVE_DATES_LABEL_KEY));
 57  0
         Section financialSection = generateFinancialsSection(initSection(LUUIConstants.FINANCIALS_LABEL_KEY));
 58  
         
 59  
         //Add course admin sections to view
 60  0
         view.addSection(courseSection);
 61  0
         view.addSection(governanceSection);
 62  0
         view.addSection(logisticsSection);        
 63  0
         view.addSection(loSection);        
 64  0
         view.addSection(activeDatesSection);
 65  0
         view.addSection(financialSection);
 66  
         
 67  
         //Add menu items for sections
 68  0
         String sections = getLabel(LUUIConstants.COURSE_SECTIONS);
 69  0
         layout.addMenu(sections);
 70  0
         layout.addMenuItemSection(sections, getLabel(LUUIConstants.INFORMATION_LABEL_KEY), LUUIConstants.INFORMATION_LABEL_KEY, courseSection);
 71  0
         layout.addMenuItemSection(sections, getLabel(LUUIConstants.GOVERNANCE_LABEL_KEY), LUUIConstants.GOVERNANCE_LABEL_KEY, governanceSection);
 72  0
         layout.addMenuItemSection(sections, getLabel(LUUIConstants.LOGISTICS_LABEL_KEY), LUUIConstants.LOGISTICS_LABEL_KEY, logisticsSection);
 73  0
         layout.addMenuItemSection(sections, getLabel(LUUIConstants.LEARNING_OBJECTIVE_LABEL_KEY), LUUIConstants.LEARNING_OBJECTIVE_LABEL_KEY, loSection);
 74  0
         layout.addMenuItemSection(sections, getLabel(LUUIConstants.ACTIVE_DATES_LABEL_KEY), LUUIConstants.ACTIVE_DATES_LABEL_KEY, activeDatesSection);
 75  0
         layout.addMenuItemSection(sections, getLabel(LUUIConstants.FINANCIALS_LABEL_KEY), LUUIConstants.FINANCIALS_LABEL_KEY, financialSection);
 76  
         
 77  
         //Add buttons to top and bottom of view
 78  0
         layout.addButtonForView(CourseSections.COURSE_INFO, layout.getSaveButton());
 79  0
         layout.addButtonForView(CourseSections.COURSE_INFO, layout.getActivateButton());
 80  0
         layout.addButtonForView(CourseSections.COURSE_INFO, layout.getCancelButton());
 81  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getSaveButton());        
 82  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getActivateButton());
 83  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getCancelButton());    
 84  
 
 85  0
         return view;
 86  
         }
 87  
     
 88  
     protected Section initSection(String labelKey){
 89  0
             return initSection(SectionTitle.generateH2Title(getLabel(labelKey)), NO_DIVIDER);            
 90  
     }
 91  
 
 92  
     /**
 93  
      * Override {@link CourseProposalConfigurer#generateCourseInfoSection(Section)} to remove configuration
 94  
      * of proposal fields.
 95  
      *  
 96  
      */
 97  
     @Override
 98  
     public Section generateCourseInfoSection(Section section) {
 99  0
         addField(section, COURSE + "/" + COURSE_TITLE, generateMessageInfo(LUUIConstants.COURSE_TITLE_LABEL_KEY));
 100  0
         addField(section, COURSE + "/" + TRANSCRIPT_TITLE, generateMessageInfo(LUUIConstants.SHORT_TITLE_LABEL_KEY));
 101  0
         section.addSection(generateCourseNumberSection());
 102  0
             FieldDescriptor instructorsFd = addField(section, COURSE + "/" + INSTRUCTORS, generateMessageInfo(LUUIConstants.INSTRUCTORS_LABEL_KEY));
 103  0
         instructorsFd.setWidgetBinding(new KeyListModelWigetBinding("personId"));
 104  
 
 105  0
         section.addSection(generateDescriptionRationaleSection());
 106  
         
 107  0
         return section;
 108  
     }
 109  
     
 110  
     /**
 111  
      * Override  {@link CourseProposalConfigurer#generateDescriptionRationaleSection()} to remove configuration of
 112  
      * proposal fields.
 113  
      * 
 114  
      */
 115  
     @Override
 116  
     protected VerticalSection generateDescriptionRationaleSection() {
 117  0
         SectionTitle title = getH4Title(LUUIConstants.PROPOSAL_TITLE_SECTION_LABEL_KEY);
 118  0
         VerticalSection description = initSection(title, !WITH_DIVIDER);
 119  0
         title.setStyleName("cluProposalTitleSection");
 120  0
         addField(description, COURSE + "/" + DESCRIPTION + "/" + RichTextInfoConstants.PLAIN, generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY));
 121  0
         return description;
 122  
     }
 123  
     
 124  
 
 125  
 }