use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project OpenOLAT by OpenOLAT.
the class AuthorListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// search form
if (withSearch) {
setFormDescription("table.search.author.desc");
searchCtrl = new AuthorSearchController(ureq, getWindowControl(), true, mainForm);
searchCtrl.setEnabled(false);
listenTo(searchCtrl);
}
if (withClosedfilter) {
String[] statusValues = new String[] { translate("cif.resources.status.all"), translate("cif.resources.status.active"), translate("cif.resources.status.closed") };
closedEl = uifactory.addRadiosHorizontal("cif_status", "cif.resources.status", formLayout, statusKeys, statusValues);
closedEl.addActionListener(FormEvent.ONCHANGE);
closedEl.setDomReplacementWrapperRequired(false);
closedEl.select(statusKeys[1], true);
searchParams.setClosed(Boolean.FALSE);
}
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
DefaultFlexiColumnModel markColumn = new DefaultFlexiColumnModel(true, Cols.mark.i18nKey(), Cols.mark.ordinal(), true, OrderBy.favorit.name());
markColumn.setExportable(false);
columnsModel.addFlexiColumnModel(markColumn);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.type.i18nKey(), Cols.type.ordinal(), true, OrderBy.type.name(), FlexiColumnModel.ALIGNMENT_LEFT, new TypeRenderer()));
FlexiCellRenderer renderer = new StaticFlexiCellRenderer("select", new TextFlexiCellRenderer());
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.displayName.i18nKey(), Cols.displayName.ordinal(), "select", true, OrderBy.displayname.name(), renderer));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.authors.i18nKey(), Cols.authors.ordinal(), true, OrderBy.authors.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.location.i18nKey(), Cols.location.ordinal(), true, OrderBy.location.name()));
if (repositoryModule.isManagedRepositoryEntries()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalId.i18nKey(), Cols.externalId.ordinal(), true, OrderBy.externalId.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalRef.i18nKey(), Cols.externalRef.ordinal(), true, OrderBy.externalRef.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lifecycleLabel.i18nKey(), Cols.lifecycleLabel.ordinal(), true, OrderBy.lifecycleLabel.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lifecycleSoftkey.i18nKey(), Cols.lifecycleSoftkey.ordinal(), true, OrderBy.lifecycleSoftkey.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lifecycleStart.i18nKey(), Cols.lifecycleStart.ordinal(), true, OrderBy.lifecycleStart.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lifecycleEnd.i18nKey(), Cols.lifecycleEnd.ordinal(), true, OrderBy.lifecycleEnd.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.author.i18nKey(), Cols.author.ordinal(), true, OrderBy.author.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.access.i18nKey(), Cols.access.ordinal(), true, OrderBy.access.name(), FlexiColumnModel.ALIGNMENT_LEFT, new AccessRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.ac.i18nKey(), Cols.ac.ordinal(), true, OrderBy.ac.name(), FlexiColumnModel.ALIGNMENT_LEFT, new ACRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.creationDate.i18nKey(), Cols.creationDate.ordinal(), true, OrderBy.creationDate.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.lastUsage.i18nKey(), Cols.lastUsage.ordinal(), true, OrderBy.lastUsage.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.references.i18nKey(), Cols.references.ordinal(), true, OrderBy.references.name()));
if (licenseModule.isEnabled(licenseHandler)) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, false, Cols.license.i18nKey(), Cols.license.ordinal(), "license", false, null, FlexiColumnModel.ALIGNMENT_LEFT, new StaticFlexiCellRenderer("license", new LicenseRenderer(getLocale()))));
}
initActionsColumns(columnsModel);
model = new AuthoringEntryDataModel(dataSource, columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setSearchEnabled(withSearch);
tableEl.setCssDelegate(this);
tableEl.setExportEnabled(true);
tableEl.setExtendedSearch(searchCtrl);
tableEl.setCustomizeColumns(true);
tableEl.setElementCssClass("o_coursetable");
tableEl.setShowAllRowsEnabled(true);
tableEl.setMultiSelect(true);
tableEl.setSelectAllEnable(true);
tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
tableEl.setSortSettings(new FlexiTableSortOptions(true, new SortKey(OrderBy.displayname.name(), true)));
tableEl.setAndLoadPersistedPreferences(ureq, "authors-list-" + i18nName);
if (!withSearch) {
tableEl.reloadData();
tableEl.setFilters(null, getFilters(), false);
}
initBatchButtons(formLayout);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project OpenOLAT by OpenOLAT.
the class AuthorListController method initActionsColumns.
protected void initActionsColumns(FlexiTableColumnModel columnsModel) {
DefaultFlexiColumnModel detailsColumn = new DefaultFlexiColumnModel(Cols.detailsSupported.i18nKey(), Cols.detailsSupported.ordinal(), "details", new StaticFlexiCellRenderer("", "details", "o_icon o_icon-lg o_icon_details", translate("details")));
detailsColumn.setExportable(false);
columnsModel.addFlexiColumnModel(detailsColumn);
if (hasAuthorRight) {
DefaultFlexiColumnModel editColumn = new DefaultFlexiColumnModel(Cols.editionSupported.i18nKey(), Cols.editionSupported.ordinal(), "edit", new BooleanCellRenderer(new StaticFlexiCellRenderer("", "edit", "o_icon o_icon-lg o_icon_edit", translate("edit")), null));
editColumn.setExportable(false);
columnsModel.addFlexiColumnModel(editColumn);
DefaultFlexiColumnModel toolsColumn = new DefaultFlexiColumnModel(Cols.tools.i18nKey(), Cols.tools.ordinal());
toolsColumn.setExportable(false);
columnsModel.addFlexiColumnModel(toolsColumn);
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project OpenOLAT by OpenOLAT.
the class RepositoryEntryListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (withSearch) {
setFormDescription("table.search.mycourses.desc");
searchCtrl = new RepositoryEntrySearchController(ureq, getWindowControl(), true, mainForm);
searchCtrl.setEnabled(false);
listenTo(searchCtrl);
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
if (!guestOnly) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.mark.i18nKey(), Cols.mark.ordinal(), true, OrderBy.favorit.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.displayName.i18nKey(), Cols.select.ordinal(), true, OrderBy.displayname.name()));
if (repositoryModule.isManagedRepositoryEntries()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalId.i18nKey(), Cols.externalId.ordinal(), true, OrderBy.externalId.name()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.externalRef.i18nKey(), Cols.externalRef.ordinal(), true, OrderBy.externalRef.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.lifecycleLabel.i18nKey(), Cols.lifecycleLabel.ordinal(), true, OrderBy.lifecycleLabel.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.lifecycleSoftkey.i18nKey(), Cols.lifecycleSoftkey.ordinal(), true, OrderBy.lifecycleSoftkey.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lifecycleStart.i18nKey(), Cols.lifecycleStart.ordinal(), true, OrderBy.lifecycleStart.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(true, Cols.lifecycleEnd.i18nKey(), Cols.lifecycleEnd.ordinal(), true, OrderBy.lifecycleEnd.name(), FlexiColumnModel.ALIGNMENT_LEFT, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.location.i18nKey(), Cols.location.ordinal(), true, OrderBy.location.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.details.i18nKey(), Cols.details.ordinal(), false, null));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.start.i18nKey(), Cols.start.ordinal()));
if (repositoryModule.isRatingEnabled()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.ratings.i18nKey(), Cols.ratings.ordinal(), true, OrderBy.rating.name()));
}
if (repositoryModule.isCommentEnabled()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.comments.i18nKey(), Cols.comments.ordinal()));
}
model = new RepositoryEntryDataModel(dataSource, columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom, FlexiTableRendererType.classic);
tableEl.setRendererType(FlexiTableRendererType.custom);
tableEl.setSearchEnabled(withSearch);
tableEl.setExtendedSearch(searchCtrl);
tableEl.setCustomizeColumns(true);
tableEl.setElementCssClass("o_coursetable");
tableEl.setEmtpyTableMessageKey("table.sEmptyTable");
VelocityContainer row = createVelocityContainer("row_1");
// sets its own DOM id in velocity container
row.setDomReplacementWrapperRequired(false);
tableEl.setRowRenderer(row, this);
initFilters(tableEl);
initSorters(tableEl);
tableEl.setAndLoadPersistedPreferences(ureq, "re-list-" + name);
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project OpenOLAT by OpenOLAT.
the class AuthorDeletedListController method initActionsColumns.
@Override
protected void initActionsColumns(FlexiTableColumnModel columnsModel) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.deletedBy.i18nKey(), Cols.deletedBy.ordinal(), true, OrderBy.deletedBy.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.deletionDate.i18nKey(), Cols.deletionDate.ordinal(), true, OrderBy.deletionDate.name(), new DateFlexiCellRenderer(getLocale())));
DefaultFlexiColumnModel detailsColumn = new DefaultFlexiColumnModel(Cols.detailsSupported.i18nKey(), Cols.detailsSupported.ordinal(), "details", new StaticFlexiCellRenderer("", "details", "o_icon o_icon-lg o_icon_details", translate("details")));
detailsColumn.setExportable(false);
columnsModel.addFlexiColumnModel(detailsColumn);
if (hasAuthorRight) {
DefaultFlexiColumnModel toolsColumn = new DefaultFlexiColumnModel(Cols.tools.i18nKey(), Cols.tools.ordinal());
toolsColumn.setExportable(false);
columnsModel.addFlexiColumnModel(toolsColumn);
}
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel in project OpenOLAT by OpenOLAT.
the class GoToMeetingsController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MeetingsCols.name.i18nHeaderKey(), MeetingsCols.name.ordinal(), true, MeetingsCols.name.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MeetingsCols.start.i18nHeaderKey(), MeetingsCols.start.ordinal(), true, MeetingsCols.start.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MeetingsCols.end.i18nHeaderKey(), MeetingsCols.end.ordinal(), true, MeetingsCols.end.name()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", translate("select"), "select-upcoming"));
upcomingTableModel = new GoToMeetingTableModel(columnsModel);
upcomingTableEl = uifactory.addTableElement(getWindowControl(), "upcomingmeetings", upcomingTableModel, getTranslator(), formLayout);
upcomingTableEl.setEmtpyTableMessageKey("table.empty");
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setDefaultOrderBy(new SortKey(MeetingsCols.start.name(), true));
upcomingTableEl.setSortSettings(sortOptions);
FlexiTableColumnModel pastColumnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
pastColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MeetingsCols.name.i18nHeaderKey(), MeetingsCols.name.ordinal(), true, MeetingsCols.name.name()));
pastColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MeetingsCols.start.i18nHeaderKey(), MeetingsCols.start.ordinal(), true, MeetingsCols.start.name()));
pastColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(MeetingsCols.end.i18nHeaderKey(), MeetingsCols.end.ordinal(), true, MeetingsCols.end.name()));
pastColumnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", translate("select"), "select-past"));
pastTableModel = new GoToMeetingTableModel(pastColumnsModel);
pastTableEl = uifactory.addTableElement(getWindowControl(), "pastmeetings", pastTableModel, getTranslator(), formLayout);
FlexiTableSortOptions pastSortOptions = new FlexiTableSortOptions();
pastSortOptions.setDefaultOrderBy(new SortKey(MeetingsCols.start.name(), false));
pastTableEl.setSortSettings(sortOptions);
updateModel();
}
Aggregations