use of org.olat.repository.RepositoryEntryRef in project openolat by klemens.
the class BusinessGroupMembershipProcessor method processResourceRemoved.
private void processResourceRemoved(Long groupKey, Long repoKey) {
BusinessGroupRef groupRef = new BusinessGroupRefImpl(groupKey);
RepositoryEntryRef entryRef = new RepositoryEntryRefImpl(repoKey);
OLATResource resource = repositoryManager.lookupRepositoryEntryResource(entryRef.getKey());
List<Long> memberKeys = businessGroupRelationDao.getMemberKeys(Collections.singletonList(groupRef), GroupRoles.coach.name(), GroupRoles.participant.name());
for (Long memberKey : memberKeys) {
IdentityRef member = new IdentityRefImpl(memberKey);
List<String> remaingRoles = repositoryEntryRelationDao.getRoles(member, entryRef);
if (remaingRoles.isEmpty()) {
notificationsManager.unsubscribeAllForIdentityAndResId(member, resource.getResourceableId());
}
}
}
use of org.olat.repository.RepositoryEntryRef in project openolat by klemens.
the class AuditLogFormatter method log.
protected static void log(CandidateEvent candidateEvent, Map<Identifier, AssessmentResponse> candidateResponseMap, Writer writer) throws IOException {
writer.append("QTI21 audit [");
AssessmentTestSession testSession = candidateEvent.getCandidateSession();
if (testSession != null) {
RepositoryEntryRef testEntry = candidateEvent.getTestEntry();
RepositoryEntryRef courseEntry = candidateEvent.getRepositoryEntry();
if (courseEntry != null && !testEntry.getKey().equals(courseEntry.getKey())) {
writer.write(courseEntry.getKey().toString());
writer.write(":");
if (testSession.getSubIdent() == null) {
writer.write("NULL:");
} else {
writer.write(testSession.getSubIdent());
writer.write(":");
}
}
if (testEntry != null) {
writer.write(testEntry.getKey().toString());
}
}
writer.write("] ");
if (candidateEvent.getTestEventType() != null) {
writer.append("TestEvent:");
writer.append(candidateEvent.getTestEventType().toString());
writer.write(" ");
}
if (candidateEvent.getItemEventType() != null) {
writer.append("ItemEvent:");
writer.append(candidateEvent.getItemEventType().toString());
writer.write(" ");
}
if (candidateEvent.getTestItemKey() != null) {
writer.append("TestItemKey[");
writer.append(candidateEvent.getTestItemKey());
writer.write("] ");
}
if (candidateResponseMap != null) {
writer.write("params=");
for (Map.Entry<Identifier, AssessmentResponse> responseEntry : candidateResponseMap.entrySet()) {
Identifier identifier = responseEntry.getKey();
AssessmentResponse response = responseEntry.getValue();
writer.append("|");
writer.append(identifier.toString());
writer.append("=");
String stringuifiedResponse = response.getStringuifiedResponse();
if (stringuifiedResponse == null) {
writer.append("NULL");
} else {
writer.append(stringuifiedResponse);
}
}
}
}
Aggregations