use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class AbstractFeedCourseNode method getReferencedRepositoryEntry.
/**
* @see org.olat.course.nodes.CourseNode#getReferencedRepositoryEntry()
*/
@Override
public RepositoryEntry getReferencedRepositoryEntry() {
this.config = getModuleConfiguration();
String repoSoftkey = (String) config.get(CONFIG_KEY_REPOSITORY_SOFTKEY);
RepositoryManager rm = RepositoryManager.getInstance();
RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repoSoftkey, false);
return entry;
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doSearchByOwnerLimitAccess.
/**
* Do search for all resources of a given type where identity is owner.
* @param owner
* @param access
*/
public void doSearchByOwnerLimitAccess(Identity owner) {
RepositoryManager rm = RepositoryManager.getInstance();
List<RepositoryEntry> entries = rm.queryByOwnerLimitAccess(owner, RepositoryEntry.ACC_USERS, Boolean.TRUE);
filterRepositoryEntries(entries);
repoTableModel.setObjects(entries);
tableCtr.setFilters(null, null);
tableCtr.modelChanged();
displaySearchResults(null);
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doSearchAllReferencables.
/**
* Implementation of referencable search: find repo entries that are
* owned by the uer or set to referencable and have at lease BA settings
* @param ureq
*/
private void doSearchAllReferencables(UserRequest ureq, String limitType, boolean updateFilters) {
searchType = SearchType.searchForm;
RepositoryManager rm = RepositoryManager.getInstance();
List<String> restrictedTypes;
if (limitType != null) {
restrictedTypes = Collections.singletonList(limitType);
} else {
Collection<String> s = searchForm.getRestrictedTypes();
restrictedTypes = (s == null) ? null : new ArrayList<String>(s);
}
Roles roles = ureq.getUserSession().getRoles();
Identity ident = ureq.getIdentity();
String name = searchForm.getDisplayName();
String author = searchForm.getAuthor();
String desc = searchForm.getDescription();
List<RepositoryEntry> entries;
if (searchForm.isAdminSearch()) {
entries = rm.queryResourcesLimitType(null, restrictedTypes, name, author, desc, true, false);
} else if (enableSearchforAllInSearchForm == Can.referenceable) {
entries = rm.queryReferencableResourcesLimitType(ident, roles, restrictedTypes, name, author, desc);
} else if (enableSearchforAllInSearchForm == Can.copyable) {
entries = rm.queryCopyableResourcesLimitType(ident, roles, restrictedTypes, name, author, desc);
} else {
entries = new ArrayList<RepositoryEntry>();
}
filterRepositoryEntries(entries);
repoTableModel.setObjects(entries);
if (updateFilters) {
updateFilters(entries, null);
}
tableCtr.modelChanged();
displaySearchResults(ureq);
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doSearchForReferencableResourcesLimitType.
/**
* Do search for all resources that the user can reference either because he
* is the owner of the resource or because he has author rights and the resource
* is set to at least BA in the BARG settings and the resource has the flag
* 'canReference' set to true.
* @param owner The current identity
* @param limitTypes List of Types to limit the search
* @param roles The users roles
*/
public void doSearchForReferencableResourcesLimitType(Identity owner, String[] limitTypes, Roles roles) {
RepositoryManager rm = RepositoryManager.getInstance();
List<String> restrictedTypes = new ArrayList<String>();
if (limitTypes == null) {
restrictedTypes = null;
} else {
restrictedTypes.addAll(Arrays.asList(limitTypes));
}
List<RepositoryEntry> entries = rm.queryReferencableResourcesLimitType(owner, roles, restrictedTypes, null, null, null);
filterRepositoryEntries(entries);
repoTableModel.setObjects(entries);
tableCtr.setFilters(null, null);
tableCtr.modelChanged();
displaySearchResults(null);
}
use of org.olat.repository.RepositoryManager in project OpenOLAT by OpenOLAT.
the class RepositorySearchController method doSearchByTypeLimitAccess.
/**
* Used by repository main controller to execute predefined searches.
*
* @param restrictedTypes
* @param ureq
*/
public void doSearchByTypeLimitAccess(String[] restrictedTypes, UserRequest ureq) {
searchType = null;
RepositoryManager rm = RepositoryManager.getInstance();
List<String> types = Arrays.asList(restrictedTypes);
List<RepositoryEntry> entries = rm.queryByTypeLimitAccess(ureq.getIdentity(), ureq.getUserSession().getRoles(), types);
filterRepositoryEntries(entries);
repoTableModel.setObjects(entries);
tableCtr.setFilters(null, null);
tableCtr.modelChanged();
displaySearchResults(ureq);
}
Aggregations