@Test(expected = AcmParticipantsException.class) public void testSetFileParticipantsThrowsAcmParticipantsExceptionOnNullParticipantType() throws AcmParticipantsException { final Long objectId = 1L; final String participantLdapId = "userId"; final String participantType1 = null; List<AcmParticipant> participants = new ArrayList<>(); AcmParticipant participant1 = new AcmParticipant(); participant1.setParticipantLdapId(participantLdapId); participant1.setParticipantType(participantType1); participant1.setReplaceChildrenParticipant(true); participants.add(participant1); fileParticipantService.setFileParticipants(objectId, participants); fail("AcmParticipantsException should have been thrown!"); }
@Transactional(rollbackFor = Exception.class) public List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants) throws AcmParticipantsException { validateFileParticipants(participants); EcmFile file = getFileDao().find(objectId); setFileParticipants(file, participants); file.setModified(new Date()); EcmFile savedFile = getFileDao().save(file); getFileDao().getEm().flush(); return savedFile.getParticipants(); }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants) throws AcmParticipantsException { validateFileParticipants(participants); EcmFile file = getFileDao().find(objectId); setFileParticipants(file, participants); file.setModified(new Date()); EcmFile savedFile = getFileDao().save(file); getFileDao().getEm().flush(); return savedFile.getParticipants(); } }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants) throws AcmParticipantsException { validateFileParticipants(participants); EcmFile file = getFileDao().find(objectId); setFileParticipants(file, participants); file.setModified(new Date()); EcmFile savedFile = getFileDao().save(file); getFileDao().getEm().flush(); return savedFile.getParticipants(); }  }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants) throws AcmParticipantsException { validateFileParticipants(participants); EcmFile file = getFileDao().find(objectId); setFileParticipants(file, participants); file.setModified(new Date()); EcmFile savedFile = getFileDao().save(file); getFileDao().getEm().flush(); return savedFile.getParticipants(); }  @Transactional(rollbackFor = Exception.class) EcmFile setFileParticipantsFromParentFolder(EcmFile file); @Transactional(rollbackFor = Exception.class) void setFolderParticipantsFromParentFolder(AcmFolder folder); List<AcmParticipant> getFolderParticipantsFromParentAssignedObject(String objectType, Long objectId); List<AcmParticipant> getFolderParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants); @Transactional(rollbackFor = Exception.class) void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants,
            List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFolderParticipants(Long objectId, List<AcmParticipant> participants); EcmFileDao getFileDao(); void setFileDao(EcmFileDao fileDao); AcmParticipantService getParticipantService(); void setParticipantService(AcmParticipantService participantService); AcmFolderService getFolderService(); void setFolderService(AcmFolderService folderService); EcmFileParticipantServiceHelper getFileParticipantServiceHelper(); void setFileParticipantServiceHelper(EcmFileParticipantServiceHelper fileParticipantServiceHelper); AcmFolderDao getFolderDao(); void setFolderDao(AcmFolderDao folderDao); EcmFileConfig getEcmFileConfig(); void setEcmFileConfig(EcmFileConfig ecmFileConfig); }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants) throws AcmParticipantsException { validateFileParticipants(participants); EcmFile file = getFileDao().find(objectId); setFileParticipants(file, participants); file.setModified(new Date()); EcmFile savedFile = getFileDao().save(file); getFileDao().getEm().flush(); return savedFile.getParticipants(); }  @Transactional(rollbackFor = Exception.class) EcmFile setFileParticipantsFromParentFolder(EcmFile file); @Transactional(rollbackFor = Exception.class) void setFolderParticipantsFromParentFolder(AcmFolder folder); List<AcmParticipant> getFolderParticipantsFromParentAssignedObject(String objectType, Long objectId); List<AcmParticipant> getFolderParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants); @Transactional(rollbackFor = Exception.class) void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants,
            List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFolderParticipants(Long objectId, List<AcmParticipant> participants); EcmFileDao getFileDao(); void setFileDao(EcmFileDao fileDao); AcmParticipantService getParticipantService(); void setParticipantService(AcmParticipantService participantService); AcmFolderService getFolderService(); void setFolderService(AcmFolderService folderService); EcmFileParticipantServiceHelper getFileParticipantServiceHelper(); void setFileParticipantServiceHelper(EcmFileParticipantServiceHelper fileParticipantServiceHelper); AcmFolderDao getFolderDao(); void setFolderDao(AcmFolderDao folderDao); EcmFileConfig getEcmFileConfig(); void setEcmFileConfig(EcmFileConfig ecmFileConfig);  }