You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2016/06/23 11:15:49 UTC
[1/2] syncope git commit: [SYNCOPE-874] handling realm provisioning
features on the administration console
Repository: syncope
Updated Branches:
refs/heads/master 9042203d7 -> 0370ddc65
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmModalPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmModalPanel.html
deleted file mode 100644
index d07b59f..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmModalPanel.html
+++ /dev/null
@@ -1,23 +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:extend>
- <div wicket:id="details">[details]</div>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmWizardBuilder$Realm.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmWizardBuilder$Realm.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmWizardBuilder$Realm.html
new file mode 100644
index 0000000..2eef032
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmWizardBuilder$Realm.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:panel>
+ <div wicket:id="details">[details]</div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RemoteObjectPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RemoteObjectPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RemoteObjectPanel.html
new file mode 100644
index 0000000..d0e5167
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RemoteObjectPanel.html
@@ -0,0 +1,24 @@
+<!--
+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">
+ <head><title></title></head>
+ <wicket:panel>
+ <span wicket:id="remoteObject">[REMOTE OBJCET]</span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html
index 4eee0d9..d517cd1 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html
@@ -21,9 +21,6 @@ under the License.
<div class="form-group" wicket:id="propView">
<span wicket:id="value">[ATTIRIBUTE]</span>
</div>
- <wicket:fragment wicket:id="singleValue">
- <span wicket:id="attribute">[ATTIRIBUTE]</span>
- </wicket:fragment>
<wicket:fragment wicket:id="doubleValue">
<div class="left attribute">
<span wicket:id="oldAttribute">[ATTIRIBUTE]</span>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/StatusPanel$RemoteObjectPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/StatusPanel$RemoteObjectPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/StatusPanel$RemoteObjectPanel.html
deleted file mode 100644
index d0e5167..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/StatusPanel$RemoteObjectPanel.html
+++ /dev/null
@@ -1,24 +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">
- <head><title></title></head>
- <wicket:panel>
- <span wicket:id="remoteObject">[REMOTE OBJCET]</span>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink.properties
index dad26b4..e4d06bf 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink.properties
@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-link.title=Connector object link (if required)
+link.title=Object link (if required)
link.summary=
-connObjectLinkCheckbox=Use ConnObjectLink
+connObjectLinkCheckbox=Use Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_it.properties
index cf74d19..12d8393 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_it.properties
@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-link.title=Connector object link (se necessario)
+link.title=Object link (se necessario)
link.summary=
-connObjectLinkCheckbox=Usa ConnObjectLink
+connObjectLinkCheckbox=Usa Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_pt_BR.properties
index 305b0b7..8c68c6b 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder$ConnObjectLink_pt_BR.properties
@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-link.title=Connector object link (se necess\u00e1rio)
+link.title=Object link (se necess\u00e1rio)
link.summary=
-connObjectLinkCheckbox=Usar ConnObjectLink
+connObjectLinkCheckbox=Usar Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
index ef243a8..de5c92f 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.html
@@ -18,6 +18,14 @@ under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
+ <div wicket:id="aboutRealmProvison" class="col-xs-12 panel-body">
+ <span wicket:id="enableRealmsProvision"/>
+ <div wicket:id="realmsProvisionContainer">
+ <span wicket:id="objectClass"/>
+ <span wicket:id="extAttrName"/>
+ <span wicket:id="connObjectLink"/>
+ </div>
+ </div>
<span wicket:id="provision">[PROVISION]</span>
</wicket:panel>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.properties
index d9e6f1f..3c8218d 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.properties
@@ -37,7 +37,8 @@ fieldName=Field name
connObjectKeyValidation=There must be exactly one AccountId
propagationMode=Propagation mode
-connObjectLink=Remote ID
+connObjectLink=Object Link
enable=Enable
inner.provision.mapping=Change mapping for provision '${key}'
inner.provision.clone=Clone provision '${key}'
+enableRealmsProvision=Enable realm provisioning
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_it.properties
index abaf81f..afaa5e5 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_it.properties
@@ -41,3 +41,4 @@ connObjectLink=ID Remoto
enable=Abilita
inner.provision.mapping=Cambia il mapping per il provision '${key}'
inner.provision.clone=Clona il provision '${key}'
+enableRealmsProvision=Abilita il provisioning dei realm
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_pt_BR.properties
index ec9a6b6..ca569f5 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_pt_BR.properties
@@ -41,3 +41,4 @@ connObjectLink=Remote ID
enable=Habilitado
inner.provision.mapping=Change mapping for provision '${key}'
inner.provision.clone=Clone provision '${key}'
+enableRealmsProvision=Enable realm provisioning
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_ru.properties
index 6733ef9..b0bfaab 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel_ru.properties
@@ -64,3 +64,4 @@ connObjectLink=\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0441\u043e\u04
enable=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c
inner.provision.mapping=Change mapping for provision '${key}'
inner.provision.clone=Clone provision '${key}'
+enableRealmsProvision=Enable realm provisioning
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AnyObjectsITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AnyObjectsITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AnyObjectsITCase.java
index 3b5d163..6edb1e0 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AnyObjectsITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/AnyObjectsITCase.java
@@ -35,7 +35,7 @@ import org.junit.Before;
@FixMethodOrder(MethodSorters.JVM)
public class AnyObjectsITCase extends AbstractConsoleITCase {
- private final String tabPanel = "body:content:body:tabbedPanel:panel:searchResult:";
+ private final String tabPanel = "body:content:body:container:content:tabbedPanel:panel:searchResult:";
private final String searchResultContainer = tabPanel + "container:content:";
@@ -47,22 +47,25 @@ public class AnyObjectsITCase extends AbstractConsoleITCase {
@Test
public void filteredSearch() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
- TESTER.clickLink("body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:title");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
- TESTER.executeAjaxEvent("body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:body:content:"
- + "searchFormContainer:search:multiValueContainer:innerForm:content:panelPlus:add", Constants.ON_CLICK);
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:title");
+
+ TESTER.executeAjaxEvent("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:body:"
+ + "content:searchFormContainer:search:multiValueContainer:innerForm:content:panelPlus:add",
+ Constants.ON_CLICK);
TESTER.assertComponent(
- "body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:body:content:searchFormContainer:search:"
- + "multiValueContainer:innerForm:content:view:0:panel:container:value:textField", TextField.class);
+ "body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:"
+ + "searchFormContainer:search:multiValueContainer:innerForm:content:view:0:panel:container:value:"
+ + "textField", TextField.class);
}
@Test
public void clickToClonePrinter() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
Component component = findComponentByProp("key", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
@@ -80,7 +83,7 @@ public class AnyObjectsITCase extends AbstractConsoleITCase {
@Test
public void editPrinter() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
Component component = findComponentByProp("key", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
@@ -131,7 +134,7 @@ public class AnyObjectsITCase extends AbstractConsoleITCase {
@Test
public void checkDeletePrinterLink() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
Component component = findComponentByProp("key", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/BulkActionITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/BulkActionITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/BulkActionITCase.java
index 5870dd3..7334bb4 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/BulkActionITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/BulkActionITCase.java
@@ -33,7 +33,7 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.JVM)
public class BulkActionITCase extends AbstractConsoleITCase {
- private final String tabPanel = "body:content:body:tabbedPanel:panel:searchResult:";
+ private final String tabPanel = "body:content:body:container:content:tabbedPanel:panel:searchResult:";
private final String searchResultContainer = tabPanel + "container:content:";
@@ -45,7 +45,7 @@ public class BulkActionITCase extends AbstractConsoleITCase {
@Test
public void usersBulkAction() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", searchResultContainer
+ "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "rossini");
@@ -70,7 +70,7 @@ public class BulkActionITCase extends AbstractConsoleITCase {
@Test
public void userResourceBulkAction() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "rossini");
@@ -112,7 +112,7 @@ public class BulkActionITCase extends AbstractConsoleITCase {
// suspend
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "rossini");
@@ -147,7 +147,7 @@ public class BulkActionITCase extends AbstractConsoleITCase {
// re-activate
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
component = findComponentByProp("username", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "rossini");
@@ -184,7 +184,7 @@ public class BulkActionITCase extends AbstractConsoleITCase {
@Test
public void groupResourceBulkAction() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:2:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:2:link");
Component component = findComponentByProp("name", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "director");
@@ -228,7 +228,7 @@ public class BulkActionITCase extends AbstractConsoleITCase {
@Test
public void printerResourceBulkAction() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
Component component = findComponentByProp("key", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
index 4067976..383714d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
@@ -38,23 +38,23 @@ public class DisplayAttributesITCase extends AbstractConsoleITCase {
@Test
public void readAndSet() {
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
- TESTER.clickLink("body:content:body:tabbedPanel:panel:"
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:"
+ "searchResult:container:content:searchContainer:resultTable:"
+ "tablePanel:groupForm:checkgroup:dataTable:topToolbars:"
+ "toolbars:1:headers:4:header:label:panelChangeView:changeViewLink");
TESTER.assertComponent(
- "body:content:body:tabbedPanel:panel:searchResult:outerObjectsRepeater:2:outer", Modal.class);
+ "body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:2:outer",
+ Modal.class);
FormTester formTester = TESTER.newFormTester(
- "body:content:body:tabbedPanel:panel:searchResult:outerObjectsRepeater:2:outer:form");
+ "body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:2:outer:form");
formTester.setValue("content:container:details:paletteField:recorder", "status");
- TESTER.clickLink(
- "body:content:body:tabbedPanel:panel:searchResult:outerObjectsRepeater:2:outer:dialog:footer:"
- + "inputs:0:submit");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:"
+ + "2:outer:dialog:footer:inputs:0:submit");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.clearFeedbackMessages();
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/GroupsITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/GroupsITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/GroupsITCase.java
index 137397e..b04c9f0 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/GroupsITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/GroupsITCase.java
@@ -34,7 +34,7 @@ import org.junit.Before;
@FixMethodOrder(MethodSorters.JVM)
public class GroupsITCase extends AbstractConsoleITCase {
- private final String tabPanel = "body:content:body:tabbedPanel:panel:searchResult:";
+ private final String tabPanel = "body:content:body:container:content:tabbedPanel:panel:searchResult:";
private final String searchResultContainer = tabPanel + "container:content:";
@@ -46,7 +46,7 @@ public class GroupsITCase extends AbstractConsoleITCase {
@Test
public void read() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:2:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:2:link");
Component component = findComponentByProp("name", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "artDirector");
@@ -54,42 +54,43 @@ public class GroupsITCase extends AbstractConsoleITCase {
TESTER.clickLink(component.getPageRelativePath() + ":cells:4:cell:panelMembers:membersLink");
- FormTester formTester = TESTER.newFormTester("body:content:body:tabbedPanel:panel:searchResult:"
- + "outerObjectsRepeater:6:outer:container:content:togglePanelContainer:membersForm");
+ FormTester formTester = TESTER.newFormTester("body:content:body:container:content:tabbedPanel:panel:"
+ + "searchResult:outerObjectsRepeater:6:outer:container:content:togglePanelContainer:membersForm");
formTester.select("type:dropDownChoiceField", 0);
formTester.submit("changeit");
- TESTER.assertModelValue("body:content:body:tabbedPanel:panel:searchResult:outerObjectsRepeater:5:outer:"
- + "dialog:header:header-label", "USER members of artDirector");
+ TESTER.assertModelValue("body:content:body:container:content:tabbedPanel:panel:searchResult:"
+ + "outerObjectsRepeater:5:outer:dialog:header:header-label", "USER members of artDirector");
- assertNotNull(findComponentByProp("username", "body:content:body:tabbedPanel:panel:searchResult:"
- + "outerObjectsRepeater:5:outer:form:content:searchResult:container:content:searchContainer:"
- + "resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini"));
+ assertNotNull(findComponentByProp("username", "body:content:body:container:content:tabbedPanel:panel:"
+ + "searchResult:outerObjectsRepeater:5:outer:form:content:searchResult:container:content:"
+ + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini"));
- TESTER.executeAjaxEvent("body:content:body:tabbedPanel:panel:searchResult:outerObjectsRepeater:5:"
- + "outer:dialog:footer:buttons:0:button", Constants.ON_CLICK);
+ TESTER.executeAjaxEvent("body:content:body:container:content:tabbedPanel:panel:searchResult:"
+ + "outerObjectsRepeater:5:outer:dialog:footer:buttons:0:button", Constants.ON_CLICK);
}
@Test
public void filteredSearch() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:2:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:2:link");
- TESTER.clickLink("body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:title");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:title");
- TESTER.executeAjaxEvent("body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:body:content:"
- + "searchFormContainer:search:multiValueContainer:innerForm:content:panelPlus:add", Constants.ON_CLICK);
+ TESTER.executeAjaxEvent("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:body:"
+ + "content:searchFormContainer:search:multiValueContainer:innerForm:content:panelPlus:add",
+ Constants.ON_CLICK);
- TESTER.assertComponent(
- "body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:body:content:searchFormContainer:search:"
- + "multiValueContainer:innerForm:content:view:0:panel:container:value:textField", TextField.class);
+ TESTER.assertComponent("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:body:"
+ + "content:searchFormContainer:search:multiValueContainer:innerForm:content:view:0:panel:container:"
+ + "value:textField", TextField.class);
}
@Test
public void clickToCloneGroup() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:2:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:2:link");
Component component = findComponentByProp("name", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "director");
@@ -109,7 +110,7 @@ public class GroupsITCase extends AbstractConsoleITCase {
@Test
public void editGroup() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:2:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:2:link");
Component component = findComponentByProp("name", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "director");
@@ -169,7 +170,7 @@ public class GroupsITCase extends AbstractConsoleITCase {
@Test
public void checkDeleteGroupLink() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:2:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:2:link");
Component component = findComponentByProp("name", searchResultContainer
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "director");
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/RealmsITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/RealmsITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/RealmsITCase.java
index 2b7b025..6b75ee7 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/RealmsITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/RealmsITCase.java
@@ -18,9 +18,14 @@
*/
package org.apache.syncope.fit.console;
+import static org.apache.syncope.fit.console.AbstractConsoleITCase.TESTER;
+import static org.junit.Assert.assertNotNull;
+
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.pages.Realms;
import org.apache.syncope.client.console.panels.TogglePanel;
+import org.apache.wicket.Component;
import org.apache.wicket.util.tester.FormTester;
import org.junit.Before;
import org.junit.FixMethodOrder;
@@ -39,39 +44,74 @@ public class RealmsITCase extends AbstractConsoleITCase {
@Test
public void read() {
- TESTER.assertLabel("body:content:body:tabbedPanel:panel:container:name:field-label", "Name");
+ TESTER.assertLabel("body:content:body:container:content:tabbedPanel:panel:container:accountPolicy:field-label",
+ "Account Policy");
}
@Test
public void create() {
- TESTER.clickLink("body:content:body:tabbedPanel:panel:actions:actions:panelCreate:createLink");
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelCreate:createLink");
+
+ TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
+
+ FormTester formTester = TESTER.newFormTester(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:form");
+ formTester.setValue("view:details:container:generics:name:textField", "testRealm");
+
+ formTester.submit("buttons:finish");
+
+ TESTER.assertInfoMessages("Operation executed successfully");
+ TESTER.cleanupFeedbackMessages();
- TESTER.assertComponent("body:content:modal", Modal.class);
+ TESTER.executeAjaxEvent(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:action:panelClose:closeLink",
+ Constants.ON_CLICK);
+
+ // remove the new realm just created
+ TESTER.clickLink("body:realmsLI:realms");
- FormTester formTester = TESTER.newFormTester("body:content:modal:form");
- formTester.setValue("content:details:container:name:textField", "testRealm");
+ TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:btn", Constants.ON_CLICK);
+ TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:dropdown-menu:buttons:4:button",
+ Constants.ON_CLICK);
- TESTER.clickLink("body:content:modal:dialog:footer:inputs:0:submit");
+ TESTER.assertLabel("body:content:realmChoicePanel:container:realm", "/testRealm");
+
+ TESTER.getRequest().addParameter("confirm", "true");
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelDelete:deleteLink");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
+
+ TESTER.assertLabel("body:content:body:container:content:tabbedPanel:panel:container:accountPolicy:field-label",
+ "Account Policy");
+
+ TESTER.assertLabel("body:content:realmChoicePanel:container:realm", "/");
}
@Test
public void update() {
- TESTER.clickLink("body:content:body:tabbedPanel:panel:actions:actions:panelEdit:editLink");
- TESTER.assertComponent("body:content:modal", Modal.class);
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelEdit:editLink");
+ TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
- FormTester formTester = TESTER.newFormTester("body:content:modal:form");
- TESTER.clickLink("body:content:modal:dialog:footer:inputs:0:submit");
+ FormTester formTester = TESTER.newFormTester(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:form");
+ formTester.submit("buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
+
+ TESTER.executeAjaxEvent(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:action:panelClose:closeLink",
+ Constants.ON_CLICK);
}
@Test
public void addUserTemplate() {
- TESTER.clickLink("body:content:body:tabbedPanel:panel:actions:actions:panelTemplate:templateLink");
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelTemplate:templateLink");
TESTER.assertComponent("body:content:toggleTemplates", TogglePanel.class);
FormTester formTester = TESTER.newFormTester(
@@ -88,7 +128,8 @@ public class RealmsITCase extends AbstractConsoleITCase {
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
- TESTER.clickLink("body:content:body:tabbedPanel:panel:actions:actions:panelTemplate:templateLink");
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelTemplate:templateLink");
TESTER.assertComponent("body:content:toggleTemplates", TogglePanel.class);
formTester = TESTER.newFormTester(
@@ -108,4 +149,115 @@ public class RealmsITCase extends AbstractConsoleITCase {
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
}
+
+ @Test
+ public void verifyPropagation() {
+ TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:btn", Constants.ON_CLICK);
+ TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:dropdown-menu:buttons:2:button",
+ Constants.ON_CLICK);
+
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelEdit:editLink");
+ TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:form:view:details:"
+ + "container:generics:name:textField", "two");
+
+ FormTester formTester = TESTER.newFormTester(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:form");
+ formTester.setValue("view:details:container:resources:paletteField:recorder", "resource-ldap-orgunit");
+
+ formTester.submit("buttons:finish");
+
+ TESTER.assertInfoMessages("Operation executed successfully");
+ TESTER.cleanupFeedbackMessages();
+
+ // ----------------------------------
+ // Check for propagation rsults
+ // ----------------------------------
+ Component component = findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:"
+ + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit");
+
+ TESTER.clickLink(component.getPageRelativePath() + ":actions:panelView:viewLink");
+
+ TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:field-label", "ou");
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:0:value:oldAttribute:textField", null);
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:1:value:oldAttribute:textField", null);
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:textField", null);
+
+ TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:field-label", "ou");
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:textField", "two");
+
+ TESTER.clickLink("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:back");
+
+ assertNotNull(findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:"
+ + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit"));
+ // ----------------------------------
+
+ TESTER.executeAjaxEvent(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:action:panelClose:closeLink",
+ Constants.ON_CLICK);
+
+ TESTER.clickLink(
+ "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelEdit:editLink");
+ TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:form:view:details:"
+ + "container:generics:name:textField", "two");
+
+ formTester = TESTER.newFormTester(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:form");
+ formTester.setValue("view:details:container:resources:paletteField:recorder", "");
+
+ formTester.submit("buttons:finish");
+
+ TESTER.assertInfoMessages("Operation executed successfully");
+ TESTER.cleanupFeedbackMessages();
+
+ // ----------------------------------
+ // Check for propagation rsults
+ // ----------------------------------
+ component = findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:"
+ + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit");
+
+ TESTER.clickLink(component.getPageRelativePath() + ":actions:panelView:viewLink");
+
+ TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:field-label", "ou");
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:textField", "two");
+
+ TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:field-label", "ou");
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:0:value:newAttribute:textField", null);
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:1:value:newAttribute:textField", null);
+
+ TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:textField", null);
+
+ TESTER.clickLink("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
+ + "secondLevelContainer:back");
+
+ assertNotNull(findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:"
+ + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit"));
+ // ----------------------------------
+
+ TESTER.executeAjaxEvent(
+ "body:content:body:outerObjectsRepeater:0:outer:form:content:action:panelClose:closeLink",
+ Constants.ON_CLICK);
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
index c7ac3db..0060793 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/TopologyITCase.java
@@ -20,6 +20,7 @@ package org.apache.syncope.fit.console;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
@@ -112,10 +113,41 @@ public class TopologyITCase extends AbstractConsoleITCase {
TESTER.executeAjaxEvent(component.getPageRelativePath() + ":res", Constants.ON_CLICK);
TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:provision");
+ // ------------------------------------------
+ // Check for realm provisioning feature availability (SYNCOPE-874)
+ // ------------------------------------------
+ FormTester formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:3:outer:form");
+ formTester.setValue("content:aboutRealmProvison:enableRealmsProvision:checkboxField", true);
+
+ TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:3:outer:form:content:aboutRealmProvison:"
+ + "enableRealmsProvision:checkboxField", Constants.ON_CHANGE);
+
+ assertNotNull(findComponentById(
+ "body:toggle:outerObjectsRepeater:3:outer:form:content:aboutRealmProvison:realmsProvisionContainer",
+ "connObjectLink"));
+
+ TESTER.assertLabel("body:toggle:outerObjectsRepeater:3:outer:form:content:aboutRealmProvison:"
+ + "realmsProvisionContainer:connObjectLink:field-label", "Object Link");
+
+ formTester.setValue("content:aboutRealmProvison:enableRealmsProvision:checkboxField", false);
+
+ TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:3:outer:form:content:aboutRealmProvison:"
+ + "enableRealmsProvision:checkboxField", Constants.ON_CHANGE);
+
+ try {
+ findComponentById(
+ "body:toggle:outerObjectsRepeater:3:outer:form:content:aboutRealmProvison:realmsProvisionContainer",
+ "connObjectLink");
+ fail();
+ } catch (NullPointerException e) {
+ // correct
+ }
+ // ------------------------------------------
+
TESTER.clickLink("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:"
+ "content:group:beans:0:actions:panelMapping:mappingLink");
- FormTester formTester = TESTER.newFormTester(
+ formTester = TESTER.newFormTester(
"body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
formTester.submit("buttons:next");
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
index cdbc514..713e899 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
@@ -35,7 +35,7 @@ import org.junit.Before;
@FixMethodOrder(MethodSorters.JVM)
public class UsersITCase extends AbstractConsoleITCase {
- private static final String TAB_PANEL = "body:content:body:tabbedPanel:panel:searchResult:";
+ private static final String TAB_PANEL = "body:content:body:container:content:tabbedPanel:panel:searchResult:";
private static final String SEARCH_RES_CONTAINER = TAB_PANEL + "container:content:";
@@ -47,22 +47,24 @@ public class UsersITCase extends AbstractConsoleITCase {
@Test
public void filteredSearch() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
- TESTER.clickLink("body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:title");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:title");
- TESTER.executeAjaxEvent("body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:body:content:"
- + "searchFormContainer:search:multiValueContainer:innerForm:content:panelPlus:add", Constants.ON_CLICK);
+ TESTER.executeAjaxEvent("body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:body:"
+ + "content:searchFormContainer:search:multiValueContainer:innerForm:content:panelPlus:add",
+ Constants.ON_CLICK);
TESTER.assertComponent(
- "body:content:body:tabbedPanel:panel:accordionPanel:tabs:0:body:content:searchFormContainer:search:"
- + "multiValueContainer:innerForm:content:view:0:panel:container:value:textField", TextField.class);
+ "body:content:body:container:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:"
+ + "searchFormContainer:search:multiValueContainer:innerForm:content:view:0:panel:container:value:"
+ + "textField", TextField.class);
}
@Test
public void forceChangePassword() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", SEARCH_RES_CONTAINER
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "verdi");
@@ -77,7 +79,7 @@ public class UsersITCase extends AbstractConsoleITCase {
@Test
public void clickToCloneUser() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", SEARCH_RES_CONTAINER
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "rossini");
@@ -98,7 +100,7 @@ public class UsersITCase extends AbstractConsoleITCase {
@Test
public void editUser() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", SEARCH_RES_CONTAINER
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini");
@@ -163,7 +165,7 @@ public class UsersITCase extends AbstractConsoleITCase {
TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:dropdown-menu:buttons:1:button",
Constants.ON_CLICK);
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", SEARCH_RES_CONTAINER
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini");
@@ -193,7 +195,8 @@ public class UsersITCase extends AbstractConsoleITCase {
formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
assertNotNull(formTester);
- TESTER.executeAjaxEvent("body:content:body:tabbedPanel:panel:searchResult:outerObjectsRepeater:0:"
+ TESTER.executeAjaxEvent(
+ "body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:0:"
+ "outer:form:content:form:view:membershipsPlainSchemas:0:membershipPlainSchemas:tabs:0:title",
Constants.ON_CLICK);
@@ -242,7 +245,7 @@ public class UsersITCase extends AbstractConsoleITCase {
@Test
public void checkDeleteUsrLink() {
TESTER.clickLink("body:realmsLI:realms");
- TESTER.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:1:link");
+ TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
Component component = findComponentByProp("username", SEARCH_RES_CONTAINER
+ ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "rossini");
[2/2] syncope git commit: [SYNCOPE-874] handling realm provisioning
features on the administration console
Posted by fm...@apache.org.
[SYNCOPE-874] handling realm provisioning features on the administration console
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/0370ddc6
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/0370ddc6
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/0370ddc6
Branch: refs/heads/master
Commit: 0370ddc65b42fc163d6bc277572074bfff2a14fb
Parents: 9042203
Author: fmartelli <fa...@gmail.com>
Authored: Thu Jun 23 13:13:32 2016 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Thu Jun 23 13:13:41 2016 +0200
----------------------------------------------------------------------
.../client/console/commons/Constants.java | 2 +
.../console/commons/status/StatusUtils.java | 48 +++++
.../syncope/client/console/pages/Realms.java | 78 ++++----
.../client/console/panels/DirectoryPanel.java | 2 +-
.../client/console/panels/ListViewPanel.java | 16 ++
.../syncope/client/console/panels/Realm.java | 130 +++++++++++++-
.../client/console/panels/RealmDetails.java | 20 ++-
.../client/console/panels/RealmModalPanel.java | 94 ----------
.../console/panels/RealmWizardBuilder.java | 80 +++++++++
.../console/panels/RemoteObjectPanel.java | 32 ++++
.../policies/PolicyRuleDirectoryPanel.java | 4 +-
.../reports/ReportletDirectoryPanel.java | 4 +-
.../client/console/rest/RealmRestClient.java | 15 +-
.../client/console/wizards/WizardMgtPanel.java | 17 +-
.../console/wizards/any/ConnObjectPanel.java | 111 ++++++------
.../client/console/wizards/any/StatusPanel.java | 32 ++--
.../wizards/resources/ResourceMappingPanel.java | 36 +---
.../resources/ResourceProvisionPanel.java | 142 +++++++++++++++
.../META-INF/resources/css/syncopeConsole.css | 2 +-
.../client/console/pages/Realms.properties | 5 +-
.../client/console/pages/Realms_it.properties | 5 +-
.../console/pages/Realms_pt_BR.properties | 5 +-
.../client/console/pages/Realms_ru.properties | 5 +-
.../syncope/client/console/panels/Realm.html | 4 +-
.../client/console/panels/RealmDetails.html | 21 ++-
.../console/panels/RealmDetails.properties | 1 +
.../console/panels/RealmDetails_it.properties | 1 +
.../panels/RealmDetails_pt_BR.properties | 1 +
.../console/panels/RealmDetails_ru.properties | 9 +-
.../client/console/panels/RealmModalPanel.html | 23 ---
.../panels/RealmWizardBuilder$Realm.html | 23 +++
.../console/panels/RemoteObjectPanel.html | 24 +++
.../console/wizards/any/ConnObjectPanel.html | 3 -
.../any/StatusPanel$RemoteObjectPanel.html | 24 ---
...isionWizardBuilder$ConnObjectLink.properties | 4 +-
...onWizardBuilder$ConnObjectLink_it.properties | 4 +-
...izardBuilder$ConnObjectLink_pt_BR.properties | 4 +-
.../resources/ResourceProvisionPanel.html | 8 +
.../resources/ResourceProvisionPanel.properties | 3 +-
.../ResourceProvisionPanel_it.properties | 1 +
.../ResourceProvisionPanel_pt_BR.properties | 1 +
.../ResourceProvisionPanel_ru.properties | 1 +
.../syncope/fit/console/AnyObjectsITCase.java | 23 +--
.../syncope/fit/console/BulkActionITCase.java | 14 +-
.../fit/console/DisplayAttributesITCase.java | 14 +-
.../syncope/fit/console/GroupsITCase.java | 43 ++---
.../syncope/fit/console/RealmsITCase.java | 176 +++++++++++++++++--
.../syncope/fit/console/TopologyITCase.java | 34 +++-
.../apache/syncope/fit/console/UsersITCase.java | 29 +--
49 files changed, 985 insertions(+), 393 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/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 7157c09..7ac304d 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
@@ -27,6 +27,8 @@ import org.apache.wicket.model.Model;
public final class Constants {
+ public static final String SYNCOPE = "syncope";
+
public static final String ON_CLICK = "click";
public static final String ON_CHANGE = "change";
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
index d3d9558..989a19e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
@@ -34,6 +34,7 @@ import org.apache.syncope.common.lib.patch.StatusPatch;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
@@ -223,6 +224,53 @@ public class StatusUtils implements Serializable {
break;
}
+ return getLabel(componentId, alt, title, clazz);
+ }
+
+ public static Panel getStatusImagePanel(final String componentId, final PropagationTaskExecStatus status) {
+ return new LabelPanel(componentId, getStatusImage("label", status));
+ }
+
+ public static Label getStatusImage(final String componentId, final PropagationTaskExecStatus status) {
+ final String alt, title, clazz;
+
+ switch (status) {
+
+ case NOT_ATTEMPTED:
+ alt = "not attempted";
+ title = "Not attempted";
+ clazz = Constants.UNDEFINED_ICON;
+ break;
+
+ case CREATED:
+ alt = "created icon";
+ title = "Created";
+ clazz = Constants.CREATED_ICON;
+ break;
+
+ case SUCCESS:
+ alt = "success icon";
+ title = "Propagation succeded";
+ clazz = Constants.ACTIVE_ICON;
+ break;
+
+ case FAILURE:
+ alt = "failure icon";
+ title = "Propagation failed";
+ clazz = Constants.NOT_FOUND_ICON;
+ break;
+
+ default:
+ alt = StringUtils.EMPTY;
+ title = StringUtils.EMPTY;
+ clazz = StringUtils.EMPTY;
+ break;
+ }
+
+ return getLabel(componentId, alt, title, clazz);
+ }
+
+ private static Label getLabel(final String componentId, final String alt, final String title, final String clazz) {
return new Label(componentId, StringUtils.EMPTY) {
private static final long serialVersionUID = 4755868673082976208L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
index 780a06f..7106ac8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
@@ -24,7 +24,6 @@ import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.panels.Realm;
-import org.apache.syncope.client.console.panels.RealmModalPanel;
import org.apache.syncope.client.console.panels.RealmChoicePanel;
import org.apache.syncope.client.console.panels.RealmChoicePanel.ChosenRealm;
import org.apache.syncope.client.console.panels.WizardModalPanel;
@@ -32,20 +31,19 @@ import org.apache.syncope.client.console.rest.RealmRestClient;
import org.apache.syncope.client.console.tasks.TemplatesTogglePanel;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.client.console.wizards.AjaxWizard;
+import org.apache.syncope.client.console.wizards.any.ResultPage;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.RealmTO;
import org.apache.syncope.common.lib.to.TemplatableTO;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.event.Broadcast;
import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.WindowClosedCallback;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
public class Realms extends BasePage {
@@ -175,7 +173,7 @@ public class Realms extends BasePage {
if (realmTO == null) {
return content;
}
- content.addOrReplace(new Realm("body", realmTO, getPageReference(), selectedIndex) {
+ content.addOrReplace(new Realm("body", realmTO, Realms.this.getPageReference(), selectedIndex) {
private static final long serialVersionUID = 8221398624379357183L;
@@ -186,42 +184,48 @@ public class Realms extends BasePage {
}
@Override
- protected void onClickCreate(final AjaxRequestTarget target) {
- modal.header(new ResourceModel("newRealm"));
-
- RealmTO newRealmTO = new RealmTO();
- modal.setFormModel(newRealmTO);
-
- RealmModalPanel panel = new RealmModalPanel(
- modal,
- Realms.this.getPageReference(),
- newRealmTO,
- realmChoicePanel.getCurrentRealm().getFullPath(),
- StandardEntitlement.REALM_CREATE,
- true);
- target.add(modal.setContent(panel));
-
- modal.addSubmitButton();
- modal.show(true);
+ protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
+ modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ target.add(realmChoicePanel.reloadRealmTree(target));
+
+ if (modal.getContent() instanceof ResultPage) {
+ updateRealmContent(RealmTO.class.cast(
+ ResultPage.class.cast(modal.getContent()).getItem()), selectedIndex);
+ target.add(content);
+ }
+
+ modal.show(false);
+ }
+ });
}
@Override
- protected void onClickEdit(final AjaxRequestTarget target, final RealmTO realmTO) {
- modal.header(new StringResourceModel("editRealm", Model.of(realmTO)));
+ protected void onClickCreate(final AjaxRequestTarget target) {
+ this.wizardBuilder.setParentPath(realmChoicePanel.getCurrentRealm().getFullPath());
+ send(this, Broadcast.EXACT, new AjaxWizard.NewItemActionEvent<RealmTO>(new RealmTO(), target) {
- modal.setFormModel(realmTO);
+ @Override
+ public String getEventDescription() {
+ return "realm.new";
+ }
+ });
+ }
- RealmModalPanel panel = new RealmModalPanel(
- modal,
- Realms.this.getPageReference(),
- realmTO,
- realmTO.getFullPath(),
- StandardEntitlement.REALM_UPDATE,
- false);
- target.add(modal.setContent(panel));
+ @Override
+ protected void onClickEdit(final AjaxRequestTarget target, final RealmTO realmTO) {
+ this.wizardBuilder.setParentPath(realmTO.getFullPath());
+ send(this, Broadcast.EXACT, new AjaxWizard.EditItemActionEvent<RealmTO>(realmTO, target) {
- modal.addSubmitButton();
- modal.show(true);
+ @Override
+ public String getEventDescription() {
+ return "realm.edit";
+ }
+ });
}
@Override
@@ -242,7 +246,7 @@ public class Realms extends BasePage {
// Escape line breaks
SyncopeConsoleSession.get().error(e.getMessage().replace("\n", " "));
}
- ((BasePage) getPage()).getNotificationPanel().refresh(target);
+ ((BasePage) Realms.this.getPage()).getNotificationPanel().refresh(target);
}
});
return content;
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
index 5951936..59af452 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DirectoryPanel.java
@@ -292,7 +292,7 @@ public abstract class DirectoryPanel<
}
@Override
- protected void customActionOnCloseCallback(final AjaxRequestTarget target) {
+ protected void customActionOnFinishCallback(final AjaxRequestTarget target) {
final EventDataWrapper data = new EventDataWrapper();
data.setTarget(target);
data.setRows(rows);
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
index b649c4f..94ed492 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
@@ -370,8 +370,24 @@ public abstract class ListViewPanel<T extends Serializable> extends WizardMgtPan
protected T getActualItem(final T item, final List<T> list) {
return Builder.this.getActualItem(item, list);
}
+
+ @Override
+ protected void customActionOnFinishCallback(final AjaxRequestTarget target) {
+ Builder.this.customActionOnFinishCallback(target);
+ }
+
+ @Override
+ protected void customActionOnCancelCallback(final AjaxRequestTarget target) {
+ Builder.this.customActionOnCancelCallback(target);
+ }
};
}
+
+ protected void customActionOnCancelCallback(final AjaxRequestTarget target) {
+ }
+
+ protected void customActionOnFinishCallback(final AjaxRequestTarget target) {
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
index cb92360..86aa1ad 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
@@ -18,13 +18,22 @@
*/
package org.apache.syncope.client.console.panels;
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.syncope.client.console.commons.AnyTypeComparator;
+import org.apache.syncope.client.console.commons.ConnIdSpecialAttributeName;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
import org.apache.syncope.client.console.layout.AnyObjectFormLayoutInfo;
import org.apache.syncope.client.console.layout.FormLayoutInfoUtils;
import org.apache.syncope.client.console.layout.GroupFormLayoutInfo;
@@ -32,19 +41,27 @@ import org.apache.syncope.client.console.layout.UserFormLayoutInfo;
import org.apache.syncope.client.console.rest.AnyTypeRestClient;
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.client.console.wizards.any.ConnObjectPanel;
import org.apache.syncope.common.lib.to.AnyTypeTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.to.RealmTO;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public abstract class Realm extends Panel {
+public abstract class Realm extends WizardMgtPanel<RealmTO> {
private static final long serialVersionUID = -1100228004207271270L;
@@ -56,15 +73,26 @@ public abstract class Realm extends Panel {
private final AnyTypeRestClient anyTypeRestClient = new AnyTypeRestClient();
+ protected final RealmWizardBuilder wizardBuilder;
+
public Realm(final String id, final RealmTO realmTO, final PageReference pageRef, final int selectedIndex) {
- super(id);
+ super(id, true);
this.realmTO = realmTO;
this.anyTypeTOs = anyTypeRestClient.list();
- AjaxBootstrapTabbedPanel<ITab> tabbedPanel =
- new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList(pageRef));
+ setPageRef(pageRef);
+
+ AjaxBootstrapTabbedPanel<ITab> tabbedPanel
+ = new AjaxBootstrapTabbedPanel<>("tabbedPanel", buildTabList(pageRef));
tabbedPanel.setSelectedTab(selectedIndex);
- add(tabbedPanel);
+ addInnerObject(tabbedPanel);
+ this.wizardBuilder = new RealmWizardBuilder(pageRef);
+ addNewItemPanelBuilder(this.wizardBuilder, false);
+
+ setShowResultPage(true);
+
+ modal.size(Modal.Size.Large);
+ setWindowClosedReloadCallback(modal);
}
public RealmTO getRealmTO() {
@@ -126,8 +154,8 @@ public abstract class Realm extends Panel {
}
});
- final Triple<UserFormLayoutInfo, GroupFormLayoutInfo, Map<String, AnyObjectFormLayoutInfo>> formLayoutInfo =
- FormLayoutInfoUtils.fetch(anyTypeTOs);
+ final Triple<UserFormLayoutInfo, GroupFormLayoutInfo, Map<String, AnyObjectFormLayoutInfo>> formLayoutInfo
+ = FormLayoutInfoUtils.fetch(anyTypeTOs);
Collections.sort(anyTypeTOs, new AnyTypeComparator());
for (final AnyTypeTO anyTypeTO : anyTypeTOs) {
@@ -145,6 +173,78 @@ public abstract class Realm extends Panel {
return tabs;
}
+ @Override
+ @SuppressWarnings("unchecked")
+ protected Panel customResultBody(final String panelId, final RealmTO item, final Serializable result) {
+ if (!(result instanceof ProvisioningResult)) {
+ throw new IllegalStateException("Unsupported result type");
+ }
+
+ final MultilevelPanel mlp = new MultilevelPanel(panelId);
+ add(mlp);
+
+ final PropagationStatus syncope = new PropagationStatus();
+ syncope.setStatus(PropagationTaskExecStatus.SUCCESS);
+ syncope.setResource(Constants.SYNCOPE);
+
+ ArrayList<PropagationStatus> propagations = new ArrayList<>();
+ propagations.add(syncope);
+ propagations.addAll(((ProvisioningResult) result).getPropagationStatuses());
+
+ ListViewPanel.Builder<PropagationStatus> builder
+ = new ListViewPanel.Builder<PropagationStatus>(PropagationStatus.class, pageRef) {
+
+ private static final long serialVersionUID = -6809736686861678498L;
+
+ @Override
+ protected Component getValueComponent(final String key, final PropagationStatus bean) {
+ if ("afterObj".equalsIgnoreCase(key)) {
+ ConnObjectTO afterObj = bean.getAfterObj();
+ String remoteId = afterObj == null
+ || MapUtils.isEmpty(afterObj.getPlainAttrMap())
+ || !afterObj.getPlainAttrMap().containsKey(ConnIdSpecialAttributeName.NAME)
+ || CollectionUtils.isEmpty(
+ afterObj.getPlainAttrMap().get(ConnIdSpecialAttributeName.NAME).getValues())
+ ? StringUtils.EMPTY
+ : afterObj.getPlainAttrMap().get(ConnIdSpecialAttributeName.NAME).getValues().
+ iterator().next();
+
+ return new Label("field", remoteId);
+ } else if ("status".equalsIgnoreCase(key)) {
+ return StatusUtils.getStatusImagePanel("field", bean.getStatus());
+ } else {
+ return super.getValueComponent(key, bean);
+ }
+ }
+ };
+
+ builder.setItems(propagations);
+
+ builder.includes("resource", "afterObj", "status");
+ builder.withChecks(ListViewPanel.CheckAvailability.NONE);
+ builder.setReuseItem(false);
+
+ builder.addAction(new ActionLink<PropagationStatus>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ protected boolean statusCondition(final PropagationStatus bean) {
+ return !Constants.SYNCOPE.equals(bean.getResource())
+ && (PropagationTaskExecStatus.CREATED == bean.getStatus()
+ || PropagationTaskExecStatus.SUCCESS == bean.getStatus());
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final PropagationStatus bean) {
+ mlp.next(bean.getResource(), new RemoteRealmPanel(bean), target);
+ }
+ }, ActionLink.ActionType.VIEW, StandardEntitlement.RESOURCE_GET_CONNOBJECT);
+
+ mlp.setFirstLevel(builder.build(MultilevelPanel.FIRST_LEVEL_ID));
+ return mlp;
+ }
+
protected abstract void onClickTemplate(final AjaxRequestTarget target);
protected abstract void onClickCreate(final AjaxRequestTarget target);
@@ -153,4 +253,20 @@ public abstract class Realm extends Panel {
protected abstract void onClickDelete(final AjaxRequestTarget target, final RealmTO realmTO);
+ public class RemoteRealmPanel extends RemoteObjectPanel {
+
+ private static final long serialVersionUID = 4303365227411467563L;
+
+ private final PropagationStatus bean;
+
+ public RemoteRealmPanel(final PropagationStatus bean) {
+ this.bean = bean;
+ add(new ConnObjectPanel(REMOTE_OBJECT_PANEL_ID, getConnObjectTO()));
+ }
+
+ @Override
+ protected final Pair<ConnObjectTO, ConnObjectTO> getConnObjectTO() {
+ return Pair.of(bean.getBeforeObj(), bean.getAfterObj());
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
index 766a2b8..3d646df 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
@@ -22,16 +22,21 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.rest.PolicyRestClient;
+import org.apache.syncope.client.console.rest.ResourceRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.PolicyRenderer;
+import org.apache.syncope.common.lib.EntityTOUtils;
+import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
import org.apache.syncope.common.lib.to.RealmTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.DropDownChoice;
@@ -110,15 +115,18 @@ public class RealmDetails extends Panel {
container.setRenderBodyOnly(unwrapped);
add(container);
+ final WebMarkupContainer generics = new WebMarkupContainer("generics");
+ container.add(generics.setVisible(unwrapped));
+
FieldPanel<String> name = new AjaxTextFieldPanel(
"name", "name", new PropertyModel<String>(realmTO, "name"), false);
name.addRequiredLabel();
- container.add(name);
+ generics.add(name);
FieldPanel<String> fullPath = new AjaxTextFieldPanel(
"fullPath", "fullPath", new PropertyModel<String>(realmTO, "fullPath"), false);
fullPath.setEnabled(false);
- container.add(fullPath);
+ generics.add(fullPath);
AjaxDropDownChoicePanel<String> accountPolicy = new AjaxDropDownChoicePanel<>(
"accountPolicy",
@@ -148,6 +156,14 @@ public class RealmDetails extends Panel {
actionsClassNames.setOutputMarkupId(true);
container.add(actionsClassNames);
+ container.add(new AjaxPalettePanel.Builder<String>().build("resources",
+ new PropertyModel<List<String>>(realmTO, "resources"),
+ new ListModel<>(CollectionUtils.collect(new ResourceRestClient().list(),
+ EntityTOUtils.<ResourceTO>keyTransformer(), new ArrayList<String>()))).
+ setOutputMarkupId(true).
+ setEnabled(!SyncopeConstants.ROOT_REALM.equals(realmTO.getName())).
+ setVisible(!SyncopeConstants.ROOT_REALM.equals(realmTO.getName())));
+
if (actions == null) {
add(new Fragment("actions", "emptyFragment", this).setRenderBodyOnly(true));
} else {
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
deleted file mode 100644
index a4bdd55..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
+++ /dev/null
@@ -1,94 +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.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.rest.RealmRestClient;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.RealmTO;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.behavior.AttributeAppender;
-import org.apache.wicket.markup.html.form.Form;
-
-public class RealmModalPanel extends AbstractModalPanel<RealmTO> {
-
- private static final long serialVersionUID = -4285220460543213901L;
-
- private final RealmRestClient realmRestClient = new RealmRestClient();
-
- private boolean newRealm = false;
-
- private final String parentPath;
-
- public RealmModalPanel(
- final BaseModal<RealmTO> modal,
- final PageReference pageRef,
- final RealmTO realmTO,
- final String parentPath,
- final String entitlement) {
-
- this(modal, pageRef, realmTO, parentPath, entitlement, false);
- }
-
- public RealmModalPanel(
- final BaseModal<RealmTO> modal,
- final PageReference pageRef,
- final RealmTO realmTO,
- final String parentPath,
- final String entitlement,
- final boolean newRealm) {
-
- super(modal, pageRef);
-
- this.newRealm = newRealm;
- this.parentPath = parentPath;
-
- RealmDetails realmDetail = new RealmDetails("details", realmTO);
- realmDetail.add(new AttributeAppender("style", "overflow-x:hidden;"));
- if (SyncopeConsoleSession.get().owns(entitlement)) {
- MetaDataRoleAuthorizationStrategy.authorize(realmDetail, ENABLE, entitlement);
- }
-
- add(realmDetail);
- }
-
- @Override
- public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- try {
- final RealmTO updatedRealmTO = RealmTO.class.cast(form.getModelObject());
- if (newRealm) {
- realmRestClient.create(this.parentPath, updatedRealmTO);
- } else {
- realmRestClient.update(updatedRealmTO);
- }
- modal.close(target);
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- } catch (Exception e) {
- LOG.error("While creating or updating realm", e);
- SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.
- getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmWizardBuilder.java
new file mode 100644
index 0000000..f491f2b
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmWizardBuilder.java
@@ -0,0 +1,80 @@
+/*
+ * 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.io.Serializable;
+import org.apache.syncope.client.console.rest.RealmRestClient;
+import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.common.lib.to.ProvisioningResult;
+import org.apache.syncope.common.lib.to.RealmTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.behavior.AttributeAppender;
+import org.apache.wicket.extensions.wizard.WizardModel;
+import org.apache.wicket.extensions.wizard.WizardStep;
+
+public class RealmWizardBuilder extends AjaxWizardBuilder<RealmTO> {
+
+ private static final long serialVersionUID = 5945391813567245081L;
+
+ private final RealmRestClient realmRestClient = new RealmRestClient();
+
+ private String parentPath;
+
+ /**
+ * Construct.
+ *
+ * @param pageRef Caller page reference.
+ */
+ public RealmWizardBuilder(final PageReference pageRef) {
+ super(new RealmTO(), pageRef);
+ }
+
+ @Override
+ protected Serializable onApplyInternal(final RealmTO modelObject) {
+ final ProvisioningResult<RealmTO> res;
+ if (modelObject.getKey() == null) {
+ res = realmRestClient.create(this.parentPath, modelObject);
+ } else {
+ res = realmRestClient.update(modelObject);
+ }
+ return res;
+ }
+
+ @Override
+ protected WizardModel buildModelSteps(final RealmTO modelObject, final WizardModel wizardModel) {
+ wizardModel.add(new Realm(modelObject));
+ return wizardModel;
+ }
+
+ public static class Realm extends WizardStep {
+
+ private static final long serialVersionUID = -2123790676338327104L;
+
+ public Realm(final RealmTO modelObject) {
+ RealmDetails realmDetail = new RealmDetails("details", modelObject);
+ realmDetail.add(new AttributeAppender("style", "overflow-x:hidden;"));
+ add(realmDetail);
+ }
+
+ }
+
+ public void setParentPath(final String parentPath) {
+ this.parentPath = parentPath;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/panels/RemoteObjectPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RemoteObjectPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RemoteObjectPanel.java
new file mode 100644
index 0000000..5a6ab4e
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RemoteObjectPanel.java
@@ -0,0 +1,32 @@
+/*
+ * 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.commons.lang3.tuple.Pair;
+import org.apache.syncope.client.console.panels.MultilevelPanel.SecondLevel;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+
+public abstract class RemoteObjectPanel extends SecondLevel {
+
+ private static final long serialVersionUID = 4303365227411467563L;
+
+ protected static final String REMOTE_OBJECT_PANEL_ID = "remoteObject";
+
+ protected abstract Pair<ConnObjectTO, ConnObjectTO> getConnObjectTO();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
index 141fe81..ea49fb8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
@@ -172,7 +172,7 @@ public class PolicyRuleDirectoryPanel<T extends AbstractPolicyTO> extends Direct
});
restClient.updatePolicy(actual);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- customActionOnCloseCallback(target);
+ customActionOnFinishCallback(target);
} catch (SyncopeClientException e) {
LOG.error("While deleting {}", rule.getName(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
@@ -196,7 +196,7 @@ public class PolicyRuleDirectoryPanel<T extends AbstractPolicyTO> extends Direct
@Override
public void onClick(final AjaxRequestTarget target, final PolicyRuleWrapper ignore) {
if (target != null) {
- customActionOnCloseCallback(target);
+ customActionOnFinishCallback(target);
}
}
}, ActionLink.ActionType.RELOAD, StandardEntitlement.TASK_LIST).build(componentId);
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
index f00463c..f80e3b5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
@@ -175,7 +175,7 @@ public class ReportletDirectoryPanel extends DirectoryPanel<
});
restClient.update(actual);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- customActionOnCloseCallback(target);
+ customActionOnFinishCallback(target);
} catch (SyncopeClientException e) {
LOG.error("While deleting {}", reportlet.getName(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
@@ -199,7 +199,7 @@ public class ReportletDirectoryPanel extends DirectoryPanel<
@Override
public void onClick(final AjaxRequestTarget target, final ReportletWrapper ignore) {
if (target != null) {
- customActionOnCloseCallback(target);
+ customActionOnFinishCallback(target);
}
}
}, ActionLink.ActionType.RELOAD, StandardEntitlement.TASK_LIST).build(componentId);
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/rest/RealmRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/RealmRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/RealmRestClient.java
index cd22cfc..7ffb5e6 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/RealmRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/RealmRestClient.java
@@ -19,6 +19,9 @@
package org.apache.syncope.client.console.rest;
import java.util.List;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.to.RealmTO;
import org.apache.syncope.common.rest.api.service.RealmService;
@@ -33,12 +36,16 @@ public class RealmRestClient extends BaseRestClient {
return getService(RealmService.class).list();
}
- public void create(final String parentPath, final RealmTO realmTO) {
- getService(RealmService.class).create(parentPath, realmTO);
+ public ProvisioningResult<RealmTO> create(final String parentPath, final RealmTO realmTO) {
+ final Response response = getService(RealmService.class).create(parentPath, realmTO);
+ return response.readEntity(new GenericType<ProvisioningResult<RealmTO>>() {
+ });
}
- public void update(final RealmTO realmTO) {
- getService(RealmService.class).update(realmTO);
+ public ProvisioningResult<RealmTO> update(final RealmTO realmTO) {
+ final Response response = getService(RealmService.class).update(realmTO);
+ return response.readEntity(new GenericType<ProvisioningResult<RealmTO>>() {
+ });
}
public void delete(final String fullPath) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
index 86d0e38..157d151 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
@@ -211,6 +211,7 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
} else {
container.addOrReplace(initialFragment);
}
+ customActionOnCancelCallback(target);
} else if (event.getPayload() instanceof AjaxWizard.NewItemFinishEvent) {
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
@@ -238,7 +239,7 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
} else {
container.addOrReplace(initialFragment);
}
- customActionOnCloseCallback(target);
+ customActionOnFinishCallback(target);
}
if (containerAutoRefresh) {
@@ -337,7 +338,7 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
*
* @param modal target modal.
*/
- protected final void setWindowClosedReloadCallback(final BaseModal<?> modal) {
+ protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = 8804221891699487139L;
@@ -350,11 +351,19 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
}
/**
- * Custom action to perform on close callback.
+ * Custom action to perform on close callback on finish event.
*
* @param target Ajax request target.
*/
- protected void customActionOnCloseCallback(final AjaxRequestTarget target) {
+ protected void customActionOnFinishCallback(final AjaxRequestTarget target) {
+ }
+
+ /**
+ * Custom action to perform on close callback on cancel event.
+ *
+ * @param target Ajax request target.
+ */
+ protected void customActionOnCancelCallback(final AjaxRequestTarget target) {
}
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
index 49f6801..329fff9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
@@ -20,10 +20,11 @@ package org.apache.syncope.client.console.wizards.any;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.ListUtils;
+import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.client.console.commons.ConnIdSpecialAttributeName;
import org.apache.syncope.common.lib.to.AttrTO;
@@ -49,31 +50,39 @@ public class ConnObjectPanel extends Panel {
public ConnObjectPanel(final String id, final Pair<ConnObjectTO, ConnObjectTO> connObjectTOs) {
super(id);
- final IModel<List<AttrTO>> formProps = new LoadableDetachableModel<List<AttrTO>>() {
+ final IModel<List<String>> formProps = new LoadableDetachableModel<List<String>>() {
private static final long serialVersionUID = 5275935387613157437L;
@Override
- protected List<AttrTO> load() {
- List<AttrTO> attrs = new ArrayList<>(connObjectTOs == null || connObjectTOs.getRight() == null
+ protected List<String> load() {
+ List<AttrTO> right = new ArrayList<>(connObjectTOs == null || connObjectTOs.getRight() == null
? Collections.<AttrTO>emptyList()
: connObjectTOs.getRight().getAttrs());
- Collections.sort(attrs, new Comparator<AttrTO>() {
+ List<AttrTO> left = new ArrayList<>(connObjectTOs == null || connObjectTOs.getLeft() == null
+ ? Collections.<AttrTO>emptyList()
+ : connObjectTOs.getLeft().getAttrs());
- @Override
- public int compare(final AttrTO attr1, final AttrTO attr2) {
- if (attr1 == null || attr1.getSchema() == null) {
- return -1;
- }
- if (attr2 == null || attr2.getSchema() == null) {
- return 1;
- }
- return attr1.getSchema().compareTo(attr2.getSchema());
- }
- });
+ final List<String> schemas = ListUtils.sum(
+ CollectionUtils.collect(right, new Transformer<AttrTO, String>() {
+
+ @Override
+ public String transform(final AttrTO input) {
+ return input.getSchema();
+ }
+ }, new ArrayList<String>()),
+ CollectionUtils.collect(left, new Transformer<AttrTO, String>() {
+
+ @Override
+ public String transform(final AttrTO input) {
+ return input.getSchema();
+ }
+ }, new ArrayList<String>()));
+
+ Collections.sort(schemas);
- return attrs;
+ return schemas;
}
};
@@ -81,46 +90,46 @@ public class ConnObjectPanel extends Panel {
? null
: connObjectTOs.getLeft().getPlainAttrMap();
- final ListView<AttrTO> propView = new ListView<AttrTO>("propView", formProps) {
+ final Map<String, AttrTO> afterProfile = connObjectTOs == null || connObjectTOs.getRight() == null
+ ? null
+ : connObjectTOs.getRight().getPlainAttrMap();
+
+ final ListView<String> propView = new ListView<String>("propView", formProps) {
private static final long serialVersionUID = 3109256773218160485L;
@Override
- protected void populateItem(final ListItem<AttrTO> item) {
- final AttrTO prop = item.getModelObject();
+ protected void populateItem(final ListItem<String> item) {
+ final String prop = item.getModelObject();
final Fragment valueFragment;
- if (beforeProfile == null) {
- valueFragment = new Fragment("value", "singleValue", ConnObjectPanel.this);
- valueFragment.add(getValuePanel("attribute", prop.getSchema(), prop));
- } else {
- final AttrTO before = beforeProfile.get(prop.getSchema());
-
- valueFragment = new Fragment("value", "doubleValue", ConnObjectPanel.this);
- valueFragment.add(getValuePanel("oldAttribute", prop.getSchema(), before));
- valueFragment.add(getValuePanel("newAttribute", prop.getSchema(), prop));
-
- if (before == null
- || (CollectionUtils.isNotEmpty(prop.getValues())
- && CollectionUtils.isEmpty(before.getValues()))
- || (CollectionUtils.isEmpty(prop.getValues())
- && CollectionUtils.isNotEmpty(before.getValues()))
- || (CollectionUtils.isNotEmpty(prop.getValues())
- && CollectionUtils.isNotEmpty(before.getValues())
- && prop.getValues().size() != before.getValues().size())
- || (CollectionUtils.isNotEmpty(prop.getValues())
- && CollectionUtils.isNotEmpty(before.getValues())
- && !prop.getValues().equals(before.getValues()))) {
- valueFragment.add(new Behavior() {
-
- private static final long serialVersionUID = 3109256773218160485L;
-
- @Override
- public void onComponentTag(final Component component, final ComponentTag tag) {
- tag.put("class", "highlight");
- }
- });
- }
+ final AttrTO before = beforeProfile == null ? null : beforeProfile.get(prop);
+ final AttrTO after = afterProfile == null ? null : afterProfile.get(prop);
+
+ valueFragment = new Fragment("value", "doubleValue", ConnObjectPanel.this);
+ valueFragment.add(getValuePanel("oldAttribute", prop, before));
+ valueFragment.add(getValuePanel("newAttribute", prop, after));
+
+ if (before == null || after == null
+ || (CollectionUtils.isNotEmpty(after.getValues())
+ && CollectionUtils.isEmpty(before.getValues()))
+ || (CollectionUtils.isEmpty(after.getValues())
+ && CollectionUtils.isNotEmpty(before.getValues()))
+ || (CollectionUtils.isNotEmpty(after.getValues())
+ && CollectionUtils.isNotEmpty(before.getValues())
+ && after.getValues().size() != before.getValues().size())
+ || (CollectionUtils.isNotEmpty(after.getValues())
+ && CollectionUtils.isNotEmpty(before.getValues())
+ && !after.getValues().equals(before.getValues()))) {
+ valueFragment.add(new Behavior() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("class", "highlight");
+ }
+ });
}
item.add(valueFragment);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/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 8594d91..79ec175 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
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.SerializableTransformer;
import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
import org.apache.syncope.client.console.commons.status.Status;
@@ -31,7 +32,7 @@ import org.apache.syncope.client.console.commons.status.StatusBean;
import org.apache.syncope.client.console.commons.status.StatusUtils;
import org.apache.syncope.client.console.panels.ListViewPanel;
import org.apache.syncope.client.console.panels.MultilevelPanel;
-import org.apache.syncope.client.console.panels.MultilevelPanel.SecondLevel;
+import org.apache.syncope.client.console.panels.RemoteObjectPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.ConnObjectTO;
@@ -99,7 +100,7 @@ public class StatusPanel extends Panel {
final List<StatusBean> statusBeans = new ArrayList<>(connObjects.size() + 1);
initialStatusBeanMap = new LinkedHashMap<>(connObjects.size() + 1);
- final StatusBean syncope = new StatusBean(any, "syncope");
+ final StatusBean syncope = new StatusBean(any, Constants.SYNCOPE);
if (any instanceof UserTO) {
syncope.setConnObjectLink(((UserTO) any).getUsername());
@@ -169,7 +170,7 @@ public class StatusPanel extends Panel {
@Override
public void onClick(final AjaxRequestTarget target, final StatusBean bean) {
- mlp.next(bean.getResourceName(), new RemoteObjectPanel(bean, connObjects), target);
+ mlp.next(bean.getResourceName(), new RemoteAnyPanel(bean, connObjects), target);
}
}, ActionLink.ActionType.VIEW, StandardEntitlement.RESOURCE_GET_CONNOBJECT);
@@ -185,8 +186,9 @@ public class StatusPanel extends Panel {
return initialStatusBeanMap;
}
- private Pair<ConnObjectTO, ConnObjectTO> getConnObjectTO(
- final String anyKey, final String resourceName, final List<Pair<ConnObjectTO, ConnObjectWrapper>> objects) {
+ protected Pair<ConnObjectTO, ConnObjectTO> getConnObjectTO(
+ final String anyKey, final String resourceName,
+ final List<Pair<ConnObjectTO, ConnObjectWrapper>> objects) {
for (Pair<ConnObjectTO, ConnObjectWrapper> object : objects) {
if (anyKey.equals(object.getRight().getAny().getKey())
@@ -199,14 +201,24 @@ public class StatusPanel extends Panel {
return null;
}
- public class RemoteObjectPanel extends SecondLevel {
+ public class RemoteAnyPanel extends RemoteObjectPanel {
private static final long serialVersionUID = 4303365227411467563L;
- public RemoteObjectPanel(final StatusBean bean, final List<Pair<ConnObjectTO, ConnObjectWrapper>> connObjects) {
- final Pair<ConnObjectTO, ConnObjectTO> res = getConnObjectTO(bean.getAnyKey(), bean.getResourceName(),
- connObjects);
- add(new ConnObjectPanel("remoteObject", res == null ? null : res));
+ private final StatusBean bean;
+
+ private final List<Pair<ConnObjectTO, ConnObjectWrapper>> connObjects;
+
+ public RemoteAnyPanel(final StatusBean bean, final List<Pair<ConnObjectTO, ConnObjectWrapper>> connObjects) {
+ this.bean = bean;
+ this.connObjects = connObjects;
+
+ add(new ConnObjectPanel(REMOTE_OBJECT_PANEL_ID, getConnObjectTO()));
+ }
+
+ @Override
+ protected final Pair<ConnObjectTO, ConnObjectTO> getConnObjectTO() {
+ return StatusPanel.this.getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
}
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceMappingPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceMappingPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceMappingPanel.java
index de90660..158b170 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceMappingPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceMappingPanel.java
@@ -33,14 +33,11 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.commons.collections4.IterableUtils;
-import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang3.ClassUtils;
import org.apache.syncope.client.console.commons.ConnIdSpecialAttributeName;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.rest.AnyTypeClassRestClient;
import org.apache.syncope.client.console.rest.AnyTypeRestClient;
-import org.apache.syncope.client.console.rest.ConnectorRestClient;
import org.apache.syncope.client.console.wicket.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
@@ -52,8 +49,6 @@ import org.apache.syncope.client.console.widgets.MappingItemTransformerWidget;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.AnyTypeClassTO;
import org.apache.syncope.common.lib.to.AnyTypeTO;
-import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
-import org.apache.syncope.common.lib.to.ConnInstanceTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.MappingItemTO;
import org.apache.syncope.common.lib.to.MappingTO;
@@ -61,7 +56,6 @@ import org.apache.syncope.common.lib.to.ProvisionTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
import org.apache.syncope.common.lib.types.MappingPurpose;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -121,11 +115,6 @@ public class ResourceMappingPanel extends Panel {
*/
private final AnyTypeClassRestClient anyTypeClassRestClient = new AnyTypeClassRestClient();
- /**
- * ConnInstance rest client.
- */
- private final ConnectorRestClient connRestClient = new ConnectorRestClient();
-
private final Label passwordLabel;
/**
@@ -284,7 +273,10 @@ public class ResourceMappingPanel extends Panel {
"extAttrName",
getString("extAttrName"),
new PropertyModel<String>(mapItem, "extAttrName"));
- extAttrName.setChoices(getExtAttrNames(resourceTO.getConnector(), resourceTO.getConfOverride()));
+ extAttrName.setChoices(ResourceProvisionPanel.getExtAttrNames(
+ ResourceMappingPanel.this.provisionTO.getObjectClass(),
+ resourceTO.getConnector(),
+ resourceTO.getConfOverride()));
boolean required = !mapItem.isPassword();
extAttrName.setRequired(required).hideLabel();
@@ -463,26 +455,6 @@ public class ResourceMappingPanel extends Panel {
passwordLabel.setVisible(AnyTypeKind.USER.name().equals(this.provisionTO.getAnyType()));
}
- private List<String> getExtAttrNames(final String connectorKey, final Set<ConnConfProperty> conf) {
- ConnInstanceTO connInstanceTO = new ConnInstanceTO();
- connInstanceTO.setKey(connectorKey);
- connInstanceTO.getConf().addAll(conf);
-
- // SYNCOPE-156: use provided info to give schema names (and type!) by ObjectClass
- ConnIdObjectClassTO connIdObjectClass = IterableUtils.find(
- connRestClient.buildObjectClassInfo(connInstanceTO, false), new Predicate<ConnIdObjectClassTO>() {
-
- @Override
- public boolean evaluate(final ConnIdObjectClassTO object) {
- return object.getType().equalsIgnoreCase(ResourceMappingPanel.this.provisionTO.getObjectClass());
- }
- });
-
- return connIdObjectClass == null
- ? new ArrayList<String>()
- : connIdObjectClass.getAttributes();
- }
-
/**
* Set attribute names for a drop down choice list.
*
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
index 873f728..e7debac 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceProvisionPanel.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Set;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.IteratorUtils;
import org.apache.commons.collections4.Predicate;
@@ -33,21 +34,33 @@ import org.apache.syncope.client.console.pages.BasePage;
import org.apache.syncope.client.console.panels.AbstractModalPanel;
import org.apache.syncope.client.console.panels.ListViewPanel;
import org.apache.syncope.client.console.panels.ListViewPanel.ListViewReload;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
import org.apache.syncope.client.console.rest.ResourceRestClient;
+import org.apache.syncope.client.console.wicket.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
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.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wizards.AjaxWizard;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
import org.apache.syncope.common.lib.to.MappingItemTO;
import org.apache.syncope.common.lib.to.ProvisionTO;
import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.OrgUnitTO;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.common.rest.api.service.ResourceService;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.model.StringResourceModel;
public class ResourceProvisionPanel extends AbstractModalPanel<Serializable> {
@@ -56,6 +69,10 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable> {
private final ResourceTO resourceTO;
+ private Model<OrgUnitTO> baseModel;
+
+ private final WebMarkupContainer aboutRealmProvison;
+
public ResourceProvisionPanel(
final BaseModal<Serializable> modal,
final ResourceTO resourceTO,
@@ -63,8 +80,90 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable> {
super(modal, pageRef);
this.resourceTO = resourceTO;
+ baseModel = Model.of(resourceTO.getOrgUnit() == null ? new OrgUnitTO() : resourceTO.getOrgUnit());
+
setOutputMarkupId(true);
+ // ----------------------------------------------------------------------
+ // Realms provisioning
+ // ----------------------------------------------------------------------
+ aboutRealmProvison = new WebMarkupContainer("aboutRealmProvison");
+ aboutRealmProvison.setOutputMarkupPlaceholderTag(true);
+ add(aboutRealmProvison);
+
+ boolean realmProvisionEnabled = resourceTO.getOrgUnit() != null;
+
+ final AjaxCheckBoxPanel enableRealmsProvision = new AjaxCheckBoxPanel(
+ "enableRealmsProvision",
+ "enableRealmsProvision",
+ Model.of(realmProvisionEnabled),
+ false);
+ aboutRealmProvison.add(enableRealmsProvision);
+
+ final WebMarkupContainer realmsProvisionContainer = new WebMarkupContainer("realmsProvisionContainer");
+ realmsProvisionContainer.setOutputMarkupPlaceholderTag(true);
+ realmsProvisionContainer.setEnabled(realmProvisionEnabled).setVisible(realmProvisionEnabled);
+ aboutRealmProvison.add(realmsProvisionContainer);
+
+ final AjaxTextFieldPanel objectClass = new AjaxTextFieldPanel(
+ "objectClass",
+ getString("objectClass"),
+ new PropertyModel<String>(baseModel.getObject(), "objectClass"),
+ false);
+ realmsProvisionContainer.add(objectClass.addRequiredLabel());
+
+ final AjaxTextFieldPanel extAttrName = new AjaxTextFieldPanel(
+ "extAttrName",
+ getString("extAttrName"),
+ new PropertyModel<String>(baseModel.getObject(), "extAttrName"),
+ false);
+ extAttrName.setChoices(ResourceProvisionPanel.getExtAttrNames(
+ resourceTO.getOrgUnit() == null ? StringUtils.EMPTY : resourceTO.getOrgUnit().getObjectClass(),
+ resourceTO.getConnector(),
+ resourceTO.getConfOverride()));
+ realmsProvisionContainer.add(extAttrName.addRequiredLabel());
+
+ objectClass.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ extAttrName.setChoices(ResourceProvisionPanel.getExtAttrNames(
+ objectClass.getModelObject(),
+ resourceTO.getConnector(),
+ resourceTO.getConfOverride()));
+ target.focusComponent(extAttrName);
+ }
+ });
+
+ final AjaxTextFieldPanel connObjectLink = new AjaxTextFieldPanel(
+ "connObjectLink",
+ new ResourceModel("connObjectLink", "connObjectLink").getObject(),
+ new PropertyModel<String>(baseModel.getObject(), "connObjectLink"),
+ false);
+ realmsProvisionContainer.add(connObjectLink.addRequiredLabel());
+
+ enableRealmsProvision.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ boolean realmProvisionEnabled = enableRealmsProvision.getModelObject();
+ realmsProvisionContainer.setEnabled(realmProvisionEnabled).setVisible(realmProvisionEnabled);
+ target.add(realmsProvisionContainer);
+
+ if (realmProvisionEnabled) {
+ resourceTO.setOrgUnit(baseModel.getObject());
+ } else {
+ resourceTO.setOrgUnit(null);
+ }
+
+ }
+ });
+ // ----------------------------------------------------------------------
+
final ProvisionWizardBuilder wizard = new ProvisionWizardBuilder(resourceTO, pageRef);
final ListViewPanel.Builder<ProvisionTO> builder = new ListViewPanel.Builder<ProvisionTO>(
@@ -87,6 +186,19 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable> {
}
});
}
+
+ @Override
+ protected void customActionOnCancelCallback(final AjaxRequestTarget target) {
+ ResourceProvisionPanel.this.aboutRealmProvison.setVisible(true);
+ target.add(ResourceProvisionPanel.this.aboutRealmProvison);
+ }
+
+ @Override
+ protected void customActionOnFinishCallback(final AjaxRequestTarget target) {
+ ResourceProvisionPanel.this.aboutRealmProvison.setVisible(true);
+ target.add(ResourceProvisionPanel.this.aboutRealmProvison);
+ }
+
};
builder.setItems(resourceTO.getProvisions());
@@ -221,4 +333,34 @@ public class ResourceProvisionPanel extends AbstractModalPanel<Serializable> {
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
+
+ protected static List<String> getExtAttrNames(
+ final String objectClass, final String connectorKey, final Set<ConnConfProperty> conf) {
+ ConnInstanceTO connInstanceTO = new ConnInstanceTO();
+ connInstanceTO.setKey(connectorKey);
+ connInstanceTO.getConf().addAll(conf);
+
+ // SYNCOPE-156: use provided info to give schema names (and type!) by ObjectClass
+ ConnIdObjectClassTO connIdObjectClass = IterableUtils.find(new ConnectorRestClient().
+ buildObjectClassInfo(connInstanceTO, false), new Predicate<ConnIdObjectClassTO>() {
+
+ @Override
+ public boolean evaluate(final ConnIdObjectClassTO object) {
+ return object.getType().equalsIgnoreCase(objectClass);
+ }
+ });
+
+ return connIdObjectClass == null ? new ArrayList<String>() : connIdObjectClass.getAttributes();
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+
+ if (event.getPayload() instanceof AjaxWizard.NewItemActionEvent) {
+ aboutRealmProvison.setVisible(false);
+ ((AjaxWizard.NewItemEvent) event.getPayload()).getTarget().add(aboutRealmProvison);
+ }
+
+ super.onEvent(event);
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
index fb59b39..feecdbb 100644
--- a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
+++ b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
@@ -150,7 +150,7 @@ div.wicket-modal div.w_content_3 {
.tab-content {
margin-bottom: 10px;
- margin-top: 10px;
+ margin-top: 5px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms.properties
index 3f7890a..a8eb7d5 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms.properties
@@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-newRealm=New Realm
-editRealm=Edit Realm ${fullPath}
+any.realm.new=New Realm
+any.realm.edit=Edit Realm ${fullPath}
inner.template.edit=Edit ${left} template for '${right.fullPath}'
+afterObj=Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_it.properties
index 7151e21..8e84750 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_it.properties
@@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-newRealm=New Realm
-editRealm=Edit Realm ${fullPath}
+any.realm.new=New Realm
+any.realm.edit=Edit Realm ${fullPath}
inner.template.edit=Modifica ${left} template per '${right.fullPath}'
+afterObj=Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_pt_BR.properties
index 3f7890a..a8eb7d5 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_pt_BR.properties
@@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-newRealm=New Realm
-editRealm=Edit Realm ${fullPath}
+any.realm.new=New Realm
+any.realm.edit=Edit Realm ${fullPath}
inner.template.edit=Edit ${left} template for '${right.fullPath}'
+afterObj=Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_ru.properties
index 209f852..bec91ef 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Realms_ru.properties
@@ -16,7 +16,8 @@
# under the License.
#
# newRealm=\u00d0\u00a1\u00d0\u00be\u00d0\u00b7\u00d0\u00b4\u00d0\u00b0\u00d1\u0082\u00d1\u008c \u00d0\u00be\u00d0\u00b1\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d1\u0082\u00d1\u008c
-newRealm=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c
+any.realm.new=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c
# editRealm=\u00d0\u0098\u00d0\u00b7\u00d0\u00bc\u00d0\u00b5\u00d0\u00bd\u00d0\u00b8\u00d1\u0082\u00d1\u008c \u00d0\u00be\u00d0\u00b1\u00d0\u00bb\u00d0\u00b0\u00d1\u0081\u00d1\u0082\u00d1\u008c ${fullPath}
-editRealm=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c ${fullPath}
+any.realm.edit=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c ${fullPath}
inner.template.edit=Edit ${left} template for '${right.fullPath}'
+afterObj=Object Link
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/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 c674ea8..25a998f 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,7 +17,7 @@ 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>
+ <wicket:extend>
<div wicket:id="tabbedPanel"></div>
- </wicket:panel>
+ </wicket:extend>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
index dacb356..76c4b98 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
@@ -19,13 +19,26 @@ under the License.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div wicket:id="container" class="summarize">
- <span wicket:id="name">[name]</span>
- <span wicket:id="fullPath">[fullPath]</span>
- <span wicket:id="accountPolicy">[accountPolicy]</span>
- <span wicket:id="passwordPolicy">[passwordPolicy]</span>
+ <div wicket:id="generics">
+ <div class="form-group">
+ <span wicket:id="name">[name]</span>
+ </div>
+ <div class="form-group">
+ <span wicket:id="fullPath">[fullPath]</span>
+ </div>
+ </div>
+ <div class="form-group">
+ <span wicket:id="accountPolicy">[accountPolicy]</span>
+ </div>
+ <div class="form-group">
+ <span wicket:id="passwordPolicy">[passwordPolicy]</span>
+ </div>
<div class="form-group form-palette">
<span wicket:id="actionsClassNames">[actionsClassNames]</span>
</div>
+ <div class="form-group form-palette">
+ <span wicket:id="resources">[resources]</span>
+ </div>
</div>
<span wicket:id="actions"></span>
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.properties
index 5dd65af..c4848a1 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.properties
@@ -18,3 +18,4 @@ fullPath=Path
accountPolicy=Account Policy
passwordPolicy=Password Policy
actionsClassNames=Actions
+resources=Assigned resources
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_it.properties
index 6d4cead..05d20c2 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_it.properties
@@ -18,3 +18,4 @@ fullPath=Percorso
accountPolicy=Account Policy
passwordPolicy=Password Policy
actionsClassNames=Actions
+resources=Risorse assegnate
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_pt_BR.properties
index db6910f..786313f 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_pt_BR.properties
@@ -18,3 +18,4 @@ fullPath=Caminho
accountPolicy=Pol\u00edtica de Conta
passwordPolicy=Pol\u00edtica de Senha
actionsClassNames=Actions
+resources=Assigned resources
http://git-wip-us.apache.org/repos/asf/syncope/blob/0370ddc6/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_ru.properties
index a79ba76..27396c6 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails_ru.properties
@@ -15,11 +15,12 @@
# specific language governing permissions and limitations
# under the License.
#
-# fullPath=\u041f\u0443\u0442\u044c
+# fullPath=\u00d0\u009f\u00d1\u0083\u00d1\u0082\u00d1\u008c
fullPath=\u041f\u0443\u0442\u044c
-# accountPolicy=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439
+# accountPolicy=\u00d0\u009f\u00d0\u00be\u00d0\u00bb\u00d0\u00b8\u00d1\u0082\u00d0\u00b8\u00d0\u00ba\u00d0\u00b0 \u00d1\u0083\u00d1\u0087\u00d0\u00b5\u00d1\u0082\u00d0\u00bd\u00d1\u008b\u00d1\u0085 \u00d0\u00b7\u00d0\u00b0\u00d0\u00bf\u00d0\u00b8\u00d1\u0081\u00d0\u00b5\u00d0\u00b9
accountPolicy=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439
-# passwordPolicy=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439
+# passwordPolicy=\u00d0\u009f\u00d0\u00be\u00d0\u00bb\u00d0\u00b8\u00d1\u0082\u00d0\u00b8\u00d0\u00ba\u00d0\u00b0 \u00d0\u00bf\u00d0\u00b0\u00d1\u0080\u00d0\u00be\u00d0\u00bb\u00d0\u00b5\u00d0\u00b9
passwordPolicy=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439
-# actionsClassNames=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f
+# actionsClassNames=\u00d0\u0094\u00d0\u00b5\u00d0\u00b9\u00d1\u0081\u00d1\u0082\u00d0\u00b2\u00d0\u00b8\u00d1\u008f
actionsClassNames=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f
+resources=Assigned resources