| 1 | 
    
            
    
     | 
    
           | 
  
            
  
    | 2 | 
    
            
    
     | 
    
           | 
  
            
  
    | 3 | 
    
            
    
     | 
    
           | 
  
            
  
    | 4 | 
    
            
    
     | 
    
           | 
  
            
  
    | 5 | 
    
            
    
     | 
    
           | 
  
            
  
    | 6 | 
    
            
    
     | 
    
           | 
  
            
  
    | 7 | 
    
            
    
     | 
    
           | 
  
            
  
    | 8 | 
    
            
    
     | 
    
           | 
  
            
  
    | 9 | 
    
            
    
     | 
    
           | 
  
            
  
    | 10 | 
    
            
    
     | 
    
           | 
  
            
  
    | 11 | 
    
            
    
     | 
    
           | 
  
            
  
    | 12 | 
    
            
    
     | 
    
           | 
  
            
  
    | 13 | 
    
            
    
     | 
    
           | 
  
            
  
    | 14 | 
    
            
    
     | 
    
           | 
  
            
  
    | 15 | 
    
            
    
     | 
    
           | 
  
            
  
    | 16 | 
    
            
    
     | 
    
      package org.kuali.student.lum.course.service.assembler;     | 
  
            
  
    | 17 | 
    
            
    
     | 
    
           | 
  
            
  
    | 18 | 
    
            
    
     | 
    
      import org.kuali.student.common.assembly.BOAssembler;     | 
  
            
  
    | 19 | 
    
            
    
     | 
    
      import org.kuali.student.common.assembly.BaseDTOAssemblyNode;     | 
  
            
  
    | 20 | 
    
            
    
     | 
    
      import org.kuali.student.common.assembly.BaseDTOAssemblyNode.NodeOperation;     | 
  
            
  
    | 21 | 
    
            
    
     | 
    
      import org.kuali.student.common.assembly.data.AssemblyException;     | 
  
            
  
    | 22 | 
    
            
    
     | 
    
      import org.kuali.student.common.dto.DtoConstants;     | 
  
            
  
    | 23 | 
    
            
    
     | 
    
      import org.kuali.student.common.util.UUIDHelper;     | 
  
            
  
    | 24 | 
    
            
    
     | 
    
      import org.kuali.student.lum.course.dto.CourseJointInfo;     | 
  
            
  
    | 25 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lu.dto.CluCluRelationInfo;     | 
  
            
  
    | 26 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lu.dto.CluInfo;     | 
  
            
  
    | 27 | 
    
            
    
     | 
    
      import org.kuali.student.lum.lu.service.LuService;     | 
  
            
  
    | 28 | 
    
            
    
     | 
    
           | 
  
            
  
    | 29 | 
    
            
    
     | 
    
           | 
  
            
  
    | 30 | 
    
            
    
     | 
    
           | 
  
            
  
    | 31 | 
    
            
    
     | 
    
           | 
  
            
  
    | 32 | 
    
            
    
     | 
    
      @author     | 
  
            
  
    | 33 | 
    
            
    
     | 
    
           | 
  
            
  
    | 34 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 3.3% | 
           Uncovered Elements: 58 (60) | 
           Complexity: 16 | 
           Complexity Density: 0.37 | 
                        
            
        | 
    
  
  
    | 35 | 
    
            
    
     | 
    
      public class CourseJointAssembler implements BOAssembler<CourseJointInfo, CluCluRelationInfo> {     | 
  
            
  
    | 36 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 37 | 
    
            
    
     | 
    
          LuService luService;             | 
  
            
  
    | 38 | 
    
            
    
     | 
    
               | 
  
            
  
    | 39 | 
    
            
    
     | 
    
               | 
  
            
  
    | 40 | 
    
            
    
     | 
    
      @return     | 
  
            
  
    | 41 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 1 (1) | 
           Complexity: 1 | 
           Complexity Density: 1 | 
                        
            
        | 
    
  
  
    | 42 | 
    
           0
    
     | 
    
           public LuService getLuService() {...     | 
  
            
  
    | 43 | 
    
           0
    
     | 
    
              return luService;     | 
  
            
  
    | 44 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 45 | 
    
            
    
     | 
    
           | 
  
            
  
    | 46 | 
    
            
    
     | 
    
               | 
  
            
  
    | 47 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 48 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 100% | 
           Uncovered Elements: 0 (1) | 
           Complexity: 1 | 
           Complexity Density: 1 | 
                        
            
        | 
    
  
  
    | 49 | 
    
           1
    
     | 
    
           public void setLuService(LuService luService) {...     | 
  
            
  
    | 50 | 
    
           1
    
     | 
    
              this.luService = luService;     | 
  
            
  
    | 51 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 52 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 18 (18) | 
           Complexity: 4 | 
           Complexity Density: 0.29 | 
                        
            
        | 
    
  
  
    | 53 | 
    
           0
    
     | 
    
           @Override...     | 
  
            
  
    | 54 | 
    
            
    
     | 
    
          public CourseJointInfo assemble(CluCluRelationInfo cluRel, CourseJointInfo jointInfo, boolean shallowBuild) throws AssemblyException {     | 
  
            
  
    | 55 | 
    
           0
    
     | 
    
              if(null == cluRel) {     | 
  
            
  
    | 56 | 
    
           0
    
     | 
    
                  return null;     | 
  
            
  
    | 57 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 58 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 59 | 
    
           0
    
     | 
    
              CourseJointInfo joint = (jointInfo != null) ? jointInfo : new CourseJointInfo();     | 
  
            
  
    | 60 | 
    
            
    
     | 
    
           | 
  
            
  
    | 61 | 
    
           0
    
     | 
    
              CluInfo clu;     | 
  
            
  
    | 62 | 
    
           0
    
     | 
    
              try {     | 
  
            
  
    | 63 | 
    
           0
    
     | 
    
                  clu = luService.getClu(cluRel.getRelatedCluId());     | 
  
            
  
    | 64 | 
    
            
    
     | 
    
           | 
  
            
  
    | 65 | 
    
           0
    
     | 
    
                  joint.setCourseId(clu.getId());     | 
  
            
  
    | 66 | 
    
           0
    
     | 
    
                  joint.setType(clu.getType());     | 
  
            
  
    | 67 | 
    
           0
    
     | 
    
                  joint.setSubjectArea(clu.getOfficialIdentifier().getDivision());     | 
  
            
  
    | 68 | 
    
           0
    
     | 
    
                  joint.setCourseTitle(clu.getOfficialIdentifier().getLongName());     | 
  
            
  
    | 69 | 
    
           0
    
     | 
    
                  joint.setCourseNumberSuffix(clu.getOfficialIdentifier().getSuffixCode());     | 
  
            
  
    | 70 | 
    
           0
    
     | 
    
                  joint.setRelationId(cluRel.getId());     | 
  
            
  
    | 71 | 
    
            
    
     | 
    
           | 
  
            
  
    | 72 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 73 | 
    
           0
    
     | 
    
                  throw new AssemblyException("Error getting related clus", e);     | 
  
            
  
    | 74 | 
    
            
    
     | 
    
              }      | 
  
            
  
    | 75 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 76 | 
    
           0
    
     | 
    
              return joint;     | 
  
            
  
    | 77 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 78 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 22 (22) | 
           Complexity: 8 | 
           Complexity Density: 0.5 | 
                        
            
        | 
    
  
  
    | 79 | 
    
           0
    
     | 
    
           public CourseJointInfo assemble(CluCluRelationInfo cluRel, String cluId, CourseJointInfo jointInfo, boolean shallowBuild) throws AssemblyException {...     | 
  
            
  
    | 80 | 
    
           0
    
     | 
    
              if(null == cluRel) {     | 
  
            
  
    | 81 | 
    
           0
    
     | 
    
                  return null;     | 
  
            
  
    | 82 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 83 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 84 | 
    
           0
    
     | 
    
              CourseJointInfo joint = (jointInfo != null) ? jointInfo : new CourseJointInfo();     | 
  
            
  
    | 85 | 
    
            
    
     | 
    
           | 
  
            
  
    | 86 | 
    
           0
    
     | 
    
              CluInfo clu;     | 
  
            
  
    | 87 | 
    
           0
    
     | 
    
              try {     | 
  
            
  
    | 88 | 
    
           0
    
     | 
    
                  clu = luService.getClu(cluId);     | 
  
            
  
    | 89 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 90 | 
    
           0
    
     | 
    
                  if (clu.getState().equals(DtoConstants.STATE_ACTIVE) || clu.getState().equals(DtoConstants.STATE_SUPERSEDED) ||     | 
  
            
  
    | 91 | 
    
            
    
     | 
    
                      clu.getState().equals(DtoConstants.STATE_APPROVED) || clu.getState().equals(DtoConstants.STATE_SUSPENDED)) {     | 
  
            
  
    | 92 | 
    
           0
    
     | 
    
                      joint.setCourseId(clu.getId());     | 
  
            
  
    | 93 | 
    
           0
    
     | 
    
                      joint.setType(clu.getType());     | 
  
            
  
    | 94 | 
    
           0
    
     | 
    
                      joint.setSubjectArea(clu.getOfficialIdentifier().getDivision());     | 
  
            
  
    | 95 | 
    
           0
    
     | 
    
                      joint.setCourseTitle(clu.getOfficialIdentifier().getLongName());     | 
  
            
  
    | 96 | 
    
           0
    
     | 
    
                      joint.setCourseNumberSuffix(clu.getOfficialIdentifier().getSuffixCode());     | 
  
            
  
    | 97 | 
    
           0
    
     | 
    
                      joint.setRelationId(cluRel.getId());     | 
  
            
  
    | 98 | 
    
            
    
     | 
    
                  } else         | 
  
            
  
    | 99 | 
    
           0
    
     | 
    
                      return null;     | 
  
            
  
    | 100 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 101 | 
    
            
    
     | 
    
              } catch (Exception e) {     | 
  
            
  
    | 102 | 
    
           0
    
     | 
    
                  throw new AssemblyException("Error getting related clus", e);     | 
  
            
  
    | 103 | 
    
            
    
     | 
    
              }      | 
  
            
  
    | 104 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 105 | 
    
           0
    
     | 
    
              return joint;     | 
  
            
  
    | 106 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 107 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 13 (13) | 
           Complexity: 2 | 
           Complexity Density: 0.18 | 
                        
            
        | 
    
  
  
    | 108 | 
    
           0
    
     | 
    
           @Override...     | 
  
            
  
    | 109 | 
    
            
    
     | 
    
          public BaseDTOAssemblyNode<CourseJointInfo, CluCluRelationInfo> disassemble(     | 
  
            
  
    | 110 | 
    
            
    
     | 
    
                  CourseJointInfo joint, NodeOperation operation) throws AssemblyException {     | 
  
            
  
    | 111 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 112 | 
    
           0
    
     | 
    
              if(null == joint){     | 
  
            
  
    | 113 | 
    
            
    
     | 
    
                       | 
  
            
  
    | 114 | 
    
           0
    
     | 
    
                  throw new AssemblyException("Activity can not be null");     | 
  
            
  
    | 115 | 
    
            
    
     | 
    
              }     | 
  
            
  
    | 116 | 
    
            
    
     | 
    
                           | 
  
            
  
    | 117 | 
    
           0
    
     | 
    
              BaseDTOAssemblyNode<CourseJointInfo, CluCluRelationInfo> result = new BaseDTOAssemblyNode<CourseJointInfo, CluCluRelationInfo>(this);     | 
  
            
  
    | 118 | 
    
           0
    
     | 
    
              result.setBusinessDTORef(joint);     | 
  
            
  
    | 119 | 
    
           0
    
     | 
    
              result.setOperation(operation);     | 
  
            
  
    | 120 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 121 | 
    
           0
    
     | 
    
              CluCluRelationInfo cluRel = new CluCluRelationInfo();     | 
  
            
  
    | 122 | 
    
           0
    
     | 
    
              cluRel.setId(UUIDHelper.genStringUUID(joint.getRelationId()));     | 
  
            
  
    | 123 | 
    
           0
    
     | 
    
              cluRel.setRelatedCluId(joint.getCourseId());     | 
  
            
  
    | 124 | 
    
           0
    
     | 
    
              cluRel.setType(CourseAssemblerConstants.JOINT_RELATION_TYPE);     | 
  
            
  
    | 125 | 
    
           0
    
     | 
    
              result.setNodeData(cluRel);     | 
  
            
  
    | 126 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 127 | 
    
            
    
     | 
    
                   | 
  
            
  
    | 128 | 
    
           0
    
     | 
    
              return result;     | 
  
            
  
    | 129 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 130 | 
    
            
    
     | 
    
      }     |