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 2022/11/08 10:57:27 UTC

[syncope] branch master updated (d2a9a472cc -> 846bfbf3ab)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


    from d2a9a472cc Upgrading Tika
     new 309d6ef968 [SYNCOPE-1697] Fixing new Macro label
     new 846bfbf3ab [SYNCOPE-1697] Better support to find actual CommandArgs class

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tasks/MacroTaskDirectoryPanel.properties       |  1 +
 .../tasks/MacroTaskDirectoryPanel_fr_CA.properties |  1 +
 .../tasks/MacroTaskDirectoryPanel_it.properties    |  1 +
 .../tasks/MacroTaskDirectoryPanel_ja.properties    |  1 +
 .../tasks/MacroTaskDirectoryPanel_pt_BR.properties |  1 +
 .../tasks/MacroTaskDirectoryPanel_ru.properties    |  1 +
 .../implementation/ImplementationManager.java      | 31 ++++++++++++++++++----
 7 files changed, 32 insertions(+), 5 deletions(-)


[syncope] 02/02: [SYNCOPE-1697] Better support to find actual CommandArgs class

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 846bfbf3abf430564edf3c3d87b9e5f7087194c3
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Nov 8 11:57:16 2022 +0100

    [SYNCOPE-1697] Better support to find actual CommandArgs class
---
 .../implementation/ImplementationManager.java      | 31 ++++++++++++++++++----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/implementation/ImplementationManager.java b/core/spring/src/main/java/org/apache/syncope/core/spring/implementation/ImplementationManager.java
index ef93c05cf1..ea8e1455a3 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/implementation/ImplementationManager.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/implementation/ImplementationManager.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.spring.implementation;
 import groovy.lang.GroovyClassLoader;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -35,6 +36,7 @@ import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
 import org.apache.syncope.common.lib.policy.PushCorrelationRuleConf;
 import org.apache.syncope.common.lib.report.ReportletConf;
 import org.apache.syncope.common.lib.types.IdRepoImplementationType;
+import org.apache.syncope.common.lib.types.ImplementationTypesHolder;
 import org.apache.syncope.core.persistence.api.ImplementationLookup;
 import org.apache.syncope.core.persistence.api.dao.AccountRule;
 import org.apache.syncope.core.persistence.api.dao.PasswordRule;
@@ -184,6 +186,26 @@ public final class ImplementationManager {
         }
     }
 
+    @SuppressWarnings("unchecked")
+    private static Class<? extends CommandArgs> findCommandArgsClass(final Type type) {
+        if (type.getTypeName().startsWith(
+                ImplementationTypesHolder.getInstance().getValues().get(IdRepoImplementationType.COMMAND) + "<")) {
+
+            return (Class<? extends CommandArgs>) ((ParameterizedType) type).getActualTypeArguments()[0];
+        }
+
+        if (type instanceof Class) {
+            for (Type i : ((Class) type).getGenericInterfaces()) {
+                Class<? extends CommandArgs> r = findCommandArgsClass(i);
+                if (r != null) {
+                    return r;
+                }
+            }
+        }
+
+        return null;
+    }
+
     public static CommandArgs emptyArgs(final Implementation impl) throws Exception {
         if (!IdRepoImplementationType.COMMAND.equals(impl.getType())) {
             throw new IllegalArgumentException("This method can be only called on implementations");
@@ -191,12 +213,11 @@ public final class ImplementationManager {
 
         Class<Object> commandClass = getClass(impl).getLeft();
 
-        @SuppressWarnings("unchecked")
-        Class<? extends CommandArgs> commandArgsClass =
-                (Class<? extends CommandArgs>) (((ParameterizedType) commandClass.getGenericInterfaces()[0]).
-                        getActualTypeArguments()[0]);
+        Class<? extends CommandArgs> commandArgsClass = findCommandArgsClass(commandClass);
+        if (commandArgsClass != null
+                && (commandArgsClass.getEnclosingClass() == null
+                || Modifier.isStatic(commandArgsClass.getModifiers()))) {
 
-        if (commandArgsClass.getEnclosingClass() == null || Modifier.isStatic(commandArgsClass.getModifiers())) {
             return commandArgsClass.getDeclaredConstructor().newInstance();
         }
 


[syncope] 01/02: [SYNCOPE-1697] Fixing new Macro label

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 309d6ef9682612ce700d0caa60c13e68350bb007
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Nov 8 11:56:20 2022 +0100

    [SYNCOPE-1697] Fixing new Macro label
---
 .../syncope/client/console/tasks/MacroTaskDirectoryPanel.properties      | 1 +
 .../client/console/tasks/MacroTaskDirectoryPanel_fr_CA.properties        | 1 +
 .../syncope/client/console/tasks/MacroTaskDirectoryPanel_it.properties   | 1 +
 .../syncope/client/console/tasks/MacroTaskDirectoryPanel_ja.properties   | 1 +
 .../client/console/tasks/MacroTaskDirectoryPanel_pt_BR.properties        | 1 +
 .../syncope/client/console/tasks/MacroTaskDirectoryPanel_ru.properties   | 1 +
 6 files changed, 6 insertions(+)

diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel.properties b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel.properties
index 2c072ba2df..ed52486951 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel.properties
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel.properties
@@ -18,3 +18,4 @@
 command.conf=Command configuration for ${name}
 continueOnError=Continue on error
 saveExecs=Save executions
+any.new=New Macro
diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_fr_CA.properties b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_fr_CA.properties
index 2c072ba2df..ed52486951 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_fr_CA.properties
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_fr_CA.properties
@@ -18,3 +18,4 @@
 command.conf=Command configuration for ${name}
 continueOnError=Continue on error
 saveExecs=Save executions
+any.new=New Macro
diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_it.properties b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_it.properties
index 91e32ecf6e..006bf2d281 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_it.properties
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_it.properties
@@ -18,3 +18,4 @@
 command.conf=Configurazione dei comandi per ${name}
 continueOnError=Continuare in caso di errore
 saveExecs=Salvare esecuzioni
+any.new=Nuova Macro
diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ja.properties b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ja.properties
index 2c072ba2df..ed52486951 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ja.properties
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ja.properties
@@ -18,3 +18,4 @@
 command.conf=Command configuration for ${name}
 continueOnError=Continue on error
 saveExecs=Save executions
+any.new=New Macro
diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_pt_BR.properties b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_pt_BR.properties
index 2c072ba2df..ed52486951 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_pt_BR.properties
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_pt_BR.properties
@@ -18,3 +18,4 @@
 command.conf=Command configuration for ${name}
 continueOnError=Continue on error
 saveExecs=Save executions
+any.new=New Macro
diff --git a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ru.properties b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ru.properties
index 2c072ba2df..ed52486951 100644
--- a/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ru.properties
+++ b/client/idrepo/console/src/main/resources/org/apache/syncope/client/console/tasks/MacroTaskDirectoryPanel_ru.properties
@@ -18,3 +18,4 @@
 command.conf=Command configuration for ${name}
 continueOnError=Continue on error
 saveExecs=Save executions
+any.new=New Macro