Coverage Report - org.kuali.student.lum.lu.ui.course.client.configuration.ViewCourseConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
ViewCourseConfigurer
0%
0/25
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  
     private CourseSummaryConfigurer summaryConfigurer;
 91  
 
 92  0
     public static enum ViewCourseSections{BRIEF, DETAILED, CATALOG}
 93  
 
 94  
     public void setModelDefinition(DataModelDefinition modelDefinition){
 95  0
         this.modelDefinition = modelDefinition;
 96  0
     }
 97  
 
 98  
     public void setStatementTypes(List<StatementTypeInfo> stmtTypes) {
 99  0
         this.stmtTypes = stmtTypes;
 100  0
     }
 101  
 
 102  
     public void generateLayout(ViewCourseController layoutController) {
 103  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 104  
 
 105  
         //Summary
 106  0
         this.generateLayout(layoutController, CLU_PROPOSAL_MODEL);
 107  0
         layoutController.addContentWidget(layoutController.getStatusLabel());
 108  0
         Widget dropdown = layoutController.generateActionDropDown();
 109  0
         layoutController.addContentWidget(dropdown);
 110  
         
 111  
         //this.modelDefinition.getMetadata(path)
 112  0
         layoutController.addContentWidget(layoutController.getVersionHistoryWidget());
 113  0
         layoutController.showPrint(true);
 114  0
     }
 115  
     
 116  
     public void generateLayout(TabMenuController layoutController, String modelId) {
 117  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 118  
 
 119  
         //Summary
 120  0
         summaryConfigurer = new CourseSummaryConfigurer(type, state, groupName, modelDefinition, stmtTypes, 
 121  
                         (Controller)layoutController, modelId);
 122  0
         layoutController.addTab(summaryConfigurer.generateCourseBriefSection(), "At a Glance");
 123  0
         layoutController.addTab(summaryConfigurer.generateCourseSummarySection(), "Detailed View");
 124  0
         layoutController.addTab(summaryConfigurer.generateCourseCatalogSection(), "Catalog View");
 125  0
         layoutController.setDefaultView(ViewCourseSections.BRIEF);
 126  
         //layoutController.addContentWidget(layoutController.getStatusLabel());
 127  
         //Widget dropdown = layoutController.generateActionDropDown();
 128  
         //dropdown.addStyleName("KS-Workflow-DropDown");
 129  
         //layoutController.addContentWidget(dropdown);
 130  
 
 131  0
     }
 132  
 
 133  
     public CourseSummaryConfigurer getSummaryConfigurer() {
 134  0
         return summaryConfigurer;
 135  
     }
 136  
 }