Coverage Report - org.kuali.student.lum.lu.ui.course.client.configuration.ViewCourseConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
ViewCourseConfigurer
0%
0/26
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.core.client.GWT;
 46  
 import com.google.gwt.user.client.ui.Widget;
 47  
 
 48  
 
 49  
 /**
 50  
  * This is the configuration factory class for viewing a courss.
 51  
  *
 52  
  * @author Kuali Student Team
 53  
  *
 54  
  */
 55  0
 public class ViewCourseConfigurer
 56  
 implements
 57  
 CreditCourseConstants,
 58  
 CreditCourseFormatConstants,
 59  
 CreditCourseActivityConstants,
 60  
 MetaInfoConstants,
 61  
 CreditCourseDurationConstants,
 62  
 FeeInfoConstants,
 63  
 LearningObjectiveConstants,
 64  
 CreditCourseCourseSpecificLOsConstants,
 65  
 SingleUseLoConstants,
 66  
 CreditCourseRevenueInfoConstants,
 67  
 CreditCourseExpenditureInfoConstants,
 68  
 AffiliatedOrgInfoConstants,
 69  
 CreditCourseVersionsConstants,
 70  
 CreditCourseJointsConstants,
 71  
 RichTextInfoConstants,
 72  
 FeeInfoFixedRateFeeConstants,
 73  
 CreditCourseLearningResultsConstants
 74  
 {
 75  
 
 76  
     public static final String COURSE_MODEL = "courseModel";
 77  
 
 78  
     //FIXME: [KSCOR-225] Temp paths waiting for DOL changes
 79  
     private static final String STATEMENTS_PATH = "statements";
 80  
     private static final String ID_TRANSLATION = "id-translation";
 81  
     
 82  
     public static final String CLU_PROPOSAL_MODEL = "courseProposalModel";
 83  
 
 84  
     //FIXME: [KSCOR-225] Initialize type and state from selected cluId
 85  0
     private String type = "Course";
 86  0
     private String state = DtoConstants.STATE_DRAFT;
 87  0
     private String groupName = LUUIConstants.COURSE_GROUP_NAME;
 88  
 
 89  
     private DataModelDefinition modelDefinition;
 90  
     private List<StatementTypeInfo> stmtTypes;
 91  
     private CourseSummaryConfigurer summaryConfigurer;
 92  
 
 93  0
     public static enum ViewCourseSections{BRIEF, DETAILED, CATALOG}
 94  
 
 95  
     public void setModelDefinition(DataModelDefinition modelDefinition){
 96  0
         this.modelDefinition = modelDefinition;
 97  0
     }
 98  
 
 99  
     public void setStatementTypes(List<StatementTypeInfo> stmtTypes) {
 100  0
         this.stmtTypes = stmtTypes;
 101  0
     }
 102  
 
 103  
     public void generateLayout(ViewCourseController layoutController) {
 104  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 105  
 
 106  
         //Summary
 107  0
         this.generateLayout(layoutController, CLU_PROPOSAL_MODEL);
 108  0
         layoutController.addContentWidget(layoutController.getStatusLabel());
 109  0
         Widget dropdown = layoutController.generateActionDropDown();
 110  0
         layoutController.addContentWidget(dropdown);
 111  
         
 112  
         //this.modelDefinition.getMetadata(path)
 113  0
         layoutController.addContentWidget(layoutController.getVersionHistoryWidget());
 114  0
         layoutController.showPrint(true);
 115  0
     }
 116  
     
 117  
     public void generateLayout(TabMenuController layoutController, String modelId) {
 118  0
         groupName = LUUIConstants.COURSE_GROUP_NAME;
 119  
 
 120  
         //Summary
 121  0
         summaryConfigurer = GWT.create(CourseSummaryConfigurer.class);
 122  0
         summaryConfigurer.init(type, state, groupName, modelDefinition, stmtTypes, 
 123  
                         (Controller)layoutController, modelId);
 124  0
         layoutController.addTab(summaryConfigurer.generateCourseBriefSection(), "At a Glance");
 125  0
         layoutController.addTab(summaryConfigurer.generateCourseSummarySection(), "Detailed View");
 126  0
         layoutController.addTab(summaryConfigurer.generateCourseCatalogSection(), "Catalog View");
 127  0
         layoutController.setDefaultView(ViewCourseSections.BRIEF);
 128  
         //layoutController.addContentWidget(layoutController.getStatusLabel());
 129  
         //Widget dropdown = layoutController.generateActionDropDown();
 130  
         //dropdown.addStyleName("KS-Workflow-DropDown");
 131  
         //layoutController.addContentWidget(dropdown);
 132  
 
 133  0
     }
 134  
 
 135  
     public CourseSummaryConfigurer getSummaryConfigurer() {
 136  0
         return summaryConfigurer;
 137  
     }
 138  
 }