-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MID-7815 mail/sms transport missing fields panels, wip
- Loading branch information
Showing
4 changed files
with
208 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
.../evolveum/midpoint/gui/impl/page/admin/systemconfiguration/component/SmsGatewayPanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!-- | ||
~ Copyright (c) 2022 Evolveum and contributors | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:panel> | ||
<div class="row no-gutters mb-3"> | ||
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.name"/></div> | ||
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="name"/> | ||
</div> | ||
<div class="row no-gutters mb-3"> | ||
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.method"/></div> | ||
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="method"/> | ||
</div> | ||
<div class="row no-gutters mb-3"> | ||
<div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.urlExpression"/></div> | ||
<div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="urlExpression"/> | ||
</div> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.headersExpression"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="headersExpression"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.bodyExpression"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="bodyExpression"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.bodyEncoding"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="bodyEncoding"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.username"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="username"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.password"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="password"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.proxyHost"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="proxyHost"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.proxyPort"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="proxyPort"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.proxyUsername"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="proxyUsername"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.proxyPassword"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="proxyPassword"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.redirectToFile"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="redirectToFile"/>--> | ||
<!-- </div>--> | ||
<!-- <div class="row no-gutters mb-3">--> | ||
<!-- <div class="col-xl-2 col-md-4 col-xs-12 prism-property-label"><wicket:message key="SmsGatewayPanel.logToFile"/></div>--> | ||
<!-- <div class="prism-property-value col-xl-10 col-md-8 col-xs-12" wicket:id="logToFile"/>--> | ||
<!-- </div>--> | ||
</wicket:panel> | ||
</body> | ||
</html> |
95 changes: 95 additions & 0 deletions
95
.../evolveum/midpoint/gui/impl/page/admin/systemconfiguration/component/SmsGatewayPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright (c) 2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.gui.impl.prism.panel.ExpressionPropertyPanel; | ||
|
||
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel; | ||
import com.evolveum.midpoint.web.component.input.ExpressionEditorPanel; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.HttpMethodType; | ||
|
||
import org.apache.wicket.markup.html.form.FormComponent; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.PropertyModel; | ||
|
||
import com.evolveum.midpoint.gui.api.component.password.PasswordPanel; | ||
import com.evolveum.midpoint.gui.api.model.LoadableModel; | ||
import com.evolveum.midpoint.web.component.input.TextPanel; | ||
import com.evolveum.midpoint.web.component.prism.InputPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SmsGatewayConfigurationType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
public class SmsGatewayPanel extends InputPanel { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private static final String ID_METHOD = "method"; | ||
private static final String ID_URL_EXPRESSION = "urlExpression"; | ||
private static final String ID_HEADERS_EXPRESSION = "headersExpression"; | ||
private static final String ID_BODY_EXPRESSION = "bodyExpression"; | ||
private static final String ID_BODY_ENCODING = "bodyEncoding"; | ||
private static final String ID_USERNAME = "username"; | ||
private static final String ID_PASSWORD = "password"; | ||
private static final String ID_PROXY_HOST = "proxyHost"; | ||
private static final String ID_PROXY_PORT = "proxyPort"; | ||
private static final String ID_PROXY_USERNAME = "proxyUsername"; | ||
private static final String ID_PROXY_PASSWORD = "proxyPassword"; | ||
private static final String ID_REDIRECT_TO_FILE = "redirectToFile"; | ||
private static final String ID_LOG_TO_FILE = "logToFile"; | ||
private static final String ID_NAME = "name"; | ||
|
||
|
||
private IModel<SmsGatewayConfigurationType> model; | ||
|
||
public SmsGatewayPanel(String id, IModel<SmsGatewayConfigurationType> model) { | ||
super(id); | ||
|
||
this.model = new LoadableModel<>() { | ||
|
||
@Override | ||
protected SmsGatewayConfigurationType load() { | ||
if (model == null) { | ||
return new SmsGatewayConfigurationType(); | ||
} | ||
|
||
SmsGatewayConfigurationType config = model.getObject(); | ||
|
||
return config != null ? config : new SmsGatewayConfigurationType(); | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
|
||
initLayout(); | ||
} | ||
|
||
public IModel<SmsGatewayConfigurationType> getModel() { | ||
return model; | ||
} | ||
|
||
private void initLayout() { | ||
add(new TextPanel<>(ID_NAME, new PropertyModel<>(model, SmsGatewayConfigurationType.F_NAME.getLocalPart()))); | ||
add(WebComponentUtil.createEnumPanel(HttpMethodType.class, ID_METHOD, new PropertyModel<>(model, SmsGatewayConfigurationType.F_METHOD.getLocalPart()), this)); | ||
add(new ExpressionEditorPanel(ID_URL_EXPRESSION, new PropertyModel<>(model, SmsGatewayConfigurationType.F_URL_EXPRESSION.getLocalPart()), getPageBase())); | ||
|
||
// add(new TextPanel<>(ID_USERNAME, new PropertyModel<>(model, SmsGatewayConfigurationType.F_USERNAME.getLocalPart()))); | ||
// add(new PasswordPanel(ID_PASSWORD, new PropertyModel<>(model, SmsGatewayConfigurationType.F_PASSWORD.getLocalPart()))); | ||
} | ||
|
||
@Override | ||
public FormComponent getBaseFormComponent() { | ||
return ((TextPanel) get(ID_NAME)).getBaseFormComponent(); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...um/midpoint/gui/impl/page/admin/systemconfiguration/component/SmsGatewayPanelFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2022 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper; | ||
import com.evolveum.midpoint.gui.impl.factory.panel.AbstractInputGuiComponentFactory; | ||
import com.evolveum.midpoint.gui.impl.factory.panel.PrismPropertyPanelContext; | ||
import com.evolveum.midpoint.web.component.prism.InputPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SmsGatewayConfigurationType; | ||
|
||
/** | ||
* Created by Viliam Repan (lazyman). | ||
*/ | ||
@Component | ||
public class SmsGatewayPanelFactory extends AbstractInputGuiComponentFactory<SmsGatewayConfigurationType> { | ||
|
||
@PostConstruct | ||
public void register() { | ||
getRegistry().addToRegistry(this); | ||
} | ||
|
||
@Override | ||
public <IW extends ItemWrapper<?, ?>> boolean match(IW wrapper) { | ||
return SmsGatewayConfigurationType.COMPLEX_TYPE.equals(wrapper.getTypeName()); | ||
} | ||
|
||
@Override | ||
protected InputPanel getPanel(PrismPropertyPanelContext<SmsGatewayConfigurationType> panelCtx) { | ||
return new SmsGatewayPanel(panelCtx.getComponentId(), panelCtx.getRealValueModel()); | ||
} | ||
} |