You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2016/08/12 14:16:05 UTC
syncope git commit: [SYNCOPE-920] provides recipient provider
extension class name selection feature
Repository: syncope
Updated Branches:
refs/heads/master 660aa70ad -> 4545e3f26
[SYNCOPE-920] provides recipient provider extension class name selection feature
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4545e3f2
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4545e3f2
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4545e3f2
Branch: refs/heads/master
Commit: 4545e3f26c8e8c2f0cb581de7d598f7ea6608a3b
Parents: 660aa70a
Author: fmartelli <fa...@gmail.com>
Authored: Fri Aug 12 16:15:47 2016 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Fri Aug 12 16:15:47 2016 +0200
----------------------------------------------------------------------
.../NotificationWizardBuilder.java | 51 ++++++++++++++------
.../NotificationWizardBuilder$Recipients.html | 3 ++
...ificationWizardBuilder$Recipients.properties | 3 +-
...cationWizardBuilder$Recipients_it.properties | 3 +-
...ionWizardBuilder$Recipients_pt_BR.properties | 3 +-
...cationWizardBuilder$Recipients_ru.properties | 3 +-
6 files changed, 46 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/4545e3f2/client/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java
index cf97161..ac69b7c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/notifications/NotificationWizardBuilder.java
@@ -27,6 +27,7 @@ import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.panels.search.AbstractSearchPanel;
import org.apache.syncope.client.console.panels.search.AnyObjectSearchPanel;
@@ -62,6 +63,7 @@ import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.ResourceModel;
@@ -214,22 +216,22 @@ public class NotificationWizardBuilder extends AjaxWizardBuilder<NotificationWra
new AnyTypeRestClient().list(),
EntityTOUtils.<AnyTypeTO>keyTransformer(), new ArrayList<String>());
- final AjaxDropDownChoicePanel<String> type =
- new AjaxDropDownChoicePanel<>("about", "about", new Model<String>() {
+ final AjaxDropDownChoicePanel<String> type = new AjaxDropDownChoicePanel<>("about", "about",
+ new Model<String>() {
- private static final long serialVersionUID = -2350296434572623272L;
+ private static final long serialVersionUID = -2350296434572623272L;
- @Override
- public String getObject() {
- return model.getObject().getLeft();
- }
+ @Override
+ public String getObject() {
+ return model.getObject().getLeft();
+ }
- @Override
- public void setObject(final String object) {
- model.setObject(Pair.of(object, model.getObject().getRight()));
- }
+ @Override
+ public void setObject(final String object) {
+ model.setObject(Pair.of(object, model.getObject().getRight()));
+ }
- });
+ });
type.setChoices(anyTypeTOs);
type.addRequiredLabel();
add(type);
@@ -300,8 +302,8 @@ public class NotificationWizardBuilder extends AjaxWizardBuilder<NotificationWra
aboutContainer.setOutputMarkupId(true);
add(aboutContainer);
- final IModel<List<Pair<String, List<SearchClause>>>> model =
- new PropertyModel<>(modelObject, "aboutClauses");
+ final IModel<List<Pair<String, List<SearchClause>>>> model
+ = new PropertyModel<>(modelObject, "aboutClauses");
aboutContainer.add(new MultiPanel<Pair<String, List<SearchClause>>>("abouts", "abouts", model, false) {
@@ -343,12 +345,23 @@ public class NotificationWizardBuilder extends AjaxWizardBuilder<NotificationWra
private static final long serialVersionUID = -7709805590497687958L;
+ private final IModel<List<String>> recipientProviders = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157447L;
+
+ @Override
+ protected List<String> load() {
+ return new ArrayList<>(
+ SyncopeConsoleSession.get().getPlatformInfo().getNotificationRecipientsProviders());
+ }
+ };
+
public Recipients(final NotificationWrapper modelObject) {
final NotificationTO notificationTO = modelObject.getInnerObject();
final boolean createFlag = notificationTO.getKey() == null;
- final AjaxTextFieldPanel staticRecipientsFieldPanel =
- new AjaxTextFieldPanel("panel", "staticRecipients", new Model<String>());
+ final AjaxTextFieldPanel staticRecipientsFieldPanel = new AjaxTextFieldPanel("panel", "staticRecipients",
+ new Model<String>());
staticRecipientsFieldPanel.addValidator(EmailAddressValidator.getInstance());
final MultiFieldPanel<String> staticRecipients = new MultiFieldPanel.Builder<>(
@@ -362,6 +375,12 @@ public class NotificationWizardBuilder extends AjaxWizardBuilder<NotificationWra
required(false).build("recipients");
add(recipients);
+ AjaxDropDownChoicePanel<String> recipientsProviderClassName = new AjaxDropDownChoicePanel<>(
+ "recipientsProviderClassName", "recipientsProviderClassName",
+ new PropertyModel<String>(notificationTO, "recipientsProviderClassName"), false);
+ recipientsProviderClassName.setChoices(recipientProviders.getObject());
+ add(recipientsProviderClassName);
+
final AjaxCheckBoxPanel selfAsRecipient = new AjaxCheckBoxPanel("selfAsRecipient",
getString("selfAsRecipient"), new PropertyModel<Boolean>(notificationTO, "selfAsRecipient"));
add(selfAsRecipient);
http://git-wip-us.apache.org/repos/asf/syncope/blob/4545e3f2/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.html b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.html
index b8387d6..1910ce6 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.html
@@ -26,6 +26,9 @@ under the License.
<div class="form-group form-group-inline">
<span wicket:id="recipients">[recipients]</span>
</div>
+ <div class="form-group">
+ <span wicket:id="recipientsProviderClassName">[recipientsProviderClassName]</span>
+ </div>
<div id="userFilter" class="form-group box">
<div id="title">
<span for="userNotifications"><wicket:message key="userNotifications"/></span>
http://git-wip-us.apache.org/repos/asf/syncope/blob/4545e3f2/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.properties b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.properties
index dec4920..b94947e 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients.properties
@@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
recipients=Recipients
-staticRecipients=Recipients
+recipientsProviderClassName=Notification recipient provider
+staticRecipients=Static recipients
selfAsRecipient=Include users matching About
userNotifications=User notifications
userNotificationsWarning=Do not select this checkbox unless events are not targeted at users
http://git-wip-us.apache.org/repos/asf/syncope/blob/4545e3f2/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_it.properties
index 4ee971c..bc98ce5 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_it.properties
@@ -15,8 +15,9 @@
# specific language governing permissions and limitations
# under the License.
recipients=Destinatari
-staticRecipients=Destinatari
+staticRecipients=Destinatari fissi
selfAsRecipient=Includi i soggetti
userNotifications=Notifiche utente
userNotificationsWarning=Non selezionare questa checkbox se gli eventi catturati non riguardano espressamente utenti
search=Cerca destinatari
+recipientsProviderClassName=Provider destinatari notifica
http://git-wip-us.apache.org/repos/asf/syncope/blob/4545e3f2/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_pt_BR.properties
index 33da973..43f0cfc 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_pt_BR.properties
@@ -15,8 +15,9 @@
# specific language governing permissions and limitations
# under the License.
recipients=Destinat\u00e1rios
-staticRecipients=Destinat\u00e1rios
+staticRecipients=Static recipients
selfAsRecipient=Incluir usu\u00e1rios relacionados Sobre
userNotifications=Notifica\u00e7\u00f5es do usu\u00e1rio
userNotificationsWarning=N\u00e3o selecione esta op\u00e7\u00e3o a menos que os eventos n\u00e3o s\u00e3o direcionados a usu\u00e1rios
search=Pesquisa para os destinat\u00e1rios
+recipientsProviderClassName=Notification recipient provider
http://git-wip-us.apache.org/repos/asf/syncope/blob/4545e3f2/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_ru.properties
index ffa20ac..bf94d76 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/notifications/NotificationWizardBuilder$Recipients_ru.properties
@@ -16,8 +16,9 @@
# under the License.
#
recipients=\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0438
-staticRecipients=\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0438
+staticRecipients=Static recipients
selfAsRecipient=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435
userNotifications=\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439
userNotificationsWarning=\u041d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433, \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439
search=\u041f\u043e\u0438\u0441\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439
+recipientsProviderClassName=Notification recipient provider