Coverage Report - org.kuali.student.lum.lu.ui.course.client.configuration.CourseAdminConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
CourseAdminConfigurer
0%
0/42
0%
0/2
1.333
 
 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.SectionTitle;
 5  
 import org.kuali.student.common.ui.client.configurable.mvc.sections.Section;
 6  
 import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView;
 7  
 import org.kuali.student.common.ui.client.mvc.View;
 8  
 import org.kuali.student.lum.common.client.lu.LUUIConstants;
 9  
 import org.kuali.student.lum.lu.ui.course.client.controllers.CourseAdminController;
 10  
 import org.kuali.student.lum.lu.ui.course.client.controllers.CourseProposalController;
 11  
 
 12  
 /**
 13  
  * This is the screen configuration and layout for the create/modify admin screens
 14  
  * 
 15  
  * @author Will
 16  
  *
 17  
  */
 18  0
 public class CourseAdminConfigurer extends CourseProposalConfigurer{
 19  
 
 20  
     /**
 21  
      * Sets up all the views, sections, and views of the CourseAdminController.  This should be called
 22  
      * once for initialization and setup per CourseAdminController instance.
 23  
      * 
 24  
      * @param layout
 25  
      */
 26  
     public void configure(final CourseProposalController layout) {
 27  0
             type = "course";
 28  0
         state = DtoConstants.STATE_DRAFT;
 29  0
         nextState = DtoConstants.STATE_APPROVED;
 30  
         
 31  0
             groupName = LUUIConstants.COURSE_GROUP_NAME;
 32  
 
 33  0
             if (modelDefinition.getMetadata().isCanEdit()) {
 34  0
             layout.addView(generateCourseAdminView((CourseAdminController)layout));
 35  
             }
 36  0
     }
 37  
 
 38  
         /**
 39  
          * Configuration for the course admin screens
 40  
          * 
 41  
          * @return view 
 42  
          */
 43  
     protected View generateCourseAdminView(final CourseAdminController layout) {
 44  0
         VerticalSectionView view = 
 45  
                 new VerticalSectionView(CourseSections.COURSE_INFO, getLabel(LUUIConstants.INFORMATION_LABEL_KEY), COURSE_PROPOSAL_MODEL, false);
 46  0
         view.addStyleName(LUUIConstants.STYLE_SECTION);
 47  
 
 48  
         // Create course admin sections
 49  0
         Section courseSection = generateCourseInfoSection(initSection(LUUIConstants.INFORMATION_LABEL_KEY)); 
 50  0
         Section governanceSection = generateGovernanceSection(initSection(LUUIConstants.GOVERNANCE_LABEL_KEY));
 51  0
         Section logisticsSection = generateCourseLogisticsSection(initSection(LUUIConstants.LOGISTICS_LABEL_KEY));
 52  0
         Section loSection = initSection(LUUIConstants.LEARNING_OBJECTIVES_LABEL_KEY);
 53  0
         loSection.addSection(generateLearningObjectivesNestedSection());
 54  0
         Section activeDatesSection = generateActiveDatesSection(initSection(LUUIConstants.ACTIVE_DATES_LABEL_KEY));
 55  0
         Section financialSection = generateFinancialsSection(initSection(LUUIConstants.FINANCIALS_LABEL_KEY));
 56  
         
 57  
         
 58  
         //Add course admin sections to view
 59  0
         view.addSection(courseSection);
 60  0
         view.addSection(governanceSection);
 61  0
         view.addSection(logisticsSection);
 62  0
         view.addView(generateCourseRequisitesSection(layout,false));//Test if requisites are added correctly
 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.getApproveAndActivateButton());
 79  0
         layout.addButtonForView(CourseSections.COURSE_INFO, layout.getApproveButton());
 80  0
         layout.addButtonForView(CourseSections.COURSE_INFO, layout.getSaveButton());
 81  0
         layout.addButtonForView(CourseSections.COURSE_INFO, layout.getCancelButton());
 82  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getApproveAndActivateButton());
 83  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getApproveButton());
 84  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getSaveButton());        
 85  0
         layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getCancelButton());    
 86  
 
 87  0
         return view;
 88  
         }
 89  
     
 90  
     protected Section initSection(String labelKey){
 91  0
             return initSection(SectionTitle.generateH2Title(getLabel(labelKey)), NO_DIVIDER);            
 92  
     }
 93  
 }