| 
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CluAssemblerUtils | Line # 48 | 110 | 0% | 31 | 25 | 82.5% | 0.8251748 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (35) | |||
| Result | |||
| 0.6503497 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateMajorDisciplineRemoveRule  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateMajorDisciplineRemoveRule | 1 PASS | |
| 0.61538464 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateVariationsByMajorDiscipline  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateVariationsByMajorDiscipline | 1 PASS | |
| 0.55944055 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testMajorDisciplineVersioning  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testMajorDisciplineVersioning | 1 PASS | |
| 0.48251748 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteVariationsByMajorDiscipline  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteVariationsByMajorDiscipline | 1 PASS | |
| 0.48251748 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateVariationsByMajorDiscipline  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateVariationsByMajorDiscipline | 1 PASS | |
| 0.48251748 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateMajorDiscipline  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateMajorDiscipline | 1 PASS | |
| 0.3986014 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateBaccCredentialProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateBaccCredentialProgram | 1 PASS | |
| 0.3986014 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateMajorDisciplineDeleteRule  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateMajorDisciplineDeleteRule | 1 PASS | |
| 0.3986014 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateMajorDiscipline  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateMajorDiscipline | 1 PASS | |
| 0.36363637 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateBaccCredentialProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateBaccCredentialProgram | 1 PASS | |
| 0.33566433 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteProgramRequirement  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteProgramRequirement | 1 PASS | |
| 0.22377622 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateProgramRequirement  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateProgramRequirement | 1 PASS | |
| 0.22377622 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreditsProgramRequirement  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreditsProgramRequirement | 1 PASS | |
| 0.22377622 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateProgramRequirement  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateProgramRequirement | 1 PASS | |
| 0.22377622 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCoreProgramVersioning  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCoreProgramVersioning | 1 PASS | |
| 0.22377622 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteCoreProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteCoreProgram | 1 PASS | |
| 0.1958042 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateCoreProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateCoreProgram | 1 PASS | |
| 0.16083916 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateCoreProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateCoreProgram | 1 PASS | |
| 0.13286713 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetMajorDiscipline  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetMajorDiscipline | 1 PASS | |
| 0.13286713 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetVariationsByMajorDisciplineId  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetVariationsByMajorDisciplineId | 1 PASS | |
| 0.08391608 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetBaccCredentialProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetBaccCredentialProgram | 1 PASS | |
| 0.08391608 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteBaccCredentialProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteBaccCredentialProgram | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetVersions  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetVersions | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetVersionBySequenceNumber  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetVersionBySequenceNumber | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetProgramRequirement  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetProgramRequirement | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCreditOptions  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCreditOptions | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCurrentVersion  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCurrentVersion | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetFirstVersion  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetFirstVersion | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCurrentVersionOnDate  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCurrentVersionOnDate | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetCoreProgram  org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetCoreProgram | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testUpdateCourse  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testUpdateCourse | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetVersionsInDateRange  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetVersionsInDateRange | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCourseVersioning  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCourseVersioning | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testDeleteCourse  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testDeleteCourse | 1 PASS | |
| 0.062937066 | org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCourse  org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCourse | 1 PASS | |
| 1 | /* | |
| 2 | * Copyright 2007 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 1.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl1.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.student.lum.service.assembler; | |
| 17 | ||
| 18 | import org.kuali.student.core.assembly.BaseDTOAssemblyNode; | |
| 19 | import org.kuali.student.core.assembly.BaseDTOAssemblyNode.NodeOperation; | |
| 20 | import org.kuali.student.core.assembly.data.AssemblyException; | |
| 21 | import org.kuali.student.core.dto.RichTextInfo; | |
| 22 | import org.kuali.student.core.exceptions.DoesNotExistException; | |
| 23 | import org.kuali.student.core.exceptions.InvalidParameterException; | |
| 24 | import org.kuali.student.core.exceptions.MissingParameterException; | |
| 25 | import org.kuali.student.core.exceptions.OperationFailedException; | |
| 26 | import org.kuali.student.lum.course.dto.LoDisplayInfo; | |
| 27 | import org.kuali.student.lum.course.service.assembler.LoAssembler; | |
| 28 | import org.kuali.student.lum.lo.dto.LoInfo; | |
| 29 | import org.kuali.student.lum.lo.service.LearningObjectiveService; | |
| 30 | import org.kuali.student.lum.lu.dto.CluLoRelationInfo; | |
| 31 | import org.kuali.student.lum.lu.dto.CluResultInfo; | |
| 32 | import org.kuali.student.lum.lu.dto.ResultOptionInfo; | |
| 33 | import org.kuali.student.lum.lu.service.LuService; | |
| 34 | ||
| 35 | import java.util.ArrayList; | |
| 36 | import java.util.Date; | |
| 37 | import java.util.HashMap; | |
| 38 | import java.util.List; | |
| 39 | import java.util.Map; | |
| 40 | import java.util.Map.Entry; | |
| 41 | ||
| 42 | /** | |
| 43 | * This is a description of what this class does - jimt don't forget to fill this in. | |
| 44 | * | |
| 45 | * @author Kuali Rice Team (kuali-rice@googlegroups.com) | |
| 46 | * | |
| 47 | */ | |
| 48 | public class CluAssemblerUtils { | |
| 49 | private LuService luService; | |
| 50 | private LearningObjectiveService loService; | |
| 51 | private LoAssembler loAssembler; | |
| 52 | ||
| 53 | 60 |  public List<String> assembleCluResults(List<String> resultTypes, List<CluResultInfo> cluResults) throws AssemblyException{ | 
| 54 | 60 | if(resultTypes==null){ | 
| 55 | 0 | throw new AssemblyException("result types can not be null"); | 
| 56 | } | |
| 57 | 60 | List<String> results = new ArrayList<String>(); | 
| 58 | //Loop through all the CluResults to find those with the matching types | |
| 59 | 60 | for(CluResultInfo cluResult:cluResults){ | 
| 60 | 57 | if(resultTypes.contains(cluResult.getType())){ | 
| 61 | //Loop through all options and add to the list of Strings | |
| 62 | 57 | for(ResultOptionInfo resultOption: cluResult.getResultOptions()){ | 
| 63 | 76 | results.add(resultOption.getResultComponentId()); | 
| 64 | } | |
| 65 | } | |
| 66 | } | |
| 67 | 60 | return results; | 
| 68 | } | |
| 69 | ||
| 70 | 36 |  public BaseDTOAssemblyNode<?, ?> disassembleCluResults(String cluId, | 
| 71 | String cluState, List<String> options, NodeOperation operation, String resultType, | |
| 72 | String resultsDescription, String resultDescription) throws AssemblyException { | |
| 73 | 36 | BaseDTOAssemblyNode<List<String>, CluResultInfo> cluResultNode = new BaseDTOAssemblyNode<List<String>, CluResultInfo>(null); | 
| 74 | 36 | if(resultType==null){ | 
| 75 | 0 | throw new AssemblyException("resultType can not be null"); | 
| 76 | } | |
| 77 | ||
| 78 | // Get the current options and put them in a map of option type id/cluResult | |
| 79 | 36 | Map<String, ResultOptionInfo> currentResults = new HashMap<String, ResultOptionInfo>(); | 
| 80 | ||
| 81 | 36 | CluResultInfo cluResult = null; | 
| 82 | ||
| 83 | //TODO Check this for proper handling of multiple CluResultInfos? | |
| 84 | //If this is not a create, lookup the results for this clu | |
| 85 | 36 | if (!NodeOperation.CREATE.equals(operation)) { | 
| 86 | 25 | try { | 
| 87 | 25 | List<CluResultInfo> cluResultList = luService.getCluResultByClu(cluId); | 
| 88 | ||
| 89 | 25 | for (CluResultInfo currentResult : cluResultList) { | 
| 90 | 18 | if (resultType.equals(currentResult.getType())) { | 
| 91 | 18 | cluResult = currentResult; | 
| 92 | 18 | if(NodeOperation.DELETE.equals(operation)){ | 
| 93 | //if this is a delete, then we only need the CluResultInfo | |
| 94 | 0 | cluResultNode.setOperation(NodeOperation.DELETE); | 
| 95 | }else{ | |
| 96 | //Find all the Result options and store in a map for easy access later | |
| 97 | 18 | cluResultNode.setOperation(NodeOperation.UPDATE); | 
| 98 | 18 | for(ResultOptionInfo resultOption:currentResult.getResultOptions()){ | 
| 99 | 24 | currentResults.put(resultOption.getResultComponentId(), resultOption); | 
| 100 | } | |
| 101 | } | |
| 102 | } | |
| 103 | } | |
| 104 | } catch (DoesNotExistException e) { | |
| 105 | } catch (InvalidParameterException e) { | |
| 106 | 0 | throw new AssemblyException("Error getting related " + resultsDescription, e); | 
| 107 | } catch (MissingParameterException e) { | |
| 108 | 0 | throw new AssemblyException("Error getting related " + resultsDescription, e); | 
| 109 | } catch (OperationFailedException e) { | |
| 110 | 0 | throw new AssemblyException("Error getting related " + resultsDescription, e); | 
| 111 | } | |
| 112 | } | |
| 113 | ||
| 114 | //If this is a delete we don't need the result options, just the CluResultInfo | |
| 115 | 36 | if(!NodeOperation.DELETE.equals(operation)){ | 
| 116 | 36 | if(cluResult == null){ | 
| 117 | //Create a new resultInfo of the given type if one does not exist and set operation to Create | |
| 118 | 18 | cluResult = new CluResultInfo(); | 
| 119 | 18 | cluResult.setCluId(cluId); | 
| 120 | 18 | cluResult.setState(cluState); | 
| 121 | 18 | cluResult.setType(resultType); | 
| 122 | 18 | RichTextInfo desc = new RichTextInfo(); | 
| 123 | 18 | desc.setPlain(resultsDescription); | 
| 124 | 18 | cluResult.setDesc(desc); | 
| 125 | 18 | cluResult.setEffectiveDate(new Date()); | 
| 126 | 18 | cluResultNode.setOperation(NodeOperation.CREATE); | 
| 127 | } | |
| 128 | ||
| 129 | 36 | cluResult.setResultOptions(new ArrayList<ResultOptionInfo>()); | 
| 130 | ||
| 131 | // Loop through all the credit options in this clu | |
| 132 | 36 | for (String optionType : options) { | 
| 133 | 57 | if(currentResults.containsKey(optionType)){ | 
| 134 | //If the option exists already copy it to the new list of result options | |
| 135 | 24 | ResultOptionInfo resultOptionInfo = currentResults.get(optionType); | 
| 136 | 24 | cluResult.getResultOptions().add(resultOptionInfo); | 
| 137 | }else{ | |
| 138 | //Otherwise create a new result option | |
| 139 | 33 | ResultOptionInfo resultOptionInfo = new ResultOptionInfo(); | 
| 140 | 33 | RichTextInfo desc = new RichTextInfo(); | 
| 141 | 33 | desc.setPlain(resultDescription); | 
| 142 | 33 | resultOptionInfo.setDesc(desc); | 
| 143 | 33 | resultOptionInfo.setResultComponentId(optionType); | 
| 144 | 33 | resultOptionInfo.setState(cluState); | 
| 145 | ||
| 146 | 33 | cluResult.getResultOptions().add(resultOptionInfo); | 
| 147 | } | |
| 148 | } | |
| 149 | } | |
| 150 | ||
| 151 | 36 | cluResultNode.setNodeData(cluResult); | 
| 152 | 36 | return cluResultNode; | 
| 153 | } | |
| 154 | ||
| 155 | 96 |  public List<LoDisplayInfo> assembleLos(String cluId, boolean shallowBuild) throws AssemblyException { | 
| 156 | 96 | List<LoDisplayInfo> loInfos = new ArrayList<LoDisplayInfo>(); | 
| 157 | 96 | try { | 
| 158 | 96 | List<CluLoRelationInfo> cluLoRelations = luService.getCluLoRelationsByClu(cluId); | 
| 159 | 96 | for (CluLoRelationInfo cluLoRelation : cluLoRelations) { | 
| 160 | 80 | String loId = cluLoRelation.getLoId(); | 
| 161 | 80 | LoInfo lo = loService.getLo(loId); | 
| 162 | 80 | loInfos.add(loAssembler.assemble(lo, null, shallowBuild)); | 
| 163 | } | |
| 164 | } catch (Exception e) { | |
| 165 | 0 | throw new AssemblyException("Error getting learning objectives", e); | 
| 166 | } | |
| 167 | ||
| 168 | 96 | return loInfos; | 
| 169 | } | |
| 170 | ||
| 171 | 61 |  public List<BaseDTOAssemblyNode<?, ?>> disassembleLos(String cluId, String cluState, List<LoDisplayInfo> loInfos, | 
| 172 | NodeOperation operation) throws AssemblyException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException{ | |
| 173 | // TODO Auto-generated method stub | |
| 174 | 61 | List<BaseDTOAssemblyNode<?, ?>> results = new ArrayList<BaseDTOAssemblyNode<?, ?>>(); | 
| 175 | ||
| 176 | // Get the current formats and put them in a map of format id/relation | |
| 177 | // id | |
| 178 | 61 | Map<String, CluLoRelationInfo> currentCluLoRelations = new HashMap<String, CluLoRelationInfo>(); | 
| 179 | 61 | try { | 
| 180 | 61 | List<CluLoRelationInfo> cluLoRelations = luService.getCluLoRelationsByClu(cluId); | 
| 181 | 61 | for(CluLoRelationInfo cluLoRelation:cluLoRelations){ | 
| 182 | 16 | if(CluAssemblerConstants.CLU_LO_CLU_SPECIFIC_RELATION.equals(cluLoRelation.getType())){ | 
| 183 | 16 | currentCluLoRelations.put(cluLoRelation.getLoId(), cluLoRelation); | 
| 184 | } | |
| 185 | } | |
| 186 | } catch (DoesNotExistException e) { | |
| 187 | } catch (Exception e) { | |
| 188 | 0 | throw new AssemblyException("Error finding related Los", e); | 
| 189 | } | |
| 190 | ||
| 191 | // Loop through all the los in this clu | |
| 192 | 61 | for(LoDisplayInfo loDisplay : loInfos){ | 
| 193 | ||
| 194 | // If this is a clu create/new lo update then all los will be created | |
| 195 | 70 | if (NodeOperation.CREATE == operation | 
| 196 | || (NodeOperation.UPDATE == operation && !currentCluLoRelations.containsKey(loDisplay.getLoInfo().getId()))) { | |
| 197 | ||
| 198 | // the lo does not exist, so create | |
| 199 | // Assemble and add the lo | |
| 200 | 54 | loDisplay.getLoInfo().setId(null); | 
| 201 | 54 | BaseDTOAssemblyNode<LoDisplayInfo, LoInfo> loNode = loAssembler | 
| 202 | .disassemble(loDisplay, NodeOperation.CREATE); | |
| 203 | 54 | results.add(loNode); | 
| 204 | ||
| 205 | // Create the relationship and add it as well | |
| 206 | 54 | CluLoRelationInfo relation = new CluLoRelationInfo(); | 
| 207 | 54 | relation.setCluId(cluId); | 
| 208 | 54 | relation.setLoId(loNode.getNodeData().getId()); | 
| 209 | 54 | relation.setType(CluAssemblerConstants.CLU_LO_CLU_SPECIFIC_RELATION); | 
| 210 | 54 | relation.setState(cluState); | 
| 211 | ||
| 212 | 54 | BaseDTOAssemblyNode<LoDisplayInfo, CluLoRelationInfo> relationNode = new BaseDTOAssemblyNode<LoDisplayInfo, CluLoRelationInfo>( | 
| 213 | null); | |
| 214 | 54 | relationNode.setNodeData(relation); | 
| 215 | 54 | relationNode.setOperation(NodeOperation.CREATE); | 
| 216 | ||
| 217 | 54 | results.add(relationNode); | 
| 218 | 16 | } else if (NodeOperation.UPDATE == operation | 
| 219 | && currentCluLoRelations.containsKey(loDisplay.getLoInfo().getId())) { | |
| 220 | // If the clu already has this lo, then just update the lo | |
| 221 | 14 | BaseDTOAssemblyNode<LoDisplayInfo, LoInfo> loNode = loAssembler | 
| 222 | .disassemble(loDisplay, NodeOperation.UPDATE); | |
| 223 | 14 | results.add(loNode); | 
| 224 | ||
| 225 | // remove this entry from the map so we can tell what needs to | |
| 226 | // be deleted at the end | |
| 227 | 14 | currentCluLoRelations.remove(loDisplay.getLoInfo().getId()); | 
| 228 | 2 | } else if (NodeOperation.DELETE == operation | 
| 229 | && currentCluLoRelations.containsKey(loDisplay.getLoInfo().getId())) { | |
| 230 | ||
| 231 | // Delete the Format and its relation | |
| 232 | 2 | CluLoRelationInfo relationToDelete = currentCluLoRelations.get(loDisplay.getLoInfo().getId()); | 
| 233 | 2 | BaseDTOAssemblyNode<LoDisplayInfo, CluLoRelationInfo> relationToDeleteNode = new BaseDTOAssemblyNode<LoDisplayInfo, CluLoRelationInfo>( | 
| 234 | null); | |
| 235 | 2 | relationToDeleteNode.setNodeData(relationToDelete); | 
| 236 | 2 | relationToDeleteNode.setOperation(NodeOperation.DELETE); | 
| 237 | 2 | results.add(relationToDeleteNode); | 
| 238 | ||
| 239 | 2 | BaseDTOAssemblyNode<LoDisplayInfo, LoInfo> loNode = loAssembler | 
| 240 | .disassemble(loDisplay, NodeOperation.DELETE); | |
| 241 | 2 | results.add(loNode); | 
| 242 | ||
| 243 | // remove this entry from the map so we can tell what needs to | |
| 244 | // be deleted at the end | |
| 245 | 2 | currentCluLoRelations.remove(loDisplay.getLoInfo().getId()); | 
| 246 | } | |
| 247 | } | |
| 248 | ||
| 249 | // Now any leftover lo ids are no longer needed, so delete | |
| 250 | // los and relations | |
| 251 | 61 | for (Entry<String, CluLoRelationInfo> entry : currentCluLoRelations.entrySet()) { | 
| 252 | // Create a new relation with the id of the relation we want to | |
| 253 | // delete | |
| 254 | 0 | CluLoRelationInfo relationToDelete = entry.getValue(); | 
| 255 | 0 | BaseDTOAssemblyNode<LoDisplayInfo, CluLoRelationInfo> relationToDeleteNode = new BaseDTOAssemblyNode<LoDisplayInfo, CluLoRelationInfo>( | 
| 256 | null); | |
| 257 | 0 | relationToDeleteNode.setNodeData(relationToDelete); | 
| 258 | 0 | relationToDeleteNode.setOperation(NodeOperation.DELETE); | 
| 259 | 0 | results.add(relationToDeleteNode); | 
| 260 | ||
| 261 | 0 | LoInfo loToDelete = loService.getLo(entry.getKey()); | 
| 262 | 0 | LoDisplayInfo loDisplayToDelete = loAssembler.assemble(loToDelete, null, false); | 
| 263 | 0 | BaseDTOAssemblyNode<LoDisplayInfo, LoInfo> loNode = loAssembler | 
| 264 | .disassemble(loDisplayToDelete, NodeOperation.DELETE); | |
| 265 | 0 | results.add(loNode); | 
| 266 | } | |
| 267 | ||
| 268 | 61 | return results; | 
| 269 | } | |
| 270 | ||
| 271 | // Spring setters | |
| 272 | 2 |  public void setLuService(LuService luService) { | 
| 273 | 2 | this.luService = luService; | 
| 274 | } | |
| 275 | ||
| 276 | 2 |  public void setLoService(LearningObjectiveService loService) { | 
| 277 | 2 | this.loService = loService; | 
| 278 | } | |
| 279 | ||
| 280 | 2 |  public void setLoAssembler(LoAssembler loAssembler) { | 
| 281 | 2 | this.loAssembler = loAssembler; | 
| 282 | } | |
| 283 | } | |
| 
 | ||||||||||||