Search in sources :

Example 6 with QuestionItemSecurityCallback

use of org.olat.modules.qpool.QuestionItemSecurityCallback in project openolat by klemens.

the class AbstractItemListController method forgeRow.

protected ItemRow forgeRow(QuestionItemView item, List<ResourceLicense> licenses) {
    boolean marked = item.isMarked();
    QuestionItemSecurityCallback securityCallback = qpoolSecurityCallbackFactory.createQuestionItemSecurityCallback(item, getSource(), roles);
    ItemRow row = new ItemRow(item, securityCallback);
    // favorite
    FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "&nbsp;", null, null, Link.NONTRANSLATED);
    markLink.setIconLeftCSS(marked ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
    markLink.setUserObject(row);
    row.setMarkLink(markLink);
    // license
    for (ResourceLicense license : licenses) {
        if (license.getResId().equals(item.getResourceableId()) && license.getResName().equals(item.getResourceableTypeName())) {
            row.setLicense(license);
        }
    }
    return row;
}
Also used : FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) QuestionItemSecurityCallback(org.olat.modules.qpool.QuestionItemSecurityCallback) ResourceLicense(org.olat.core.commons.services.license.ResourceLicense)

Aggregations

QuestionItemSecurityCallback (org.olat.modules.qpool.QuestionItemSecurityCallback)6 ResourceLicense (org.olat.core.commons.services.license.ResourceLicense)2 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)2 ItemWrapper (org.olat.modules.qpool.model.ItemWrapper)2