Search in sources :

Example 61 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class RegistrationController method displayFinalStep.

/**
 * OO-92
 *
 * displays the final step of the registration process. (step5)<br />
 * see also _content/finish.html
 *
 * @param user
 *            The newly created User from which to display information
 */
private void displayFinalStep(Identity persitedIdentity) {
    // set wizard step to 5
    wizInfoController.setCurStep(5);
    // hide the text we don't need anymore
    myContent.contextPut("pwdhelp", "");
    myContent.contextPut("loginhelp", "");
    myContent.contextPut("text", "");
    // show last screen
    VelocityContainer finishVC = createVelocityContainer("finish");
    List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(RegistrationForm2.USERPROPERTIES_FORM_IDENTIFIER, false);
    finishVC.contextPut("userPropertyHandlers", userPropertyHandlers);
    finishVC.contextPut("user", persitedIdentity.getUser());
    finishVC.contextPut("locale", getLocale());
    finishVC.contextPut("username", registrationForm.getLogin());
    finishVC.contextPut("text", getTranslator().translate("step5.reg.text", new String[] { registrationForm.getLogin() }));
    loginButton = LinkFactory.createButton("form.login", finishVC, this);
    loginButton.setCustomEnabledLinkCSS("btn btn-primary");
    loginButton.setUserObject(persitedIdentity);
    finishVC.put("loginhref", loginButton);
    regarea.setContent(finishVC);
}
Also used : UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 62 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

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);
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 63 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class TaxonomyListAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    createTaxonomyButton = uifactory.addFormLink("create.taxonomy", formLayout, Link.BUTTON);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, TaxonomyCols.key, "select"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TaxonomyCols.displayName, "select"));
    model = new TaxonomyListDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
    tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom);
    tableEl.setRendererType(FlexiTableRendererType.custom);
    tableEl.setSearchEnabled(false);
    tableEl.setCustomizeColumns(false);
    tableEl.setElementCssClass("o_taxonomy_listing");
    tableEl.setEmtpyTableMessageKey("table.taxonomy.empty");
    tableEl.setNumOfRowsEnabled(false);
    tableEl.setPageSize(24);
    VelocityContainer row = createVelocityContainer("taxonomy_row");
    // sets its own DOM id in velocity container
    row.setDomReplacementWrapperRequired(false);
    tableEl.setRowRenderer(row, this);
    tableEl.setCssDelegate(new TaxonomyCssDelegate());
}
Also used : FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 64 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class EPMapRunController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == createMapLink) {
        // if only normal maps can be created, show popup immediately, else present selection in callout
        if (option.equals(EPMapRunViewOption.MY_DEFAULTS_MAPS)) {
            VelocityContainer mapCreateVC = createVelocityContainer("createMapCallout");
            createMapCalloutLink = LinkFactory.createLink("create.map.default", mapCreateVC, this);
            createMapCalloutLink.setElementCssClass("o_sel_create_default_map");
            createMapFromTemplateLink = LinkFactory.createLink("create.map.fromTemplate", mapCreateVC, this);
            createMapFromTemplateLink.setElementCssClass("o_sel_create_template_map");
            String title = translate("create.map");
            removeAsListenerAndDispose(mapCreateCalloutCtrl);
            mapCreateCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), mapCreateVC, createMapLink, title, true, null);
            listenTo(mapCreateCalloutCtrl);
            mapCreateCalloutCtrl.activate();
        } else {
            popUpCreateMapBox(ureq);
        }
    } else if (source == createMapFromTemplateLink) {
        closeCreateMapCallout();
        popUpCreateMapFromTemplateBox(ureq);
    } else if (source == createMapCalloutLink) {
        closeCreateMapCallout();
        popUpCreateMapBox(ureq);
    }
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 65 with VelocityContainer

use of org.olat.core.gui.components.velocity.VelocityContainer in project openolat by klemens.

the class EPArtefactViewOptionsLinkController method popUpArtefactOptionsBox.

/**
 * opens the callout
 * @param ureq
 */
private void popUpArtefactOptionsBox(UserRequest ureq) {
    VelocityContainer artOptVC = createVelocityContainer("artefactOptions");
    if (secCallback.canRemoveArtefactFromStruct()) {
        unlinkLink = LinkFactory.createCustomLink("unlink.link", "remove", "remove.from.map", Link.LINK, artOptVC, this);
    }
    if (secCallback.canAddArtefact() && secCallback.canRemoveArtefactFromStruct() && secCallback.isOwner()) {
        // isOwner: don't show move in group maps!
        moveLink = LinkFactory.createCustomLink("move.link", "move", "artefact.options.move", Link.LINK, artOptVC, this);
    }
    reflexionLink = LinkFactory.createCustomLink("reflexion.link", "reflexion", "table.header.reflexion", Link.LINK, artOptVC, this);
    if (secCallback.canEditTags()) {
        tagsLink = LinkFactory.createCustomLink("tags.link", "tags", "artefact.tags", Link.LINK, artOptVC, this);
    }
    String title = translate("option.link");
    removeAsListenerAndDispose(artefactOptionCalloutCtrl);
    artefactOptionCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), artOptVC, optionLink, title, true, null);
    listenTo(artefactOptionCalloutCtrl);
    artefactOptionCalloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)162 Component (org.olat.core.gui.components.Component)22 ArrayList (java.util.ArrayList)16 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)14 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)14 CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)14 Link (org.olat.core.gui.components.link.Link)12 Panel (org.olat.core.gui.components.panel.Panel)12 UserRequest (org.olat.core.gui.UserRequest)10 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)10 List (java.util.List)8 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)8 WindowControl (org.olat.core.gui.control.WindowControl)8 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 Translator (org.olat.core.gui.translator.Translator)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 HashMap (java.util.HashMap)6 Collectors (java.util.stream.Collectors)6 Mapper (org.olat.core.dispatcher.mapper.Mapper)6 BarSeries (org.olat.core.gui.components.chart.BarSeries)6