use of org.olat.repository.RepositoryService in project OpenOLAT by OpenOLAT.
the class WikiHandler method createResource.
@Override
public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
WikiResource wikiResource = WikiManager.getInstance().createWiki();
OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(wikiResource);
RepositoryEntry re = repositoryService.create(initialAuthor, null, WikiManager.WIKI_RESOURCE_FOLDER_NAME, displayname, description, resource, RepositoryEntry.ACC_OWNERS);
DBFactory.getInstance().commit();
return re;
}
use of org.olat.repository.RepositoryService in project OpenOLAT by OpenOLAT.
the class GlossaryHandler method createResource.
@Override
public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
GlossaryResource glossaryResource = GlossaryManager.getInstance().createGlossary();
OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(glossaryResource);
RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
DBFactory.getInstance().commit();
return re;
}
use of org.olat.repository.RepositoryService in project OpenOLAT by OpenOLAT.
the class GlossaryHandler method importResource.
@Override
public RepositoryEntry importResource(Identity initialAuthor, String initialAuthorAlt, String displayname, String description, boolean withReferences, Locale locale, File file, String filename) {
RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
GlossaryResource glossaryResource = GlossaryManager.getInstance().createGlossary();
OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(glossaryResource);
// copy resources
File glossyPath = GlossaryManager.getInstance().getGlossaryRootFolder(glossaryResource).getBasefile();
FileResource.copyResource(file, filename, glossyPath);
RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
DBFactory.getInstance().commit();
return re;
}
use of org.olat.repository.RepositoryService in project OpenOLAT by OpenOLAT.
the class PodcastHandler method createResource.
@Override
public RepositoryEntry createResource(Identity initialAuthor, String displayname, String description, Object createObject, Locale locale) {
RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
OLATResourceable ores = FeedManager.getInstance().createPodcastResource();
OLATResource resource = OLATResourceManager.getInstance().findOrPersistResourceable(ores);
RepositoryEntry re = repositoryService.create(initialAuthor, null, "", displayname, description, resource, RepositoryEntry.ACC_OWNERS);
DBFactory.getInstance().commit();
return re;
}
use of org.olat.repository.RepositoryService in project OpenOLAT by OpenOLAT.
the class CourseAssessmentWebService method loadUsers.
private List<Identity> loadUsers(ICourse course) {
List<Identity> identities = new ArrayList<Identity>();
List<BusinessGroup> groups = course.getCourseEnvironment().getCourseGroupManager().getAllBusinessGroups();
Set<Long> check = new HashSet<Long>();
BusinessGroupService businessGroupService = CoreSpringFactory.getImpl(BusinessGroupService.class);
List<Identity> participants = businessGroupService.getMembers(groups, GroupRoles.participant.name());
for (Identity participant : participants) {
if (!check.contains(participant.getKey())) {
identities.add(participant);
check.add(participant.getKey());
}
}
RepositoryService repositoryService = CoreSpringFactory.getImpl(RepositoryService.class);
RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(course, false);
if (re != null) {
List<Identity> ids = repositoryService.getMembers(re, GroupRoles.participant.name());
for (Identity id : ids) {
if (!check.contains(id.getKey())) {
identities.add(id);
check.add(id.getKey());
}
}
}
return identities;
}
Aggregations