use of org.olat.repository.model.RepositoryEntryRefImpl in project openolat by klemens.
the class RepositoryEntryMembershipProcessor method processIdentityRemoved.
private void processIdentityRemoved(Long repoKey, Long identityKey) {
IdentityRef identity = new IdentityRefImpl(identityKey);
RepositoryEntryRef re = new RepositoryEntryRefImpl(repoKey);
List<String> remainingRoles = repositoryEntryRelationDao.getRoles(identity, re);
if (remainingRoles.isEmpty()) {
OLATResource resource = repositoryManager.lookupRepositoryEntryResource(repoKey);
notificationsManager.unsubscribeAllForIdentityAndResId(identity, resource.getResourceableId());
}
}
use of org.olat.repository.model.RepositoryEntryRefImpl in project openolat by klemens.
the class BusinessGroupMembershipProcessor method processIdentityRemoved.
private void processIdentityRemoved(Long groupKey, Long identityKey) {
IdentityRef identityRef = new IdentityRefImpl(identityKey);
BusinessGroupRef groupRef = new BusinessGroupRefImpl(groupKey);
if (!businessGroupRelationDao.hasAnyRole(identityRef, groupRef)) {
infoMessageManager.updateInfoMessagesOfIdentity(groupRef, identityRef);
notificationsManager.unsubscribeAllForIdentityAndResId(identityRef, groupRef.getKey());
List<BGRepositoryEntryRelation> relations = businessGroupRelationDao.findRelationToRepositoryEntries(Collections.singletonList(groupKey), 0, -1);
for (BGRepositoryEntryRelation relation : relations) {
Long repositoryEntryKey = relation.getRepositoryEntryKey();
RepositoryEntryRef entryRef = new RepositoryEntryRefImpl(repositoryEntryKey);
List<String> remaingRoles = repositoryEntryRelationDao.getRoles(identityRef, entryRef);
if (remaingRoles.isEmpty()) {
OLATResource resource = repositoryManager.lookupRepositoryEntryResource(entryRef.getKey());
notificationsManager.unsubscribeAllForIdentityAndResId(identityRef, resource.getResourceableId());
}
}
}
}
use of org.olat.repository.model.RepositoryEntryRefImpl in project OpenOLAT by OpenOLAT.
the class RepositoryEntryMembershipProcessor method processIdentityRemoved.
private void processIdentityRemoved(Long repoKey, Long identityKey) {
IdentityRef identity = new IdentityRefImpl(identityKey);
RepositoryEntryRef re = new RepositoryEntryRefImpl(repoKey);
List<String> remainingRoles = repositoryEntryRelationDao.getRoles(identity, re);
if (remainingRoles.isEmpty()) {
OLATResource resource = repositoryManager.lookupRepositoryEntryResource(repoKey);
notificationsManager.unsubscribeAllForIdentityAndResId(identity, resource.getResourceableId());
}
}
use of org.olat.repository.model.RepositoryEntryRefImpl in project OpenOLAT by OpenOLAT.
the class BusinessGroupMembershipProcessor method processIdentityRemoved.
private void processIdentityRemoved(Long groupKey, Long identityKey) {
IdentityRef identityRef = new IdentityRefImpl(identityKey);
BusinessGroupRef groupRef = new BusinessGroupRefImpl(groupKey);
if (!businessGroupRelationDao.hasAnyRole(identityRef, groupRef)) {
infoMessageManager.updateInfoMessagesOfIdentity(groupRef, identityRef);
notificationsManager.unsubscribeAllForIdentityAndResId(identityRef, groupRef.getKey());
List<BGRepositoryEntryRelation> relations = businessGroupRelationDao.findRelationToRepositoryEntries(Collections.singletonList(groupKey), 0, -1);
for (BGRepositoryEntryRelation relation : relations) {
Long repositoryEntryKey = relation.getRepositoryEntryKey();
RepositoryEntryRef entryRef = new RepositoryEntryRefImpl(repositoryEntryKey);
List<String> remaingRoles = repositoryEntryRelationDao.getRoles(identityRef, entryRef);
if (remaingRoles.isEmpty()) {
OLATResource resource = repositoryManager.lookupRepositoryEntryResource(entryRef.getKey());
notificationsManager.unsubscribeAllForIdentityAndResId(identityRef, resource.getResourceableId());
}
}
}
}
use of org.olat.repository.model.RepositoryEntryRefImpl in project openolat by klemens.
the class EfficiencyStatementManager method deleteEfficiencyStatement.
/**
* Delete the given efficiency statement for this person
* @param identity
* @param efficiencyStatement
*/
protected void deleteEfficiencyStatement(Identity identity, EfficiencyStatement efficiencyStatement) {
RepositoryEntryRef ref = new RepositoryEntryRefImpl(efficiencyStatement.getCourseRepoEntryKey());
UserEfficiencyStatement s = getUserEfficiencyStatementLightByRepositoryEntry(ref, identity);
if (s != null) {
dbInstance.getCurrentEntityManager().remove(s);
}
}
Aggregations