Search in sources :

Example 1 with AssessedIdentityListState

use of org.olat.modules.assessment.ui.AssessedIdentityListState in project openolat by klemens.

the class IdentityAssessmentOverviewController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (state instanceof AssessedIdentityListState) {
        AssessedIdentityListState listState = (AssessedIdentityListState) state;
        tableEl.setSelectedFilterKey(listState.getFilter());
        loadModel();
    }
}
Also used : AssessedIdentityListState(org.olat.modules.assessment.ui.AssessedIdentityListState)

Example 2 with AssessedIdentityListState

use of org.olat.modules.assessment.ui.AssessedIdentityListState in project OpenOLAT by OpenOLAT.

the class IdentityAssessmentOverviewController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (state instanceof AssessedIdentityListState) {
        AssessedIdentityListState listState = (AssessedIdentityListState) state;
        tableEl.setSelectedFilterKey(listState.getFilter());
        loadModel();
    }
}
Also used : AssessedIdentityListState(org.olat.modules.assessment.ui.AssessedIdentityListState)

Example 3 with AssessedIdentityListState

use of org.olat.modules.assessment.ui.AssessedIdentityListState in project OpenOLAT by OpenOLAT.

the class IdentityListCourseNodeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    String filter = null;
    List<FlexiTableFilter> extendedFilters = null;
    if (state instanceof AssessedIdentityListState) {
        AssessedIdentityListState listState = (AssessedIdentityListState) state;
        if (StringHelper.containsNonWhitespace(listState.getFilter())) {
            filter = listState.getFilter();
        }
        extendedFilters = listState.getExtendedFilters();
    }
    tableEl.setSelectedFilterKey(filter);
    if (extendedFilters != null) {
        tableEl.setSelectedExtendedFilters(extendedFilters);
    }
    loadModel(ureq);
    if (entries != null && entries.size() > 0) {
        ContextEntry entry = entries.get(0);
        String resourceType = entry.getOLATResourceable().getResourceableTypeName();
        if ("Identity".equals(resourceType)) {
            Long identityKey = entries.get(0).getOLATResourceable().getResourceableId();
            for (int i = usersTableModel.getRowCount(); i-- > 0; ) {
                AssessedIdentityElementRow row = usersTableModel.getObject(i);
                if (row.getIdentityKey().equals(identityKey)) {
                    Controller ctrl = doSelect(ureq, row);
                    if (ctrl instanceof Activateable2) {
                        List<ContextEntry> subEntries = entries.subList(1, entries.size());
                        ((Activateable2) ctrl).activate(ureq, subEntries, entry.getTransientState());
                    }
                }
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) AssessedIdentityListState(org.olat.modules.assessment.ui.AssessedIdentityListState) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) AssessedIdentityController(org.olat.modules.assessment.ui.AssessedIdentityController) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) Controller(org.olat.core.gui.control.Controller) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 4 with AssessedIdentityListState

use of org.olat.modules.assessment.ui.AssessedIdentityListState in project openolat by klemens.

the class IdentityListCourseNodeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    String filter = null;
    List<FlexiTableFilter> extendedFilters = null;
    if (state instanceof AssessedIdentityListState) {
        AssessedIdentityListState listState = (AssessedIdentityListState) state;
        if (StringHelper.containsNonWhitespace(listState.getFilter())) {
            filter = listState.getFilter();
        }
        extendedFilters = listState.getExtendedFilters();
    }
    tableEl.setSelectedFilterKey(filter);
    if (extendedFilters != null) {
        tableEl.setSelectedExtendedFilters(extendedFilters);
    }
    loadModel(ureq);
    if (entries != null && entries.size() > 0) {
        ContextEntry entry = entries.get(0);
        String resourceType = entry.getOLATResourceable().getResourceableTypeName();
        if ("Identity".equals(resourceType)) {
            Long identityKey = entries.get(0).getOLATResourceable().getResourceableId();
            for (int i = usersTableModel.getRowCount(); i-- > 0; ) {
                AssessedIdentityElementRow row = usersTableModel.getObject(i);
                if (row.getIdentityKey().equals(identityKey)) {
                    Controller ctrl = doSelect(ureq, row);
                    if (ctrl instanceof Activateable2) {
                        List<ContextEntry> subEntries = entries.subList(1, entries.size());
                        ((Activateable2) ctrl).activate(ureq, subEntries, entry.getTransientState());
                    }
                }
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) AssessedIdentityListState(org.olat.modules.assessment.ui.AssessedIdentityListState) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) AssessedIdentityController(org.olat.modules.assessment.ui.AssessedIdentityController) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) Controller(org.olat.core.gui.control.Controller) ContextEntry(org.olat.core.id.context.ContextEntry)

Aggregations

AssessedIdentityListState (org.olat.modules.assessment.ui.AssessedIdentityListState)4 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)2 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)2 Controller (org.olat.core.gui.control.Controller)2 CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 AssessedIdentityController (org.olat.modules.assessment.ui.AssessedIdentityController)2 AssessedIdentityElementRow (org.olat.modules.assessment.ui.AssessedIdentityElementRow)2