use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.
the class ItemListMySharesController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (selectLink == source) {
Set<Integer> selections = getItemsTable().getMultiSelectedIndex();
if (!selections.isEmpty()) {
List<QuestionItemView> items = getItemViews(selections);
fireEvent(ureq, new QItemViewEvent("select-item", items));
}
} else if (myShareEl == source) {
String selectedKey = myShareEl.getSelectedKey();
if (selectedKey != null && selectedKey.length() > 4) {
String key = selectedKey.substring(4);
if (StringHelper.isLong(key)) {
Long resourceKey = Long.parseLong(key);
if (selectedKey.startsWith("pool")) {
doSelectPool(ureq, resourceKey);
} else if (selectedKey.startsWith("grou")) {
doSelectBusinessGroup(ureq, resourceKey);
}
}
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.qpool.QuestionItemView in project OpenOLAT by OpenOLAT.
the class ItemListMyListsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (selectLink == source) {
Set<Integer> selections = getItemsTable().getMultiSelectedIndex();
if (!selections.isEmpty()) {
List<QuestionItemView> items = getItemViews(selections);
fireEvent(ureq, new QItemViewEvent("select-item", items));
}
} else if (myListEl == source) {
String selectedCollKey = myListEl.getSelectedKey();
if (StringHelper.isLong(selectedCollKey)) {
Long collectionKey = Long.parseLong(selectedCollKey);
doSelectCollection(ureq, collectionKey);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.qpool.QuestionItemView in project openolat by klemens.
the class QuestionItemDetailsController method reloadData.
private void reloadData(UserRequest ureq) {
Long itemKey = metadatasCtrl.getItem().getKey();
QuestionItemView itemView = itemSource.getItemWithoutRestrictions(itemKey);
if (itemView != null) {
qItemSecurityCallback.setQuestionItemView(itemView);
initTools();
setCommentsController(ureq);
QuestionItem reloadedItem = qpoolService.loadItemById(itemView.getKey());
metadatasCtrl.setItem(reloadedItem, qItemSecurityCallback);
reviewActionCtrl.setSecurityCallback(qItemSecurityCallback);
setQuestionController(ureq, reloadedItem, qItemSecurityCallback);
}
}
use of org.olat.modules.qpool.QuestionItemView in project openolat by klemens.
the class AbstractItemListController method reload.
@Override
public List<ItemRow> reload(List<ItemRow> rows) {
List<Long> itemToReload = new ArrayList<>();
for (ItemRow row : rows) {
itemToReload.add(row.getKey());
}
List<QuestionItemView> reloadedItems = itemsSource.getItems(itemToReload);
List<ItemRow> reloadedRows = new ArrayList<>(reloadedItems.size());
List<ResourceLicense> licenses = licenseService.loadLicenses(reloadedItems);
for (QuestionItemView item : reloadedItems) {
ItemRow reloadedRow = forgeRow(item, licenses);
reloadedRows.add(reloadedRow);
}
return reloadedRows;
}
use of org.olat.modules.qpool.QuestionItemView in project openolat by klemens.
the class AbstractItemListController method getRows.
@Override
public ResultInfos<ItemRow> getRows(String query, List<FlexiTableFilter> filters, List<String> condQueries, int firstResult, int maxResults, SortKey... orderBy) {
ResultInfos<QuestionItemView> items = itemsSource.getItems(query, condQueries, firstResult, maxResults, orderBy);
List<ItemRow> rows = new ArrayList<>(items.getObjects().size());
List<ResourceLicense> licenses = licenseService.loadLicenses(items.getObjects());
for (QuestionItemView item : items.getObjects()) {
ItemRow row = forgeRow(item, licenses);
rows.add(row);
}
return new DefaultResultInfos<>(items.getNextFirstResult(), items.getCorrectedRowCount(), rows);
}
Aggregations