Coverage Report - org.kuali.student.lum.lu.ui.course.client.configuration.CourseSummaryConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
CourseSummaryConfigurer
0%
0/280
0%
0/34
2.212
CourseSummaryConfigurer$1
0%
0/6
0%
0/4
2.212
CourseSummaryConfigurer$2
0%
0/35
0%
0/6
2.212
CourseSummaryConfigurer$2$1
0%
0/6
0%
0/2
2.212
CourseSummaryConfigurer$2$1$1
0%
0/6
N/A
2.212
CourseSummaryConfigurer$2$2
0%
0/13
0%
0/6
2.212
CourseSummaryConfigurer$3
0%
0/16
0%
0/22
2.212
CourseSummaryConfigurer$4
0%
0/17
0%
0/10
2.212
CourseSummaryConfigurer$4$1
0%
0/6
0%
0/2
2.212
CourseSummaryConfigurer$5
0%
0/13
0%
0/6
2.212
CourseSummaryConfigurer$6
0%
0/16
0%
0/22
2.212
CourseSummaryConfigurer$7
0%
0/29
0%
0/10
2.212
CourseSummaryConfigurer$EditHandler
0%
0/5
N/A
2.212
 
 1  
 package org.kuali.student.lum.lu.ui.course.client.configuration;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.Arrays;
 5  
 import java.util.HashMap;
 6  
 import java.util.Iterator;
 7  
 import java.util.List;
 8  
 import java.util.Map;
 9  
 
 10  
 import org.kuali.student.common.assembly.data.Data;
 11  
 import org.kuali.student.common.assembly.data.Data.Property;
 12  
 import org.kuali.student.common.assembly.data.Metadata;
 13  
 import org.kuali.student.common.assembly.data.QueryPath;
 14  
 import org.kuali.student.common.ui.client.configurable.mvc.Configurer;
 15  
 import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptorReadOnly;
 16  
 import org.kuali.student.common.ui.client.configurable.mvc.binding.ListToTextBinding;
 17  
 import org.kuali.student.common.ui.client.configurable.mvc.binding.ModelWidgetBinding;
 18  
 import org.kuali.student.common.ui.client.configurable.mvc.layouts.MenuSectionController;
 19  
 import org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityConfiguration;
 20  
 import org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityFieldConfiguration;
 21  
 import org.kuali.student.common.ui.client.configurable.mvc.sections.WarnContainer;
 22  
 import org.kuali.student.common.ui.client.configurable.mvc.views.VerticalSectionView;
 23  
 import org.kuali.student.common.ui.client.mvc.Callback;
 24  
 import org.kuali.student.common.ui.client.mvc.Controller;
 25  
 import org.kuali.student.common.ui.client.mvc.DataModel;
 26  
 import org.kuali.student.common.ui.client.mvc.DataModelDefinition;
 27  
 import org.kuali.student.common.ui.client.widgets.KSLabel;
 28  
 import org.kuali.student.common.ui.client.widgets.field.layout.element.MessageKeyInfo;
 29  
 import org.kuali.student.common.ui.client.widgets.menus.KSListPanel;
 30  
 import org.kuali.student.common.ui.client.widgets.table.summary.ShowRowConditionCallback;
 31  
 import org.kuali.student.common.ui.client.widgets.table.summary.SummaryTableFieldBlock;
 32  
 import org.kuali.student.common.ui.client.widgets.table.summary.SummaryTableFieldRow;
 33  
 import org.kuali.student.common.ui.client.widgets.table.summary.SummaryTableSection;
 34  
 import org.kuali.student.common.validation.dto.ValidationResultInfo;
 35  
 import org.kuali.student.common.validation.dto.ValidationResultInfo.ErrorLevel;
 36  
 import org.kuali.student.core.document.ui.client.widgets.documenttool.DocumentList;
 37  
 import org.kuali.student.core.document.ui.client.widgets.documenttool.DocumentListBinding;
 38  
 import org.kuali.student.core.statement.dto.StatementTreeViewInfo;
 39  
 import org.kuali.student.core.statement.dto.StatementTypeInfo;
 40  
 import org.kuali.student.core.statement.ui.client.widgets.rules.SubrulePreviewWidget;
 41  
 import org.kuali.student.core.workflow.ui.client.widgets.WorkflowEnhancedNavController;
 42  
 import org.kuali.student.lum.common.client.lo.TreeStringBinding;
 43  
 import org.kuali.student.lum.common.client.lu.LUUIConstants;
 44  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.AcademicSubjectOrgInfoConstants;
 45  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.MetaInfoConstants;
 46  
 import org.kuali.student.lum.lu.assembly.data.client.constants.base.RichTextInfoConstants;
 47  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.AffiliatedOrgInfoConstants;
 48  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseActivityConstants;
 49  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseConstants;
 50  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseDurationConstants;
 51  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseExpenditureInfoConstants;
 52  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseFormatConstants;
 53  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseJointsConstants;
 54  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseProposalConstants;
 55  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseProposalInfoConstants;
 56  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.CreditCourseRevenueInfoConstants;
 57  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.FeeInfoConstants;
 58  
 import org.kuali.student.lum.lu.assembly.data.client.constants.orch.LearningObjectiveConstants;
 59  
 import org.kuali.student.lum.lu.ui.course.client.configuration.CourseProposalConfigurer.CourseSections;
 60  
 import org.kuali.student.lum.lu.ui.course.client.configuration.CourseProposalConfigurer.KeyListModelWigetBinding;
 61  
 import org.kuali.student.lum.lu.ui.course.client.configuration.ViewCourseConfigurer.ViewCourseSections;
 62  
 import org.kuali.student.lum.lu.ui.course.client.controllers.CourseProposalController;
 63  
 import org.kuali.student.lum.lu.ui.course.client.controllers.VersionsController;
 64  
 import org.kuali.student.lum.lu.ui.course.client.requirements.CourseRequirementsSummaryView;
 65  
 import org.kuali.student.lum.lu.ui.course.client.requirements.HasRequirements;
 66  
 
 67  
 import com.google.gwt.core.client.GWT;
 68  
 import com.google.gwt.event.dom.client.ClickEvent;
 69  
 import com.google.gwt.event.dom.client.ClickHandler;
 70  
 import com.google.gwt.user.client.ui.Anchor;
 71  
 import com.google.gwt.user.client.ui.FlowPanel;
 72  
 import com.google.gwt.user.client.ui.HTML;
 73  
 import com.google.gwt.user.client.ui.Widget;
 74  
 
 75  0
 public class CourseSummaryConfigurer extends Configurer implements
 76  
         CreditCourseProposalConstants, CreditCourseProposalInfoConstants,
 77  
         CreditCourseConstants, CreditCourseFormatConstants,
 78  
         CreditCourseActivityConstants, MetaInfoConstants,
 79  
         CreditCourseDurationConstants, FeeInfoConstants,
 80  
         LearningObjectiveConstants, AcademicSubjectOrgInfoConstants,
 81  
         AffiliatedOrgInfoConstants, CreditCourseRevenueInfoConstants,
 82  
         CreditCourseExpenditureInfoConstants {
 83  
     // Override paths for course and proposal so they are root
 84  
     public static final String PROPOSAL = "";
 85  
     public static final String COURSE = "";
 86  
     public static final String PROPOSAL_TITLE_PATH = "proposal/name";
 87  
 
 88  
     protected static final String OPTIONAL = "o";
 89  
 
 90  0
     private List<ValidationResultInfo> validationInfos = new ArrayList<ValidationResultInfo>();
 91  0
     private boolean showingValidation = false;
 92  
 
 93  
     protected List<StatementTypeInfo> stmtTypes;
 94  
 
 95  
     protected Controller controller;
 96  
     protected SummaryTableSection tableSection; // review proposal data display
 97  
     protected String modelId;
 98  
 
 99  0
     private List<Anchor> validateLinks = new ArrayList<Anchor>(); //KSLAB-1985
 100  
 
 101  
     protected class EditHandler implements ClickHandler {
 102  
 
 103  
         Enum<?> view;
 104  
 
 105  0
         public EditHandler(Enum<?> view) {
 106  0
             this.view = view;
 107  0
         }
 108  
 
 109  
         @Override
 110  
         public void onClick(ClickEvent event) {
 111  0
             controller.showView(view);
 112  0
         }
 113  
     }
 114  
     
 115  0
     public CourseSummaryConfigurer(){
 116  
         
 117  0
     }
 118  
 
 119  
     public CourseSummaryConfigurer(String type, String state, String groupName,
 120  
             DataModelDefinition modelDefinition,
 121  
             List<StatementTypeInfo> stmtTypes, Controller controller,
 122  0
             String modelId) {
 123  0
         this.type = type;
 124  0
         this.state = state;
 125  0
         this.groupName = groupName;
 126  0
         this.modelDefinition = modelDefinition;
 127  0
         this.stmtTypes = stmtTypes;
 128  0
         this.controller = controller;
 129  0
         this.modelId = modelId;
 130  0
         tableSection = new SummaryTableSection((Controller) controller);
 131  0
     }
 132  
     
 133  
     public void init(String type, String state, String groupName,
 134  
             DataModelDefinition modelDefinition,
 135  
             List<StatementTypeInfo> stmtTypes, Controller controller,
 136  
             String modelId) {
 137  0
         this.type = type;
 138  0
         this.state = state;
 139  0
         this.groupName = groupName;
 140  0
         this.modelDefinition = modelDefinition;
 141  0
         this.stmtTypes = stmtTypes;
 142  0
         this.controller = controller;
 143  0
         this.modelId = modelId;
 144  0
         tableSection = new SummaryTableSection((Controller) controller);
 145  0
     }
 146  
 
 147  
     protected VerticalSectionView initSectionView(Enum<?> viewEnum,
 148  
             String labelKey) {
 149  0
         VerticalSectionView section = new VerticalSectionView(viewEnum,
 150  
                 getLabel(labelKey), modelId);
 151  0
         section.addStyleName(LUUIConstants.STYLE_SECTION);
 152  0
         return section;
 153  
     }
 154  
 
 155  
     protected SummaryTableFieldRow getFieldRow(String fieldKey,
 156  
             MessageKeyInfo messageKey) {
 157  0
         return getFieldRow(fieldKey, messageKey, null, null, null, null, false);
 158  
     }
 159  
 
 160  
     protected SummaryTableFieldRow getFieldRow(String fieldKey,
 161  
             MessageKeyInfo messageKey, boolean optional) {
 162  0
         return getFieldRow(fieldKey, messageKey, null, null, null, null,
 163  
                 optional);
 164  
     }
 165  
 
 166  
     protected SummaryTableFieldRow getFieldRow(String fieldKey,
 167  
             MessageKeyInfo messageKey, Widget widget, Widget widget2,
 168  
             String parentPath, ModelWidgetBinding<?> binding, boolean optional) {
 169  0
         QueryPath path = QueryPath.concat(parentPath, fieldKey);
 170  0
         Metadata meta = modelDefinition.getMetadata(path);
 171  
 
 172  0
         FieldDescriptorReadOnly fd = new FieldDescriptorReadOnly(
 173  
                 path.toString(), messageKey, meta);
 174  0
         if (widget != null) {
 175  0
             fd.setFieldWidget(widget);
 176  
         }
 177  0
         if (binding != null) {
 178  0
             fd.setWidgetBinding(binding);
 179  
         }
 180  0
         fd.setOptional(optional);
 181  
 
 182  0
         FieldDescriptorReadOnly fd2 = new FieldDescriptorReadOnly(
 183  
                 path.toString(), messageKey, meta);
 184  0
         if (widget2 != null) {
 185  0
             fd2.setFieldWidget(widget2);
 186  
         }
 187  0
         if (binding != null) {
 188  0
             fd2.setWidgetBinding(binding);
 189  
         }
 190  0
         fd2.setOptional(optional);
 191  
 
 192  0
         SummaryTableFieldRow fieldRow = new SummaryTableFieldRow(fd, fd2);
 193  
 
 194  0
         return fieldRow;
 195  
     }
 196  
 
 197  
     public VerticalSectionView generateProposalSummarySection(boolean canEditSections) {
 198  0
         tableSection.setEditable(canEditSections);
 199  0
         tableSection.addSummaryTableFieldBlock(generateCourseInformationForProposal());
 200  0
         tableSection.addSummaryTableFieldBlock(generateCourseInformationForProposalCrossListed());
 201  0
         tableSection.addSummaryTableFieldBlock(generateGovernanceSection());
 202  0
         tableSection.addSummaryTableFieldBlock(generateCourseLogisticsSection());
 203  0
         tableSection.addSummaryTableFieldBlock(generateLearningObjectivesSection());
 204  0
         tableSection.addSummaryTableFieldBlock(generateRequirementsSection());
 205  0
         tableSection.addSummaryTableFieldBlock(generateActiveDatesSection());
 206  0
         tableSection.addSummaryTableFieldBlock(generateFeesSection());
 207  0
         tableSection.addSummaryTableFieldBlock(generateProposalDocumentsSection());
 208  
 
 209  0
         if (   controller instanceof WorkflowEnhancedNavController
 210  
             && ((WorkflowEnhancedNavController) controller).getWfUtilities() != null) {
 211  
             final WarnContainer infoContainer1; // Header widget (with warnings if necessary)
 212  
             final WarnContainer infoContainer2; // Footer widget (with warnings if necessary)
 213  
             //WarnContainers initialized with buttons common to all states (error or otherwise)
 214  0
             Widget topWorkflowActionWidget= ((WorkflowEnhancedNavController) controller).getWfUtilities().getWorkflowActionsWidget();
 215  0
             Widget bottomWorkflowActionWidget = ((WorkflowEnhancedNavController) controller).getWfUtilities().getWorkflowActionsWidget();
 216  
             
 217  0
             topWorkflowActionWidget.ensureDebugId("Top-Workflow-Actions");            
 218  0
             bottomWorkflowActionWidget.ensureDebugId("Bottom-Workflow-Actions");
 219  
             
 220  0
             infoContainer1= generateWorkflowWidgetContainer(topWorkflowActionWidget);
 221  0
             infoContainer2= generateWorkflowWidgetContainer(bottomWorkflowActionWidget);
 222  
 
 223  0
             ((WorkflowEnhancedNavController) controller).getWfUtilities()
 224  0
                     .addSubmitCallback(new Callback<Boolean>() {
 225  
 
 226  
                         @Override
 227  
                         public void exec(Boolean result) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 228  0
                             if (result) {
 229  0
                                 tableSection.setEditable(false);
 230  0
                                 if (controller instanceof MenuSectionController) {
 231  0
                                     ((MenuSectionController) controller).removeMenuNavigation();
 232  
                                 }
 233  
                             }
 234  
 
 235  0
                         }
 236  
                     });
 237  
 
 238  
             // Override beforeShow for summary section here to allow for custom validation mechanism on the table
 239  0
             VerticalSectionView verticalSection = new VerticalSectionView(CourseSections.SUMMARY, getLabel(LUUIConstants.SUMMARY_LABEL_KEY), modelId) {
 240  
                                 
 241  
                 @Override
 242  
                 public void beforeShow(final Callback<Boolean> onReadyCallback) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 243  
 
 244  0
                     super.beforeShow(new Callback<Boolean>() {
 245  
 
 246  
                         @Override
 247  
                         public void exec(final Boolean result) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 248  
 
 249  0
                             if (result) {
 250  
                                 // Make sure workflow actions and status updated before showing.
 251  0
                                 ((WorkflowEnhancedNavController) controller).getWfUtilities().refresh();
 252  
 
 253  
                                 // Show validation errors if they exist
 254  0
                                 ((WorkflowEnhancedNavController) controller).getWfUtilities().doValidationCheck(new Callback<List<ValidationResultInfo>>() {
 255  
                                             
 256  
                                     @Override
 257  
                                     public void exec(List<ValidationResultInfo> validationResults) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 258  
 
 259  0
                                         tableSection.enableValidation(showingValidation);   //  I think passing true here turns on all validation highlighting automatically (i.e: without requiring "click to show") [KSCM-250]
 260  
                                         
 261  0
                                         initializeHeaders(validationResults);
 262  0
                                         resolveMissingFieldsWarnings();
 263  
                                         // proposal submission warnings resolution moved to overridden processValidationResults below.
 264  
                                         
 265  0
                                         onReadyCallback.exec(result);   // calls CourseProposalController.showView.finalView [KSCM-250]
 266  0
                                     }
 267  
                                 });
 268  
                             } else {
 269  0
                                 onReadyCallback.exec(result);
 270  
                             }
 271  0
                         }
 272  
                     });
 273  0
                 }
 274  
                 
 275  
                 /*
 276  
                  * Appropriately initializes yellow warning (WarnContainers called infoContainers here) boxes at page top/bottom.
 277  
                  */                
 278  
                 void initializeHeaders(List<ValidationResultInfo> validationResults){                  
 279  0
                     ErrorLevel isValid = tableSection.processValidationResults(validationResults, true);                                            
 280  0
                     validationInfos = validationResults;
 281  
                     
 282  0
                     if (isValid == ErrorLevel.OK) {
 283  
                         
 284  0
                         infoContainer1.showWarningLayout(false);
 285  0
                         infoContainer2.showWarningLayout(false);
 286  
                         
 287  0
                         ((WorkflowEnhancedNavController) controller).getWfUtilities().enableWorkflowActionsWidgets(true);
 288  
                     } else { //KSLAB-1985
 289  
 
 290  0
                         infoContainer1.clearWarnLayout();
 291  0
                         infoContainer2.clearWarnLayout();
 292  
 
 293  0
                         infoContainer1.showWarningLayout(true);
 294  0
                         infoContainer2.showWarningLayout(true);
 295  0
                         ((WorkflowEnhancedNavController) controller).getWfUtilities().enableWorkflowActionsWidgets(false);
 296  
                     }
 297  0
                 }
 298  
                 
 299  
                 /* 
 300  
                  * Shows missing fields warnings if and their links, if appropriate. 
 301  
                  */
 302  
                 public void resolveMissingFieldsWarnings(){
 303  
 
 304  0
                     if (tableSection.getIsMissingFields()) {
 305  0
                         final Anchor link1 = new Anchor("Show what's missing.");
 306  0
                         final Anchor link2 = new Anchor("Show what's missing.");                        
 307  0
                         ClickHandler showHideMsgClickHandler = new ClickHandler() {                            
 308  
                             
 309  
                             @Override   // Sets link action
 310  
                             public void onClick(ClickEvent event) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 311  
                                 
 312  0
                                 if (!showingValidation) {
 313  
 
 314  0
                                     for (int i = 0; i < validateLinks.size(); i++) {
 315  
                                         
 316  0
                                         validateLinks.get(i).setText("Hide error highlighting.");
 317  
                                     }
 318  
                                     
 319  0
                                     showingValidation = true;
 320  
                                     
 321  0
                                     tableSection.enableValidation(showingValidation);
 322  0
                                     tableSection.processValidationResults(validationInfos, true);
 323  
                                 } else {
 324  
 
 325  0
                                     for (int i = 0; i < validateLinks.size(); i++) {
 326  
                                         
 327  0
                                         validateLinks.get(i).setText("Show what's missing.");
 328  
                                     }
 329  
                                     
 330  0
                                     showingValidation = false;
 331  
                                     
 332  0
                                     tableSection.enableValidation(showingValidation);
 333  0
                                     tableSection.removeValidationHighlighting();
 334  
                                 }
 335  0
                             }
 336  
                         };
 337  
                         
 338  0
                         validateLinks.add(link1);   // Enable links
 339  0
                         validateLinks.add(link2);
 340  
 
 341  0
                         link1.addClickHandler(showHideMsgClickHandler);
 342  0
                         link2.addClickHandler(showHideMsgClickHandler);
 343  
 
 344  0
                         infoContainer1.addWarnWidget(new KSLabel("This proposal has missing fields.  "));
 345  0
                         infoContainer1.addWarnWidget(link1);
 346  0
                         infoContainer2.addWarnWidget(new KSLabel("This proposal has missing fields.  "));
 347  0
                         infoContainer2.addWarnWidget(link2);
 348  
                     }
 349  0
                 }
 350  
 
 351  
                 @Override   //overridden from BaseSection to handle conflict warnings   [KSCM-250]
 352  
                 public ErrorLevel processValidationResults(List<ValidationResultInfo> validationResults) {                    
 353  
 
 354  0
                     tableSection.processValidationResults(validationResults, false);
 355  0
                     resolveProposalSubmissionWarnings();
 356  
                     
 357  0
                     return super.processValidationResults(validationResults);
 358  
                 }
 359  
                 
 360  
                 /* 
 361  
                  * Shows proposal submission warnings if appropriate.
 362  
                  *  i.e: If conflict warnings exist //[KSCM-250]
 363  
                  */
 364  
                 public void resolveProposalSubmissionWarnings(){
 365  
                     
 366  0
                     if (tableSection.getHasWarnings()) {
 367  
 
 368  0
                         infoContainer1.addWarnWidgetBlock(new KSLabel("This proposal contains warnings that prevent it from being submitted."));
 369  0
                         infoContainer2.addWarnWidgetBlock(new KSLabel("This proposal contains warnings that prevent it from being submitted."));
 370  
                     }
 371  0
                 }
 372  
                
 373  
             };
 374  
             // Widget-adding order matters
 375  0
             verticalSection.addWidget(infoContainer1); // Header widget (with warnings if necessary)
 376  0
             verticalSection.addSection(tableSection);
 377  0
             verticalSection.addWidget(infoContainer2); // Footer widget (with warnings if necessary)
 378  
 
 379  0
             return verticalSection;
 380  
 
 381  
         } else {
 382  
 
 383  0
             VerticalSectionView verticalSection = new VerticalSectionView(
 384  
                     CourseSections.SUMMARY,
 385  
                     getLabel(LUUIConstants.SUMMARY_LABEL_KEY), modelId);
 386  0
             verticalSection.addSection(tableSection);
 387  0
             GWT.log("CourseSummaryConfigurer - Summary table needs a workflow controller to provide submit/validation mechanism");
 388  
 
 389  0
             return verticalSection;
 390  
         }
 391  
 
 392  
     }
 393  
 
 394  
     private SummaryTableFieldBlock generateProposalDocumentsSection() {
 395  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 396  0
         block.addEditingHandler(new EditHandler(CourseSections.DOCUMENTS));
 397  0
         block.setTitle(getLabel(LUUIConstants.TOOL_DOCUMENTS_LABEL_KEY));
 398  0
         block.addSummaryTableFieldRow(getFieldRow("proposal/id",
 399  
                 generateMessageInfo(LUUIConstants.TOOL_DOCUMENTS_LABEL_KEY),
 400  
                 new DocumentList(LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE,
 401  
                         false, false), new DocumentList(
 402  
                         LUUIConstants.REF_DOC_RELATION_PROPOSAL_TYPE, false,
 403  
                         false), null, new DocumentListBinding("proposal/id"),
 404  
                 false));
 405  0
         return block;
 406  
     }
 407  
 
 408  
     // Initializes a WarnContainer with Action options dropdown, and Curriculum Management link 
 409  
     private WarnContainer generateWorkflowWidgetContainer(Widget w) {
 410  
 
 411  0
         WarnContainer warnContainer = new WarnContainer();
 412  
 
 413  0
         warnContainer.add(w);
 414  0
         w.addStyleName("ks-button-spacing");
 415  
 //        warnContainer.add(new KSButton("Return to Curriculum Management",
 416  
 //                ButtonStyle.DEFAULT_ANCHOR, new ClickHandler() {
 417  
 //
 418  
 //                    @Override
 419  
 //                    public void onClick(ClickEvent event) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 420  
 //                        Application
 421  
 //                                .navigate(AppLocations.Locations.CURRICULUM_MANAGEMENT
 422  
 //                                        .getLocation());
 423  
 //                    }
 424  
 //                }));
 425  
 
 426  
         // KSLAB-1985:  Warning logic/display moved to generateProposalSummarySection() where error states are established
 427  
 
 428  0
         return warnContainer;
 429  
     }
 430  
 
 431  
     public VerticalSectionView generateCourseSummarySection() {
 432  0
         tableSection.setEditable(false);
 433  0
         tableSection.addSummaryTableFieldBlock(generateCourseInformation());
 434  0
         tableSection
 435  
                 .addSummaryTableFieldBlock(generateCourseInformationCrossListing());
 436  0
         tableSection.addSummaryTableFieldBlock(generateGovernanceSection());
 437  0
         tableSection
 438  
                 .addSummaryTableFieldBlock(generateCourseLogisticsSection());
 439  0
         tableSection
 440  
                 .addSummaryTableFieldBlock(generateLearningObjectivesSection());
 441  0
         tableSection.addSummaryTableFieldBlock(generateRequirementsSection());
 442  0
         tableSection.addSummaryTableFieldBlock(generateActiveDatesSection());
 443  0
         tableSection.addSummaryTableFieldBlock(generateFeesSection());
 444  
 
 445  0
         VerticalSectionView verticalSection = new VerticalSectionView(
 446  
                 ViewCourseSections.DETAILED,
 447  
                 getLabel(LUUIConstants.SUMMARY_LABEL_KEY), modelId, false);
 448  0
         verticalSection.addSection(tableSection);
 449  
 
 450  0
         return verticalSection;
 451  
     }
 452  
 
 453  
     @SuppressWarnings("unchecked")
 454  
     public SummaryTableFieldBlock generateCourseInformationForProposal() {
 455  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 456  0
         block.addEditingHandler(new EditHandler(CourseSections.COURSE_INFO));
 457  0
         block.setTitle(getLabel(LUUIConstants.INFORMATION_LABEL_KEY));
 458  0
         block.addSummaryTableFieldRow(getFieldRow(PROPOSAL_TITLE_PATH,
 459  
                 generateMessageInfo(LUUIConstants.PROPOSAL_TITLE_LABEL_KEY)));
 460  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + COURSE_TITLE,
 461  
                 generateMessageInfo(LUUIConstants.COURSE_TITLE_LABEL_KEY)));
 462  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 463  
                 + TRANSCRIPT_TITLE,
 464  
                 generateMessageInfo(LUUIConstants.SHORT_TITLE_LABEL_KEY)));
 465  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + SUBJECT_AREA,
 466  
                 generateMessageInfo(LUUIConstants.SUBJECT_CODE_LABEL_KEY)));
 467  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 468  
                 + COURSE_NUMBER_SUFFIX,
 469  
                 generateMessageInfo(LUUIConstants.COURSE_NUMBER_LABEL_KEY)));
 470  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + INSTRUCTORS,
 471  
                 generateMessageInfo(LUUIConstants.INSTRUCTORS_LABEL_KEY), null,
 472  
                 null, null, new KeyListModelWigetBinding("personId"), false));
 473  
 
 474  
         // block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" +
 475  
         // PROPOSAL_DESCRIPTION + "/" + RichTextInfoConstants.PLAIN,
 476  
         // generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY)));
 477  
         // block.addSummaryTableFieldRow(getFieldRow("proposal/rationale",
 478  
         // generateMessageInfo(LUUIConstants.PROPOSAL_RATIONALE_LABEL_KEY)));
 479  
 
 480  0
         return block;
 481  
     }
 482  
 
 483  
     @SuppressWarnings("unchecked")
 484  
     public SummaryTableFieldBlock generateCourseInformationForProposalCrossListed() {
 485  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 486  0
         block.addEditingHandler(new EditHandler(CourseSections.COURSE_INFO));
 487  0
         block.setTitle("Cross Listed Courses");
 488  
 
 489  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 490  
                 COURSE + QueryPath.getPathSeparator() + CROSS_LISTINGS,
 491  
                 LUUIConstants.CROSS_LISTED_ITEM_LABEL_KEY, Arrays.asList(Arrays
 492  
                         .asList(SUBJECT_AREA,
 493  
                                 LUUIConstants.SUBJECT_CODE_LABEL_KEY), Arrays
 494  
                         .asList(COURSE_NUMBER_SUFFIX,
 495  
                                 LUUIConstants.COURSE_NUMBER_LABEL_KEY))));
 496  
 
 497  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 498  
                 COURSE + QueryPath.getPathSeparator() + JOINTS,
 499  
                 LUUIConstants.JOINT_OFFER_ITEM_LABEL_KEY,
 500  
                 Arrays.asList(Arrays.asList(
 501  
                         CreditCourseJointsConstants.COURSE_ID,
 502  
                         LUUIConstants.COURSE_NUMBER_OR_TITLE_LABEL_KEY))));
 503  
 
 504  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 505  
                 COURSE + QueryPath.getPathSeparator() + VERSIONS,
 506  
                 LUUIConstants.VERSION_CODE_LABEL_KEY, Arrays.asList(Arrays
 507  
                         .asList("variationCode",
 508  
                                 LUUIConstants.VERSION_CODE_LABEL_KEY),
 509  
                         Arrays.asList("variationTitle",
 510  
                                 LUUIConstants.TITLE_LABEL_KEY))));
 511  
 
 512  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 513  
                 + PROPOSAL_DESCRIPTION + "/" + RichTextInfoConstants.PLAIN,
 514  
                 generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY)));
 515  0
         block.addSummaryTableFieldRow(getFieldRow("proposal/rationale",
 516  
                 generateMessageInfo(LUUIConstants.PROPOSAL_RATIONALE_LABEL_KEY)));
 517  
 
 518  0
         return block;
 519  
     }
 520  
 
 521  
     public SummaryTableFieldBlock generateCourseInformation() {
 522  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 523  0
         block.addEditingHandler(new EditHandler(CourseSections.COURSE_INFO));
 524  0
         block.setTitle(getLabel(LUUIConstants.INFORMATION_LABEL_KEY));
 525  
         // block.addSummaryTableFieldRow(getFieldRow(PROPOSAL_TITLE_PATH,
 526  
         // generateMessageInfo(LUConstants.PROPOSAL_TITLE_LABEL_KEY)));
 527  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + COURSE_TITLE,
 528  
                 generateMessageInfo(LUUIConstants.COURSE_TITLE_LABEL_KEY)));
 529  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 530  
                 + TRANSCRIPT_TITLE,
 531  
                 generateMessageInfo(LUUIConstants.SHORT_TITLE_LABEL_KEY)));
 532  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + SUBJECT_AREA,
 533  
                 generateMessageInfo(LUUIConstants.SUBJECT_CODE_LABEL_KEY)));
 534  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 535  
                 + COURSE_NUMBER_SUFFIX,
 536  
                 generateMessageInfo(LUUIConstants.COURSE_NUMBER_LABEL_KEY)));
 537  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + INSTRUCTORS,
 538  
                 generateMessageInfo(LUUIConstants.INSTRUCTORS_LABEL_KEY), null,
 539  
                 null, null, new KeyListModelWigetBinding("personId"), false));
 540  0
         SummaryTableFieldBlock aRow = new SummaryTableFieldBlock();
 541  0
         aRow.setTitle("Fixing it");
 542  
 
 543  0
         aRow.addSummaryMultiplicity(getMultiplicityConfig(
 544  
                 COURSE + QueryPath.getPathSeparator() + CROSS_LISTINGS,
 545  
                 LUUIConstants.CROSS_LISTED_ITEM_LABEL_KEY, Arrays.asList(Arrays
 546  
                         .asList(SUBJECT_AREA,
 547  
                                 LUUIConstants.SUBJECT_CODE_LABEL_KEY), Arrays
 548  
                         .asList(COURSE_NUMBER_SUFFIX,
 549  
                                 LUUIConstants.COURSE_NUMBER_LABEL_KEY))));
 550  
 
 551  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 552  
                 COURSE + QueryPath.getPathSeparator() + JOINTS,
 553  
                 LUUIConstants.JOINT_OFFER_ITEM_LABEL_KEY,
 554  
                 Arrays.asList(Arrays.asList(
 555  
                         CreditCourseJointsConstants.COURSE_ID,
 556  
                         LUUIConstants.COURSE_NUMBER_OR_TITLE_LABEL_KEY))));
 557  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 558  
                 COURSE + QueryPath.getPathSeparator() + VERSIONS,
 559  
                 LUUIConstants.VERSION_CODE_LABEL_KEY, Arrays.asList(Arrays
 560  
                         .asList("variationCode",
 561  
                                 LUUIConstants.VERSION_CODE_LABEL_KEY),
 562  
                         Arrays.asList("variationTitle",
 563  
                                 LUUIConstants.TITLE_LABEL_KEY))));
 564  
 
 565  
         // block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" +
 566  
         // PROPOSAL_DESCRIPTION + "/" + RichTextInfoConstants.PLAIN,
 567  
         // generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY)));
 568  
 
 569  0
         return block;
 570  
     }
 571  
 
 572  
     public SummaryTableFieldBlock generateCourseInformationCrossListing() {
 573  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 574  0
         block.addEditingHandler(new EditHandler(CourseSections.COURSE_INFO));
 575  0
         block.setTitle("Cross Listings");
 576  
 
 577  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 578  
                 COURSE + QueryPath.getPathSeparator() + CROSS_LISTINGS,
 579  
                 LUUIConstants.CROSS_LISTED_ITEM_LABEL_KEY, Arrays.asList(Arrays
 580  
                         .asList(SUBJECT_AREA,
 581  
                                 LUUIConstants.SUBJECT_CODE_LABEL_KEY), Arrays
 582  
                         .asList(COURSE_NUMBER_SUFFIX,
 583  
                                 LUUIConstants.COURSE_NUMBER_LABEL_KEY))));
 584  
 
 585  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 586  
                 COURSE + QueryPath.getPathSeparator() + JOINTS,
 587  
                 LUUIConstants.JOINT_OFFER_ITEM_LABEL_KEY,
 588  
                 Arrays.asList(Arrays.asList(
 589  
                         CreditCourseJointsConstants.COURSE_ID,
 590  
                         LUUIConstants.COURSE_NUMBER_OR_TITLE_LABEL_KEY))));
 591  0
         block.addSummaryMultiplicity(getMultiplicityConfig(
 592  
                 COURSE + QueryPath.getPathSeparator() + VERSIONS,
 593  
                 LUUIConstants.VERSION_CODE_LABEL_KEY, Arrays.asList(Arrays
 594  
                         .asList("variationCode",
 595  
                                 LUUIConstants.VERSION_CODE_LABEL_KEY),
 596  
                         Arrays.asList("variationTitle",
 597  
                                 LUUIConstants.TITLE_LABEL_KEY))));
 598  
 
 599  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 600  
                 + PROPOSAL_DESCRIPTION + "/" + RichTextInfoConstants.PLAIN,
 601  
                 generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY)));
 602  
 
 603  0
         return block;
 604  
     }
 605  
 
 606  
     public SummaryTableFieldBlock generateGovernanceSection() {
 607  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 608  0
         block.addEditingHandler(new EditHandler(CourseSections.GOVERNANCE));
 609  0
         block.setTitle(getLabel(LUUIConstants.GOVERNANCE_LABEL_KEY));
 610  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 611  
                 + CAMPUS_LOCATIONS,
 612  
                 generateMessageInfo(LUUIConstants.CAMPUS_LOCATION_LABEL_KEY)));
 613  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 614  
                 + CURRICULUM_OVERSIGHT_ORGS_,
 615  
                 generateMessageInfo(LUUIConstants.ACADEMIC_SUBJECT_ORGS_KEY)));
 616  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + ADMIN_ORGS,
 617  
                 generateMessageInfo(LUUIConstants.ADMIN_ORG_LABEL_KEY)));
 618  0
         return block;
 619  
     }
 620  
 
 621  
     @SuppressWarnings("unchecked")
 622  
     public SummaryTableFieldBlock generateCourseLogisticsSection() {
 623  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 624  0
         block.addEditingHandler(new EditHandler(CourseSections.COURSE_LOGISTICS));
 625  0
         block.setTitle(getLabel(LUUIConstants.LOGISTICS_LABEL_KEY));
 626  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + TERMS_OFFERED,
 627  
                 generateMessageInfo(LUUIConstants.TERMS_OFFERED_LABEL_KEY)));
 628  0
         block.addSummaryTableFieldRow(getFieldRow(
 629  
                 COURSE + "/" + GRADING_OPTIONS,
 630  
                 generateMessageInfo(LUUIConstants.LEARNING_RESULT_ASSESSMENT_SCALE_LABEL_KEY)));
 631  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 632  
                 + CreditCourseConstants.DURATION + "/" + "atpDurationTypeKey",
 633  
                 generateMessageInfo(LUUIConstants.DURATION_TYPE_LABEL_KEY)));
 634  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 635  
                 + CreditCourseConstants.DURATION + "/" + "timeQuantity",
 636  
                 generateMessageInfo(LUUIConstants.DURATION_QUANTITY_LABEL_KEY)));
 637  0
         block.addSummaryTableFieldRow(getFieldRow(
 638  
                 COURSE + "/" + PASS_FAIL,
 639  
                 generateMessageInfo(LUUIConstants.LEARNING_RESULT_PASS_FAIL_LABEL_KEY)));
 640  0
         block.addSummaryTableFieldRow(getFieldRow(
 641  
                 COURSE + "/" + AUDIT,
 642  
                 generateMessageInfo(LUUIConstants.LEARNING_RESULT_AUDIT_LABEL_KEY)));
 643  
 
 644  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 645  
                 + CreditCourseConstants.FINAL_EXAM,
 646  
                 generateMessageInfo(LUUIConstants.FINAL_EXAM_STATUS_LABEL_KEY)));
 647  0
         block.addSummaryTableFieldRow(getFieldRow(
 648  
                 COURSE + "/" + CreditCourseConstants.FINAL_EXAM_RATIONALE,
 649  
                 generateMessageInfo(LUUIConstants.FINAL_EXAM_RATIONALE_LABEL_KEY),
 650  
                 true));
 651  
 
 652  
         // Outcomes
 653  0
         Map<String, ModelWidgetBinding> customBindings = new HashMap<String, ModelWidgetBinding>();
 654  0
         ListToTextBinding resultValuesBinding = new ListToTextBinding();
 655  0
         customBindings.put("resultValues", resultValuesBinding);
 656  0
         String outcomesKey = COURSE + QueryPath.getPathSeparator()
 657  
                 + CREDIT_OPTIONS;
 658  0
         MultiplicityConfiguration outcomesConfig = getMultiplicityConfig(
 659  
                 outcomesKey,
 660  
                 LUUIConstants.LEARNING_RESULT_OUTCOME_LABEL_KEY,
 661  
                 Arrays.asList(
 662  
                         Arrays.asList(
 663  
                                 CreditCourseConstants.TYPE,
 664  
                                 LUUIConstants.LEARNING_RESULT_OUTCOME_TYPE_LABEL_KEY),
 665  
                         Arrays.asList(CREDIT_OPTION_FIXED_CREDITS,
 666  
                                 LUUIConstants.CREDIT_VALUE_LABEL_KEY, OPTIONAL),
 667  
                         Arrays.asList(
 668  
                                 CREDIT_OPTION_MIN_CREDITS,
 669  
                                 LUUIConstants.CREDIT_OPTION_MIN_CREDITS_LABEL_KEY,
 670  
                                 OPTIONAL),
 671  
                         Arrays.asList(
 672  
                                 CREDIT_OPTION_MAX_CREDITS,
 673  
                                 LUUIConstants.CREDIT_OPTION_MAX_CREDITS_LABEL_KEY,
 674  
                                 OPTIONAL),
 675  
                         Arrays.asList(
 676  
                                 "resultValues",
 677  
                                 LUUIConstants.CREDIT_OPTION_FIXED_CREDITS_LABEL_KEY,
 678  
                                 OPTIONAL)), customBindings);
 679  
 
 680  
         // Massive workaround for result values problem where we dont want to
 681  
         // show them on certain selections,
 682  
         // in most cases you want to just use the optional flag and have it be
 683  
         // based on empty/null data
 684  
         // but since this data is sometimes not empty/null when we dont want to
 685  
         // show it, it requires a show
 686  
         // condition callback
 687  0
         tableSection.addShowRowCallback(new ShowRowConditionCallback() {
 688  
             @Override
 689  
             public void processShowConditions(SummaryTableFieldRow row, //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 690  
                     DataModel column1, DataModel column2) {
 691  0
                 if (row.getFieldDescriptor1() != null
 692  
                         && row.getFieldDescriptor1().getFieldKey()
 693  
                                 .contains(CREDIT_OPTIONS)
 694  
                         && row.getFieldDescriptor1().getFieldKey()
 695  
                                 .contains("resultValues")) {
 696  0
                     String type = row
 697  
                             .getFieldDescriptor1()
 698  
                             .getFieldKey()
 699  
                             .replace("resultValues", CreditCourseConstants.TYPE);
 700  0
                     Object data1 = null;
 701  0
                     Object data2 = null;
 702  0
                     if (column1 != null) {
 703  0
                         data1 = column1.get(type);
 704  
                     }
 705  0
                     if (column2 != null) {
 706  0
                         data2 = column2.get(type);
 707  
                     }
 708  
 
 709  0
                     if (data1 != null && data1 instanceof String) {
 710  0
                         if (!((String) data1)
 711  
                                 .equals("kuali.resultComponentType.credit.degree.multiple")) {
 712  0
                             row.setShown(false);
 713  
                         }
 714  0
                     } else if (data2 != null && data2 instanceof String) {
 715  0
                         if (!((String) data2)
 716  
                                 .equals("kuali.resultComponentType.credit.degree.multiple")) {
 717  0
                             row.setShown(false);
 718  
                         }
 719  
                     }
 720  
                 }
 721  0
             }
 722  
         });
 723  
 
 724  0
         block.addSummaryMultiplicity(outcomesConfig);
 725  
 
 726  
         // Formats
 727  0
         MultiplicityConfiguration formatsConfig = getMultiplicityConfig(COURSE
 728  
                 + QueryPath.getPathSeparator() + FORMATS,
 729  
                 LUUIConstants.FORMAT_LABEL_KEY, null);
 730  0
         MultiplicityConfiguration activitiesConfig = getMultiplicityConfig(
 731  
                 COURSE + QueryPath.getPathSeparator() + FORMATS
 732  
                         + QueryPath.getPathSeparator()
 733  
                         + QueryPath.getWildCard()
 734  
                         + QueryPath.getPathSeparator() + ACTIVITIES,
 735  
                 LUUIConstants.ACTIVITY_LITERAL_LABEL_KEY,
 736  
                 Arrays.asList(Arrays.asList(ACTIVITY_TYPE,
 737  
                         LUUIConstants.ACTIVITY_TYPE_LABEL_KEY), Arrays.asList(
 738  
                         CONTACT_HOURS + "/" + "unitQuantity",
 739  
                         LUUIConstants.CONTACT_HOURS_LABEL_KEY), Arrays.asList(
 740  
                         CONTACT_HOURS + "/" + "unitType",
 741  
                         LUUIConstants.CONTACT_HOURS_FREQUENCY_LABEL_KEY),
 742  
                         Arrays.asList(CreditCourseActivityConstants.DURATION
 743  
                                 + "/" + "atpDurationTypeKey",
 744  
                                 LUUIConstants.DURATION_TYPE_LABEL_KEY),
 745  
                         Arrays.asList(CreditCourseActivityConstants.DURATION
 746  
                                 + "/" + "timeQuantity",
 747  
                                 LUUIConstants.DURATION_LITERAL_LABEL_KEY),
 748  
                         Arrays.asList(DEFAULT_ENROLLMENT_ESTIMATE,
 749  
                                 LUUIConstants.CLASS_SIZE_LABEL_KEY)));
 750  0
         formatsConfig.setNestedConfig(activitiesConfig);
 751  0
         block.addSummaryMultiplicity(formatsConfig);
 752  
 
 753  0
         return block;
 754  
     }
 755  
 
 756  
     public SummaryTableFieldBlock generateLearningObjectivesSection() {
 757  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 758  0
         block.addEditingHandler(new EditHandler(
 759  
                 CourseSections.LEARNING_OBJECTIVES));
 760  0
         block.setTitle(getLabel(LUUIConstants.LEARNING_OBJECTIVES_LABEL_KEY));
 761  0
         SummaryTableFieldRow loRow = getFieldRow(
 762  
                 COURSE + "/" + CreditCourseConstants.COURSE_SPECIFIC_LOS,
 763  
                 generateMessageInfo(LUUIConstants.LEARNING_OBJECTIVES_LABEL_KEY),
 764  
                 new KSListPanel(), new KSListPanel(), null,
 765  
                 new TreeStringBinding(), false);
 766  0
         loRow.addContentCellStyleName("summaryTable-lo-cell");
 767  0
         block.addSummaryTableFieldRow(loRow);
 768  
 
 769  0
         return block;
 770  
     }
 771  
 
 772  
     public SummaryTableFieldBlock generateActiveDatesSection() {
 773  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 774  0
         block.addEditingHandler(new EditHandler(CourseSections.ACTIVE_DATES));
 775  0
         block.setTitle(getLabel(LUUIConstants.ACTIVE_DATES_LABEL_KEY));
 776  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + START_TERM,
 777  
                 generateMessageInfo(LUUIConstants.START_TERM_LABEL_KEY)));
 778  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + END_TERM,
 779  
                 generateMessageInfo(LUUIConstants.END_TERM_LABEL_KEY)));
 780  
         // Probably wrong - checkbox
 781  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + PILOT_COURSE,
 782  
                 generateMessageInfo(LUUIConstants.PILOT_COURSE_LABEL_KEY)));
 783  0
         return block;
 784  
     }
 785  
 
 786  
     public SummaryTableFieldBlock generateFeesSection() {
 787  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 788  0
         block.addEditingHandler(new EditHandler(CourseSections.FINANCIALS));
 789  0
         block.setTitle(getLabel(LUUIConstants.FINANCIALS_LABEL_KEY));
 790  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 791  
                 + "feeJustification" + "/" + RichTextInfoConstants.PLAIN,
 792  
                 generateMessageInfo(LUUIConstants.JUSTIFICATION_FEE)));
 793  
         // Fees
 794  0
         MultiplicityConfiguration feesConfig = getMultiplicityConfig(
 795  
                 COURSE + QueryPath.getPathSeparator() + FEES,
 796  
                 LUUIConstants.FEE,
 797  
                 Arrays.asList(Arrays.asList("rateType", "Rate Type"),
 798  
                         Arrays.asList("feeType", "Fee Type")));
 799  
         // Note the use of empty string to remove the additional row from
 800  
         // display in the summary table
 801  0
         MultiplicityConfiguration amountsConfig = getMultiplicityConfig(
 802  
                 COURSE + QueryPath.getPathSeparator() + FEES
 803  
                         + QueryPath.getPathSeparator()
 804  
                         + QueryPath.getWildCard()
 805  
                         + QueryPath.getPathSeparator() + "feeAmounts", "",
 806  
                 Arrays.asList(Arrays.asList("currencyQuantity", "Amount")));
 807  0
         feesConfig.setNestedConfig(amountsConfig);
 808  0
         block.addSummaryMultiplicity(feesConfig);
 809  
 
 810  
         // Revenue
 811  0
         MultiplicityConfiguration revenueConfig = getMultiplicityConfig(
 812  
                 COURSE + QueryPath.getPathSeparator() + "revenues",
 813  
                 LUUIConstants.REVENUE,
 814  
                 Arrays.asList(Arrays.asList("affiliatedOrgs/0/orgId",
 815  
                         "Organization"), Arrays.asList(
 816  
                         "affiliatedOrgs/0/percentage", "Percentage")));
 817  0
         block.addSummaryMultiplicity(revenueConfig);
 818  
 
 819  
         // Expenditure
 820  0
         MultiplicityConfiguration expenditureConfig = getMultiplicityConfig(
 821  
                 COURSE + QueryPath.getPathSeparator() + "expenditure"
 822  
                         + QueryPath.getPathSeparator() + "affiliatedOrgs",
 823  
                 LUUIConstants.EXPENDITURE,
 824  
                 Arrays.asList(Arrays.asList("orgId", "Organization"),
 825  
                         Arrays.asList("percentage", "Percentage")));
 826  0
         block.addSummaryMultiplicity(expenditureConfig);
 827  
 
 828  0
         return block;
 829  
     }
 830  
 
 831  
     public SummaryTableFieldBlock generateRequirementsSection() {
 832  
 
 833  0
         final SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 834  0
         block.addEditingHandler(new EditHandler(
 835  
                 CourseSections.COURSE_REQUISITES));
 836  0
         block.setTitle(getLabel(LUUIConstants.REQUISITES_LABEL_KEY));
 837  
 
 838  
         // one row per requirement type
 839  0
         for (StatementTypeInfo stmtType : stmtTypes) {
 840  
             SummaryTableFieldRow arow;
 841  0
             if (controller instanceof VersionsController
 842  
                     || controller instanceof CourseProposalController)
 843  0
                 arow = new SummaryTableFieldRow(addRequisiteField(
 844  
                         new FlowPanel(), stmtType), addRequisiteFieldComp(
 845  
                         new FlowPanel(), stmtType));
 846  
             else
 847  0
                 arow = new SummaryTableFieldRow(addRequisiteField(
 848  
                         new FlowPanel(), stmtType), addRequisiteField(
 849  
                         new FlowPanel(), stmtType));
 850  0
             block.addSummaryTableFieldRow(arow);
 851  0
         }
 852  
 
 853  0
         return block;
 854  
     }
 855  
 
 856  
     protected FieldDescriptorReadOnly addRequisiteField(final FlowPanel panel,
 857  
             final StatementTypeInfo stmtType) {
 858  
 
 859  0
         final ModelWidgetBinding<FlowPanel> widgetBinding = new ModelWidgetBinding<FlowPanel>() {
 860  
 
 861  
             @Override
 862  
             public void setModelValue(FlowPanel panel, DataModel model, //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 863  
                     String path) {
 864  0
                 }
 865  
 
 866  
             @Override
 867  
             public void setWidgetValue(final FlowPanel panel, DataModel model, //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 868  
                     String path) {
 869  0
                 panel.clear();
 870  0
                 if (controller instanceof HasRequirements) {
 871  0
                     final HasRequirements requirementsController = (HasRequirements) controller;
 872  0
                     if (requirementsController.getReqDataModel().isInitialized()) {
 873  0
                         List<StatementTreeViewInfo> statementTreeViewInfos = requirementsController
 874  
                                 .getReqDataModel().getCourseReqInfo(
 875  
                                         stmtType.getId());
 876  0
                         addSubrulePreviewWidget(panel, statementTreeViewInfos);
 877  0
                     } else {
 878  0
                         requirementsController.getReqDataModel().retrieveCourseRequirements(
 879  0
                                 AbstractCourseConfigurer.COURSE_PROPOSAL_MODEL, new Callback<Boolean>() {
 880  
                                     @Override
 881  
                                     public void exec(Boolean result) {
 882  0
                                         if (result) {
 883  0
                                             List<StatementTreeViewInfo> statementTreeViewInfos = requirementsController
 884  
                                                     .getReqDataModel().getCourseReqInfo(
 885  
                                                             stmtType.getId());
 886  0
                                             addSubrulePreviewWidget(panel, statementTreeViewInfos);
 887  
                                             //reset initialized property so that rules load on CourseRequirementSummaryView
 888  0
                                             requirementsController.getReqDataModel().setInitialized(false);
 889  
                                         }
 890  0
                                     }
 891  
                                 });
 892  
                     }
 893  
 
 894  
                 }
 895  0
             }
 896  
 
 897  
             private void addSubrulePreviewWidget(final FlowPanel panel,
 898  
                     List<StatementTreeViewInfo> statementTreeViewInfos) {
 899  0
                 for (StatementTreeViewInfo rule : statementTreeViewInfos) {
 900  0
                     if (!rule.getStatements().isEmpty() || !rule.getReqComponents().isEmpty()) {                                 
 901  0
                             SubrulePreviewWidget ruleWidget = new SubrulePreviewWidget(rule, true, CourseRequirementsSummaryView.getCluSetWidgetList(rule));
 902  0
                             panel.add(ruleWidget);
 903  0
                     }        
 904  
                 }
 905  0
             }
 906  
         };
 907  0
         FieldDescriptorReadOnly requisiteField = new FieldDescriptorReadOnly(
 908  
                 COURSE + "/" + CreditCourseConstants.ID, new MessageKeyInfo(
 909  
                         stmtType.getName()), null, panel);
 910  0
         requisiteField.setWidgetBinding(widgetBinding);
 911  
 
 912  0
         return requisiteField;
 913  
     }
 914  
 
 915  
     protected FieldDescriptorReadOnly addRequisiteFieldComp(
 916  
             final FlowPanel panel, final StatementTypeInfo stmtType) {
 917  
 
 918  0
         final ModelWidgetBinding<FlowPanel> widgetBinding = new ModelWidgetBinding<FlowPanel>() {
 919  
 
 920  
             @Override
 921  
             public void setModelValue(FlowPanel panel, DataModel model,
 922  
                     String path) {
 923  0
                 }
 924  
 
 925  
             @Override
 926  
             public void setWidgetValue(final FlowPanel panel, DataModel model,
 927  
                     String path) {
 928  0
                 panel.clear();
 929  0
                 List<StatementTreeViewInfo> statementTreeViewInfos = null;
 930  
 
 931  0
                 if (controller instanceof VersionsController)
 932  0
                     statementTreeViewInfos = ((VersionsController) controller)
 933  
                             .getReqDataModelComp().getCourseReqInfo(
 934  
                                     stmtType.getId());
 935  0
                 else if (controller instanceof CourseProposalController)
 936  0
                     statementTreeViewInfos = ((CourseProposalController) controller)
 937  
                             .getReqDataModelComp().getCourseReqInfo(
 938  
                                     stmtType.getId());
 939  
 
 940  0
                 for (StatementTreeViewInfo rule : statementTreeViewInfos) {
 941  0
                     SubrulePreviewWidget ruleWidget = new SubrulePreviewWidget(
 942  
                             rule, true,
 943  
                             CourseRequirementsSummaryView
 944  
                                     .getCluSetWidgetList(rule));
 945  0
                     panel.add(ruleWidget);
 946  0
                 }
 947  0
             }
 948  
         };
 949  
 
 950  0
         FieldDescriptorReadOnly requisiteField = new FieldDescriptorReadOnly(
 951  
                 COURSE + "/" + CreditCourseConstants.ID, new MessageKeyInfo(
 952  
                         stmtType.getName()), null, panel);
 953  0
         requisiteField.setWidgetBinding(widgetBinding);
 954  
 
 955  0
         return requisiteField;
 956  
     }
 957  
 
 958  
     protected MultiplicityConfiguration getMultiplicityConfig(String path,
 959  
             String itemLabelMessageKey, List<List<String>> fieldKeysAndLabels) {
 960  0
         return getMultiplicityConfig(path, itemLabelMessageKey,
 961  
                 fieldKeysAndLabels, null);
 962  
     }
 963  
 
 964  
     protected MultiplicityConfiguration getMultiplicityConfig(String path,
 965  
             String itemLabelMessageKey, List<List<String>> fieldKeysAndLabels,
 966  
             Map<String, ModelWidgetBinding> customBindings) {
 967  0
         QueryPath parentPath = QueryPath.concat(path);
 968  0
         MultiplicityConfiguration config = new MultiplicityConfiguration(
 969  
                 MultiplicityConfiguration.MultiplicityType.TABLE,
 970  
                 MultiplicityConfiguration.StyleType.TOP_LEVEL_GROUP,
 971  
                 modelDefinition.getMetadata(parentPath));
 972  0
         config.setItemLabel(getLabel(itemLabelMessageKey));
 973  0
         config.setUpdateable(false);
 974  0
         config.setShowHeaders(true);
 975  
 
 976  0
         FieldDescriptorReadOnly parentFd = buildFieldDescriptor(path,
 977  
                 getLabel(itemLabelMessageKey), null);
 978  0
         config.setParent(parentFd);
 979  
 
 980  0
         if (fieldKeysAndLabels != null) {
 981  0
             for (List<String> fieldKeyAndLabel : fieldKeysAndLabels) {
 982  0
                 MultiplicityFieldConfiguration fd = buildMultiplicityFD(
 983  
                         fieldKeyAndLabel.get(0), fieldKeyAndLabel.get(1),
 984  
                         parentPath.toString());
 985  0
                 if (fieldKeyAndLabel.size() == 3
 986  
                         && fieldKeyAndLabel.get(2).equals(OPTIONAL)) {
 987  0
                     fd.setOptional(true);
 988  
                 }
 989  0
                 if (customBindings != null
 990  
                         && customBindings.containsKey(fieldKeyAndLabel.get(0))) {
 991  0
                     fd.setModelWidgetBinding(customBindings
 992  
                             .get(fieldKeyAndLabel.get(0)));
 993  
                 }
 994  0
                 config.addFieldConfiguration(fd);
 995  0
             }
 996  
         }
 997  
 
 998  0
         return config;
 999  
     }
 1000  
 
 1001  
     // TODO next 3 methods below should be moved into some kind of multiplicity
 1002  
     // helper class
 1003  
     private MultiplicityFieldConfiguration buildMultiplicityFD(String fieldKey,
 1004  
             String labelKey, String parentPath) {
 1005  
 
 1006  0
         QueryPath fieldPath = QueryPath.concat(parentPath,
 1007  
                 QueryPath.getWildCard(), fieldKey);
 1008  0
         Metadata meta = modelDefinition.getMetadata(fieldPath);
 1009  
 
 1010  0
         MultiplicityFieldConfiguration fd = new MultiplicityFieldConfiguration(
 1011  
                 fieldPath.toString(), generateMessageInfo(labelKey), meta, null);
 1012  
 
 1013  0
         return fd;
 1014  
 
 1015  
     }
 1016  
 
 1017  
     private FieldDescriptorReadOnly buildFieldDescriptor(String fieldKey,
 1018  
             String messageKey, String parentPath) {
 1019  0
         return buildFieldDescriptor(fieldKey, messageKey, parentPath, null,
 1020  
                 null);
 1021  
     }
 1022  
 
 1023  
     private FieldDescriptorReadOnly buildFieldDescriptor(String fieldKey,
 1024  
             String messageKey, String parentPath, Widget widget,
 1025  
             ModelWidgetBinding<?> binding) {
 1026  
 
 1027  0
         QueryPath path = QueryPath.concat(parentPath, fieldKey);
 1028  0
         Metadata meta = modelDefinition.getMetadata(path);
 1029  
 
 1030  0
         FieldDescriptorReadOnly fd = new FieldDescriptorReadOnly(
 1031  
                 path.toString(), generateMessageInfo(messageKey), meta);
 1032  0
         if (widget != null) {
 1033  0
             fd.setFieldWidget(widget);
 1034  
         }
 1035  0
         if (binding != null) {
 1036  0
             fd.setWidgetBinding(binding);
 1037  
         }
 1038  0
         return fd;
 1039  
     }
 1040  
 
 1041  
     public VerticalSectionView generateCourseBriefSection() {
 1042  0
         SummaryTableSection courseBriefSection = new SummaryTableSection(
 1043  
                 controller);
 1044  0
         courseBriefSection.setEditable(false);
 1045  0
         SummaryTableFieldBlock block = new SummaryTableFieldBlock();
 1046  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + COURSE_TITLE,
 1047  
                 generateMessageInfo(LUUIConstants.COURSE_TITLE_LABEL_KEY)));
 1048  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + "code",
 1049  
                 generateMessageInfo(LUUIConstants.COURSE_NUMBER_LABEL_KEY)));
 1050  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + ADMIN_ORGS,
 1051  
                 generateMessageInfo(LUUIConstants.ADMIN_ORG_LABEL_KEY)));
 1052  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 1053  
                 + PROPOSAL_DESCRIPTION + "/" + RichTextInfoConstants.PLAIN,
 1054  
                 generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY)));
 1055  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 1056  
                 + CURRICULUM_OVERSIGHT_ORGS_,
 1057  
                 generateMessageInfo(LUUIConstants.ACADEMIC_SUBJECT_ORGS_KEY)));
 1058  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/"
 1059  
                 + CAMPUS_LOCATIONS,
 1060  
                 generateMessageInfo(LUUIConstants.CAMPUS_LOCATION_LABEL_KEY)));
 1061  
 
 1062  0
         Map<String, ModelWidgetBinding> customBindings = new HashMap<String, ModelWidgetBinding>();
 1063  0
         ListToTextBinding resultValuesBinding = new ListToTextBinding();
 1064  0
         customBindings.put("resultValues", resultValuesBinding);
 1065  0
         String outcomesKey = COURSE + QueryPath.getPathSeparator()
 1066  
                 + CREDIT_OPTIONS;
 1067  0
         MultiplicityConfiguration outcomesConfig = getMultiplicityConfig(
 1068  
                 outcomesKey,
 1069  
                 LUUIConstants.LEARNING_RESULT_OUTCOME_LABEL_KEY,
 1070  
                 Arrays.asList(
 1071  
                         Arrays.asList(
 1072  
                                 CreditCourseConstants.TYPE,
 1073  
                                 LUUIConstants.LEARNING_RESULT_OUTCOME_TYPE_LABEL_KEY),
 1074  
                         Arrays.asList(CREDIT_OPTION_FIXED_CREDITS,
 1075  
                                 LUUIConstants.CONTACT_HOURS_LABEL_KEY, OPTIONAL),
 1076  
                         Arrays.asList(
 1077  
                                 CREDIT_OPTION_MIN_CREDITS,
 1078  
                                 LUUIConstants.CREDIT_OPTION_MIN_CREDITS_LABEL_KEY,
 1079  
                                 OPTIONAL),
 1080  
                         Arrays.asList(
 1081  
                                 CREDIT_OPTION_MAX_CREDITS,
 1082  
                                 LUUIConstants.CREDIT_OPTION_MAX_CREDITS_LABEL_KEY,
 1083  
                                 OPTIONAL),
 1084  
                         Arrays.asList(
 1085  
                                 "resultValues",
 1086  
                                 LUUIConstants.CREDIT_OPTION_FIXED_CREDITS_LABEL_KEY,
 1087  
                                 OPTIONAL)), customBindings);
 1088  
 
 1089  
         // Massive workaround for result values problem where we dont want to
 1090  
         // show them on certain selections,
 1091  
         // in most cases you want to just use the optional flag and have it be
 1092  
         // based on empty/null data
 1093  
         // but since this data is sometimes not empty/null when we dont want to
 1094  
         // show it, it requires a show
 1095  
         // condition callback
 1096  0
         courseBriefSection.addShowRowCallback(new ShowRowConditionCallback() {
 1097  
             @Override
 1098  
             public void processShowConditions(SummaryTableFieldRow row,
 1099  
                     DataModel column1, DataModel column2) {
 1100  0
                 if (row.getFieldDescriptor1() != null
 1101  
                         && row.getFieldDescriptor1().getFieldKey()
 1102  
                                 .contains(CREDIT_OPTIONS)
 1103  
                         && row.getFieldDescriptor1().getFieldKey()
 1104  
                                 .contains("resultValues")) {
 1105  0
                     String type = row
 1106  
                             .getFieldDescriptor1()
 1107  
                             .getFieldKey()
 1108  
                             .replace("resultValues", CreditCourseConstants.TYPE);
 1109  0
                     Object data1 = null;
 1110  0
                     Object data2 = null;
 1111  0
                     if (column1 != null) {
 1112  0
                         data1 = column1.get(type);
 1113  
                     }
 1114  0
                     if (column2 != null) {
 1115  0
                         data2 = column2.get(type);
 1116  
                     }
 1117  
 
 1118  0
                     if (data1 != null && data1 instanceof String) {
 1119  0
                         if (!((String) data1)
 1120  
                                 .equals("kuali.resultComponentType.credit.degree.multiple")) {
 1121  0
                             row.setShown(false);
 1122  
                         }
 1123  0
                     } else if (data2 != null && data2 instanceof String) {
 1124  0
                         if (!((String) data2)
 1125  
                                 .equals("kuali.resultComponentType.credit.degree.multiple")) {
 1126  0
                             row.setShown(false);
 1127  
                         }
 1128  
                     }
 1129  
                 }
 1130  0
             }
 1131  
         });
 1132  0
         block.addSummaryMultiplicity(outcomesConfig);
 1133  
 
 1134  0
         block.addSummaryTableFieldRow(getFieldRow(COURSE + "/" + TERMS_OFFERED,
 1135  
                 generateMessageInfo(LUUIConstants.TERMS_OFFERED_LABEL_KEY)));
 1136  0
         block.addSummaryTableFieldRow(getFieldRow(
 1137  
                 COURSE + "/" + GRADING_OPTIONS,
 1138  
                 generateMessageInfo(LUUIConstants.LEARNING_RESULT_ASSESSMENT_SCALE_LABEL_KEY)));
 1139  0
         block.addSummaryTableFieldRow(getFieldRow(
 1140  
                 COURSE + "/" + PASS_FAIL,
 1141  
                 generateMessageInfo(LUUIConstants.LEARNING_RESULT_PASS_FAIL_LABEL_KEY),
 1142  
                 true));
 1143  0
         block.addSummaryTableFieldRow(getFieldRow(
 1144  
                 COURSE + "/" + AUDIT,
 1145  
                 generateMessageInfo(LUUIConstants.LEARNING_RESULT_AUDIT_LABEL_KEY),
 1146  
                 true));
 1147  0
         MultiplicityConfiguration formatsConfig = getMultiplicityConfig(COURSE
 1148  
                 + QueryPath.getPathSeparator() + FORMATS,
 1149  
                 LUUIConstants.FORMAT_LABEL_KEY, null);
 1150  0
         MultiplicityConfiguration activitiesConfig = getMultiplicityConfig(
 1151  
                 COURSE + QueryPath.getPathSeparator() + FORMATS
 1152  
                         + QueryPath.getPathSeparator()
 1153  
                         + QueryPath.getWildCard()
 1154  
                         + QueryPath.getPathSeparator() + ACTIVITIES,
 1155  
                 LUUIConstants.ACTIVITY_LITERAL_LABEL_KEY, Arrays.asList(Arrays
 1156  
                         .asList(ACTIVITY_TYPE,
 1157  
                                 LUUIConstants.ACTIVITY_TYPE_LABEL_KEY), Arrays
 1158  
                         .asList(CONTACT_HOURS + "/" + "unitQuantity",
 1159  
                                 LUUIConstants.CONTACT_HOURS_LABEL_KEY), Arrays
 1160  
                         .asList(CONTACT_HOURS + "/" + "unitType", "per"),
 1161  
                         Arrays.asList(CreditCourseActivityConstants.DURATION
 1162  
                                 + "/" + "atpDurationTypeKey",
 1163  
                                 LUUIConstants.DURATION_TYPE_LABEL_KEY),
 1164  
                         Arrays.asList(CreditCourseActivityConstants.DURATION
 1165  
                                 + "/" + "timeQuantity",
 1166  
                                 LUUIConstants.DURATION_LITERAL_LABEL_KEY),
 1167  
                         Arrays.asList(DEFAULT_ENROLLMENT_ESTIMATE,
 1168  
                                 LUUIConstants.CLASS_SIZE_LABEL_KEY)));
 1169  0
         formatsConfig.setNestedConfig(activitiesConfig);
 1170  0
         block.addSummaryMultiplicity(formatsConfig);
 1171  
         // Fees
 1172  0
         MultiplicityConfiguration feesConfig = getMultiplicityConfig(
 1173  
                 COURSE + QueryPath.getPathSeparator() + FEES,
 1174  
                 LUUIConstants.FEE,
 1175  
                 Arrays.asList(Arrays.asList("rateType", "Rate Type"),
 1176  
                         Arrays.asList("feeType", "Fee Type")));
 1177  
         // Note the use of empty string to remove the additional row from
 1178  
         // display in the summary table
 1179  0
         MultiplicityConfiguration amountsConfig = getMultiplicityConfig(
 1180  
                 COURSE + QueryPath.getPathSeparator() + FEES
 1181  
                         + QueryPath.getPathSeparator()
 1182  
                         + QueryPath.getWildCard()
 1183  
                         + QueryPath.getPathSeparator() + "feeAmounts", "",
 1184  
                 Arrays.asList(Arrays.asList("currencyQuantity", "Amount")));
 1185  0
         feesConfig.setNestedConfig(amountsConfig);
 1186  0
         block.addSummaryMultiplicity(feesConfig);
 1187  
         /*
 1188  
          * block.addSummaryMultiplicity(getMultiplicityConfig(COURSE +
 1189  
          * QueryPath.getPathSeparator() + CROSS_LISTINGS,
 1190  
          * LUConstants.CROSS_LISTED_ITEM_LABEL_KEY, Arrays.asList(
 1191  
          * Arrays.asList(SUBJECT_AREA, LUConstants.SUBJECT_CODE_LABEL_KEY),
 1192  
          * Arrays.asList(COURSE_NUMBER_SUFFIX,
 1193  
          * LUConstants.COURSE_NUMBER_LABEL_KEY))));
 1194  
          * block.addSummaryMultiplicity(getMultiplicityConfig(COURSE +
 1195  
          * QueryPath.getPathSeparator() + JOINTS,
 1196  
          * LUConstants.JOINT_OFFER_ITEM_LABEL_KEY, Arrays.asList(
 1197  
          * Arrays.asList(CreditCourseJointsConstants.COURSE_ID,
 1198  
          * LUConstants.COURSE_NUMBER_OR_TITLE_LABEL_KEY))));
 1199  
          * block.addSummaryMultiplicity(getMultiplicityConfig(COURSE +
 1200  
          * QueryPath.getPathSeparator() + VERSIONS,
 1201  
          * LUConstants.VERSION_CODE_LABEL_KEY, Arrays.asList(
 1202  
          * Arrays.asList("variationCode", LUConstants.VERSION_CODE_LABEL_KEY),
 1203  
          * Arrays.asList("variationTitle", LUConstants.TITLE_LABEL_KEY))));
 1204  
          */
 1205  0
         courseBriefSection.addSummaryTableFieldBlock(block);
 1206  0
         VerticalSectionView verticalSection = new VerticalSectionView(
 1207  
                 ViewCourseSections.BRIEF, "At a Glance", modelId, false);
 1208  0
         verticalSection.addSection(courseBriefSection);
 1209  
 
 1210  0
         return verticalSection;
 1211  
     }
 1212  
 
 1213  
     public VerticalSectionView generateCourseCatalogSection() {
 1214  0
         VerticalSectionView verticalSection = new VerticalSectionView(
 1215  
                 ViewCourseSections.CATALOG, "Catalog View", modelId, false);
 1216  0
         FieldDescriptorReadOnly catalogField = new FieldDescriptorReadOnly("",
 1217  
                 null, null, new HTML());
 1218  0
         catalogField.hideLabel();
 1219  0
         catalogField.setWidgetBinding(new ModelWidgetBinding<HTML>() {
 1220  
 
 1221  
             @Override
 1222  
             public void setModelValue(HTML widget, DataModel model, String path) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 1223  
                 // TODO Auto-generated method stub
 1224  
 
 1225  0
             }
 1226  
 
 1227  
             @Override
 1228  
             public void setWidgetValue(HTML widget, DataModel model, String path) { //Don't place a breakpoint here:  It will stall debugging for some unknown reason!
 1229  0
                 String code = model.get("code");
 1230  0
                 String title = model.get(COURSE + "/" + COURSE_TITLE);
 1231  0
                 String credits = "";
 1232  0
                 String outcomesKey = COURSE + QueryPath.getPathSeparator()
 1233  
                         + CREDIT_OPTIONS;
 1234  0
                 Data outcomes = model.get(outcomesKey);
 1235  0
                 if (outcomes != null) {
 1236  0
                     Iterator<Property> iter = outcomes.realPropertyIterator();
 1237  0
                     String list = "";
 1238  0
                     ListToTextBinding binding = new ListToTextBinding();
 1239  0
                     while (iter.hasNext()) {
 1240  0
                         Property prop = iter.next();
 1241  0
                         if (prop.getKey() instanceof Integer) {
 1242  0
                             Integer number = (Integer) prop.getKey();
 1243  0
                             Object value = outcomes.get(number);
 1244  0
                             if (value instanceof Data) {
 1245  0
                                 list = list
 1246  
                                         + binding.getStringList(model,
 1247  
                                                 outcomesKey + "/" + number
 1248  
                                                         + "/" + "resultValues")
 1249  
                                         + ", ";
 1250  
                             }
 1251  
                         }
 1252  0
                     }
 1253  
 
 1254  0
                     if (!list.isEmpty()) {
 1255  0
                         list = list.trim();
 1256  0
                         list = list.substring(0, list.length() - 1);
 1257  0
                         credits = "(" + list + ")";
 1258  
                     }
 1259  
                 }
 1260  
 
 1261  0
                 String description = model.get(COURSE + "/"
 1262  
                         + PROPOSAL_DESCRIPTION + "/"
 1263  
                         + RichTextInfoConstants.PLAIN);
 1264  0
                 String catalogText = "<b> " + code + " " + title + " "
 1265  
                         + credits + "</b> " + description + " ";
 1266  0
                 catalogText.replace(" null ", "");
 1267  0
                 catalogText.trim();
 1268  0
                 widget.setHTML(catalogText);
 1269  
 
 1270  0
             }
 1271  
         });
 1272  0
         verticalSection.addField(catalogField);
 1273  
 
 1274  0
         return verticalSection;
 1275  
     }
 1276  
 
 1277  
     public SummaryTableSection getTableSection() {
 1278  0
         return tableSection;
 1279  
     }
 1280  
 }
 1281  
 // KSLAB-1940