use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doSearchMyCoursesStudent.
private void doSearchMyCoursesStudent(UserRequest ureq, String limitType, boolean updateFilters) {
searchType = SearchType.myAsStudent;
RepositoryManager rm = RepositoryManager.getInstance();
List<RepositoryEntry> entries = rm.getLearningResourcesAsStudent(ureq.getIdentity(), null, 0, -1);
filterRepositoryEntries(entries);
doSearchMyRepositoryEntries(ureq, entries, limitType, updateFilters);
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doSearchByOwnerLimitTypeInternal.
private void doSearchByOwnerLimitTypeInternal(Identity owner, String[] limitTypes, boolean updateFilters) {
searchType = SearchType.byOwner;
RepositoryManager rm = RepositoryManager.getInstance();
List<RepositoryEntry> entries = rm.queryByOwner(owner, limitTypes);
filterRepositoryEntries(entries);
if (updateFilters) {
updateFilters(entries, owner);
}
repoTableModel.setObjects(entries);
tableCtr.modelChanged(updateFilters);
displaySearchResults(null);
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class WikiEditController method getWikiReference.
/**
* @param config the moduleConfig
* @param strict an assertion exception is thrown if no entry is found when
* strict is set to true, otherwise, null is returned
* @return the repositoryentry or null if not in strict mode and no entry
* found
* @throws AssertException when in strict mode and no entry is found
*/
public static RepositoryEntry getWikiReference(ModuleConfiguration config, boolean strict) {
if (config == null) {
if (strict)
throw new AssertException("missing config in Wiki");
else
return null;
}
String repoSoftkey = (String) config.get(WikiEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
if (repoSoftkey == null) {
if (strict)
throw new AssertException("invalid config when being asked for references");
else
return null;
}
RepositoryManager rm = RepositoryManager.getInstance();
RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repoSoftkey, strict);
// entry can be null only if !strict
return entry;
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class WikiEditController method getWikiRepoReference.
/**
* @param config the moduleConfig
* @param strict an assertion exception is thrown if no entry is found when
* strict is set to true, otherwise, null is returned
* @return the repositoryentry or null if not in strict mode and no entry
* found
* @throws AssertException when in strict mode and no entry is found
*/
public static RepositoryEntry getWikiRepoReference(ModuleConfiguration config, boolean strict) {
if (config == null)
throw new AssertException("missing config in wiki course node");
String repoSoftkey = (String) config.get(WikiEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
if (repoSoftkey == null)
throw new AssertException("invalid config when being asked for references");
RepositoryManager rm = RepositoryManager.getInstance();
RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repoSoftkey, strict);
// entry can be null only if !strict
return entry;
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class PublishProcess method changeAccessAndProperties.
public void changeAccessAndProperties(Identity author, CourseAccessAndProperties accessAndProps) {
RepositoryManager manager = RepositoryManager.getInstance();
manager.setAccessAndProperties(accessAndProps.getRepositoryEntry(), accessAndProps.getAccess(), accessAndProps.isMembersOnly(), accessAndProps.isCanCopy(), accessAndProps.isCanReference(), accessAndProps.isCanDownload());
manager.setLeaveSetting(accessAndProps.getRepositoryEntry(), accessAndProps.getSetting());
List<OfferAccess> offerAccess = accessAndProps.getOfferAccess();
// 1: add new and update existing offerings
ACService acService = CoreSpringFactory.getImpl(ACService.class);
for (OfferAccess newLink : offerAccess) {
if (accessAndProps.getConfirmationEmail() != null) {
Offer offer = newLink.getOffer();
boolean confirmation = accessAndProps.getConfirmationEmail().booleanValue();
if (offer.isConfirmationEmail() != confirmation) {
offer.setConfirmationEmail(confirmation);
if (offer.getKey() != null) {
offer = acService.save(offer);
}
}
}
acService.saveOfferAccess(newLink);
}
// 2: remove offerings not available anymore
List<OfferAccess> deletedOfferAccess = accessAndProps.getDeletedOfferAccess();
for (OfferAccess deletedLink : deletedOfferAccess) {
acService.deletedLinkToMethod(deletedLink);
}
MultiUserEvent modifiedEvent = new EntryChangedEvent(repositoryEntry, author, Change.modifiedAtPublish, "publish");
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, repositoryEntry);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, RepositoryService.REPOSITORY_EVENT_ORES);
}
Aggregations