Search in sources :

Example 51 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class OAuthAdminController method initOpenIDConnectForm.

private void initOpenIDConnectForm(FormItemContainer formLayout) {
    FormLayoutContainer openIdConnectIFCont = FormLayoutContainer.createDefaultFormLayout("openidconnectif", getTranslator());
    openIdConnectIFCont.setFormTitle(translate("openidconnectif.admin.title"));
    openIdConnectIFCont.setFormTitleIconCss("o_icon o_icon_provider_openid");
    openIdConnectIFCont.setRootForm(mainForm);
    formLayout.add(openIdConnectIFCont);
    openIdConnectIFEl = uifactory.addCheckboxesHorizontal("openidconnectif.enabled", openIdConnectIFCont, keys, values);
    openIdConnectIFEl.addActionListener(FormEvent.ONCHANGE);
    openIdConnectIFDefaultEl = uifactory.addCheckboxesHorizontal("openidconnectif.default.enabled", openIdConnectIFCont, keys, values);
    openIdConnectIFDefaultEl.addActionListener(FormEvent.ONCHANGE);
    String openIdConnectIFApiKey = oauthModule.getOpenIdConnectIFApiKey();
    openIdConnectIFApiKeyEl = uifactory.addTextElement("openidconnectif.id", "openidconnectif.api.id", 256, openIdConnectIFApiKey, openIdConnectIFCont);
    String openIdConnectIFApiSecret = oauthModule.getOpenIdConnectIFApiSecret();
    openIdConnectIFApiSecretEl = uifactory.addTextElement("openidconnectif.secret", "openidconnectif.api.secret", 256, openIdConnectIFApiSecret, openIdConnectIFCont);
    String openIdConnectIFIssuer = oauthModule.getOpenIdConnectIFIssuer();
    openIdConnectIFIssuerEl = uifactory.addTextElement("openidconnectif.issuer", "openidconnectif.issuer", 256, openIdConnectIFIssuer, openIdConnectIFCont);
    openIdConnectIFIssuerEl.setExampleKey("openidconnectif.issuer.example", null);
    String openIdConnectIFAuthorizationEndPoint = oauthModule.getOpenIdConnectIFAuthorizationEndPoint();
    openIdConnectIFAuthorizationEndPointEl = uifactory.addTextElement("openidconnectif.authorization.endpoint", "openidconnectif.authorization.endpoint", 256, openIdConnectIFAuthorizationEndPoint, openIdConnectIFCont);
    openIdConnectIFAuthorizationEndPointEl.setExampleKey("openidconnectif.authorization.endpoint.example", null);
    if (oauthModule.isOpenIdConnectIFEnabled()) {
        openIdConnectIFEl.select(keys[0], true);
    } else {
        openIdConnectIFApiKeyEl.setVisible(false);
        openIdConnectIFDefaultEl.setVisible(false);
        openIdConnectIFApiSecretEl.setVisible(false);
        openIdConnectIFIssuerEl.setVisible(false);
        openIdConnectIFAuthorizationEndPointEl.setVisible(false);
    }
    if (oauthModule.isOpenIdConnectIFRootEnabled()) {
        openIdConnectIFDefaultEl.select(keys[0], true);
    }
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 52 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class OAuthAdminController method initTwitterForm.

private void initTwitterForm(FormItemContainer formLayout) {
    FormLayoutContainer twitterCont = FormLayoutContainer.createDefaultFormLayout("twitter", getTranslator());
    twitterCont.setFormTitle(translate("twitter.admin.title"));
    twitterCont.setFormTitleIconCss("o_icon o_icon_provider_twitter");
    twitterCont.setRootForm(mainForm);
    formLayout.add(twitterCont);
    twitterEl = uifactory.addCheckboxesHorizontal("twitter.enabled", twitterCont, keys, values);
    twitterEl.addActionListener(FormEvent.ONCHANGE);
    String twitterApiKey = oauthModule.getTwitterApiKey();
    twitterApiKeyEl = uifactory.addTextElement("twitter.id", "twitter.api.id", 256, twitterApiKey, twitterCont);
    String twitterApiSecret = oauthModule.getTwitterApiSecret();
    twitterApiSecretEl = uifactory.addTextElement("twitter.secret", "twitter.api.secret", 256, twitterApiSecret, twitterCont);
    if (oauthModule.isTwitterEnabled()) {
        twitterEl.select(keys[0], true);
    } else {
        twitterApiKeyEl.setVisible(false);
        twitterApiSecretEl.setVisible(false);
    }
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 53 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class OAuthAdminController method initFacebookForm.

private void initFacebookForm(FormItemContainer formLayout) {
    FormLayoutContainer facebookCont = FormLayoutContainer.createDefaultFormLayout("facebook", getTranslator());
    facebookCont.setFormTitle(translate("facebook.admin.title"));
    facebookCont.setFormTitleIconCss("o_icon o_icon_provider_facebook");
    facebookCont.setRootForm(mainForm);
    formLayout.add(facebookCont);
    facebookEl = uifactory.addCheckboxesHorizontal("facebook.enabled", facebookCont, keys, values);
    facebookEl.addActionListener(FormEvent.ONCHANGE);
    String facebookApiKey = oauthModule.getFacebookApiKey();
    facebookApiKeyEl = uifactory.addTextElement("facebook.id", "facebook.api.id", 256, facebookApiKey, facebookCont);
    String facebookApiSecret = oauthModule.getFacebookApiSecret();
    facebookApiSecretEl = uifactory.addTextElement("facebook.secret", "facebook.api.secret", 256, facebookApiSecret, facebookCont);
    if (oauthModule.isFacebookEnabled()) {
        facebookEl.select(keys[0], true);
    } else {
        facebookApiKeyEl.setVisible(false);
        facebookApiSecretEl.setVisible(false);
    }
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 54 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class OAuthAdminController method initAdfsForm.

private void initAdfsForm(FormItemContainer formLayout) {
    FormLayoutContainer adfsCont = FormLayoutContainer.createDefaultFormLayout("adfs", getTranslator());
    adfsCont.setFormTitle(translate("adfs.admin.title"));
    adfsCont.setFormTitleIconCss("o_icon o_icon_provider_adfs");
    adfsCont.setRootForm(mainForm);
    formLayout.add(adfsCont);
    adfsEl = uifactory.addCheckboxesHorizontal("adfs.enabled", adfsCont, keys, values);
    adfsEl.addActionListener(FormEvent.ONCHANGE);
    adfsDefaultEl = uifactory.addCheckboxesHorizontal("adfs.default.enabled", adfsCont, keys, values);
    adfsDefaultEl.addActionListener(FormEvent.ONCHANGE);
    String adfsOAuth2Endpoint = oauthModule.getAdfsOAuth2Endpoint();
    adfsOAuth2EndpointEl = uifactory.addTextElement("adfs.oauth2.endpoint", "adfs.oauth2.endpoint", 256, adfsOAuth2Endpoint, adfsCont);
    adfsOAuth2EndpointEl.setExampleKey("adfs.oauth2.endpoint.example", null);
    String adfsApiKey = oauthModule.getAdfsApiKey();
    adfsApiKeyEl = uifactory.addTextElement("adfs.id", "adfs.api.id", 256, adfsApiKey, adfsCont);
    String adfsApiSecret = oauthModule.getAdfsApiSecret();
    adfsApiSecretEl = uifactory.addTextElement("adfs.secret", "adfs.api.secret", 256, adfsApiSecret, adfsCont);
    adfsApiSecretEl.setHelpText(translate("adfs.api.secret.hint"));
    if (oauthModule.isAdfsEnabled()) {
        adfsEl.select(keys[0], true);
    } else {
        adfsApiKeyEl.setVisible(false);
        adfsApiSecretEl.setVisible(false);
        adfsDefaultEl.setVisible(false);
        adfsOAuth2EndpointEl.setVisible(false);
    }
    if (oauthModule.isAdfsRootEnabled()) {
        adfsDefaultEl.select(keys[0], true);
    }
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 55 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class OAuthAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FormLayoutContainer oauthCont = FormLayoutContainer.createDefaultFormLayout("oauth", getTranslator());
    oauthCont.setFormTitle(translate("oauth.admin.title"));
    oauthCont.setRootForm(mainForm);
    formLayout.add(oauthCont);
    userCreationEl = uifactory.addCheckboxesHorizontal("user.creation.enabled", oauthCont, keys, values);
    userCreationEl.addActionListener(FormEvent.ONCHANGE);
    if (oauthModule.isAllowUserCreation()) {
        userCreationEl.select(keys[0], true);
    }
    initLinkedInForm(formLayout);
    initTwitterForm(formLayout);
    initGoogleForm(formLayout);
    initFacebookForm(formLayout);
    initAdfsForm(formLayout);
    initTequilaForm(formLayout);
    initOpenIDConnectForm(formLayout);
    customProvidersCont = FormLayoutContainer.createBareBoneFormLayout("custom.providers", getTranslator());
    customProvidersCont.setRootForm(mainForm);
    formLayout.add(customProvidersCont);
    // highly configurable providers
    initCustomProviders();
    // buttons
    FormLayoutContainer buttonBonesCont = FormLayoutContainer.createDefaultFormLayout("button_bones", getTranslator());
    buttonBonesCont.setRootForm(mainForm);
    formLayout.add(buttonBonesCont);
    uifactory.addSpacerElement("buttons-spacer", buttonBonesCont, true);
    FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("button_layout", getTranslator());
    buttonBonesCont.add(buttonLayout);
    uifactory.addFormSubmitButton("save", buttonLayout);
    addProviderLink = uifactory.addFormLink("add.openidconnectif.custom", buttonLayout, Link.BUTTON);
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Aggregations

FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)844 ArrayList (java.util.ArrayList)96 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)76 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)76 Date (java.util.Date)56 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)56 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)42 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)40 FormItem (org.olat.core.gui.components.form.flexible.FormItem)38 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)32 Translator (org.olat.core.gui.translator.Translator)30 Identity (org.olat.core.id.Identity)30 VFSContainer (org.olat.core.util.vfs.VFSContainer)28 File (java.io.File)26 MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)26 BusinessGroup (org.olat.group.BusinessGroup)26 HashMap (java.util.HashMap)22 HashSet (java.util.HashSet)22 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)22 StaticTextElement (org.olat.core.gui.components.form.flexible.elements.StaticTextElement)20