Clover Coverage Report - Kuali Student 1.3.0-SNAPSHOT (Aggregated)
Coverage timestamp: Thu Apr 28 2011 05:03:32 EDT
../../../../../../img/srcFileCovDistChart0.png 2% of files have more coverage
18   64   8   3.6
6   48   0.44   5
5     1.6  
1    
 
  AbstractProgramConfigurer       Line # 16 18 0% 8 29 0% 0.0
 
No Tests
 
1    package org.kuali.student.lum.program.client;
2   
3    import java.util.ArrayList;
4   
5    import org.kuali.student.common.ui.client.configurable.mvc.Configurer;
6    import org.kuali.student.common.ui.client.mvc.DataModel;
7    import org.kuali.student.lum.common.client.configuration.AbstractControllerConfiguration;
8    import org.kuali.student.lum.common.client.configuration.Configuration;
9    import org.kuali.student.lum.common.client.configuration.ConfigurationManager;
10    import org.kuali.student.lum.program.client.major.edit.MajorSummaryConfiguration;
11    import org.kuali.student.lum.program.client.properties.ProgramProperties;
12   
13    /**
14    * @author Igor
15    */
 
16    public abstract class AbstractProgramConfigurer extends Configurer {
17   
18    private ProgramController programController;
19   
20    protected ConfigurationManager programSectionConfigManager;
21   
 
22  0 toggle public void configure(ProgramController viewController) {
23  0 this.programController = viewController;
24  0 configureProgramSections();
25    }
26   
27    /**
28    * Configures menu for Program Sections
29    */
 
30  0 toggle private void configureProgramSections() {
31  0 String programSectionLabel = ProgramProperties.get().program_menu_sections();
32  0 programController.addMenu(programSectionLabel);
33  0 ArrayList<Configuration> configurations = programSectionConfigManager.getConfigurations();
34  0 for (Configuration configuration : configurations) {
35  0 if (configuration instanceof AbstractControllerConfiguration) {
36  0 ((AbstractControllerConfiguration) configuration).setController(programController);
37    }
38  0 if (configuration instanceof MajorSummaryConfiguration) {
39  0 programController.addSpecialMenuItem(configuration.getView(), programSectionLabel);
40    } else {
41  0 programController.addMenuItem(programSectionLabel, configuration.getView());
42    }
43    }
44    }
45   
 
46  0 toggle public ProgramController getProgramController() {
47  0 return programController;
48    }
49   
 
50  0 toggle public void applyPermissions() {
51  0 DataModel dataModel = programController.getProgramModel();
52  0 for (Configuration configuration : programSectionConfigManager.getConfigurations()) {
53  0 if (configuration.checkPermission(dataModel)) {
54  0 configuration.applyRestrictions();
55    }else{
56  0 configuration.removeRestrictions();
57    }
58    }
59    }
60   
 
61  0 toggle public ConfigurationManager getProgramSectionConfigManager() {
62  0 return programSectionConfigManager;
63    }
64    }