Coverage Report - org.kuali.student.lum.lu.ui.course.client.configuration.ViewCourseConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
ViewCourseConfigurer
0%
0/24
N/A
1
ViewCourseConfigurer$ViewCourseSections
0%
0/1
N/A
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 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.common.ui.client.configurable.mvc.layouts.TabMenuController;
 21  
 import org.kuali.student.common.ui.client.mvc.Controller;
 22  
 import org.kuali.student.common.ui.client.mvc.DataModelDefinition;
 23  
 import org.kuali.student.core.statement.dto.StatementTypeInfo;
 24  
 import org.kuali.student.lum.common.client.lu.LUUIConstants;
 25  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.MetaInfoConstants;
 26  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.RichTextInfoConstants;
 27  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.AffiliatedOrgInfoConstants;
 28  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseActivityConstants;
 29  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseConstants;
 30  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseCourseSpecificLOsConstants;
 31  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseDurationConstants;
 32  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseExpenditureInfoConstants;
 33  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseFormatConstants;
 34  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseJointsConstants;
 35  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseLearningResultsConstants;
 36  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseRevenueInfoConstants;
 37  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseVersionsConstants;
 38  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoConstants;
 39  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoFixedRateFeeConstants;
 40  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.LearningObjectiveConstants;
 41  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.SingleUseLoConstants;
 42  
 import org.kuali.student.lum.lu.ui.course.client.controllers.ViewCourseController;
 43  
 
 44  
 import com.google.gwt.user.client.ui.Widget;
 45  
 
 46  
 
 47  
 /**
 48  
  * This is the configuration factory class for viewing a courss.
 49  
  *
 50  
  * @author Kuali Student Team
 51  
  *
 52  
  */
 53  0
 public class ViewCourseConfigurer
 54  
 implements
 55  
 CreditCourseConstants,
 56  
 CreditCourseFormatConstants,
 57  
 CreditCourseActivityConstants,
 58  
 MetaInfoConstants,
 59  
 CreditCourseDurationConstants,
 60  
 FeeInfoConstants,
 61  
 LearningObjectiveConstants,
 62  
 CreditCourseCourseSpecificLOsConstants,
 63  
 SingleUseLoConstants,
 64  
 CreditCourseRevenueInfoConstants,
 65  
 CreditCourseExpenditureInfoConstants,
 66  
 AffiliatedOrgInfoConstants,
 67  
 CreditCourseVersionsConstants,
 68  
 CreditCourseJointsConstants,
 69  
 RichTextInfoConstants,
 70  
 FeeInfoFixedRateFeeConstants,
 71  
 CreditCourseLearningResultsConstants
 72  
 {
 73  
 
 74  
     public static final String COURSE_MODEL = "courseModel";
 75  
 
 76  
     //FIXME: [KSCOR-225] Temp paths waiting for DOL changes
 77  
     private static final String STATEMENTS_PATH = "statements";
 78  
     private static final String ID_TRANSLATION = "id-translation";
 79  
     
 80  
     public static final String CLU_PROPOSAL_MODEL = "cluProposalModel";
 81  
 
 82  
     //FIXME: [KSCOR-225] Initialize type and state from selected cluId
 83  0
     private String type = "Course";
 84  0
     private String state = "draft";
 85  0
     private String groupName = LUUIConstants.COURSE_GROUP_NAME;
 86  
 
 87  
     private DataModelDefinition modelDefinition;
 88  
     private List<StatementTypeInfo> stmtTypes;
 89  
 
 90  0
     public static enum ViewCourseSections{BRIEF, DETAILED, CATALOG}
 91  
 
 92  
     public void setModelDefinition(DataModelDefinition modelDefinition){
 93  0
         this.modelDefinition = modelDefinition;
 94  0
     }
 95  
 
 96  
     public void setStatementTypes(List<StatementTypeInfo> stmtTypes) {
 97  0
         this.stmtTypes = stmtTypes;
 98  0
     }
 99  
 
 100  
     public void generateLayout(ViewCourseController layoutController) {
 101  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 102  
 
 103  
         //Summary
 104  0
         this.generateLayout(layoutController, CLU_PROPOSAL_MODEL);
 105  0
         layoutController.addContentWidget(layoutController.getStatusLabel());
 106  0
         Widget dropdown = layoutController.generateActionDropDown();
 107  0
         layoutController.addContentWidget(dropdown);
 108  
         
 109  
         //this.modelDefinition.getMetadata(path)
 110  0
         layoutController.addContentWidget(layoutController.getVersionHistoryWidget());
 111  0
         layoutController.showPrint(true);
 112  0
     }
 113  
     
 114  
     public void generateLayout(TabMenuController layoutController, String modelId) {
 115  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 116  
 
 117  
         //Summary
 118  0
         CourseSummaryConfigurer summaryConfigurer = new CourseSummaryConfigurer(type, state, groupName, modelDefinition, stmtTypes, 
 119  
                         (Controller)layoutController, modelId);
 120  0
         layoutController.addTab(summaryConfigurer.generateCourseBriefSection(), "At a Glance");
 121  0
         layoutController.addTab(summaryConfigurer.generateCourseSummarySection(), "Detailed View");
 122  0
         layoutController.addTab(summaryConfigurer.generateCourseCatalogSection(), "Catalog View");
 123  0
         layoutController.setDefaultView(ViewCourseSections.BRIEF);
 124  
         //layoutController.addContentWidget(layoutController.getStatusLabel());
 125  
         //Widget dropdown = layoutController.generateActionDropDown();
 126  
         //dropdown.addStyleName("KS-Workflow-DropDown");
 127  
         //layoutController.addContentWidget(dropdown);
 128  
 
 129  0
     }
 130  
 }