ilgrosso commented on code in PR #1278:
URL: https://github.com/apache/syncope/pull/1278#discussion_r2689184341


##########
client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeWebApplication.java:
##########
@@ -240,6 +244,26 @@ protected void init() {
 
         mountPage("/login", getSignInPageClass());
 
+        //[SYNCOPE-1942]

Review Comment:
   No need to comment with issue reference, we have `git blame` for this



##########
client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/DynamicMenuStringResourceLoader.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.ui.commons;
+
+import java.util.Locale;
+import org.apache.wicket.core.util.resource.locator.IResourceNameIterator;
+import org.apache.wicket.resource.IPropertiesFactory;
+import org.apache.wicket.resource.Properties;
+import org.apache.wicket.resource.loader.ClassStringResourceLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DynamicMenuStringResourceLoader extends ClassStringResourceLoader 
{
+
+    protected static final Logger LOG = 
LoggerFactory.getLogger(DynamicMenuStringResourceLoader.class);
+
+    public DynamicMenuStringResourceLoader() {
+        super(DynamicMenuStringResourceLoader.class);
+    }
+
+    @Override
+    public String loadStringResource(
+            final Class<?> clazz,
+            final String key,
+            final Locale locale,
+            final String style,
+            final String variation) {
+
+        if (key != null && key.startsWith("menu.")) {
+            Class<?> pageClass = DynamicMenuRegister.getPage(key);
+
+            if (pageClass != null) {
+                final String path = pageClass.getName().replace('.', '/');
+                final IResourceNameIterator iter = 
newResourceNameIterator(path, locale, style, variation);
+                final IPropertiesFactory propertiesFactory = 
getPropertiesFactory();
+
+                while (iter.hasNext()) {

Review Comment:
   Use streams, not iterators



##########
client/idrepo/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties:
##########
@@ -16,7 +16,7 @@
 # under the License.
 home=Home
 version=Version
-domain=Domain
+domain=Domain   

Review Comment:
   Please revert this space-adding change



##########
client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeWebApplication.java:
##########
@@ -203,6 +206,26 @@ public IResource getResource() {
             }
         }
 
+        //[SYNCOPE-1942]

Review Comment:
   Same as above



##########
client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/DynamicMenuRegister.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.ui.commons;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public final class DynamicMenuRegister {

Review Comment:
   Turn this class into a bean.
   
   You can take 
https://github.com/apache/syncope/blob/master/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/MIMETypesLoader.java
 as reference



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to