You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/11/12 18:03:09 UTC
[syncope] branch 2_1_X updated: [SYNCOPE-1600] Adding
PasswordFormType
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_1_X by this push:
new 4247279 [SYNCOPE-1600] Adding PasswordFormType
4247279 is described below
commit 4247279232a5be9887e7f100c5236c22ec309a4f
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Nov 12 18:49:11 2020 +0100
[SYNCOPE-1600] Adding PasswordFormType
---
.../client/console/panels/UserRequestFormPanel.java | 5 +++++
.../common/lib/types/UserRequestFormPropertyType.java | 3 ++-
.../support/DomainProcessEngineFactoryBean.java | 2 +-
.../core/flowable/support/PasswordFormType.java} | 18 ++++++++----------
.../core/flowable/support/SyncopeTaskFormHandler.java | 4 ++++
5 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/UserRequestFormPanel.java b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/UserRequestFormPanel.java
index 50eb262..6f9091f 100644
--- a/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/UserRequestFormPanel.java
+++ b/ext/flowable/client-console/src/main/java/org/apache/syncope/client/console/panels/UserRequestFormPanel.java
@@ -31,6 +31,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDateTimeFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPasswordFieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
import org.apache.syncope.common.lib.to.UserRequestFormProperty;
import org.apache.syncope.common.lib.to.UserRequestForm;
@@ -163,6 +164,10 @@ public abstract class UserRequestFormPanel extends Panel {
});
break;
+ case Password:
+ field = new AjaxPasswordFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
+ break;
+
case String:
default:
field = new AjaxTextFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
index 227296b..89ce4ba 100644
--- a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
+++ b/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
@@ -28,6 +28,7 @@ public enum UserRequestFormPropertyType {
Enum,
Date,
Boolean,
- Dropdown
+ Dropdown,
+ Password
}
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
index 09e7e73..689320a 100644
--- a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/DomainProcessEngineFactoryBean.java
@@ -82,7 +82,7 @@ public class DomainProcessEngineFactoryBean
conf.addEngineConfiguration(spiec.getEngineCfgKey(), spiec.getEngineScopeType(), spiec);
}
conf.setEnableSafeBpmnXml(true);
- conf.setCustomFormTypes(Arrays.asList(new DropdownFormType(null)));
+ conf.setCustomFormTypes(Arrays.asList(new DropdownFormType(null), new PasswordFormType()));
engines.put(domain, conf.buildProcessEngine());
}
diff --git a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/PasswordFormType.java
similarity index 72%
copy from ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
copy to ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/PasswordFormType.java
index 227296b..130f682 100644
--- a/ext/flowable/common-lib/src/main/java/org/apache/syncope/common/lib/types/UserRequestFormPropertyType.java
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/PasswordFormType.java
@@ -16,18 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.common.lib.types;
+package org.apache.syncope.core.flowable.support;
-import javax.xml.bind.annotation.XmlEnum;
+import org.flowable.engine.impl.form.StringFormType;
-@XmlEnum
-public enum UserRequestFormPropertyType {
+public class PasswordFormType extends StringFormType {
- String,
- Long,
- Enum,
- Date,
- Boolean,
- Dropdown
+ private static final long serialVersionUID = 4657839355580978699L;
+ @Override
+ public String getName() {
+ return "password";
+ }
}
diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeTaskFormHandler.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeTaskFormHandler.java
index 69c5e50..76000e7 100644
--- a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeTaskFormHandler.java
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/support/SyncopeTaskFormHandler.java
@@ -60,6 +60,10 @@ public class SyncopeTaskFormHandler extends DefaultTaskFormHandler {
}
break;
+ case "password":
+ formType = new PasswordFormType();
+ break;
+
default:
}