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 2016/01/14 18:18:32 UTC
[1/2] syncope git commit: [SYNCOPE-746] Almost done: item in left
menu under 'Extensions' does not remain active after click
Repository: syncope
Updated Branches:
refs/heads/master 9536ffa91 -> 7cb3c322e
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
deleted file mode 100644
index 1567831..0000000
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRouteRestClient.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.console.rest;
-
-import java.util.List;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.common.lib.to.CamelRouteTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.rest.api.service.CamelRouteService;
-import org.springframework.stereotype.Component;
-
-@Component
-public class CamelRouteRestClient extends BaseRestClient {
-
- private static final long serialVersionUID = -2018208424159468912L;
-
- public List<CamelRouteTO> list(final AnyTypeKind anyTypeKind) {
- return getService(CamelRouteService.class).list(anyTypeKind);
- }
-
- public CamelRouteTO read(final String key) {
- return getService(CamelRouteService.class).read(key);
- }
-
- public void update(final String key, final String content) {
- CamelRouteTO routeTO = read(key);
- routeTO.setContent(content);
- getService(CamelRouteService.class).update(routeTO);
- }
-
- public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
- return anyTypeKind == AnyTypeKind.USER
- ? SyncopeConsoleSession.get().getSyncopeTO().getUserProvisioningManager().contains("Camel")
- : anyTypeKind == AnyTypeKind.ANY_OBJECT
- ? SyncopeConsoleSession.get().getSyncopeTO().getAnyObjectProvisioningManager().contains("Camel")
- : SyncopeConsoleSession.get().getSyncopeTO().getGroupProvisioningManager().contains("Camel");
-
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
new file mode 100644
index 0000000..285b27d
--- /dev/null
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
@@ -0,0 +1,55 @@
+/*
+ * 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.console.rest;
+
+import java.util.List;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.common.lib.to.CamelRouteTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.rest.api.service.CamelRouteService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CamelRoutesRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -2018208424159468912L;
+
+ public List<CamelRouteTO> list(final AnyTypeKind anyTypeKind) {
+ return getService(CamelRouteService.class).list(anyTypeKind);
+ }
+
+ public CamelRouteTO read(final String key) {
+ return getService(CamelRouteService.class).read(key);
+ }
+
+ public void update(final String key, final String content) {
+ CamelRouteTO routeTO = read(key);
+ routeTO.setContent(content);
+ getService(CamelRouteService.class).update(routeTO);
+ }
+
+ public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
+ return anyTypeKind == AnyTypeKind.USER
+ ? SyncopeConsoleSession.get().getSyncopeTO().getUserProvisioningManager().contains("Camel")
+ : anyTypeKind == AnyTypeKind.ANY_OBJECT
+ ? SyncopeConsoleSession.get().getSyncopeTO().getAnyObjectProvisioningManager().contains("Camel")
+ : SyncopeConsoleSession.get().getSyncopeTO().getGroupProvisioningManager().contains("Camel");
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.html
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.html b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.html
deleted file mode 100644
index 63ae4f4..0000000
--- a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--
-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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <link rel="stylesheet" type="text/css" href="webjars/codemirror/${codemirror.version}/lib/codemirror.css"/>
-
- <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/lib/codemirror.js"></script>
- <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/mode/xml/xml.js"></script>
- <script type="text/javascript">
- function updateTextArea(editor) {
- document.getElementById("routeDefForm").elements["content"].value = editor.getValue();
- }
- </script>
- <style>
- .w_content_3 {
- padding: 0;
- color: #333333;
- font-family: Verdana,Tahoma,sans-serif;
- font-size: 100%;
- border: 1px solid #BBBBBB;
- padding: 1%;
- }
- </style>
- </wicket:head>
- <wicket:extend>
- <div style="padding: 1%;">
- <div class="w_content_3">
- <p class="ui-widget ui-corner-all ui-widget-header">
- <wicket:message key="title"/>
- </p>
- <form wicket:id="routeDefForm" id="routeDefForm">
- <textarea wicket:id="content" id="content" name="content" style="width: 100%; height: 350px;">
- </textarea>
- <div style="margin: 10px;">
- <input type="submit"
- class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="apply"
- onclick=""/>
- </div>
- </form>
- </div>
- </div>
- <script>
- window.onload = function () {
- var editor = CodeMirror.fromTextArea(document.getElementById("content"), {lineNumbers: true});
- editor.on("change", updateTextArea);
- }
- </script>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.properties
deleted file mode 100644
index 8273ee0..0000000
--- a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-title=Camel route
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_it.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_it.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_it.properties
deleted file mode 100644
index cc9b275..0000000
--- a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_it.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-title=Rotta di Camel
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_pt_BR.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_pt_BR.properties
deleted file mode 100644
index eceba57..0000000
--- a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRouteModalPage_pt_BR.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-title=Rota de Camel
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.html
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.html b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.html
new file mode 100644
index 0000000..142df33
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div class="wrapper">
+ <div class="admin-content-page" wicket:id="content">
+
+ <div class="box box-solid box-primary">
+ <div class="box-header with-border">
+ <h3 class="box-title">
+ <span wicket:id="header"></span>
+ </h3>
+ </div>
+ <div class="box-body">
+ <div class="realms">
+ <form>
+ <div wicket:id="tabbedPanel"></div>
+ </form>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.properties
new file mode 100644
index 0000000..f8c2fd1
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage.properties
@@ -0,0 +1,17 @@
+# 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.
+header_title=Camel Routes
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_it.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_it.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_it.properties
new file mode 100644
index 0000000..f8c2fd1
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_it.properties
@@ -0,0 +1,17 @@
+# 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.
+header_title=Camel Routes
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_pt_BR.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_pt_BR.properties
new file mode 100644
index 0000000..f8c2fd1
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPage_pt_BR.properties
@@ -0,0 +1,17 @@
+# 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.
+header_title=Camel Routes
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.html
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.html b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.html
new file mode 100644
index 0000000..3b0b255
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.html
@@ -0,0 +1,66 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="webjars/codemirror/${codemirror.version}/lib/codemirror.css"/>
+
+ <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/lib/codemirror.js"></script>
+ <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/mode/xml/xml.js"></script>
+ <script type="text/javascript">
+ function updateTextArea(editor) {
+ document.getElementById("routeDefForm").elements["content"].value = editor.getValue();
+ }
+ </script>
+ <style>
+ .w_content_3 {
+ padding: 0;
+ color: #333333;
+ font-family: Verdana,Tahoma,sans-serif;
+ font-size: 100%;
+ border: 1px solid #BBBBBB;
+ padding: 1%;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+ <div style="padding: 1%;">
+ <div class="w_content_3">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/>
+ </p>
+ <form wicket:id="routeDefForm" id="routeDefForm">
+ <textarea wicket:id="content" id="content" name="content" style="width: 100%; height: 350px;">
+ </textarea>
+ <div style="padding-top: 1%;">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"
+ onclick=""/>
+ </div>
+ </form>
+ </div>
+ </div>
+ <script>
+ window.onload = function () {
+ var editor = CodeMirror.fromTextArea(document.getElementById("content"), {lineNumbers: true});
+ editor.on("change", updateTextArea);
+ }
+ </script>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.properties
new file mode 100644
index 0000000..31bf6a7
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.properties
@@ -0,0 +1,19 @@
+# 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.
+title=Camel route
+submit=Save
+cancel=Close
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_it.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_it.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_it.properties
new file mode 100644
index 0000000..7d2f1ec
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_it.properties
@@ -0,0 +1,19 @@
+# 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.
+title=Rotta di Camel
+submit=Salva
+cancel=Chiudi
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_pt_BR.properties b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_pt_BR.properties
new file mode 100644
index 0000000..fa7217f
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutesPopupPage_pt_BR.properties
@@ -0,0 +1,19 @@
+# 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.
+title=Rota de Camel
+submit=Salvar
+cancel=Fechar
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutePanel.html
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutePanel.html b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutePanel.html
deleted file mode 100644
index f1ba455..0000000
--- a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutePanel.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
-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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="camelRoutesContainer">
- <table class="ui-widget ui-widget-content table-hover" wicket:id="camelRouteTable"/>
- </span>
- </div>
- <div wicket:id="editCamelRouteWin">[Show modal window for editing Camel route]</div>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesPanel.html
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesPanel.html b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesPanel.html
new file mode 100644
index 0000000..0bd1210
--- /dev/null
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesPanel.html
@@ -0,0 +1,23 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div wicket:id="editCamelRouteWin">[Show modal window for editing Camel route]</div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
index 4408eb1..8dffed4 100644
--- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
+++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
@@ -18,12 +18,10 @@
*/
package org.apache.syncope.fit.console.reference;
-import static org.apache.syncope.client.console.init.ConsoleInitializer.CLASSPATH_LOOKUP;
-import static org.apache.syncope.client.console.init.ConsoleInitializer.MIMETYPES_LOADER;
-
import javax.servlet.ServletContext;
import org.apache.syncope.client.console.SyncopeConsoleApplication;
import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
+import org.apache.syncope.client.console.init.ConsoleInitializer;
import org.apache.syncope.client.console.init.MIMETypesLoader;
import org.apache.syncope.client.console.pages.Login;
import org.apache.wicket.util.tester.FormTester;
@@ -54,12 +52,12 @@ public abstract class AbstractITCase {
final ServletContext ctx = getServletContext();
final ClassPathScanImplementationLookup lookup = new ClassPathScanImplementationLookup();
lookup.load();
- ctx.setAttribute(CLASSPATH_LOOKUP, lookup);
+ ctx.setAttribute(ConsoleInitializer.CLASSPATH_LOOKUP, lookup);
final MIMETypesLoader mimeTypes = new MIMETypesLoader();
mimeTypes.load();
- ctx.setAttribute(MIMETYPES_LOADER, mimeTypes);
-
+ ctx.setAttribute(ConsoleInitializer.MIMETYPES_LOADER, mimeTypes);
+
super.init();
}
};
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/BaseITCase.java
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/BaseITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/BaseITCase.java
index 6457963..59fed66 100644
--- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/BaseITCase.java
+++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/BaseITCase.java
@@ -18,10 +18,6 @@
*/
package org.apache.syncope.fit.console.reference;
-import static org.apache.syncope.fit.console.reference.AbstractITCase.ADMIN;
-import static org.apache.syncope.fit.console.reference.AbstractITCase.PASSWORD;
-
-import org.apache.syncope.client.console.pages.CamelRoutes;
import org.apache.syncope.client.console.pages.Dashboard;
import org.apache.syncope.client.console.pages.Layouts;
import org.apache.syncope.client.console.pages.Login;
@@ -94,8 +90,5 @@ public class BaseITCase extends AbstractITCase {
wicketTester.clickLink("configurationLI:configurationUL:notificationsLI:notifications");
wicketTester.assertRenderedPage(Notifications.class);
-
- wicketTester.clickLink("camelroutesLI:camelroutes");
- wicketTester.assertRenderedPage(CamelRoutes.class);
}
}
[2/2] syncope git commit: [SYNCOPE-746] Almost done: item in left
menu under 'Extensions' does not remain active after click
Posted by il...@apache.org.
[SYNCOPE-746] Almost done: item in left menu under 'Extensions' does not remain active after click
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/7cb3c322
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/7cb3c322
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/7cb3c322
Branch: refs/heads/master
Commit: 7cb3c322e08eaf4fcb94c02485962ce92f98a00d
Parents: 9536ffa
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Jan 14 18:18:16 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Jan 14 18:18:16 2016 +0100
----------------------------------------------------------------------
.../client/console/annotations/ExtPage.java | 48 +++++
.../console/annotations/ExtensionPanel.java | 34 ----
.../client/console/commons/Constants.java | 2 +-
.../init/ClassPathScanImplementationLookup.java | 55 ++++--
.../client/console/pages/AbstractExtPage.java | 34 ++++
.../syncope/client/console/pages/BasePage.java | 36 +++-
.../client/console/pages/CamelRoutes.java | 30 ---
.../syncope/client/console/pages/Logs.java | 6 +-
.../syncope/client/console/pages/Roles.java | 9 +-
.../client/console/pages/SecurityQuestions.java | 31 +--
.../console/panels/AbstractExtensionPanel.java | 34 ----
.../panels/AbstractSearchResultPanel.java | 1 -
.../console/panels/AnyTypeClassesPanel.java | 2 +-
.../client/console/panels/AnyTypePanel.java | 5 +-
.../console/panels/RealmSidebarPanel.java | 2 -
.../console/panels/RelationshipTypePanel.java | 9 +-
.../client/console/panels/SchemaTypePanel.java | 4 +-
.../console/panels/SecurityQuestionsPanel.java | 20 +-
.../console/rest/AnyObjectRestClient.java | 3 -
.../client/console/rest/RoleRestClient.java | 2 -
.../console/topology/TopologyTogglePanel.java | 2 -
.../client/console/wizards/any/StatusPanel.java | 11 +-
.../syncope/client/console/pages/BasePage.html | 7 +-
.../client/console/pages/BasePopupPage.html | 5 -
.../client/console/pages/CamelRoutes.html | 39 ----
.../client/console/pages/SecurityQuestions.html | 1 -
.../panels/AbstractSearchResultPanel.html | 1 +
.../syncope/client/console/panels/Realm.html | 11 +-
.../console/pages/CamelRouteModalPage.java | 93 ---------
.../client/console/pages/CamelRoutesPage.java | 102 ++++++++++
.../console/pages/CamelRoutesPopupPage.java | 76 +++++++
.../client/console/panels/CamelRoutePanel.java | 176 -----------------
.../client/console/panels/CamelRoutesPanel.java | 196 +++++++++++++++++++
.../console/rest/CamelRouteRestClient.java | 55 ------
.../console/rest/CamelRoutesRestClient.java | 55 ++++++
.../console/pages/CamelRouteModalPage.html | 66 -------
.../pages/CamelRouteModalPage.properties | 17 --
.../pages/CamelRouteModalPage_it.properties | 17 --
.../pages/CamelRouteModalPage_pt_BR.properties | 17 --
.../client/console/pages/CamelRoutesPage.html | 43 ++++
.../console/pages/CamelRoutesPage.properties | 17 ++
.../console/pages/CamelRoutesPage_it.properties | 17 ++
.../pages/CamelRoutesPage_pt_BR.properties | 17 ++
.../console/pages/CamelRoutesPopupPage.html | 66 +++++++
.../pages/CamelRoutesPopupPage.properties | 19 ++
.../pages/CamelRoutesPopupPage_it.properties | 19 ++
.../pages/CamelRoutesPopupPage_pt_BR.properties | 19 ++
.../client/console/panels/CamelRoutePanel.html | 28 ---
.../client/console/panels/CamelRoutesPanel.html | 23 +++
.../fit/console/reference/AbstractITCase.java | 10 +-
.../fit/console/reference/BaseITCase.java | 7 -
51 files changed, 866 insertions(+), 733 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtPage.java b/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtPage.java
new file mode 100644
index 0000000..32587c9
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtPage.java
@@ -0,0 +1,48 @@
+/*
+ * 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.console.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ExtPage {
+
+ /**
+ * @return the label shown under the "Extensions" menu item, on the left pane
+ */
+ String label();
+
+ /**
+ * @return the icon shown next to the label, under the "Extensions" menu item, on the left pane;
+ * check https://fortawesome.github.io/Font-Awesome/icons/ for more
+ */
+ String icon() default "fa-circle-o";
+
+ /**
+ * @return the priority used to determine the display order under the "Extensions" menu item, on the left pane; the
+ * higher value, the higher rank
+ */
+ int priority() default 0;
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtensionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtensionPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtensionPanel.java
deleted file mode 100644
index 5546d65..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/annotations/ExtensionPanel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.console.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface ExtensionPanel {
-
- String value();
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
index e172bd4..60a1f58 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
@@ -58,7 +58,7 @@ public final class Constants {
public static final String PREF_ANYTYPE_PAGINATOR_ROWS = "anytype.paginator.rows";
- public static final String PREF_SECURITY_QUESTIONS_PAGINATOR_ROWS = "secutiry.questions.paginator.rows";
+ public static final String PREF_SECURITY_QUESTIONS_PAGINATOR_ROWS = "security.questions.paginator.rows";
public static final String PREF_RELATIONSHIPTYPE_PAGINATOR_ROWS = "relationshiptype.painator.rows";
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
index 5ec7e58..67bbe20 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
@@ -21,11 +21,13 @@ package org.apache.syncope.client.console.init;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.panels.AbstractExtensionPanel;
+import org.apache.syncope.client.console.pages.AbstractExtPage;
import org.apache.syncope.client.console.annotations.BinaryPreview;
+import org.apache.syncope.client.console.annotations.ExtPage;
import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
import org.slf4j.Logger;
@@ -43,18 +45,18 @@ public class ClassPathScanImplementationLookup {
private List<Class<? extends AbstractBinaryPreviewer>> previewers;
- private List<Class<? extends AbstractExtensionPanel>> extPanels;
+ private List<Class<? extends AbstractExtPage>> extPages;
@SuppressWarnings("unchecked")
public void load() {
pages = new ArrayList<>();
previewers = new ArrayList<>();
- extPanels = new ArrayList<>();
+ extPages = new ArrayList<>();
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
scanner.addIncludeFilter(new AssignableTypeFilter(AbstractBinaryPreviewer.class));
- scanner.addIncludeFilter(new AssignableTypeFilter(AbstractExtensionPanel.class));
+ scanner.addIncludeFilter(new AssignableTypeFilter(AbstractExtPage.class));
for (BeanDefinition bd : scanner.findCandidateComponents(StringUtils.EMPTY)) {
try {
@@ -62,12 +64,19 @@ public class ClassPathScanImplementationLookup {
bd.getBeanClassName(), ClassUtils.getDefaultClassLoader());
boolean isAbsractClazz = Modifier.isAbstract(clazz.getModifiers());
- if (BasePage.class.isAssignableFrom(clazz) && !isAbsractClazz) {
- pages.add((Class<? extends BasePage>) clazz);
- } else if (AbstractBinaryPreviewer.class.isAssignableFrom(clazz) && !isAbsractClazz) {
- previewers.add((Class<? extends AbstractBinaryPreviewer>) clazz);
- } else if (AbstractExtensionPanel.class.isAssignableFrom(clazz) && !isAbsractClazz) {
- extPanels.add((Class<? extends AbstractExtensionPanel>) clazz);
+ if (!isAbsractClazz) {
+ if (AbstractExtPage.class.isAssignableFrom(clazz)) {
+ if (clazz.isAnnotationPresent(ExtPage.class)) {
+ extPages.add((Class<? extends AbstractExtPage>) clazz);
+ } else {
+ LOG.error("Could not find annotation {} in {}, ignoring",
+ ExtPage.class.getName(), clazz.getName());
+ }
+ } else if (BasePage.class.isAssignableFrom(clazz)) {
+ pages.add((Class<? extends BasePage>) clazz);
+ } else if (AbstractBinaryPreviewer.class.isAssignableFrom(clazz)) {
+ previewers.add((Class<? extends AbstractBinaryPreviewer>) clazz);
+ }
}
} catch (Throwable t) {
LOG.warn("Could not inspect class {}", bd.getBeanClassName(), t);
@@ -75,10 +84,28 @@ public class ClassPathScanImplementationLookup {
}
pages = Collections.unmodifiableList(pages);
previewers = Collections.unmodifiableList(previewers);
- extPanels = Collections.unmodifiableList(extPanels);
+
+ Collections.sort(extPages, new Comparator<Class<? extends AbstractExtPage>>() {
+
+ @Override
+ public int compare(
+ final Class<? extends AbstractExtPage> o1,
+ final Class<? extends AbstractExtPage> o2) {
+
+ int prio1 = o1.getAnnotation(ExtPage.class).priority();
+ int prio2 = o2.getAnnotation(ExtPage.class).priority();
+
+ return prio1 > prio2
+ ? 1
+ : prio1 == prio2
+ ? 0
+ : -1;
+ }
+ });
+ extPages = Collections.unmodifiableList(extPages);
LOG.debug("Binary previewers found: {}", previewers);
- LOG.debug("Extension panels found: {}", extPanels);
+ LOG.debug("Extension pages found: {}", extPages);
}
public Class<? extends AbstractBinaryPreviewer> getPreviewerClass(final String mimeType) {
@@ -103,8 +130,8 @@ public class ClassPathScanImplementationLookup {
return previewers;
}
- public List<Class<? extends AbstractExtensionPanel>> getExtPanelClasses() {
- return extPanels;
+ public List<Class<? extends AbstractExtPage>> getExtPageClasses() {
+ return extPages;
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractExtPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractExtPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractExtPage.java
new file mode 100644
index 0000000..1a8949d
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractExtPage.java
@@ -0,0 +1,34 @@
+/*
+ * 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.console.pages;
+
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public abstract class AbstractExtPage extends BasePage {
+
+ private static final long serialVersionUID = 4627828052717627159L;
+
+ public AbstractExtPage() {
+ super();
+ }
+
+ public AbstractExtPage(final PageParameters parameters) {
+ super(parameters);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index a684735..c3228be 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -20,14 +20,18 @@ package org.apache.syncope.client.console.pages;
import org.apache.syncope.client.console.SyncopeConsoleApplication;
import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.annotations.ExtPage;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.NotificationAwareComponent;
+import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
+import org.apache.syncope.client.console.init.ConsoleInitializer;
import org.apache.syncope.client.console.panels.NotificationPanel;
import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
import org.apache.syncope.client.console.topology.Topology;
import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -43,6 +47,8 @@ import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -165,9 +171,33 @@ public class BasePage extends WebPage implements NotificationAwareComponent, IAj
liContainer.add(new BookmarkablePageLink<>("notifications", Notifications.class));
MetaDataRoleAuthorizationStrategy.authorize(liContainer, WebPage.RENDER, StandardEntitlement.NOTIFICATION_LIST);
- liContainer = new WebMarkupContainer(getLIContainerId("camelroutes"));
- add(liContainer);
- liContainer.add(new BookmarkablePageLink<>("camelroutes", CamelRoutes.class));
+ ClassPathScanImplementationLookup classPathScanImplementationLookup =
+ (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().
+ getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
+ ListView<Class<? extends AbstractExtPage>> extPages = new ListView<Class<? extends AbstractExtPage>>(
+ "extPages", classPathScanImplementationLookup.getExtPageClasses()) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<Class<? extends AbstractExtPage>> item) {
+ WebMarkupContainer liContainer = new WebMarkupContainer("extPageLI");
+ item.add(liContainer);
+
+ BookmarkablePageLink<?> link = new BookmarkablePageLink<>("extPage", item.getModelObject());
+ liContainer.add(link);
+
+ ExtPage ann = item.getModelObject().getAnnotation(ExtPage.class);
+
+ link.add(new Label("extPageLabel", ann.label()));
+
+ Label extPageIcon = new Label("extPageIcon");
+ extPageIcon.add(new AttributeModifier("class", "fa " + ann.icon()));
+ link.add(extPageIcon);
+ }
+ };
+ extPages.setOutputMarkupId(true);
+ add(extPages);
add(new Label("domain", SyncopeConsoleSession.get().getDomain()));
add(new BookmarkablePageLink<Page>("logout", Logout.class));
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutes.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutes.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutes.java
deleted file mode 100644
index cdb6915..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutes.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.console.pages;
-
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-public class CamelRoutes extends BasePage {
-
- private static final long serialVersionUID = -1100228004207271271L;
-
- public CamelRoutes(final PageParameters parameters) {
- super(parameters);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/pages/Logs.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Logs.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Logs.java
index c3d61fd..6823583 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Logs.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Logs.java
@@ -35,15 +35,13 @@ public class Logs extends BasePage {
private static final long serialVersionUID = -1100228004207271271L;
- private final AjaxBootstrapTabbedPanel<ITab> tabbedPanel;
-
public Logs(final PageParameters parameters) {
super(parameters);
final WebMarkupContainer content = new WebMarkupContainer("content");
content.add(new Label("header", getString("header_title")));
content.setOutputMarkupId(true);
- tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList());
+ AjaxBootstrapTabbedPanel<ITab> tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList());
content.add(tabbedPanel);
add(content);
@@ -51,7 +49,7 @@ public class Logs extends BasePage {
private List<ITab> buildTabList() {
- final List<ITab> tabs = new ArrayList<>();
+ final List<ITab> tabs = new ArrayList<>(2);
tabs.add(new AbstractTab(new Model<>("Core")) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
index 8f7e7f1..913fd71 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
@@ -41,13 +41,14 @@ public class Roles extends BasePage {
content.setOutputMarkupId(true);
add(content);
- final WizardMgtPanel<RoleHandler> roleSearchResultPanel
- = new RoleSearchResultPanel.Builder(getPageReference()) {
+ WizardMgtPanel<RoleHandler> roleSearchResultPanel =
+ new RoleSearchResultPanel.Builder(getPageReference()) {
private static final long serialVersionUID = -5960765294082359003L;
- }.addNewItemPanelBuilder(new RoleWizardBuilder(BaseModal.CONTENT_ID, new RoleTO(), getPageReference()), true)
- .build("roles");
+ }.disableCheckBoxes().addNewItemPanelBuilder(
+ new RoleWizardBuilder(BaseModal.CONTENT_ID, new RoleTO(), getPageReference()), true).
+ build("roles");
content.add(roleSearchResultPanel);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestions.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestions.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestions.java
index 2247b35..40dce7c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestions.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestions.java
@@ -19,10 +19,6 @@
package org.apache.syncope.client.console.pages;
import org.apache.syncope.client.console.panels.SecurityQuestionsPanel;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.SecurityQuestionTO;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.mapper.parameter.PageParameters;
@@ -31,10 +27,6 @@ public class SecurityQuestions extends BasePage {
private static final long serialVersionUID = 931085006718655535L;
- private final SecurityQuestionsPanel securityQuestionsPanel;
-
- private final BaseModal<SecurityQuestionTO> securityQuestionModal;
-
public SecurityQuestions(final PageParameters parameters) {
super(parameters);
@@ -43,29 +35,10 @@ public class SecurityQuestions extends BasePage {
content.setOutputMarkupId(true);
add(content);
- securityQuestionModal = new BaseModal<>("securityQuestionModal");
- addWindowWindowClosedCallback(securityQuestionModal);
- add(securityQuestionModal);
-
- securityQuestionsPanel = new SecurityQuestionsPanel("securityQuestionPanel", getPageReference());
+ SecurityQuestionsPanel securityQuestionsPanel =
+ new SecurityQuestionsPanel("securityQuestionPanel", getPageReference());
securityQuestionsPanel.setOutputMarkupId(true);
content.add(securityQuestionsPanel);
}
-
- private void addWindowWindowClosedCallback(final BaseModal<?> modal) {
- modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
- private static final long serialVersionUID = 8804221891699487139L;
-
- @Override
- public void onClose(final AjaxRequestTarget target) {
- target.add(securityQuestionsPanel);
- modal.show(false);
-
- ((BasePage) getPage()).getNotificationPanel().refresh(target);
- }
- }
- );
- }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractExtensionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractExtensionPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractExtensionPanel.java
deleted file mode 100644
index 87af2ff..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractExtensionPanel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.console.panels;
-
-import org.apache.wicket.PageReference;
-import org.apache.wicket.markup.html.panel.Panel;
-
-public abstract class AbstractExtensionPanel extends Panel {
-
- private static final long serialVersionUID = 4627828052717627159L;
-
- protected PageReference pageref;
-
- public AbstractExtensionPanel(final String id, final PageReference pageref) {
- super(id);
- this.pageref = pageref;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
index 0c21416..a3291b0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
@@ -92,7 +92,6 @@ public abstract class AbstractSearchResultPanel<
protected final BasePage page;
protected AbstractSearchResultPanel(final String id, final Builder<T, W, E> builder) {
-
super(id, true);
setOutputMarkupId(true);
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java
index 382958a..e4fca73 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypeClassesPanel.java
@@ -74,7 +74,7 @@ public class AnyTypeClassesPanel extends AbstractTypesPanel<AnyTypeClassTO, AnyT
protected WizardMgtPanel<AnyTypeClassTO> newInstance(final String id) {
return new AnyTypeClassesPanel(id, this);
}
- });
+ }.disableCheckBoxes());
this.addNewItemPanelBuilder(new AbstractModalPanelBuilder<AnyTypeClassTO>(
BaseModal.CONTENT_ID, new AnyTypeClassTO(), pageRef) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java
index 85cac81..b7caf9c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyTypePanel.java
@@ -18,9 +18,6 @@
*/
package org.apache.syncope.client.console.panels;
-import static org.apache.syncope.client.console.panels.AbstractModalPanel.LOG;
-import static org.apache.wicket.Component.ENABLE;
-
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -77,7 +74,7 @@ public class AnyTypePanel extends AbstractTypesPanel<AnyTypeTO, AnyTypeProvider>
protected WizardMgtPanel<AnyTypeTO> newInstance(final String id) {
return new AnyTypePanel(id, this);
}
- });
+ }.disableCheckBoxes());
this.addNewItemPanelBuilder(new AbstractModalPanelBuilder<AnyTypeTO>(
BaseModal.CONTENT_ID, new AnyTypeTO(), pageRef) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
index f1a6fee..6436354 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.panels;
-import static org.apache.wicket.Component.ENABLE;
-
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/RelationshipTypePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RelationshipTypePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RelationshipTypePanel.java
index 0bafa60..64570d6 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RelationshipTypePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RelationshipTypePanel.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.panels;
-import static org.apache.syncope.client.console.panels.AbstractModalPanel.LOG;
-
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -76,7 +74,7 @@ public class RelationshipTypePanel extends AbstractTypesPanel<RelationshipTypeTO
protected WizardMgtPanel<RelationshipTypeTO> newInstance(final String id) {
return new RelationshipTypePanel(id, this);
}
- });
+ }.disableCheckBoxes());
this.addNewItemPanelBuilder(new AbstractModalPanelBuilder<RelationshipTypeTO>(
BaseModal.CONTENT_ID, new RelationshipTypeTO(), pageRef) {
@@ -188,8 +186,7 @@ public class RelationshipTypePanel extends AbstractTypesPanel<RelationshipTypeTO
final RelationshipTypeTO relationshipTypeTO = model.getObject();
- final ActionLinksPanel.Builder<Serializable> actionLinks
- = ActionLinksPanel.builder(page.getPageReference());
+ ActionLinksPanel.Builder<Serializable> actionLinks = ActionLinksPanel.builder(page.getPageReference());
actionLinks.setDisableIndicator(true);
actionLinks.addWithRoles(new ActionLink<Serializable>() {
@@ -198,7 +195,7 @@ public class RelationshipTypePanel extends AbstractTypesPanel<RelationshipTypeTO
@Override
public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
send(RelationshipTypePanel.this, Broadcast.EXACT,
- new AjaxWizard.EditItemActionEvent<RelationshipTypeTO>(model.getObject(), target));
+ new AjaxWizard.EditItemActionEvent<>(model.getObject(), target));
}
}, ActionLink.ActionType.EDIT, StandardEntitlement.RELATIONSHIPTYPE_UPDATE).addWithRoles(
new ActionLink<Serializable>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
index 97ab195..95c0d29 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.panels;
-import static org.apache.syncope.client.console.panels.AbstractModalPanel.LOG;
-
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayList;
@@ -107,7 +105,7 @@ public class SchemaTypePanel extends AbstractTypesPanel<AbstractSchemaTO, Schema
protected WizardMgtPanel<AbstractSchemaTO> newInstance(final String id) {
return new SchemaTypePanel(id, schemaType, this);
}
- });
+ }.disableCheckBoxes());
this.schemaType = schemaType;
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionsPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionsPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionsPanel.java
index 0fe8bdd..64b71da 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionsPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionsPanel.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.panels;
-import static org.apache.wicket.Component.ENABLE;
-
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import java.io.Serializable;
import java.lang.reflect.Field;
@@ -36,7 +34,7 @@ import org.apache.syncope.client.console.commons.SearchableDataProvider;
import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.panels.SecurityQuestionsPanel.SecurityQuestionsProvider;
-import org.apache.syncope.client.console.rest.BaseRestClient;
+import org.apache.syncope.client.console.rest.SecurityQuestionRestClient;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
@@ -60,12 +58,12 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
public class SecurityQuestionsPanel extends AbstractSearchResultPanel<
- SecurityQuestionTO, SecurityQuestionTO, SecurityQuestionsProvider, BaseRestClient> {
+ SecurityQuestionTO, SecurityQuestionTO, SecurityQuestionsProvider, SecurityQuestionRestClient> {
private static final long serialVersionUID = 3323019773236588850L;
public SecurityQuestionsPanel(final String id, final PageReference pageRef) {
- super(id, new Builder<SecurityQuestionTO, SecurityQuestionTO, BaseRestClient>(null, pageRef) {
+ super(id, new Builder<SecurityQuestionTO, SecurityQuestionTO, SecurityQuestionRestClient>(null, pageRef) {
private static final long serialVersionUID = 8769126634538601689L;
@@ -73,7 +71,7 @@ public class SecurityQuestionsPanel extends AbstractSearchResultPanel<
protected WizardMgtPanel<SecurityQuestionTO> newInstance(final String id) {
return new SecurityQuestionsPanel(id, this);
}
- });
+ }.disableCheckBoxes());
this.addNewItemPanelBuilder(new AbstractModalPanelBuilder<SecurityQuestionTO>(
BaseModal.CONTENT_ID, new SecurityQuestionTO(), pageRef) {
@@ -105,8 +103,10 @@ public class SecurityQuestionsPanel extends AbstractSearchResultPanel<
MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, ENABLE, StandardEntitlement.SECURITY_QUESTION_CREATE);
}
- public SecurityQuestionsPanel(
- final String id, final Builder<SecurityQuestionTO, SecurityQuestionTO, BaseRestClient> builder) {
+ private SecurityQuestionsPanel(
+ final String id,
+ final Builder<SecurityQuestionTO, SecurityQuestionTO, SecurityQuestionRestClient> builder) {
+
super(id, builder);
}
@@ -188,8 +188,6 @@ public class SecurityQuestionsPanel extends AbstractSearchResultPanel<
public void populateItem(final Item<ICellPopulator<SecurityQuestionTO>> item, final String componentId,
final IModel<SecurityQuestionTO> model) {
- final SecurityQuestionTO securityQuestionTO = model.getObject();
-
final ActionLinksPanel.Builder<Serializable> actionLinks =
ActionLinksPanel.builder(page.getPageReference());
actionLinks.setDisableIndicator(true);
@@ -213,7 +211,7 @@ public class SecurityQuestionsPanel extends AbstractSearchResultPanel<
public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
try {
SyncopeConsoleSession.get().getService(SecurityQuestionService.class
- ).delete(securityQuestionTO.getKey());
+ ).delete(model.getObject().getKey());
info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java
index 57a973d..b23d9fe 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java
@@ -18,9 +18,6 @@
*/
package org.apache.syncope.client.console.rest;
-import static org.apache.syncope.client.console.rest.BaseRestClient.getService;
-import static org.apache.syncope.client.console.rest.BaseRestClient.toOrderBy;
-
import java.util.List;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.SyncopeClientException;
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
index a2ec369..1da57a7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.rest;
-import static org.apache.syncope.client.console.rest.BaseRestClient.getService;
-
import java.util.ArrayList;
import java.util.List;
import org.apache.syncope.common.lib.to.RoleTO;
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
index dc3a6d4..360fbc7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.topology;
-import static org.apache.wicket.Component.ENABLE;
-
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import java.text.MessageFormat;
import org.apache.syncope.client.console.commons.Constants;
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
index 77f9355..a0064b1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
@@ -18,9 +18,6 @@
*/
package org.apache.syncope.client.console.wizards.any;
-import static org.apache.syncope.client.console.commons.status.Status.ACTIVE;
-import static org.apache.syncope.client.console.commons.status.Status.SUSPENDED;
-
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@@ -219,8 +216,8 @@ public class StatusPanel extends Panel implements IHeaderContributor {
@Override
protected boolean statusCondition(final StatusBean bean) {
- final Pair<ConnObjectTO, ConnObjectTO> pair
- = getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
+ final Pair<ConnObjectTO, ConnObjectTO> pair =
+ getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
return pair != null && pair.getRight() != null;
}
@@ -244,8 +241,8 @@ public class StatusPanel extends Panel implements IHeaderContributor {
remoteObjectFragment.add(
new Label("resource", new ResourceModel(bean.getResourceName(), bean.getResourceName())));
- final Pair<ConnObjectTO, ConnObjectTO> res
- = getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
+ final Pair<ConnObjectTO, ConnObjectTO> res =
+ getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
remoteObjectFragment.add(new ConnObjectPanel("remoteObject", res == null ? null : res));
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index 7bae94e..84f9060 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -31,7 +31,6 @@ under the License.
<link href="css/AdminLTE_plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/AdminLTE_skins/skin-green.css" rel="stylesheet" type="text/css" />
<link href="css/syncopeConsole.css" rel="stylesheet" type="text/css" />
- <link href="css/fieldstyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="webjars/bootbox/${bootbox.version}/bootbox.js"></script>
</head>
@@ -112,8 +111,10 @@ under the License.
</li>
<li class="treeview">
<a href="#"><i class="fa fa-puzzle-piece"></i><span>Extensions</span> <i class="fa fa-angle-left pull-right"></i></a>
- <ul class="treeview-menu">
- <li wicket:id="camelroutesLI"><a href="#" wicket:id="camelroutes"><i class="fa fa-circle-o"></i>Camel Routes</a></li>
+ <ul class="treeview-menu" wicket:id="extPages">
+ <li wicket:id="extPageLI">
+ <a href="#" wicket:id="extPage"><i wicket:id="extPageIcon"></i><span wicket:id="extPageLabel"/></a>
+ </li>
</ul>
</li>
</ul>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
index 04500bd..2d9bca1 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
@@ -20,11 +20,6 @@ under the License.
<head>
<title></title>
- <link rel="stylesheet" type="text/css" href="webjars/jquery-ui/${jquery-ui.version}/themes/base/minified/jquery-ui.min.css" media="all"/>
- <link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all"/>
- <link rel="stylesheet" type="text/css" href="css/style.css" media="all"/>
- <link rel="stylesheet" type="text/css" href="css/fieldstyle.css" media="all"/>
-
<style type="text/css">
table.palette td.header {
background:url("images/ui-bg_glass_75_e6e6e6_1x400.png")
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutes.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutes.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutes.html
deleted file mode 100644
index 6553da1..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/CamelRoutes.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<!--
-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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:extend>
-
- <section class="content-header">
- <h1>
- Camel Routes
- <small>Work in progress</small>
- </h1>
- </section>
-
- <section class="content">
- <div class="progress progress active" style="margin:100px">
- <div style="width: 70%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-success progress-bar-striped">
- <span class="sr-only">20% Complete</span>
- </div>
- </div>
- </section>
-
- </wicket:extend>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestions.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestions.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestions.html
index 77d0675..5ada5a2 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestions.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestions.html
@@ -37,6 +37,5 @@ under the License.
</div>
</div>
</div>
- <div wicket:id="securityQuestionModal"></div>
</wicket:extend>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
index c7677df..ec13467 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
@@ -40,6 +40,7 @@ under the License.
</form>
</div>
</div>
+ <wicket:child/>
</wicket:extend>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/client/console/src/main/resources/org/apache/syncope/client/console/panels/Realm.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Realm.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/Realm.html
index 9a6f9ef..0755e3e 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/Realm.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/Realm.html
@@ -17,13 +17,8 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <body>
- <wicket:panel>
- <div wicket:id="tabbedPanel"></div>
- </wicket:panel>
- </body>
+ <wicket:panel>
+ <div wicket:id="tabbedPanel"></div>
+ </wicket:panel>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRouteModalPage.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRouteModalPage.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRouteModalPage.java
deleted file mode 100644
index 29db354..0000000
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRouteModalPage.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.console.pages;
-
-import java.io.Serializable;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.panels.AbstractModalPanel;
-import org.apache.syncope.client.console.rest.CamelRouteRestClient;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.CamelRouteTO;
-import org.apache.syncope.common.lib.types.CamelEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-
-public class CamelRouteModalPage<T extends Serializable> extends AbstractModalPanel<T> {
-
- private static final long serialVersionUID = -1438441210568592931L;
-
- private final CamelRouteRestClient restClient = new CamelRouteRestClient();
-
- public CamelRouteModalPage(
- final BaseModal<T> modal,
- final PageReference pageRef,
- final CamelRouteTO routeTO,
- final boolean createFlag) {
-
- super(modal, pageRef);
-
- Form<CamelRouteTO> routeForm = new Form<>("routeDefForm");
-
- TextArea<String> routeDefArea = new TextArea<>("content", new PropertyModel<String>(routeTO, "content"));
-
- routeForm.add(routeDefArea);
- routeForm.setModel(new CompoundPropertyModel<>(routeTO));
-
- AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<>(getString(SUBMIT)), routeForm) {
-
- private static final long serialVersionUID = -958724007591692537L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- try {
- restClient.update(routeTO.getKey(), ((CamelRouteTO) form.getModelObject()).getContent());
- info(getString(Constants.OPERATION_SUCCEEDED));
-
- // Uncomment with something similar once SYNCOPE-156 is completed
- // Configuration callerPage = (Configuration) pageRef.getPage();
- // callerPage.setModalResult(true);
- modal.close(target);
- } catch (SyncopeClientException scee) {
- error(getString(Constants.ERROR) + ": " + scee.getMessage());
- }
- modal.getNotificationPanel().refresh(target);
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
- modal.getNotificationPanel().refresh(target);
- }
-
- };
-
- MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, CamelEntitlement.ROUTE_UPDATE);
- routeForm.add(submit);
-
- this.add(routeForm);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPage.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPage.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPage.java
new file mode 100644
index 0000000..81dfbb3
--- /dev/null
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPage.java
@@ -0,0 +1,102 @@
+/*
+ * 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.console.pages;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.rest.CamelRoutesRestClient;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.CamelEntitlement;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.syncope.client.console.annotations.ExtPage;
+import org.apache.syncope.client.console.panels.CamelRoutesPanel;
+import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.extensions.markup.html.tabs.ITab;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+@ExtPage(label = "Camel Routes", icon = "fa-road", priority = 100)
+public class CamelRoutesPage extends AbstractExtPage {
+
+ private static final long serialVersionUID = 1965360932245590233L;
+
+ public static final String PREF_CAMEL_ROUTES_PAGINATOR_ROWS = "camel.routes.paginator.rows";
+
+ private final CamelRoutesRestClient restClient = new CamelRoutesRestClient();
+
+ public CamelRoutesPage(final PageParameters parameters) {
+ super(parameters);
+
+ WebMarkupContainer content = new WebMarkupContainer("content");
+ content.setOutputMarkupId(true);
+ content.add(new Label("header", getString("header_title")));
+ AjaxBootstrapTabbedPanel<ITab> tabbedPanel = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList());
+ content.add(tabbedPanel);
+
+ MetaDataRoleAuthorizationStrategy.authorize(content, ENABLE, CamelEntitlement.ROUTE_LIST);
+ add(content);
+ }
+
+ private List<ITab> buildTabList() {
+ List<ITab> tabs = new ArrayList<>(3);
+
+ tabs.add(new AbstractTab(new Model<>(AnyTypeKind.USER.name())) {
+
+ private static final long serialVersionUID = -6815067322125799251L;
+
+ @Override
+ public Panel getPanel(final String panelId) {
+ CamelRoutesPanel panel = new CamelRoutesPanel(panelId, getPageReference(), AnyTypeKind.USER);
+ panel.setEnabled(restClient.isCamelEnabledFor(AnyTypeKind.USER));
+ return panel;
+ }
+ });
+
+ tabs.add(new AbstractTab(new Model<>(AnyTypeKind.GROUP.name())) {
+
+ private static final long serialVersionUID = -6815067322125799251L;
+
+ @Override
+ public Panel getPanel(final String panelId) {
+ CamelRoutesPanel panel = new CamelRoutesPanel(panelId, getPageReference(), AnyTypeKind.GROUP);
+ panel.setEnabled(restClient.isCamelEnabledFor(AnyTypeKind.GROUP));
+ return panel;
+ }
+ });
+
+ tabs.add(new AbstractTab(new Model<>(AnyTypeKind.ANY_OBJECT.name())) {
+
+ private static final long serialVersionUID = -6815067322125799251L;
+
+ @Override
+ public Panel getPanel(final String panelId) {
+ CamelRoutesPanel panel = new CamelRoutesPanel(panelId, getPageReference(), AnyTypeKind.ANY_OBJECT);
+ panel.setEnabled(restClient.isCamelEnabledFor(AnyTypeKind.ANY_OBJECT));
+ return panel;
+ }
+ });
+
+ return tabs;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.java
new file mode 100644
index 0000000..e87443e
--- /dev/null
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/pages/CamelRoutesPopupPage.java
@@ -0,0 +1,76 @@
+/*
+ * 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.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.CamelRoutesRestClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.CamelRouteTO;
+import org.apache.syncope.common.lib.types.CamelEntitlement;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+public class CamelRoutesPopupPage extends BasePopupPage {
+
+ private static final long serialVersionUID = -1438441210568592931L;
+
+ private final CamelRoutesRestClient restClient = new CamelRoutesRestClient();
+
+ public CamelRoutesPopupPage(final CamelRouteTO routeTO) {
+ super();
+
+ Form<CamelRouteTO> routeDefForm = new Form<>("routeDefForm");
+
+ TextArea<String> routeDefArea = new TextArea<>("content", new PropertyModel<String>(routeTO, "content"));
+ routeDefForm.add(routeDefArea);
+ routeDefForm.setModel(new CompoundPropertyModel<>(routeTO));
+
+ AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<>(getString(SUBMIT)), routeDefForm) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ restClient.update(routeTO.getKey(), ((CamelRouteTO) form.getModelObject()).getContent());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scee) {
+ error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ }
+ notificationPanel.refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ notificationPanel.refresh(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, CamelEntitlement.ROUTE_UPDATE);
+ routeDefForm.add(submit);
+ add(routeDefForm);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutePanel.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutePanel.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutePanel.java
deleted file mode 100644
index bcd5e7a..0000000
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutePanel.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * 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.console.panels;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.apache.syncope.client.console.annotations.ExtensionPanel;
-import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.client.console.rest.CamelRouteRestClient;
-import org.apache.syncope.common.lib.to.CamelRouteTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.CamelEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.AbstractReadOnlyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.ResourceModel;
-
-@ExtensionPanel("Camel routes")
-public class CamelRoutePanel extends AbstractExtensionPanel {
-
- private static final long serialVersionUID = 1965360932245590233L;
-
- private static final int CAMELROUTE_WIN_HEIGHT = 480;
-
- private static final int CAMELROUTE_WIN_WIDTH = 800;
-
- private CamelRouteRestClient restClient = new CamelRouteRestClient();
-
- private ModalWindow editCamelRouteWin;
-
- public CamelRoutePanel(final String id, final PageReference pageref) {
- super(id, pageref);
-
- editCamelRouteWin = new ModalWindow("editCamelRouteWin");
- editCamelRouteWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
- editCamelRouteWin.setInitialHeight(CAMELROUTE_WIN_HEIGHT);
- editCamelRouteWin.setInitialWidth(CAMELROUTE_WIN_WIDTH);
- editCamelRouteWin.setCookieName("editCamelRouteWin-modal");
- add(editCamelRouteWin);
-
- List<IColumn<CamelRouteTO, String>> routeCols = new ArrayList<>();
- routeCols.add(new PropertyColumn<CamelRouteTO, String>(new ResourceModel("key"), "key", "key"));
- routeCols.add(new AbstractColumn<CamelRouteTO, String>(new ResourceModel("actions", "")) {
-
- private static final long serialVersionUID = 2054811145491901166L;
-
- @Override
- public String getCssClass() {
- return "action";
- }
-
- @Override
- public void populateItem(final Item<ICellPopulator<CamelRouteTO>> cellItem, final String componentId,
- final IModel<CamelRouteTO> model) {
-
- // Uncomment with something similar once SYNCOPE-156 is completed
- /* final ActionLinksPanel panel = new
- * ActionLinksPanel(componentId, model, pageref);
- *
- * panel.add(new ActionLink() {
- *
- * private static final long serialVersionUID = -3722207913631435501L;
- *
- * @Override
- * public void onClick(final AjaxRequestTarget target) {
- *
- * editCamelRouteWin.setPageCreator(new ModalWindow.PageCreator() {
- *
- * private static final long serialVersionUID = -7834632442532690940L;
- *
- * @Override
- * public Page createPage() {
- * return new CamelRouteModalPage(pageref, editCamelRouteWin,
- * restClient.read(model.getObject().getKey()), false);
- * }
- *
- * });
- *
- * editCamelRouteWin.show(target);
- * }
- * }, ActionLink.ActionType.EDIT, "CamelRoutes");
- *
- * cellItem.add(panel); */
- }
- });
-
- final AjaxFallbackDefaultDataTable<CamelRouteTO, String> routeTable =
- new AjaxFallbackDefaultDataTable<>("camelRouteTable", routeCols, new CamelRouteProvider(), 50);
-
- WebMarkupContainer routeContainer = new WebMarkupContainer("camelRoutesContainer");
- routeContainer.add(routeTable);
- routeContainer.setOutputMarkupId(true);
- MetaDataRoleAuthorizationStrategy.authorize(routeContainer, ENABLE, CamelEntitlement.ROUTE_LIST);
- add(routeContainer);
- }
-
- private class CamelRouteProvider extends SortableDataProvider<CamelRouteTO, String> {
-
- private static final long serialVersionUID = -2917236020432105949L;
-
- private final SortableDataProviderComparator<CamelRouteTO> comparator;
-
- CamelRouteProvider() {
- setSort("key", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<>(this);
- }
-
- @Override
- public Iterator<? extends CamelRouteTO> iterator(final long first, final long count) {
- List<CamelRouteTO> list = new ArrayList<>();
- if (restClient.isCamelEnabledFor(AnyTypeKind.USER)) {
- list.addAll(restClient.list(AnyTypeKind.USER));
- }
- if (restClient.isCamelEnabledFor(AnyTypeKind.GROUP)) {
- list.addAll(restClient.list(AnyTypeKind.GROUP));
- }
-
- Collections.sort(list, comparator);
-
- return list.subList((int) first, (int) first + (int) count).iterator();
- }
-
- @Override
- public long size() {
- return (restClient.isCamelEnabledFor(AnyTypeKind.USER)
- ? restClient.list(AnyTypeKind.USER).size()
- : 0)
- + (restClient.isCamelEnabledFor(AnyTypeKind.GROUP)
- ? restClient.list(AnyTypeKind.GROUP).size()
- : 0);
- }
-
- @Override
- public IModel<CamelRouteTO> model(final CamelRouteTO route) {
- return new AbstractReadOnlyModel<CamelRouteTO>() {
-
- private static final long serialVersionUID = 774694801558497248L;
-
- @Override
- public CamelRouteTO getObject() {
- return route;
- }
- };
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7cb3c322/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesPanel.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesPanel.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesPanel.java
new file mode 100644
index 0000000..8ef050d
--- /dev/null
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesPanel.java
@@ -0,0 +1,196 @@
+/*
+ * 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.console.panels;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.SearchableDataProvider;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.pages.CamelRoutesPage;
+import org.apache.syncope.client.console.pages.CamelRoutesPopupPage;
+import org.apache.syncope.client.console.panels.CamelRoutesPanel.CamelRoutesProvider;
+import org.apache.syncope.client.console.rest.CamelRoutesRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.to.CamelRouteTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.CamelEntitlement;
+import org.apache.syncope.common.rest.api.service.CamelRouteService;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class CamelRoutesPanel extends AbstractSearchResultPanel<
+ CamelRouteTO, CamelRouteTO, CamelRoutesProvider, CamelRoutesRestClient> {
+
+ private static final long serialVersionUID = 3727444742501082182L;
+
+ private static final int CAMELROUTE_WIN_HEIGHT = 480;
+
+ private static final int CAMELROUTE_WIN_WIDTH = 800;
+
+ private final AnyTypeKind anyTypeKind;
+
+ private ModalWindow editCamelRouteWin;
+
+ public CamelRoutesPanel(final String id, final PageReference pageRef, final AnyTypeKind anyTypeKind) {
+ super(id, new Builder<CamelRouteTO, CamelRouteTO, CamelRoutesRestClient>(
+ new CamelRoutesRestClient(), pageRef) {
+
+ private static final long serialVersionUID = 8769126634538601689L;
+
+ @Override
+ protected WizardMgtPanel<CamelRouteTO> newInstance(final String id) {
+ return new CamelRoutesPanel(id, this, anyTypeKind);
+ }
+ }.disableCheckBoxes());
+
+ this.anyTypeKind = anyTypeKind;
+ setFooterVisibility(true);
+ modal.addSumbitButton();
+ modal.size(Modal.Size.Large);
+ initResultTable();
+
+ editCamelRouteWin = new ModalWindow("editCamelRouteWin");
+ editCamelRouteWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editCamelRouteWin.setInitialHeight(CAMELROUTE_WIN_HEIGHT);
+ editCamelRouteWin.setInitialWidth(CAMELROUTE_WIN_WIDTH);
+ editCamelRouteWin.setCookieName("editCamelRouteWin-modal");
+ add(editCamelRouteWin);
+ }
+
+ private CamelRoutesPanel(
+ final String id,
+ final Builder<CamelRouteTO, CamelRouteTO, CamelRoutesRestClient> builder,
+ final AnyTypeKind anyTypeKind) {
+
+ super(id, builder);
+ this.anyTypeKind = anyTypeKind;
+ }
+
+ @Override
+ protected CamelRoutesProvider dataProvider() {
+ return new CamelRoutesProvider(anyTypeKind, rows);
+ }
+
+ @Override
+ protected String paginatorRowsKey() {
+ return CamelRoutesPage.PREF_CAMEL_ROUTES_PAGINATOR_ROWS;
+ }
+
+ @Override
+ protected Collection<ActionLink.ActionType> getBulkActions() {
+ return Collections.<ActionLink.ActionType>emptyList();
+ }
+
+ @Override
+ protected List<IColumn<CamelRouteTO, String>> getColumns() {
+ final List<IColumn<CamelRouteTO, String>> columns = new ArrayList<>();
+ columns.add(new PropertyColumn<CamelRouteTO, String>(new ResourceModel("name"), "name", "name"));
+ columns.add(new AbstractColumn<CamelRouteTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<CamelRouteTO>> item, final String componentId,
+ final IModel<CamelRouteTO> model) {
+
+ ActionLinksPanel.Builder<Serializable> actionLinks = ActionLinksPanel.builder(page.getPageReference());
+ actionLinks.setDisableIndicator(true);
+ actionLinks.addWithRoles(new ActionLink<Serializable>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
+ editCamelRouteWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new CamelRoutesPopupPage(restClient.read(model.getObject().getKey()));
+ }
+
+ });
+
+ editCamelRouteWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, CamelEntitlement.ROUTE_READ);
+ item.add(actionLinks.build(componentId));
+ }
+ });
+
+ return columns;
+
+ }
+
+ protected final class CamelRoutesProvider extends SearchableDataProvider<CamelRouteTO> {
+
+ private static final long serialVersionUID = -185944053385660794L;
+
+ private final AnyTypeKind anyTypeKind;
+
+ private final SortableDataProviderComparator<CamelRouteTO> comparator;
+
+ private CamelRoutesProvider(final AnyTypeKind anyTypeKind, final int paginatorRows) {
+ super(paginatorRows);
+ this.anyTypeKind = anyTypeKind;
+ comparator = new SortableDataProviderComparator<>(this);
+ }
+
+ @Override
+ public Iterator<CamelRouteTO> iterator(final long first, final long count) {
+ List<CamelRouteTO> list = SyncopeConsoleSession.get().getService(CamelRouteService.class).list(anyTypeKind);
+ Collections.sort(list, comparator);
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return SyncopeConsoleSession.get().getService(CamelRouteService.class).list(anyTypeKind).size();
+ }
+
+ @Override
+ public IModel<CamelRouteTO> model(final CamelRouteTO object) {
+ return new CompoundPropertyModel<>(object);
+ }
+ }
+}