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.dto.DtoConstants;
 21  
 import org.kuali.student.common.ui.client.configurable.mvc.layouts.TabMenuController;
 22  
 import org.kuali.student.common.ui.client.mvc.Controller;
 23  
 import org.kuali.student.common.ui.client.mvc.DataModelDefinition;
 24  
 import org.kuali.student.core.statement.dto.StatementTypeInfo;
 25  
 import org.kuali.student.lum.common.client.lu.LUUIConstants;
 26  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.MetaInfoConstants;
 27  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.RichTextInfoConstants;
 28  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.AffiliatedOrgInfoConstants;
 29  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseActivityConstants;
 30  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseConstants;
 31  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseCourseSpecificLOsConstants;
 32  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseDurationConstants;
 33  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseExpenditureInfoConstants;
 34  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseFormatConstants;
 35  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseJointsConstants;
 36  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseLearningResultsConstants;
 37  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseRevenueInfoConstants;
 38  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseVersionsConstants;
 39  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoConstants;
 40  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoFixedRateFeeConstants;
 41  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.LearningObjectiveConstants;
 42  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.SingleUseLoConstants;
 43  
 import org.kuali.student.lum.lu.ui.course.client.controllers.ViewCourseController;
 44  
 
 45  
 import com.google.gwt.user.client.ui.Widget;
 46  
 
 47  
 
 48  
 /**
 49  
  * This is the configuration factory class for viewing a courss.
 50  
  *
 51  
  * @author Kuali Student Team
 52  
  *
 53  
  */
 54  0
 public class ViewCourseConfigurer
 55  
 implements
 56  
 CreditCourseConstants,
 57  
 CreditCourseFormatConstants,
 58  
 CreditCourseActivityConstants,
 59  
 MetaInfoConstants,
 60  
 CreditCourseDurationConstants,
 61  
 FeeInfoConstants,
 62  
 LearningObjectiveConstants,
 63  
 CreditCourseCourseSpecificLOsConstants,
 64  
 SingleUseLoConstants,
 65  
 CreditCourseRevenueInfoConstants,
 66  
 CreditCourseExpenditureInfoConstants,
 67  
 AffiliatedOrgInfoConstants,
 68  
 CreditCourseVersionsConstants,
 69  
 CreditCourseJointsConstants,
 70  
 RichTextInfoConstants,
 71  
 FeeInfoFixedRateFeeConstants,
 72  
 CreditCourseLearningResultsConstants
 73  
 {
 74  
 
 75  
     public static final String COURSE_MODEL = "courseModel";
 76  
 
 77  
     //FIXME: [KSCOR-225] Temp paths waiting for DOL changes
 78  
     private static final String STATEMENTS_PATH = "statements";
 79  
     private static final String ID_TRANSLATION = "id-translation";
 80  
     
 81  
     public static final String CLU_PROPOSAL_MODEL = "cluProposalModel";
 82  
 
 83  
     //FIXME: [KSCOR-225] Initialize type and state from selected cluId
 84  0
     private String type = "Course";
 85  0
     private String state = DtoConstants.STATE_DRAFT;
 86  0
     private String groupName = LUUIConstants.COURSE_GROUP_NAME;
 87  
 
 88  
     private DataModelDefinition modelDefinition;
 89  
     private List<StatementTypeInfo> stmtTypes;
 90  
 
 91  0
     public static enum ViewCourseSections{BRIEF, DETAILED, CATALOG}
 92  
 
 93  
     public void setModelDefinition(DataModelDefinition modelDefinition){
 94  0
         this.modelDefinition = modelDefinition;
 95  0
     }
 96  
 
 97  
     public void setStatementTypes(List<StatementTypeInfo> stmtTypes) {
 98  0
         this.stmtTypes = stmtTypes;
 99  0
     }
 100  
 
 101  
     public void generateLayout(ViewCourseController layoutController) {
 102  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 103  
 
 104  
         //Summary
 105  0
         this.generateLayout(layoutController, CLU_PROPOSAL_MODEL);
 106  0
         layoutController.addContentWidget(layoutController.getStatusLabel());
 107  0
         Widget dropdown = layoutController.generateActionDropDown();
 108  0
         layoutController.addContentWidget(dropdown);
 109  
         
 110  
         //this.modelDefinition.getMetadata(path)
 111  0
         layoutController.addContentWidget(layoutController.getVersionHistoryWidget());
 112  0
         layoutController.showPrint(true);
 113  0
     }
 114  
     
 115  
     public void generateLayout(TabMenuController layoutController, String modelId) {
 116  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 117  
 
 118  
         //Summary
 119  0
         CourseSummaryConfigurer summaryConfigurer = new CourseSummaryConfigurer(type, state, groupName, modelDefinition, stmtTypes, 
 120  
                         (Controller)layoutController, modelId);
 121  0
         layoutController.addTab(summaryConfigurer.generateCourseBriefSection(), "At a Glance");
 122  0
         layoutController.addTab(summaryConfigurer.generateCourseSummarySection(), "Detailed View");
 123  0
         layoutController.addTab(summaryConfigurer.generateCourseCatalogSection(), "Catalog View");
 124  0
         layoutController.setDefaultView(ViewCourseSections.BRIEF);
 125  
         //layoutController.addContentWidget(layoutController.getStatusLabel());
 126  
         //Widget dropdown = layoutController.generateActionDropDown();
 127  
         //dropdown.addStyleName("KS-Workflow-DropDown");
 128  
         //layoutController.addContentWidget(dropdown);
 129  
 
 130  0
     }
 131  
 }