You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/02/05 17:00:32 UTC
[01/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Repository: syncope
Updated Branches:
refs/heads/2_0_X 8be42f881 -> 07aa45858
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
index b706efd..6808a5b 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/SyncopeLogic.java
@@ -29,6 +29,7 @@ import javax.annotation.Resource;
import org.apache.syncope.common.lib.to.SyncopeTO;
import org.apache.syncope.server.logic.init.ImplementationClassNamesLoader;
import org.apache.syncope.server.misc.spring.ResourceWithFallbackLoader;
+import org.apache.syncope.server.persistence.api.dao.ConfDAO;
import org.apache.syncope.server.provisioning.api.AttributableTransformer;
import org.apache.syncope.server.provisioning.api.ConnIdBundleManager;
import org.apache.syncope.server.provisioning.api.RoleProvisioningManager;
@@ -40,10 +41,14 @@ import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
@Component
public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
+ @Autowired
+ private ConfDAO confDAO;
+
@Resource(name = "version")
private String version;
@@ -71,11 +76,31 @@ public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
@Resource(name = "velocityResourceLoader")
private ResourceWithFallbackLoader resourceLoader;
+ @Transactional(readOnly = true)
+ public boolean isSelfRegAllowed() {
+ return confDAO.find("selfRegistration.allowed", "false").getValues().get(0).getBooleanValue();
+ }
+
+ @Transactional(readOnly = true)
+ public boolean isPwdResetAllowed() {
+ return confDAO.find("passwordReset.allowed", "false").getValues().get(0).getBooleanValue();
+ }
+
+ @Transactional(readOnly = true)
+ public boolean isPwdResetRequiringSecurityQuestions() {
+ return confDAO.find("passwordReset.securityQuestion", "true").getValues().get(0).getBooleanValue();
+ }
+
@PreAuthorize("isAuthenticated()")
+ @Transactional(readOnly = true)
public SyncopeTO info() {
SyncopeTO syncopeTO = new SyncopeTO();
syncopeTO.setVersion(version);
+ syncopeTO.setSelfRegAllowed(isSelfRegAllowed());
+ syncopeTO.setPwdResetAllowed(isPwdResetAllowed());
+ syncopeTO.setPwdResetRequiringSecurityQuestions(isPwdResetRequiringSecurityQuestions());
+
if (bundleManager.getLocations() != null) {
for (URI location : bundleManager.getLocations()) {
syncopeTO.getConnIdLocations().add(location.toASCIIString());
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
----------------------------------------------------------------------
diff --git a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
index c9b9249..ef869eb 100644
--- a/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
+++ b/syncope620/server/logic/src/main/java/org/apache/syncope/server/logic/UserLogic.java
@@ -42,7 +42,6 @@ import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.SubjectType;
import org.apache.syncope.server.persistence.api.RoleEntitlementUtil;
-import org.apache.syncope.server.persistence.api.dao.ConfDAO;
import org.apache.syncope.server.persistence.api.dao.NotFoundException;
import org.apache.syncope.server.persistence.api.dao.RoleDAO;
import org.apache.syncope.server.persistence.api.dao.SubjectSearchDAO;
@@ -81,9 +80,6 @@ public class UserLogic extends AbstractSubjectLogic<UserTO, UserMod> {
protected SubjectSearchDAO searchDAO;
@Autowired
- protected ConfDAO confDAO;
-
- @Autowired
protected UserDataBinder binder;
@Autowired
@@ -101,20 +97,8 @@ public class UserLogic extends AbstractSubjectLogic<UserTO, UserMod> {
@Autowired
protected UserProvisioningManager provisioningManager;
- @Transactional(readOnly = true)
- public boolean isSelfRegAllowed() {
- return confDAO.find("selfRegistration.allowed", "false").getValues().get(0).getBooleanValue();
- }
-
- @Transactional(readOnly = true)
- public boolean isPwdResetAllowed() {
- return confDAO.find("passwordReset.allowed", "false").getValues().get(0).getBooleanValue();
- }
-
- @Transactional(readOnly = true)
- public boolean isPwdResetRequiringSecurityQuestions() {
- return confDAO.find("passwordReset.securityQuestion", "true").getValues().get(0).getBooleanValue();
- }
+ @Autowired
+ protected SyncopeLogic syncopeLogic;
@PreAuthorize("hasRole('USER_READ')")
public String getUsername(final Long key) {
@@ -307,7 +291,7 @@ public class UserLogic extends AbstractSubjectLogic<UserTO, UserMod> {
throw new NotFoundException("User " + username);
}
- if (isPwdResetRequiringSecurityQuestions()
+ if (syncopeLogic.isPwdResetRequiringSecurityQuestions()
&& (securityAnswer == null || !securityAnswer.equals(user.getSecurityAnswer()))) {
throw SyncopeClientException.build(ClientExceptionType.InvalidSecurityAnswer);
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/UserSelfServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/UserSelfServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/UserSelfServiceImpl.java
index c018d5c..826c312 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/UserSelfServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/UserSelfServiceImpl.java
@@ -18,14 +18,13 @@
*/
package org.apache.syncope.server.rest.cxf.service;
-import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.mod.UserMod;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.service.UserSelfService;
+import org.apache.syncope.server.logic.SyncopeLogic;
import org.apache.syncope.server.logic.UserLogic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -36,18 +35,12 @@ public class UserSelfServiceImpl extends AbstractServiceImpl implements UserSelf
@Autowired
private UserLogic logic;
- @Override
- public Response getOptions() {
- return Response.ok().header(HttpHeaders.ALLOW, OPTIONS_ALLOW).
- header(RESTHeaders.SELFREG_ALLOWED, logic.isSelfRegAllowed()).
- header(RESTHeaders.PWDRESET_ALLOWED, logic.isPwdResetAllowed()).
- header(RESTHeaders.PWDRESET_NEEDS_SECURITYQUESTIONS, logic.isPwdResetRequiringSecurityQuestions()).
- build();
- }
+ @Autowired
+ private SyncopeLogic syncopeLogic;
@Override
public Response create(final UserTO userTO, final boolean storePassword) {
- if (!logic.isSelfRegAllowed()) {
+ if (!syncopeLogic.isSelfRegAllowed()) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.Unauthorized);
sce.getElements().add("Self registration forbidden by configuration");
throw sce;
@@ -77,7 +70,7 @@ public class UserSelfServiceImpl extends AbstractServiceImpl implements UserSelf
@Override
public void requestPasswordReset(final String username, final String securityAnswer) {
- if (!logic.isPwdResetAllowed()) {
+ if (!syncopeLogic.isPwdResetAllowed()) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.Unauthorized);
sce.getElements().add("Password reset forbidden by configuration");
throw sce;
@@ -88,7 +81,7 @@ public class UserSelfServiceImpl extends AbstractServiceImpl implements UserSelf
@Override
public void confirmPasswordReset(final String token, final String password) {
- if (!logic.isPwdResetAllowed()) {
+ if (!syncopeLogic.isPwdResetAllowed()) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.Unauthorized);
sce.getElements().add("Password reset forbidden by configuration");
throw sce;
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/server/rest-cxf/src/main/resources/META-INF/org.apache.cxf.Logger
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/resources/META-INF/org.apache.cxf.Logger b/syncope620/server/rest-cxf/src/main/resources/META-INF/org.apache.cxf.Logger
deleted file mode 100644
index 6e7bd36..0000000
--- a/syncope620/server/rest-cxf/src/main/resources/META-INF/org.apache.cxf.Logger
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.cxf.common.logging.Slf4jLogger
[47/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java
new file mode 100644
index 0000000..17713fa
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java
@@ -0,0 +1,238 @@
+/*
+ * 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.fit.console.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+
+public class ConnectorITCase extends AbstractITCase {
+
+ @Test
+ public void browseCreateModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[3]/div[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(("//iframe"))));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ Select select = new Select(
+ seleniumDriver.findElement(By.xpath("//form/div[2]/div[1]/div[1]/div[2]/div[2]/span/select")));
+
+ select.selectByValue("1");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='connectorName:dropDownChoiceField']/option[3]")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//form/div[2]/div[1]/div[1]/div[3]/div[2]/span/select")));
+ select.selectByVisibleText("net.tirasa.connid.bundles.soap");
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[1]/a/span")).click();
+
+ assertTrue(seleniumDriver.findElement(By.xpath("//form/div[2]/div/div/div[3]/div[2]")).isDisplayed());
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void browseEditModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[3]/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//tr[4]/td[7]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//div[2]/form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ assertEquals("ConnInstance103",
+ seleniumDriver.findElement(By.xpath("//input[@name='displayName:textField']")).getAttribute("value"));
+
+ assertEquals("net.tirasa.connid.bundles.soap",(new Select(seleniumDriver.findElement(
+ By.xpath("//select[@name='connectorName:dropDownChoiceField']")))).getFirstSelectedOption().getText());
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[2]/a/span")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void delete() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[3]/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//tr[4]/td[7]/div/span[15]/a")).click();
+
+ Alert alert = seleniumDriver.switchTo().alert();
+ assertTrue(alert.getText().equals("Do you really want to delete the selected item(s)?"));
+ alert.accept();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(By.tagName("body")).getText().contains("Error: "));
+ }
+
+ @Test
+ public void checkConnection() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[3]/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//tr[2]/td[7]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='version:dropDownChoiceField']")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//div[2]/form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[2]/div[2]/div/span/div[2]/div[30]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/div[2]/div/span/div[2]/div[30]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div/ul/li/span[contains(text(),'Successful connection')]")));
+
+ seleniumDriver.switchTo().defaultContent();
+ }
+
+ @Test
+ public void issueSYNCOPE506() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//tr[4]/td[3]/div/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='version:dropDownChoiceField']")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ seleniumDriver.findElement(By.xpath(
+ "//div[2]/form/div[2]/div[2]/div/span/div[2]/div[30]/div[3]/span/div/div/span/a[2]/span/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(By.tagName("body")).getText().contains("Operation executed successfully"));
+
+ seleniumDriver.findElement(By.xpath("//tr[4]/td[3]/div/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='version:dropDownChoiceField']")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@value='99']")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[2]/a/span")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void issueSyncope605() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[3]/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//tr[8]/td[7]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//div[2]/form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ assertEquals("H2-testsync",
+ seleniumDriver.findElement(By.xpath("//input[@name='displayName:textField']")).getAttribute("value"));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[3]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/div[3]/span/input[7]")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+
+ seleniumDriver.findElement(By.xpath("//tr[8]/td[7]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//div[2]/form/div[2]/div/div/div[3]/div[2]/span/select")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[3]/a")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[2]/div[3]/span/input[7]")));
+
+ assertFalse(seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/div[3]/span/input[7]")).isSelected());
+ seleniumDriver.switchTo().defaultContent();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/EditProfileITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/EditProfileITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/EditProfileITCase.java
new file mode 100644
index 0000000..edee7e0
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/EditProfileITCase.java
@@ -0,0 +1,94 @@
+/*
+ * 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.fit.console.reference;
+
+import java.util.concurrent.TimeUnit;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+
+public class EditProfileITCase {
+
+ private WebDriver seleniumDriver;
+
+ private WebDriverWait wait;
+
+ @Before
+ public void setUp() throws Exception {
+ seleniumDriver = new FirefoxDriver();
+ seleniumDriver.get(AbstractITCase.BASE_URL);
+ wait = new WebDriverWait(seleniumDriver, 10);
+
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Logout\"]")).click();
+ seleniumDriver.quit();
+ }
+
+ @Test
+ public void selfRegistration() {
+ seleniumDriver.findElement(By.xpath("//div/div[2]/div[1]/span/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//span[contains(text(),'Plain attributes')]")));
+ seleniumDriver.switchTo().defaultContent();
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+
+ // only to have some "Logout" available for @After
+ seleniumDriver.get(AbstractITCase.BASE_URL);
+ seleniumDriver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
+ WebElement element = seleniumDriver.findElement(By.name("userId"));
+ element.sendKeys(AbstractITCase.ADMIN);
+ element = seleniumDriver.findElement(By.name("password"));
+ element.sendKeys(AbstractITCase.PASSWORD);
+ seleniumDriver.findElement(By.name("p::submit")).click();
+ seleniumDriver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
+ }
+
+ @Test
+ public void editUserProfile() {
+ WebElement element = seleniumDriver.findElement(By.name("userId"));
+ element.sendKeys("rossini");
+ element = seleniumDriver.findElement(By.name("password"));
+ element.sendKeys("password");
+ seleniumDriver.findElement(By.name("p::submit")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='username']/a")));
+ seleniumDriver.findElement(By.xpath("//div[@id='username']/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//span[contains(text(),'Plain attributes')]")));
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@value='rossini']")));
+ seleniumDriver.switchTo().defaultContent();
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ReportITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ReportITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ReportITCase.java
new file mode 100644
index 0000000..0a6b1b5
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ReportITCase.java
@@ -0,0 +1,117 @@
+/*
+ * 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.fit.console.reference;
+
+import static org.junit.Assert.assertTrue;
+
+import org.apache.syncope.common.lib.report.StaticReportletConf;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+
+public class ReportITCase extends AbstractITCase {
+
+ @Test
+ public void readReportlet() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Reports\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+ seleniumDriver.findElement(By.xpath("//table/tbody/tr/td[8]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[2]/div/div/span/div/div/div/span")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/div/div/span/div/div[5]/div[2]/div/div[2]/div/a"))
+ .click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[2]/div/div/span/div/div[5]/div[2]/div/div/select")));
+
+ Select select = new Select(seleniumDriver.findElement(
+ By.xpath("//div[2]/form/div[2]/div/div/span/div/div[5]/div[2]/div/div/select")));
+ select.selectByVisibleText("testUserReportlet");
+
+ seleniumDriver.findElement(
+ By.xpath("//div[2]/form/div[2]/div/div/span/div/div[5]/div[2]/div[2]/div[2]/a")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+ wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(
+ By.xpath("//div[7]/form/div/div[2]/div/div/div/div[2]/div/div/iframe")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.name("reportletClass:dropDownChoiceField")));
+
+ select = new Select(seleniumDriver.findElement(By.name("reportletClass:dropDownChoiceField")));
+ select.selectByVisibleText(StaticReportletConf.class.getName());
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void executeReport() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Reports\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//table/tbody/tr/td[8]/div/span[6]/a")).click();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(
+ By.tagName("body")).getText().contains("Operation executed successfully"));
+ }
+
+ @Test
+ public void navigateAudit() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Reports\"]")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//option[contains(text(),'[REST]:[EntitlementLogic]:[]:[getOwn]:[SUCCESS]')]")));
+
+ Select select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='events:categoryContainer:type:dropDownChoiceField']")));
+ select.selectByVisibleText("PROPAGATION");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//select[@name='events:categoryContainer:category:dropDownChoiceField']/option[text()='user']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='events:categoryContainer:category:dropDownChoiceField']")));
+ select.selectByVisibleText("user");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//select[@name='events:categoryContainer:subcategory:dropDownChoiceField']"
+ + "/option[text()='resource-csv']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='events:categoryContainer:subcategory:dropDownChoiceField']")));
+ select.selectByVisibleText("resource-csv");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//input[@name='events:eventsContainer:eventsPanel:successGroup']")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ResourceITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ResourceITCase.java
new file mode 100644
index 0000000..cf9c10c
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ResourceITCase.java
@@ -0,0 +1,144 @@
+/*
+ * 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.fit.console.reference;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+public class ResourceITCase extends AbstractITCase {
+
+ @Test
+ public void browseCreateModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[3]/div/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//form/div[3]/div/span/div/div/div/label[text()='Name']")));
+
+ seleniumDriver.switchTo().defaultContent();
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void browseEditModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//td[6]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//form/div[3]/div/span/div/div/div/label[text()='Name']")));
+
+ seleniumDriver.findElement(By.xpath("//li[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//tbody/tr[2]/td/input")));
+
+ seleniumDriver.findElement(By.xpath("//tbody/tr[2]/td/input")).click();
+
+ Alert alert = seleniumDriver.switchTo().alert();
+ assertTrue(alert.getText().equals("Do you really want to delete the selected item(s)?"));
+ alert.accept();
+
+ seleniumDriver.findElement(By.xpath("//div[4]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+ }
+
+ @Test
+ public void delete() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//tr[3]/td[6]/div/span[15]/a")).click();
+
+ Alert alert = seleniumDriver.switchTo().alert();
+ assertTrue(alert.getText().equals("Do you really want to delete the selected item(s)?"));
+ alert.accept();
+ }
+
+ @Test
+ public void checkSecurityTab() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//td[6]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//form/div[3]/div/span/div/div/div/label[text()='Name']")));
+
+ seleniumDriver.findElement(By.xpath("//li[4]/a")).click();
+
+ assertTrue(seleniumDriver.findElements(By.xpath("//label[@for='passwordPolicy']")).size() > 0);
+
+ seleniumDriver.findElement(By.xpath("//li[1]/a")).click();
+ seleniumDriver.findElement(By.xpath("//li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//li[3]/a")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void checkConnection() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(
+ By.xpath("//*[@id=\"users-contain\"]//*[div=\"ws-target-resource-delete\"]/../td[6]/div/span[13]/a"))
+ .click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//form/div[3]/div/span/div/div/div/label[text()='Name']")));
+
+ seleniumDriver.findElement(By.xpath("//li[4]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[text()='endpoint']")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div[4]/span/span/div[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div/ul/li/span[contains(text(), 'Successful connection')]")));
+
+ seleniumDriver.switchTo().defaultContent();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java
new file mode 100644
index 0000000..111ba5e
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java
@@ -0,0 +1,211 @@
+/*
+ * 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.fit.console.reference;
+
+import static junit.framework.TestCase.assertTrue;
+import org.junit.Test;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+
+public class RoleITCase extends AbstractITCase {
+
+ @Test
+ public void createRootNodeModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span/div/div/div/div/div/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div/div/span[2]/span/div/p/span/span/a")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span[2]/span/div/p/span/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//span[contains(text(),'Plain attributes')]")));
+
+ seleniumDriver.switchTo().defaultContent();
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void browseCreateModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span/div/div/div/div/div[2]/div/div/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt='create icon']")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt='create icon']")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[3]/div/ul/li[1]/a/span")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[1]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[2]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[5]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[6]/a/span")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void browseEditModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span/div/div/div/div/div[2]/div/div/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt='edit icon']")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt='edit icon']")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[3]/div/ul/li[1]/a/span")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[2]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[5]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[6]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/ul/li[7]/a/span")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void checkSecurityTab() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span/div/div/div/div/div[2]/div/div/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div/form/div[2]/ul/li[7]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div/form/div[2]/ul/li[7]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//form/div[2]/div/div[8]/span/div/div/div/label")));
+ }
+
+ @Test
+ public void browseUserEditModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span/div/div/div/div/div[2]/div/div/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div/div/span[2]/span/span/div/form/div[2]/ul/li[9]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span[2]/span/span/div/form/div[2]/ul/li[9]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//input[@name=\"userListContainer:search\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//table/tbody/tr/td[5]/div/span[13]/a")));
+
+ seleniumDriver.findElement(By.xpath("//table/tbody/tr/td[5]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//form/div[3]/div/span/div/div/div[contains(text(),'Username')]")));
+
+ seleniumDriver.switchTo().defaultContent();
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void searchUsers() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span/div/div/div/div/div[2]/div/div/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div/div/span[2]/span/span/div/form/div[2]/ul/li[9]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div/div/span[2]/span/span/div/form/div[2]/ul/li[9]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//input[@name=\"userListContainer:search\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[15]/a")));
+ }
+
+ @Test
+ public void deleteRole() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='navigationPane']")));
+
+ seleniumDriver.findElement(By.xpath(
+ "//div/div/span/div/div/div/div/div[2]/div[2]/div[2]/div/div[2]/div[3]/div/span[2]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt='delete icon']")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt='delete icon']")).click();
+
+ Alert alert = seleniumDriver.switchTo().alert();
+ assertTrue(alert.getText().equals("Do you really want to delete the selected item(s)?"));
+ alert.accept();
+ }
+
+ @Test
+ public void issueSYNCOPE510() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//span[contains(text(),'Search')]")));
+
+ seleniumDriver.findElement(By.xpath("//span[contains(text(),'Search')]")).click() ;
+ Select select = new Select(seleniumDriver.findElement(By.xpath("//td[2]/select")));
+ select.selectByVisibleText("RESOURCE");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//td[3]/select[option='ws-target-resource-2']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath("//td[3]/select")));
+ select.selectByVisibleText("ws-target-resource-2");
+ seleniumDriver.findElement(By.xpath("//form/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[3]/div[2]/div[2]/span/div[1]/span[1]/span/form/span/table/tbody/tr/td[3]/div")));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java
new file mode 100644
index 0000000..130d414
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java
@@ -0,0 +1,70 @@
+/*
+ * 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.fit.console.reference;
+
+import static junit.framework.TestCase.assertTrue;
+import org.junit.Test;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+
+public class SchemaITCase extends AbstractITCase {
+
+ @Test
+ public void create() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Schema\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[4]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='rschema']/div/div/div/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@name='key:textField']")));
+
+ Select select = new Select(seleniumDriver.findElement(By.name("type:dropDownChoiceField")));
+ select.selectByValue("0");
+ WebElement textField = seleniumDriver.findElement(By.name("key:textField"));
+ textField.sendKeys("newschema");
+ seleniumDriver.findElement(By.name("apply")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(By.tagName("body")).getText().contains("newschema"));
+ }
+
+ @Test
+ public void delete() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Schema\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(
+ By.xpath("//div[3]/div/div/div/div/div/span/table/tbody/tr/td[7]/div/span[15]/a")).click();
+
+ Alert alert = seleniumDriver.switchTo().alert();
+ assertTrue(alert.getText().equals("Do you really want to delete the selected item(s)?"));
+ alert.accept();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/TaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/TaskITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/TaskITCase.java
new file mode 100644
index 0000000..5acf45f
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/TaskITCase.java
@@ -0,0 +1,123 @@
+/*
+ * 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.fit.console.reference;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+public class TaskITCase extends AbstractITCase {
+
+ @Test
+ public void execute() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Tasks\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[1]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//tr[4]/td[10]/div/span[6]/a/img")));
+
+ seleniumDriver.findElement(By.xpath("//tr[4]/td[10]/div/span[6]/a/img")).click();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(
+ By.tagName("body")).getText().contains("Operation executed successfully"));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//tr[4]/td[10]/div/span[13]/a/img")));
+
+ seleniumDriver.findElement(By.xpath("//tr[4]/td[10]/div/span[13]/a/img")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[2]/ul/li[2]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[2]/ul/li[2]/a"));
+
+ assertTrue(seleniumDriver.findElements(
+ By.xpath("//div[2]/form/div[2]/div[2]/span/table/tbody/tr/td[4]")).size() > 0);
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void delete() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Tasks\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a")).click();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("(//img[@alt='delete icon'])[6]")));
+
+ seleniumDriver.findElement(By.xpath("(//img[@alt='delete icon'])[6]")).click();
+ seleniumDriver.switchTo().alert().accept();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(
+ By.tagName("body")).getText().contains("Operation executed successfully"));
+ }
+
+ @Test
+ public void issueSYNCOPE148() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Tasks\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//a[contains(text(),'Create')]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[2]/div/div/span/div/div[2]/div/label")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/input[2]")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ assertTrue(seleniumDriver.findElement(By.tagName("body")).getText().contains("Key"));
+ }
+
+ @Test
+ public void issueSYNCOPE473() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Tasks\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[5]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[5]/span/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ assertFalse(seleniumDriver.findElements(By.xpath("//div[@id='userFilter']")).isEmpty());
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/UserITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/UserITCase.java
new file mode 100644
index 0000000..af765a5
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/UserITCase.java
@@ -0,0 +1,184 @@
+/*
+ * 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.fit.console.reference;
+
+import static junit.framework.TestCase.assertTrue;
+import org.junit.Test;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+
+public class UserITCase extends AbstractITCase {
+
+ @Test
+ @SuppressWarnings("SleepWhileHoldingLock")
+ public void browseCreateModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs-1']/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//span[contains(text(),'Plain attributes')]")));
+
+ seleniumDriver.findElement(By.xpath("//div/form/div[3]/div[1]/span[2]/div/div[2]/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[5]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[6]/a/span")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ @SuppressWarnings("SleepWhileHoldingLock")
+ public void browseEditModal() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ //Edit vivaldi
+ seleniumDriver.findElement(By.xpath("//*[@id=\"users-contain\"]//*[div=3]/../td[5]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@value='Antonio Vivaldi']")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@value='Vivaldi']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[5]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[6]/a/span")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void search() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//span[contains(text(),'Search')]")).click();
+ Select select = new Select(seleniumDriver.findElement(By.xpath("//td[2]/select")));
+ select.selectByVisibleText("MEMBERSHIP");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//td[3]/select[option='3 citizen']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath("//td[3]/select")));
+ select.selectByVisibleText("3 citizen");
+ seleniumDriver.findElement(By.xpath("//form/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='users-contain']//*[div=2]")));
+ }
+
+ @Test
+ public void delete() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//*[@id=\"users-contain\"]//*[div=4]/../td[5]/div/span[15]/a")).click();
+
+ Alert alert = seleniumDriver.switchTo().alert();
+ assertTrue(alert.getText().equals("Do you really want to delete the selected item(s)?"));
+ alert.accept();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='propagation']/span")));
+
+ seleniumDriver.findElement(By.xpath("//*[@id=\"users-contain\"]/a")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(seleniumDriver.findElement(By.tagName("body")).getText().contains("Operation executed successfully"));
+ }
+
+ @Test
+ public void browseProvisioningFeatures() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ //Edit vivaldi
+ seleniumDriver.findElement(By.xpath("//*[@id=\"users-contain\"]//*[div=3]/../td[5]/div/span[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//td[div='ws-target-resource-1']")));
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//td[div='resource-testdb']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@class='navigator']/div/span[4]/a")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//td[div='resource-ldap']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@class='navigator']/div/span/a")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//td[div='ws-target-resource-1']")));
+
+ seleniumDriver.switchTo().defaultContent();
+
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+
+ @Test
+ public void issueSYNCOPE495() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//*[@id=\"users-contain\"]//*[div=3]/../td[5]/div/span[13]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@value='Antonio Vivaldi']")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@value='Vivaldi']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[5]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[6]/a/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//span[2]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@class='infolabel']")));
+ seleniumDriver.switchTo().defaultContent();
+ seleniumDriver.findElement(By.xpath("//a[@class='w_close']")).click();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/pom.xml b/syncope620/fit/pom.xml
index 99cec38..ef8ae42 100644
--- a/syncope620/fit/pom.xml
+++ b/syncope620/fit/pom.xml
@@ -36,6 +36,7 @@ under the License.
<modules>
<module>build-tools</module>
<module>server-reference</module>
+ <module>console-reference</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/pom.xml b/syncope620/fit/server-reference/pom.xml
index 0fa46dd..1fc5afd 100644
--- a/syncope620/fit/server-reference/pom.xml
+++ b/syncope620/fit/server-reference/pom.xml
@@ -71,26 +71,6 @@ under the License.
</dependency>
<dependency>
- <groupId>org.apache.syncope.fit</groupId>
- <artifactId>syncope-fit-build-tools</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.tirasa.connid.bundles.soap</groupId>
- <artifactId>wssample</artifactId>
- <version>${connid.soap.version}</version>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
@@ -135,6 +115,25 @@ under the License.
<!-- TEST -->
<dependency>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-build-tools</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.tirasa.connid.bundles.soap</groupId>
+ <artifactId>wssample</artifactId>
+ <version>${connid.soap.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.syncope.ext.camel</groupId>
<artifactId>syncope-ext-camel-rest-cxf</artifactId>
<version>${project.version}</version>
@@ -435,27 +434,6 @@ under the License.
</profile>
<profile>
- <id>light</id>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <excludes>
- <exclude>workflow.properties</exclude>
- <exclude>provisioning.properties</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src/main/resources/light</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </build>
- </profile>
-
- <profile>
<id>all</id>
<activation>
<activeByDefault>true</activeByDefault>
@@ -520,6 +498,21 @@ under the License.
</configuration>
</plugin>
</plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <excludes>
+ <exclude>workflow.properties</exclude>
+ <exclude>provisioning.properties</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/main/resources/all</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
</build>
</profile>
</profiles>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/main/resources/all/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/all/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/all/provisioning.properties
new file mode 100644
index 0000000..b0c8917
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/all/provisioning.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+camel.directory=${conf.directory}
+userProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelUserProvisioningManager
+roleProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/main/resources/all/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/all/workflow.properties b/syncope620/fit/server-reference/src/main/resources/all/workflow.properties
new file mode 100644
index 0000000..0cad37e
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/all/workflow.properties
@@ -0,0 +1,20 @@
+# 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.
+wf.directory=${conf.directory}
+jobExecutorActivate=true
+uwfAdapter=org.apache.syncope.server.workflow.activiti.ActivitiUserWorkflowAdapter
+rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
deleted file mode 100644
index 2ed4d0d..0000000
--- a/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
+++ /dev/null
@@ -1,18 +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.
-userProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultUserProvisioningManager
-roleProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/light/workflow.properties b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
deleted file mode 100644
index 2c08d50..0000000
--- a/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
+++ /dev/null
@@ -1,20 +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.
-wf.directory=${conf.directory}
-jobExecutorActivate=false
-uwfAdapter=org.apache.syncope.server.workflow.java.DefaultUserWorkflowAdapter
-rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/main/resources/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
index b0c8917..2ed4d0d 100644
--- a/syncope620/fit/server-reference/src/main/resources/provisioning.properties
+++ b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
@@ -14,6 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-camel.directory=${conf.directory}
-userProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelUserProvisioningManager
-roleProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelRoleProvisioningManager
+userProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultUserProvisioningManager
+roleProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/workflow.properties b/syncope620/fit/server-reference/src/main/resources/workflow.properties
index 0cad37e..2c08d50 100644
--- a/syncope620/fit/server-reference/src/main/resources/workflow.properties
+++ b/syncope620/fit/server-reference/src/main/resources/workflow.properties
@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
wf.directory=${conf.directory}
-jobExecutorActivate=true
-uwfAdapter=org.apache.syncope.server.workflow.activiti.ActivitiUserWorkflowAdapter
+jobExecutorActivate=false
+uwfAdapter=org.apache.syncope.server.workflow.java.DefaultUserWorkflowAdapter
rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
index bf35a9c..0945c90 100644
--- a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
@@ -166,8 +166,8 @@ public class ConfigurationITCase extends AbstractITCase {
RoleTO roleTO = new RoleTO();
roleTO.setName("aRole" + getUUIDString());
- roleTO.getMAttrTemplates().add(membershipKey.getKey());
- roleTO.getRAttrTemplates().add(roleKey.getKey());
+ roleTO.getMPlainAttrTemplates().add(membershipKey.getKey());
+ roleTO.getRPlainAttrTemplates().add(roleKey.getKey());
roleTO = createRole(roleTO);
try {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
index f845997..8e38963 100644
--- a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
@@ -258,7 +258,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
roleTO.setName("all" + getUUIDString());
roleTO.setParent(8L);
- roleTO.getRAttrTemplates().add(newPlainSchemaTO.getKey());
+ roleTO.getRPlainAttrTemplates().add(newPlainSchemaTO.getKey());
roleTO.getPlainAttrs().add(attrTO(newPlainSchemaTO.getKey(), "all"));
roleTO = createRole(roleTO);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
index 18646f5..e3ff2e6 100644
--- a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
@@ -90,7 +90,7 @@ public class RoleITCase extends AbstractITCase {
// inherited so setter execution should be ignored
roleTO.setPasswordPolicy(2L);
- roleTO.getRAttrTemplates().add("icon");
+ roleTO.getRPlainAttrTemplates().add("icon");
roleTO.getPlainAttrs().add(attrTO("icon", "anIcon"));
roleTO.getResources().add(RESOURCE_NAME_LDAP);
@@ -243,7 +243,7 @@ public class RoleITCase extends AbstractITCase {
@Test
public void update() {
RoleTO roleTO = buildRoleTO("latestRole" + getUUIDString());
- roleTO.getRAttrTemplates().add("show");
+ roleTO.getRPlainAttrTemplates().add("show");
roleTO = createRole(roleTO);
assertEquals(1, roleTO.getPlainAttrs().size());
@@ -749,7 +749,7 @@ public class RoleITCase extends AbstractITCase {
// 1. create ancestor role
RoleTO ancestor = buildBasicRoleTO(ancestorName);
ancestor.setParent(0L);
- ancestor.getRAttrTemplates().add("icon");
+ ancestor.getRPlainAttrTemplates().add("icon");
ancestor.getPlainAttrs().add(attrTO("icon", "ancestorIcon"));
ancestor = createRole(ancestor);
assertEquals("ancestorIcon", ancestor.getPlainAttrMap().get("icon").getValues().get(0));
@@ -757,7 +757,7 @@ public class RoleITCase extends AbstractITCase {
// 2. create parent role
RoleTO parent = buildBasicRoleTO(parentName);
parent.setParent(ancestor.getKey());
- parent.getRAttrTemplates().add("icon");
+ parent.getRPlainAttrTemplates().add("icon");
parent.getPlainAttrs().add(attrTO("icon", "parentIcon"));
parent = createRole(parent);
assertEquals("parentIcon", parent.getPlainAttrMap().get("icon").getValues().get(0));
@@ -765,7 +765,7 @@ public class RoleITCase extends AbstractITCase {
// 3. create child role
RoleTO child = buildBasicRoleTO(childName);
child.setParent(parent.getKey());
- child.getRAttrTemplates().add("icon");
+ child.getRPlainAttrTemplates().add("icon");
child.getPlainAttrs().add(attrTO("icon", "childIcon"));
child = createRole(child);
assertEquals("childIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
@@ -829,9 +829,9 @@ public class RoleITCase extends AbstractITCase {
// 2. create a role and give the resource created above
roleTO = buildRoleTO("lastRole");
- roleTO.getRAttrTemplates().add("icon");
+ roleTO.getRPlainAttrTemplates().add("icon");
roleTO.getPlainAttrs().add(attrTO("icon", "anIcon"));
- roleTO.getRAttrTemplates().add("show");
+ roleTO.getRPlainAttrTemplates().add("show");
roleTO.getPlainAttrs().add(attrTO("show", "true"));
roleTO.getRDerAttrTemplates().add("displayProperty");
roleTO.getDerAttrs().add(attrTO("displayProperty", null));
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/pom.xml b/syncope620/pom.xml
index 27f1fe9..e2a7cb8 100644
--- a/syncope620/pom.xml
+++ b/syncope620/pom.xml
@@ -354,7 +354,9 @@ under the License.
<commons.logging.version>1.1.3</commons.logging.version>
<h2.version>1.4.185</h2.version>
+
<junit.version>4.12</junit.version>
+ <selenium.version>2.44.0</selenium.version>
<conf.directory>${project.build.directory}/test-classes</conf.directory>
<bundles.directory>${project.build.directory}/bundles</bundles.directory>
@@ -924,6 +926,20 @@ under the License.
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
+
+ <!-- SELENIUM INTEGRATION TEST -->
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-api</artifactId>
+ <version>${selenium.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-java</artifactId>
+ <version>${selenium.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -1052,6 +1068,18 @@ under the License.
</plugin>
<plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>replacer</artifactId>
+ <version>1.5.3</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <version>1.1.5</version>
+ </plugin>
+
+ <plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.12</version>
@@ -1123,8 +1151,72 @@ under the License.
</plugins>
</pluginManagement>
- <plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.5</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>1.5.8</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ project.properties['licenseUrl'] = project.parent.licenses[0].url
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>nbactions.xml</exclude>
+ <exclude>nb-configuration.xml</exclude>
+ <exclude>**/META-INF/cxf/**</exclude>
+ <exclude>**/META-INF/services/**</exclude>
+ <exclude>**/META-INF/MANIFEST.MF</exclude>
+ <exclude>**/*.csv</exclude>
+ <exclude>**/archetype-resources/**</exclude>
+ <exclude>**/goal.txt</exclude>
+ <exclude>**/rat.txt</exclude>
+ <exclude>**/build-copy-javadoc-files.xml</exclude>
+ <exclude>**/maven-eclipse.xml</exclude>
+ <exclude>**/*.iml</exclude>
+ <exclude>**/*.log</exclude>
+ <exclude>.externalToolBuilders/**</exclude>
+ <exclude>.git/**</exclude>
+ <exclude>.idea/**</exclude>
+ <exclude>**/.*</exclude>
+ <exclude>**/deb/control/conffiles</exclude>
+ <exclude>**/deb/control/control</exclude>
+ <exclude>**/*.lst</exclude>
+ <exclude>**/syncope620/**</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
+
</build>
<profiles>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/server/misc/src/main/java/org/apache/syncope/server/misc/ConnObjectUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/server/misc/src/main/java/org/apache/syncope/server/misc/ConnObjectUtil.java b/syncope620/server/misc/src/main/java/org/apache/syncope/server/misc/ConnObjectUtil.java
index 592cd0c..0a4dadf 100644
--- a/syncope620/server/misc/src/main/java/org/apache/syncope/server/misc/ConnObjectUtil.java
+++ b/syncope620/server/misc/src/main/java/org/apache/syncope/server/misc/ConnObjectUtil.java
@@ -434,10 +434,10 @@ public class ConnObjectUtil {
((RoleTO) subjectTO).getEntitlements().addAll(((RoleTO) template).getEntitlements());
- ((RoleTO) subjectTO).getRAttrTemplates().addAll(((RoleTO) template).getRAttrTemplates());
+ ((RoleTO) subjectTO).getRPlainAttrTemplates().addAll(((RoleTO) template).getRPlainAttrTemplates());
((RoleTO) subjectTO).getRDerAttrTemplates().addAll(((RoleTO) template).getRDerAttrTemplates());
((RoleTO) subjectTO).getRVirAttrTemplates().addAll(((RoleTO) template).getRVirAttrTemplates());
- ((RoleTO) subjectTO).getMAttrTemplates().addAll(((RoleTO) template).getMAttrTemplates());
+ ((RoleTO) subjectTO).getMPlainAttrTemplates().addAll(((RoleTO) template).getMPlainAttrTemplates());
((RoleTO) subjectTO).getMDerAttrTemplates().addAll(((RoleTO) template).getMDerAttrTemplates());
((RoleTO) subjectTO).getMVirAttrTemplates().addAll(((RoleTO) template).getMVirAttrTemplates());
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPASubjectSearchDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPASubjectSearchDAO.java b/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPASubjectSearchDAO.java
index f8e1804..19bffd0 100644
--- a/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPASubjectSearchDAO.java
+++ b/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/dao/JPASubjectSearchDAO.java
@@ -283,38 +283,41 @@ public class JPASubjectSearchDAO extends AbstractDAO<Subject<?, ?, ?>, Long> imp
for (OrderByClause clause : orderByClauses) {
OrderBySupport.Item obs = new OrderBySupport.Item();
- Field subjectField = ReflectionUtils.findField(attrUtil.attributableClass(), clause.getField());
+ // Manage difference among external key attribute and internal JPA @Id
+ String fieldName = "key".equals(clause.getField()) ? "id" : clause.getField();
+
+ Field subjectField = ReflectionUtils.findField(attrUtil.attributableClass(), fieldName);
if (subjectField == null) {
- PlainSchema schema = schemaDAO.find(clause.getField(), attrUtil.plainSchemaClass());
+ PlainSchema schema = schemaDAO.find(fieldName, attrUtil.plainSchemaClass());
if (schema != null) {
if (schema.isUniqueConstraint()) {
orderBySupport.views.add(svs.uniqueAttr());
obs.select = new StringBuilder().
append(svs.uniqueAttr().alias).append('.').append(svs.fieldName(schema.getType())).
- append(" AS ").append(clause.getField()).toString();
+ append(" AS ").append(fieldName).toString();
obs.where = new StringBuilder().
append(svs.uniqueAttr().alias).
- append(".schema_name='").append(clause.getField()).append("'").toString();
- obs.orderBy = clause.getField() + " " + clause.getDirection().name();
+ append(".schema_name='").append(fieldName).append("'").toString();
+ obs.orderBy = fieldName + " " + clause.getDirection().name();
} else {
orderBySupport.views.add(svs.attr());
obs.select = new StringBuilder().
append(svs.attr().alias).append('.').append(svs.fieldName(schema.getType())).
- append(" AS ").append(clause.getField()).toString();
+ append(" AS ").append(fieldName).toString();
obs.where = new StringBuilder().
append(svs.attr().alias).
- append(".schema_name='").append(clause.getField()).append("'").toString();
- obs.orderBy = clause.getField() + " " + clause.getDirection().name();
+ append(".schema_name='").append(fieldName).append("'").toString();
+ obs.orderBy = fieldName + " " + clause.getDirection().name();
}
}
} else {
orderBySupport.views.add(svs.field());
- obs.select = svs.field().alias + "." + clause.getField();
+ obs.select = svs.field().alias + "." + fieldName;
obs.where = StringUtils.EMPTY;
- obs.orderBy = svs.field().alias + "." + clause.getField() + " " + clause.getDirection().name();
+ obs.orderBy = svs.field().alias + "." + fieldName + " " + clause.getDirection().name();
}
if (obs.isEmpty()) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/entity/AnnotatedEntityListener.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/entity/AnnotatedEntityListener.java b/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/entity/AnnotatedEntityListener.java
index 436aab7..3a9fe76 100644
--- a/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/entity/AnnotatedEntityListener.java
+++ b/syncope620/server/persistence-jpa/src/main/java/org/apache/syncope/server/persistence/jpa/entity/AnnotatedEntityListener.java
@@ -35,7 +35,7 @@ public class AnnotatedEntityListener {
@PrePersist
@PreUpdate
- public void setSysInfo(final AnnotatedEntity entity) {
+ public void setSysInfo(final AnnotatedEntity<?> entity) {
final String username = AuthContextUtil.getAuthenticatedUsername();
LOG.debug("Set system properties for '{}'", entity);
[32/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
new file mode 100644
index 0000000..c3b0455
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
@@ -0,0 +1,306 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Arrays;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.ResourceModalPage.ResourceEvent;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.PropagationMode;
+import org.apache.syncope.common.lib.types.TraceLevel;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResourceDetailsPanel extends Panel {
+
+ private static final long serialVersionUID = -7982691107029848579L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(ResourceDetailsPanel.class);
+
+ @SpringBean
+ private ConnectorRestClient connRestClient;
+
+ private ConnInstanceTO connInstanceTO;
+
+ public ResourceDetailsPanel(final String id, final ResourceTO resourceTO, final List<String> actionClassNames,
+ final boolean createFlag) {
+
+ super(id);
+ setOutputMarkupId(true);
+
+ final AjaxTextFieldPanel resourceName = new AjaxTextFieldPanel("name", new ResourceModel("name", "name").
+ getObject(), new PropertyModel<String>(resourceTO, "name"));
+
+ resourceName.setEnabled(createFlag);
+ resourceName.addRequiredLabel();
+ add(resourceName);
+
+ final AjaxCheckBoxPanel enforceMandatoryCondition = new AjaxCheckBoxPanel("enforceMandatoryCondition",
+ new ResourceModel("enforceMandatoryCondition", "enforceMandatoryCondition").getObject(),
+ new PropertyModel<Boolean>(resourceTO, "enforceMandatoryCondition"));
+ add(enforceMandatoryCondition);
+
+ final AjaxCheckBoxPanel propagationPrimary = new AjaxCheckBoxPanel("propagationPrimary", new ResourceModel(
+ "propagationPrimary", "propagationPrimary").getObject(), new PropertyModel<Boolean>(resourceTO,
+ "propagationPrimary"));
+ add(propagationPrimary);
+
+ final SpinnerFieldPanel<Integer> propagationPriority =
+ new SpinnerFieldPanel<Integer>("propagationPriority", "propagationPriority", Integer.class,
+ new PropertyModel<Integer>(resourceTO, "propagationPriority"), null, null);
+ add(propagationPriority);
+
+ final AjaxDropDownChoicePanel<PropagationMode> propagationMode = new AjaxDropDownChoicePanel<PropagationMode>(
+ "propagationMode", new ResourceModel("propagationMode", "propagationMode").getObject(),
+ new PropertyModel<PropagationMode>(resourceTO, "propagationMode"));
+ propagationMode.setChoices(Arrays.asList(PropagationMode.values()));
+ add(propagationMode);
+
+ final AjaxCheckBoxPanel randomPwdIfNotProvided = new AjaxCheckBoxPanel("randomPwdIfNotProvided",
+ new ResourceModel("randomPwdIfNotProvided", "randomPwdIfNotProvided").getObject(),
+ new PropertyModel<Boolean>(resourceTO, "randomPwdIfNotProvided"));
+ add(randomPwdIfNotProvided);
+
+ final WebMarkupContainer propagationActionsClassNames = new WebMarkupContainer("propagationActionsClassNames");
+ propagationActionsClassNames.setOutputMarkupId(true);
+ add(propagationActionsClassNames);
+
+ final AjaxLink<Void> first = new IndicatingAjaxLink<Void>("first") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ resourceTO.getPropagationActionsClassNames().add(StringUtils.EMPTY);
+ setVisible(false);
+ target.add(propagationActionsClassNames);
+ }
+ };
+ first.setOutputMarkupPlaceholderTag(true);
+ first.setVisible(resourceTO.getPropagationActionsClassNames().isEmpty());
+ propagationActionsClassNames.add(first);
+
+ final ListView<String> actionsClasses = new ListView<String>("actionsClasses",
+ new PropertyModel<List<String>>(resourceTO, "propagationActionsClassNames")) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ final String className = item.getModelObject();
+
+ final DropDownChoice<String> actionsClass = new DropDownChoice<String>(
+ "actionsClass", new Model<String>(className), actionClassNames);
+ actionsClass.setNullValid(true);
+ actionsClass.setRequired(true);
+ actionsClass.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ resourceTO.getPropagationActionsClassNames().
+ set(item.getIndex(), actionsClass.getModelObject());
+ }
+ });
+ actionsClass.setRequired(true);
+ actionsClass.setOutputMarkupId(true);
+ actionsClass.setRequired(true);
+ item.add(actionsClass);
+
+ AjaxLink<Void> minus = new IndicatingAjaxLink<Void>("drop") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ resourceTO.getPropagationActionsClassNames().remove(className);
+ first.setVisible(resourceTO.getPropagationActionsClassNames().isEmpty());
+ target.add(propagationActionsClassNames);
+ }
+ };
+ item.add(minus);
+
+ final AjaxLink<Void> plus = new IndicatingAjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ resourceTO.getPropagationActionsClassNames().add(StringUtils.EMPTY);
+ target.add(propagationActionsClassNames);
+ }
+ };
+ plus.setOutputMarkupPlaceholderTag(true);
+ plus.setVisible(item.getIndex() == resourceTO.getPropagationActionsClassNames().size() - 1);
+ item.add(plus);
+ }
+ };
+ propagationActionsClassNames.add(actionsClasses);
+
+ final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ "createTraceLevel", new ResourceModel("createTraceLevel", "createTraceLevel").getObject(),
+ new PropertyModel<TraceLevel>(resourceTO, "createTraceLevel"));
+ createTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
+ add(createTraceLevel);
+
+ final AjaxDropDownChoicePanel<TraceLevel> updateTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ "updateTraceLevel", new ResourceModel("updateTraceLevel", "updateTraceLevel").getObject(),
+ new PropertyModel<TraceLevel>(resourceTO, "updateTraceLevel"));
+ updateTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
+ add(updateTraceLevel);
+
+ final AjaxDropDownChoicePanel<TraceLevel> deleteTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ "deleteTraceLevel", new ResourceModel("deleteTraceLevel", "deleteTraceLevel").getObject(),
+ new PropertyModel<TraceLevel>(resourceTO, "deleteTraceLevel"));
+ deleteTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
+ add(deleteTraceLevel);
+
+ final AjaxDropDownChoicePanel<TraceLevel> syncTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ "syncTraceLevel", new ResourceModel("syncTraceLevel", "syncTraceLevel").getObject(),
+ new PropertyModel<TraceLevel>(resourceTO, "syncTraceLevel"));
+ syncTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
+ add(syncTraceLevel);
+
+ final IModel<List<ConnInstanceTO>> connectors = new LoadableDetachableModel<List<ConnInstanceTO>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<ConnInstanceTO> load() {
+ return connRestClient.getAllConnectors();
+ }
+ };
+
+ connInstanceTO = getConectorInstanceTO(connectors.getObject(), resourceTO);
+
+ final AjaxDropDownChoicePanel<ConnInstanceTO> conn = new AjaxDropDownChoicePanel<ConnInstanceTO>("connector",
+ new ResourceModel("connector", "connector").getObject(),
+ new PropertyModel<ConnInstanceTO>(this, "connInstanceTO"));
+ conn.setChoices(connectors.getObject());
+ conn.setChoiceRenderer(new ChoiceRenderer("displayName", "id"));
+
+ conn.getField().setModel(new IModel<ConnInstanceTO>() {
+
+ private static final long serialVersionUID = -4202872830392400310L;
+
+ @Override
+ public ConnInstanceTO getObject() {
+ return connInstanceTO;
+ }
+
+ @Override
+ public void setObject(final ConnInstanceTO connector) {
+ resourceTO.setConnectorId(connector.getKey());
+ connInstanceTO = connector;
+ }
+
+ @Override
+ public void detach() {
+ }
+ });
+
+ conn.addRequiredLabel();
+ conn.setEnabled(createFlag);
+
+ conn.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(getPage(), Broadcast.BREADTH, new DetailsModEvent(target));
+ }
+ });
+
+ add(conn);
+ }
+
+ /**
+ * Get the connetorTO linked to the resource.
+ *
+ * @param connectorTOs list of all connectors.
+ * @param resourceTO resource.
+ * @return selected connector instance: in case of no connectors available, null; in case of new resource
+ * specification, the first on connector available
+ */
+ private ConnInstanceTO getConectorInstanceTO(final List<ConnInstanceTO> connectorTOs, final ResourceTO resourceTO) {
+ if (connectorTOs.isEmpty()) {
+ resourceTO.setConnectorId(null);
+ return null;
+ } else {
+ // use the first element as default
+ ConnInstanceTO res = connectorTOs.get(0);
+
+ for (ConnInstanceTO to : connectorTOs) {
+ if (Long.valueOf(to.getKey()).equals(resourceTO.getConnectorId())) {
+ res = to;
+ }
+ }
+
+ // in case of no match
+ resourceTO.setConnectorId(res.getKey());
+
+ return res;
+ }
+ }
+
+ /**
+ * Connector instance modification event.
+ */
+ public static class DetailsModEvent extends ResourceEvent {
+
+ /**
+ * Constructor.
+ *
+ * @param target request target.
+ */
+ public DetailsModEvent(final AjaxRequestTarget target) {
+ super(target);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
new file mode 100644
index 0000000..0e8d34b
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
@@ -0,0 +1,644 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.JexlHelpUtil;
+import org.apache.syncope.client.console.panels.ResourceConnConfPanel.ConnConfModEvent;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDecoratedCheckbox;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+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.MappingPurposePanel;
+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.MappingTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Resource mapping panel.
+ */
+public class ResourceMappingPanel extends Panel {
+
+ private static final long serialVersionUID = -7982691107029848579L;
+
+ /**
+ * Mapping field style sheet.
+ */
+ private static final String FIELD_STYLE = "ui-widget-content ui-corner-all short_fixedsize";
+
+ /**
+ * Mapping field style sheet.
+ */
+ private static final String DEF_FIELD_STYLE = "ui-widget-content ui-corner-all";
+
+ /**
+ * Mapping field style sheet.
+ */
+ private static final String SHORT_FIELD_STYLE = "ui-widget-content ui-corner-all veryshort_fixedsize";
+
+ /**
+ * Schema rest client.
+ */
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ /**
+ * ConnInstance rest client.
+ */
+ @SpringBean
+ private ConnectorRestClient connRestClient;
+
+ /**
+ * Resource schema name.
+ */
+ private final List<String> schemaNames;
+
+ /**
+ * Add mapping button.
+ */
+ private final AjaxButton addMappingBtn;
+
+ /**
+ * All mappings.
+ */
+ private final ListView<MappingItemTO> mappings;
+
+ /**
+ * External resource to be updated.
+ */
+ private final ResourceTO resourceTO;
+
+ /**
+ * User / role.
+ */
+ private final AttributableType attrType;
+
+ /**
+ * Mapping container.
+ */
+ private final WebMarkupContainer mappingContainer;
+
+ /**
+ * AccountLink container.
+ */
+ private final WebMarkupContainer accountLinkContainer;
+
+ private final AjaxCheckBoxPanel accountLinkCheckbox;
+
+ private MappingTO getMapping() {
+ MappingTO result = null;
+
+ if (AttributableType.USER == this.attrType) {
+ if (this.resourceTO.getUmapping() == null) {
+ this.resourceTO.setUmapping(new MappingTO());
+ }
+ result = this.resourceTO.getUmapping();
+ }
+ if (AttributableType.ROLE == this.attrType) {
+ if (this.resourceTO.getRmapping() == null) {
+ this.resourceTO.setRmapping(new MappingTO());
+ }
+ result = this.resourceTO.getRmapping();
+ }
+
+ return result;
+ }
+
+ /**
+ * Attribute Mapping Panel.
+ *
+ * @param id panel id
+ * @param resourceTO external resource
+ * @param attrType USER / ROLE
+ */
+ public ResourceMappingPanel(final String id, final ResourceTO resourceTO, final AttributableType attrType) {
+ super(id);
+ setOutputMarkupId(true);
+
+ this.resourceTO = resourceTO;
+ this.attrType = attrType;
+
+ this.mappingContainer = new WebMarkupContainer("mappingContainer");
+ this.mappingContainer.setOutputMarkupId(true);
+ add(this.mappingContainer);
+
+ this.accountLinkContainer = new WebMarkupContainer("accountLinkContainer");
+ this.accountLinkContainer.setOutputMarkupId(true);
+ add(this.accountLinkContainer);
+
+ if (this.resourceTO.getConnectorId() != null && this.resourceTO.getConnectorId() > 0) {
+ schemaNames = getSchemaNames(this.resourceTO.getConnectorId(), this.resourceTO.getConnConfProperties());
+
+ setEnabled();
+ } else {
+ schemaNames = Collections.<String>emptyList();
+ }
+
+ final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
+
+ AjaxLink<Void> questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
+ mappingContainer.add(questionMarkJexlHelp);
+ questionMarkJexlHelp.add(jexlHelp);
+
+ final Label passwordLabel = new Label("passwordLabel", new ResourceModel("password"));
+ mappingContainer.add(passwordLabel);
+ if (AttributableType.USER != ResourceMappingPanel.this.attrType) {
+ passwordLabel.setVisible(false);
+ }
+
+ Collections.sort(getMapping().getItems(), new Comparator<MappingItemTO>() {
+
+ @Override
+ public int compare(final MappingItemTO left, final MappingItemTO right) {
+ int compared;
+ if (left == null && right == null) {
+ compared = 0;
+ } else if (left == null) {
+ compared = 1;
+ } else if (right == null) {
+ compared = -1;
+ } else if (left.getPurpose() == MappingPurpose.BOTH && right.getPurpose() != MappingPurpose.BOTH) {
+ compared = -1;
+ } else if (left.getPurpose() != MappingPurpose.BOTH && right.getPurpose() == MappingPurpose.BOTH) {
+ compared = 1;
+ } else if (left.getPurpose() == MappingPurpose.PROPAGATION
+ && (right.getPurpose() == MappingPurpose.SYNCHRONIZATION || right.getPurpose()
+ == MappingPurpose.NONE)) {
+ compared = -1;
+ } else if (left.getPurpose() == MappingPurpose.SYNCHRONIZATION
+ && right.getPurpose() == MappingPurpose.PROPAGATION) {
+ compared = 1;
+ } else if (left.getPurpose() == MappingPurpose.SYNCHRONIZATION
+ && right.getPurpose() == MappingPurpose.NONE) {
+ compared = -1;
+ } else if (left.getPurpose() == MappingPurpose.NONE
+ && right.getPurpose() != MappingPurpose.NONE) {
+ compared = 1;
+ } else if (left.isAccountid()) {
+ compared = -1;
+ } else if (right.isAccountid()) {
+ compared = 1;
+ } else if (left.isPassword()) {
+ compared = -1;
+ } else if (right.isPassword()) {
+ compared = 1;
+ } else {
+ compared = left.getIntAttrName().compareTo(right.getIntAttrName());
+ }
+ return compared;
+ }
+ });
+
+ mappings = new ListView<MappingItemTO>("mappings", getMapping().getItems()) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<MappingItemTO> item) {
+ final MappingItemTO mapItem = item.getModelObject();
+ if (mapItem.getPurpose() == null) {
+ mapItem.setPurpose(MappingPurpose.BOTH);
+ }
+
+ AttributableType entity = null;
+ if (mapItem.getIntMappingType() != null) {
+ entity = mapItem.getIntMappingType().getAttributableType();
+ }
+
+ final List<IntMappingType> attrTypes = new ArrayList<IntMappingType>(getAttributeTypes(entity));
+
+ item.add(new AjaxDecoratedCheckbox("toRemove", new Model<Boolean>(Boolean.FALSE)) {
+
+ private static final long serialVersionUID = 7170946748485726506L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ int index = -1;
+ for (int i = 0; i < getMapping().getItems().size() && index == -1; i++) {
+ if (mapItem.equals(getMapping().getItems().get(i))) {
+ index = i;
+ }
+ }
+
+ if (index != -1) {
+ getMapping().getItems().remove(index);
+ item.getParent().removeAll();
+ target.add(ResourceMappingPanel.this);
+ }
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+
+ final AjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component component) {
+ return "if (!confirm('" + getString("confirmDelete") + "')) return false;";
+ }
+ };
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
+ }
+ });
+
+ final AjaxDropDownChoicePanel<String> intAttrNames =
+ new AjaxDropDownChoicePanel<String>("intAttrNames", getString("intAttrNames"),
+ new PropertyModel<String>(mapItem, "intAttrName"), false);
+ intAttrNames.setChoices(schemaNames);
+ intAttrNames.setRequired(true);
+ intAttrNames.setStyleSheet(FIELD_STYLE);
+ intAttrNames.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+ item.add(intAttrNames);
+
+ final AjaxDropDownChoicePanel<IntMappingType> intMappingTypes =
+ new AjaxDropDownChoicePanel<IntMappingType>("intMappingTypes",
+ new ResourceModel("intMappingTypes", "intMappingTypes").getObject(),
+ new PropertyModel<IntMappingType>(mapItem, "intMappingType"));
+ intMappingTypes.setRequired(true);
+ intMappingTypes.setChoices(attrTypes);
+ intMappingTypes.setStyleSheet(FIELD_STYLE);
+ item.add(intMappingTypes);
+
+ final AjaxDropDownChoicePanel<AttributableType> entitiesPanel =
+ new AjaxDropDownChoicePanel<AttributableType>("entities",
+ new ResourceModel("entities", "entities").getObject(), new Model<AttributableType>(
+ entity));
+ entitiesPanel.setChoices(attrType == AttributableType.ROLE
+ ? Collections.<AttributableType>singletonList(AttributableType.ROLE)
+ : Arrays.asList(AttributableType.values()));
+ entitiesPanel.setStyleSheet(DEF_FIELD_STYLE);
+ entitiesPanel.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ attrTypes.clear();
+ attrTypes.addAll(getAttributeTypes(entitiesPanel.getModelObject()));
+ intMappingTypes.setChoices(attrTypes);
+
+ intAttrNames.setChoices(Collections.<String>emptyList());
+
+ target.add(intMappingTypes.getField());
+ target.add(intAttrNames.getField());
+ }
+ });
+ item.add(entitiesPanel);
+
+ final FieldPanel<String> extAttrNames = new AjaxTextFieldPanel("extAttrName",
+ new ResourceModel("extAttrNames", "extAttrNames").getObject(),
+ new PropertyModel<String>(mapItem, "extAttrName"));
+ ((AjaxTextFieldPanel) extAttrNames).setChoices(schemaNames);
+
+ boolean required = false;
+ if (mapItem.isPassword()) {
+ ((AjaxTextFieldPanel) extAttrNames).setModelObject(null);
+ } else {
+ required = true;
+ }
+ extAttrNames.setRequired(required);
+ extAttrNames.setEnabled(required);
+ extAttrNames.setStyleSheet(FIELD_STYLE);
+ item.add(extAttrNames);
+
+ final AjaxTextFieldPanel mandatory = new AjaxTextFieldPanel("mandatoryCondition",
+ new ResourceModel("mandatoryCondition", "mandatoryCondition").getObject(),
+ new PropertyModel<String>(mapItem, "mandatoryCondition"));
+ mandatory.setChoices(Arrays.asList(new String[] { "true", "false" }));
+ mandatory.setStyleSheet(SHORT_FIELD_STYLE);
+ item.add(mandatory);
+
+ final AjaxCheckBoxPanel accountId = new AjaxCheckBoxPanel("accountId",
+ new ResourceModel("accountId", "accountId").getObject(),
+ new PropertyModel<Boolean>(mapItem, "accountid"));
+ accountId.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (accountId.getModelObject()) {
+ mapItem.setMandatoryCondition("true");
+ mandatory.setEnabled(false);
+ } else {
+ mapItem.setMandatoryCondition("false");
+ mandatory.setEnabled(true);
+ }
+ target.add(mandatory);
+ }
+ });
+ item.add(accountId);
+
+ final AjaxCheckBoxPanel password = new AjaxCheckBoxPanel("password",
+ new ResourceModel("password", "password").getObject(),
+ new PropertyModel<Boolean>(mapItem, "password"));
+ password.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ extAttrNames.setEnabled(!mapItem.isAccountid() && !password.getModelObject());
+ extAttrNames.setModelObject(null);
+ extAttrNames.setRequired(!password.getModelObject());
+ target.add(extAttrNames);
+
+ setAccountId(intMappingTypes.getModelObject(), accountId, password);
+ target.add(accountId);
+ }
+ });
+ item.add(password);
+ if (AttributableType.USER != ResourceMappingPanel.this.attrType) {
+ password.setVisible(false);
+ }
+
+ final WebMarkupContainer purpose = new WebMarkupContainer("purpose");
+ purpose.setOutputMarkupId(Boolean.TRUE);
+
+ final MappingPurposePanel panel = new MappingPurposePanel("purposeActions",
+ new PropertyModel<MappingPurpose>(mapItem, "purpose"), purpose);
+
+ purpose.add(panel);
+
+ item.add(purpose);
+
+ intMappingTypes.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ setAttrNames(intMappingTypes.getModelObject(), intAttrNames);
+ target.add(intAttrNames);
+
+ setAccountId(intMappingTypes.getModelObject(), accountId, password);
+ target.add(accountId);
+ }
+ });
+
+ setAttrNames(mapItem.getIntMappingType(), intAttrNames);
+ setAccountId(mapItem.getIntMappingType(), accountId, password);
+ }
+ };
+
+ mappings.setReuseItems(true);
+ mappingContainer.add(mappings);
+
+ addMappingBtn = new IndicatingAjaxButton("addMappingBtn", new ResourceModel("add")) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ getMapping().getItems().add(new MappingItemTO());
+ target.add(ResourceMappingPanel.this);
+ }
+ };
+ addMappingBtn.setDefaultFormProcessing(false);
+ addMappingBtn.setEnabled(this.resourceTO.getConnectorId() != null && this.resourceTO.getConnectorId() > 0);
+ mappingContainer.add(addMappingBtn);
+
+ boolean accountLinkEnabled = false;
+ if (getMapping().getAccountLink() != null) {
+ accountLinkEnabled = true;
+ }
+ accountLinkCheckbox = new AjaxCheckBoxPanel("accountLinkCheckbox",
+ new ResourceModel("accountLinkCheckbox", "accountLinkCheckbox").getObject(),
+ new Model<Boolean>(Boolean.valueOf(accountLinkEnabled)));
+ accountLinkCheckbox.setEnabled(true);
+
+ accountLinkContainer.add(accountLinkCheckbox);
+
+ final AjaxTextFieldPanel accountLink = new AjaxTextFieldPanel("accountLink",
+ new ResourceModel("accountLink", "accountLink").getObject(),
+ new PropertyModel<String>(getMapping(), "accountLink"));
+ accountLink.setEnabled(accountLinkEnabled);
+ accountLinkContainer.add(accountLink);
+
+ accountLinkCheckbox.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (accountLinkCheckbox.getModelObject()) {
+ accountLink.setEnabled(Boolean.TRUE);
+ accountLink.setModelObject("");
+ } else {
+ accountLink.setEnabled(Boolean.FALSE);
+ accountLink.setModelObject("");
+ }
+
+ target.add(accountLink);
+ }
+ });
+ }
+
+ private List<String> getSchemaNames(final Long connectorId, final Set<ConnConfProperty> conf) {
+ final ConnInstanceTO connInstanceTO = new ConnInstanceTO();
+ connInstanceTO.setKey(connectorId);
+ connInstanceTO.getConfiguration().addAll(conf);
+
+ return connRestClient.getSchemaNames(connInstanceTO);
+ }
+
+ private void setEnabled() {
+ final ConnInstanceTO connInstanceTO = new ConnInstanceTO();
+ connInstanceTO.setKey(this.resourceTO.getConnectorId());
+ connInstanceTO.getConfiguration().addAll(this.resourceTO.getConnConfProperties());
+
+ List<ConnIdObjectClassTO> objectClasses = connRestClient.getSupportedObjectClasses(connInstanceTO);
+
+ boolean enabled = objectClasses.isEmpty()
+ || (AttributableType.USER == attrType && objectClasses.contains(ConnIdObjectClassTO.ACCOUNT))
+ || (AttributableType.ROLE == attrType && objectClasses.contains(ConnIdObjectClassTO.GROUP));
+ this.mappingContainer.setEnabled(enabled);
+ this.mappingContainer.setVisible(enabled);
+ this.accountLinkContainer.setEnabled(enabled);
+ this.accountLinkContainer.setVisible(enabled);
+
+ if (!enabled) {
+ getMapping().getItems().clear();
+ getMapping().setAccountLink(null);
+ if (this.accountLinkCheckbox != null) {
+ this.accountLinkCheckbox.setModelObject(null);
+ }
+ }
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof ConnConfModEvent) {
+ final AjaxRequestTarget target = ((ConnConfModEvent) event.getPayload()).getTarget();
+
+ final List<ConnConfProperty> conf = ((ConnConfModEvent) event.getPayload()).getConfiguration();
+
+ mappings.removeAll();
+
+ addMappingBtn.setEnabled(resourceTO.getConnectorId() != null && resourceTO.getConnectorId() > 0);
+
+ schemaNames.clear();
+ schemaNames.addAll(getSchemaNames(resourceTO.getConnectorId(), new HashSet<ConnConfProperty>(conf)));
+
+ setEnabled();
+
+ target.add(this);
+ }
+ }
+
+ /**
+ * Set attribute names for a drop down choice list.
+ *
+ * @param type attribute type.
+ * @param toBeUpdated drop down choice to be updated.
+ */
+ private void setAttrNames(final IntMappingType type, final AjaxDropDownChoicePanel<String> toBeUpdated) {
+ toBeUpdated.setRequired(true);
+ toBeUpdated.setEnabled(true);
+
+ if (type == null || type.getAttributableType() == null) {
+ toBeUpdated.setChoices(Collections.<String>emptyList());
+ } else {
+ switch (type) {
+ // user attribute names
+ case UserPlainSchema:
+ case RolePlainSchema:
+ case MembershipPlainSchema:
+ toBeUpdated.setChoices(schemaRestClient.getSchemaNames(type.getAttributableType()));
+ break;
+
+ case UserDerivedSchema:
+ case RoleDerivedSchema:
+ case MembershipDerivedSchema:
+ toBeUpdated.setChoices(schemaRestClient.getDerSchemaNames(type.getAttributableType()));
+ break;
+
+ case UserVirtualSchema:
+ case RoleVirtualSchema:
+ case MembershipVirtualSchema:
+ toBeUpdated.setChoices(schemaRestClient.getVirSchemaNames(type.getAttributableType()));
+ break;
+
+ case UserId:
+ case Password:
+ case Username:
+ case RoleId:
+ case RoleName:
+ default:
+ toBeUpdated.setRequired(false);
+ toBeUpdated.setEnabled(false);
+ toBeUpdated.setChoices(Collections.<String>emptyList());
+ }
+ }
+ }
+
+ /**
+ * Enable/Disable accountId checkbox.
+ *
+ * @param type attribute type.
+ * @param accountId accountId checkbox.
+ * @param password password checkbox.
+ */
+ private void setAccountId(final IntMappingType type, final AjaxCheckBoxPanel accountId,
+ final AjaxCheckBoxPanel password) {
+
+ if (type != null && type.getAttributableType() != null) {
+ switch (type) {
+ case UserVirtualSchema:
+ case RoleVirtualSchema:
+ case MembershipVirtualSchema:
+ // Virtual accountId is not permitted
+ case Password:
+ // AccountId cannot be derived from password.
+ accountId.setReadOnly(true);
+ accountId.setModelObject(false);
+ break;
+
+ default:
+ if (password.getModelObject()) {
+ accountId.setReadOnly(true);
+ accountId.setModelObject(false);
+ } else {
+ accountId.setReadOnly(false);
+ }
+ }
+ }
+ }
+
+ /**
+ * Get all attribute types from a selected attribute type.
+ *
+ * @param entity entity.
+ * @return all attribute types.
+ */
+ private List<IntMappingType> getAttributeTypes(final AttributableType entity) {
+ final List<IntMappingType> res = new ArrayList<IntMappingType>();
+
+ if (entity != null) {
+ res.addAll(IntMappingType.getAttributeTypes(AttributableType.valueOf(entity.name())));
+ }
+
+ return res;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceSecurityPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceSecurityPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceSecurityPanel.java
new file mode 100644
index 0000000..40e031a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceSecurityPanel.java
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.syncope.client.console.rest.PolicyRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.common.lib.to.AbstractPolicyTO;
+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.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class ResourceSecurityPanel extends Panel {
+
+ private static final long serialVersionUID = -7982691107029848579L;
+
+ @SpringBean
+ private PolicyRestClient policyRestClient;
+
+ private IModel<Map<Long, String>> passwordPolicies = null;
+
+ private IModel<Map<Long, String>> accountPolicies = null;
+
+ private IModel<Map<Long, String>> syncPolicies = null;
+
+ public ResourceSecurityPanel(final String id, final ResourceTO resourceTO) {
+
+ super(id);
+
+ setOutputMarkupId(true);
+
+ passwordPolicies = new LoadableDetachableModel<Map<Long, String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected Map<Long, String> load() {
+ Map<Long, String> res = new HashMap<>();
+ for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PASSWORD, false)) {
+ res.put(policyTO.getKey(), policyTO.getDescription());
+ }
+ return res;
+ }
+ };
+
+ accountPolicies = new LoadableDetachableModel<Map<Long, String>>() {
+
+ private static final long serialVersionUID = -2012833443695917883L;
+
+ @Override
+ protected Map<Long, String> load() {
+ Map<Long, String> res = new HashMap<>();
+ for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.ACCOUNT, false)) {
+ res.put(policyTO.getKey(), policyTO.getDescription());
+ }
+ return res;
+ }
+ };
+
+ syncPolicies = new LoadableDetachableModel<Map<Long, String>>() {
+
+ private static final long serialVersionUID = -2012833443695917883L;
+
+ @Override
+ protected Map<Long, String> load() {
+ Map<Long, String> res = new HashMap<>();
+ for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.SYNC, false)) {
+ res.put(policyTO.getKey(), policyTO.getDescription());
+ }
+ return res;
+ }
+ };
+
+ final WebMarkupContainer securityContainer = new WebMarkupContainer("security");
+
+ securityContainer.setOutputMarkupId(true);
+ add(securityContainer);
+
+ // -------------------------------
+ // Password policy specification
+ // -------------------------------
+ final AjaxDropDownChoicePanel<Long> passwordPolicy = new AjaxDropDownChoicePanel<Long>("passwordPolicy",
+ new ResourceModel("passwordPolicy", "passwordPolicy").getObject(), new PropertyModel<Long>(resourceTO,
+ "passwordPolicy"));
+
+ passwordPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.PASSWORD));
+
+ passwordPolicy.setChoices(new ArrayList<>(passwordPolicies.getObject().keySet()));
+
+ ((DropDownChoice<?>) passwordPolicy.getField()).setNullValid(true);
+
+ securityContainer.add(passwordPolicy);
+ // -------------------------------
+
+ // -------------------------------
+ // Account policy specification
+ // -------------------------------
+ final AjaxDropDownChoicePanel<Long> accountPolicy = new AjaxDropDownChoicePanel<Long>("accountPolicy",
+ new ResourceModel("accountPolicy", "accountPolicy").getObject(), new PropertyModel<Long>(resourceTO,
+ "accountPolicy"));
+
+ accountPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.ACCOUNT));
+
+ accountPolicy.setChoices(new ArrayList<Long>(accountPolicies.getObject().keySet()));
+
+ ((DropDownChoice<?>) accountPolicy.getField()).setNullValid(true);
+
+ securityContainer.add(accountPolicy);
+ // -------------------------------
+
+ // -------------------------------
+ // Sync policy specification
+ // -------------------------------
+ final AjaxDropDownChoicePanel<Long> syncPolicy = new AjaxDropDownChoicePanel<Long>("syncPolicy",
+ new ResourceModel("syncPolicy", "syncPolicy").getObject(), new PropertyModel<Long>(resourceTO,
+ "syncPolicy"));
+
+ syncPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.SYNC));
+
+ syncPolicy.setChoices(new ArrayList<Long>(syncPolicies.getObject().keySet()));
+
+ ((DropDownChoice<?>) syncPolicy.getField()).setNullValid(true);
+
+ securityContainer.add(syncPolicy);
+ // -------------------------------
+ }
+
+ private class PolicyRenderer extends ChoiceRenderer<Long> {
+
+ private static final long serialVersionUID = 8060500161321947000L;
+
+ private PolicyType type;
+
+ public PolicyRenderer(final PolicyType type) {
+ super();
+ this.type = type;
+ }
+
+ @Override
+ public Object getDisplayValue(final Long object) {
+ switch (type) {
+ case GLOBAL_ACCOUNT:
+ case ACCOUNT:
+ return accountPolicies.getObject().get(object);
+ case GLOBAL_PASSWORD:
+ case PASSWORD:
+ return passwordPolicies.getObject().get(object);
+ case GLOBAL_SYNC:
+ case SYNC:
+ return syncPolicies.getObject().get(object);
+ default:
+ return "";
+ }
+ }
+
+ @Override
+ public String getIdValue(final Long object, final int index) {
+ return String.valueOf(object != null
+ ? object
+ : 0L);
+ }
+ };
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourcesPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourcesPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourcesPanel.java
new file mode 100644
index 0000000..67e2281
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourcesPanel.java
@@ -0,0 +1,178 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.RoleTreeBuilder;
+import org.apache.syncope.client.console.commons.RoleUtils;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
+import org.apache.syncope.client.console.rest.ResourceRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.NonI18nPalette;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.markup.html.form.palette.Palette;
+import org.apache.wicket.extensions.markup.html.form.palette.component.Recorder;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class ResourcesPanel extends Panel {
+
+ private static final long serialVersionUID = -8728071019777410008L;
+
+ @SpringBean
+ private ResourceRestClient resourceRestClient;
+
+ @SpringBean
+ private RoleTreeBuilder roleTreeBuilder;
+
+ private final AbstractSubjectTO subjectTO;
+
+ private final Set<String> previousResources;
+
+ private final List<String> allResources;
+
+ public static class Builder implements Serializable {
+
+ private static final long serialVersionUID = 8644108944633025494L;
+
+ private String id;
+
+ private Object to;
+
+ private StatusPanel statusPanel;
+
+ public Builder(final String id) {
+ this.id = id;
+ }
+
+ public Builder attributableTO(final Object to) {
+ this.to = to;
+ return this;
+ }
+
+ public Builder statusPanel(final StatusPanel statusPanel) {
+ this.statusPanel = statusPanel;
+ return this;
+ }
+
+ public ResourcesPanel build() {
+ return new ResourcesPanel(this);
+ }
+ }
+
+ private ResourcesPanel(final Builder builder) {
+ super(builder.id);
+ subjectTO = (AbstractSubjectTO) builder.to;
+ previousResources = new HashSet<>(subjectTO.getResources());
+ allResources = new ArrayList<>();
+ for (ResourceTO resourceTO : resourceRestClient.getAll()) {
+ allResources.add(resourceTO.getKey());
+ }
+ Collections.sort(allResources);
+
+ AjaxPalettePanel<String> resourcesPalette = null;
+
+ if (subjectTO instanceof UserTO) {
+ resourcesPalette = new AjaxRecordingPalettePanel<>("resourcesPalette",
+ new PropertyModel<List<String>>(subjectTO, "resources"),
+ new ListModel<>(allResources), builder.statusPanel);
+ } else if (subjectTO instanceof RoleTO) {
+ resourcesPalette = new AjaxPalettePanel<>("resourcesPalette",
+ new PropertyModel<List<String>>(subjectTO, "resources"), new ListModel<>(allResources));
+ }
+ add(resourcesPalette);
+ }
+
+ private class AjaxRecordingPalettePanel<T> extends AjaxPalettePanel<T> {
+
+ private static final long serialVersionUID = -4215625881756021988L;
+
+ private final StatusPanel statusPanel;
+
+ public AjaxRecordingPalettePanel(final String id, final IModel<List<T>> model, final ListModel<T> choices,
+ final StatusPanel statusPanel) {
+
+ super(id, model, choices, new SelectChoiceRenderer<T>(), false, false);
+ this.statusPanel = statusPanel;
+ }
+
+ @Override
+ protected Palette<T> createPalette(final IModel<List<T>> model, final ListModel<T> choices,
+ final IChoiceRenderer<T> renderer, final boolean allowOrder, final boolean allowMoveAll) {
+
+ return new NonI18nPalette<T>("paletteField", model, choices, renderer, 8, allowOrder, false) {
+
+ private static final long serialVersionUID = -3415146226879212841L;
+
+ @Override
+ protected Recorder<T> newRecorderComponent() {
+ Recorder<T> recorder = super.newRecorderComponent();
+ recorder.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = 5538299138211283825L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (subjectTO instanceof UserTO) {
+ UserTO userTO = (UserTO) subjectTO;
+
+ Set<String> resourcesToRemove = new HashSet<String>(previousResources);
+ resourcesToRemove.removeAll(userTO.getResources());
+ if (!resourcesToRemove.isEmpty()) {
+ Set<String> resourcesAssignedViaMembership = new HashSet<String>();
+ for (MembershipTO membTO : userTO.getMemberships()) {
+ RoleTO roleTO = RoleUtils.findRole(roleTreeBuilder, membTO.getRoleId());
+ if (roleTO != null) {
+ resourcesAssignedViaMembership.addAll(roleTO.getResources());
+ }
+ }
+ resourcesToRemove.removeAll(resourcesAssignedViaMembership);
+ }
+
+ previousResources.clear();
+ previousResources.addAll(userTO.getResources());
+
+ StatusUtils.update(
+ userTO, statusPanel, target, userTO.getResources(), resourcesToRemove);
+ }
+ }
+ });
+ return recorder;
+ }
+ };
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
new file mode 100644
index 0000000..2a97b3a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
@@ -0,0 +1,435 @@
+/*
+ * 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.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.JexlHelpUtil;
+import org.apache.syncope.client.console.pages.RoleSelectModalPage;
+import org.apache.syncope.client.console.pages.UserOwnerSelectModalPage;
+import org.apache.syncope.client.console.panels.AttrTemplatesPanel.RoleAttrTemplatesChange;
+import org.apache.syncope.client.console.panels.AttrTemplatesPanel.Type;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
+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.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RoleDetailsPanel extends Panel {
+
+ private static final long serialVersionUID = 855618618337931784L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(RoleDetailsPanel.class);
+
+ @SpringBean
+ private UserRestClient userRestClient;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ private final Fragment parentFragment;
+
+ private final WebMarkupContainer ownerContainer;
+
+ private final OwnerModel userOwnerModel;
+
+ private final OwnerModel roleOwnerModel;
+
+ private ParentModel parentModel;
+
+ public RoleDetailsPanel(final String id, final RoleTO roleTO, final boolean templateMode) {
+ super(id);
+
+ ownerContainer = new WebMarkupContainer("ownerContainer");
+ ownerContainer.setOutputMarkupId(true);
+ this.add(ownerContainer);
+
+ final ModalWindow userOwnerSelectWin = new ModalWindow("userOwnerSelectWin");
+ userOwnerSelectWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ userOwnerSelectWin.setCookieName("create-userOwnerSelect-modal");
+ this.add(userOwnerSelectWin);
+ final ModalWindow roleOwnerSelectWin = new ModalWindow("roleOwnerSelectWin");
+ roleOwnerSelectWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ roleOwnerSelectWin.setCookieName("create-roleOwnerSelect-modal");
+ this.add(roleOwnerSelectWin);
+ final ModalWindow parentSelectWin = new ModalWindow("parentSelectWin");
+ parentSelectWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ parentSelectWin.setCookieName("create-parentSelect-modal");
+ this.add(parentSelectWin);
+
+ if (templateMode) {
+ parentFragment = new Fragment("parent", "parentFragment", this);
+
+ parentModel = new ParentModel(roleTO);
+ @SuppressWarnings("unchecked")
+ final AjaxTextFieldPanel parent = new AjaxTextFieldPanel("parent", "parent", parentModel);
+ parent.setReadOnly(true);
+ parent.setOutputMarkupId(true);
+ parentFragment.add(parent);
+ final AjaxLink<Void> parentSelect = new IndicatingAjaxLink<Void>("parentSelect") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ parentSelectWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new RoleSelectModalPage(getPage().getPageReference(), parentSelectWin,
+ ParentSelectPayload.class);
+ }
+ });
+ parentSelectWin.show(target);
+ }
+ };
+ parentFragment.add(parentSelect);
+ final IndicatingAjaxLink<Void> parentReset = new IndicatingAjaxLink<Void>("parentReset") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ parentModel.setObject(null);
+ target.add(parent);
+ }
+ };
+ parentFragment.add(parentReset);
+ } else {
+ parentFragment = new Fragment("parent", "emptyFragment", this);
+ }
+ parentFragment.setOutputMarkupId(true);
+ this.add(parentFragment);
+
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(roleTO, "name"));
+
+ final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
+
+ final AjaxLink questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
+ this.add(questionMarkJexlHelp);
+ questionMarkJexlHelp.add(jexlHelp);
+
+ if (!templateMode) {
+ name.addRequiredLabel();
+ questionMarkJexlHelp.setVisible(false);
+ }
+ this.add(name);
+
+ userOwnerModel = new OwnerModel(roleTO, AttributableType.USER);
+ @SuppressWarnings("unchecked")
+ final AjaxTextFieldPanel userOwner = new AjaxTextFieldPanel("userOwner", "userOwner", userOwnerModel);
+ userOwner.setReadOnly(true);
+ userOwner.setOutputMarkupId(true);
+ ownerContainer.add(userOwner);
+ final AjaxLink<Void> userOwnerSelect = new IndicatingAjaxLink<Void>("userOwnerSelect") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ userOwnerSelectWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new UserOwnerSelectModalPage(getPage().getPageReference(), userOwnerSelectWin);
+ }
+ });
+ userOwnerSelectWin.show(target);
+ }
+ };
+ ownerContainer.add(userOwnerSelect);
+ final IndicatingAjaxLink<Void> userOwnerReset = new IndicatingAjaxLink<Void>("userOwnerReset") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ userOwnerModel.setObject(null);
+ target.add(userOwner);
+ }
+ };
+ ownerContainer.add(userOwnerReset);
+
+ roleOwnerModel = new OwnerModel(roleTO, AttributableType.ROLE);
+ @SuppressWarnings("unchecked")
+ final AjaxTextFieldPanel roleOwner = new AjaxTextFieldPanel("roleOwner", "roleOwner", roleOwnerModel);
+ roleOwner.setReadOnly(true);
+ roleOwner.setOutputMarkupId(true);
+ ownerContainer.add(roleOwner);
+ final AjaxLink<Void> roleOwnerSelect = new IndicatingAjaxLink<Void>("roleOwnerSelect") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ parentSelectWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new RoleSelectModalPage(getPage().getPageReference(), parentSelectWin,
+ RoleOwnerSelectPayload.class);
+ }
+ });
+ parentSelectWin.show(target);
+ }
+ };
+ ownerContainer.add(roleOwnerSelect);
+ final IndicatingAjaxLink<Void> roleOwnerReset = new IndicatingAjaxLink<Void>("roleOwnerReset") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ roleOwnerModel.setObject(null);
+ target.add(roleOwner);
+ }
+ };
+ ownerContainer.add(roleOwnerReset);
+
+ final AjaxCheckBoxPanel inhOwner = new AjaxCheckBoxPanel("inheritOwner", "inheritOwner",
+ new PropertyModel<Boolean>(roleTO, "inheritOwner"));
+ this.add(inhOwner);
+
+ final AjaxCheckBoxPanel inhTemplates = new AjaxCheckBoxPanel("inheritTemplates", "inheritTemplates",
+ new PropertyModel<Boolean>(roleTO, "inheritTemplates"));
+ inhTemplates.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rAttrTemplates, target));
+ send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rDerAttrTemplates, target));
+ send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rVirAttrTemplates, target));
+ }
+ });
+ this.add(inhTemplates);
+ }
+
+ /**
+ * This is waiting for events from opened modal windows: first to get the selected user / role, then to update the
+ * respective text panel.
+ *
+ * {@inheritDoc }
+ */
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ super.onEvent(event);
+
+ if (event.getPayload() instanceof ParentSelectPayload) {
+ parentModel.setObject(((ParentSelectPayload) event.getPayload()).getRoleId());
+ }
+ if (event.getPayload() instanceof UserOwnerSelectPayload) {
+ userOwnerModel.setObject(((UserOwnerSelectPayload) event.getPayload()).getUserId());
+ }
+ if (event.getPayload() instanceof RoleOwnerSelectPayload) {
+ roleOwnerModel.setObject(((RoleOwnerSelectPayload) event.getPayload()).getRoleId());
+ }
+
+ if (event.getPayload() instanceof AjaxRequestTarget) {
+ ((AjaxRequestTarget) event.getPayload()).add(parentFragment);
+ ((AjaxRequestTarget) event.getPayload()).add(ownerContainer);
+ }
+ }
+
+ private class OwnerModel implements IModel {
+
+ private static final long serialVersionUID = -3865621970810102714L;
+
+ private final RoleTO roleTO;
+
+ private final AttributableType type;
+
+ public OwnerModel(final RoleTO roleTO, final AttributableType type) {
+ this.roleTO = roleTO;
+ this.type = type;
+ }
+
+ @Override
+ public Object getObject() {
+ String object = null;
+
+ switch (type) {
+ case USER:
+ if (roleTO.getUserOwner() != null) {
+ UserTO user = null;
+ try {
+ user = userRestClient.read(roleTO.getUserOwner());
+ } catch (Exception e) {
+ LOG.warn("Could not find user with id {}, ignoring", roleTO.getUserOwner(), e);
+ }
+ if (user == null) {
+ roleTO.setUserOwner(null);
+ } else {
+ object = user.getKey() + " " + user.getUsername();
+ }
+ }
+ break;
+
+ case ROLE:
+ RoleTO role = null;
+ if (roleTO.getRoleOwner() != null) {
+ try {
+ role = roleRestClient.read(roleTO.getRoleOwner());
+ } catch (Exception e) {
+ LOG.warn("Could not find role with id {}, ignoring", roleTO.getRoleOwner(), e);
+ }
+ if (role == null) {
+ roleTO.setRoleOwner(null);
+ } else {
+ object = role.getDisplayName();
+ }
+ }
+ break;
+
+ case MEMBERSHIP:
+ default:
+ }
+
+ return object;
+ }
+
+ @Override
+ public void setObject(final Object object) {
+ switch (type) {
+ case USER:
+ roleTO.setUserOwner((Long) object);
+ break;
+
+ case ROLE:
+ roleTO.setRoleOwner((Long) object);
+ break;
+
+ case MEMBERSHIP:
+ default:
+ }
+ }
+
+ @Override
+ public void detach() {
+ // ignore
+ }
+ }
+
+ private class ParentModel implements IModel {
+
+ private static final long serialVersionUID = 1006546156848990721L;
+
+ private final RoleTO roleTO;
+
+ public ParentModel(final RoleTO roleTO) {
+ this.roleTO = roleTO;
+ }
+
+ @Override
+ public Object getObject() {
+ Object object = null;
+ if (roleTO.getParent() != 0) {
+ RoleTO parent = null;
+ try {
+ parent = roleRestClient.read(roleTO.getParent());
+ } catch (Exception e) {
+ LOG.warn("Could not find role with id {}, ignoring", roleTO.getParent(), e);
+ }
+ if (parent == null) {
+ roleTO.setParent(0);
+ } else {
+ object = parent.getDisplayName();
+ }
+ }
+ return object;
+ }
+
+ @Override
+ public void setObject(final Object object) {
+ roleTO.setParent((object instanceof Long) ? ((Long) object) : 0);
+ }
+
+ @Override
+ public void detach() {
+ // ignore
+ }
+ }
+
+ public static class UserOwnerSelectPayload {
+
+ private final Long userId;
+
+ public UserOwnerSelectPayload(final Long userId) {
+ this.userId = userId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+ }
+
+ public static class RoleOwnerSelectPayload {
+
+ private final Long roleId;
+
+ public RoleOwnerSelectPayload(final Long roleId) {
+ this.roleId = roleId;
+ }
+
+ public Long getRoleId() {
+ return roleId;
+ }
+ }
+
+ public static class ParentSelectPayload {
+
+ private final Long roleId;
+
+ public ParentSelectPayload(final Long roleId) {
+ this.roleId = roleId;
+ }
+
+ public Long getRoleId() {
+ return roleId;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
new file mode 100644
index 0000000..09f838a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
@@ -0,0 +1,187 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.commons.status.StatusBean;
+import org.apache.syncope.client.console.rest.AuthRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class RolePanel extends Panel {
+
+ private static final long serialVersionUID = 4216376097320768369L;
+
+ @SpringBean
+ private AuthRestClient authRestClient;
+
+ @SpringBean
+ private XMLRolesReader xmlRolesReader;
+
+ private final AjaxPalettePanel<String> entitlements;
+
+ public static class Builder implements Serializable {
+
+ private static final long serialVersionUID = 8150440254654306070L;
+
+ private String id;
+
+ private Form form;
+
+ private RoleTO roleTO;
+
+ private Mode mode;
+
+ private PageReference pageReference;
+
+ public Builder(final String id) {
+ this.id = id;
+ }
+
+ public Builder form(final Form form) {
+ this.form = form;
+ return this;
+ }
+
+ public Builder roleTO(final RoleTO roleTO) {
+ this.roleTO = roleTO;
+ return this;
+ }
+
+ public Builder roleModalPageMode(final Mode mode) {
+ this.mode = mode;
+ return this;
+ }
+
+ public Builder pageRef(final PageReference pageReference) {
+ this.pageReference = pageReference;
+ return this;
+ }
+
+ public RolePanel build() {
+ return new RolePanel(this);
+ }
+ }
+
+ private RolePanel(final Builder builder) {
+ super(builder.id);
+
+ this.add(new RoleDetailsPanel("details", builder.roleTO, builder.mode == Mode.TEMPLATE));
+
+ if (builder.pageReference == null || builder.roleTO.getKey() == 0) {
+ this.add(new Label("statuspanel", ""));
+ } else {
+ StatusPanel statusPanel = new StatusPanel(
+ "statuspanel", builder.roleTO, new ArrayList<StatusBean>(), builder.pageReference);
+ statusPanel.setOutputMarkupId(true);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ statusPanel, RENDER, xmlRolesReader.getEntitlement("Resources", "getConnectorObject"));
+ this.add(statusPanel);
+ }
+
+ this.add(new AnnotatedBeanPanel("systeminformation", builder.roleTO));
+
+ //--------------------------------
+ // Attribute templates panel
+ //--------------------------------
+ AttrTemplatesPanel attrTemplates = new AttrTemplatesPanel("templates", builder.roleTO);
+ this.add(attrTemplates);
+
+ //--------------------------------
+ // Attributes panel
+ //--------------------------------
+ this.add(new PlainAttrsPanel(
+ "attrs", builder.roleTO, builder.form, builder.mode, attrTemplates));
+
+ final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel("inheritAttrs", "inheritAttrs",
+ new PropertyModel<Boolean>(builder.roleTO, "inheritAttrs"));
+ inhAttributes.setOutputMarkupId(true);
+ this.add(inhAttributes);
+ //--------------------------------
+
+ //--------------------------------
+ // Derived attributes panel
+ //--------------------------------
+ this.add(new DerAttrsPanel("derAttrs", builder.roleTO, attrTemplates));
+
+ final AjaxCheckBoxPanel inhDerivedAttributes = new AjaxCheckBoxPanel("inheritDerAttrs",
+ "inheritDerAttrs", new PropertyModel<Boolean>(builder.roleTO, "inheritDerAttrs"));
+ inhDerivedAttributes.setOutputMarkupId(true);
+ this.add(inhDerivedAttributes);
+ //--------------------------------
+
+ //--------------------------------
+ // Virtual attributes panel
+ //--------------------------------
+ this.add(new VirAttrsPanel(
+ "virAttrs", builder.roleTO, builder.mode == Mode.TEMPLATE, attrTemplates));
+
+ final AjaxCheckBoxPanel inhVirtualAttributes = new AjaxCheckBoxPanel("inheritVirAttrs",
+ "inheritVirAttrs", new PropertyModel<Boolean>(builder.roleTO, "inheritVirAttrs"));
+ inhVirtualAttributes.setOutputMarkupId(true);
+ this.add(inhVirtualAttributes);
+ //--------------------------------
+
+ //--------------------------------
+ // Resources panel
+ //--------------------------------
+ this.add(new ResourcesPanel.Builder("resources").attributableTO(builder.roleTO).build().
+ setOutputMarkupId(true));
+ //--------------------------------
+
+ //--------------------------------
+ // Entitlements
+ //--------------------------------
+ ListModel<String> selectedEntitlements = new ListModel<String>(builder.roleTO.getEntitlements());
+
+ List<String> allEntitlements = authRestClient.getAllEntitlements();
+ if (allEntitlements != null && !allEntitlements.isEmpty()) {
+ Collections.sort(allEntitlements);
+ }
+ ListModel<String> availableEntitlements = new ListModel<String>(allEntitlements);
+
+ entitlements = new AjaxPalettePanel<String>("entitlements", selectedEntitlements, availableEntitlements);
+ this.add(entitlements);
+
+ //--------------------------------
+ // Security panel
+ //--------------------------------
+ this.add(new RoleSecurityPanel("security", builder.roleTO).setOutputMarkupId(true));
+ //--------------------------------
+ }
+
+ public Collection<String> getSelectedEntitlements() {
+ return this.entitlements.getModelCollection();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchPanel.java
new file mode 100644
index 0000000..c8d9727
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchPanel.java
@@ -0,0 +1,101 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.search.SyncopeFiqlSearchConditionBuilder;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.model.LoadableDetachableModel;
+
+public class RoleSearchPanel extends AbstractSearchPanel {
+
+ private static final long serialVersionUID = 5757183539269316263L;
+
+ public static class Builder implements Serializable {
+
+ private static final long serialVersionUID = 6308997285778809579L;
+
+ private String id;
+
+ private String fiql = null;
+
+ private boolean required = true;
+
+ public Builder(final String id) {
+ this.id = id;
+ }
+
+ public Builder fiql(final String fiql) {
+ this.fiql = fiql;
+ return this;
+ }
+
+ public Builder required(final boolean required) {
+ this.required = required;
+ return this;
+ }
+
+ public RoleSearchPanel build() {
+ return new RoleSearchPanel(this);
+ }
+ }
+
+ private RoleSearchPanel(final Builder builder) {
+ super(builder.id, AttributableType.ROLE, builder.fiql, builder.required);
+ }
+
+ @Override
+ protected void populate() {
+ super.populate();
+
+ this.types = new LoadableDetachableModel<List<SearchClause.Type>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<SearchClause.Type> load() {
+ final List<SearchClause.Type> result = new ArrayList<SearchClause.Type>();
+ result.add(SearchClause.Type.ATTRIBUTE);
+ result.add(SearchClause.Type.ENTITLEMENT);
+ result.add(SearchClause.Type.RESOURCE);
+ return result;
+ }
+ };
+
+ this.roleNames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return Collections.<String>emptyList();
+ }
+ };
+ }
+
+ @Override
+ protected SyncopeFiqlSearchConditionBuilder getSearchConditionBuilder() {
+ return SyncopeClient.getRoleSearchConditionBuilder();
+ }
+
+}
[07/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/webapp/db.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/webapp/db.jsp b/syncope620/fit/server-reference/src/main/webapp/db.jsp
new file mode 100644
index 0000000..2a4c6ac
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/webapp/db.jsp
@@ -0,0 +1,36 @@
+<%--
+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.
+--%>
+<%@page import="java.sql.SQLException"%>
+<%@page import="org.h2.tools.Server"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%
+ Server h2Datastore = (Server) getServletConfig().getServletContext().getAttribute("H2_DATASTORE");
+ if (h2Datastore == null || !h2Datastore.isRunning(true)) {
+ try {
+ h2Datastore = Server.createWebServer("-webPort", "8082");
+ h2Datastore.start();
+
+ getServletConfig().getServletContext().setAttribute("H2_DATASTORE", h2Datastore);
+ } catch (SQLException e) {
+ getServletConfig().getServletContext().log("Could not start H2 web console (datastore)", e);
+ }
+
+ response.sendRedirect("http://localhost:8082");
+ }
+%>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java
new file mode 100644
index 0000000..cf545a7
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java
@@ -0,0 +1,388 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.UUID;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.InitialDirContext;
+import javax.sql.DataSource;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AbstractPolicyTO;
+import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.CamelRouteService;
+import org.apache.syncope.common.rest.api.service.ConfigurationService;
+import org.apache.syncope.common.rest.api.service.ConnectorService;
+import org.apache.syncope.common.rest.api.service.EntitlementService;
+import org.apache.syncope.common.rest.api.service.LoggerService;
+import org.apache.syncope.common.rest.api.service.NotificationService;
+import org.apache.syncope.common.rest.api.service.PolicyService;
+import org.apache.syncope.common.rest.api.service.ReportService;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.RoleService;
+import org.apache.syncope.common.rest.api.service.SchemaService;
+import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
+import org.apache.syncope.common.rest.api.service.SyncopeService;
+import org.apache.syncope.common.rest.api.service.TaskService;
+import org.apache.syncope.common.rest.api.service.UserSelfService;
+import org.apache.syncope.common.rest.api.service.UserService;
+import org.apache.syncope.common.rest.api.service.UserWorkflowService;
+import org.apache.syncope.common.rest.api.service.WorkflowService;
+import org.identityconnectors.common.security.Encryptor;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = { "classpath:testJDBCContext.xml" })
+public abstract class AbstractITCase {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractITCase.class);
+
+ protected static final String ADMIN_UNAME = "admin";
+
+ protected static final String ADMIN_PWD = "password";
+
+ private static final String ADDRESS = "http://localhost:9080/syncope/rest";
+
+ private static final String ENV_KEY_CONTENT_TYPE = "jaxrsContentType";
+
+ protected static final SyncopeClientFactoryBean clientFactory = new SyncopeClientFactoryBean().setAddress(ADDRESS);
+
+ protected static final String RESOURCE_NAME_WS1 = "ws-target-resource-1";
+
+ protected static final String RESOURCE_NAME_WS2 = "ws-target-resource-2";
+
+ protected static final String RESOURCE_NAME_LDAP = "resource-ldap";
+
+ protected static final String RESOURCE_NAME_TESTDB = "resource-testdb";
+
+ protected static final String RESOURCE_NAME_TESTDB2 = "resource-testdb2";
+
+ protected static final String RESOURCE_NAME_CSV = "resource-csv";
+
+ protected static final String RESOURCE_NAME_DBSYNC = "resource-db-sync";
+
+ protected static final String RESOURCE_NAME_DBVIRATTR = "resource-db-virattr";
+
+ protected static final String RESOURCE_NAME_NOPROPAGATION = "ws-target-resource-nopropagation";
+
+ protected static final String RESOURCE_NAME_NOPROPAGATION2 = "ws-target-resource-nopropagation2";
+
+ protected static final String RESOURCE_NAME_NOPROPAGATION3 = "ws-target-resource-nopropagation3";
+
+ protected static final String RESOURCE_NAME_NOPROPAGATION4 = "ws-target-resource-nopropagation4";
+
+ protected static final String RESOURCE_NAME_RESETSYNCTOKEN = "ws-target-resource-update-resetsynctoken";
+
+ protected static final String RESOURCE_NAME_TIMEOUT = "ws-target-resource-timeout";
+
+ protected static final String RESOURCE_NAME_MAPPINGS1 = "ws-target-resource-list-mappings-1";
+
+ protected static final String RESOURCE_NAME_MAPPINGS2 = "ws-target-resource-list-mappings-2";
+
+ protected static final String RESOURCE_NAME_CREATE = "ws-target-resource-create";
+
+ protected static final String RESOURCE_NAME_CREATE_SINGLE = "ws-target-resource-create-single";
+
+ protected static final String RESOURCE_NAME_CREATE_WRONG = "ws-target-resource-create-wrong";
+
+ protected static final String RESOURCE_NAME_DELETE = "ws-target-resource-delete";
+
+ protected static final String RESOURCE_NAME_UPDATE = "ws-target-resource-update";
+
+ protected static final String RESOURCE_NAME_CREATE_NONE = "ws-target-resource-create-none";
+
+ protected static String ANONYMOUS_UNAME;
+
+ protected static String ANONYMOUS_KEY;
+
+ protected static SyncopeClient adminClient;
+
+ protected static SyncopeService syncopeService;
+
+ protected static UserService userService;
+
+ protected static UserSelfService userSelfService;
+
+ protected static UserWorkflowService userWorkflowService;
+
+ protected static RoleService roleService;
+
+ protected static ResourceService resourceService;
+
+ protected static EntitlementService entitlementService;
+
+ protected static ConfigurationService configurationService;
+
+ protected static ConnectorService connectorService;
+
+ protected static LoggerService loggerService;
+
+ protected static ReportService reportService;
+
+ protected static TaskService taskService;
+
+ protected static WorkflowService workflowService;
+
+ protected static NotificationService notificationService;
+
+ protected static SchemaService schemaService;
+
+ protected static PolicyService policyService;
+
+ protected static SecurityQuestionService securityQuestionService;
+
+ protected static CamelRouteService camelRouteService;
+
+ @Autowired
+ protected DataSource testDataSource;
+
+ @BeforeClass
+ public static void securitySetup() {
+ InputStream propStream = null;
+ try {
+ propStream = Encryptor.class.getResourceAsStream("/security.properties");
+ Properties props = new Properties();
+ props.load(propStream);
+
+ ANONYMOUS_UNAME = props.getProperty("anonymousUser");
+ ANONYMOUS_KEY = props.getProperty("anonymousKey");
+ } catch (Exception e) {
+ LOG.error("Could not read secretKey", e);
+ } finally {
+ IOUtils.closeQuietly(propStream);
+ }
+
+ assertNotNull(ANONYMOUS_UNAME);
+ assertNotNull(ANONYMOUS_KEY);
+ }
+
+ @BeforeClass
+ public static void restSetup() {
+ final String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE);
+ if (StringUtils.isNotBlank(envContentType)) {
+ clientFactory.setContentType(envContentType);
+ }
+ LOG.info("Performing IT with content type {}", clientFactory.getContentType().getMediaType());
+
+ adminClient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
+
+ syncopeService = adminClient.getService(SyncopeService.class);
+ userService = adminClient.getService(UserService.class);
+ userSelfService = adminClient.getService(UserSelfService.class);
+ userWorkflowService = adminClient.getService(UserWorkflowService.class);
+ roleService = adminClient.getService(RoleService.class);
+ resourceService = adminClient.getService(ResourceService.class);
+ entitlementService = adminClient.getService(EntitlementService.class);
+ configurationService = adminClient.getService(ConfigurationService.class);
+ connectorService = adminClient.getService(ConnectorService.class);
+ loggerService = adminClient.getService(LoggerService.class);
+ reportService = adminClient.getService(ReportService.class);
+ taskService = adminClient.getService(TaskService.class);
+ policyService = adminClient.getService(PolicyService.class);
+ workflowService = adminClient.getService(WorkflowService.class);
+ notificationService = adminClient.getService(NotificationService.class);
+ schemaService = adminClient.getService(SchemaService.class);
+ securityQuestionService = adminClient.getService(SecurityQuestionService.class);
+ camelRouteService = adminClient.getService(CamelRouteService.class);
+ }
+
+ protected static String getUUIDString() {
+ return UUID.randomUUID().toString().substring(0, 8);
+ }
+
+ protected static AttrTO attrTO(final String schema, final String value) {
+ AttrTO attr = new AttrTO();
+ attr.setSchema(schema);
+ attr.getValues().add(value);
+ return attr;
+ }
+
+ protected static AttrMod attrMod(final String schema, final String valueToBeAdded) {
+ AttrMod attr = new AttrMod();
+ attr.setSchema(schema);
+ attr.getValuesToBeAdded().add(valueToBeAdded);
+ return attr;
+ }
+
+ protected UserTO createUser(final UserTO userTO) {
+ return createUser(userTO, true);
+ }
+
+ protected UserTO createUser(final UserTO userTO, final boolean storePassword) {
+ Response response = userService.create(userTO, storePassword);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
+ if (ex != null) {
+ throw (RuntimeException) ex;
+ }
+ }
+ return response.readEntity(UserTO.class);
+ }
+
+ protected UserTO readUser(final String username) {
+ return userService.read(Long.valueOf(
+ userService.getUserId(username).getHeaderString(RESTHeaders.USER_ID)));
+ }
+
+ protected UserTO updateUser(final UserMod userMod) {
+ return userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
+ }
+
+ protected UserTO deleteUser(final Long id) {
+ return userService.delete(id).readEntity(UserTO.class);
+ }
+
+ public <T> T getObject(final URI location, final Class<?> serviceClass, final Class<T> resultClass) {
+ WebClient webClient = WebClient.fromClient(WebClient.client(adminClient.getService(serviceClass)));
+ webClient.accept(clientFactory.getContentType().getMediaType()).to(location.toASCIIString(), false);
+
+ return webClient.get(resultClass);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected <T extends AbstractSchemaTO> T createSchema(final AttributableType kind,
+ final SchemaType type, final T schemaTO) {
+
+ Response response = schemaService.create(kind, type, schemaTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
+ if (ex != null) {
+ throw (RuntimeException) ex;
+ }
+ }
+
+ return (T) getObject(response.getLocation(), SchemaService.class, schemaTO.getClass());
+ }
+
+ protected RoleTO createRole(final RoleTO newRoleTO) {
+ Response response = roleService.create(newRoleTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
+ if (ex != null) {
+ throw (RuntimeException) ex;
+ }
+ }
+ return getObject(response.getLocation(), RoleService.class, RoleTO.class);
+ }
+
+ protected RoleTO updateRole(final RoleMod roleMod) {
+ return roleService.update(roleMod.getKey(), roleMod).readEntity(RoleTO.class);
+ }
+
+ protected RoleTO deleteRole(final Long id) {
+ return roleService.delete(id).readEntity(RoleTO.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected <T extends AbstractPolicyTO> T createPolicy(final T policy) {
+ Response response = policyService.create(policy);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
+ if (ex != null) {
+ throw (RuntimeException) ex;
+ }
+ }
+ return (T) getObject(response.getLocation(), PolicyService.class, policy.getClass());
+ }
+
+ protected ResourceTO createResource(final ResourceTO resourceTO) {
+ Response response = resourceService.create(resourceTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
+ if (ex != null) {
+ throw (RuntimeException) ex;
+ }
+ }
+ return getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes", "UseOfObsoleteCollectionType" })
+ protected InitialDirContext getLdapResourceDirContext(final String bindDn, final String bindPwd)
+ throws NamingException {
+ ResourceTO ldapRes = resourceService.read(RESOURCE_NAME_LDAP);
+ final Map<String, ConnConfProperty> ldapConnConf =
+ connectorService.read(ldapRes.getConnectorId()).getConfigurationMap();
+
+ Hashtable env = new Hashtable();
+ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, "ldap://" + ldapConnConf.get("host").getValues().get(0)
+ + ":" + ldapConnConf.get("port").getValues().get(0) + "/");
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL,
+ bindDn == null ? ldapConnConf.get("principal").getValues().get(0) : bindDn);
+ env.put(Context.SECURITY_CREDENTIALS,
+ bindPwd == null ? ldapConnConf.get("credentials").getValues().get(0) : bindPwd);
+
+ return new InitialDirContext(env);
+ }
+
+ protected Object getLdapRemoteObject(final String bindDn, final String bindPwd, final String objectDn) {
+ InitialDirContext ctx = null;
+ try {
+ ctx = getLdapResourceDirContext(bindDn, bindPwd);
+ return ctx.lookup(objectDn);
+ } catch (Exception e) {
+ return null;
+ } finally {
+ if (ctx != null) {
+ try {
+ ctx.close();
+ } catch (NamingException e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ protected Object getLdapRemoteObject(final String objectDn) {
+ return getLdapRemoteObject(null, null, objectDn);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java
new file mode 100644
index 0000000..afc9752
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java
@@ -0,0 +1,138 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.to.UserTO;
+
+public abstract class AbstractTaskITCase extends AbstractITCase {
+
+ protected static final Long SYNC_TASK_ID = 4L;
+
+ protected static final Long SCHED_TASK_ID = 5L;
+
+ protected static class ThreadExec implements Callable<TaskExecTO> {
+
+ private final AbstractTaskITCase test;
+
+ private final Long taskKey;
+
+ private final int maxWaitSeconds;
+
+ private final boolean dryRun;
+
+ public ThreadExec(AbstractTaskITCase test, Long taskKey, int maxWaitSeconds, boolean dryRun) {
+ this.test = test;
+ this.taskKey = taskKey;
+ this.maxWaitSeconds = maxWaitSeconds;
+ this.dryRun = dryRun;
+ }
+
+ @Override
+ public TaskExecTO call() throws Exception {
+ return test.execSyncTask(taskKey, maxWaitSeconds, dryRun);
+ }
+ }
+
+ /**
+ * Remove initial and synchronized users to make test re-runnable.
+ */
+ protected void removeTestUsers() {
+ for (int i = 0; i < 10; i++) {
+ String cUserName = "test" + i;
+ try {
+ UserTO cUserTO = readUser(cUserName);
+ userService.delete(cUserTO.getKey());
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
+ }
+
+ protected TaskExecTO execSyncTask(final Long taskKey, final int maxWaitSeconds, final boolean dryRun) {
+ AbstractTaskTO taskTO = taskService.read(taskKey);
+ assertNotNull(taskTO);
+ assertNotNull(taskTO.getExecutions());
+
+ int preSyncSize = taskTO.getExecutions().size();
+ TaskExecTO execution = taskService.execute(taskTO.getKey(), dryRun);
+ assertEquals("JOB_FIRED", execution.getStatus());
+
+ int i = 0;
+ int maxit = maxWaitSeconds;
+
+ // wait for sync completion (executions incremented)
+ do {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+
+ taskTO = taskService.read(taskTO.getKey());
+
+ assertNotNull(taskTO);
+ assertNotNull(taskTO.getExecutions());
+
+ i++;
+ } while (preSyncSize == taskTO.getExecutions().size() && i < maxit);
+ if (i == maxit) {
+ fail("Timeout when executing task " + taskKey);
+ }
+ return taskTO.getExecutions().get(taskTO.getExecutions().size() - 1);
+ }
+
+ protected Map<Long, TaskExecTO> execSyncTasks(
+ final Set<Long> taskKeys, final int maxWaitSeconds, final boolean dryRun) throws Exception {
+
+ final ExecutorService service = Executors.newFixedThreadPool(taskKeys.size());
+ final List<Future<TaskExecTO>> futures = new ArrayList<>();
+
+ for (Long key : taskKeys) {
+ futures.add(service.submit(new ThreadExec(this, key, maxWaitSeconds, dryRun)));
+ }
+
+ final Map<Long, TaskExecTO> res = new HashMap<>();
+
+ for (Future<TaskExecTO> future : futures) {
+ TaskExecTO taskExecTO = future.get(100, TimeUnit.SECONDS);
+ res.put(taskExecTO.getTask(), taskExecTO);
+ }
+
+ service.shutdownNow();
+
+ return res;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java
new file mode 100644
index 0000000..f16dbe6
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.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.fit.server.reference;
+
+import org.apache.syncope.common.rest.api.service.SyncopeService;
+
+public class ActivitiDetector {
+
+ public static boolean isActivitiEnabledForUsers(final SyncopeService syncopeService) {
+ return syncopeService.info().getUserWorkflowAdapter().indexOf("Activiti") != -1;
+ }
+
+ public static boolean isActivitiEnabledForRoles(final SyncopeService syncopeService) {
+ return syncopeService.info().getRoleWorkflowAdapter().indexOf("Activiti") != -1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java
new file mode 100644
index 0000000..5b3b4b0
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java
@@ -0,0 +1,440 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.security.AccessControlException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.wrap.EntitlementTO;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.EntitlementService;
+import org.apache.syncope.common.rest.api.service.SchemaService;
+import org.apache.syncope.common.rest.api.service.UserSelfService;
+import org.apache.syncope.common.rest.api.service.UserService;
+import org.apache.syncope.server.misc.security.Encryptor;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class AuthenticationITCase extends AbstractITCase {
+
+ private int getFailedLogins(UserService testUserService, long userId) {
+ UserTO readUserTO = testUserService.read(userId);
+ assertNotNull(readUserTO);
+ assertNotNull(readUserTO.getFailedLogins());
+ return readUserTO.getFailedLogins();
+ }
+
+ private void assertReadFails(UserService userService, long id) {
+ try {
+ userService.read(id);
+ fail("access should not work");
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void testAdminEntitlements() {
+ // 1. as anonymous, read all available entitlements
+ List<EntitlementTO> allEntitlements = entitlementService.getAllEntitlements();
+ assertNotNull(allEntitlements);
+ assertFalse(allEntitlements.isEmpty());
+
+ // 2. as admin, read own entitlements
+ List<EntitlementTO> adminEntitlements = entitlementService.getOwnEntitlements();
+
+ assertEquals(new HashSet<String>(CollectionWrapper.unwrap(allEntitlements)),
+ new HashSet<String>(CollectionWrapper.unwrap(adminEntitlements)));
+ }
+
+ @Test
+ public void testUserSchemaAuthorization() {
+ // 0. create a role that can only read schemas
+ RoleTO authRoleTO = new RoleTO();
+ authRoleTO.setName("authRole" + getUUIDString());
+ authRoleTO.setParent(8L);
+ authRoleTO.getEntitlements().add("SCHEMA_READ");
+
+ authRoleTO = createRole(authRoleTO);
+ assertNotNull(authRoleTO);
+
+ String schemaName = "authTestSchema" + getUUIDString();
+
+ // 1. create a schema (as admin)
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey(schemaName);
+ schemaTO.setMandatoryCondition("false");
+ schemaTO.setType(AttrSchemaType.String);
+
+ PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ assertEquals(schemaTO, newPlainSchemaTO);
+
+ // 2. create an user with the role created above (as admin)
+ UserTO userTO = UserITCase.getUniqueSampleTO("auth@test.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(authRoleTO.getKey());
+ AttrTO testAttrTO = new AttrTO();
+ testAttrTO.setSchema("testAttribute");
+ testAttrTO.getValues().add("a value");
+ membershipTO.getPlainAttrs().add(testAttrTO);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ // 3. read the schema created above (as admin) - success
+ schemaTO = schemaService.read(AttributableType.USER, SchemaType.PLAIN, schemaName);
+ assertNotNull(schemaTO);
+
+ // 4. read the schema created above (as user) - success
+ SchemaService schemaService2 = clientFactory.create(userTO.getUsername(), "password123").getService(
+ SchemaService.class);
+
+ schemaTO = schemaService2.read(AttributableType.USER, SchemaType.PLAIN, schemaName);
+ assertNotNull(schemaTO);
+
+ // 5. update the schema create above (as user) - failure
+ try {
+ schemaService2.update(AttributableType.ROLE, SchemaType.PLAIN, schemaName, schemaTO);
+ fail("Schemaupdate as user schould not work");
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ assertEquals(Response.Status.UNAUTHORIZED, e.getType().getResponseStatus());
+ } catch (AccessControlException e) {
+ // CXF Service will throw this exception
+ assertNotNull(e);
+ }
+
+ assertEquals(0, getFailedLogins(userService, userTO.getKey()));
+ }
+
+ @Test
+ public void testUserRead() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("testuserread@test.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+ AttrTO testAttrTO = new AttrTO();
+ testAttrTO.setSchema("testAttribute");
+ testAttrTO.getValues().add("a value");
+ membershipTO.getPlainAttrs().add(testAttrTO);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").
+ getService(UserService.class);
+
+ UserTO readUserTO = userService2.read(1L);
+ assertNotNull(readUserTO);
+
+ UserService userService3 = clientFactory.create("verdi", ADMIN_PWD).getService(UserService.class);
+
+ SyncopeClientException exception = null;
+ try {
+ userService3.read(1L);
+ fail();
+ } catch (SyncopeClientException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ assertEquals(ClientExceptionType.UnauthorizedRole, exception.getType());
+ }
+
+ @Test
+ public void testUserSearch() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("testusersearch@test.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+ AttrTO testAttrTO = new AttrTO();
+ testAttrTO.setSchema("testAttribute");
+ testAttrTO.getValues().add("a value");
+ membershipTO.getPlainAttrs().add(testAttrTO);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").
+ getService(UserService.class);
+
+ PagedResult<UserTO> matchedUsers = userService2.search(
+ SyncopeClient.getUserSearchConditionBuilder().isNotNull("loginDate").query());
+ assertNotNull(matchedUsers);
+ assertFalse(matchedUsers.getResult().isEmpty());
+ Set<Long> userIds = new HashSet<Long>(matchedUsers.getResult().size());
+ for (UserTO user : matchedUsers.getResult()) {
+ userIds.add(user.getKey());
+ }
+ assertTrue(userIds.contains(1L));
+
+ UserService userService3 = clientFactory.create("verdi", "password").getService(UserService.class);
+
+ matchedUsers = userService3.search(
+ SyncopeClient.getUserSearchConditionBuilder().isNotNull("loginDate").query());
+ assertNotNull(matchedUsers);
+
+ userIds = new HashSet<>(matchedUsers.getResult().size());
+
+ for (UserTO user : matchedUsers.getResult()) {
+ userIds.add(user.getKey());
+ }
+ assertFalse(userIds.contains(1L));
+ }
+
+ @Test
+ public void checkFailedLogins() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("checkFailedLogin@syncope.apache.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+ AttrTO testAttrTO = new AttrTO();
+ testAttrTO.setSchema("testAttribute");
+ testAttrTO.getValues().add("a value");
+ membershipTO.getPlainAttrs().add(testAttrTO);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ long userId = userTO.getKey();
+
+ UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").getService(
+ UserService.class);
+ assertEquals(0, getFailedLogins(userService2, userId));
+
+ // authentications failed ...
+ UserService userService3 = clientFactory.create(userTO.getUsername(), "wrongpwd1").getService(
+ UserService.class);
+ assertReadFails(userService3, userId);
+ assertReadFails(userService3, userId);
+
+ assertEquals(2, getFailedLogins(userService, userId));
+
+ UserService userService4 = clientFactory.create(userTO.getUsername(), "password123").getService(
+ UserService.class);
+ assertEquals(0, getFailedLogins(userService4, userId));
+ }
+
+ @Test
+ public void checkUserSuspension() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("checkSuspension@syncope.apache.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+ AttrTO testAttrTO = new AttrTO();
+ testAttrTO.setSchema("testAttribute");
+ testAttrTO.getValues().add("a value");
+ membershipTO.getPlainAttrs().add(testAttrTO);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ long userId = userTO.getKey();
+ assertNotNull(userTO);
+
+ UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").
+ getService(UserService.class);
+ assertEquals(0, getFailedLogins(userService2, userId));
+
+ // authentications failed ...
+ UserService userService3 = clientFactory.create(userTO.getUsername(), "wrongpwd1").
+ getService(UserService.class);
+ assertReadFails(userService3, userId);
+ assertReadFails(userService3, userId);
+ assertReadFails(userService3, userId);
+
+ assertEquals(3, getFailedLogins(userService, userId));
+
+ // last authentication before suspension
+ assertReadFails(userService3, userId);
+
+ userTO = userService.read(userTO.getKey());
+ assertNotNull(userTO);
+ assertNotNull(userTO.getFailedLogins());
+ assertEquals(3, userTO.getFailedLogins(), 0);
+ assertEquals("suspended", userTO.getStatus());
+
+ // Access with correct credentials should fail as user is suspended
+ userService2 = clientFactory.create(userTO.getUsername(), "password123").getService(UserService.class);
+ assertReadFails(userService2, userId);
+
+ StatusMod reactivate = new StatusMod();
+ reactivate.setType(StatusMod.ModType.REACTIVATE);
+ userTO = userService.status(userTO.getKey(), reactivate).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+
+ userService2 = clientFactory.create(userTO.getUsername(), "password123").getService(UserService.class);
+ assertEquals(0, getFailedLogins(userService2, userId));
+ }
+
+ @Test
+ public void issueSYNCOPE48() {
+ // Parent role, able to create users with role 1
+ RoleTO parentRole = new RoleTO();
+ parentRole.setName("parentAdminRole" + getUUIDString());
+ parentRole.getEntitlements().add("USER_CREATE");
+ parentRole.getEntitlements().add("ROLE_1");
+ parentRole.setParent(1L);
+ parentRole = createRole(parentRole);
+ assertNotNull(parentRole);
+
+ // Child role, with no entitlements
+ RoleTO childRole = new RoleTO();
+ childRole.setName("childAdminRole");
+ childRole.setParent(parentRole.getKey());
+
+ childRole = createRole(childRole);
+ assertNotNull(childRole);
+
+ // User with child role, created by admin
+ UserTO role1Admin = UserITCase.getUniqueSampleTO("syncope48admin@apache.org");
+ role1Admin.setPassword("password");
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(childRole.getKey());
+ role1Admin.getMemberships().add(membershipTO);
+
+ role1Admin = createUser(role1Admin);
+ assertNotNull(role1Admin);
+
+ UserService userService2 = clientFactory.create(role1Admin.getUsername(), "password").getService(
+ UserService.class);
+
+ // User with role 1, created by user with child role created above
+ UserTO role1User = UserITCase.getUniqueSampleTO("syncope48user@apache.org");
+ membershipTO = new MembershipTO();
+ membershipTO.setRoleId(1L);
+ role1User.getMemberships().add(membershipTO);
+
+ Response response = userService2.create(role1User, true);
+ assertNotNull(response);
+ role1User = response.readEntity(UserTO.class);
+ assertNotNull(role1User);
+ }
+
+ @Test
+ public void issueSYNCOPE434() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ // 1. create user with role 9 (users with role 9 are defined in workflow as subject to approval)
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(9L);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals("createApproval", userTO.getStatus());
+
+ // 2. try to authenticate: fail
+ EntitlementService myEntitlementService = clientFactory.create(userTO.getUsername(), "password123").
+ getService(EntitlementService.class);
+ try {
+ myEntitlementService.getOwnEntitlements();
+ fail();
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ // 3. approve user
+ WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
+ form = userWorkflowService.claimForm(form.getTaskId());
+ Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
+ props.get("approve").setValue(Boolean.TRUE.toString());
+ form.getProperties().clear();
+ form.getProperties().addAll(props.values());
+ userTO = userWorkflowService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+
+ // 4. try to authenticate again: success
+ assertNotNull(myEntitlementService.getOwnEntitlements());
+ }
+
+ @Test
+ public void issueSYNCOPE164() throws Exception {
+ // 1. create user with db resource
+ UserTO user = UserITCase.getUniqueSampleTO("syncope164@syncope.apache.org");
+ user.setPassword("password1");
+ user.getResources().add(RESOURCE_NAME_TESTDB);
+ user = createUser(user);
+ assertNotNull(user);
+
+ // 2. unlink the resource from the created user
+ assertNotNull(userService.bulkDeassociation(user.getKey(),
+ ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(RESOURCE_NAME_TESTDB, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ // 3. change password on Syncope
+ UserMod userMod = new UserMod();
+ userMod.setKey(user.getKey());
+ userMod.setPassword("password2");
+ user = updateUser(userMod);
+ assertNotNull(user);
+
+ // 4. check that the db resource has still the initial password value
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ String value = jdbcTemplate.queryForObject(
+ "SELECT PASSWORD FROM test WHERE ID=?", String.class, user.getUsername());
+ assertEquals(Encryptor.getInstance().encode("password1", CipherAlgorithm.SHA1), value.toUpperCase());
+
+ // 5. successfully authenticate with old (on db resource) and new (on internal storage) password values
+ user = clientFactory.create(user.getUsername(), "password1").getService(UserSelfService.class).read();
+ assertNotNull(user);
+ user = clientFactory.create(user.getUsername(), "password2").getService(UserSelfService.class).read();
+ assertNotNull(user);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java
new file mode 100644
index 0000000..81eaa4e
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.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.fit.server.reference;
+
+import org.apache.syncope.common.rest.api.service.SyncopeService;
+
+public class CamelDetector {
+
+ public static boolean isCamelEnabledForUsers(final SyncopeService syncopeService) {
+ return syncopeService.info().getUserProvisioningManager().indexOf("Camel") != -1;
+ }
+
+ public static boolean isCamelEnabledForRoles(final SyncopeService syncopeService) {
+ return syncopeService.info().getRoleProvisioningManager().indexOf("Camel") != -1;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java
new file mode 100644
index 0000000..46d813e
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java
@@ -0,0 +1,164 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.apache.syncope.fit.server.reference.AbstractITCase.syncopeService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.CamelRouteTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class CamelRouteITCase extends AbstractITCase {
+
+ @Test
+ public void userRoutes() {
+ Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
+
+ List<CamelRouteTO> userRoutes = camelRouteService.list(SubjectType.USER);
+ assertNotNull(userRoutes);
+ assertEquals(15, userRoutes.size());
+ for (CamelRouteTO route : userRoutes) {
+ assertNotNull(route.getContent());
+ }
+ }
+
+ @Test
+ public void roleRoutes() {
+ Assume.assumeTrue(CamelDetector.isCamelEnabledForRoles(syncopeService));
+
+ List<CamelRouteTO> roleRoutes = camelRouteService.list(SubjectType.ROLE);
+ assertNotNull(roleRoutes);
+ assertEquals(7, roleRoutes.size());
+ for (CamelRouteTO route : roleRoutes) {
+ assertNotNull(route.getContent());
+ }
+ }
+
+ private CamelRouteTO doUpdate(final String key, String content) {
+ CamelRouteTO route = camelRouteService.read(key);
+ route.setContent(content);
+ camelRouteService.update(route.getKey(), route);
+ //getting new route definition
+ return camelRouteService.read(key);
+ }
+
+ @Test
+ public void update() {
+ Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
+
+ CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ assertNotNull(oldRoute);
+ String routeContent = "<route id=\"createUser\">\n"
+ + " <from uri=\"direct:createUser\"/>\n"
+ + " <setProperty propertyName=\"actual\">\n"
+ + " <simple>${body}</simple>\n"
+ + " </setProperty>\n"
+ + " <doTry>\n"
+ + " <bean ref=\"uwfAdapter\" method=\"create(${body},${property.disablePwdPolicyCheck},\n"
+ + " ${property.enabled},${property.storePassword})\"/>\n"
+ + " <process ref=\"userCreateProcessor\" />\n"
+ + " <to uri=\"direct:createPort\"/>\n"
+ + " <to uri=\"log:myLog\"/>\n"
+ + " <doCatch> \n"
+ + " <exception>java.lang.RuntimeException</exception>\n"
+ + " <handled>\n"
+ + " <constant>false</constant>\n"
+ + " </handled>\n"
+ + " <to uri=\"direct:createPort\"/>\n"
+ + " </doCatch>\n"
+ + " </doTry>\n"
+ + "</route>";
+ try {
+ CamelRouteTO route = doUpdate("createUser", routeContent);
+ assertEquals(routeContent, route.getContent());
+ } finally {
+ doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ }
+ }
+
+ @Test
+ public void scriptingUpdate() {
+ Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
+
+ CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ //updating route content including new attribute management
+ String routeContent = "<route id=\"createUser\">\n"
+ + " <from uri=\"direct:createUser\"/>\n"
+ + " <setProperty propertyName=\"actual\">\n"
+ + " <simple>${body}</simple>\n"
+ + " </setProperty>\n"
+ + " <setBody>\n"
+ + " <groovy>\n"
+ + " request.body.getPlainAttrs().get(3).getValues().set(0,\"true\")\n"
+ + " return request.body\n"
+ + " </groovy>\n"
+ + " </setBody>\n"
+ + " <doTry>\n"
+ + " <bean ref=\"uwfAdapter\" method=\"create(${body},${property.disablePwdPolicyCheck},\n"
+ + " ${property.enabled},${property.storePassword})\"/>\n"
+ + " <process ref=\"userCreateProcessor\" />\n"
+ + " <to uri=\"direct:createPort\"/>\n"
+ + " <doCatch> \n"
+ + " <exception>java.lang.RuntimeException</exception>\n"
+ + " <handled>\n"
+ + " <constant>false</constant>\n"
+ + " </handled>\n"
+ + " <to uri=\"direct:createPort\"/>\n"
+ + " </doCatch>\n"
+ + " </doTry>\n"
+ + "</route>";
+ try {
+ doUpdate("createUser", routeContent);
+
+ //creating new schema attribute for user
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("camelAttribute");
+ schemaTO.setType(AttrSchemaType.String);
+ createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+
+ UserTO userTO = new UserTO();
+ String userId = getUUIDString() + "camelUser@syncope.apache.org";
+ userTO.setUsername(userId);
+ userTO.setPassword("password");
+ userTO.getPlainAttrs().add(attrTO("userId", userId));
+ userTO.getPlainAttrs().add(attrTO("fullname", userId));
+ userTO.getPlainAttrs().add(attrTO("surname", userId));
+ userTO.getPlainAttrs().add(attrTO("camelAttribute", "false"));
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals("true", userTO.getPlainAttrs().get(3).getValues().get(0));
+ } finally {
+ doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
new file mode 100644
index 0000000..bf35a9c
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
@@ -0,0 +1,210 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConfTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class ConfigurationITCase extends AbstractITCase {
+
+ @Test
+ public void create() {
+ PlainSchemaTO testKey = new PlainSchemaTO();
+ testKey.setKey("testKey");
+ testKey.setType(AttrSchemaType.String);
+ createSchema(AttributableType.CONFIGURATION, SchemaType.PLAIN, testKey);
+
+ AttrTO conf = new AttrTO();
+ conf.setSchema("testKey");
+ conf.getValues().add("testValue");
+
+ configurationService.set(conf.getSchema(), conf);
+
+ AttrTO actual = configurationService.read(conf.getSchema());
+ assertEquals(actual, conf);
+ }
+
+ @Test
+ public void delete() throws UnsupportedEncodingException {
+ try {
+ configurationService.delete("nonExistent");
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+
+ AttrTO tokenLength = configurationService.read("token.length");
+
+ configurationService.delete("token.length");
+ try {
+ configurationService.read("token.length");
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+
+ configurationService.set(tokenLength.getSchema(), tokenLength);
+
+ AttrTO actual = configurationService.read(tokenLength.getSchema());
+ assertEquals(actual, tokenLength);
+ }
+
+ @Test
+ public void list() {
+ ConfTO wholeConf = configurationService.list();
+ assertNotNull(wholeConf);
+ for (AttrTO conf : wholeConf.getPlainAttrs()) {
+ assertNotNull(conf);
+ }
+ }
+
+ @Test
+ public void read() {
+ AttrTO conf = configurationService.read("token.expireTime");
+ assertNotNull(conf);
+ }
+
+ @Test
+ public void update() {
+ AttrTO expireTime = configurationService.read("token.expireTime");
+ int value = Integer.parseInt(expireTime.getValues().get(0));
+ value++;
+ expireTime.getValues().set(0, value + "");
+
+ configurationService.set(expireTime.getSchema(), expireTime);
+
+ AttrTO newConfigurationTO = configurationService.read(expireTime.getSchema());
+ assertEquals(expireTime, newConfigurationTO);
+ }
+
+ @Test
+ public void dbExport() throws IOException {
+ Response response = configurationService.export();
+ assertNotNull(response);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
+ assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
+ String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
+ assertNotNull(contentDisposition);
+
+ Object entity = response.getEntity();
+ assertTrue(entity instanceof InputStream);
+ String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
+ assertFalse(configExport.isEmpty());
+ assertTrue(configExport.length() > 1000);
+ }
+
+ @Test
+ public void issueSYNCOPE418() {
+ PlainSchemaTO failing = new PlainSchemaTO();
+ failing.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
+ failing.setType(AttrSchemaType.String);
+
+ try {
+ createSchema(AttributableType.CONFIGURATION, SchemaType.PLAIN, failing);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+
+ assertNotNull(e.getElements());
+ assertEquals(1, e.getElements().size());
+ assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE629() throws IOException {
+ PlainSchemaTO membershipKey = new PlainSchemaTO();
+ membershipKey.setKey("membershipKey" + getUUIDString());
+ membershipKey.setType(AttrSchemaType.String);
+ createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, membershipKey);
+
+ PlainSchemaTO roleKey = new PlainSchemaTO();
+ roleKey.setKey("roleKey" + getUUIDString());
+ roleKey.setType(AttrSchemaType.String);
+ createSchema(AttributableType.ROLE, SchemaType.PLAIN, roleKey);
+
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName("aRole" + getUUIDString());
+ roleTO.getMAttrTemplates().add(membershipKey.getKey());
+ roleTO.getRAttrTemplates().add(roleKey.getKey());
+ roleTO = createRole(roleTO);
+
+ try {
+ Response response = configurationService.export();
+ assertNotNull(response);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
+ assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
+ String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
+ assertNotNull(contentDisposition);
+
+ Object entity = response.getEntity();
+ assertTrue(entity instanceof InputStream);
+ String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
+ assertFalse(configExport.isEmpty());
+ assertTrue(configExport.length() > 1000);
+
+ String[] result = StringUtils.substringsBetween(configExport, "<RPLAINATTRTEMPLATE", "/>");
+ assertNotNull(result);
+ boolean rattrExists = false;
+ for (String entry : result) {
+ if (entry.contains(roleKey.getKey())) {
+ rattrExists = true;
+ }
+ }
+ assertTrue(rattrExists);
+
+ result = StringUtils.substringsBetween(configExport, "<MPLAINATTRTEMPLATE", "/>");
+ assertNotNull(result);
+ boolean mattrExists = false;
+ for (String entry : result) {
+ if (entry.contains(membershipKey.getKey())) {
+ mattrExists = true;
+ }
+ }
+ assertTrue(mattrExists);
+ } finally {
+ deleteRole(roleTO.getKey());
+ }
+ }
+}
[51/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
index 5600152..bc4357d 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
@@ -24,7 +24,7 @@ import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvid
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
-public class SortableDataProviderComparator<T extends Object> implements Comparator<T>, Serializable {
+public class SortableDataProviderComparator<T> implements Comparator<T>, Serializable {
private static final long serialVersionUID = -8897687699977460543L;
@@ -58,8 +58,8 @@ public class SortableDataProviderComparator<T extends Object> implements Compara
@SuppressWarnings("rawtypes")
@Override
public int compare(final T object1, final T object2) {
- IModel<Comparable> model1 = new PropertyModel<Comparable>(object1, provider.getSort().getProperty());
- IModel<Comparable> model2 = new PropertyModel<Comparable>(object2, provider.getSort().getProperty());
+ IModel<Comparable> model1 = new PropertyModel<>(object1, provider.getSort().getProperty());
+ IModel<Comparable> model2 = new PropertyModel<>(object2, provider.getSort().getProperty());
return compare(model1, model2);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
index 8d59e25..3c0e56e 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
@@ -40,6 +40,7 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.request.resource.ContextRelativeResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +53,7 @@ public class StatusUtils implements Serializable {
*/
private static final Logger LOG = LoggerFactory.getLogger(StatusUtils.class);
- public static final String IMG_STATUES = "../statuses/";
+ private static final String IMG_PREFIX = "/img/statuses/";
private final AbstractSubjectRestClient restClient;
@@ -102,7 +103,7 @@ public class StatusUtils implements Serializable {
final String resourceName,
final ConnObjectTO objectTO,
final boolean isRole) {
-
+
final StatusBean statusBean = new StatusBean(attributable, resourceName);
if (objectTO != null) {
@@ -111,8 +112,8 @@ public class StatusUtils implements Serializable {
final Status status = enabled == null
? (isRole ? Status.ACTIVE : Status.UNDEFINED)
: enabled
- ? Status.ACTIVE
- : Status.SUSPENDED;
+ ? Status.ACTIVE
+ : Status.SUSPENDED;
final String accountLink = getAccountLink(objectTO);
@@ -177,7 +178,7 @@ public class StatusUtils implements Serializable {
final Collection<String> resourcesToRemove) {
if (statusPanel != null) {
- Map<String, StatusBean> statusMap = new LinkedHashMap<String, StatusBean>();
+ Map<String, StatusBean> statusMap = new LinkedHashMap<>();
for (StatusBean statusBean : statusPanel.getStatusBeans()) {
statusMap.put(statusBean.getResourceName(), statusBean);
}
@@ -200,7 +201,7 @@ public class StatusUtils implements Serializable {
statusMap.remove(resource);
}
- statusPanel.updateStatusBeans(new ArrayList<StatusBean>(statusMap.values()));
+ statusPanel.updateStatusBeans(new ArrayList<>(statusMap.values()));
target.add(statusPanel);
}
}
@@ -254,8 +255,8 @@ public class StatusUtils implements Serializable {
title = "Disabled";
}
- final Image img = new Image(componentId, IMG_STATUES + statusName + Constants.PNG_EXT);
-
+ final Image img = new Image(componentId,
+ new ContextRelativeResource(IMG_PREFIX + statusName + Constants.PNG_EXT));
img.add(new Behavior() {
private static final long serialVersionUID = 1469628524240283489L;
@@ -305,7 +306,8 @@ public class StatusUtils implements Serializable {
title = "Disabled";
}
- final ImagePanel imagePanel = new ImagePanel(componentId, IMG_STATUES + statusName + Constants.PNG_EXT);
+ final ImagePanel imagePanel = new ImagePanel(componentId,
+ new ContextRelativeResource(IMG_PREFIX + statusName + Constants.PNG_EXT));
imagePanel.add(new Behavior() {
private static final long serialVersionUID = 1469628524240283489L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/BinaryPreviewersLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/BinaryPreviewersLoader.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/BinaryPreviewersLoader.java
new file mode 100644
index 0000000..fd5bc35
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/BinaryPreviewersLoader.java
@@ -0,0 +1,71 @@
+/*
+ * 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.init;
+
+import java.util.List;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.syncope.client.console.preview.BinaryPreview;
+import org.apache.syncope.client.console.preview.PreviewerClassScanner;
+import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class BinaryPreviewersLoader implements SyncopeConsoleLoader {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(BinaryPreviewersLoader.class);
+
+ @Autowired
+ private PreviewerClassScanner classScanner;
+
+ private List<Class<? extends AbstractBinaryPreviewer>> classes;
+
+ @Override
+ public Integer getPriority() {
+ return 0;
+ }
+
+ @Override
+ public void load() {
+ classes = classScanner.getComponentClasses();
+ }
+
+ public List<Class<? extends AbstractBinaryPreviewer>> getClasses() {
+ LOG.debug("Returning loaded classes: {}", classes);
+ return classes;
+ }
+
+ public Class<? extends AbstractBinaryPreviewer> getClass(final String mimeType) {
+ LOG.debug("Searching for previewer class for MIME type: {}", mimeType);
+ Class<? extends AbstractBinaryPreviewer> previewer = null;
+ for (Class<? extends AbstractBinaryPreviewer> candidate : classes) {
+ LOG.debug("Evaluating previewer class {} for MIME type {}", candidate.getName(), mimeType);
+ if (ArrayUtils.contains(candidate.getAnnotation(BinaryPreview.class).mimeTypes(), mimeType)) {
+ LOG.debug("Found existing previewer for MIME type {}: {}", mimeType, candidate.getName());
+ previewer = candidate;
+ }
+ }
+ return previewer;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
new file mode 100644
index 0000000..ec51d3e
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
@@ -0,0 +1,72 @@
+/*
+ * 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.init;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.aop.support.AopUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * Take care of all initializations needed by Syncope Console to run up and safe.
+ */
+@Component
+public class ConsoleInitializer implements InitializingBean, BeanFactoryAware {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ConsoleInitializer.class);
+
+ private DefaultListableBeanFactory beanFactory;
+
+ @Override
+ public void setBeanFactory(final BeanFactory beanFactory) throws BeansException {
+ this.beanFactory = (DefaultListableBeanFactory) beanFactory;
+ }
+
+ @Override
+ public void afterPropertiesSet() {
+ Map<String, SyncopeConsoleLoader> loaderMap = beanFactory.getBeansOfType(SyncopeConsoleLoader.class);
+
+ List<SyncopeConsoleLoader> loaders = new ArrayList<>(loaderMap.values());
+ Collections.sort(loaders, new Comparator<SyncopeConsoleLoader>() {
+
+ @Override
+ public int compare(final SyncopeConsoleLoader o1, final SyncopeConsoleLoader o2) {
+ return o1.getPriority().compareTo(o2.getPriority());
+ }
+ });
+
+ LOG.debug("Starting initialization...");
+ for (SyncopeConsoleLoader loader : loaders) {
+ LOG.debug("Invoking {} with priority {}", AopUtils.getTargetClass(loader).getName(), loader.getPriority());
+ loader.load();
+ }
+ LOG.debug("Initialization completed");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java
deleted file mode 100644
index b52991a..0000000
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java
+++ /dev/null
@@ -1,63 +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.init;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.wicket.util.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Component
-public class MIMETypesInitializer {
-
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(MIMETypesInitializer.class);
-
- private List<String> mimeTypes;
-
- public void load() {
- final Set<String> mediaTypes = new HashSet<>();
- this.mimeTypes = new ArrayList<>();
- try {
- final String mimeTypesFile = IOUtils.toString(getClass().getResourceAsStream("/MIMETypes"));
- for (String fileRow : mimeTypesFile.split("\n")) {
- if (StringUtils.isNotBlank(fileRow) && !fileRow.startsWith("#")) {
- mediaTypes.add(fileRow);
- }
- }
- this.mimeTypes.addAll(mediaTypes);
- Collections.sort(this.mimeTypes);
- } catch (Exception e) {
- LOG.error("Error reading file MIMETypes from resources", e);
- }
- }
-
- public List<String> getMimeTypes() {
- LOG.debug("Returning loaded MIME types list");
- return mimeTypes;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
new file mode 100644
index 0000000..7a2f878
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
@@ -0,0 +1,69 @@
+/*
+ * 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.init;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MIMETypesLoader implements SyncopeConsoleLoader {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(MIMETypesLoader.class);
+
+ private List<String> mimeTypes;
+
+ @Override
+ public Integer getPriority() {
+ return 10;
+ }
+
+ @Override
+ public void load() {
+ final Set<String> mediaTypes = new HashSet<>();
+ this.mimeTypes = new ArrayList<>();
+ try {
+ final String mimeTypesFile = IOUtils.toString(getClass().getResourceAsStream("/MIMETypes"));
+ for (String fileRow : mimeTypesFile.split("\n")) {
+ if (StringUtils.isNotBlank(fileRow) && !fileRow.startsWith("#")) {
+ mediaTypes.add(fileRow);
+ }
+ }
+ this.mimeTypes.addAll(mediaTypes);
+ Collections.sort(this.mimeTypes);
+ } catch (Exception e) {
+ LOG.error("Error reading file MIMETypes from resources", e);
+ }
+ }
+
+ public List<String> getMimeTypes() {
+ LOG.debug("Returning loaded MIME types list {}", mimeTypes);
+ return mimeTypes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java
deleted file mode 100644
index 11739be..0000000
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java
+++ /dev/null
@@ -1,69 +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.init;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.syncope.client.console.preview.BinaryPreview;
-import org.apache.syncope.client.console.preview.PreviewerClassScanner;
-import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class PreviewPanelClassInitializer {
-
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(PreviewPanelClassInitializer.class);
-
- @Autowired
- private PreviewerClassScanner classScanner;
-
- private List<Class<? extends AbstractBinaryPreviewer>> classes;
-
- public void load() {
- classes = new ArrayList<Class<? extends AbstractBinaryPreviewer>>();
- for (Class<? extends AbstractBinaryPreviewer> candidate : classScanner.getComponentClasses()) {
- classes.add(candidate);
- }
- }
-
- public List<Class<? extends AbstractBinaryPreviewer>> getClasses() {
- LOG.debug("Returning loaded classes: {}", classes);
- return classes;
- }
-
- public Class<? extends AbstractBinaryPreviewer> getClass(final String mimeType) {
- LOG.debug("Searching for previewer class for MIME type: {}", mimeType);
- Class<? extends AbstractBinaryPreviewer> previewer = null;
- for (Class<? extends AbstractBinaryPreviewer> candidate : classes) {
- LOG.debug("Evaluating previewer class {} for MIME type {}", candidate.getName(), mimeType);
- if (Arrays.asList(candidate.getAnnotation(BinaryPreview.class).mimeTypes()).contains(mimeType)) {
- LOG.debug("Found existing previewer for MIME type {}: {}", mimeType, candidate.getName());
- previewer = candidate;
- }
- }
- return previewer;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java
deleted file mode 100644
index 116f82c..0000000
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java
+++ /dev/null
@@ -1,45 +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.init;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Configurable;
-import org.springframework.stereotype.Component;
-
-/**
- * Take care of all initializations needed by Syncope Console to run up and safe.
- */
-@Component
-@Configurable
-public class SpringContextInitializer implements InitializingBean {
-
- @Autowired
- private PreviewPanelClassInitializer previewPanelClassInitializer;
-
- @Autowired
- private MIMETypesInitializer mimeTypesInitializer;
-
- @Override
- public void afterPropertiesSet() {
- previewPanelClassInitializer.load();
- mimeTypesInitializer.load();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java
new file mode 100644
index 0000000..7c4d3d4
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java
@@ -0,0 +1,35 @@
+/*
+ * 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.init;
+
+/**
+ * Marker interface for Syncope console initialization.
+ */
+public interface SyncopeConsoleLoader {
+
+ /**
+ * @return the priority that the implementing class has in the initialization process.
+ */
+ Integer getPriority();
+
+ /**
+ * Perform initialization operations.
+ */
+ void load();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
index ca330d8..4a32700 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
@@ -20,7 +20,7 @@ package org.apache.syncope.client.console.pages;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.XMLRolesReader;
-import org.apache.syncope.client.console.init.MIMETypesInitializer;
+import org.apache.syncope.client.console.init.MIMETypesLoader;
import org.apache.syncope.client.console.panels.NotificationPanel;
import org.apache.syncope.client.console.rest.ConfigurationRestClient;
import org.apache.syncope.client.console.rest.ReportRestClient;
@@ -59,8 +59,6 @@ public class AbstractBasePage extends WebPage {
protected static final String APPLY = "apply";
- protected static final String NAME = "name";
-
protected final HeaderItem meta = new MetaHeaderItem("X-UA-Compatible", "IE=edge");
@SpringBean
@@ -91,7 +89,7 @@ public class AbstractBasePage extends WebPage {
protected ConfigurationRestClient confRestClient;
@SpringBean
- protected MIMETypesInitializer mimeTypesInitializer;
+ protected MIMETypesLoader mimeTypesInitializer;
protected NotificationPanel feedbackPanel;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
index 5cc8885..78ca906 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
@@ -116,11 +116,11 @@ public abstract class AbstractSchedTaskModalPage extends TaskModalPage {
cancel.setDefaultFormProcessing(false);
if (taskTO.getKey() > 0) {
- MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getEntitlement(TASKS,
- "update"));
+ MetaDataRoleAuthorizationStrategy.authorize(
+ submit, RENDER, xmlRolesReader.getEntitlement(TASKS, "update"));
} else {
- MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getEntitlement(TASKS,
- "create"));
+ MetaDataRoleAuthorizationStrategy.authorize(
+ submit, RENDER, xmlRolesReader.getEntitlement(TASKS, "create"));
}
form.add(submit);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
index 0733f63..95e514b 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
@@ -74,13 +74,13 @@ public class BulkActionModalPage<T, S> extends BaseModalPage {
@Override
public IModel<T> model(final T object) {
- return new CompoundPropertyModel<T>(object);
+ return new CompoundPropertyModel<>(object);
}
};
- add(new AjaxFallbackDefaultDataTable<T, S>(
+ add(new AjaxFallbackDefaultDataTable<>(
"selectedObjects",
- new ArrayList<IColumn<T, S>>(columns.subList(1, columns.size() - 1)),
+ new ArrayList<>(columns.subList(1, columns.size() - 1)),
dataProvider,
Integer.MAX_VALUE).setVisible(items != null && !items.isEmpty()));
@@ -139,7 +139,7 @@ public class BulkActionModalPage<T, S> extends BaseModalPage {
}, action, pageId, !items.isEmpty());
}
- final Form<Void> form = new Form<Void>(FORM);
+ final Form<Void> form = new Form<>(FORM);
add(form);
final AjaxButton cancel =
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
index b52864d..ea964d8 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
@@ -324,9 +324,9 @@ public class Configuration extends BasePage {
private void setupNotification() {
notificationPaginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_NOTIFICATION_PAGINATOR_ROWS);
- final List<IColumn<NotificationTO, String>> notificationCols = new ArrayList<IColumn<NotificationTO, String>>();
+ final List<IColumn<NotificationTO, String>> notificationCols = new ArrayList<>();
notificationCols.add(new PropertyColumn<NotificationTO, String>(
- new ResourceModel("id"), "id", "id"));
+ new ResourceModel("key"), "key", "key"));
notificationCols.add(new CollectionPropertyColumn<NotificationTO>(
new ResourceModel("events"), "events", "events"));
notificationCols.add(new PropertyColumn<NotificationTO, String>(
@@ -464,10 +464,9 @@ public class Configuration extends BasePage {
}
private void setupSecurityQuestion() {
- final List<IColumn<SecurityQuestionTO, String>> securityQuestionCols =
- new ArrayList<IColumn<SecurityQuestionTO, String>>();
+ final List<IColumn<SecurityQuestionTO, String>> securityQuestionCols = new ArrayList<>();
securityQuestionCols.add(new PropertyColumn<SecurityQuestionTO, String>(
- new ResourceModel("id"), "id", "id"));
+ new ResourceModel("key"), "key", "key"));
securityQuestionCols.add(new PropertyColumn<SecurityQuestionTO, String>(
new ResourceModel("content"), "content", "content"));
@@ -581,7 +580,7 @@ public class Configuration extends BasePage {
public NotificationProvider() {
//Default sorting
- setSort("id", SortOrder.ASCENDING);
+ setSort("key", SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<NotificationTO>(this);
}
@@ -621,8 +620,8 @@ public class Configuration extends BasePage {
public SecurityQuestionProvider() {
//Default sorting
- setSort("id", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<SecurityQuestionTO>(this);
+ setSort("key", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
}
@Override
@@ -668,9 +667,9 @@ public class Configuration extends BasePage {
@Override
protected void populateItem(final ListItem<LoggerTO> item) {
- item.add(new Label("name"));
+ item.add(new Label("key"));
- DropDownChoice<LoggerLevel> level = new DropDownChoice<LoggerLevel>("level");
+ DropDownChoice<LoggerLevel> level = new DropDownChoice<>("level");
level.setModel(new IModel<LoggerLevel>() {
private static final long serialVersionUID = -2350428186089596562L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
index 529a55a..8095591 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
@@ -48,6 +48,7 @@ import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDa
import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.CheckBoxMultipleChoice;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
@@ -86,12 +87,19 @@ public class ConnectorModalPage extends BaseModalPage {
super();
+ this.add(new Label("new", connInstanceTO.getKey() == 0
+ ? new ResourceModel("new")
+ : new Model<>(StringUtils.EMPTY)));
+ this.add(new Label("key", connInstanceTO.getKey() == 0
+ ? StringUtils.EMPTY
+ : connInstanceTO.getKey()));
+
// general data setup
- selectedCapabilities = new ArrayList<ConnectorCapability>(connInstanceTO.getKey() == 0
+ selectedCapabilities = new ArrayList<>(connInstanceTO.getKey() == 0
? EnumSet.noneOf(ConnectorCapability.class)
: connInstanceTO.getCapabilities());
- mapConnBundleTOs = new HashMap<String, Map<String, Map<String, ConnBundleTO>>>();
+ mapConnBundleTOs = new HashMap<>();
for (ConnBundleTO connBundleTO : restClient.getAllBundles()) {
// by location
if (!mapConnBundleTOs.containsKey(connBundleTO.getLocation())) {
@@ -115,8 +123,8 @@ public class ConnectorModalPage extends BaseModalPage {
properties = fillProperties(bundleTO, connInstanceTO);
// form - first tab
- final Form<ConnInstanceTO> connectorForm = new Form<ConnInstanceTO>(FORM);
- connectorForm.setModel(new CompoundPropertyModel<ConnInstanceTO>(connInstanceTO));
+ final Form<ConnInstanceTO> connectorForm = new Form<>(FORM);
+ connectorForm.setModel(new CompoundPropertyModel<>(connInstanceTO));
connectorForm.setOutputMarkupId(true);
add(connectorForm);
@@ -124,8 +132,8 @@ public class ConnectorModalPage extends BaseModalPage {
propertiesContainer.setOutputMarkupId(true);
connectorForm.add(propertiesContainer);
- final Form<ConnInstanceTO> connectorPropForm = new Form<ConnInstanceTO>("connectorPropForm");
- connectorPropForm.setModel(new CompoundPropertyModel<ConnInstanceTO>(connInstanceTO));
+ final Form<ConnInstanceTO> connectorPropForm = new Form<>("connectorPropForm");
+ connectorPropForm.setModel(new CompoundPropertyModel<>(connInstanceTO));
connectorPropForm.setOutputMarkupId(true);
propertiesContainer.add(connectorPropForm);
@@ -165,7 +173,7 @@ public class ConnectorModalPage extends BaseModalPage {
connectorForm.add(connectorName);
final AjaxDropDownChoicePanel<String> version =
- new AjaxDropDownChoicePanel<String>("version", "version",
+ new AjaxDropDownChoicePanel<>("version", "version",
new Model<>(bundleTO == null ? null : bundleTO.getVersion()));
version.setStyleSheet("long_dynamicsize");
version.setChoices(bundleTO == null
@@ -181,39 +189,39 @@ public class ConnectorModalPage extends BaseModalPage {
connectorForm.add(version);
final SpinnerFieldPanel<Integer> connRequestTimeout =
- new SpinnerFieldPanel<Integer>("connRequestTimeout", "connRequestTimeout", Integer.class,
+ new SpinnerFieldPanel<>("connRequestTimeout", "connRequestTimeout", Integer.class,
new PropertyModel<Integer>(connInstanceTO, "connRequestTimeout"), 0, null);
- connRequestTimeout.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ connRequestTimeout.getField().add(new RangeValidator<>(0, Integer.MAX_VALUE));
connectorForm.add(connRequestTimeout);
if (connInstanceTO.getPoolConf() == null) {
connInstanceTO.setPoolConf(new ConnPoolConfTO());
}
final SpinnerFieldPanel<Integer> poolMaxObjects =
- new SpinnerFieldPanel<Integer>("poolMaxObjects", "poolMaxObjects", Integer.class,
+ new SpinnerFieldPanel<>("poolMaxObjects", "poolMaxObjects", Integer.class,
new PropertyModel<Integer>(connInstanceTO.getPoolConf(), "maxObjects"), 0, null);
- poolMaxObjects.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ poolMaxObjects.getField().add(new RangeValidator<>(0, Integer.MAX_VALUE));
connectorForm.add(poolMaxObjects);
final SpinnerFieldPanel<Integer> poolMinIdle =
- new SpinnerFieldPanel<Integer>("poolMinIdle", "poolMinIdle", Integer.class,
+ new SpinnerFieldPanel<>("poolMinIdle", "poolMinIdle", Integer.class,
new PropertyModel<Integer>(connInstanceTO.getPoolConf(), "minIdle"), 0, null);
- poolMinIdle.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ poolMinIdle.getField().add(new RangeValidator<>(0, Integer.MAX_VALUE));
connectorForm.add(poolMinIdle);
final SpinnerFieldPanel<Integer> poolMaxIdle =
- new SpinnerFieldPanel<Integer>("poolMaxIdle", "poolMaxIdle", Integer.class,
+ new SpinnerFieldPanel<>("poolMaxIdle", "poolMaxIdle", Integer.class,
new PropertyModel<Integer>(connInstanceTO.getPoolConf(), "maxIdle"), 0, null);
- poolMaxIdle.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ poolMaxIdle.getField().add(new RangeValidator<>(0, Integer.MAX_VALUE));
connectorForm.add(poolMaxIdle);
final SpinnerFieldPanel<Long> poolMaxWait =
- new SpinnerFieldPanel<Long>("poolMaxWait", "poolMaxWait", Long.class,
+ new SpinnerFieldPanel<>("poolMaxWait", "poolMaxWait", Long.class,
new PropertyModel<Long>(connInstanceTO.getPoolConf(), "maxWait"), 0L, null);
- poolMaxWait.getField().add(new RangeValidator<Long>(0L, Long.MAX_VALUE));
+ poolMaxWait.getField().add(new RangeValidator<>(0L, Long.MAX_VALUE));
connectorForm.add(poolMaxWait);
final SpinnerFieldPanel<Long> poolMinEvictableIdleTime =
- new SpinnerFieldPanel<Long>("poolMinEvictableIdleTime", "poolMinEvictableIdleTime", Long.class,
+ new SpinnerFieldPanel<>("poolMinEvictableIdleTime", "poolMinEvictableIdleTime", Long.class,
new PropertyModel<Long>(connInstanceTO.getPoolConf(), "minEvictableIdleTimeMillis"),
0L, null);
- poolMinEvictableIdleTime.getField().add(new RangeValidator<Long>(0L, Long.MAX_VALUE));
+ poolMinEvictableIdleTime.getField().add(new RangeValidator<>(0L, Long.MAX_VALUE));
connectorForm.add(poolMinEvictableIdleTime);
// form - first tab - onchange()
@@ -227,7 +235,7 @@ public class ConnectorModalPage extends BaseModalPage {
connInstanceTO.setLocation(location.getModelObject());
target.add(location);
- connectorName.setChoices(new ArrayList<String>(
+ connectorName.setChoices(new ArrayList<>(
mapConnBundleTOs.get(location.getModelObject()).keySet()));
connectorName.setEnabled(true);
connectorName.getField().setModelValue(null);
@@ -252,7 +260,7 @@ public class ConnectorModalPage extends BaseModalPage {
connInstanceTO.setBundleName(connectorName.getModelObject());
target.add(connectorName);
- List<String> versions = new ArrayList<String>(
+ List<String> versions = new ArrayList<>(
mapConnBundleTOs.get(location.getModelObject()).get(connectorName.getModelObject()).keySet());
version.setChoices(versions);
version.setEnabled(true);
@@ -320,7 +328,7 @@ public class ConnectorModalPage extends BaseModalPage {
}
};
CheckBoxMultipleChoice<ConnectorCapability> capabilitiesPalette =
- new CheckBoxMultipleChoice<ConnectorCapability>("capabilitiesPalette",
+ new CheckBoxMultipleChoice<>("capabilitiesPalette",
new PropertyModel<List<ConnectorCapability>>(this, "selectedCapabilities"), capabilities);
capabilitiesPalette.add(new AjaxFormChoiceComponentUpdatingBehavior() {
@@ -335,7 +343,7 @@ public class ConnectorModalPage extends BaseModalPage {
connectorForm.add(capabilitiesPalette);
// form - submit / cancel buttons
- final AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT))) {
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<>(getString(SUBMIT))) {
private static final long serialVersionUID = -958724007591692537L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
index fd948b1..98f4fbb 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
@@ -56,12 +56,12 @@ public class DerSchemaModalPage extends AbstractSchemaModalPage<DerSchemaTO> {
schema = new DerSchemaTO();
}
- final Form<DerSchemaTO> schemaForm = new Form<DerSchemaTO>(FORM);
+ final Form<DerSchemaTO> schemaForm = new Form<>(FORM);
- schemaForm.setModel(new CompoundPropertyModel<DerSchemaTO>(schema));
+ schemaForm.setModel(new CompoundPropertyModel<>(schema));
- final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
- schema, "name"));
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<String>(schema, "key"));
name.addRequiredLabel();
final AjaxTextFieldPanel expression = new AjaxTextFieldPanel("expression", getString("expression"),
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
index 3de8efe..6f89ec3 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
@@ -57,14 +57,14 @@ public class DisplayAttributesModalPage extends BaseModalPage {
*/
private static final int MAX_SELECTIONS = 9;
- public static final String[] DEFAULT_SELECTION = { "id", "username", "status" };
+ public static final String[] DEFAULT_SELECTION = { "key", "username", "status" };
@SpringBean
private PreferenceManager prefMan;
private final List<String> selectedDetails;
- private final List<String> selectedSchemas;
+ private final List<String> selectedPlainSchemas;
private final List<String> selectedDerSchemas;
@@ -120,7 +120,7 @@ public class DisplayAttributesModalPage extends BaseModalPage {
selectedDetails = prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW);
- selectedSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW);
+ selectedPlainSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW);
selectedDerSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW);
@@ -142,23 +142,23 @@ public class DisplayAttributesModalPage extends BaseModalPage {
dgroup.add(details);
if (names.getObject() == null || names.getObject().isEmpty()) {
- final Fragment fragment = new Fragment("schemas", "emptyFragment", form);
+ final Fragment fragment = new Fragment("plainSchemas", "emptyFragment", form);
form.add(fragment);
- selectedSchemas.clear();
+ selectedPlainSchemas.clear();
} else {
- final Fragment fragment = new Fragment("schemas", "sfragment", form);
+ final Fragment fragment = new Fragment("plainSchemas", "sfragment", form);
form.add(fragment);
- final CheckGroup sgroup = new CheckGroup("sCheckGroup", new PropertyModel(this, "selectedSchemas"));
+ final CheckGroup sgroup = new CheckGroup("psCheckGroup", new PropertyModel(this, "selectedPlainSchemas"));
fragment.add(sgroup);
- final ListView<String> schemas = new ListView<String>("schemas", names) {
+ final ListView<String> schemas = new ListView<String>("plainSchemas", names) {
private static final long serialVersionUID = 9101744072914090143L;
@Override
- protected void populateItem(ListItem<String> item) {
+ protected void populateItem(final ListItem<String> item) {
item.add(new Check("scheck", item.getModel()));
item.add(new Label("sname", new ResourceModel(item.getModelObject(), item.getModelObject())));
}
@@ -222,7 +222,7 @@ public class DisplayAttributesModalPage extends BaseModalPage {
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- if (selectedDetails.size() + selectedSchemas.size() + selectedVirSchemas.size() + selectedDerSchemas.
+ if (selectedDetails.size() + selectedPlainSchemas.size() + selectedVirSchemas.size() + selectedDerSchemas.
size()
> MAX_SELECTIONS) {
@@ -233,7 +233,7 @@ public class DisplayAttributesModalPage extends BaseModalPage {
prefs.put(Constants.PREF_USERS_DETAILS_VIEW, selectedDetails);
- prefs.put(Constants.PREF_USERS_ATTRIBUTES_VIEW, selectedSchemas);
+ prefs.put(Constants.PREF_USERS_ATTRIBUTES_VIEW, selectedPlainSchemas);
prefs.put(Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW, selectedDerSchemas);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
index cb342ae..782c907 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
@@ -416,7 +416,7 @@ class NotificationModalPage extends BaseModalPage {
} else {
switch (type) {
case UserPlainSchema:
- result = schemaRestClient.getSchemaNames(AttributableType.USER);
+ result = schemaRestClient.getPlainSchemaNames(AttributableType.USER);
break;
case UserDerivedSchema:
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
index 869f3a6..bad0ae7 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
@@ -81,7 +81,7 @@ public class PlainSchemaModalPage extends AbstractSchemaModalPage<PlainSchemaTO>
schemaForm.setOutputMarkupId(true);
final AjaxTextFieldPanel name =
- new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(schema, "name"));
+ new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<String>(schema, "key"));
name.addRequiredLabel();
name.setEnabled(createFlag);
schemaForm.add(name);
@@ -255,9 +255,9 @@ public class PlainSchemaModalPage extends AbstractSchemaModalPage<PlainSchemaTO>
try {
if (createFlag) {
- schemaRestClient.createSchema(kind, schemaTO);
+ schemaRestClient.createPlainSchema(kind, schemaTO);
} else {
- schemaRestClient.updateSchema(kind, schemaTO);
+ schemaRestClient.updatePlainSchema(kind, schemaTO);
}
if (pageRef.getPage() instanceof BasePage) {
((BasePage) pageRef.getPage()).setModalResult(true);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
index 70b646c..efa61c1 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
@@ -86,12 +86,12 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage {
public PolicyModalPage(final PageReference pageRef, final ModalWindow window, final T policyTO) {
super();
- final Form<?> form = new Form<Void>(FORM);
+ final Form<?> form = new Form<>(FORM);
form.setOutputMarkupId(true);
add(form);
- final AjaxTextFieldPanel policyid = new AjaxTextFieldPanel("id", "id",
- new PropertyModel<String>(policyTO, "id"));
+ final AjaxTextFieldPanel policyid =
+ new AjaxTextFieldPanel("key", "key", new PropertyModel<String>(policyTO, "key"));
policyid.setEnabled(false);
policyid.setStyleSheet("ui-widget-content ui-corner-all short_fixedsize");
form.add(policyid);
@@ -102,8 +102,8 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage {
description.setStyleSheet("ui-widget-content ui-corner-all medium_dynamicsize");
form.add(description);
- final AjaxDropDownChoicePanel<PolicyType> type = new AjaxDropDownChoicePanel<PolicyType>("type", "type",
- new PropertyModel<PolicyType>(policyTO, "type"));
+ final AjaxDropDownChoicePanel<PolicyType> type =
+ new AjaxDropDownChoicePanel<>("type", "type", new PropertyModel<PolicyType>(policyTO, "type"));
switch (policyTO.getType()) {
case GLOBAL_ACCOUNT:
case ACCOUNT:
@@ -154,7 +154,7 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage {
mwindow.setCookieName("meta-edit-modal");
add(mwindow);
- List<IColumn<String, String>> resColumns = new ArrayList<IColumn<String, String>>();
+ List<IColumn<String, String>> resColumns = new ArrayList<>();
resColumns.add(new AbstractColumn<String, String>(new StringResourceModel("name", this, null, "")) {
private static final long serialVersionUID = 2054811145491901166L;
@@ -228,15 +228,15 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage {
@Override
public IModel<String> model(final String object) {
- return new Model<String>(object);
+ return new Model<>(object);
}
};
final AjaxFallbackDefaultDataTable<String, String> resources =
- new AjaxFallbackDefaultDataTable<String, String>("resources", resColumns, resDataProvider, 10);
+ new AjaxFallbackDefaultDataTable<>("resources", resColumns, resDataProvider, 10);
form.add(resources);
- List<IColumn<RoleTO, String>> roleColumns = new ArrayList<IColumn<RoleTO, String>>();
- roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("id", "id"), "id", "id"));
+ List<IColumn<RoleTO, String>> roleColumns = new ArrayList<>();
+ roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("key", "key"), "key", "key"));
roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("name", "name"), "name", "name"));
roleColumns.add(new AbstractColumn<RoleTO, String>(new StringResourceModel("actions", this, null, "")) {
@@ -306,11 +306,11 @@ public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage {
@Override
public IModel<RoleTO> model(final RoleTO object) {
- return new Model<RoleTO>(object);
+ return new Model<>(object);
}
};
final AjaxFallbackDefaultDataTable<RoleTO, String> roles =
- new AjaxFallbackDefaultDataTable<RoleTO, String>("roles", roleColumns, roleDataProvider, 10);
+ new AjaxFallbackDefaultDataTable<>("roles", roleColumns, roleDataProvider, 10);
form.add(roles);
mwindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
index c7e192f..dc3ee88 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
+import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.status.AbstractStatusBeanProvider;
import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
@@ -38,7 +39,7 @@ import org.apache.syncope.common.lib.to.RoleTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
import org.apache.syncope.common.lib.wrap.AbstractWrappable;
-import org.apache.syncope.common.lib.wrap.SubjectId;
+import org.apache.syncope.common.lib.wrap.SubjectKey;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
@@ -48,6 +49,7 @@ import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.StringResourceModel;
@@ -83,10 +85,12 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs
statusUtils = new StatusUtils((UserTO.class.isAssignableFrom(typeRef) ? userRestClient : roleRestClient));
- final List<IColumn<StatusBean, String>> columns = new ArrayList<IColumn<StatusBean, String>>();
+ add(new Label("displayName", StringUtils.EMPTY));
+
+ final List<IColumn<StatusBean, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<StatusBean, String>(
- new StringResourceModel("id", this, null, "Attributable id"),
- "attributableId", "attributableId"));
+ new StringResourceModel("key", this, null, "Attributable key"),
+ "attributableKey", "attributableKey"));
columns.add(new PropertyColumn<StatusBean, String>(
new StringResourceModel("name", this, null, "Attributable name"),
"attributableName", "attributableName"));
@@ -116,7 +120,7 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs
}
});
- final ActionDataTablePanel<StatusBean, String> table = new ActionDataTablePanel<StatusBean, String>(
+ final ActionDataTablePanel<StatusBean, String> table = new ActionDataTablePanel<>(
"resourceDatatable",
columns,
(ISortableDataProvider<StatusBean, String>) new StatusBeanProvider(),
@@ -191,21 +195,18 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs
public List<StatusBean> getStatusBeans() {
final String fiql = SyncopeClient.getUserSearchConditionBuilder().hasResources(resourceTO.getKey()).query();
- final List<T> subjects = new ArrayList<T>();
+ final List<T> subjects = new ArrayList<>();
if (UserTO.class.isAssignableFrom(typeRef)) {
- subjects.addAll((List<T>) userRestClient.search(fiql, 1, ROWS_PER_PAGE,
- new SortParam<String>("id", true)));
+ subjects.addAll((List<T>) userRestClient.search(fiql, 1, ROWS_PER_PAGE, new SortParam<>("key", true)));
} else {
- subjects.addAll((List<T>) roleRestClient.search(fiql, 1, ROWS_PER_PAGE,
- new SortParam<String>("id", true)));
+ subjects.addAll((List<T>) roleRestClient.search(fiql, 1, ROWS_PER_PAGE, new SortParam<>("key", true)));
}
final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects(
(List<AbstractSubjectTO>) subjects, Collections.<String>singleton(resourceTO.getKey()));
- final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
- final LinkedHashMap<String, StatusBean> initialStatusBeanMap = new LinkedHashMap<String, StatusBean>(
- connObjects.size());
+ final List<StatusBean> statusBeans = new ArrayList<>(connObjects.size() + 1);
+ final LinkedHashMap<String, StatusBean> initialStatusBeanMap = new LinkedHashMap<>(connObjects.size());
for (ConnObjectWrapper entry : connObjects) {
final StatusBean statusBean = statusUtils.getStatusBean(
@@ -228,23 +229,22 @@ public class ProvisioningModalPage<T extends AbstractAttributableTO> extends Abs
final ActionDataTablePanel<StatusBean, String> table,
final List<IColumn<StatusBean, String>> columns) {
- final List<StatusBean> beans = new ArrayList<StatusBean>(table.getModelObject());
- List<SubjectId> subjectIds = new ArrayList<SubjectId>();
+ final List<StatusBean> beans = new ArrayList<>(table.getModelObject());
+ List<SubjectKey> subjectKeys = new ArrayList<>();
for (StatusBean bean : beans) {
LOG.debug("Selected bean {}", bean);
- subjectIds.add(AbstractWrappable.getInstance(SubjectId.class, bean.getAttributableId()));
+ subjectKeys.add(AbstractWrappable.getInstance(SubjectKey.class, bean.getAttributableId()));
}
if (beans.isEmpty()) {
window.close(target);
} else {
final BulkActionResult res = resourceRestClient.bulkAssociationAction(
- resourceTO.getKey(), typeRef, type, subjectIds);
+ resourceTO.getKey(), typeRef, type, subjectKeys);
((BasePage) pageRef.getPage()).setModalResult(true);
- setResponsePage(new BulkActionResultModalPage<StatusBean, String>(
- window, beans, columns, res, "attributableId"));
+ setResponsePage(new BulkActionResultModalPage<>(window, beans, columns, res, "attributableKey"));
}
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
index ebf91bd..0ef7c6a 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
@@ -219,19 +219,19 @@ public class ReportModalPage extends BaseModalPage {
});
add(reportletConfWin);
- final Label idLabel = new Label("idLabel", new ResourceModel("id"));
+ final Label idLabel = new Label("idLabel", new ResourceModel("key"));
profile.add(idLabel);
- final AjaxTextFieldPanel id = new AjaxTextFieldPanel("id", getString("id"), new PropertyModel<String>(reportTO,
- "id"));
- id.setEnabled(false);
- profile.add(id);
+ final AjaxTextFieldPanel key =
+ new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<String>(reportTO, "key"));
+ key.setEnabled(false);
+ profile.add(key);
final Label nameLabel = new Label("nameLabel", new ResourceModel("name"));
profile.add(nameLabel);
- final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
- reportTO, "name"));
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(reportTO, "name"));
profile.add(name);
final AjaxTextFieldPanel lastExec = new AjaxTextFieldPanel("lastExec", getString("lastExec"),
@@ -433,7 +433,7 @@ public class ReportModalPage extends BaseModalPage {
add(reportExecExportWin);
final List<IColumn> columns = new ArrayList<IColumn>();
- columns.add(new PropertyColumn(new ResourceModel("id"), "id", "id"));
+ columns.add(new PropertyColumn(new ResourceModel("key"), "key", "key"));
columns.add(new DatePropertyColumn(new ResourceModel("startDate"), "startDate", "startDate"));
columns.add(new DatePropertyColumn(new ResourceModel("endDate"), "endDate", "endDate"));
columns.add(new PropertyColumn(new ResourceModel("status"), "status", "status"));
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
index 9c625e1..e7155ca 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
@@ -72,8 +72,8 @@ public class ReportletConfModalPage extends BaseModalPage {
private static final long serialVersionUID = 3910027601200382958L;
- private static final String[] EXCLUDE_PROPERTIES = new String[] { "serialVersionUID", "class", "name",
- "reportletClassName" };
+ private static final String[] EXCLUDE_PROPERTIES =
+ new String[] { "serialVersionUID", "class", "name", "reportletClassName" };
private AbstractReportletConf reportletConf;
@@ -294,7 +294,7 @@ public class ReportletConfModalPage extends BaseModalPage {
List<String> choices;
switch (annotation.schema()) {
case UserPlainSchema:
- choices = schemaRestClient.getSchemaNames(AttributableType.USER);
+ choices = schemaRestClient.getPlainSchemaNames(AttributableType.USER);
break;
case UserDerivedSchema:
@@ -306,7 +306,7 @@ public class ReportletConfModalPage extends BaseModalPage {
break;
case RolePlainSchema:
- choices = schemaRestClient.getSchemaNames(AttributableType.ROLE);
+ choices = schemaRestClient.getPlainSchemaNames(AttributableType.ROLE);
break;
case RoleDerivedSchema:
@@ -318,7 +318,7 @@ public class ReportletConfModalPage extends BaseModalPage {
break;
case MembershipPlainSchema:
- choices = schemaRestClient.getSchemaNames(AttributableType.MEMBERSHIP);
+ choices = schemaRestClient.getPlainSchemaNames(AttributableType.MEMBERSHIP);
break;
case MembershipDerivedSchema:
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
index 6c53dee..a7b9c6c 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
@@ -113,8 +113,8 @@ public class Reports extends BasePage {
paginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_REPORT_PAGINATOR_ROWS);
- List<IColumn<ReportTO, String>> columns = new ArrayList<IColumn<ReportTO, String>>();
- columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("id"), "id", "id"));
+ List<IColumn<ReportTO, String>> columns = new ArrayList<>();
+ columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("key"), "key", "key"));
columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("name"), "name", "name"));
columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("lastExec"), "lastExec", "lastExec"));
columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("nextExec"), "nextExec", "nextExec"));
@@ -213,8 +213,7 @@ public class Reports extends BasePage {
});
final AjaxFallbackDefaultDataTable<ReportTO, String> reportTable =
- new AjaxFallbackDefaultDataTable<ReportTO, String>(
- "reportTable", columns, new ReportProvider(), paginatorRows);
+ new AjaxFallbackDefaultDataTable<>("reportTable", columns, new ReportProvider(), paginatorRows);
reportContainer.add(reportTable);
reportContainer.setOutputMarkupId(true);
@@ -248,7 +247,7 @@ public class Reports extends BasePage {
paginatorForm.add(rowsChooser);
add(paginatorForm);
- AjaxLink createLink = new ClearIndicatingAjaxLink("createLink", getPageReference()) {
+ AjaxLink<Void> createLink = new ClearIndicatingAjaxLink<Void>("createLink", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -298,7 +297,7 @@ public class Reports extends BasePage {
audit.getResult()));
}
- final ListModel<String> model = new ListModel<String>(new ArrayList<String>(events));
+ final ListModel<String> model = new ListModel<>(new ArrayList<>(events));
form.add(new LoggerCategoryPanel(
"events", loggerRestClient.listEvents(), model, getPageReference(), "Reports") {
@@ -377,8 +376,8 @@ public class Reports extends BasePage {
super();
//Default sorting
- setSort("id", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<ReportTO>(this);
+ setSort("key", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
index 824c39c..d6f69cf 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
@@ -55,14 +55,13 @@ public class ResourceModalPage extends BaseModalPage {
this.add(new Label("new", StringUtils.isBlank(resourceTO.getKey())
? new ResourceModel("new")
- : new Model("")));
-
+ : new Model(StringUtils.EMPTY)));
this.add(new Label("name", StringUtils.isBlank(resourceTO.getKey())
- ? ""
+ ? StringUtils.EMPTY
: resourceTO.getKey()));
- final Form<ResourceTO> form = new Form<ResourceTO>(FORM);
- form.setModel(new CompoundPropertyModel<ResourceTO>(resourceTO));
+ final Form<ResourceTO> form = new Form<>(FORM);
+ form.setModel(new CompoundPropertyModel<>(resourceTO));
//--------------------------------
// Resource details panel
@@ -180,10 +179,8 @@ public class ResourceModalPage extends BaseModalPage {
add(form);
- MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getEntitlement("Resources",
- createFlag
- ? "create"
- : "update"));
+ MetaDataRoleAuthorizationStrategy.authorize(
+ submit, ENABLE, xmlRolesReader.getEntitlement("Resources", createFlag ? "create" : "update"));
}
/**
@@ -194,7 +191,7 @@ public class ResourceModalPage extends BaseModalPage {
/**
* Request target.
*/
- private AjaxRequestTarget target;
+ private final AjaxRequestTarget target;
/**
* Constructor.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
index c0ebfa0..0fabe59 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
@@ -176,10 +176,9 @@ public class Resources extends BasePage {
}
private void setupResources() {
- List<IColumn<ResourceTO, String>> columns = new ArrayList<IColumn<ResourceTO, String>>();
+ List<IColumn<ResourceTO, String>> columns = new ArrayList<>();
- columns.add(
- new PropertyColumn<ResourceTO, String>(new StringResourceModel("name", this, null), "name", "name"));
+ columns.add(new PropertyColumn<ResourceTO, String>(new StringResourceModel("key", this, null), "key", "key"));
columns.add(new AbstractColumn<ResourceTO, String>(
new StringResourceModel("connector", this, null, "connector")) {
@@ -236,7 +235,7 @@ public class Resources extends BasePage {
final String componentId, final IModel<ResourceTO> model) {
item.add(new Label(componentId, ""));
- item.add(new AttributeModifier("class", new Model<String>(
+ item.add(new AttributeModifier("class", new Model<>(
Boolean.toString(model.getObject().isPropagationPrimary()))));
}
@@ -305,7 +304,7 @@ public class Resources extends BasePage {
@Override
public Page createPage() {
- return new ProvisioningModalPage<RoleTO>(
+ return new ProvisioningModalPage<>(
getPageReference(), statusmodal, model.getObject(), RoleTO.class);
}
});
@@ -381,14 +380,14 @@ public class Resources extends BasePage {
}
});
- final AjaxDataTablePanel<ResourceTO, String> table = new AjaxDataTablePanel<ResourceTO, String>(
+ final AjaxDataTablePanel<ResourceTO, String> table = new AjaxDataTablePanel<>(
"resourceDatatable",
columns,
(ISortableDataProvider<ResourceTO, String>) new ResourcesProvider(),
resourcePaginatorRows,
Arrays.asList(new ActionLink.ActionType[] { ActionLink.ActionType.DELETE }),
resourceRestClient,
- "name",
+ "key",
"Resources",
getPageReference());
@@ -466,10 +465,10 @@ public class Resources extends BasePage {
}
private void setupConnectors() {
- List<IColumn<ConnInstanceTO, String>> columns = new ArrayList<IColumn<ConnInstanceTO, String>>();
+ List<IColumn<ConnInstanceTO, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<ConnInstanceTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
columns.add(new PropertyColumn<ConnInstanceTO, String>(
new StringResourceModel("name", this, null), "connectorName", "connectorName"));
columns.add(new PropertyColumn<ConnInstanceTO, String>(
@@ -547,7 +546,7 @@ public class Resources extends BasePage {
connectorPaginatorRows,
Arrays.asList(new ActionLink.ActionType[] { ActionLink.ActionType.DELETE }),
connectorRestClient,
- "id",
+ "key",
"Connectors",
getPageReference());
@@ -640,13 +639,13 @@ public class Resources extends BasePage {
public ResourcesProvider() {
super();
//Default sorting
- setSort("name", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<ResourceTO>(this);
+ setSort("key", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
}
@Override
public Iterator<ResourceTO> iterator(final long first, final long count) {
- List<ResourceTO> list = getResourcesListDB();
+ List<ResourceTO> list = resourceRestClient.getAll();
Collections.sort(list, comparator);
@@ -655,7 +654,7 @@ public class Resources extends BasePage {
@Override
public long size() {
- return getResourcesListDB().size();
+ return resourceRestClient.getAll().size();
}
@Override
@@ -670,10 +669,6 @@ public class Resources extends BasePage {
}
};
}
-
- public List<ResourceTO> getResourcesListDB() {
- return resourceRestClient.getAll();
- }
}
private class ConnectorsProvider extends SortableDataProvider<ConnInstanceTO, String> {
@@ -685,13 +680,13 @@ public class Resources extends BasePage {
public ConnectorsProvider() {
super();
//Default sorting
- setSort("id", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<ConnInstanceTO>(this);
+ setSort("key", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
}
@Override
public Iterator<ConnInstanceTO> iterator(long first, long count) {
- List<ConnInstanceTO> list = getConnectorsListDB();
+ List<ConnInstanceTO> list = connectorRestClient.getAllConnectors();
Collections.sort(list, comparator);
@@ -700,7 +695,7 @@ public class Resources extends BasePage {
@Override
public long size() {
- return getConnectorsListDB().size();
+ return connectorRestClient.getAllConnectors().size();
}
@Override
@@ -716,10 +711,6 @@ public class Resources extends BasePage {
}
};
}
-
- public List<ConnInstanceTO> getConnectorsListDB() {
- return connectorRestClient.getAllConnectors();
- }
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
index 4a3589c..b6ecb9e 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
@@ -53,7 +53,7 @@ import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.request.resource.ContextRelativeResource;
/**
* Show user or role status after performing a successful operation.
@@ -62,10 +62,7 @@ public class ResultStatusModalPage extends BaseModalPage {
private static final long serialVersionUID = 2646115294319713723L;
- private static final String IMG_STATUSES = "statuses/";
-
- @SpringBean(name = "anonymousUser")
- private String anonymousUser;
+ private static final String IMG_PREFIX = "/img/statuses/";
private final AbstractSubjectTO subject;
@@ -184,8 +181,9 @@ public class ResultStatusModalPage extends BaseModalPage {
case SUCCESS:
case SUBMITTED:
case CREATED:
- image = new Image("icon", IMG_STATUSES + Status.ACTIVE.toString()
- + Constants.PNG_EXT);
+ image = new Image("icon",
+ new ContextRelativeResource(IMG_PREFIX + Status.ACTIVE.toString()
+ + Constants.PNG_EXT));
alt = "success icon";
title = "success";
failureWindow.setVisible(false);
@@ -193,8 +191,9 @@ public class ResultStatusModalPage extends BaseModalPage {
break;
default:
- image = new Image("icon", IMG_STATUSES + Status.SUSPENDED.toString()
- + Constants.PNG_EXT);
+ image = new Image("icon",
+ new ContextRelativeResource(IMG_PREFIX + Status.SUSPENDED.toString()
+ + Constants.PNG_EXT));
alt = "failure icon";
title = "failure";
}
@@ -381,15 +380,15 @@ public class ResultStatusModalPage extends BaseModalPage {
subject, resourceName, objectTO, this.subject instanceof RoleTO).getStatus()) {
case ACTIVE:
- image = new Image("status", IMG_STATUSES + Status.ACTIVE.toString()
- + Constants.PNG_EXT);
+ image = new Image("status",
+ new ContextRelativeResource(IMG_PREFIX + Status.ACTIVE.toString() + Constants.PNG_EXT));
alt = "active icon";
title = "Enabled";
break;
case SUSPENDED:
- image = new Image("status", IMG_STATUSES + Status.SUSPENDED.toString()
- + Constants.PNG_EXT);
+ image = new Image("status",
+ new ContextRelativeResource(IMG_PREFIX + Status.SUSPENDED.toString() + Constants.PNG_EXT));
alt = "inactive icon";
title = "Disabled";
break;
[50/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
index 8852862..2e26ded 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
@@ -88,10 +88,10 @@ public class Schema extends BasePage {
private static final long serialVersionUID = 3109256773218160485L;
{
- put(SchemaType.PLAIN, Arrays.asList(new String[] { "name", "type",
+ put(SchemaType.PLAIN, Arrays.asList(new String[] { "key", "type",
"mandatoryCondition", "uniqueConstraint", "multivalue", "readonly" }));
- put(SchemaType.DERIVED, Arrays.asList(new String[] { "name", "expression" }));
- put(SchemaType.VIRTUAL, Arrays.asList(new String[] { "name", "readonly" }));
+ put(SchemaType.DERIVED, Arrays.asList(new String[] { "key", "expression" }));
+ put(SchemaType.VIRTUAL, Arrays.asList(new String[] { "key", "readonly" }));
}
};
@@ -210,7 +210,7 @@ public class Schema extends BasePage {
@Override
public String getCssClass() {
String css = super.getCssClass();
- if ("name".equals(field)) {
+ if ("key".equals(field)) {
css = StringUtils.isBlank(css)
? "medium_fixedsize"
: css + " medium_fixedsize";
@@ -282,7 +282,7 @@ public class Schema extends BasePage {
break;
default:
- restClient.deleteSchema(attributableType, schemaTO.getKey());
+ restClient.deletePlainSchema(attributableType, schemaTO.getKey());
break;
}
@@ -377,9 +377,9 @@ public class Schema extends BasePage {
this.schemaType = schemaType;
// Default sorting
- setSort("name", SortOrder.ASCENDING);
+ setSort("key", SortOrder.ASCENDING);
- comparator = new SortableDataProviderComparator<AbstractSchemaTO>(this);
+ comparator = new SortableDataProviderComparator<>(this);
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
index 7580f64..9d0ede2 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
@@ -119,7 +119,10 @@ public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatus
statusUtils = new StatusUtils(subjectTO instanceof UserTO ? userRestClient : roleRestClient);
- columns = new ArrayList<IColumn<StatusBean, String>>();
+ add(new Label("displayName", subjectTO.getKey() + " "
+ + (subjectTO instanceof UserTO ? ((UserTO) subjectTO).getUsername() : ((RoleTO) subjectTO).getName())));
+
+ columns = new ArrayList<>();
columns.add(new AbstractColumn<StatusBean, String>(
new StringResourceModel("resourceName", this, null, "Resource name"), "resourceName") {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
index cd4e812..c251d87 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
@@ -75,8 +75,8 @@ public abstract class TaskModalPage extends BaseModalPage {
taskExecMessageWin.setCookieName("task-exec-message-win-modal");
add(taskExecMessageWin);
- form = new Form<AbstractTaskTO>(FORM);
- form.setModel(new CompoundPropertyModel<AbstractTaskTO>(taskTO));
+ form = new Form<>(FORM);
+ form.setModel(new CompoundPropertyModel<>(taskTO));
add(form);
profile = new WebMarkupContainer("profile");
@@ -87,27 +87,23 @@ public abstract class TaskModalPage extends BaseModalPage {
executions.setOutputMarkupId(true);
form.add(executions);
- final Label idLabel = new Label("idLabel", new ResourceModel("id"));
+ final Label idLabel = new Label("idLabel", new ResourceModel("key"));
profile.add(idLabel);
final AjaxTextFieldPanel id =
- new AjaxTextFieldPanel("id", getString("id"), new PropertyModel<String>(taskTO, "id"));
+ new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<String>(taskTO, "key"));
id.setEnabled(false);
profile.add(id);
- final List<IColumn<TaskExecTO, String>> columns = new ArrayList<IColumn<TaskExecTO, String>>();
+ final List<IColumn<TaskExecTO, String>> columns = new ArrayList<>();
final int paginatorRows = 10;
- columns.add(new PropertyColumn<TaskExecTO, String>(new ResourceModel("id"), "id", "id"));
-
+ columns.add(new PropertyColumn<TaskExecTO, String>(new ResourceModel("key"), "key", "key"));
columns.add(new DatePropertyColumn<TaskExecTO>(new ResourceModel("startDate"), "startDate", "startDate"));
-
columns.add(new DatePropertyColumn<TaskExecTO>(new ResourceModel("endDate"), "endDate", "endDate"));
-
columns.add(new PropertyColumn<TaskExecTO, String>(new ResourceModel("status"), "status", "status"));
-
columns.add(new ActionColumn<TaskExecTO, String>(new ResourceModel("actions", "")) {
private static final long serialVersionUID = 2054811145491901166L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
index 948af72..296c365 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
@@ -141,8 +141,8 @@ public class Tasks extends BasePage {
super();
//Default sorting
- setSort("id", SortOrder.DESCENDING);
- comparator = new SortableDataProviderComparator<T>(this);
+ setSort("key", SortOrder.DESCENDING);
+ comparator = new SortableDataProviderComparator<>(this);
this.paginatorRows = paginatorRows;
this.restClient = restClient;
this.id = id;
@@ -151,7 +151,7 @@ public class Tasks extends BasePage {
@Override
public Iterator<T> iterator(final long first, final long count) {
- final List<T> tasks = new ArrayList<T>();
+ final List<T> tasks = new ArrayList<>();
final int page = ((int) first / paginatorRows);
@@ -184,7 +184,7 @@ public class Tasks extends BasePage {
@Override
public IModel<T> model(final T object) {
- return new CompoundPropertyModel<T>(object);
+ return new CompoundPropertyModel<>(object);
}
}
@@ -208,7 +208,7 @@ public class Tasks extends BasePage {
final BaseRestClient restClient) {
@SuppressWarnings("unchecked")
- final AjaxDataTablePanel<AbstractTaskTO, String> table = new AjaxDataTablePanel<AbstractTaskTO, String>(
+ final AjaxDataTablePanel<AbstractTaskTO, String> table = new AjaxDataTablePanel<>(
"datatable",
columns,
(ISortableDataProvider<AbstractTaskTO, String>) dataProvider,
@@ -216,7 +216,7 @@ public class Tasks extends BasePage {
Arrays.asList(new ActionLink.ActionType[] {
ActionLink.ActionType.DELETE, ActionLink.ActionType.DRYRUN, ActionLink.ActionType.EXECUTE }),
restClient,
- "id",
+ "key",
TASKS,
pageRef);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
index 7319c38..0215538 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.client.console.pages;
+import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.Mode;
import org.apache.syncope.client.console.panels.DerAttrsPanel;
@@ -93,12 +94,12 @@ public abstract class UserModalPage extends BaseModalPage {
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Form setupEditPanel() {
fragment.add(new Label("id", userTO.getKey() == 0
- ? ""
+ ? StringUtils.EMPTY
: userTO.getUsername()));
fragment.add(new Label("new", userTO.getKey() == 0
? new ResourceModel("new")
- : new Model("")));
+ : new Model(StringUtils.EMPTY)));
final Form form = new Form("UserForm");
form.setModel(new CompoundPropertyModel(userTO));
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
index ed8419e..98f93bf 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
@@ -95,7 +95,7 @@ public class Users extends BasePage {
setWindowClosedReloadCallback(editModalWin);
- final Form searchForm = new Form("searchForm");
+ final Form<?> searchForm = new Form<>("searchForm");
add(searchForm);
final UserSearchPanel searchPanel = new UserSearchPanel.Builder("searchPanel").build();
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
index daa65d6..425b9cb 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
@@ -54,12 +54,12 @@ public class VirSchemaModalPage extends AbstractSchemaModalPage<VirSchemaTO> {
schema = new VirSchemaTO();
}
- final Form<VirSchemaTO> schemaForm = new Form<VirSchemaTO>(FORM);
+ final Form<VirSchemaTO> schemaForm = new Form<>(FORM);
- schemaForm.setModel(new CompoundPropertyModel<VirSchemaTO>(schema));
+ schemaForm.setModel(new CompoundPropertyModel<>(schema));
- final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
- schema, "name"));
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("key", getString("key"), new PropertyModel<String>(schema, "key"));
name.addRequiredLabel();
name.setEnabled(createFlag);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
index aa30fae..d610739 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
@@ -131,11 +131,11 @@ public abstract class AbstractSearchPanel extends Panel {
searchFeedback.setOutputMarkupId(true);
add(searchFeedback);
- this.searchClauses = new ArrayList<SearchClause>();
+ this.searchClauses = new ArrayList<>();
this.searchClauses.add(new SearchClause());
if (StringUtils.isNotBlank(fiql)) {
try {
- FiqlParser<SearchBean> fiqlParser = new FiqlParser<SearchBean>(
+ FiqlParser<SearchBean> fiqlParser = new FiqlParser<>(
SearchBean.class, SyncopeFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES);
List<SearchClause> parsed = getSearchClauses(fiqlParser.parse(fiql));
@@ -158,8 +158,8 @@ public abstract class AbstractSearchPanel extends Panel {
@Override
protected List<String> load() {
- return SearchableFields.get(attributableType == AttributableType.USER
- ? SubjectType.USER : SubjectType.ROLE);
+ return SearchableFields.get(
+ attributableType == AttributableType.USER ? SubjectType.USER : SubjectType.ROLE);
}
};
@@ -169,7 +169,7 @@ public abstract class AbstractSearchPanel extends Panel {
@Override
protected List<String> load() {
- return schemaRestClient.getSchemaNames(attributableType);
+ return schemaRestClient.getPlainSchemaNames(attributableType);
}
};
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
index 386392c..6139ee4 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
@@ -205,10 +205,10 @@ public abstract class AbstractSearchResultPanel extends Panel implements IEventS
// ---------------------------
// Rows-per-page selector
// ---------------------------
- final Form paginatorForm = new Form("paginator");
+ final Form<?> paginatorForm = new Form<>("paginator");
container.add(paginatorForm);
- final DropDownChoice<Integer> rowsChooser = new DropDownChoice<Integer>(
+ final DropDownChoice<Integer> rowsChooser = new DropDownChoice<>(
"rowsChooser", new PropertyModel<Integer>(this, "rows"), prefMan.getPaginatorChoices());
rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
@@ -254,14 +254,14 @@ public abstract class AbstractSearchResultPanel extends Panel implements IEventS
: (int) resultTable.getCurrentPage())
: 0;
- resultTable = new AjaxDataTablePanel<AbstractAttributableTO, String>(
+ resultTable = new AjaxDataTablePanel<>(
"resultTable",
getColumns(),
dataProvider,
rows,
getBulkActions(),
restClient,
- "id",
+ "key",
getPageId(),
page.getPageReference());
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
index b9162da..1601ca7 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
@@ -41,7 +41,7 @@ public class AttrTemplatesPanel extends Panel {
public enum Type {
- rAttrTemplates,
+ rPlainAttrTemplates,
rDerAttrTemplates,
rVirAttrTemplates,
mPlainAttrTemplates,
@@ -67,7 +67,7 @@ public class AttrTemplatesPanel extends Panel {
super(id);
this.roleTO = roleTO;
- rPlainAttrTemplates = buildPalette(Type.rAttrTemplates,
+ rPlainAttrTemplates = buildPalette(Type.rPlainAttrTemplates,
schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.PLAIN));
this.add(rPlainAttrTemplates);
rDerAttrTemplates = buildPalette(Type.rDerAttrTemplates,
@@ -89,7 +89,7 @@ public class AttrTemplatesPanel extends Panel {
if (allSchemas != null && !allSchemas.isEmpty()) {
Collections.sort(allSchemas);
}
- ListModel<String> availableSchemas = new ListModel<String>(allSchemas);
+ ListModel<String> availableSchemas = new ListModel<>(allSchemas);
return new NonI18nPalette<String>(type.name(), new PropertyModel<List<String>>(roleTO, type.name()),
availableSchemas, new SelectChoiceRenderer<String>(), 8, false, true) {
@@ -101,7 +101,7 @@ public class AttrTemplatesPanel extends Panel {
final Recorder<String> recorder = super.newRecorderComponent();
switch (type) {
- case rAttrTemplates:
+ case rPlainAttrTemplates:
case rDerAttrTemplates:
case rVirAttrTemplates:
recorder.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
@@ -126,7 +126,7 @@ public class AttrTemplatesPanel extends Panel {
public Collection<String> getSelected(final Type type) {
Collection<String> selected;
switch (type) {
- case rAttrTemplates:
+ case rPlainAttrTemplates:
selected = this.rPlainAttrTemplates.getModelCollection();
break;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
index b0b3d9a..7969c63 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
@@ -22,6 +22,7 @@ import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.request.resource.ContextRelativeResource;
public class ImagePanel extends Panel {
@@ -29,7 +30,7 @@ public class ImagePanel extends Panel {
final Image img;
- public ImagePanel(final String id, final String img) {
+ public ImagePanel(final String id, final ContextRelativeResource img) {
super(id);
this.img = new Image("img", img);
add(this.img);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
index a68d8cd..26f1894 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
@@ -75,7 +75,7 @@ public class LayoutsPanel extends Panel {
final AttrTO attrLayout = confRestClient.readAttrLayout(attrLayoutType);
form.setModel(new CompoundPropertyModel(attrLayout.getValues()));
- final List<String> fields = schemaRestClient.getSchemaNames(attrLayoutType.getAttrType());
+ final List<String> fields = schemaRestClient.getPlainSchemaNames(attrLayoutType.getAttrType());
final ListModel<String> selectedFields =
new ListModel<String>(attrLayout.getValues().isEmpty() ? fields : attrLayout.getValues());
final ListModel<String> availableFields = new ListModel<String>(fields);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
index 41ac64e..d7f52e1 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
@@ -137,10 +137,10 @@ public class NotificationTasks extends AbstractTasks {
}
private List<IColumn<AbstractTaskTO, String>> getColumns() {
- final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+ final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("sender", this, null), "sender", "sender"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
index 34d4f81..8e42318 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
@@ -154,11 +154,11 @@ public class PlainAttrsPanel extends Panel {
schemaTOs = schemaRestClient.getSchemas(AttributableType.ROLE);
Set<String> allowed;
if (attrTemplates == null) {
- allowed = new HashSet<>(roleTO.getRAttrTemplates());
+ allowed = new HashSet<>(roleTO.getRPlainAttrTemplates());
} else {
- allowed = new HashSet<>(attrTemplates.getSelected(AttrTemplatesPanel.Type.rAttrTemplates));
+ allowed = new HashSet<>(attrTemplates.getSelected(AttrTemplatesPanel.Type.rPlainAttrTemplates));
if (roleTO.isInheritTemplates() && roleTO.getParent() != 0) {
- allowed.addAll(roleRestClient.read(roleTO.getParent()).getRAttrTemplates());
+ allowed.addAll(roleRestClient.read(roleTO.getParent()).getRPlainAttrTemplates());
}
}
schemaRestClient.filter(schemaTOs, allowed, true);
@@ -169,7 +169,7 @@ public class PlainAttrsPanel extends Panel {
attrLayout = confRestClient.readAttrLayout(AttrLayoutType.valueOf(mode, AttributableType.MEMBERSHIP));
schemaTOs = schemaRestClient.getSchemas(AttributableType.MEMBERSHIP);
Set<String> allowed = new HashSet<>(
- roleRestClient.read(((MembershipTO) entityTO).getRoleId()).getMAttrTemplates());
+ roleRestClient.read(((MembershipTO) entityTO).getRoleId()).getMPlainAttrTemplates());
schemaRestClient.filter(schemaTOs, allowed, true);
} else {
schemas = new TreeMap<>();
@@ -385,7 +385,7 @@ public class PlainAttrsPanel extends Panel {
public void onEvent(final IEvent<?> event) {
if ((event.getPayload() instanceof RoleAttrTemplatesChange)) {
final RoleAttrTemplatesChange update = (RoleAttrTemplatesChange) event.getPayload();
- if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.rAttrTemplates) {
+ if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.rPlainAttrTemplates) {
setSchemas();
setAttrs();
update.getTarget().add(this);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
index 9979ee0..4d66eda 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
@@ -117,9 +117,9 @@ public class PoliciesPanel extends Panel {
setWindowClosedCallback(mwindow, container);
- final List<IColumn<AbstractPolicyTO, String>> columns = new ArrayList<IColumn<AbstractPolicyTO, String>>();
+ final List<IColumn<AbstractPolicyTO, String>> columns = new ArrayList<>();
- columns.add(new PropertyColumn<AbstractPolicyTO, String>(new ResourceModel("id"), "id", "id"));
+ columns.add(new PropertyColumn<AbstractPolicyTO, String>(new ResourceModel("key"), "key", "key"));
columns.add(new PropertyColumn<AbstractPolicyTO, String>(
new ResourceModel("description"), "description", "description"));
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
index a46bcd1..67d6684 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
@@ -80,7 +80,7 @@ public class PolicyBeanPanel extends Panel {
@Override
protected List<String> load() {
- return schemaRestClient.getSchemaNames(AttributableType.USER);
+ return schemaRestClient.getPlainSchemaNames(AttributableType.USER);
}
};
@@ -90,7 +90,7 @@ public class PolicyBeanPanel extends Panel {
@Override
protected List<String> load() {
- return schemaRestClient.getSchemaNames(AttributableType.ROLE);
+ return schemaRestClient.getPlainSchemaNames(AttributableType.ROLE);
}
};
@@ -183,7 +183,7 @@ public class PolicyBeanPanel extends Panel {
item.add(new Label("field", new Model(null)));
} else if (Collection.class.isAssignableFrom(field.getType())) {
if (field.getSchemaList() != null) {
- final List<String> values = new ArrayList<String>();
+ final List<String> values = new ArrayList<>();
if (field.getName().charAt(0) == 'r') {
values.addAll(roleSchemas.getObject());
@@ -194,13 +194,13 @@ public class PolicyBeanPanel extends Panel {
values.addAll(userSchemas.getObject());
if (field.getSchemaList().extended()) {
- values.add("id");
+ values.add("key");
values.add("username");
}
}
component = new AjaxPalettePanel("field", new PropertyModel(policy, field.getName()),
- new ListModel<String>(values));
+ new ListModel<>(values));
item.add(component);
Collection<?> collection = (Collection) propDesc.getReadMethod().invoke(policy);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
index 5a942fd..41fdb03 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
@@ -124,8 +124,7 @@ public class PropagationTasks extends AbstractTasks {
table = Tasks.updateTaskTable(
getColumns(),
- new TasksProvider<PropagationTaskTO>(restClient, paginatorRows,
- getId(), PropagationTaskTO.class),
+ new TasksProvider<>(restClient, paginatorRows, getId(), PropagationTaskTO.class),
container,
table == null ? 0 : (int) table.getCurrentPage(),
pageRef,
@@ -140,32 +139,24 @@ public class PropagationTasks extends AbstractTasks {
}
private List<IColumn<AbstractTaskTO, String>> getColumns() {
- final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+ final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
-
+ new StringResourceModel("key", this, null), "key", "key"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("resource", this, null), "resource", "resource"));
-
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("accountId", this, null), "accountId", "accountId"));
-
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("propagationMode", this, null), "propagationMode", "propagationMode"));
-
columns.add(new PropertyColumn<AbstractTaskTO, String>(new StringResourceModel(
"propagationOperation", this, null), "propagationOperation", "propagationOperation"));
-
columns.add(new DatePropertyColumn<AbstractTaskTO>(
new StringResourceModel("startDate", this, null), "startDate", "startDate"));
-
columns.add(new DatePropertyColumn<AbstractTaskTO>(
new StringResourceModel("endDate", this, null), "endDate", "endDate"));
-
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
-
columns.add(new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
private static final long serialVersionUID = 2054811145491901166L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
index 2d25a83..a93000d 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
@@ -55,7 +55,7 @@ public class PushTasksPanel extends AbstractProvisioningTasksPanel<PushTaskTO> {
final List<IColumn<AbstractTaskTO, String>> pushTasksColumns = new ArrayList<IColumn<AbstractTaskTO, String>>();
pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("name", this, null), "name", "name"));
pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
index c3b0455..3bff23f 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceDetailsPanel.java
@@ -73,7 +73,7 @@ public class ResourceDetailsPanel extends Panel {
setOutputMarkupId(true);
final AjaxTextFieldPanel resourceName = new AjaxTextFieldPanel("name", new ResourceModel("name", "name").
- getObject(), new PropertyModel<String>(resourceTO, "name"));
+ getObject(), new PropertyModel<String>(resourceTO, "key"));
resourceName.setEnabled(createFlag);
resourceName.addRequiredLabel();
@@ -90,11 +90,11 @@ public class ResourceDetailsPanel extends Panel {
add(propagationPrimary);
final SpinnerFieldPanel<Integer> propagationPriority =
- new SpinnerFieldPanel<Integer>("propagationPriority", "propagationPriority", Integer.class,
+ new SpinnerFieldPanel<>("propagationPriority", "propagationPriority", Integer.class,
new PropertyModel<Integer>(resourceTO, "propagationPriority"), null, null);
add(propagationPriority);
- final AjaxDropDownChoicePanel<PropagationMode> propagationMode = new AjaxDropDownChoicePanel<PropagationMode>(
+ final AjaxDropDownChoicePanel<PropagationMode> propagationMode = new AjaxDropDownChoicePanel<>(
"propagationMode", new ResourceModel("propagationMode", "propagationMode").getObject(),
new PropertyModel<PropagationMode>(resourceTO, "propagationMode"));
propagationMode.setChoices(Arrays.asList(PropagationMode.values()));
@@ -133,8 +133,8 @@ public class ResourceDetailsPanel extends Panel {
protected void populateItem(final ListItem<String> item) {
final String className = item.getModelObject();
- final DropDownChoice<String> actionsClass = new DropDownChoice<String>(
- "actionsClass", new Model<String>(className), actionClassNames);
+ final DropDownChoice<String> actionsClass = new DropDownChoice<>(
+ "actionsClass", new Model<>(className), actionClassNames);
actionsClass.setNullValid(true);
actionsClass.setRequired(true);
actionsClass.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
@@ -182,25 +182,25 @@ public class ResourceDetailsPanel extends Panel {
};
propagationActionsClassNames.add(actionsClasses);
- final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel = new AjaxDropDownChoicePanel<>(
"createTraceLevel", new ResourceModel("createTraceLevel", "createTraceLevel").getObject(),
new PropertyModel<TraceLevel>(resourceTO, "createTraceLevel"));
createTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
add(createTraceLevel);
- final AjaxDropDownChoicePanel<TraceLevel> updateTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ final AjaxDropDownChoicePanel<TraceLevel> updateTraceLevel = new AjaxDropDownChoicePanel<>(
"updateTraceLevel", new ResourceModel("updateTraceLevel", "updateTraceLevel").getObject(),
new PropertyModel<TraceLevel>(resourceTO, "updateTraceLevel"));
updateTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
add(updateTraceLevel);
- final AjaxDropDownChoicePanel<TraceLevel> deleteTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ final AjaxDropDownChoicePanel<TraceLevel> deleteTraceLevel = new AjaxDropDownChoicePanel<>(
"deleteTraceLevel", new ResourceModel("deleteTraceLevel", "deleteTraceLevel").getObject(),
new PropertyModel<TraceLevel>(resourceTO, "deleteTraceLevel"));
deleteTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
add(deleteTraceLevel);
- final AjaxDropDownChoicePanel<TraceLevel> syncTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ final AjaxDropDownChoicePanel<TraceLevel> syncTraceLevel = new AjaxDropDownChoicePanel<>(
"syncTraceLevel", new ResourceModel("syncTraceLevel", "syncTraceLevel").getObject(),
new PropertyModel<TraceLevel>(resourceTO, "syncTraceLevel"));
syncTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
@@ -218,11 +218,11 @@ public class ResourceDetailsPanel extends Panel {
connInstanceTO = getConectorInstanceTO(connectors.getObject(), resourceTO);
- final AjaxDropDownChoicePanel<ConnInstanceTO> conn = new AjaxDropDownChoicePanel<ConnInstanceTO>("connector",
+ final AjaxDropDownChoicePanel<ConnInstanceTO> conn = new AjaxDropDownChoicePanel<>("connector",
new ResourceModel("connector", "connector").getObject(),
new PropertyModel<ConnInstanceTO>(this, "connInstanceTO"));
conn.setChoices(connectors.getObject());
- conn.setChoiceRenderer(new ChoiceRenderer("displayName", "id"));
+ conn.setChoiceRenderer(new ChoiceRenderer("displayName", "key"));
conn.getField().setModel(new IModel<ConnInstanceTO>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
index 0e8d34b..ecd7e0c 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
@@ -565,7 +565,7 @@ public class ResourceMappingPanel extends Panel {
case UserPlainSchema:
case RolePlainSchema:
case MembershipPlainSchema:
- toBeUpdated.setChoices(schemaRestClient.getSchemaNames(type.getAttributableType()));
+ toBeUpdated.setChoices(schemaRestClient.getPlainSchemaNames(type.getAttributableType()));
break;
case UserDerivedSchema:
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
index 2a97b3a..03d2e75 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDetailsPanel.java
@@ -140,11 +140,11 @@ public class RoleDetailsPanel extends Panel {
this.add(parentFragment);
final AjaxTextFieldPanel name =
- new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(roleTO, "name"));
+ new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(roleTO, "key"));
final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
- final AjaxLink questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
+ final AjaxLink<Void> questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
this.add(questionMarkJexlHelp);
questionMarkJexlHelp.add(jexlHelp);
@@ -241,7 +241,7 @@ public class RoleDetailsPanel extends Panel {
@Override
protected void onUpdate(final AjaxRequestTarget target) {
- send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rAttrTemplates, target));
+ send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rPlainAttrTemplates, target));
send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rDerAttrTemplates, target));
send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(Type.rVirAttrTemplates, target));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
index 09f838a..da04397 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RolePanel.java
@@ -122,10 +122,10 @@ public class RolePanel extends Panel {
// Attributes panel
//--------------------------------
this.add(new PlainAttrsPanel(
- "attrs", builder.roleTO, builder.form, builder.mode, attrTemplates));
+ "plainAttrs", builder.roleTO, builder.form, builder.mode, attrTemplates));
- final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel("inheritAttrs", "inheritAttrs",
- new PropertyModel<Boolean>(builder.roleTO, "inheritAttrs"));
+ final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel("inheritPlainAttrs", "inheritPlainAttrs",
+ new PropertyModel<Boolean>(builder.roleTO, "inheritPlainAttrs"));
inhAttributes.setOutputMarkupId(true);
this.add(inhAttributes);
//--------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
index 3762dee..dfd40d5 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
@@ -60,13 +60,10 @@ public class RoleSearchResultPanel extends AbstractSearchResultPanel {
@Override
protected List<IColumn<AbstractAttributableTO, String>> getColumns() {
- final List<IColumn<AbstractAttributableTO, String>> columns =
- new ArrayList<IColumn<AbstractAttributableTO, String>>();
+ final List<IColumn<AbstractAttributableTO, String>> columns = new ArrayList<>();
- final String[] colnames = { "id", "name", "entitlements" };
- for (String name : colnames) {
- columns.add(
- new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(name, name), name, name));
+ for (String item : new String[] { "key", "name", "entitlements" }) {
+ columns.add(new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(item, item), item, item));
}
columns.add(new AbstractColumn<AbstractAttributableTO, String>(new ResourceModel("actions", "")) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
index bbc10b7..205bfa5 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
@@ -153,7 +153,7 @@ public class SchedTasks extends AbstractTasks {
final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
columns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("name", this, null), "name", "name"));
columns.add(new PropertyColumn<AbstractTaskTO, String>(
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
index cf75285..f520391 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
@@ -53,10 +53,10 @@ public class SyncTasksPanel extends AbstractProvisioningTasksPanel<SyncTaskTO> {
@Override
protected List<IColumn<AbstractTaskTO, String>> getColumns() {
- final List<IColumn<AbstractTaskTO, String>> syncTaskscolumns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+ final List<IColumn<AbstractTaskTO, String>> syncTaskscolumns = new ArrayList<>();
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
- new StringResourceModel("id", this, null), "id", "id"));
+ new StringResourceModel("key", this, null), "key", "key"));
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
new StringResourceModel("name", this, null), "name", "name"));
syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
@@ -202,7 +202,7 @@ public class SyncTasksPanel extends AbstractProvisioningTasksPanel<SyncTaskTO> {
}
@Override
- public Component getHeader(String componentId) {
+ public Component getHeader(final String componentId) {
final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
panel.add(new ActionLink() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
index 7e494a5..132bb66 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
@@ -76,7 +76,7 @@ public class UserSearchResultPanel extends AbstractSearchResultPanel {
super(id, filtered, fiql, callerRef, restClient);
- this.pSchemaNames = schemaRestClient.getSchemaNames(AttributableType.USER);
+ this.pSchemaNames = schemaRestClient.getPlainSchemaNames(AttributableType.USER);
this.dSchemaNames = schemaRestClient.getDerSchemaNames(AttributableType.USER);
this.vSchemaNames = schemaRestClient.getVirSchemaNames(AttributableType.USER);
@@ -85,8 +85,7 @@ public class UserSearchResultPanel extends AbstractSearchResultPanel {
@Override
protected List<IColumn<AbstractAttributableTO, String>> getColumns() {
- final List<IColumn<AbstractAttributableTO, String>> columns =
- new ArrayList<IColumn<AbstractAttributableTO, String>>();
+ final List<IColumn<AbstractAttributableTO, String>> columns = new ArrayList<>();
for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW)) {
final Field field = ReflectionUtils.findField(UserTO.class, name);
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
index 2baff26..3ebc28a 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
@@ -20,24 +20,17 @@ package org.apache.syncope.client.console.preview;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.init.PreviewPanelClassInitializer;
+import org.apache.syncope.client.console.init.BinaryPreviewersLoader;
import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
import org.apache.wicket.Component;
import org.apache.wicket.util.crypt.Base64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@org.springframework.stereotype.Component
public class PreviewUtil {
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(PreviewUtil.class);
-
@Autowired
- private PreviewPanelClassInitializer previewPanelClassInitializer;
+ private BinaryPreviewersLoader previewPanelClassInitializer;
public Component getPreviewer(final String mimeType, final String file) throws ClassNotFoundException,
NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
index 921d783..a70f9cf 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.console.preview;
import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
@@ -30,8 +31,6 @@ import org.springframework.util.ClassUtils;
@Component
public class PreviewerClassScanner extends ClassPathScanningCandidateComponentProvider {
- private static final String BASE_PATH = "org.apache.syncope.console.wicket.markup.html.form";
-
public PreviewerClassScanner() {
super(false);
addIncludeFilter(new AnnotationTypeFilter(BinaryPreview.class));
@@ -39,9 +38,8 @@ public class PreviewerClassScanner extends ClassPathScanningCandidateComponentPr
@SuppressWarnings("unchecked")
public final List<Class<? extends AbstractBinaryPreviewer>> getComponentClasses() {
- List<Class<? extends AbstractBinaryPreviewer>> classes =
- new ArrayList<Class<? extends AbstractBinaryPreviewer>>();
- for (BeanDefinition candidate : findCandidateComponents(BASE_PATH)) {
+ List<Class<? extends AbstractBinaryPreviewer>> classes = new ArrayList<>();
+ for (BeanDefinition candidate : findCandidateComponents(StringUtils.EMPTY)) {
classes.add((Class<AbstractBinaryPreviewer>) ClassUtils.resolveClassName(candidate.getBeanClassName(),
ClassUtils.getDefaultClassLoader()));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
index 9d09984..ca00ea8 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
@@ -73,7 +73,7 @@ public class ConfigurationRestClient extends BaseRestClient {
attrLayout.setSchema(type.getConfKey());
}
if (attrLayout.getValues().isEmpty()) {
- attrLayout.getValues().addAll(schemaRestClient.getSchemaNames(type.getAttrType()));
+ attrLayout.getValues().addAll(schemaRestClient.getPlainSchemaNames(type.getAttrType()));
}
return attrLayout;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
index a62b644..5ed1f45 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
@@ -28,7 +28,7 @@ import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.wrap.SubjectId;
+import org.apache.syncope.common.lib.wrap.SubjectKey;
import org.apache.syncope.common.rest.api.service.ResourceService;
import org.springframework.stereotype.Component;
@@ -85,7 +85,7 @@ public class ResourceRestClient extends BaseRestClient {
public BulkActionResult bulkAssociationAction(
final String resourceName, final Class<? extends AbstractAttributableTO> typeRef,
- final ResourceDeassociationActionType type, final List<SubjectId> subjtectIds) {
+ final ResourceDeassociationActionType type, final List<SubjectKey> subjtectIds) {
return getService(ResourceService.class).bulkDeassociation(resourceName,
UserTO.class.isAssignableFrom(typeRef) ? SubjectType.USER : SubjectType.ROLE,
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
index d5d7046..378f98d 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
@@ -89,7 +89,7 @@ public class SchemaRestClient extends BaseRestClient {
}
public List<String> getSchemaNames(final AttributableType attrType, final SchemaType schemaType) {
- final List<String> schemaNames = new ArrayList<String>();
+ final List<String> schemaNames = new ArrayList<>();
try {
final List<? extends AbstractSchemaTO> schemas = getSchemas(attrType, schemaType);
@@ -103,8 +103,8 @@ public class SchemaRestClient extends BaseRestClient {
return schemaNames;
}
- public List<String> getSchemaNames(final AttributableType type) {
- final List<String> schemaNames = new ArrayList<String>();
+ public List<String> getPlainSchemaNames(final AttributableType type) {
+ final List<String> schemaNames = new ArrayList<>();
try {
final List<PlainSchemaTO> schemas = getSchemas(type);
@@ -131,7 +131,7 @@ public class SchemaRestClient extends BaseRestClient {
}
public List<String> getDerSchemaNames(final AttributableType type) {
- final List<String> userDerSchemasNames = new ArrayList<String>();
+ final List<String> userDerSchemasNames = new ArrayList<>();
try {
final List<DerSchemaTO> userDerSchemas = getService(SchemaService.class).list(type, SchemaType.DERIVED);
@@ -174,11 +174,11 @@ public class SchemaRestClient extends BaseRestClient {
return userVirSchemasNames;
}
- public void createSchema(final AttributableType type, final PlainSchemaTO schemaTO) {
+ public void createPlainSchema(final AttributableType type, final PlainSchemaTO schemaTO) {
getService(SchemaService.class).create(type, SchemaType.PLAIN, schemaTO);
}
- public PlainSchemaTO readSchema(final AttributableType type, final String name) {
+ public PlainSchemaTO readPlainSchema(final AttributableType type, final String name) {
PlainSchemaTO schema = null;
try {
@@ -189,11 +189,11 @@ public class SchemaRestClient extends BaseRestClient {
return schema;
}
- public void updateSchema(final AttributableType type, final PlainSchemaTO schemaTO) {
+ public void updatePlainSchema(final AttributableType type, final PlainSchemaTO schemaTO) {
getService(SchemaService.class).update(type, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
}
- public PlainSchemaTO deleteSchema(final AttributableType type, final String name) {
+ public PlainSchemaTO deletePlainSchema(final AttributableType type, final String name) {
PlainSchemaTO response = getService(SchemaService.class).read(type, SchemaType.PLAIN, name);
getService(SchemaService.class).delete(type, SchemaType.PLAIN, name);
return response;
@@ -237,9 +237,6 @@ public class SchemaRestClient extends BaseRestClient {
return schemaTO;
}
- /**
- * Populator for Validator Schema DropDown components.
- */
public List<String> getAllValidatorClasses() {
List<String> response = null;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/cxf/org.apache.cxf.Logger b/syncope620/client/console/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
new file mode 100644
index 0000000..6e7bd36
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
@@ -0,0 +1 @@
+org.apache.cxf.common.logging.Slf4jLogger
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico b/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico
deleted file mode 100644
index 599ec2b..0000000
Binary files a/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico and /dev/null differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.png
new file mode 100644
index 0000000..aa2f3e2
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/active.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/active.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/active.png
new file mode 100644
index 0000000..79332c0
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/active.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/inactive.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/inactive.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/inactive.png
new file mode 100644
index 0000000..68975bd
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/inactive.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/objectnotfound.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/objectnotfound.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/objectnotfound.png
new file mode 100644
index 0000000..a0a2933
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/objectnotfound.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/undefined.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/undefined.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/undefined.png
new file mode 100644
index 0000000..97188ba
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/statuses/undefined.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml b/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
index d8e31be..f19df05 100644
--- a/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
+++ b/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
@@ -46,6 +46,10 @@ under the License.
<filter-name>SyncopeConsole</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
+ <param-name>filterMappingUrlPattern</param-name>
+ <param-value>/*</param-value>
+ </init-param>
+ <init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/console.properties b/syncope620/client/console/src/main/resources/console.properties
index 75c88de..3f2667b 100644
--- a/syncope620/client/console/src/main/resources/console.properties
+++ b/syncope620/client/console/src/main/resources/console.properties
@@ -14,8 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+console.directory=${conf.directory}
scheme=http
host=localhost
port=8080
rootPath=/syncope/rest/
-activitiModelerDirectory=${activiti-modeler.directory}
\ No newline at end of file
+activitiModelerDirectory=${activiti-modeler.directory}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/consoleContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/consoleContext.xml b/syncope620/client/console/src/main/resources/consoleContext.xml
index b451ef1..bb7f94b 100644
--- a/syncope620/client/console/src/main/resources/consoleContext.xml
+++ b/syncope620/client/console/src/main/resources/consoleContext.xml
@@ -31,7 +31,7 @@ under the License.
<bean id="confDirectoryPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="order" value="1"/>
- <property name="location" value="file:${conf.directory}/console.properties"/>
+ <property name="location" value="file:${console.directory}/console.properties"/>
<property name="ignoreResourceNotFound" value="true"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
index 223b27a..83cb198 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
@@ -52,3 +52,4 @@ jexl_ex1=surname + ',' + firstname
jexl_ex2='new.' + surname
jexl_syntax_url=Full JEXL reference
create=Create
+key=Key
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
index 3a54be5..96edcee 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
@@ -51,3 +51,4 @@ jexl_ex1=surname + ',' + firstname
jexl_ex2='new.' + surname
jexl_syntax_url=Sintassi JEXL completa
create=Crea
+key=Chiave
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
index dd9ecd7..a7e2880 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
@@ -51,3 +51,4 @@ jexl_ex1=sobrenome + ',' + nome
jexl_ex2='novo.' + sobrenome
jexl_syntax_url=Refer\u00eancia JEXL completa
create=Criar
+key=Chave
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
index ef013ce..0c43c4b 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
@@ -72,7 +72,9 @@ under the License.
</style>
</wicket:head>
<wicket:extend>
- <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/> <span wicket:id="displayName"/>
+ </p>
<span wicket:id="resourceDatatable" id="dataTableSpan">[resources]</span>
<span wicket:id="pwdMgtFields">[password management]</span>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index 44b0e45..1b274a9 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -25,7 +25,7 @@ under the License.
<title>Apache Syncope</title>
- <link rel="shortcut icon" href="img/favicon.ico" />
+ <link rel="shortcut icon" href="img/favicon.png" type="image/png"/>
<style type="text/css">
div.wicket-modal div.w_caption {
[46/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/server/persistence-jpa/src/test/resources/content.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-jpa/src/test/resources/content.xml b/syncope620/server/persistence-jpa/src/test/resources/content.xml
index 4d34efc..dd17aaf 100644
--- a/syncope620/server/persistence-jpa/src/test/resources/content.xml
+++ b/syncope620/server/persistence-jpa/src/test/resources/content.xml
@@ -905,7 +905,7 @@ under the License.
performCreate="1" performUpdate="1" performDelete="1" syncStatus="1" fullReconciliation="0"
jobClassName="org.apache.syncope.server.provisioning.api.job.SyncJob" unmatchingRule="ASSIGN" matchingRule="UPDATE"
userTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"password":null,"status":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"attributes":[{"schema":"type","readonly":false,"values":["email == 'test8@syncope.apache.org'? 'TYPE_8': 'TYPE_OTHER'"]}],"derivedAttributes":[{"schema":"cn","readonly":false,"values":[null]}],"virtualAttributes":[],"resources":["resource-testdb"],"propagationStatuses":[],"memberships":[{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"roleId":8,"roleName":null,"attributes":[{"schema":"subscriptionDate","readonly":false,"values":["'2009-08-18T16:33:12.203+0200'"]}],"derivedAttributes":[],"virtualAttributes":[]}]}'
- roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":0,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rAttrTemplates":[],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
+ roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":0,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rPlainAttrTemplates":[],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mPlainAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
<Task DTYPE="SchedTask" type="SCHEDULED" id="5" name="SampleJob Task" jobClassName="org.apache.syncope.server.provisioning.java.job.SampleJob" cronExpression="0 0 0 1 * ?"/>
<Task DTYPE="PropagationTask" type="PROPAGATION" id="6" propagationMode="TWO_PHASES" propagationOperation="UPDATE"
objectClassName="__ACCOUNT__" resource_name="ws-target-resource-nopropagation" subjectType="USER" subjectId="1"
@@ -915,7 +915,7 @@ under the License.
performCreate="1" performUpdate="1" performDelete="0" syncStatus="1" fullReconciliation="1"
jobClassName="org.apache.syncope.server.provisioning.api.job.SyncJob" unmatchingRule="PROVISION" matchingRule="UPDATE"
userTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"password":null,"status":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"attributes":[{"schema":"type","readonly":false,"values":["'type a'"]},{"schema":"userId","readonly":false,"values":["'reconciled@syncope.apache.org'"]},{"schema":"fullname","readonly":false,"values":["'reconciled fullname'"]},{"schema":"surname","readonly":false,"values":["'surname'"]}],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"memberships":[]}'
- roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":0,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rAttrTemplates":[],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
+ roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":0,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rPlainAttrTemplates":[],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mPlainAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
<Task DTYPE="NotificationTask" type="NOTIFICATION" id="8" sender="admin@prova.org" subject="Notification for SYNCOPE-81"
textBody="NOTIFICATION-81" htmlBody="NOTIFICATION-81" traceLevel="ALL"/>
<Task DTYPE="SyncTask" type="SYNCHRONIZATION" id="9" name="TestDB2 Task" resource_name="resource-testdb2"
@@ -928,7 +928,7 @@ under the License.
fullReconciliation="1" performCreate="1" performDelete="1" performUpdate="1" syncStatus="0"
jobClassName="org.apache.syncope.server.provisioning.api.job.SyncJob" unmatchingRule="PROVISION" matchingRule="UPDATE"
userTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"password":null,"status":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[{"schema":"virtualReadOnly","readonly":false,"values":[""]}],"resources":["resource-ldap"],"propagationStatuses":[],"memberships":[]}'
- roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":8,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[{"schema":"show","readonly":false,"values":["'true'"]}],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rAttrTemplates":["show"],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
+ roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":8,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[{"schema":"show","readonly":false,"values":["'true'"]}],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rPlainAttrTemplates":["show"],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mPlainAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
<SyncTask_actionsClassNames SyncTask_id="11" actionClassName="org.apache.syncope.server.provisioning.java.sync.LDAPMembershipSyncActions"/>
<Task DTYPE="SyncTask" type="SYNCHRONIZATION" id="12" name="VirAttrCache test" resource_name="resource-csv"
performCreate="0" performUpdate="1" performDelete="0" syncStatus="0" fullReconciliation="1"
@@ -981,7 +981,7 @@ under the License.
performCreate="1" performUpdate="1" performDelete="1" syncStatus="1" fullReconciliation="0"
jobClassName="org.apache.syncope.server.provisioning.api.job.SyncJob" unmatchingRule="PROVISION" matchingRule="UPDATE"
userTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"password":null,"status":null,"token":null,"tokenExpireTime":null,"username":null,"lastLoginDate":null,"changePwdDate":null,"failedLogins":null,"attributes":[{"schema":"firstname","readonly":false,"values":[""]},{"schema":"userId","readonly":false,"values":["'test'"]},{"schema":"fullname","readonly":false,"values":["'test'"]},{"schema":"surname","readonly":false,"values":["'test'"]}],"derivedAttributes":[],"virtualAttributes":[],"resources":["resource-testdb"],"propagationStatuses":[],"memberships":[]}'
- roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":0,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rAttrTemplates":[],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
+ roleTemplate='{"creator":null,"creationDate":null,"lastModifier":null,"lastChangeDate":null,"key":0,"name":null,"parent":0,"userOwner":null,"roleOwner":null,"inheritOwner":false,"inheritTemplates":false,"inheritPlainAttrs":false,"inheritDerAttrs":false,"inheritVirAttrs":false,"inheritPasswordPolicy":false,"inheritAccountPolicy":false,"passwordPolicy":null,"accountPolicy":null,"attributes":[],"derivedAttributes":[],"virtualAttributes":[],"resources":[],"propagationStatuses":[],"entitlements":[],"rPlainAttrTemplates":[],"rDerAttrTemplates":[],"rVirAttrTemplates":[],"mPlainAttrTemplates":[],"mDerAttrTemplates":[],"mVirAttrTemplates":[]}'/>
<Task DTYPE="SyncTask" type="SYNCHRONIZATION" id="25" name="CSV (unlink matching; ignore unmatching)" resource_name="resource-csv"
performCreate="1" performUpdate="1" performDelete="1" syncStatus="1" fullReconciliation="0"
jobClassName="org.apache.syncope.server.provisioning.api.job.SyncJob" unmatchingRule="IGNORE" matchingRule="UNLINK"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/data/RoleDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/data/RoleDataBinderImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/data/RoleDataBinderImpl.java
index 3004a99..84c9778 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/data/RoleDataBinderImpl.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/data/RoleDataBinderImpl.java
@@ -143,10 +143,10 @@ public class RoleDataBinderImpl extends AbstractAttributableDataBinder implement
}
// attribute templates
- setAttrTemplates(role, roleTO.getRAttrTemplates(), RPlainAttrTemplate.class, RPlainSchema.class);
+ setAttrTemplates(role, roleTO.getRPlainAttrTemplates(), RPlainAttrTemplate.class, RPlainSchema.class);
setAttrTemplates(role, roleTO.getRDerAttrTemplates(), RDerAttrTemplate.class, RDerSchema.class);
setAttrTemplates(role, roleTO.getRVirAttrTemplates(), RVirAttrTemplate.class, RVirSchema.class);
- setAttrTemplates(role, roleTO.getMAttrTemplates(), MPlainAttrTemplate.class, MPlainSchema.class);
+ setAttrTemplates(role, roleTO.getMPlainAttrTemplates(), MPlainAttrTemplate.class, MPlainSchema.class);
setAttrTemplates(role, roleTO.getMDerAttrTemplates(), MDerAttrTemplate.class, MDerSchema.class);
setAttrTemplates(role, roleTO.getMVirAttrTemplates(), MVirAttrTemplate.class, MVirSchema.class);
@@ -375,7 +375,7 @@ public class RoleDataBinderImpl extends AbstractAttributableDataBinder implement
}
for (RPlainAttrTemplate template : role.findInheritedTemplates(RPlainAttrTemplate.class)) {
- roleTO.getRAttrTemplates().add(template.getSchema().getKey());
+ roleTO.getRPlainAttrTemplates().add(template.getSchema().getKey());
}
for (RDerAttrTemplate template : role.findInheritedTemplates(RDerAttrTemplate.class)) {
roleTO.getRDerAttrTemplates().add(template.getSchema().getKey());
@@ -384,7 +384,7 @@ public class RoleDataBinderImpl extends AbstractAttributableDataBinder implement
roleTO.getRVirAttrTemplates().add(template.getSchema().getKey());
}
for (MPlainAttrTemplate template : role.findInheritedTemplates(MPlainAttrTemplate.class)) {
- roleTO.getMAttrTemplates().add(template.getSchema().getKey());
+ roleTO.getMPlainAttrTemplates().add(template.getSchema().getKey());
}
for (MDerAttrTemplate template : role.findInheritedTemplates(MDerAttrTemplate.class)) {
roleTO.getMDerAttrTemplates().add(template.getSchema().getKey());
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
index b8bdd0a..02d8aa3 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ResourceServiceImpl.java
@@ -30,7 +30,7 @@ import org.apache.syncope.common.lib.to.ConnObjectTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.wrap.SubjectId;
+import org.apache.syncope.common.lib.wrap.SubjectKey;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.service.ResourceService;
import org.apache.syncope.server.logic.AbstractResourceAssociator;
@@ -99,7 +99,7 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
@Override
public BulkActionResult bulkDeassociation(final String resourceKey, final SubjectType subjectType,
- final ResourceDeassociationActionType type, final List<SubjectId> subjectIds) {
+ final ResourceDeassociationActionType type, final List<SubjectKey> subjectKeys) {
AbstractResourceAssociator<? extends AbstractAttributableTO> associator = subjectType == SubjectType.USER
? userLogic
@@ -107,29 +107,29 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
final BulkActionResult res = new BulkActionResult();
- for (SubjectId id : subjectIds) {
+ for (SubjectKey key : subjectKeys) {
final Set<String> resources = Collections.singleton(resourceKey);
try {
switch (type) {
case DEPROVISION:
- associator.deprovision(id.getElement(), resources);
+ associator.deprovision(key.getElement(), resources);
break;
case UNASSIGN:
- associator.unassign(id.getElement(), resources);
+ associator.unassign(key.getElement(), resources);
break;
case UNLINK:
- associator.unlink(id.getElement(), resources);
+ associator.unlink(key.getElement(), resources);
break;
default:
}
- res.add(id, BulkActionResult.Status.SUCCESS);
+ res.add(key, BulkActionResult.Status.SUCCESS);
} catch (Exception e) {
- LOG.warn("While executing {} on {} {}", type, subjectType, id.getElement(), e);
- res.add(id, BulkActionResult.Status.FAILURE);
+ LOG.warn("While executing {} on {} {}", type, subjectType, key.getElement(), e);
+ res.add(key, BulkActionResult.Status.FAILURE);
}
}
[04/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java
new file mode 100644
index 0000000..57dfbb0
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java
@@ -0,0 +1,182 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class SearchITCase extends AbstractITCase {
+
+ @Test
+ public void searchUser() {
+ // LIKE
+ PagedResult<UserTO> matchedUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().
+ is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query());
+ assertNotNull(matchedUsers);
+ assertFalse(matchedUsers.getResult().isEmpty());
+
+ for (UserTO user : matchedUsers.getResult()) {
+ assertNotNull(user);
+ }
+
+ // ISNULL
+ matchedUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().isNull("loginDate").query());
+ assertNotNull(matchedUsers);
+ assertFalse(matchedUsers.getResult().isEmpty());
+
+ Set<Long> userIds = new HashSet<Long>(matchedUsers.getResult().size());
+ for (UserTO user : matchedUsers.getResult()) {
+ userIds.add(user.getKey());
+ }
+ assertTrue(userIds.contains(2L));
+ assertTrue(userIds.contains(3L));
+ }
+
+ @Test
+ public void searchByUsernameAndKey() {
+ final PagedResult<UserTO> matchingUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().
+ is("username").equalTo("rossini").and("key").lessThan(2).query());
+
+ assertNotNull(matchingUsers);
+ assertEquals(1, matchingUsers.getResult().size());
+ assertEquals("rossini", matchingUsers.getResult().iterator().next().getUsername());
+ assertEquals(1L, matchingUsers.getResult().iterator().next().getKey());
+ }
+
+ @Test
+ public void searchByRolenameAndKey() {
+ final PagedResult<RoleTO> matchingRoles = roleService.search(
+ SyncopeClient.getRoleSearchConditionBuilder().
+ is("name").equalTo("root").and("key").lessThan(2).query());
+
+ assertNotNull(matchingRoles);
+ assertEquals(1, matchingRoles.getResult().size());
+ assertEquals("root", matchingRoles.getResult().iterator().next().getName());
+ assertEquals(1L, matchingRoles.getResult().iterator().next().getKey());
+ }
+
+ @Test
+ public void searchUserByResourceName() {
+ PagedResult<UserTO> matchedUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().hasResources(RESOURCE_NAME_MAPPINGS2).query());
+ assertNotNull(matchedUsers);
+ assertFalse(matchedUsers.getResult().isEmpty());
+
+ Set<Long> userIds = new HashSet<Long>(matchedUsers.getResult().size());
+ for (UserTO user : matchedUsers.getResult()) {
+ userIds.add(user.getKey());
+ }
+
+ assertEquals(1, userIds.size());
+ assertTrue(userIds.contains(2L));
+ }
+
+ @Test
+ public void paginatedSearch() {
+ // LIKE
+ PagedResult<UserTO> matchingUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().
+ is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query(), 1, 2);
+ assertNotNull(matchingUsers);
+
+ assertFalse(matchingUsers.getResult().isEmpty());
+ for (UserTO user : matchingUsers.getResult()) {
+ assertNotNull(user);
+ }
+
+ // ISNULL
+ matchingUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().isNull("loginDate").query(), 1, 2);
+
+ assertNotNull(matchingUsers);
+ assertFalse(matchingUsers.getResult().isEmpty());
+ Set<Long> userIds = new HashSet<>(matchingUsers.getResult().size());
+ for (UserTO user : matchingUsers.getResult()) {
+ userIds.add(user.getKey());
+ }
+ assertEquals(2, userIds.size());
+ }
+
+ @Test
+ public void searchByBooleanSubjectCond() {
+ final PagedResult<RoleTO> matchingRoles = roleService.search(
+ SyncopeClient.getRoleSearchConditionBuilder().is("inheritPlainAttrs").equalTo("true").query());
+ assertNotNull(matchingRoles);
+ assertFalse(matchingRoles.getResult().isEmpty());
+ }
+
+ @Test
+ public void searchByEntitlement() {
+ final PagedResult<RoleTO> matchingRoles = roleService.search(
+ SyncopeClient.getRoleSearchConditionBuilder().hasEntitlements("USER_LIST", "USER_READ").query());
+ assertNotNull(matchingRoles);
+ assertFalse(matchingRoles.getResult().isEmpty());
+ }
+
+ @Test
+ public void searchByRelationshipSubjectCond() {
+ final PagedResult<RoleTO> matchingRoles = roleService.search(SyncopeClient.getRoleSearchConditionBuilder().
+ isNotNull("passwordPolicy").and("userOwner").equalTo(5).query());
+
+ assertNotNull(matchingRoles);
+ assertEquals(1, matchingRoles.getResult().size());
+ assertEquals("director", matchingRoles.getResult().iterator().next().getName());
+ assertEquals(6L, matchingRoles.getResult().iterator().next().getKey());
+ }
+
+ @Test
+ public void nested() {
+ PagedResult<UserTO> matchedUsers = userService.search(
+ "((fullname==*o*,fullname==*i*);$resources!=ws-target-resource-1)", 1, 2);
+ assertNotNull(matchedUsers);
+
+ assertFalse(matchedUsers.getResult().isEmpty());
+ for (UserTO user : matchedUsers.getResult()) {
+ assertNotNull(user);
+ }
+ }
+
+ @Test
+ public void orderBy() {
+ final PagedResult<UserTO> matchedUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().is("userId").equalTo("*@apache.org").query(),
+ SyncopeClient.getOrderByClauseBuilder().asc("status").desc("firstname").build());
+
+ assertFalse(matchedUsers.getResult().isEmpty());
+ for (UserTO user : matchedUsers.getResult()) {
+ assertNotNull(user);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java
new file mode 100644
index 0000000..da65d29
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java
@@ -0,0 +1,99 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class SecurityQuestionITCase extends AbstractITCase {
+
+ @Test
+ public void read() {
+ SecurityQuestionTO securityQuestionTO = securityQuestionService.read(1L);
+ assertNotNull(securityQuestionTO);
+ }
+
+ @Test
+ public void list() {
+ List<SecurityQuestionTO> securityQuestionTOs = securityQuestionService.list();
+ assertNotNull(securityQuestionTOs);
+ assertFalse(securityQuestionTOs.isEmpty());
+ for (SecurityQuestionTO instance : securityQuestionTOs) {
+ assertNotNull(instance);
+ }
+ }
+
+ @Test
+ public void create() {
+ SecurityQuestionTO securityQuestionTO = new SecurityQuestionTO();
+ securityQuestionTO.setContent("What is your favorite pet's name?");
+
+ Response response = securityQuestionService.create(securityQuestionTO);
+ SecurityQuestionTO actual = getObject(response.getLocation(), SecurityQuestionService.class,
+ SecurityQuestionTO.class);
+
+ assertNotNull(actual);
+ assertNotNull(actual.getKey());
+ securityQuestionTO.setKey(actual.getKey());
+ assertEquals(actual, securityQuestionTO);
+ }
+
+ @Test
+ public void update() {
+ SecurityQuestionTO securityQuestionTO = securityQuestionService.read(1L);
+ securityQuestionTO.setContent("What is your favorite color?");
+
+ securityQuestionService.update(securityQuestionTO.getKey(), securityQuestionTO);
+ SecurityQuestionTO actual = securityQuestionService.read(securityQuestionTO.getKey());
+ assertNotNull(actual);
+ assertEquals(actual, securityQuestionTO);
+ }
+
+ @Test
+ public void delete() {
+ SecurityQuestionTO securityQuestion = new SecurityQuestionTO();
+ securityQuestion.setContent("What is your first pet's name?");
+
+ Response response = securityQuestionService.create(securityQuestion);
+ securityQuestion = getObject(response.getLocation(), SecurityQuestionService.class, SecurityQuestionTO.class);
+
+ securityQuestionService.delete(securityQuestion.getKey());
+
+ try {
+ securityQuestionService.read(securityQuestion.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java
new file mode 100644
index 0000000..7b66d26
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java
@@ -0,0 +1,694 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.apache.syncope.fit.server.reference.AbstractITCase.RESOURCE_NAME_TESTDB;
+import static org.apache.syncope.fit.server.reference.AbstractITCase.RESOURCE_NAME_WS2;
+import static org.apache.syncope.fit.server.reference.AbstractITCase.roleService;
+import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.SyncPolicyTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.TaskService;
+import org.apache.syncope.server.misc.security.Encryptor;
+import org.apache.syncope.server.provisioning.java.sync.DBPasswordSyncActions;
+import org.apache.syncope.server.provisioning.java.sync.LDAPPasswordSyncActions;
+import org.identityconnectors.framework.common.objects.Name;
+import org.junit.BeforeClass;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class SyncTaskITCase extends AbstractTaskITCase {
+
+ @BeforeClass
+ public static void testSyncActionsSetup() {
+ SyncTaskTO syncTask = taskService.read(SYNC_TASK_ID);
+ syncTask.getActionsClassNames().add(TestSyncActions.class.getName());
+ taskService.update(SYNC_TASK_ID, syncTask);
+ }
+
+ @Test
+ public void getSyncActionsClasses() {
+ List<String> actions = syncopeService.info().getSyncActions();
+ assertNotNull(actions);
+ assertFalse(actions.isEmpty());
+ }
+
+ @Test
+ public void list() {
+ final PagedResult<SyncTaskTO> tasks = taskService.list(TaskType.SYNCHRONIZATION);
+ assertFalse(tasks.getResult().isEmpty());
+ for (AbstractTaskTO task : tasks.getResult()) {
+ if (!(task instanceof SyncTaskTO)) {
+ fail();
+ }
+ }
+ }
+
+ @Test
+ public void create() {
+ SyncTaskTO task = new SyncTaskTO();
+ task.setName("Test create Sync");
+ task.setResource(RESOURCE_NAME_WS2);
+
+ UserTO userTemplate = new UserTO();
+ userTemplate.getResources().add(RESOURCE_NAME_WS2);
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ userTemplate.getMemberships().add(membershipTO);
+ task.setUserTemplate(userTemplate);
+
+ RoleTO roleTemplate = new RoleTO();
+ roleTemplate.getResources().add(RESOURCE_NAME_LDAP);
+ task.setRoleTemplate(roleTemplate);
+
+ Response response = taskService.create(task);
+ SyncTaskTO actual = getObject(response.getLocation(), TaskService.class, SyncTaskTO.class);
+ assertNotNull(actual);
+
+ task = taskService.read(actual.getKey());
+ assertNotNull(task);
+ assertEquals(actual.getKey(), task.getKey());
+ assertEquals(actual.getJobClassName(), task.getJobClassName());
+ assertEquals(userTemplate, task.getUserTemplate());
+ assertEquals(roleTemplate, task.getRoleTemplate());
+ }
+
+ @Test
+ public void sync() throws Exception {
+ removeTestUsers();
+
+ // -----------------------------
+ // Create a new user ... it should be updated applying sync policy
+ // -----------------------------
+ UserTO inUserTO = new UserTO();
+ inUserTO.setPassword("password123");
+ String userName = "test9";
+ inUserTO.setUsername(userName);
+ inUserTO.getPlainAttrs().add(attrTO("firstname", "nome9"));
+ inUserTO.getPlainAttrs().add(attrTO("surname", "cognome"));
+ inUserTO.getPlainAttrs().add(attrTO("type", "a type"));
+ inUserTO.getPlainAttrs().add(attrTO("fullname", "nome cognome"));
+ inUserTO.getPlainAttrs().add(attrTO("userId", "puccini@syncope.apache.org"));
+ inUserTO.getPlainAttrs().add(attrTO("email", "puccini@syncope.apache.org"));
+ inUserTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ inUserTO = createUser(inUserTO);
+ assertNotNull(inUserTO);
+ assertFalse(inUserTO.getResources().contains(RESOURCE_NAME_CSV));
+
+ // -----------------------------
+ try {
+ int usersPre = userService.list(1, 1).getTotalCount();
+ assertNotNull(usersPre);
+
+ execSyncTask(SYNC_TASK_ID, 50, false);
+
+ // after execution of the sync task the user data should be synced from
+ // csv datasource and processed by user template
+ UserTO userTO = userService.read(inUserTO.getKey());
+ assertNotNull(userTO);
+ assertEquals(userName, userTO.getUsername());
+ assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+ ? "active" : "created", userTO.getStatus());
+ assertEquals("test9@syncope.apache.org", userTO.getPlainAttrMap().get("email").getValues().get(0));
+ assertEquals("test9@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
+ assertTrue(Integer.valueOf(userTO.getPlainAttrMap().get("fullname").getValues().get(0)) <= 10);
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_WS2));
+
+ // Matching --> Update (no link)
+ assertFalse(userTO.getResources().contains(RESOURCE_NAME_CSV));
+
+ // check for user template
+ userTO = readUser("test7");
+ assertNotNull(userTO);
+ assertEquals("TYPE_OTHER", userTO.getPlainAttrMap().get("type").getValues().get(0));
+ assertEquals(3, userTO.getResources().size());
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_WS2));
+ assertEquals(1, userTO.getMemberships().size());
+ assertTrue(userTO.getMemberships().get(0).getPlainAttrMap().containsKey("subscriptionDate"));
+
+ // Unmatching --> Assign (link)
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_CSV));
+
+ userTO = readUser("test8");
+ assertNotNull(userTO);
+ assertEquals("TYPE_8", userTO.getPlainAttrMap().get("type").getValues().get(0));
+
+ // check for sync results
+ int usersPost = userService.list(1, 1).getTotalCount();
+ assertNotNull(usersPost);
+ assertEquals(usersPre + 9, usersPost);
+
+ // Check for issue 215:
+ // * expected disabled user test1
+ // * expected enabled user test2
+ userTO = readUser("test1");
+ assertNotNull(userTO);
+ assertEquals("suspended", userTO.getStatus());
+
+ userTO = readUser("test3");
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+
+ // SYNCOPE-317
+ execSyncTask(SYNC_TASK_ID, 50, false);
+
+ final Set<Long> pushTaskIds = new HashSet<>();
+ pushTaskIds.add(25L);
+ pushTaskIds.add(26L);
+
+ execSyncTasks(pushTaskIds, 50, false);
+ // Matching --> UNLINK
+ assertFalse(readUser("test9").getResources().contains(RESOURCE_NAME_CSV));
+ assertFalse(readUser("test7").getResources().contains(RESOURCE_NAME_CSV));
+ } finally {
+ removeTestUsers();
+ }
+ }
+
+ @Test
+ public void dryRun() {
+ TaskExecTO execution = execSyncTask(SYNC_TASK_ID, 50, true);
+ assertEquals("Execution of task " + execution.getTask() + " failed with message " + execution.getMessage(),
+ "SUCCESS", execution.getStatus());
+ }
+
+ @Test
+ public void reconcileFromDB() {
+ // update sync task
+ TaskExecTO execution = execSyncTask(7L, 50, false);
+ assertNotNull(execution.getStatus());
+ assertTrue(PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful());
+
+ UserTO userTO = readUser("testuser1");
+ assertNotNull(userTO);
+ assertEquals("reconciled@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
+ assertEquals("suspended", userTO.getStatus());
+
+ // enable user on external resource
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ jdbcTemplate.execute("UPDATE TEST SET STATUS=TRUE");
+
+ // re-execute the same SyncTask: now user must be active
+ execution = execSyncTask(7L, 50, false);
+ assertNotNull(execution.getStatus());
+ assertTrue(PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful());
+
+ userTO = readUser("testuser1");
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+ }
+
+ /**
+ * Clean Syncope and LDAP resource status.
+ */
+ private void ldapCleanup() {
+ PagedResult<RoleTO> matchingRoles = roleService.search(
+ SyncopeClient.getRoleSearchConditionBuilder().is("name").equalTo("testLDAPGroup").query());
+ if (matchingRoles.getSize() > 0) {
+ for (RoleTO role : matchingRoles.getResult()) {
+ roleService.bulkDeassociation(role.getKey(),
+ ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class));
+ roleService.delete(role.getKey());
+ }
+ }
+ PagedResult<UserTO> matchingUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().is("username").equalTo("syncFromLDAP").query());
+ if (matchingUsers.getSize() > 0) {
+ for (UserTO user : matchingUsers.getResult()) {
+ userService.bulkDeassociation(user.getKey(),
+ ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class));
+ userService.delete(user.getKey());
+ }
+ }
+ }
+
+ @Test
+ public void reconcileFromLDAP() {
+ // First of all, clear any potential conflict with existing user / role
+ ldapCleanup();
+
+ // Update sync task
+ TaskExecTO execution = execSyncTask(11L, 50, false);
+
+ // 1. verify execution status
+ final String status = execution.getStatus();
+ assertNotNull(status);
+ assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
+
+ // 2. verify that synchronized role is found, with expected attributes
+ final PagedResult<RoleTO> matchingRoles = roleService.search(
+ SyncopeClient.getRoleSearchConditionBuilder().is("name").equalTo("testLDAPGroup").query());
+ assertNotNull(matchingRoles);
+ assertEquals(1, matchingRoles.getResult().size());
+
+ final PagedResult<UserTO> matchingUsers = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().is("username").equalTo("syncFromLDAP").query());
+ assertNotNull(matchingUsers);
+ assertEquals(1, matchingUsers.getResult().size());
+
+ // Check for SYNCOPE-436
+ assertEquals("syncFromLDAP",
+ matchingUsers.getResult().get(0).getVirAttrMap().get("virtualReadOnly").getValues().get(0));
+ // Check for SYNCOPE-270
+ assertNotNull(matchingUsers.getResult().get(0).getPlainAttrMap().get("obscure"));
+ // Check for SYNCOPE-123
+ assertNotNull(matchingUsers.getResult().get(0).getPlainAttrMap().get("photo"));
+
+ final RoleTO roleTO = matchingRoles.getResult().iterator().next();
+ assertNotNull(roleTO);
+ assertEquals("testLDAPGroup", roleTO.getName());
+ assertEquals(8L, roleTO.getParent());
+ assertEquals("true", roleTO.getPlainAttrMap().get("show").getValues().get(0));
+ assertEquals(matchingUsers.getResult().iterator().next().getKey(), (long) roleTO.getUserOwner());
+ assertNull(roleTO.getRoleOwner());
+
+ // 3. verify that LDAP group membership is propagated as Syncope role membership
+ final PagedResult<UserTO> members = userService.search(
+ SyncopeClient.getUserSearchConditionBuilder().hasRoles(roleTO.getKey()).query());
+ assertNotNull(members);
+ assertEquals(1, members.getResult().size());
+ }
+
+ @Test
+ public void issueSYNCOPE68() {
+ //-----------------------------
+ // Create a new user ... it should be updated applying sync policy
+ //-----------------------------
+ UserTO userTO = new UserTO();
+ userTO.setPassword("password123");
+ userTO.setUsername("testuser2");
+
+ userTO.getPlainAttrs().add(attrTO("firstname", "testuser2"));
+ userTO.getPlainAttrs().add(attrTO("surname", "testuser2"));
+ userTO.getPlainAttrs().add(attrTO("type", "a type"));
+ userTO.getPlainAttrs().add(attrTO("fullname", "a type"));
+ userTO.getPlainAttrs().add(attrTO("userId", "testuser2@syncope.apache.org"));
+ userTO.getPlainAttrs().add(attrTO("email", "testuser2@syncope.apache.org"));
+
+ userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION2);
+ userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION4);
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals("testuser2", userTO.getUsername());
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals(3, userTO.getResources().size());
+ //-----------------------------
+
+ try {
+ //-----------------------------
+ // add user template
+ //-----------------------------
+ UserTO template = new UserTO();
+
+ membershipTO = new MembershipTO();
+ membershipTO.setRoleId(10L);
+
+ template.getMemberships().add(membershipTO);
+
+ template.getResources().add(RESOURCE_NAME_NOPROPAGATION4);
+ //-----------------------------
+
+ // Update sync task
+ SyncTaskTO task = taskService.read(9L);
+ assertNotNull(task);
+
+ task.setUserTemplate(template);
+
+ taskService.update(task.getKey(), task);
+ SyncTaskTO actual = taskService.read(task.getKey());
+ assertNotNull(actual);
+ assertEquals(task.getKey(), actual.getKey());
+ assertFalse(actual.getUserTemplate().getResources().isEmpty());
+ assertFalse(actual.getUserTemplate().getMemberships().isEmpty());
+
+ TaskExecTO execution = execSyncTask(actual.getKey(), 50, false);
+ final String status = execution.getStatus();
+ assertNotNull(status);
+ assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
+
+ userTO = readUser("testuser2");
+ assertNotNull(userTO);
+ assertEquals("testuser2@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
+ assertEquals(2, userTO.getMemberships().size());
+ assertEquals(4, userTO.getResources().size());
+ } finally {
+ UserTO dUserTO = deleteUser(userTO.getKey());
+ assertNotNull(dUserTO);
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE230() {
+ // 1. read SyncTask for resource-db-sync (table TESTSYNC on external H2)
+ execSyncTask(10L, 50, false);
+
+ // 3. read e-mail address for user created by the SyncTask first execution
+ UserTO userTO = readUser("issuesyncope230");
+ assertNotNull(userTO);
+ String email = userTO.getPlainAttrMap().get("email").getValues().iterator().next();
+ assertNotNull(email);
+
+ // 4. update TESTSYNC on external H2 by changing e-mail address
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ jdbcTemplate.execute("UPDATE TESTSYNC SET email='updatedSYNCOPE230@syncope.apache.org'");
+
+ // 5. re-execute the SyncTask
+ execSyncTask(10L, 50, false);
+
+ // 6. verify that the e-mail was updated
+ userTO = readUser("issuesyncope230");
+ assertNotNull(userTO);
+ email = userTO.getPlainAttrMap().get("email").getValues().iterator().next();
+ assertNotNull(email);
+ assertEquals("updatedSYNCOPE230@syncope.apache.org", email);
+ }
+
+ @Test
+ public void issueSYNCOPE258() {
+ // -----------------------------
+ // Add a custom correlation rule
+ // -----------------------------
+ SyncPolicyTO policyTO = policyService.read(9L);
+ policyTO.getSpecification().setUserJavaRule(TestSyncRule.class.getName());
+
+ policyService.update(policyTO.getKey(), policyTO);
+ // -----------------------------
+
+ SyncTaskTO task = new SyncTaskTO();
+ task.setName("Test Sync Rule");
+ task.setResource(RESOURCE_NAME_WS2);
+ task.setFullReconciliation(true);
+ task.setPerformCreate(true);
+ task.setPerformDelete(true);
+ task.setPerformUpdate(true);
+
+ Response response = taskService.create(task);
+ SyncTaskTO actual = getObject(response.getLocation(), TaskService.class, SyncTaskTO.class);
+ assertNotNull(actual);
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("s258_1@apache.org");
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_WS2);
+
+ createUser(userTO);
+
+ userTO = UserITCase.getUniqueSampleTO("s258_2@apache.org");
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_WS2);
+
+ userTO = createUser(userTO);
+
+ // change email in order to unmatch the second user
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getPlainAttrsToRemove().add("email");
+ userMod.getPlainAttrsToUpdate().add(attrMod("email", "s258@apache.org"));
+
+ userService.update(userMod.getKey(), userMod);
+
+ execSyncTask(actual.getKey(), 50, false);
+
+ SyncTaskTO executed = taskService.read(actual.getKey());
+ assertEquals(1, executed.getExecutions().size());
+
+ // asser for just one match
+ assertTrue(executed.getExecutions().get(0).getMessage().substring(0, 55) + "...",
+ executed.getExecutions().get(0).getMessage().contains("[updated/failures]: 1/0"));
+ }
+
+ @Test
+ public void issueSYNCOPE272() {
+ removeTestUsers();
+
+ // create user with testdb resource
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope272@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ userTO = createUser(userTO);
+ try {
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getPropagationStatusTOs().size());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+
+ TaskExecTO taskExecTO = execSyncTask(24L, 50, false);
+
+ assertNotNull(taskExecTO.getStatus());
+ assertTrue(PropagationTaskExecStatus.valueOf(taskExecTO.getStatus()).isSuccessful());
+
+ userTO = userService.read(userTO.getKey());
+ assertNotNull(userTO);
+ assertNotNull(userTO.getPlainAttrMap().get("firstname").getValues().get(0));
+ } finally {
+ removeTestUsers();
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE307() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("s307@apache.org");
+
+ AttrTO csvuserid = new AttrTO();
+ csvuserid.setSchema("csvuserid");
+ userTO.getDerAttrs().add(csvuserid);
+
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_WS2);
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ userTO = userService.read(userTO.getKey());
+ assertEquals("virtualvalue", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // Update sync task
+ SyncTaskTO task = taskService.read(12L);
+ assertNotNull(task);
+
+ // add user template
+ UserTO template = new UserTO();
+ template.getResources().add(RESOURCE_NAME_DBVIRATTR);
+
+ AttrTO userId = attrTO("userId", "'s307@apache.org'");
+ template.getPlainAttrs().add(userId);
+
+ AttrTO email = attrTO("email", "'s307@apache.org'");
+ template.getPlainAttrs().add(email);
+
+ task.setUserTemplate(template);
+
+ taskService.update(task.getKey(), task);
+ execSyncTask(task.getKey(), 50, false);
+
+ // check for sync policy
+ userTO = userService.read(userTO.getKey());
+ assertEquals("virtualvalue", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ try {
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ String value = jdbcTemplate.queryForObject(
+ "SELECT USERNAME FROM testsync WHERE ID=?", String.class, userTO.getKey());
+ assertEquals("virtualvalue", value);
+ } catch (EmptyResultDataAccessException e) {
+ assertTrue(false);
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE313DB() throws Exception {
+ // 1. create user in DB
+ UserTO user = UserITCase.getUniqueSampleTO("syncope313-db@syncope.apache.org");
+ user.setPassword("security");
+ user.getResources().add(RESOURCE_NAME_TESTDB);
+ user = createUser(user);
+ assertNotNull(user);
+ assertFalse(user.getResources().isEmpty());
+
+ // 2. Check that the DB resource has the correct password
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ String value = jdbcTemplate.queryForObject(
+ "SELECT PASSWORD FROM test WHERE ID=?", String.class, user.getUsername());
+ assertEquals(Encryptor.getInstance().encode("security", CipherAlgorithm.SHA1), value.toUpperCase());
+
+ // 3. Update the password in the DB
+ String newPassword = Encryptor.getInstance().encode("new-security", CipherAlgorithm.SHA1);
+ jdbcTemplate.execute(
+ "UPDATE test set PASSWORD='" + newPassword + "' where ID='" + user.getUsername() + "'");
+
+ // 4. Sync the user from the resource
+ SyncTaskTO syncTask = new SyncTaskTO();
+ syncTask.setName("DB Sync Task");
+ syncTask.setPerformCreate(true);
+ syncTask.setPerformUpdate(true);
+ syncTask.setFullReconciliation(true);
+ syncTask.setResource(RESOURCE_NAME_TESTDB);
+ syncTask.getActionsClassNames().add(DBPasswordSyncActions.class.getName());
+ Response taskResponse = taskService.create(syncTask);
+
+ SyncTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, SyncTaskTO.class);
+ assertNotNull(actual);
+
+ syncTask = taskService.read(actual.getKey());
+ assertNotNull(syncTask);
+ assertEquals(actual.getKey(), syncTask.getKey());
+ assertEquals(actual.getJobClassName(), syncTask.getJobClassName());
+
+ TaskExecTO execution = execSyncTask(syncTask.getKey(), 50, false);
+ final String status = execution.getStatus();
+ assertNotNull(status);
+ assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
+
+ // 5. Test the sync'd user
+ UserTO updatedUser = userService.read(user.getKey());
+ assertEquals(newPassword, updatedUser.getPassword());
+
+ // 6. Delete SyncTask + user
+ taskService.delete(syncTask.getKey());
+ deleteUser(user.getKey());
+ }
+
+ @Test
+ public void issueSYNCOPE313LDAP() throws Exception {
+ // First of all, clear any potential conflict with existing user / role
+ ldapCleanup();
+
+ // 1. create user in LDAP
+ UserTO user = UserITCase.getUniqueSampleTO("syncope313-ldap@syncope.apache.org");
+ user.setPassword("security");
+ user.getResources().add(RESOURCE_NAME_LDAP);
+ user = createUser(user);
+ assertNotNull(user);
+ assertFalse(user.getResources().isEmpty());
+
+ // 2. request to change password only on Syncope and not on LDAP
+ UserMod userMod = new UserMod();
+ userMod.setKey(user.getKey());
+ userMod.setPassword("new-security");
+ StatusMod pwdPropRequest = new StatusMod();
+ pwdPropRequest.setOnSyncope(true);
+ pwdPropRequest.getResourceNames().clear();
+ userMod.setPwdPropRequest(pwdPropRequest);
+ updateUser(userMod);
+
+ // 3. Check that the Syncope user now has the changed password
+ UserTO updatedUser = userService.read(user.getKey());
+ String encodedNewPassword = Encryptor.getInstance().encode("new-security", CipherAlgorithm.SHA1);
+ assertEquals(encodedNewPassword, updatedUser.getPassword());
+
+ // 4. Check that the LDAP resource has the old password
+ ConnObjectTO connObject =
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, user.getKey());
+ assertNotNull(getLdapRemoteObject(
+ connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+ "security",
+ connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+
+ // 5. Update the LDAP Connector to retrieve passwords
+ ResourceTO ldapResource = resourceService.read(RESOURCE_NAME_LDAP);
+ ConnInstanceTO resourceConnector = connectorService.read(ldapResource.getConnectorId());
+ ConnConfProperty property = resourceConnector.getConfigurationMap().get("retrievePasswordsWithSearch");
+ property.getValues().clear();
+ property.getValues().add(Boolean.TRUE);
+ connectorService.update(ldapResource.getConnectorId(), resourceConnector);
+
+ // 6. Sync the user from the resource
+ SyncTaskTO syncTask = new SyncTaskTO();
+ syncTask.setName("LDAP Sync Task");
+ syncTask.setPerformCreate(true);
+ syncTask.setPerformUpdate(true);
+ syncTask.setFullReconciliation(true);
+ syncTask.setResource(RESOURCE_NAME_LDAP);
+ syncTask.getActionsClassNames().add(LDAPPasswordSyncActions.class.getName());
+ Response taskResponse = taskService.create(syncTask);
+
+ SyncTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, SyncTaskTO.class);
+ assertNotNull(actual);
+
+ syncTask = taskService.read(actual.getKey());
+ assertNotNull(syncTask);
+ assertEquals(actual.getKey(), syncTask.getKey());
+ assertEquals(actual.getJobClassName(), syncTask.getJobClassName());
+
+ TaskExecTO execution = execSyncTask(syncTask.getKey(), 50, false);
+ final String status = execution.getStatus();
+ assertNotNull(status);
+ assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
+
+ // 7. Test the sync'd user
+ String syncedPassword = Encryptor.getInstance().encode("security", CipherAlgorithm.SHA1);
+ updatedUser = userService.read(user.getKey());
+ assertEquals(syncedPassword, updatedUser.getPassword());
+
+ // 8. Delete SyncTask + user + reset the connector
+ taskService.delete(syncTask.getKey());
+ property.getValues().clear();
+ property.getValues().add(Boolean.FALSE);
+ connectorService.update(ldapResource.getConnectorId(), resourceConnector);
+ deleteUser(updatedUser.getKey());
+ }
+}
[44/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
[SYNCOPE-620] Console (JAR) in, now time for console-reference
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/32707b3b
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/32707b3b
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/32707b3b
Branch: refs/heads/2_0_X
Commit: 32707b3b91361b36719a5a1467cf798b3e4b85af
Parents: 721f327
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 3 17:34:03 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 3 17:34:03 2015 +0100
----------------------------------------------------------------------
syncope620/client/console/pom.xml | 112 +
.../client/console/SyncopeApplication.java | 305 +++
.../console/SyncopeRequestCycleListener.java | 84 +
.../syncope/client/console/SyncopeSession.java | 185 ++
.../console/commons/ActionTableCheckGroup.java | 40 +
.../client/console/commons/AttrLayoutType.java | 105 +
.../commons/AttributableDataProvider.java | 105 +
.../console/commons/CloseOnESCBehavior.java | 55 +
.../commons/ConnIdSpecialAttributeName.java | 34 +
.../client/console/commons/Constants.java | 110 +
.../console/commons/DateFormatROModel.java | 50 +
.../console/commons/HttpResourceStream.java | 101 +
.../client/console/commons/JexlHelpUtil.java | 61 +
.../console/commons/MapChoiceRenderer.java | 43 +
.../syncope/client/console/commons/Mode.java | 27 +
.../console/commons/PreferenceManager.java | 177 ++
.../client/console/commons/RoleTreeBuilder.java | 116 +
.../client/console/commons/RoleUtils.java | 36 +
.../console/commons/SchemaModalPageFactory.java | 58 +
.../console/commons/SelectChoiceRenderer.java | 40 +
.../client/console/commons/SelectOption.java | 72 +
.../SortableAttributableProviderComparator.java | 122 +
.../commons/SortableDataProviderComparator.java | 66 +
.../client/console/commons/XMLRolesReader.java | 118 +
.../status/AbstractStatusBeanProvider.java | 69 +
.../commons/status/ConnObjectWrapper.java | 55 +
.../client/console/commons/status/Status.java | 45 +
.../console/commons/status/StatusBean.java | 103 +
.../console/commons/status/StatusUtils.java | 322 +++
.../console/init/MIMETypesInitializer.java | 63 +
.../init/PreviewPanelClassInitializer.java | 69 +
.../console/init/SpringContextInitializer.java | 45 +
.../client/console/pages/AbstractBasePage.java | 133 +
.../pages/AbstractSchedTaskModalPage.java | 132 +
.../console/pages/AbstractSchemaModalPage.java | 45 +
.../console/pages/AbstractStatusModalPage.java | 30 +
.../pages/AbstractSyncTaskModalPage.java | 209 ++
.../console/pages/ActivitiModelerPopupPage.java | 27 +
.../client/console/pages/ApprovalModalPage.java | 286 ++
.../client/console/pages/BaseModalPage.java | 35 +
.../syncope/client/console/pages/BasePage.java | 111 +
.../client/console/pages/BasePopupPage.java | 25 +
.../console/pages/BulkActionModalPage.java | 166 ++
.../pages/BulkActionResultModalPage.java | 97 +
.../client/console/pages/ConfModalPage.java | 112 +
.../client/console/pages/Configuration.java | 756 ++++++
.../pages/ConfirmPasswordResetModalPage.java | 103 +
.../console/pages/ConnObjectModalPage.java | 101 +
.../console/pages/ConnectorModalPage.java | 471 ++++
.../console/pages/DerSchemaModalPage.java | 140 +
.../pages/DisplayAttributesModalPage.java | 273 ++
.../client/console/pages/EditUserModalPage.java | 105 +
.../syncope/client/console/pages/ErrorPage.java | 42 +
.../console/pages/ExecMessageModalPage.java | 32 +
.../console/pages/FailureMessageModalPage.java | 37 +
.../syncope/client/console/pages/HomePage.java | 33 +
.../client/console/pages/InfoModalPage.java | 43 +
.../syncope/client/console/pages/Login.java | 365 +++
.../syncope/client/console/pages/Logout.java | 38 +
.../console/pages/MembershipModalPage.java | 114 +
.../console/pages/NotificationModalPage.java | 441 ++++
.../pages/NotificationTaskModalPage.java | 69 +
.../console/pages/PlainSchemaModalPage.java | 456 ++++
.../client/console/pages/PolicyModalPage.java | 451 ++++
.../console/pages/PropagationTaskModalPage.java | 45 +
.../console/pages/ProvisioningModalPage.java | 250 ++
.../client/console/pages/PushTaskModalPage.java | 135 +
.../ReportExecResultDownloadModalPage.java | 73 +
.../client/console/pages/ReportModalPage.java | 640 +++++
.../console/pages/ReportletConfModalPage.java | 362 +++
.../syncope/client/console/pages/Reports.java | 413 +++
.../pages/RequestPasswordResetModalPage.java | 153 ++
.../client/console/pages/ResourceModalPage.java | 217 ++
.../syncope/client/console/pages/Resources.java | 732 ++++++
.../console/pages/ResultStatusModalPage.java | 426 +++
.../client/console/pages/RoleModalPage.java | 162 ++
.../console/pages/RoleSelectModalPage.java | 105 +
.../console/pages/RoleTemplateModalPage.java | 50 +
.../syncope/client/console/pages/Roles.java | 186 ++
.../console/pages/SchedTaskModalPage.java | 68 +
.../syncope/client/console/pages/Schema.java | 467 ++++
.../pages/SecurityQuestionModalPage.java | 111 +
.../client/console/pages/StatusModalPage.java | 641 +++++
.../client/console/pages/SyncTaskModalPage.java | 73 +
.../client/console/pages/TaskModalPage.java | 257 ++
.../syncope/client/console/pages/Tasks.java | 230 ++
.../syncope/client/console/pages/Todo.java | 245 ++
.../client/console/pages/UserModalPage.java | 228 ++
.../console/pages/UserOwnerSelectModalPage.java | 81 +
.../client/console/pages/UserSelfModalPage.java | 72 +
.../console/pages/UserTemplateModalPage.java | 60 +
.../syncope/client/console/pages/Users.java | 166 ++
.../client/console/pages/ViewUserModalPage.java | 49 +
.../console/pages/VirSchemaModalPage.java | 126 +
.../client/console/pages/WelcomePage.java | 55 +
.../console/pages/XMLEditorPopupPage.java | 90 +
.../panels/AbstractProvisioningTasksPanel.java | 160 ++
.../console/panels/AbstractSearchPanel.java | 401 +++
.../panels/AbstractSearchResultPanel.java | 353 +++
.../client/console/panels/AbstractTasks.java | 55 +
.../console/panels/AccountInformationPanel.java | 73 +
.../console/panels/ActionDataTablePanel.java | 149 ++
.../console/panels/AjaxDataTablePanel.java | 142 +
.../console/panels/AnnotatedBeanPanel.java | 66 +
.../console/panels/AttrTemplatesPanel.java | 167 ++
.../client/console/panels/DataTablePanel.java | 113 +
.../client/console/panels/DerAttrsPanel.java | 206 ++
.../console/panels/EventSelectionPanel.java | 243 ++
.../client/console/panels/ImagePanel.java | 43 +
.../console/panels/JQueryUITabbedPanel.java | 45 +
.../client/console/panels/LayoutsPanel.java | 130 +
.../console/panels/LoggerCategoryPanel.java | 468 ++++
.../client/console/panels/MembershipsPanel.java | 256 ++
.../console/panels/NotificationPanel.java | 119 +
.../console/panels/NotificationTasks.java | 254 ++
.../client/console/panels/PlainAttrsPanel.java | 395 +++
.../client/console/panels/PoliciesPanel.java | 343 +++
.../client/console/panels/PolicyBeanPanel.java | 328 +++
.../client/console/panels/PropagationTasks.java | 273 ++
.../client/console/panels/PushTasksPanel.java | 184 ++
.../console/panels/ResourceConnConfPanel.java | 187 ++
.../console/panels/ResourceDetailsPanel.java | 306 +++
.../console/panels/ResourceMappingPanel.java | 644 +++++
.../console/panels/ResourceSecurityPanel.java | 189 ++
.../client/console/panels/ResourcesPanel.java | 178 ++
.../client/console/panels/RoleDetailsPanel.java | 435 ++++
.../client/console/panels/RolePanel.java | 187 ++
.../client/console/panels/RoleSearchPanel.java | 101 +
.../console/panels/RoleSearchResultPanel.java | 175 ++
.../console/panels/RoleSecurityPanel.java | 198 ++
.../client/console/panels/RoleSummaryPanel.java | 153 ++
.../client/console/panels/RoleTabPanel.java | 195 ++
.../client/console/panels/SchedTasks.java | 286 ++
.../client/console/panels/SearchClause.java | 129 +
.../client/console/panels/SearchView.java | 461 ++++
.../console/panels/SecurityQuestionPanel.java | 98 +
.../panels/SelectOnlyUserSearchResultPanel.java | 93 +
.../console/panels/SelectedEventsPanel.java | 167 ++
.../client/console/panels/StatusPanel.java | 263 ++
.../client/console/panels/SyncTasksPanel.java | 226 ++
.../client/console/panels/UserDetailsPanel.java | 122 +
.../client/console/panels/UserSearchPanel.java | 113 +
.../console/panels/UserSearchResultPanel.java | 298 +++
.../client/console/panels/VirAttrsPanel.java | 295 +++
.../client/console/preview/BinaryPreview.java | 34 +
.../client/console/preview/PreviewUtil.java | 67 +
.../console/preview/PreviewerClassScanner.java | 50 +
.../console/resources/FilesystemResource.java | 83 +
.../resources/WorkflowDefGETResource.java | 58 +
.../resources/WorkflowDefPUTResource.java | 74 +
.../console/rest/AbstractSubjectRestClient.java | 46 +
.../client/console/rest/ApprovalRestClient.java | 45 +
.../client/console/rest/AuthRestClient.java | 44 +
.../client/console/rest/BaseRestClient.java | 70 +
.../console/rest/ConfigurationRestClient.java | 97 +
.../console/rest/ConnectorRestClient.java | 217 ++
.../console/rest/ExecutionRestClient.java | 26 +
.../client/console/rest/InvalidPolicyType.java | 31 +
.../client/console/rest/LoggerRestClient.java | 92 +
.../console/rest/NotificationRestClient.java | 50 +
.../client/console/rest/PolicyRestClient.java | 104 +
.../client/console/rest/ReportRestClient.java | 108 +
.../client/console/rest/ResourceRestClient.java | 94 +
.../client/console/rest/RoleRestClient.java | 184 ++
.../client/console/rest/SchemaRestClient.java | 253 ++
.../rest/SecurityQuestionRestClient.java | 51 +
.../client/console/rest/TaskRestClient.java | 139 +
.../client/console/rest/UserRestClient.java | 228 ++
.../client/console/rest/UserSelfRestClient.java | 96 +
.../client/console/rest/WorkflowRestClient.java | 69 +
.../ajax/form/AbstractAjaxDownloadBehavior.java | 48 +
.../markup/html/ClearIndicatingAjaxButton.java | 76 +
.../markup/html/ClearIndicatingAjaxLink.java | 61 +
.../html/IndicatingOnConfirmAjaxLink.java | 58 +
.../html/repeater/data/table/ActionColumn.java | 59 +
.../repeater/data/table/ActionResultColumn.java | 77 +
.../html/repeater/data/table/AttrColumn.java | 85 +
.../data/table/CheckBoxGroupSelectorPanel.java | 34 +
.../html/repeater/data/table/CheckBoxPanel.java | 43 +
.../repeater/data/table/CheckGroupColumn.java | 54 +
.../repeater/data/table/CollectionPanel.java | 47 +
.../data/table/CollectionPropertyColumn.java | 54 +
.../repeater/data/table/DatePropertyColumn.java | 53 +
.../html/repeater/data/table/TokenColumn.java | 51 +
.../wicket/markup/head/MetaHeaderItem.java | 49 +
.../wicket/markup/html/CrontabContainer.java | 184 ++
.../markup/html/form/AbstractFieldPanel.java | 40 +
.../wicket/markup/html/form/ActionLink.java | 83 +
.../markup/html/form/ActionLinksPanel.java | 586 +++++
.../markup/html/form/AjaxCheckBoxPanel.java | 130 +
.../markup/html/form/AjaxDecoratedCheckbox.java | 55 +
.../html/form/AjaxDropDownChoicePanel.java | 87 +
.../markup/html/form/AjaxPalettePanel.java | 70 +
.../html/form/AjaxPasswordFieldPanel.java | 60 +
.../markup/html/form/AjaxTextFieldPanel.java | 98 +
.../markup/html/form/BinaryFieldPanel.java | 211 ++
.../form/CheckBoxMultipleChoiceFieldPanel.java | 46 +
.../wicket/markup/html/form/DateFieldPanel.java | 132 +
.../markup/html/form/DateTextFieldPanel.java | 88 +
.../markup/html/form/DateTimeFieldPanel.java | 195 ++
.../wicket/markup/html/form/FieldPanel.java | 199 ++
.../wicket/markup/html/form/LinkPanel.java | 39 +
.../markup/html/form/MappingPurposePanel.java | 133 +
.../markup/html/form/MultiFieldPanel.java | 172 ++
.../wicket/markup/html/form/NonI18nPalette.java | 44 +
.../markup/html/form/SelectableRecorder.java | 204 ++
.../markup/html/form/SpinnerFieldPanel.java | 197 ++
.../form/preview/AbstractBinaryPreviewer.java | 46 +
.../html/form/preview/BinaryCertPreviewer.java | 70 +
.../html/form/preview/BinaryImagePreviewer.java | 51 +
.../markup/html/link/VeilPopupSettings.java | 32 +
.../wicket/markup/html/list/AltListView.java | 59 +
.../html/list/ConnConfPropertyListView.java | 152 ++
.../tree/DefaultMutableTreeNodeExpansion.java | 160 ++
.../DefaultMutableTreeNodeExpansionModel.java | 36 +
.../wicket/markup/html/tree/TreeRolePanel.java | 121 +
.../markup/html/tree/TreeRoleProvider.java | 43 +
.../resources/META-INF/resources/css/bulk.css | 97 +
.../META-INF/resources/css/fieldstyle.css | 191 ++
.../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 0 -> 251 bytes
.../css/images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 1310 bytes
.../ui-bg_flat_0_aaaaaa_40x100_greennotused.png | Bin 0 -> 1312 bytes
.../css/images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes
.../css/images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes
.../css/images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes
.../css/images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes
.../css/images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes
.../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 1244 bytes
...ghlight-soft_75_cccccc_1x100_greynotused.png | Bin 0 -> 101 bytes
...ui-bg_highlight-soft_75_cccccc_1x100_red.png | Bin 0 -> 257 bytes
.../css/images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes
.../css/images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes
.../css/images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes
.../css/images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes
.../css/images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes
.../resources/META-INF/resources/css/style.css | 550 ++++
.../resources/img/actions/assign-icon.png | Bin 0 -> 566 bytes
.../resources/img/actions/both-icon.png | Bin 0 -> 611 bytes
.../META-INF/resources/img/actions/bulk.png | Bin 0 -> 1182 bytes
.../META-INF/resources/img/actions/claim.png | Bin 0 -> 509 bytes
.../META-INF/resources/img/actions/create.png | Bin 0 -> 360 bytes
.../META-INF/resources/img/actions/delete.png | Bin 0 -> 530 bytes
.../resources/img/actions/deprovision-icon.png | Bin 0 -> 210 bytes
.../META-INF/resources/img/actions/dryrun.png | Bin 0 -> 891 bytes
.../META-INF/resources/img/actions/edit.png | Bin 0 -> 455 bytes
.../META-INF/resources/img/actions/enable.png | Bin 0 -> 715 bytes
.../META-INF/resources/img/actions/execute.png | Bin 0 -> 695 bytes
.../META-INF/resources/img/actions/export.png | Bin 0 -> 474 bytes
.../resources/img/actions/link-icon.png | Bin 0 -> 447 bytes
.../resources/img/actions/manage-icon.png | Bin 0 -> 611 bytes
.../resources/img/actions/none-icon.png | Bin 0 -> 521 bytes
.../resources/img/actions/propagation-icon.png | Bin 0 -> 362 bytes
.../resources/img/actions/provision-icon.png | Bin 0 -> 360 bytes
.../resources/img/actions/reactivate.png | Bin 0 -> 496 bytes
.../META-INF/resources/img/actions/reload.png | Bin 0 -> 491 bytes
.../META-INF/resources/img/actions/reset.png | Bin 0 -> 491 bytes
.../resources/img/actions/resources-icon.png | Bin 0 -> 634 bytes
.../resources/img/actions/roles-icon.png | Bin 0 -> 391 bytes
.../META-INF/resources/img/actions/search.png | Bin 0 -> 763 bytes
.../META-INF/resources/img/actions/select.png | Bin 0 -> 279 bytes
.../resources/img/actions/settings-icon.png | Bin 0 -> 153 bytes
.../META-INF/resources/img/actions/suspend.png | Bin 0 -> 504 bytes
.../img/actions/synchronization-icon.png | Bin 0 -> 406 bytes
.../resources/img/actions/unassign-icon.png | Bin 0 -> 573 bytes
.../resources/img/actions/unlink-icon.png | Bin 0 -> 509 bytes
.../resources/img/actions/user_template.png | Bin 0 -> 597 bytes
.../resources/img/actions/users-icon.png | Bin 0 -> 754 bytes
.../resources/META-INF/resources/img/add.png | Bin 0 -> 814 bytes
.../resources/META-INF/resources/img/addAll.png | Bin 0 -> 1037 bytes
.../resources/META-INF/resources/img/busy.gif | Bin 0 -> 2834 bytes
.../META-INF/resources/img/db_export.png | Bin 0 -> 16675 bytes
.../META-INF/resources/img/disable.png | Bin 0 -> 1001 bytes
.../META-INF/resources/img/down-icon.png | Bin 0 -> 418 bytes
.../META-INF/resources/img/favicon.ico | Bin 0 -> 1406 bytes
.../META-INF/resources/img/file-download.png | Bin 0 -> 967 bytes
.../META-INF/resources/img/file-upload.png | Bin 0 -> 949 bytes
.../resources/META-INF/resources/img/help.png | Bin 0 -> 808 bytes
.../resources/META-INF/resources/img/info.png | Bin 0 -> 575 bytes
.../META-INF/resources/img/left-icon.png | Bin 0 -> 451 bytes
.../META-INF/resources/img/loading.gif | Bin 0 -> 2530 bytes
.../resources/META-INF/resources/img/logo.png | Bin 0 -> 8913 bytes
.../resources/img/menu/configuration.png | Bin 0 -> 5670 bytes
.../META-INF/resources/img/menu/connectors.png | Bin 0 -> 5772 bytes
.../META-INF/resources/img/menu/logout.png | Bin 0 -> 5460 bytes
.../resources/img/menu/notsel/configuration.png | Bin 0 -> 5518 bytes
.../resources/img/menu/notsel/connectors.png | Bin 0 -> 6401 bytes
.../resources/img/menu/notsel/logout.png | Bin 0 -> 5720 bytes
.../resources/img/menu/notsel/reports.png | Bin 0 -> 6074 bytes
.../resources/img/menu/notsel/resources.png | Bin 0 -> 6401 bytes
.../resources/img/menu/notsel/roles.png | Bin 0 -> 5175 bytes
.../resources/img/menu/notsel/schema.png | Bin 0 -> 5544 bytes
.../resources/img/menu/notsel/sf_body.png | Bin 0 -> 303 bytes
.../resources/img/menu/notsel/tasks.png | Bin 0 -> 7461 bytes
.../META-INF/resources/img/menu/notsel/todo.png | Bin 0 -> 6996 bytes
.../resources/img/menu/notsel/users.png | Bin 0 -> 7637 bytes
.../META-INF/resources/img/menu/reports.png | Bin 0 -> 5553 bytes
.../META-INF/resources/img/menu/resources.png | Bin 0 -> 5772 bytes
.../META-INF/resources/img/menu/roles.png | Bin 0 -> 5020 bytes
.../META-INF/resources/img/menu/schema.png | Bin 0 -> 5217 bytes
.../META-INF/resources/img/menu/tasks.png | Bin 0 -> 5742 bytes
.../META-INF/resources/img/menu/todo.png | Bin 0 -> 5722 bytes
.../META-INF/resources/img/menu/users.png | Bin 0 -> 6006 bytes
.../META-INF/resources/img/minus-icon.png | Bin 0 -> 210 bytes
.../META-INF/resources/img/modeler.png | Bin 0 -> 3118 bytes
.../META-INF/resources/img/moveDown.png | Bin 0 -> 833 bytes
.../resources/META-INF/resources/img/moveUp.png | Bin 0 -> 834 bytes
.../resources/META-INF/resources/img/ok.png | Bin 0 -> 497 bytes
.../resources/META-INF/resources/img/ping.png | Bin 0 -> 22945 bytes
.../META-INF/resources/img/plus-icon.png | Bin 0 -> 360 bytes
.../META-INF/resources/img/reload_30.png | Bin 0 -> 611 bytes
.../resources/META-INF/resources/img/remove.png | Bin 0 -> 825 bytes
.../META-INF/resources/img/removeAll.png | Bin 0 -> 1034 bytes
.../META-INF/resources/img/right-icon.png | Bin 0 -> 411 bytes
.../resources/META-INF/resources/img/search.png | Bin 0 -> 763 bytes
.../META-INF/resources/img/sf_testa.png | Bin 0 -> 293 bytes
.../META-INF/resources/img/success.png | Bin 0 -> 1696 bytes
.../resources/META-INF/resources/img/tab ok.png | Bin 0 -> 2330 bytes
.../META-INF/resources/img/tab old.png | Bin 0 -> 734 bytes
.../resources/META-INF/resources/img/tab.png | Bin 0 -> 2098 bytes
.../META-INF/resources/img/up-icon.png | Bin 0 -> 421 bytes
.../META-INF/resources/img/warning.png | Bin 0 -> 1107 bytes
.../resources/META-INF/resources/img/xml.png | Bin 0 -> 2741 bytes
.../main/resources/META-INF/web-fragment.xml | 66 +
.../client/console/src/main/resources/MIMETypes | 671 +++++
.../src/main/resources/authorizations.xml | 333 +++
.../src/main/resources/console.properties | 21 +
.../src/main/resources/consoleContext.xml | 79 +
.../console/SyncopeApplication.properties | 54 +
.../console/SyncopeApplication_it.properties | 53 +
.../console/SyncopeApplication_pt_BR.properties | 53 +
.../console/pages/AbstractStatusModalPage.html | 120 +
.../pages/AbstractStatusModalPage.properties | 19 +
.../pages/AbstractStatusModalPage_it.properties | 19 +
.../AbstractStatusModalPage_pt_BR.properties | 19 +
.../console/pages/ActivitiModelerPopupPage.html | 65 +
.../client/console/pages/ApprovalModalPage.html | 52 +
.../console/pages/ApprovalModalPage.properties | 18 +
.../pages/ApprovalModalPage_it.properties | 18 +
.../pages/ApprovalModalPage_pt_BR.properties | 18 +
.../client/console/pages/BaseModalPage.html | 56 +
.../console/pages/BaseModalPage.properties | 20 +
.../console/pages/BaseModalPage_it.properties | 20 +
.../pages/BaseModalPage_pt_BR.properties | 20 +
.../syncope/client/console/pages/BasePage.html | 145 ++
.../client/console/pages/BasePage.properties | 19 +
.../client/console/pages/BasePage_it.properties | 19 +
.../console/pages/BasePage_pt_BR.properties | 19 +
.../client/console/pages/BasePopupPage.html | 51 +
.../console/pages/BulkActionModalPage.html | 45 +
.../pages/BulkActionModalPage.properties | 17 +
.../pages/BulkActionModalPage_it.properties | 17 +
.../pages/BulkActionModalPage_pt_BR.properties | 17 +
.../pages/BulkActionResultModalPage.html | 57 +
.../pages/BulkActionResultModalPage.properties | 19 +
.../BulkActionResultModalPage_it.properties | 19 +
.../BulkActionResultModalPage_pt_BR.properties | 19 +
.../client/console/pages/ConfModalPage.html | 39 +
.../console/pages/ConfModalPage.properties | 17 +
.../console/pages/ConfModalPage_it.properties | 17 +
.../pages/ConfModalPage_pt_BR.properties | 17 +
.../client/console/pages/Configuration.html | 236 ++
.../console/pages/Configuration.properties | 48 +
.../console/pages/Configuration_it.properties | 47 +
.../pages/Configuration_pt_BR.properties | 47 +
.../pages/ConfirmPasswordResetModalPage.html | 55 +
.../ConfirmPasswordResetModalPage.properties | 20 +
.../ConfirmPasswordResetModalPage_it.properties | 20 +
...nfirmPasswordResetModalPage_pt_BR.properties | 20 +
.../console/pages/ConnObjectModalPage.html | 39 +
.../pages/ConnObjectModalPage.properties | 17 +
.../pages/ConnObjectModalPage_it.properties | 17 +
.../pages/ConnObjectModalPage_pt_BR.properties | 17 +
.../console/pages/ConnectorModalPage.html | 159 ++
.../console/pages/ConnectorModalPage.properties | 42 +
.../pages/ConnectorModalPage_it.properties | 42 +
.../pages/ConnectorModalPage_pt_BR.properties | 42 +
.../console/pages/DerSchemaModalPage.html | 64 +
.../console/pages/DerSchemaModalPage.properties | 22 +
.../pages/DerSchemaModalPage_it.properties | 22 +
.../pages/DerSchemaModalPage_pt_BR.properties | 22 +
.../pages/DisplayAttributesModalPage.html | 132 +
.../pages/DisplayAttributesModalPage.properties | 33 +
.../DisplayAttributesModalPage_it.properties | 33 +
.../DisplayAttributesModalPage_pt_BR.properties | 33 +
.../syncope/client/console/pages/ErrorPage.html | 53 +
.../console/pages/ExecMessageModalPage.html | 25 +
.../console/pages/FailureMessageModalPage.html | 36 +
.../syncope/client/console/pages/HomePage.html | 34 +
.../client/console/pages/InfoModalPage.html | 42 +
.../console/pages/InfoModalPage.properties | 19 +
.../console/pages/InfoModalPage_it.properties | 19 +
.../pages/InfoModalPage_pt_BR.properties | 19 +
.../syncope/client/console/pages/Login.html | 89 +
.../client/console/pages/Login.properties | 22 +
.../client/console/pages/Login_it.properties | 22 +
.../client/console/pages/Login_pt_BR.properties | 22 +
.../console/pages/MembershipModalPage.html | 55 +
.../pages/MembershipModalPage.properties | 35 +
.../pages/MembershipModalPage_it.properties | 35 +
.../pages/MembershipModalPage_pt_BR.properties | 35 +
.../console/pages/NotificationModalPage.html | 234 ++
.../pages/NotificationModalPage.properties | 40 +
.../pages/NotificationModalPage_it.properties | 40 +
.../NotificationModalPage_pt_BR.properties | 40 +
.../pages/NotificationTaskModalPage.html | 109 +
.../pages/NotificationTaskModalPage.properties | 32 +
.../NotificationTaskModalPage_it.properties | 32 +
.../NotificationTaskModalPage_pt_BR.properties | 32 +
.../console/pages/PlainSchemaModalPage.html | 172 ++
.../pages/PlainSchemaModalPage.properties | 38 +
.../pages/PlainSchemaModalPage_it.properties | 38 +
.../pages/PlainSchemaModalPage_pt_BR.properties | 38 +
.../client/console/pages/PolicyModalPage.html | 109 +
.../console/pages/PolicyModalPage.properties | 88 +
.../console/pages/PolicyModalPage_it.properties | 88 +
.../pages/PolicyModalPage_pt_BR.properties | 87 +
.../console/pages/PropagationTaskModalPage.html | 73 +
.../pages/PropagationTaskModalPage.properties | 28 +
.../PropagationTaskModalPage_it.properties | 28 +
.../PropagationTaskModalPage_pt_BR.properties | 28 +
.../client/console/pages/PushTaskModalPage.html | 228 ++
.../console/pages/PushTaskModalPage.properties | 45 +
.../pages/PushTaskModalPage_it.properties | 47 +
.../pages/PushTaskModalPage_pt_BR.properties | 45 +
.../client/console/pages/RecursivePanel.html | 28 +
.../ReportExecResultDownloadModalPage.html | 23 +
...ReportExecResultDownloadModalPage.properties | 18 +
...ortExecResultDownloadModalPage_it.properties | 18 +
...ExecResultDownloadModalPage_pt_BR.properties | 18 +
.../client/console/pages/ReportModalPage.html | 146 ++
.../console/pages/ReportModalPage.properties | 36 +
.../console/pages/ReportModalPage_it.properties | 36 +
.../pages/ReportModalPage_pt_BR.properties | 36 +
.../console/pages/ReportletConfModalPage.html | 85 +
.../pages/ReportletConfModalPage.properties | 22 +
.../pages/ReportletConfModalPage_it.properties | 22 +
.../ReportletConfModalPage_pt_BR.properties | 22 +
.../syncope/client/console/pages/Reports.html | 58 +
.../client/console/pages/Reports.properties | 24 +
.../client/console/pages/Reports_it.properties | 24 +
.../console/pages/Reports_pt_BR.properties | 24 +
.../pages/RequestPasswordResetModalPage.html | 64 +
.../RequestPasswordResetModalPage.properties | 21 +
.../RequestPasswordResetModalPage_it.properties | 21 +
...questPasswordResetModalPage_pt_BR.properties | 21 +
.../client/console/pages/ResourceModalPage.html | 64 +
.../console/pages/ResourceModalPage.properties | 60 +
.../pages/ResourceModalPage_it.properties | 60 +
.../pages/ResourceModalPage_pt_BR.properties | 60 +
.../syncope/client/console/pages/Resources.html | 99 +
.../client/console/pages/Resources.properties | 34 +
.../console/pages/Resources_it.properties | 34 +
.../console/pages/Resources_pt_BR.properties | 32 +
.../console/pages/ResultStatusModalPage.html | 226 ++
.../pages/ResultStatusModalPage.properties | 26 +
.../pages/ResultStatusModalPage_it.properties | 26 +
.../ResultStatusModalPage_pt_BR.properties | 26 +
.../client/console/pages/RoleModalPage.html | 52 +
.../console/pages/RoleModalPage.properties | 48 +
.../console/pages/RoleModalPage_it.properties | 48 +
.../pages/RoleModalPage_pt_BR.properties | 48 +
.../console/pages/RoleSelectModalPage.html | 22 +
.../syncope/client/console/pages/Roles.html | 80 +
.../client/console/pages/Roles.properties | 26 +
.../client/console/pages/Roles_it.properties | 26 +
.../client/console/pages/Roles_pt_BR.properties | 26 +
.../client/console/pages/RouteModalPage.html | 49 +
.../console/pages/RouteModalPage.properties | 18 +
.../console/pages/RouteModalPage_it.properties | 18 +
.../pages/RouteModalPage_pt_BR.properties | 18 +
.../console/pages/SchedTaskModalPage.html | 136 +
.../console/pages/SchedTaskModalPage.properties | 36 +
.../pages/SchedTaskModalPage_it.properties | 36 +
.../pages/SchedTaskModalPage_pt_BR.properties | 36 +
.../console/pages/Schema$SchemaTypePanel.html | 41 +
.../syncope/client/console/pages/Schema.html | 59 +
.../client/console/pages/Schema.properties | 35 +
.../client/console/pages/Schema_it.properties | 35 +
.../console/pages/Schema_pt_BR.properties | 35 +
.../pages/SecurityQuestionModalPage.html | 46 +
.../pages/SecurityQuestionModalPage.properties | 18 +
.../SecurityQuestionModalPage_it.properties | 18 +
.../SecurityQuestionModalPage_pt_BR.properties | 18 +
.../client/console/pages/SyncTaskModalPage.html | 205 ++
.../console/pages/SyncTaskModalPage.properties | 43 +
.../pages/SyncTaskModalPage_it.properties | 44 +
.../pages/SyncTaskModalPage_pt_BR.properties | 43 +
.../syncope/client/console/pages/Tasks.html | 46 +
.../client/console/pages/Tasks.properties | 21 +
.../client/console/pages/Tasks_it.properties | 21 +
.../client/console/pages/Tasks_pt_BR.properties | 21 +
.../syncope/client/console/pages/Todo.html | 45 +
.../client/console/pages/Todo.properties | 31 +
.../client/console/pages/Todo_it.properties | 31 +
.../client/console/pages/Todo_pt_BR.properties | 31 +
.../client/console/pages/UserModalPage.html | 97 +
.../console/pages/UserModalPage.properties | 52 +
.../console/pages/UserModalPage_it.properties | 53 +
.../pages/UserModalPage_pt_BR.properties | 52 +
.../console/pages/UserOwnerSelectModalPage.html | 38 +
.../pages/UserOwnerSelectModalPage.properties | 23 +
.../UserOwnerSelectModalPage_it.properties | 23 +
.../UserOwnerSelectModalPage_pt_BR.properties | 23 +
.../syncope/client/console/pages/Users.html | 72 +
.../client/console/pages/Users.properties | 26 +
.../client/console/pages/Users_it.properties | 26 +
.../client/console/pages/Users_pt_BR.properties | 26 +
.../console/pages/VirSchemaModalPage.html | 53 +
.../console/pages/VirSchemaModalPage.properties | 22 +
.../pages/VirSchemaModalPage_it.properties | 22 +
.../pages/VirSchemaModalPage_pt_BR.properties | 22 +
.../client/console/pages/WelcomePage.html | 70 +
.../client/console/pages/WelcomePage.properties | 18 +
.../console/pages/WelcomePage_it.properties | 18 +
.../console/pages/WelcomePage_pt_BR.properties | 18 +
.../console/pages/XMLEditorPopupPage.html | 82 +
.../console/pages/XMLEditorPopupPage.properties | 19 +
.../pages/XMLEditorPopupPage_it.properties | 19 +
.../pages/XMLEditorPopupPage_pt_BR.properties | 19 +
.../client/console/pages/statuses/active.png | Bin 0 -> 509 bytes
.../client/console/pages/statuses/inactive.png | Bin 0 -> 477 bytes
.../console/pages/statuses/objectnotfound.png | Bin 0 -> 668 bytes
.../client/console/pages/statuses/undefined.png | Bin 0 -> 758 bytes
.../console/panels/AbstractSearchPanel.html | 50 +
.../panels/AbstractSearchResultPanel.html | 43 +
.../panels/AbstractSearchResultPanel.properties | 30 +
.../AbstractSearchResultPanel_it.properties | 30 +
.../AbstractSearchResultPanel_pt_BR.properties | 30 +
.../console/panels/AbstractSyncTasksPanel.html | 41 +
.../console/panels/AccountInformationPanel.html | 67 +
.../panels/AccountInformationPanel.properties | 22 +
.../AccountInformationPanel_it.properties | 23 +
.../AccountInformationPanel_pt_BR.properties | 23 +
.../console/panels/ActionDataTablePanel.html | 45 +
.../console/panels/AjaxDataTablePanel.html | 47 +
.../console/panels/AnnotatedBeanPanel.html | 98 +
.../panels/AnnotatedBeanPanel.properties | 20 +
.../panels/AnnotatedBeanPanel_it.properties | 20 +
.../panels/AnnotatedBeanPanel_pt_BR.properties | 20 +
.../console/panels/AttrTemplatesPanel.html | 58 +
.../panels/AttrTemplatesPanel.properties | 23 +
.../panels/AttrTemplatesPanel_it.properties | 23 +
.../panels/AttrTemplatesPanel_pt_BR.properties | 23 +
.../client/console/panels/AuditEventsPanel.html | 122 +
.../client/console/panels/DerAttrsPanel.html | 60 +
.../console/panels/DerAttrsPanel.properties | 17 +
.../console/panels/DerAttrsPanel_it.properties | 18 +
.../panels/DerAttrsPanel_pt_BR.properties | 17 +
.../console/panels/EventSelectionPanel.html | 125 +
.../client/console/panels/ImagePanel.html | 23 +
.../console/panels/JQueryUITabbedPanel.html | 41 +
.../client/console/panels/LayoutsPanel.html | 41 +
.../console/panels/LayoutsPanel.properties | 18 +
.../console/panels/LayoutsPanel_it.properties | 18 +
.../panels/LayoutsPanel_pt_BR.properties | 18 +
.../console/panels/LoggerCategoryPanel.html | 106 +
.../client/console/panels/MembershipsPanel.html | 66 +
.../console/panels/MembershipsPanel.properties | 23 +
.../panels/MembershipsPanel_it.properties | 24 +
.../panels/MembershipsPanel_pt_BR.properties | 23 +
.../console/panels/NotificationTasks.html | 38 +
.../console/panels/NotificationTasks.properties | 26 +
.../panels/NotificationTasks_it.properties | 26 +
.../panels/NotificationTasks_pt_BR.properties | 26 +
.../client/console/panels/PlainAttrsPanel.html | 44 +
.../client/console/panels/PoliciesPanel.html | 42 +
.../console/panels/PoliciesPanel.properties | 34 +
.../console/panels/PoliciesPanel_it.properties | 34 +
.../panels/PoliciesPanel_pt_BR.properties | 34 +
.../client/console/panels/PolicyBeanPanel.html | 39 +
.../client/console/panels/PropagationTasks.html | 37 +
.../console/panels/PropagationTasks.properties | 28 +
.../panels/PropagationTasks_it.properties | 28 +
.../panels/PropagationTasks_pt_BR.properties | 28 +
.../console/panels/PushTasksPanel.properties | 29 +
.../console/panels/PushTasksPanel_it.properties | 29 +
.../panels/PushTasksPanel_pt_BR.properties | 29 +
.../console/panels/ResourceConnConfPanel.html | 41 +
.../console/panels/ResourceDetailsPanel.html | 137 +
.../console/panels/ResourceMappingPanel.html | 125 +
.../console/panels/ResourceSecurityPanel.html | 56 +
.../panels/ResourceSecurityPanel.properties | 19 +
.../panels/ResourceSecurityPanel_it.properties | 19 +
.../ResourceSecurityPanel_pt_BR.properties | 19 +
.../client/console/panels/ResourcesPanel.html | 23 +
.../client/console/panels/RoleDetailsPanel.html | 107 +
.../console/panels/RoleDetailsPanel.properties | 22 +
.../panels/RoleDetailsPanel_it.properties | 22 +
.../panels/RoleDetailsPanel_pt_BR.properties | 22 +
.../client/console/panels/RolePanel.html | 88 +
.../client/console/panels/RolePanel.properties | 51 +
.../console/panels/RolePanel_it.properties | 53 +
.../console/panels/RolePanel_pt_BR.properties | 40 +
.../console/panels/RoleSecurityPanel.html | 66 +
.../console/panels/RoleSecurityPanel.properties | 20 +
.../panels/RoleSecurityPanel_it.properties | 20 +
.../panels/RoleSecurityPanel_pt_BR.properties | 20 +
.../client/console/panels/RoleSummaryPanel.html | 39 +
.../client/console/panels/RoleTabPanel.html | 64 +
.../console/panels/RoleTabPanel.properties | 27 +
.../console/panels/RoleTabPanel_it.properties | 27 +
.../panels/RoleTabPanel_pt_BR.properties | 27 +
.../client/console/panels/SchedTasks.html | 42 +
.../client/console/panels/SchedTasks.properties | 28 +
.../console/panels/SchedTasks_it.properties | 28 +
.../console/panels/SchedTasks_pt_BR.properties | 28 +
.../console/panels/SecurityQuestionPanel.html | 41 +
.../panels/SecurityQuestionPanel.properties | 18 +
.../panels/SecurityQuestionPanel_it.properties | 18 +
.../SecurityQuestionPanel_pt_BR.properties | 18 +
.../console/panels/SelectedEventsPanel.html | 33 +
.../client/console/panels/StatusPanel.html | 130 +
.../console/panels/StatusPanel.properties | 19 +
.../console/panels/StatusPanel_it.properties | 19 +
.../console/panels/StatusPanel_pt_BR.properties | 19 +
.../console/panels/SyncTasksPanel.properties | 29 +
.../console/panels/SyncTasksPanel_it.properties | 29 +
.../panels/SyncTasksPanel_pt_BR.properties | 29 +
.../client/console/panels/UserDetailsPanel.html | 71 +
.../console/panels/UserDetailsPanel.properties | 19 +
.../panels/UserDetailsPanel_it.properties | 19 +
.../panels/UserDetailsPanel_pt_BR.properties | 19 +
.../client/console/panels/VirAttrsPanel.html | 60 +
.../console/panels/VirAttrsPanel.properties | 19 +
.../console/panels/VirAttrsPanel_it.properties | 20 +
.../panels/VirAttrsPanel_pt_BR.properties | 19 +
.../data/table/CheckBoxGroupSelectorPanel.html | 21 +
.../html/repeater/data/table/CheckBoxPanel.html | 23 +
.../repeater/data/table/CollectionPanel.html | 25 +
.../markup/html/CrontabContainer.properties | 22 +
.../markup/html/CrontabContainer_it.properties | 22 +
.../html/CrontabContainer_pt_BR.properties | 22 +
.../markup/html/form/ActionLinksPanel.html | 163 ++
.../markup/html/form/AjaxCheckBoxPanel.html | 21 +
.../html/form/AjaxDropDownChoicePanel.html | 24 +
.../markup/html/form/AjaxNumberFieldPanel.html | 22 +
.../markup/html/form/AjaxPalettePanel.html | 23 +
.../html/form/AjaxPasswordFieldPanel.html | 22 +
.../markup/html/form/AjaxTextFieldPanel.html | 23 +
.../markup/html/form/BinaryFieldPanel.html | 44 +
.../form/CheckBoxMultipleChoiceFieldPanel.html | 23 +
.../markup/html/form/DateTextFieldPanel.html | 22 +
.../markup/html/form/DateTimeFieldPanel.html | 21 +
.../html/form/DateTimeFieldPanel.properties | 17 +
.../html/form/DateTimeFieldPanel_it.properties | 17 +
.../form/DateTimeFieldPanel_pt_BR.properties | 17 +
.../wicket/markup/html/form/FieldPanel.html | 34 +
.../wicket/markup/html/form/LinkPanel.html | 23 +
.../markup/html/form/MappingPurposePanel.html | 31 +
.../markup/html/form/MultiFieldPanel.html | 35 +
.../markup/html/form/MultiFieldPanel.properties | 22 +
.../html/form/MultiFieldPanel_it.properties | 22 +
.../html/form/MultiFieldPanel_pt_BR.properties | 22 +
.../wicket/markup/html/form/NonI18nPalette.html | 69 +
.../markup/html/form/SpinnerFieldPanel.html | 29 +
.../form/preview/AbstractBinaryPreviewer.html | 24 +
.../html/form/preview/BinaryCertPreviewer.html | 24 +
.../html/form/preview/BinaryImagePreviewer.html | 23 +
.../wicket/markup/html/tree/TreeRolePanel.html | 23 +
.../syncope/client/lib/SyncopeClient.java | 34 -
syncope620/client/pom.xml | 1 +
.../apache/syncope/common/lib/to/SyncopeTO.java | 30 +
.../common/lib/types/AuditLoggerName.java | 2 +-
.../syncope/common/rest/api/RESTHeaders.java | 15 -
.../rest/api/service/UserSelfService.java | 18 -
syncope620/fit/pom.xml | 2 +-
syncope620/fit/reference/pom.xml | 526 ----
.../DoubleValueAttributableTransformer.java | 75 -
.../fit/server/reference/TestSyncActions.java | 83 -
.../fit/server/reference/TestSyncRule.java | 37 -
.../src/main/resources/connid.properties | 23 -
.../reference/src/main/resources/context.xml | 23 -
.../resources/light/provisioning.properties | 18 -
.../main/resources/light/workflow.properties | 20 -
.../fit/reference/src/main/resources/log4j2.xml | 135 -
.../src/main/resources/logic.properties | 18 -
.../src/main/resources/provisioning.properties | 19 -
.../src/main/resources/serverContext.xml | 57 -
.../src/main/resources/userWorkflow.bpmn20.xml | 577 -----
.../src/main/resources/workflow.properties | 20 -
.../reference/src/main/webapp/cacheStats.jsp | 190 --
syncope620/fit/reference/src/main/webapp/db.jsp | 36 -
.../fit/server/reference/AbstractITCase.java | 388 ---
.../server/reference/AbstractTaskITCase.java | 138 -
.../fit/server/reference/ActivitiDetector.java | 32 -
.../server/reference/AuthenticationITCase.java | 440 ----
.../fit/server/reference/CamelDetector.java | 32 -
.../fit/server/reference/CamelRouteITCase.java | 164 --
.../server/reference/ConfigurationITCase.java | 210 --
.../fit/server/reference/ConnectorITCase.java | 730 ------
.../fit/server/reference/DerSchemaITCase.java | 151 --
.../fit/server/reference/LoggerITCase.java | 215 --
.../server/reference/NotificationITCase.java | 172 --
.../reference/NotificationTaskITCase.java | 156 --
.../fit/server/reference/PlainSchemaITCase.java | 317 ---
.../fit/server/reference/PolicyITCase.java | 238 --
.../server/reference/PropagationTaskITCase.java | 150 --
.../fit/server/reference/PushTaskITCase.java | 354 ---
.../fit/server/reference/ReportITCase.java | 252 --
.../fit/server/reference/ResourceITCase.java | 578 -----
.../fit/server/reference/RoleITCase.java | 889 -------
.../fit/server/reference/SchedTaskITCase.java | 107 -
.../fit/server/reference/SearchITCase.java | 182 --
.../reference/SecurityQuestionITCase.java | 99 -
.../fit/server/reference/SyncTaskITCase.java | 694 -----
.../fit/server/reference/UserITCase.java | 2442 ------------------
.../fit/server/reference/UserSelfITCase.java | 344 ---
.../server/reference/UserWorkflowITCase.java | 299 ---
.../fit/server/reference/VirAttrITCase.java | 872 -------
.../fit/server/reference/VirSchemaITCase.java | 122 -
.../fit/server/reference/WorkflowITCase.java | 77 -
.../src/test/resources/addActivitiToContent.xsl | 50 -
.../reference/src/test/resources/favicon.jpg | Bin 557 -> 0 bytes
.../fit/reference/src/test/resources/test.csv | 10 -
.../src/test/resources/testJDBCContext.xml | 33 -
syncope620/fit/server-reference/pom.xml | 526 ++++
.../DoubleValueAttributableTransformer.java | 75 +
.../fit/server/reference/TestSyncActions.java | 83 +
.../fit/server/reference/TestSyncRule.java | 37 +
.../src/main/resources/connid.properties | 23 +
.../src/main/resources/context.xml | 23 +
.../resources/light/provisioning.properties | 18 +
.../main/resources/light/workflow.properties | 20 +
.../src/main/resources/log4j2.xml | 135 +
.../src/main/resources/logic.properties | 18 +
.../src/main/resources/provisioning.properties | 19 +
.../src/main/resources/serverContext.xml | 57 +
.../src/main/resources/userWorkflow.bpmn20.xml | 577 +++++
.../src/main/resources/workflow.properties | 20 +
.../src/main/webapp/cacheStats.jsp | 190 ++
.../fit/server-reference/src/main/webapp/db.jsp | 36 +
.../fit/server/reference/AbstractITCase.java | 388 +++
.../server/reference/AbstractTaskITCase.java | 138 +
.../fit/server/reference/ActivitiDetector.java | 32 +
.../server/reference/AuthenticationITCase.java | 440 ++++
.../fit/server/reference/CamelDetector.java | 32 +
.../fit/server/reference/CamelRouteITCase.java | 164 ++
.../server/reference/ConfigurationITCase.java | 210 ++
.../fit/server/reference/ConnectorITCase.java | 730 ++++++
.../fit/server/reference/DerSchemaITCase.java | 151 ++
.../fit/server/reference/LoggerITCase.java | 215 ++
.../server/reference/NotificationITCase.java | 172 ++
.../reference/NotificationTaskITCase.java | 156 ++
.../fit/server/reference/PlainSchemaITCase.java | 317 +++
.../fit/server/reference/PolicyITCase.java | 238 ++
.../server/reference/PropagationTaskITCase.java | 150 ++
.../fit/server/reference/PushTaskITCase.java | 354 +++
.../fit/server/reference/ReportITCase.java | 252 ++
.../fit/server/reference/ResourceITCase.java | 578 +++++
.../fit/server/reference/RoleITCase.java | 889 +++++++
.../fit/server/reference/SchedTaskITCase.java | 107 +
.../fit/server/reference/SearchITCase.java | 182 ++
.../reference/SecurityQuestionITCase.java | 99 +
.../fit/server/reference/SyncTaskITCase.java | 694 +++++
.../fit/server/reference/UserITCase.java | 2442 ++++++++++++++++++
.../fit/server/reference/UserSelfITCase.java | 344 +++
.../server/reference/UserWorkflowITCase.java | 299 +++
.../fit/server/reference/VirAttrITCase.java | 872 +++++++
.../fit/server/reference/VirSchemaITCase.java | 122 +
.../fit/server/reference/WorkflowITCase.java | 77 +
.../src/test/resources/addActivitiToContent.xsl | 50 +
.../src/test/resources/favicon.jpg | Bin 0 -> 557 bytes
.../src/test/resources/test.csv | 10 +
.../src/test/resources/testJDBCContext.xml | 33 +
syncope620/pom.xml | 33 +
.../syncope/server/logic/SyncopeLogic.java | 25 +
.../apache/syncope/server/logic/UserLogic.java | 22 +-
.../rest/cxf/service/UserSelfServiceImpl.java | 19 +-
.../resources/META-INF/org.apache.cxf.Logger | 1 -
769 files changed, 61562 insertions(+), 12896 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/console/pom.xml b/syncope620/client/console/pom.xml
new file mode 100644
index 0000000..35185f1
--- /dev/null
+++ b/syncope620/client/console/pom.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.syncope</groupId>
+ <artifactId>syncope-client</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope Client Console</name>
+ <description>Apache Syncope Client Console</description>
+ <groupId>org.apache.syncope.client</groupId>
+ <artifactId>syncope-client-console</artifactId>
+ <packaging>jar</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-extensions</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-datetime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-spring</artifactId>
+ <!-- exclude spring framework that wicket pulls in -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-auth-roles</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.client</groupId>
+ <artifactId>syncope-client-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeApplication.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeApplication.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeApplication.java
new file mode 100644
index 0000000..daebd45
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeApplication.java
@@ -0,0 +1,305 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.pages.Configuration;
+import org.apache.syncope.client.console.pages.InfoModalPage;
+import org.apache.syncope.client.console.pages.Login;
+import org.apache.syncope.client.console.pages.Logout;
+import org.apache.syncope.client.console.pages.Reports;
+import org.apache.syncope.client.console.pages.Resources;
+import org.apache.syncope.client.console.pages.Roles;
+import org.apache.syncope.client.console.pages.Schema;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Todo;
+import org.apache.syncope.client.console.pages.UserSelfModalPage;
+import org.apache.syncope.client.console.pages.Users;
+import org.apache.syncope.client.console.pages.WelcomePage;
+import org.apache.syncope.client.console.resources.FilesystemResource;
+import org.apache.syncope.client.console.resources.WorkflowDefGETResource;
+import org.apache.syncope.client.console.resources.WorkflowDefPUTResource;
+import org.apache.syncope.client.console.rest.UserSelfRestClient;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.RestartResponseAtInterceptPageException;
+import org.apache.wicket.Session;
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authorization.IUnauthorizedComponentInstantiationListener;
+import org.apache.wicket.authorization.UnauthorizedInstantiationException;
+import org.apache.wicket.authroles.authorization.strategies.role.IRoleCheckingStrategy;
+import org.apache.wicket.authroles.authorization.strategies.role.RoleAuthorizationStrategy;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.request.resource.ContextRelativeResource;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.ResourceReference;
+import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * SyncopeApplication class.
+ */
+public class SyncopeApplication
+ extends WebApplication
+ implements IUnauthorizedComponentInstantiationListener, IRoleCheckingStrategy, Serializable {
+
+ private static final long serialVersionUID = -2920378752291913495L;
+
+ public static final String IMG_PREFIX = "/img/menu/";
+
+ public static final String IMG_NOTSEL = "notsel/";
+
+ private static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
+
+ private static final int EDIT_PROFILE_WIN_HEIGHT = 550;
+
+ private static final int EDIT_PROFILE_WIN_WIDTH = 800;
+
+ @Override
+ protected void init() {
+ super.init();
+
+ getComponentInstantiationListeners().add(new SpringComponentInjector(this));
+
+ getResourceSettings().setThrowExceptionOnMissingResource(true);
+
+ getSecuritySettings().setAuthorizationStrategy(new RoleAuthorizationStrategy(this));
+ getSecuritySettings().setUnauthorizedComponentInstantiationListener(this);
+
+ getMarkupSettings().setStripWicketTags(true);
+ getMarkupSettings().setCompressWhitespace(true);
+
+ getRequestCycleListeners().add(new SyncopeRequestCycleListener());
+
+ final String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
+ WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
+ mountResource("/" + ACTIVITI_MODELER_CONTEXT, new ResourceReference(ACTIVITI_MODELER_CONTEXT) {
+
+ private static final long serialVersionUID = -128426276529456602L;
+
+ @Override
+ public IResource getResource() {
+ return new FilesystemResource(ACTIVITI_MODELER_CONTEXT, activitiModelerDirectory);
+ }
+
+ });
+ mountResource("/workflowDefGET", new ResourceReference("workflowDefGET") {
+
+ private static final long serialVersionUID = -128426276529456602L;
+
+ @Override
+ public IResource getResource() {
+ return new WorkflowDefGETResource();
+ }
+ });
+ mountResource("/workflowDefPUT", new ResourceReference("workflowDefPUT") {
+
+ private static final long serialVersionUID = -128426276529456602L;
+
+ @Override
+ public IResource getResource() {
+ return new WorkflowDefPUTResource();
+ }
+ });
+ }
+
+ public void setupNavigationPanel(final WebPage page, final XMLRolesReader xmlRolesReader, final boolean notsel) {
+ final ModalWindow infoModal = new ModalWindow("infoModal");
+ page.add(infoModal);
+ infoModal.setInitialWidth(350);
+ infoModal.setInitialHeight(300);
+ infoModal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ infoModal.setCookieName("infoModal");
+ infoModal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new InfoModalPage();
+ }
+ });
+
+ final AjaxLink<Page> infoLink = new AjaxLink<Page>("infoLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ infoModal.show(target);
+ }
+ };
+ page.add(infoLink);
+
+ BookmarkablePageLink<Page> schemaLink = new BookmarkablePageLink<Page>("schema", Schema.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ schemaLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Schema", "list"));
+ page.add(schemaLink);
+ schemaLink.add(new Image("schemaIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "schema" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> usersLink = new BookmarkablePageLink<Page>("users", Users.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ usersLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Users", "list"));
+ page.add(usersLink);
+ usersLink.add(new Image("usersIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "users" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> rolesLink = new BookmarkablePageLink<Page>("roles", Roles.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ rolesLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Roles", "list"));
+ page.add(rolesLink);
+ rolesLink.add(new Image("rolesIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "roles" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> resourcesLink = new BookmarkablePageLink<Page>("resources", Resources.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ resourcesLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Resources", "list"));
+ page.add(resourcesLink);
+ resourcesLink.add(new Image("resourcesIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "resources" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> todoLink = new BookmarkablePageLink<Page>("todo", Todo.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ todoLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Approval", "list"));
+ page.add(todoLink);
+ todoLink.add(new Image("todoIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "todo" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> reportLink = new BookmarkablePageLink<Page>("reports", Reports.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ reportLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Reports", "list"));
+ page.add(reportLink);
+ reportLink.add(new Image("reportsIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "reports" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> configurationLink = new BookmarkablePageLink<Page>("configuration",
+ Configuration.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ configurationLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Configuration", "list"));
+ page.add(configurationLink);
+ configurationLink.add(new Image("configurationIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "configuration" + Constants.PNG_EXT)));
+
+ BookmarkablePageLink<Page> taskLink = new BookmarkablePageLink<Page>("tasks", Tasks.class);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ taskLink, WebPage.ENABLE, xmlRolesReader.getEntitlement("Tasks", "list"));
+ page.add(taskLink);
+ taskLink.add(new Image("tasksIcon", new ContextRelativeResource(IMG_PREFIX + (notsel
+ ? IMG_NOTSEL
+ : "") + "tasks" + Constants.PNG_EXT)));
+
+ page.add(new BookmarkablePageLink<Page>("logout", Logout.class));
+ }
+
+ public void setupEditProfileModal(final WebPage page, final UserSelfRestClient userSelfRestClient) {
+ // Modal window for editing user profile
+ final ModalWindow editProfileModalWin = new ModalWindow("editProfileModal");
+ editProfileModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editProfileModalWin.setInitialHeight(EDIT_PROFILE_WIN_HEIGHT);
+ editProfileModalWin.setInitialWidth(EDIT_PROFILE_WIN_WIDTH);
+ editProfileModalWin.setCookieName("edit-profile-modal");
+ page.add(editProfileModalWin);
+
+ final AjaxLink<Page> editProfileLink = new AjaxLink<Page>("editProfileLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ final UserTO userTO;
+ if (SyncopeSession.get().isAuthenticated()) {
+ try {
+ userTO = userSelfRestClient.read();
+ } catch (Exception e) {
+ throw new WicketRuntimeException(e);
+ }
+ } else {
+ userTO = new UserTO();
+ }
+
+ editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new UserSelfModalPage(page.getPageReference(), editProfileModalWin, userTO);
+ }
+ });
+
+ editProfileModalWin.show(target);
+ }
+ };
+
+ editProfileLink.add(new Label("username", SyncopeSession.get().getUsername()));
+
+ if ("admin".equals(SyncopeSession.get().getUsername())) {
+ editProfileLink.setEnabled(false);
+ }
+
+ page.add(editProfileLink);
+ }
+
+ @Override
+ public Session newSession(final Request request, final Response response) {
+ return new SyncopeSession(request);
+ }
+
+ @Override
+ public Class<? extends Page> getHomePage() {
+ return SyncopeSession.get().isAuthenticated() ? WelcomePage.class : Login.class;
+ }
+
+ @Override
+ public void onUnauthorizedInstantiation(final Component component) {
+ SyncopeSession.get().invalidate();
+
+ if (component instanceof Page) {
+ throw new UnauthorizedInstantiationException(component.getClass());
+ }
+
+ throw new RestartResponseAtInterceptPageException(Login.class);
+ }
+
+ @Override
+ public boolean hasAnyRole(final org.apache.wicket.authroles.authorization.strategies.role.Roles roles) {
+ return SyncopeSession.get().hasAnyRole(roles);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeRequestCycleListener.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeRequestCycleListener.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeRequestCycleListener.java
new file mode 100644
index 0000000..8b27260
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeRequestCycleListener.java
@@ -0,0 +1,84 @@
+/*
+ * 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;
+
+import java.security.AccessControlException;
+import javax.ws.rs.BadRequestException;
+import javax.xml.ws.WebServiceException;
+import org.apache.syncope.client.console.pages.ErrorPage;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.wicket.Page;
+import org.apache.wicket.authorization.UnauthorizedInstantiationException;
+import org.apache.wicket.core.request.handler.PageProvider;
+import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
+import org.apache.wicket.markup.html.pages.ExceptionErrorPage;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.protocol.http.PageExpiredException;
+import org.apache.wicket.request.IRequestHandler;
+import org.apache.wicket.request.cycle.AbstractRequestCycleListener;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SyncopeRequestCycleListener extends AbstractRequestCycleListener {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(SyncopeRequestCycleListener.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IRequestHandler onException(final RequestCycle cycle, final Exception e) {
+ LOG.error("Exception found", e);
+
+ PageParameters errorParameters = new PageParameters();
+ errorParameters.add("errorTitle", new StringResourceModel("alert", null).getString());
+
+ final Page errorPage;
+ if (e instanceof UnauthorizedInstantiationException) {
+ errorParameters.add("errorMessage",
+ new StringResourceModel("unauthorizedInstantiationException", null).getString());
+
+ errorPage = new ErrorPage(errorParameters);
+ } else if (e.getCause() instanceof AccessControlException) {
+ errorParameters.add("errorMessage", new StringResourceModel("accessControlException", null).getString());
+
+ errorPage = new ErrorPage(errorParameters);
+ } else if (e instanceof PageExpiredException || !(SyncopeSession.get()).isAuthenticated()) {
+ errorParameters.add("errorMessage", new StringResourceModel("pageExpiredException", null).getString());
+
+ errorPage = new ErrorPage(errorParameters);
+ } else if (e.getCause() instanceof BadRequestException || e.getCause() instanceof WebServiceException
+ || e.getCause() instanceof SyncopeClientException) {
+
+ errorParameters.add("errorMessage", new StringResourceModel("restClientException", null).getString());
+
+ errorPage = new ErrorPage(errorParameters);
+ } else {
+ // redirect to default Wicket error page
+ errorPage = new ExceptionErrorPage(e, null);
+ }
+
+ return new RenderPageRequestHandler(new PageProvider(errorPage));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeSession.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeSession.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeSession.java
new file mode 100644
index 0000000..fc7f7b9
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/SyncopeSession.java
@@ -0,0 +1,185 @@
+/*
+ * 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;
+
+import java.text.DateFormat;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import javax.ws.rs.core.EntityTag;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
+import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.rest.api.service.SyncopeService;
+import org.apache.wicket.Session;
+import org.apache.wicket.authroles.authorization.strategies.role.Roles;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebSession;
+import org.apache.wicket.request.Request;
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Custom Syncope Session class.
+ */
+public class SyncopeSession extends WebSession {
+
+ private static final long serialVersionUID = 7743446298924805872L;
+
+ public static final List<Locale> SUPPORTED_LOCALES = Arrays.asList(new Locale[] {
+ Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR") });
+
+ private String username;
+
+ private String password;
+
+ private String version;
+
+ private Roles roles = new Roles();
+
+ private final SyncopeClientFactoryBean clientFactory;
+
+ private final String anonymousUser;
+
+ private final String anonymousKey;
+
+ private final SyncopeTO syncopeTO;
+
+ private final Map<Integer, SyncopeClient> clients =
+ Collections.synchronizedMap(new HashMap<Integer, SyncopeClient>());
+
+ public static SyncopeSession get() {
+ return (SyncopeSession) Session.get();
+ }
+
+ public SyncopeSession(final Request request) {
+ super(request);
+
+ final ApplicationContext ctx = WebApplicationContextUtils.
+ getWebApplicationContext(WebApplication.get().getServletContext());
+
+ clientFactory = ctx.getBean(SyncopeClientFactoryBean.class).
+ setContentType(SyncopeClientFactoryBean.ContentType.JSON);
+ anonymousUser = ctx.getBean("anonymousUser", String.class);
+ anonymousKey = ctx.getBean("anonymousKey", String.class);
+
+ syncopeTO = clientFactory.create(anonymousUser, anonymousKey).getService(SyncopeService.class).info();
+ }
+
+ public SyncopeTO getSyncopeTO() {
+ return syncopeTO;
+ }
+
+ public void resetClients() {
+ clients.clear();
+ }
+
+ public <T> T getService(final Class<T> service) {
+ return getService(service, this.username, this.password);
+ }
+
+ public <T> T getService(final String etag, final Class<T> service) {
+ T serviceInstance = getService(service, this.username, this.password);
+ WebClient.client(serviceInstance).match(new EntityTag(etag), false);
+
+ return serviceInstance;
+ }
+
+ public <T> void resetClient(final Class<T> service) {
+ T serviceInstance = getService(service, this.username, this.password);
+ WebClient.client(serviceInstance).reset();
+ }
+
+ public <T> T getService(final MediaType mediaType, final Class<T> serviceClass) {
+ T service;
+
+ synchronized (clientFactory) {
+ SyncopeClientFactoryBean.ContentType preType = clientFactory.getContentType();
+
+ clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
+ service = clientFactory.create(username, password).getService(serviceClass);
+ clientFactory.setContentType(preType);
+ }
+
+ return service;
+ }
+
+ public <T> T getAnonymousService(final Class<T> serviceClass) {
+ return getService(serviceClass, this.anonymousUser, this.anonymousKey);
+ }
+
+ public <T> T getService(final Class<T> serviceClass, final String username, final String password) {
+ final int clientKey = new HashCodeBuilder().append(username).append(password).toHashCode();
+
+ if (!clients.containsKey(clientKey)) {
+ clients.put(clientKey, clientFactory.create(username, password));
+ }
+
+ return clients.get(clientKey).getService(serviceClass);
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(final String username) {
+ this.username = username;
+ }
+
+ public void setPassword(final String password) {
+ this.password = password;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+
+ public void setEntitlements(final String[] entitlements) {
+ String[] defensiveCopy = entitlements.clone();
+ roles = new Roles(defensiveCopy);
+ }
+
+ public Roles getEntitlements() {
+ return roles;
+ }
+
+ public boolean isAuthenticated() {
+ return getUsername() != null;
+ }
+
+ public boolean hasAnyRole(final Roles roles) {
+ return this.roles.hasAnyRole(roles);
+ }
+
+ public DateFormat getDateFormat() {
+ final Locale locale = getLocale() == null ? Locale.ENGLISH : getLocale();
+
+ return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ActionTableCheckGroup.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ActionTableCheckGroup.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ActionTableCheckGroup.java
new file mode 100644
index 0000000..453e0c0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ActionTableCheckGroup.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons;
+
+import java.util.Collection;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.model.IModel;
+
+public class ActionTableCheckGroup<T> extends CheckGroup<T> {
+
+ private static final long serialVersionUID = 1288270558573401394L;
+
+ public ActionTableCheckGroup(final String id, final Collection<T> collection) {
+ super(id, collection);
+ }
+
+ public ActionTableCheckGroup(final String id, final IModel<Collection<T>> model) {
+ super(id, model);
+ }
+
+ public boolean isCheckable(final T element) {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttrLayoutType.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttrLayoutType.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttrLayoutType.java
new file mode 100644
index 0000000..87cc062
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttrLayoutType.java
@@ -0,0 +1,105 @@
+/*
+ * 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.commons;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.common.lib.types.AttributableType;
+
+public enum AttrLayoutType {
+
+ ADMIN_USER("admin.user.layout", Mode.ADMIN, AttributableType.USER),
+ SELF_USER("self.user.layout", Mode.SELF, AttributableType.USER),
+ ADMIN_ROLE("admin.role.layout", Mode.ADMIN, AttributableType.ROLE),
+ SELF_ROLE("self.role.layout", Mode.SELF, AttributableType.ROLE),
+ ADMIN_MEMBERSHIP("admin.membership.layout", Mode.ADMIN, AttributableType.MEMBERSHIP),
+ SELF_MEMBERSHIP("self.membership.layout", Mode.SELF, AttributableType.MEMBERSHIP);
+
+ private final String confKey;
+
+ private final Mode mode;
+
+ private final AttributableType attrType;
+
+ AttrLayoutType(final String confKey, final Mode mode, final AttributableType attrType) {
+ this.confKey = confKey;
+ this.mode = mode;
+ this.attrType = attrType;
+ }
+
+ public String getConfKey() {
+ return confKey;
+ }
+
+ public Mode getMode() {
+ return mode;
+ }
+
+ public AttributableType getAttrType() {
+ return attrType;
+ }
+
+ public static List<String> confKeys() {
+ List<String> confKeys = new ArrayList<String>();
+ for (AttrLayoutType value : values()) {
+ confKeys.add(value.getConfKey());
+ }
+
+ return confKeys;
+ }
+
+ public static AttrLayoutType valueOf(final Mode mode, final AttributableType attrType) {
+ AttrLayoutType result = null;
+ if (mode == Mode.ADMIN) {
+ switch (attrType) {
+ case USER:
+ result = ADMIN_USER;
+ break;
+
+ case MEMBERSHIP:
+ result = ADMIN_MEMBERSHIP;
+ break;
+
+ case ROLE:
+ result = ADMIN_ROLE;
+ break;
+
+ default:
+ }
+ } else if (mode == Mode.SELF) {
+ switch (attrType) {
+ case USER:
+ result = SELF_USER;
+ break;
+
+ case MEMBERSHIP:
+ result = SELF_MEMBERSHIP;
+ break;
+
+ case ROLE:
+ result = SELF_ROLE;
+ break;
+
+ default:
+ }
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
new file mode 100644
index 0000000..4b207a7
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
@@ -0,0 +1,105 @@
+/*
+ * 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.commons;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.rest.AbstractSubjectRestClient;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AttributableDataProvider extends SortableDataProvider<AbstractAttributableTO, String> {
+
+ private static final long serialVersionUID = 6267494272884913376L;
+
+ private static final Logger LOG = LoggerFactory.getLogger(AttributableDataProvider.class);
+
+ private final SortableAttributableProviderComparator comparator;
+
+ private String fiql = null;
+
+ private final int paginatorRows;
+
+ private final boolean filtered;
+
+ private final AbstractSubjectRestClient restClient;
+
+ public AttributableDataProvider(final AbstractSubjectRestClient restClient,
+ final int paginatorRows, final boolean filtered) {
+
+ super();
+
+ this.restClient = restClient;
+ this.filtered = filtered;
+ this.paginatorRows = paginatorRows;
+
+ // default sorting
+ setSort("id", SortOrder.ASCENDING);
+
+ this.comparator = new SortableAttributableProviderComparator(this);
+ }
+
+ public void setFIQL(final String fiql) {
+ this.fiql = fiql;
+ }
+
+ @Override
+ public Iterator<? extends AbstractAttributableTO> iterator(final long first, final long count) {
+ List<? extends AbstractAttributableTO> result;
+
+ final int page = ((int) first / paginatorRows);
+
+ if (filtered) {
+ result = fiql == null
+ ? Collections.<AbstractAttributableTO>emptyList()
+ : restClient.search(fiql, (page < 0 ? 0 : page) + 1, paginatorRows, getSort());
+ } else {
+ result = restClient.list((page < 0 ? 0 : page) + 1, paginatorRows, getSort());
+ }
+
+ Collections.sort(result, comparator);
+ return result.iterator();
+ }
+
+ @Override
+ public long size() {
+ long result;
+
+ if (filtered) {
+ result = fiql == null
+ ? 0
+ : restClient.searchCount(fiql);
+ } else {
+ result = restClient.count();
+ }
+
+ return result;
+ }
+
+ @Override
+ public IModel<AbstractAttributableTO> model(final AbstractAttributableTO object) {
+ return new CompoundPropertyModel<AbstractAttributableTO>(object);
+ }
+}
[52/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
[SYNCOPE-620] Console working, Selenium IT in
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/07aa4585
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/07aa4585
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/07aa4585
Branch: refs/heads/2_0_X
Commit: 07aa458582c654e0683091b9da36e54c1ce7a0c4
Parents: 246ff1f
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Feb 5 17:00:14 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Feb 5 17:00:14 2015 +0100
----------------------------------------------------------------------
.../console/commons/SchemaModalPageFactory.java | 4 +-
.../console/pages/PlainSchemaModalPage.java | 456 ++++++++++++++++
.../syncope/console/pages/SchemaModalPage.java | 456 ----------------
.../console/pages/PlainSchemaModalPage.html | 172 ++++++
.../pages/PlainSchemaModalPage.properties | 38 ++
.../pages/PlainSchemaModalPage_it.properties | 38 ++
.../pages/PlainSchemaModalPage_pt_BR.properties | 38 ++
.../syncope/console/pages/SchemaModalPage.html | 172 ------
.../console/pages/SchemaModalPage.properties | 38 --
.../console/pages/SchemaModalPage_it.properties | 38 --
.../pages/SchemaModalPage_pt_BR.properties | 38 --
.../commons/AttributableDataProvider.java | 8 +-
.../SortableAttributableProviderComparator.java | 4 +-
.../commons/SortableDataProviderComparator.java | 6 +-
.../console/commons/status/StatusUtils.java | 20 +-
.../console/init/BinaryPreviewersLoader.java | 71 +++
.../client/console/init/ConsoleInitializer.java | 72 +++
.../console/init/MIMETypesInitializer.java | 63 ---
.../client/console/init/MIMETypesLoader.java | 69 +++
.../init/PreviewPanelClassInitializer.java | 69 ---
.../console/init/SpringContextInitializer.java | 45 --
.../console/init/SyncopeConsoleLoader.java | 35 ++
.../client/console/pages/AbstractBasePage.java | 6 +-
.../pages/AbstractSchedTaskModalPage.java | 8 +-
.../console/pages/BulkActionModalPage.java | 8 +-
.../client/console/pages/Configuration.java | 19 +-
.../console/pages/ConnectorModalPage.java | 54 +-
.../console/pages/DerSchemaModalPage.java | 8 +-
.../pages/DisplayAttributesModalPage.java | 22 +-
.../console/pages/NotificationModalPage.java | 2 +-
.../console/pages/PlainSchemaModalPage.java | 6 +-
.../client/console/pages/PolicyModalPage.java | 24 +-
.../console/pages/ProvisioningModalPage.java | 38 +-
.../client/console/pages/ReportModalPage.java | 16 +-
.../console/pages/ReportletConfModalPage.java | 10 +-
.../syncope/client/console/pages/Reports.java | 15 +-
.../client/console/pages/ResourceModalPage.java | 17 +-
.../syncope/client/console/pages/Resources.java | 43 +-
.../console/pages/ResultStatusModalPage.java | 25 +-
.../syncope/client/console/pages/Schema.java | 14 +-
.../client/console/pages/StatusModalPage.java | 5 +-
.../client/console/pages/TaskModalPage.java | 16 +-
.../syncope/client/console/pages/Tasks.java | 12 +-
.../client/console/pages/UserModalPage.java | 5 +-
.../syncope/client/console/pages/Users.java | 2 +-
.../console/pages/VirSchemaModalPage.java | 8 +-
.../console/panels/AbstractSearchPanel.java | 10 +-
.../panels/AbstractSearchResultPanel.java | 8 +-
.../console/panels/AttrTemplatesPanel.java | 10 +-
.../client/console/panels/ImagePanel.java | 3 +-
.../client/console/panels/LayoutsPanel.java | 2 +-
.../console/panels/NotificationTasks.java | 4 +-
.../client/console/panels/PlainAttrsPanel.java | 10 +-
.../client/console/panels/PoliciesPanel.java | 4 +-
.../client/console/panels/PolicyBeanPanel.java | 10 +-
.../client/console/panels/PropagationTasks.java | 15 +-
.../client/console/panels/PushTasksPanel.java | 2 +-
.../console/panels/ResourceDetailsPanel.java | 22 +-
.../console/panels/ResourceMappingPanel.java | 2 +-
.../client/console/panels/RoleDetailsPanel.java | 6 +-
.../client/console/panels/RolePanel.java | 6 +-
.../console/panels/RoleSearchResultPanel.java | 9 +-
.../client/console/panels/SchedTasks.java | 2 +-
.../client/console/panels/SyncTasksPanel.java | 6 +-
.../console/panels/UserSearchResultPanel.java | 5 +-
.../client/console/preview/PreviewUtil.java | 11 +-
.../console/preview/PreviewerClassScanner.java | 8 +-
.../console/rest/ConfigurationRestClient.java | 2 +-
.../client/console/rest/ResourceRestClient.java | 4 +-
.../client/console/rest/SchemaRestClient.java | 19 +-
.../META-INF/cxf/org.apache.cxf.Logger | 1 +
.../META-INF/resources/img/favicon.ico | Bin 1406 -> 0 bytes
.../META-INF/resources/img/favicon.png | Bin 0 -> 641 bytes
.../META-INF/resources/img/statuses/active.png | Bin 0 -> 509 bytes
.../resources/img/statuses/inactive.png | Bin 0 -> 477 bytes
.../resources/img/statuses/objectnotfound.png | Bin 0 -> 668 bytes
.../resources/img/statuses/undefined.png | Bin 0 -> 758 bytes
.../main/resources/META-INF/web-fragment.xml | 4 +
.../src/main/resources/console.properties | 3 +-
.../src/main/resources/consoleContext.xml | 2 +-
.../console/SyncopeApplication.properties | 1 +
.../console/SyncopeApplication_it.properties | 1 +
.../console/SyncopeApplication_pt_BR.properties | 1 +
.../console/pages/AbstractStatusModalPage.html | 4 +-
.../syncope/client/console/pages/BasePage.html | 2 +-
.../client/console/pages/Configuration.html | 403 +++++++-------
.../console/pages/Configuration.properties | 1 -
.../console/pages/ConnectorModalPage.html | 4 +-
.../console/pages/ConnectorModalPage.properties | 3 +-
.../pages/ConnectorModalPage_it.properties | 3 +-
.../pages/ConnectorModalPage_pt_BR.properties | 3 +-
.../console/pages/DerSchemaModalPage.html | 4 +-
.../pages/DisplayAttributesModalPage.html | 8 +-
.../pages/DisplayAttributesModalPage.properties | 2 +-
.../DisplayAttributesModalPage_it.properties | 2 +-
.../DisplayAttributesModalPage_pt_BR.properties | 14 +-
.../syncope/client/console/pages/Login.html | 2 +-
.../console/pages/MembershipModalPage.html | 2 +-
.../pages/MembershipModalPage.properties | 2 +-
.../pages/MembershipModalPage_it.properties | 2 +-
.../pages/MembershipModalPage_pt_BR.properties | 2 +-
.../pages/NotificationTaskModalPage.html | 148 +++---
.../console/pages/PlainSchemaModalPage.html | 4 +-
.../client/console/pages/PolicyModalPage.html | 4 +-
.../console/pages/PropagationTaskModalPage.html | 92 ++--
.../client/console/pages/PushTaskModalPage.html | 2 +-
.../client/console/pages/ReportModalPage.html | 2 +-
.../pages/ResourceModalPage_pt_BR.properties | 2 +-
.../client/console/pages/RoleModalPage.html | 2 +-
.../console/pages/RoleModalPage.properties | 4 +-
.../console/pages/RoleModalPage_it.properties | 10 +-
.../pages/RoleModalPage_pt_BR.properties | 4 +-
.../console/pages/SchedTaskModalPage.html | 4 +-
.../client/console/pages/Schema.properties | 2 +-
.../client/console/pages/Schema_it.properties | 2 +-
.../console/pages/Schema_pt_BR.properties | 2 +-
.../client/console/pages/SyncTaskModalPage.html | 2 +-
.../client/console/pages/UserModalPage.html | 2 +-
.../console/pages/UserModalPage.properties | 2 +-
.../console/pages/UserModalPage_it.properties | 2 +-
.../pages/UserModalPage_pt_BR.properties | 2 +-
.../console/pages/VirSchemaModalPage.html | 4 +-
.../client/console/pages/statuses/active.png | Bin 509 -> 0 bytes
.../client/console/pages/statuses/inactive.png | Bin 477 -> 0 bytes
.../console/pages/statuses/objectnotfound.png | Bin 668 -> 0 bytes
.../client/console/pages/statuses/undefined.png | Bin 758 -> 0 bytes
.../panels/AbstractProvisioningTasksPanel.html | 41 ++
.../console/panels/AbstractSyncTasksPanel.html | 41 --
.../console/panels/AttrTemplatesPanel.html | 12 +-
.../panels/AttrTemplatesPanel.properties | 4 +-
.../panels/AttrTemplatesPanel_it.properties | 4 +-
.../panels/AttrTemplatesPanel_pt_BR.properties | 4 +-
.../client/console/panels/RolePanel.html | 8 +-
.../client/console/panels/RolePanel.properties | 2 +-
.../console/panels/RolePanel_it.properties | 2 +-
.../console/panels/RolePanel_pt_BR.properties | 2 +-
.../client/console/panels/RoleTabPanel.html | 6 +-
.../console/panels/RoleTabPanel.properties | 2 +-
.../console/panels/RoleTabPanel_it.properties | 2 +-
.../panels/RoleTabPanel_pt_BR.properties | 2 +-
.../common/lib/AttributableOperations.java | 12 +-
.../common/lib/report/RoleReportletConf.java | 4 +-
.../common/lib/report/UserReportletConf.java | 4 +-
.../common/lib/search/SearchableFields.java | 12 +-
.../common/lib/to/AbstractSubjectTO.java | 2 +-
.../syncope/common/lib/to/NotificationTO.java | 4 +-
.../apache/syncope/common/lib/to/RoleTO.java | 24 +-
.../syncope/common/lib/types/PolicySpec.java | 4 +-
.../syncope/common/lib/wrap/SubjectId.java | 25 -
.../syncope/common/lib/wrap/SubjectKey.java | 25 +
.../rest/api/service/ResourceService.java | 6 +-
syncope620/fit/console-reference/pom.xml | 525 +++++++++++++++++++
.../src/main/resources/console.properties | 22 +
.../src/main/resources/context.xml | 23 +
.../src/main/resources/log4j2.xml | 66 +++
.../oryx.debug.js-tokenValueMap.properties | 35 ++
.../fit/console/reference/AbstractITCase.java | 70 +++
.../fit/console/reference/AccessITCase.java | 80 +++
.../console/reference/ConfigurationITCase.java | 402 ++++++++++++++
.../fit/console/reference/ConnectorITCase.java | 238 +++++++++
.../console/reference/EditProfileITCase.java | 94 ++++
.../fit/console/reference/ReportITCase.java | 117 +++++
.../fit/console/reference/ResourceITCase.java | 144 +++++
.../fit/console/reference/RoleITCase.java | 211 ++++++++
.../fit/console/reference/SchemaITCase.java | 70 +++
.../fit/console/reference/TaskITCase.java | 123 +++++
.../fit/console/reference/UserITCase.java | 184 +++++++
syncope620/fit/pom.xml | 1 +
syncope620/fit/server-reference/pom.xml | 75 ++-
.../main/resources/all/provisioning.properties | 19 +
.../src/main/resources/all/workflow.properties | 20 +
.../resources/light/provisioning.properties | 18 -
.../main/resources/light/workflow.properties | 20 -
.../src/main/resources/provisioning.properties | 5 +-
.../src/main/resources/workflow.properties | 4 +-
.../server/reference/ConfigurationITCase.java | 4 +-
.../fit/server/reference/PushTaskITCase.java | 2 +-
.../fit/server/reference/RoleITCase.java | 14 +-
syncope620/pom.xml | 94 +++-
.../syncope/server/misc/ConnObjectUtil.java | 4 +-
.../jpa/dao/JPASubjectSearchDAO.java | 23 +-
.../jpa/entity/AnnotatedEntityListener.java | 2 +-
.../src/test/resources/content.xml | 8 +-
.../java/data/RoleDataBinderImpl.java | 8 +-
.../rest/cxf/service/ResourceServiceImpl.java | 18 +-
185 files changed, 4414 insertions(+), 1870 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java b/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java
index b545e8f..429fd40 100644
--- a/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java
+++ b/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java
@@ -22,7 +22,7 @@ import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.SchemaType;
import org.apache.syncope.console.pages.AbstractSchemaModalPage;
import org.apache.syncope.console.pages.DerSchemaModalPage;
-import org.apache.syncope.console.pages.SchemaModalPage;
+import org.apache.syncope.console.pages.PlainSchemaModalPage;
import org.apache.syncope.console.pages.VirSchemaModalPage;
public final class SchemaModalPageFactory {
@@ -49,7 +49,7 @@ public final class SchemaModalPageFactory {
break;
default:
- page = (T) new SchemaModalPage(entity);
+ page = (T) new PlainSchemaModalPage(entity);
break;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/java/org/apache/syncope/console/pages/PlainSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/pages/PlainSchemaModalPage.java b/console/src/main/java/org/apache/syncope/console/pages/PlainSchemaModalPage.java
new file mode 100644
index 0000000..935e605
--- /dev/null
+++ b/console/src/main/java/org/apache/syncope/console/pages/PlainSchemaModalPage.java
@@ -0,0 +1,456 @@
+/*
+ * 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.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.SyncopeConstants;
+import org.apache.syncope.common.to.SchemaTO;
+import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.AttributeSchemaType;
+import org.apache.syncope.common.SyncopeClientException;
+import org.apache.syncope.common.types.CipherAlgorithm;
+import org.apache.syncope.console.commons.Constants;
+import org.apache.syncope.console.commons.JexlHelpUtil;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.util.string.Strings;
+
+/**
+ * Modal window with Schema form.
+ */
+public class PlainSchemaModalPage extends AbstractSchemaModalPage<SchemaTO> {
+
+ private static final long serialVersionUID = -5991561277287424057L;
+
+ public PlainSchemaModalPage(final AttributableType kind) {
+ super(kind);
+ }
+
+ @Override
+ public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
+ final SchemaTO schemaTO, final boolean createFlag) {
+
+ final SchemaTO schema = schemaTO == null
+ ? new SchemaTO()
+ : schemaTO;
+
+ final Form<SchemaTO> schemaForm = new Form<SchemaTO>(FORM);
+
+ schemaForm.setModel(new CompoundPropertyModel<SchemaTO>(schema));
+ schemaForm.setOutputMarkupId(true);
+
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(schema, "name"));
+ name.addRequiredLabel();
+ name.setEnabled(createFlag);
+ schemaForm.add(name);
+
+ final AjaxDropDownChoicePanel<AttributeSchemaType> type = new AjaxDropDownChoicePanel<AttributeSchemaType>(
+ "type", getString("type"), new PropertyModel<AttributeSchemaType>(schema, "type"));
+ type.setChoices(Arrays.asList(AttributeSchemaType.values()));
+ type.addRequiredLabel();
+ schemaForm.add(type);
+
+ // -- long, double, date
+ final AjaxTextFieldPanel conversionPattern = new AjaxTextFieldPanel("conversionPattern",
+ getString("conversionPattern"), new PropertyModel<String>(schema, "conversionPattern"));
+ schemaForm.add(conversionPattern);
+
+ final WebMarkupContainer conversionParams = new WebMarkupContainer("conversionParams");
+ conversionParams.setOutputMarkupPlaceholderTag(true);
+ conversionParams.add(conversionPattern);
+ schemaForm.add(conversionParams);
+
+ final WebMarkupContainer typeParams = new WebMarkupContainer("typeParams");
+ typeParams.setOutputMarkupPlaceholderTag(true);
+ // -- enum
+ final AjaxTextFieldPanel enumerationValuesPanel =
+ new AjaxTextFieldPanel("panel", "enumerationValues", new Model<String>(null));
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final MultiFieldPanel<String> enumerationValues = new MultiFieldPanel<String>("enumerationValues",
+ new Model(),
+ enumerationValuesPanel);
+ enumerationValues.setModelObject(getEnumValuesAsList(schema.getEnumerationValues()));
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final MultiFieldPanel<String> enumerationKeys = new MultiFieldPanel<String>("enumerationKeys",
+ new Model(),
+ new AjaxTextFieldPanel("panel", "enumerationKeys", new Model<String>(null)));
+ enumerationKeys.setModelObject(getEnumValuesAsList(schema.getEnumerationKeys()));
+
+ final WebMarkupContainer enumParams = new WebMarkupContainer("enumParams");
+ enumParams.setOutputMarkupPlaceholderTag(true);
+ enumParams.add(enumerationValues);
+ enumParams.add(enumerationKeys);
+ typeParams.add(enumParams);
+
+ // -- encrypted
+ final AjaxTextFieldPanel secretKey = new AjaxTextFieldPanel("secretKey",
+ getString("secretKey"), new PropertyModel<String>(schema, "secretKey"));
+
+ final AjaxDropDownChoicePanel<CipherAlgorithm> cipherAlgorithm = new AjaxDropDownChoicePanel<CipherAlgorithm>(
+ "cipherAlgorithm", getString("cipherAlgorithm"),
+ new PropertyModel<CipherAlgorithm>(schema, "cipherAlgorithm"));
+ cipherAlgorithm.setChoices(Arrays.asList(CipherAlgorithm.values()));
+
+ final WebMarkupContainer encryptedParams = new WebMarkupContainer("encryptedParams");
+ encryptedParams.setOutputMarkupPlaceholderTag(true);
+ encryptedParams.add(secretKey);
+ encryptedParams.add(cipherAlgorithm);
+ typeParams.add(encryptedParams);
+
+ // -- binary
+ final AjaxTextFieldPanel mimeType = new AjaxTextFieldPanel("mimeType",
+ getString("mimeType"), new PropertyModel<String>(schema, "mimeType"));
+ mimeType.setChoices(mimeTypesInitializer.getMimeTypes());
+
+ final WebMarkupContainer binaryParams = new WebMarkupContainer("binaryParams");
+ binaryParams.setOutputMarkupPlaceholderTag(true);
+ binaryParams.add(mimeType);
+ typeParams.add(binaryParams);
+
+ schemaForm.add(typeParams);
+
+ // -- show or hide
+ showHide(schema, type,
+ conversionParams, conversionPattern,
+ enumParams, enumerationValuesPanel, enumerationValues, enumerationKeys,
+ encryptedParams, secretKey, cipherAlgorithm,
+ binaryParams, mimeType);
+ type.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ PlainSchemaModalPage.this.showHide(schema, type,
+ conversionParams, conversionPattern,
+ enumParams, enumerationValuesPanel, enumerationValues, enumerationKeys,
+ encryptedParams, secretKey, cipherAlgorithm,
+ binaryParams, mimeType);
+ target.add(typeParams);
+ }
+ });
+
+ final IModel<List<String>> validatorsList = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return schemaRestClient.getAllValidatorClasses();
+ }
+ };
+ final AjaxDropDownChoicePanel<String> validatorClass = new AjaxDropDownChoicePanel<String>("validatorClass",
+ getString("validatorClass"), new PropertyModel<String>(schema, "validatorClass"));
+ ((DropDownChoice) validatorClass.getField()).setNullValid(true);
+ validatorClass.setChoices(validatorsList.getObject());
+ schemaForm.add(validatorClass);
+
+ final AutoCompleteTextField<String> mandatoryCondition =
+ new AutoCompleteTextField<String>("mandatoryCondition") {
+
+ private static final long serialVersionUID = -2428903969518079100L;
+
+ @Override
+ protected Iterator<String> getChoices(final String input) {
+ List<String> choices = new ArrayList<String>();
+
+ if (Strings.isEmpty(input)) {
+ choices = Collections.emptyList();
+ } else if ("true".startsWith(input.toLowerCase())) {
+ choices.add("true");
+ } else if ("false".startsWith(input.toLowerCase())) {
+ choices.add("false");
+ }
+
+ return choices.iterator();
+ }
+ };
+ mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+ schemaForm.add(mandatoryCondition);
+
+ final WebMarkupContainer pwdJexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
+
+ final AjaxLink<Void> pwdQuestionMarkJexlHelp = JexlHelpUtil.getAjaxLink(pwdJexlHelp, "questionMarkJexlHelp");
+ schemaForm.add(pwdQuestionMarkJexlHelp);
+ pwdQuestionMarkJexlHelp.add(pwdJexlHelp);
+
+ final AjaxCheckBoxPanel multivalue = new AjaxCheckBoxPanel("multivalue", getString("multivalue"),
+ new PropertyModel<Boolean>(schema, "multivalue"));
+ schemaForm.add(multivalue);
+
+ final AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", getString("readonly"),
+ new PropertyModel<Boolean>(schema, "readonly"));
+ schemaForm.add(readonly);
+
+ final AjaxCheckBoxPanel uniqueConstraint = new AjaxCheckBoxPanel("uniqueConstraint",
+ getString("uniqueConstraint"), new PropertyModel<Boolean>(schema, "uniqueConstraint"));
+ schemaForm.add(uniqueConstraint);
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final SchemaTO schemaTO = (SchemaTO) form.getDefaultModelObject();
+
+ schemaTO.setEnumerationValues(getEnumValuesAsString(enumerationValues.getView().getModelObject()));
+ schemaTO.setEnumerationKeys(getEnumValuesAsString(enumerationKeys.getView().getModelObject()));
+
+ if (schemaTO.isMultivalue() && schemaTO.isUniqueConstraint()) {
+ error(getString("multivalueAndUniqueConstr.validation"));
+ feedbackPanel.refresh(target);
+ return;
+ }
+
+ try {
+ if (createFlag) {
+ schemaRestClient.createSchema(kind, schemaTO);
+ } else {
+ schemaRestClient.updateSchema(kind, schemaTO);
+ }
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ schemaForm.add(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ schemaForm.add(cancel);
+
+ String allowedRoles = createFlag
+ ? xmlRolesReader.getEntitlement("Schema", "create")
+ : xmlRolesReader.getEntitlement("Schema", "update");
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
+
+ add(schemaForm);
+ }
+
+ private void showHide(final SchemaTO schema, final AjaxDropDownChoicePanel<AttributeSchemaType> type,
+ final WebMarkupContainer conversionParams, final AjaxTextFieldPanel conversionPattern,
+ final WebMarkupContainer enumParams, final AjaxTextFieldPanel enumerationValuesPanel,
+ final MultiFieldPanel<String> enumerationValues, final MultiFieldPanel<String> enumerationKeys,
+ final WebMarkupContainer encryptedParams,
+ final AjaxTextFieldPanel secretKey, final AjaxDropDownChoicePanel<CipherAlgorithm> cipherAlgorithm,
+ final WebMarkupContainer binaryParams, final AjaxTextFieldPanel mimeType) {
+
+ final int typeOrdinal = Integer.parseInt(type.getField().getValue());
+ if (AttributeSchemaType.Long.ordinal() == typeOrdinal
+ || AttributeSchemaType.Double.ordinal() == typeOrdinal
+ || AttributeSchemaType.Date.ordinal() == typeOrdinal) {
+
+ conversionParams.setVisible(true);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ } else if (AttributeSchemaType.Enum.ordinal() == typeOrdinal) {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(true);
+ if (!enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.addRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(schema.getEnumerationValues()));
+ enumerationKeys.setModelObject(getEnumValuesAsList(schema.getEnumerationKeys()));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ } else if (AttributeSchemaType.Encrypted.ordinal() == typeOrdinal) {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(true);
+ if (!secretKey.isRequired()) {
+ secretKey.addRequiredLabel();
+ }
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.addRequiredLabel();
+ }
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ } else if (AttributeSchemaType.Binary.ordinal() == typeOrdinal) {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(true);
+ } else {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ }
+ }
+
+ private String getEnumValuesAsString(final List<String> enumerationValues) {
+ final StringBuilder builder = new StringBuilder();
+
+ for (String str : enumerationValues) {
+ if (StringUtils.isNotBlank(str)) {
+ if (builder.length() > 0) {
+ builder.append(SyncopeConstants.ENUM_VALUES_SEPARATOR);
+ }
+
+ builder.append(str.trim());
+ }
+ }
+
+ return builder.toString();
+ }
+
+ private List<String> getEnumValuesAsList(final String enumerationValues) {
+ final List<String> values = new ArrayList<String>();
+
+ if (StringUtils.isNotBlank(enumerationValues)) {
+ for (String value : enumerationValues.split(SyncopeConstants.ENUM_VALUES_SEPARATOR)) {
+ values.add(value.trim());
+ }
+ } else {
+ values.add(StringUtils.EMPTY);
+ }
+
+ return values;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/java/org/apache/syncope/console/pages/SchemaModalPage.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/pages/SchemaModalPage.java b/console/src/main/java/org/apache/syncope/console/pages/SchemaModalPage.java
deleted file mode 100644
index 1e634f0..0000000
--- a/console/src/main/java/org/apache/syncope/console/pages/SchemaModalPage.java
+++ /dev/null
@@ -1,456 +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.console.pages;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.SyncopeConstants;
-import org.apache.syncope.common.to.SchemaTO;
-import org.apache.syncope.common.types.AttributableType;
-import org.apache.syncope.common.types.AttributeSchemaType;
-import org.apache.syncope.common.SyncopeClientException;
-import org.apache.syncope.common.types.CipherAlgorithm;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.commons.JexlHelpUtil;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
-import org.apache.syncope.console.wicket.markup.html.form.MultiFieldPanel;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
-import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.util.string.Strings;
-
-/**
- * Modal window with Schema form.
- */
-public class SchemaModalPage extends AbstractSchemaModalPage<SchemaTO> {
-
- private static final long serialVersionUID = -5991561277287424057L;
-
- public SchemaModalPage(final AttributableType kind) {
- super(kind);
- }
-
- @Override
- public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
- final SchemaTO schemaTO, final boolean createFlag) {
-
- final SchemaTO schema = schemaTO == null
- ? new SchemaTO()
- : schemaTO;
-
- final Form<SchemaTO> schemaForm = new Form<SchemaTO>(FORM);
-
- schemaForm.setModel(new CompoundPropertyModel<SchemaTO>(schema));
- schemaForm.setOutputMarkupId(true);
-
- final AjaxTextFieldPanel name =
- new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(schema, "name"));
- name.addRequiredLabel();
- name.setEnabled(createFlag);
- schemaForm.add(name);
-
- final AjaxDropDownChoicePanel<AttributeSchemaType> type = new AjaxDropDownChoicePanel<AttributeSchemaType>(
- "type", getString("type"), new PropertyModel<AttributeSchemaType>(schema, "type"));
- type.setChoices(Arrays.asList(AttributeSchemaType.values()));
- type.addRequiredLabel();
- schemaForm.add(type);
-
- // -- long, double, date
- final AjaxTextFieldPanel conversionPattern = new AjaxTextFieldPanel("conversionPattern",
- getString("conversionPattern"), new PropertyModel<String>(schema, "conversionPattern"));
- schemaForm.add(conversionPattern);
-
- final WebMarkupContainer conversionParams = new WebMarkupContainer("conversionParams");
- conversionParams.setOutputMarkupPlaceholderTag(true);
- conversionParams.add(conversionPattern);
- schemaForm.add(conversionParams);
-
- final WebMarkupContainer typeParams = new WebMarkupContainer("typeParams");
- typeParams.setOutputMarkupPlaceholderTag(true);
- // -- enum
- final AjaxTextFieldPanel enumerationValuesPanel =
- new AjaxTextFieldPanel("panel", "enumerationValues", new Model<String>(null));
- @SuppressWarnings({ "unchecked", "rawtypes" })
- final MultiFieldPanel<String> enumerationValues = new MultiFieldPanel<String>("enumerationValues",
- new Model(),
- enumerationValuesPanel);
- enumerationValues.setModelObject(getEnumValuesAsList(schema.getEnumerationValues()));
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- final MultiFieldPanel<String> enumerationKeys = new MultiFieldPanel<String>("enumerationKeys",
- new Model(),
- new AjaxTextFieldPanel("panel", "enumerationKeys", new Model<String>(null)));
- enumerationKeys.setModelObject(getEnumValuesAsList(schema.getEnumerationKeys()));
-
- final WebMarkupContainer enumParams = new WebMarkupContainer("enumParams");
- enumParams.setOutputMarkupPlaceholderTag(true);
- enumParams.add(enumerationValues);
- enumParams.add(enumerationKeys);
- typeParams.add(enumParams);
-
- // -- encrypted
- final AjaxTextFieldPanel secretKey = new AjaxTextFieldPanel("secretKey",
- getString("secretKey"), new PropertyModel<String>(schema, "secretKey"));
-
- final AjaxDropDownChoicePanel<CipherAlgorithm> cipherAlgorithm = new AjaxDropDownChoicePanel<CipherAlgorithm>(
- "cipherAlgorithm", getString("cipherAlgorithm"),
- new PropertyModel<CipherAlgorithm>(schema, "cipherAlgorithm"));
- cipherAlgorithm.setChoices(Arrays.asList(CipherAlgorithm.values()));
-
- final WebMarkupContainer encryptedParams = new WebMarkupContainer("encryptedParams");
- encryptedParams.setOutputMarkupPlaceholderTag(true);
- encryptedParams.add(secretKey);
- encryptedParams.add(cipherAlgorithm);
- typeParams.add(encryptedParams);
-
- // -- binary
- final AjaxTextFieldPanel mimeType = new AjaxTextFieldPanel("mimeType",
- getString("mimeType"), new PropertyModel<String>(schema, "mimeType"));
- mimeType.setChoices(mimeTypesInitializer.getMimeTypes());
-
- final WebMarkupContainer binaryParams = new WebMarkupContainer("binaryParams");
- binaryParams.setOutputMarkupPlaceholderTag(true);
- binaryParams.add(mimeType);
- typeParams.add(binaryParams);
-
- schemaForm.add(typeParams);
-
- // -- show or hide
- showHide(schema, type,
- conversionParams, conversionPattern,
- enumParams, enumerationValuesPanel, enumerationValues, enumerationKeys,
- encryptedParams, secretKey, cipherAlgorithm,
- binaryParams, mimeType);
- type.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
-
- private static final long serialVersionUID = -1107858522700306810L;
-
- @Override
- protected void onUpdate(final AjaxRequestTarget target) {
- SchemaModalPage.this.showHide(schema, type,
- conversionParams, conversionPattern,
- enumParams, enumerationValuesPanel, enumerationValues, enumerationKeys,
- encryptedParams, secretKey, cipherAlgorithm,
- binaryParams, mimeType);
- target.add(typeParams);
- }
- });
-
- final IModel<List<String>> validatorsList = new LoadableDetachableModel<List<String>>() {
-
- private static final long serialVersionUID = 5275935387613157437L;
-
- @Override
- protected List<String> load() {
- return schemaRestClient.getAllValidatorClasses();
- }
- };
- final AjaxDropDownChoicePanel<String> validatorClass = new AjaxDropDownChoicePanel<String>("validatorClass",
- getString("validatorClass"), new PropertyModel<String>(schema, "validatorClass"));
- ((DropDownChoice) validatorClass.getField()).setNullValid(true);
- validatorClass.setChoices(validatorsList.getObject());
- schemaForm.add(validatorClass);
-
- final AutoCompleteTextField<String> mandatoryCondition =
- new AutoCompleteTextField<String>("mandatoryCondition") {
-
- private static final long serialVersionUID = -2428903969518079100L;
-
- @Override
- protected Iterator<String> getChoices(final String input) {
- List<String> choices = new ArrayList<String>();
-
- if (Strings.isEmpty(input)) {
- choices = Collections.emptyList();
- } else if ("true".startsWith(input.toLowerCase())) {
- choices.add("true");
- } else if ("false".startsWith(input.toLowerCase())) {
- choices.add("false");
- }
-
- return choices.iterator();
- }
- };
- mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
-
- private static final long serialVersionUID = -1107858522700306810L;
-
- @Override
- protected void onUpdate(final AjaxRequestTarget target) {
- }
- });
- schemaForm.add(mandatoryCondition);
-
- final WebMarkupContainer pwdJexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
-
- final AjaxLink<Void> pwdQuestionMarkJexlHelp = JexlHelpUtil.getAjaxLink(pwdJexlHelp, "questionMarkJexlHelp");
- schemaForm.add(pwdQuestionMarkJexlHelp);
- pwdQuestionMarkJexlHelp.add(pwdJexlHelp);
-
- final AjaxCheckBoxPanel multivalue = new AjaxCheckBoxPanel("multivalue", getString("multivalue"),
- new PropertyModel<Boolean>(schema, "multivalue"));
- schemaForm.add(multivalue);
-
- final AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", getString("readonly"),
- new PropertyModel<Boolean>(schema, "readonly"));
- schemaForm.add(readonly);
-
- final AjaxCheckBoxPanel uniqueConstraint = new AjaxCheckBoxPanel("uniqueConstraint",
- getString("uniqueConstraint"), new PropertyModel<Boolean>(schema, "uniqueConstraint"));
- schemaForm.add(uniqueConstraint);
-
- final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT)) {
-
- private static final long serialVersionUID = -958724007591692537L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- final SchemaTO schemaTO = (SchemaTO) form.getDefaultModelObject();
-
- schemaTO.setEnumerationValues(getEnumValuesAsString(enumerationValues.getView().getModelObject()));
- schemaTO.setEnumerationKeys(getEnumValuesAsString(enumerationKeys.getView().getModelObject()));
-
- if (schemaTO.isMultivalue() && schemaTO.isUniqueConstraint()) {
- error(getString("multivalueAndUniqueConstr.validation"));
- feedbackPanel.refresh(target);
- return;
- }
-
- try {
- if (createFlag) {
- schemaRestClient.createSchema(kind, schemaTO);
- } else {
- schemaRestClient.updateSchema(kind, schemaTO);
- }
- if (pageRef.getPage() instanceof BasePage) {
- ((BasePage) pageRef.getPage()).setModalResult(true);
- }
-
- window.close(target);
- } catch (SyncopeClientException e) {
- error(getString(Constants.ERROR) + ": " + e.getMessage());
- feedbackPanel.refresh(target);
- }
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
- feedbackPanel.refresh(target);
- }
- };
- schemaForm.add(submit);
-
- final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
-
- private static final long serialVersionUID = -958724007591692537L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- window.close(target);
- }
- };
- cancel.setDefaultFormProcessing(false);
- schemaForm.add(cancel);
-
- String allowedRoles = createFlag
- ? xmlRolesReader.getEntitlement("Schema", "create")
- : xmlRolesReader.getEntitlement("Schema", "update");
-
- MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
-
- add(schemaForm);
- }
-
- private void showHide(final SchemaTO schema, final AjaxDropDownChoicePanel<AttributeSchemaType> type,
- final WebMarkupContainer conversionParams, final AjaxTextFieldPanel conversionPattern,
- final WebMarkupContainer enumParams, final AjaxTextFieldPanel enumerationValuesPanel,
- final MultiFieldPanel<String> enumerationValues, final MultiFieldPanel<String> enumerationKeys,
- final WebMarkupContainer encryptedParams,
- final AjaxTextFieldPanel secretKey, final AjaxDropDownChoicePanel<CipherAlgorithm> cipherAlgorithm,
- final WebMarkupContainer binaryParams, final AjaxTextFieldPanel mimeType) {
-
- final int typeOrdinal = Integer.parseInt(type.getField().getValue());
- if (AttributeSchemaType.Long.ordinal() == typeOrdinal
- || AttributeSchemaType.Double.ordinal() == typeOrdinal
- || AttributeSchemaType.Date.ordinal() == typeOrdinal) {
-
- conversionParams.setVisible(true);
-
- enumParams.setVisible(false);
- if (enumerationValuesPanel.isRequired()) {
- enumerationValuesPanel.removeRequiredLabel();
- }
- enumerationValues.setModelObject(getEnumValuesAsList(null));
- enumerationKeys.setModelObject(getEnumValuesAsList(null));
-
- encryptedParams.setVisible(false);
- if (secretKey.isRequired()) {
- secretKey.removeRequiredLabel();
- }
- secretKey.setModelObject(null);
- if (cipherAlgorithm.isRequired()) {
- cipherAlgorithm.removeRequiredLabel();
- }
- cipherAlgorithm.setModelObject(null);
-
- binaryParams.setVisible(false);
- mimeType.setModelObject(null);
- } else if (AttributeSchemaType.Enum.ordinal() == typeOrdinal) {
- conversionParams.setVisible(false);
- conversionPattern.setModelObject(null);
-
- enumParams.setVisible(true);
- if (!enumerationValuesPanel.isRequired()) {
- enumerationValuesPanel.addRequiredLabel();
- }
- enumerationValues.setModelObject(getEnumValuesAsList(schema.getEnumerationValues()));
- enumerationKeys.setModelObject(getEnumValuesAsList(schema.getEnumerationKeys()));
-
- encryptedParams.setVisible(false);
- if (secretKey.isRequired()) {
- secretKey.removeRequiredLabel();
- }
- secretKey.setModelObject(null);
- if (cipherAlgorithm.isRequired()) {
- cipherAlgorithm.removeRequiredLabel();
- }
- cipherAlgorithm.setModelObject(null);
-
- binaryParams.setVisible(false);
- mimeType.setModelObject(null);
- } else if (AttributeSchemaType.Encrypted.ordinal() == typeOrdinal) {
- conversionParams.setVisible(false);
- conversionPattern.setModelObject(null);
-
- enumParams.setVisible(false);
- if (enumerationValuesPanel.isRequired()) {
- enumerationValuesPanel.removeRequiredLabel();
- }
- enumerationValues.setModelObject(getEnumValuesAsList(null));
- enumerationKeys.setModelObject(getEnumValuesAsList(null));
-
- encryptedParams.setVisible(true);
- if (!secretKey.isRequired()) {
- secretKey.addRequiredLabel();
- }
- if (cipherAlgorithm.isRequired()) {
- cipherAlgorithm.addRequiredLabel();
- }
-
- binaryParams.setVisible(false);
- mimeType.setModelObject(null);
- } else if (AttributeSchemaType.Binary.ordinal() == typeOrdinal) {
- conversionParams.setVisible(false);
- conversionPattern.setModelObject(null);
-
- enumParams.setVisible(false);
- if (enumerationValuesPanel.isRequired()) {
- enumerationValuesPanel.removeRequiredLabel();
- }
- enumerationValues.setModelObject(getEnumValuesAsList(null));
- enumerationKeys.setModelObject(getEnumValuesAsList(null));
-
- encryptedParams.setVisible(false);
- if (secretKey.isRequired()) {
- secretKey.removeRequiredLabel();
- }
- secretKey.setModelObject(null);
- if (cipherAlgorithm.isRequired()) {
- cipherAlgorithm.removeRequiredLabel();
- }
- cipherAlgorithm.setModelObject(null);
-
- binaryParams.setVisible(true);
- } else {
- conversionParams.setVisible(false);
- conversionPattern.setModelObject(null);
-
- enumParams.setVisible(false);
- if (enumerationValuesPanel.isRequired()) {
- enumerationValuesPanel.removeRequiredLabel();
- }
- enumerationValues.setModelObject(getEnumValuesAsList(null));
- enumerationKeys.setModelObject(getEnumValuesAsList(null));
-
- encryptedParams.setVisible(false);
- if (secretKey.isRequired()) {
- secretKey.removeRequiredLabel();
- }
- secretKey.setModelObject(null);
- if (cipherAlgorithm.isRequired()) {
- cipherAlgorithm.removeRequiredLabel();
- }
- cipherAlgorithm.setModelObject(null);
-
- binaryParams.setVisible(false);
- mimeType.setModelObject(null);
- }
- }
-
- private String getEnumValuesAsString(final List<String> enumerationValues) {
- final StringBuilder builder = new StringBuilder();
-
- for (String str : enumerationValues) {
- if (StringUtils.isNotBlank(str)) {
- if (builder.length() > 0) {
- builder.append(SyncopeConstants.ENUM_VALUES_SEPARATOR);
- }
-
- builder.append(str.trim());
- }
- }
-
- return builder.toString();
- }
-
- private List<String> getEnumValuesAsList(final String enumerationValues) {
- final List<String> values = new ArrayList<String>();
-
- if (StringUtils.isNotBlank(enumerationValues)) {
- for (String value : enumerationValues.split(SyncopeConstants.ENUM_VALUES_SEPARATOR)) {
- values.add(value.trim());
- }
- } else {
- values.add(StringUtils.EMPTY);
- }
-
- return values;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.html b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.html
new file mode 100644
index 0000000..154419f
--- /dev/null
+++ b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.html
@@ -0,0 +1,172 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="key"><wicket:message key="key"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="key">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="type"><wicket:message key="type"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="type">[type]</span>
+ </div>
+ </div>
+
+ <div wicket:id="conversionParams">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="conversionPattern"><wicket:message key="conversionPattern"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="conversionPattern">[conversionPattern]</span>
+ </div>
+ </div>
+ </div>
+
+ <div wicket:id="typeParams">
+ <div wicket:id="enumParams">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="enumerationValues"><wicket:message key="enumerationValues"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="enumerationValues">[enumerationValues]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="enumerationKeys"><wicket:message key="enumerationKeys"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="enumerationKeys">[enumerationKeys]</span>
+ </div>
+ </div>
+ </div>
+ <div wicket:id="encryptedParams">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="secretKey"><wicket:message key="secretKey"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="secretKey">[secretKey]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="cipherAlgorithm"><wicket:message key="cipherAlgorithm"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="cipherAlgorithm">[cipherAlgorithm]</span>
+ </div>
+ </div>
+ </div>
+ <div wicket:id="binaryParams">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="mimeType"><wicket:message key="mimeType"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="mimeType">[mimeType]</span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="validatorClass"><wicket:message key="validatorClass"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="validatorClass">[validatorClass]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="mandatoryCondition"><wicket:message key="mandatoryCondition"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <input type="text" class="ui-widget-content ui-corner-all"
+ id="mandatoryCondition" wicket:id="mandatoryCondition"/>
+ <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
+ <img src="img/help.png"/>
+ <span wicket:id="jexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="uniqueConstraint" class="onerowlabel"><wicket:message key="uniqueConstraint"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="uniqueConstraint">[uniqueConstraint]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="multivalue" class="onerowlabel"><wicket:message key="multivalue"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="multivalue">[multivalue]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="readonly" class="onerowlabel"><wicket:message key="readonly"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="readonly">[readonly]</span>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 10px 0px 0;">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.properties
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.properties b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.properties
new file mode 100644
index 0000000..58c5708
--- /dev/null
+++ b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage.properties
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Attributes
+tab2=Derived attributes
+tab3=User attributes
+tab4=User derived attributes
+required_alert=All form fields are required.
+mandatoryCondition=Mandatory
+enumerationValues= Enumeration values
+enumerationKeys= Enumeration labels
+uniqueConstraint=Unique
+multivalue=Multivalue
+multivalueAndUniqueConstr.validation='Multivalue' and 'Unique constraint' options can't be both checked
+type=Type
+validatorClass=Validator class
+conversionPattern=Conversion pattern
+existing_schemas=Existing Schemas:
+action=Action
+edit_attribute=Edit attribute
+title=Schema
+readonly=Read-only
+secretKey=Secret key
+cipherAlgorithm=Cipher algorithm
+mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_it.properties
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_it.properties b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_it.properties
new file mode 100644
index 0000000..74eed7d
--- /dev/null
+++ b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_it.properties
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Attributi
+tab2=Attributi derivati
+tab3=Attributi utenti
+tab4=Attributi utenti derivati
+required_alert=Tutti i campi sono richiesti
+mandatoryCondition=Obbligatorio
+enumerationValues= Valori enumeration
+enumerationKeys= Label enumeration
+multivalue=Multivalore
+type=Tipo
+validatorClass=Validatore
+conversionPattern=Conversion pattern
+existing_schemas=Schema esistenti:
+action=Azione
+edit_attribute=Modifica attributo
+title=Schema
+readonly=Read-only
+uniqueConstraint=Univoco
+multivalueAndUniqueConstr.validation=Le opzioni 'Multivalore' e 'Vincolo unique' non possono essere entrambe impostate
+secretKey=Chiave segreta
+cipherAlgorithm=Algoritmo di cifratura
+mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_pt_BR.properties b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_pt_BR.properties
new file mode 100644
index 0000000..a026c17
--- /dev/null
+++ b/console/src/main/resources/org/apache/syncope/console/pages/PlainSchemaModalPage_pt_BR.properties
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Atributos
+tab2=Atributos derivados
+tab3=Atributos de usu\u00e1rios
+tab4=Atributos derivados de usu\u00e1rios
+required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
+mandatoryCondition=obrigat\u00f3rio
+enumerationValues= Valores enumerados
+enumerationKeys= R\u00f3tulos de enumera\u00e7\u00e3o
+uniqueConstraint=\u00danico
+multivalue=Multivalorado
+multivalueAndUniqueConstr.validation=As op\u00e7\u00f5es 'Multivalorado' e 'Restri\u00e7\u00e3o \u00fanica' n\u00e3o podem serem ambas selecionadas
+type=Tipo
+validatorClass=Classe de Valida\u00e7\u00e3o
+conversionPattern=Padr\u00e3o de Convers\u00e3o
+existing_schemas=Esquemas Existentes\:
+action=A\u00e7\u00e3o
+edit_attribute=Editar Atributo
+title=Esquema
+readonly=Apenas leitura
+secretKey=Chave secreta
+cipherAlgorithm=Algoritmo de criptografia
+mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.html
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.html b/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.html
deleted file mode 100644
index 43b95cb..0000000
--- a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.html
+++ /dev/null
@@ -1,172 +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>
- <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
- <div style="margin: 5px;">
- <form wicket:id="form">
- <div id="formtable">
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="name"><wicket:message key="name"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="name">[name]</span>
- </div>
- </div>
-
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="type"><wicket:message key="type"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="type">[type]</span>
- </div>
- </div>
-
- <div wicket:id="conversionParams">
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="conversionPattern"><wicket:message key="conversionPattern"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="conversionPattern">[conversionPattern]</span>
- </div>
- </div>
- </div>
-
- <div wicket:id="typeParams">
- <div wicket:id="enumParams">
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="enumerationValues"><wicket:message key="enumerationValues"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="enumerationValues">[enumerationValues]</span>
- </div>
- </div>
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="enumerationKeys"><wicket:message key="enumerationKeys"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="enumerationKeys">[enumerationKeys]</span>
- </div>
- </div>
- </div>
- <div wicket:id="encryptedParams">
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="secretKey"><wicket:message key="secretKey"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="secretKey">[secretKey]</span>
- </div>
- </div>
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="cipherAlgorithm"><wicket:message key="cipherAlgorithm"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="cipherAlgorithm">[cipherAlgorithm]</span>
- </div>
- </div>
- </div>
- <div wicket:id="binaryParams">
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="mimeType"><wicket:message key="mimeType"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="mimeType">[mimeType]</span>
- </div>
- </div>
- </div>
- </div>
-
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="validatorClass"><wicket:message key="validatorClass"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="validatorClass">[validatorClass]</span>
- </div>
- </div>
-
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="mandatoryCondition"><wicket:message key="mandatoryCondition"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <input type="text" class="ui-widget-content ui-corner-all"
- id="mandatoryCondition" wicket:id="mandatoryCondition"/>
- <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
- <img src="img/help.png"/>
- <span wicket:id="jexlHelp" class="tooltips">
- <wicket:message key="jexl_info"/>
- <ul>
- <li><wicket:message key="jexl_ex1"/></li>
- <li><wicket:message key="jexl_ex2"/></li>
- </ul>
- <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
- </span>
- </a>
- </div>
- </div>
-
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="uniqueConstraint" class="onerowlabel"><wicket:message key="uniqueConstraint"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="uniqueConstraint">[uniqueConstraint]</span>
- </div>
- </div>
-
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="multivalue" class="onerowlabel"><wicket:message key="multivalue"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="multivalue">[multivalue]</span>
- </div>
- </div>
-
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="readonly" class="onerowlabel"><wicket:message key="readonly"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="readonly">[readonly]</span>
- </div>
- </div>
- </div>
-
- <div style="margin: 10px 0px 0;">
- <input type="submit"
- class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="apply"/>
- <input type="button"
- class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="cancel"/>
- </div>
- </form>
- </div>
- </wicket:extend>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.properties
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.properties b/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.properties
deleted file mode 100644
index 58c5708..0000000
--- a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.properties
+++ /dev/null
@@ -1,38 +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.
-tab1=Attributes
-tab2=Derived attributes
-tab3=User attributes
-tab4=User derived attributes
-required_alert=All form fields are required.
-mandatoryCondition=Mandatory
-enumerationValues= Enumeration values
-enumerationKeys= Enumeration labels
-uniqueConstraint=Unique
-multivalue=Multivalue
-multivalueAndUniqueConstr.validation='Multivalue' and 'Unique constraint' options can't be both checked
-type=Type
-validatorClass=Validator class
-conversionPattern=Conversion pattern
-existing_schemas=Existing Schemas:
-action=Action
-edit_attribute=Edit attribute
-title=Schema
-readonly=Read-only
-secretKey=Secret key
-cipherAlgorithm=Cipher algorithm
-mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_it.properties
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_it.properties b/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_it.properties
deleted file mode 100644
index 74eed7d..0000000
--- a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_it.properties
+++ /dev/null
@@ -1,38 +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.
-tab1=Attributi
-tab2=Attributi derivati
-tab3=Attributi utenti
-tab4=Attributi utenti derivati
-required_alert=Tutti i campi sono richiesti
-mandatoryCondition=Obbligatorio
-enumerationValues= Valori enumeration
-enumerationKeys= Label enumeration
-multivalue=Multivalore
-type=Tipo
-validatorClass=Validatore
-conversionPattern=Conversion pattern
-existing_schemas=Schema esistenti:
-action=Azione
-edit_attribute=Modifica attributo
-title=Schema
-readonly=Read-only
-uniqueConstraint=Univoco
-multivalueAndUniqueConstr.validation=Le opzioni 'Multivalore' e 'Vincolo unique' non possono essere entrambe impostate
-secretKey=Chiave segreta
-cipherAlgorithm=Algoritmo di cifratura
-mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_pt_BR.properties b/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_pt_BR.properties
deleted file mode 100644
index a026c17..0000000
--- a/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage_pt_BR.properties
+++ /dev/null
@@ -1,38 +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.
-tab1=Atributos
-tab2=Atributos derivados
-tab3=Atributos de usu\u00e1rios
-tab4=Atributos derivados de usu\u00e1rios
-required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
-mandatoryCondition=obrigat\u00f3rio
-enumerationValues= Valores enumerados
-enumerationKeys= R\u00f3tulos de enumera\u00e7\u00e3o
-uniqueConstraint=\u00danico
-multivalue=Multivalorado
-multivalueAndUniqueConstr.validation=As op\u00e7\u00f5es 'Multivalorado' e 'Restri\u00e7\u00e3o \u00fanica' n\u00e3o podem serem ambas selecionadas
-type=Tipo
-validatorClass=Classe de Valida\u00e7\u00e3o
-conversionPattern=Padr\u00e3o de Convers\u00e3o
-existing_schemas=Esquemas Existentes\:
-action=A\u00e7\u00e3o
-edit_attribute=Editar Atributo
-title=Esquema
-readonly=Apenas leitura
-secretKey=Chave secreta
-cipherAlgorithm=Algoritmo de criptografia
-mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
index 4b207a7..91a797e 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/AttributableDataProvider.java
@@ -27,15 +27,11 @@ import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class AttributableDataProvider extends SortableDataProvider<AbstractAttributableTO, String> {
private static final long serialVersionUID = 6267494272884913376L;
- private static final Logger LOG = LoggerFactory.getLogger(AttributableDataProvider.class);
-
private final SortableAttributableProviderComparator comparator;
private String fiql = null;
@@ -56,7 +52,7 @@ public class AttributableDataProvider extends SortableDataProvider<AbstractAttri
this.paginatorRows = paginatorRows;
// default sorting
- setSort("id", SortOrder.ASCENDING);
+ setSort("key", SortOrder.ASCENDING);
this.comparator = new SortableAttributableProviderComparator(this);
}
@@ -100,6 +96,6 @@ public class AttributableDataProvider extends SortableDataProvider<AbstractAttri
@Override
public IModel<AbstractAttributableTO> model(final AbstractAttributableTO object) {
- return new CompoundPropertyModel<AbstractAttributableTO>(object);
+ return new CompoundPropertyModel<>(object);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
index 15fcddb..e82b9bb 100644
--- a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
@@ -33,8 +33,8 @@ public class SortableAttributableProviderComparator extends SortableDataProvider
private static final long serialVersionUID = 1775967163571699258L;
- private static final Set<String> INLINE_PROPS = new HashSet<String>(Arrays.asList(
- new String[] { "id", "status", "token", "username" }));
+ private static final Set<String> INLINE_PROPS = new HashSet<>(Arrays.asList(
+ new String[] { "key", "status", "token", "username" }));
public SortableAttributableProviderComparator(final SortableDataProvider<AbstractAttributableTO, String> provider) {
super(provider);
[43/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/CloseOnESCBehavior.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/CloseOnESCBehavior.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/CloseOnESCBehavior.java
new file mode 100644
index 0000000..2e62431
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/CloseOnESCBehavior.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.commons;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+
+public class CloseOnESCBehavior extends AjaxEventBehavior {
+
+ private static final long serialVersionUID = 5826308247642534260L;
+
+ public CloseOnESCBehavior(String event) {
+ super(event);
+ }
+
+ @Override
+ protected void onEvent(final AjaxRequestTarget target) {
+ ModalWindow.closeCurrent(target);
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+
+ attributes.getAjaxCallListeners().add(new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component aComponent) {
+ return " if(Wicket.Event.keyCode(attrs.event) != 27){return false;}";
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ConnIdSpecialAttributeName.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ConnIdSpecialAttributeName.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ConnIdSpecialAttributeName.java
new file mode 100644
index 0000000..3533172
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/ConnIdSpecialAttributeName.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.commons;
+
+public final class ConnIdSpecialAttributeName {
+
+ public static final String ENABLE = "__ENABLE__";
+
+ public static final String NAME = "__NAME__";
+
+ public static final String UID = "__UID__";
+
+ public static final String PASSWORD = "__PASSWORD__";
+
+ private ConnIdSpecialAttributeName() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
new file mode 100644
index 0000000..8f06874
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
@@ -0,0 +1,110 @@
+/*
+ * 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.commons;
+
+public final class Constants {
+
+ public static final String ON_CLICK = "onclick";
+
+ public static final String ON_CHANGE = "onchange";
+
+ public static final String ON_BLUR = "onblur";
+
+ public static final String PNG_EXT = ".png";
+
+ public static final String FEEDBACK = "feedback";
+
+ public static final String OPERATION_SUCCEEDED = "operation_succeeded";
+
+ public static final String OPERATION_ERROR = "operation_error";
+
+ public static final String SEARCH_ERROR = "search_error";
+
+ public static final String ERROR = "error";
+
+ public static final String PARAM_PASSWORD_RESET_TOKEN = "pwdResetToken";
+
+ public static final String PREF_USERS_DETAILS_VIEW = "users.details.view";
+
+ public static final String PREF_USERS_ATTRIBUTES_VIEW = "users.attributes.view";
+
+ public static final String PREF_USERS_DERIVED_ATTRIBUTES_VIEW = "users.derived.attributes.view";
+
+ public static final String PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW = "users.virtual.attributes.view";
+
+ public static final String PREF_CONF_SCHEMA_PAGINATOR_ROWS = "conf.schema.paginator.rows";
+
+ public static final String PREF_USER_SCHEMA_PAGINATOR_ROWS = "user.schema.paginator.rows";
+
+ public static final String PREF_USER_DER_SCHEMA_PAGINATOR_ROWS = "user.derived.schema.paginator.rows";
+
+ public static final String PREF_USER_VIR_SCHEMA_PAGINATOR_ROWS = "user.virtual.schema.paginator.rows";
+
+ public static final String PREF_ROLE_SCHEMA_PAGINATOR_ROWS = "role.schema.paginator.rows";
+
+ public static final String PREF_ROLE_DER_SCHEMA_PAGINATOR_ROWS = "role.derived.schema.paginator.rows";
+
+ public static final String PREF_ROLE_VIR_SCHEMA_PAGINATOR_ROWS = "role.virtual.schema.paginator.rows";
+
+ public static final String PREF_MEMBERSHIP_SCHEMA_PAGINATOR_ROWS = "membership.schema.paginator.rows";
+
+ public static final String PREF_MEMBERSHIP_DER_SCHEMA_PAGINATOR_ROWS = "membership.derived.aschema.paginator.rows";
+
+ public static final String PREF_MEMBERSHIP_VIR_SCHEMA_PAGINATOR_ROWS = "membership.virtual.aschema.paginator.rows";
+
+ public static final String PREF_USERS_PAGINATOR_ROWS = "users.paginator.rows";
+
+ public static final String PREF_RESOURCES_PAGINATOR_ROWS = "resources.paginator.rows";
+
+ public static final String PREF_CONNECTORS_PAGINATOR_ROWS = "connectors.paginator.rows";
+
+ public static final String PREF_NOTIFICATION_PAGINATOR_ROWS = "notification.paginator.rows";
+
+ public static final String PREF_PROPAGATION_TASKS_PAGINATOR_ROWS = "proagationtasks.paginator.rows";
+
+ public static final String PREF_NOTIFICATION_TASKS_PAGINATOR_ROWS = "notificationtasks.paginator.rows";
+
+ public static final String PREF_SCHED_TASKS_PAGINATOR_ROWS = "schedtasks.paginator.rows";
+
+ public static final String PREF_SYNC_TASKS_PAGINATOR_ROWS = "synctasks.paginator.rows";
+
+ public static final String PREF_TODO_PAGINATOR_ROWS = "todo.paginator.rows";
+
+ public static final String PREF_REPORT_PAGINATOR_ROWS = "report.paginator.rows";
+
+ public static final String PAGEPARAM_CREATE = "CREATE";
+
+ public static final String PAGEPARAM_CURRENT_PAGE = "_current_page";
+
+ public static final String PREF_POLICY_PAGINATOR_ROWS = "policy.paginator.rows";
+
+ /**
+ * ConnId's GuardedString is not in the classpath.
+ */
+ public static final String GUARDED_STRING = "org.identityconnectors.common.security.GuardedString";
+
+ /**
+ * ConnId's GuardedByteArray is not in the classpath.
+ */
+ public static final String GUARDED_BYTE_ARRAY = "org.identityconnectors.common.security.GuardedByteArray";
+
+ private Constants() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/DateFormatROModel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/DateFormatROModel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/DateFormatROModel.java
new file mode 100644
index 0000000..e72b7d0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/DateFormatROModel.java
@@ -0,0 +1,50 @@
+/*
+ * 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.commons;
+
+import java.util.Date;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+
+public class DateFormatROModel implements IModel<String> {
+
+ private static final long serialVersionUID = 6677274580927636121L;
+
+ private final PropertyModel model;
+
+ public DateFormatROModel(final PropertyModel model) {
+ this.model = model;
+ }
+
+ @Override
+ public String getObject() {
+ return model.getObject() == null
+ ? ""
+ : SyncopeSession.get().getDateFormat().format((Date) model.getObject());
+ }
+
+ @Override
+ public void setObject(final String object) {
+ }
+
+ @Override
+ public void detach() {
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/HttpResourceStream.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/HttpResourceStream.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/HttpResourceStream.java
new file mode 100644
index 0000000..feeba85
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/HttpResourceStream.java
@@ -0,0 +1,101 @@
+/*
+ * 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.commons;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.wicket.util.lang.Bytes;
+import org.apache.wicket.util.resource.AbstractResourceStream;
+import org.apache.wicket.util.resource.IFixedLocationResourceStream;
+import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
+
+public class HttpResourceStream extends AbstractResourceStream implements IFixedLocationResourceStream {
+
+ private static final long serialVersionUID = 5811207817876330189L;
+
+ private transient InputStream inputStream;
+
+ private String contentType;
+
+ private String location;
+
+ private String filename;
+
+ public HttpResourceStream(final Response response) {
+ super();
+
+ Object entity = response.getEntity();
+ if (response.getStatusInfo().getStatusCode() == Response.Status.OK.getStatusCode()
+ && (entity instanceof InputStream)) {
+
+ this.inputStream = (InputStream) entity;
+ this.contentType = response.getHeaderString(HttpHeaders.CONTENT_TYPE);
+ this.location = response.getLocation() == null ? null : response.getLocation().toASCIIString();
+ String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
+ if (StringUtils.isNotBlank(contentDisposition)) {
+ String[] splitted = contentDisposition.split("=");
+ if (splitted != null && splitted.length > 1) {
+ this.filename = splitted[1].trim();
+ }
+ }
+ }
+ }
+
+ @Override
+ public InputStream getInputStream()
+ throws ResourceStreamNotFoundException {
+
+ return inputStream == null
+ ? new ByteArrayInputStream(new byte[0])
+ : inputStream;
+ }
+
+ @Override
+ public Bytes length() {
+ return inputStream == null
+ ? Bytes.bytes(0)
+ : null;
+ }
+
+ @Override
+ public void close() throws IOException {
+ // No need for explict closing
+ }
+
+ @Override
+ public String locationAsString() {
+ return location;
+ }
+
+ @Override
+ public String getContentType() {
+ return contentType == null
+ ? MediaType.APPLICATION_OCTET_STREAM
+ : contentType;
+ }
+
+ public String getFilename() {
+ return filename;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/JexlHelpUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/JexlHelpUtil.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/JexlHelpUtil.java
new file mode 100644
index 0000000..5cfd3ce
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/JexlHelpUtil.java
@@ -0,0 +1,61 @@
+/*
+ * 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.commons;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.link.ExternalLink;
+
+public final class JexlHelpUtil {
+
+ private static final String JEXL_SYNTAX_URL = "http://commons.apache.org/jexl/reference/syntax.html";
+
+ private JexlHelpUtil() {
+ // private constructor for static utility class
+ }
+
+ public static WebMarkupContainer getJexlHelpWebContainer(final String wicketId) {
+ final WebMarkupContainer jexlHelp = new WebMarkupContainer(wicketId);
+ jexlHelp.setVisible(false);
+ jexlHelp.setOutputMarkupPlaceholderTag(true);
+ jexlHelp.setOutputMarkupId(true);
+ jexlHelp.add(new ExternalLink("jexlLink", JEXL_SYNTAX_URL));
+ return jexlHelp;
+ }
+
+ public static AjaxLink<Void> getAjaxLink(final WebMarkupContainer wmc, final String wicketId) {
+ AjaxLink<Void> questionMarkJexlHelp = new AjaxLink<Void>(wicketId) {
+
+ private static final long serialVersionUID = -1838017408000591382L;
+
+ private boolean toogle = false;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ // using bitwise inversion as suggested by
+ // http://pmd.sourceforge.net/pmd-4.2.5/rules/controversial.html#BooleanInversion
+ toogle ^= true;
+ wmc.setVisible(toogle);
+ target.add(wmc);
+ }
+ };
+ return questionMarkJexlHelp;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/MapChoiceRenderer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/MapChoiceRenderer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/MapChoiceRenderer.java
new file mode 100644
index 0000000..118db6d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/MapChoiceRenderer.java
@@ -0,0 +1,43 @@
+/*
+ * 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.commons;
+
+import java.util.Map;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+
+public class MapChoiceRenderer<T, K> implements IChoiceRenderer<T> {
+
+ private static final long serialVersionUID = -7452881117778186644L;
+
+ private final Map<T, K> map;
+
+ public MapChoiceRenderer(final Map<T, K> map) {
+ this.map = map;
+ }
+
+ @Override
+ public Object getDisplayValue(final T key) {
+ return map.get(key);
+ }
+
+ @Override
+ public String getIdValue(final T key, final int index) {
+ return key.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Mode.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Mode.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Mode.java
new file mode 100644
index 0000000..27dad64
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/Mode.java
@@ -0,0 +1,27 @@
+/*
+ * 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.commons;
+
+public enum Mode {
+
+ ADMIN,
+ SELF,
+ TEMPLATE;
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/PreferenceManager.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/PreferenceManager.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/PreferenceManager.java
new file mode 100644
index 0000000..c9b27fc
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/PreferenceManager.java
@@ -0,0 +1,177 @@
+/*
+ * 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.commons;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.core.type.TypeReference;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.util.cookies.CookieDefaults;
+import org.apache.wicket.util.cookies.CookieUtils;
+import org.apache.wicket.util.crypt.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+public class PreferenceManager {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(PreferenceManager.class);
+
+ private static final String PREFMAN_KEY = "prefMan";
+
+ private static final int ONE_YEAR_TIME = 60 * 60 * 24 * 365;
+
+ private static final TypeReference<Map<String, String>> MAP_TYPE_REF = new TypeReference<Map<String, String>>() {
+ };
+
+ private static final List<Integer> PAGINATOR_CHOICES = Arrays.asList(new Integer[] { 10, 25, 50 });
+
+ private final ObjectMapper mapper;
+
+ private final CookieUtils cookieUtils;
+
+ public PreferenceManager() {
+ this.mapper = new ObjectMapper();
+
+ CookieDefaults cookieDefaults = new CookieDefaults();
+ cookieDefaults.setMaxAge(ONE_YEAR_TIME);
+ this.cookieUtils = new CookieUtils(cookieDefaults);
+ }
+
+ public List<Integer> getPaginatorChoices() {
+ return PAGINATOR_CHOICES;
+ }
+
+ private Map<String, String> getPrefs(final String value) {
+ Map<String, String> prefs;
+ try {
+ if (StringUtils.hasText(value)) {
+ prefs = mapper.readValue(value, MAP_TYPE_REF);
+ } else {
+ throw new Exception("Invalid cookie value '" + value + "'");
+ }
+ } catch (Exception e) {
+ LOG.debug("No preferences found", e);
+ prefs = new HashMap<String, String>();
+ }
+
+ return prefs;
+ }
+
+ private String setPrefs(final Map<String, String> prefs) throws IOException {
+ StringWriter writer = new StringWriter();
+ mapper.writeValue(writer, prefs);
+
+ return writer.toString();
+ }
+
+ public String get(final Request request, final String key) {
+ String result = null;
+
+ String prefString = cookieUtils.load(PREFMAN_KEY);
+ if (prefString != null) {
+ final Map<String, String> prefs = getPrefs(new String(Base64.decodeBase64(prefString.getBytes())));
+ result = prefs.get(key);
+ }
+
+ return result;
+ }
+
+ public Integer getPaginatorRows(final Request request, final String key) {
+ Integer result = getPaginatorChoices().get(0);
+
+ String value = get(request, key);
+ if (value != null) {
+ result = NumberUtils.toInt(value, 10);
+ }
+
+ return result;
+ }
+
+ public List<String> getList(final Request request, final String key) {
+ final List<String> result = new ArrayList<String>();
+
+ final String compound = get(request, key);
+
+ if (StringUtils.hasText(compound)) {
+ String[] items = compound.split(";");
+ result.addAll(Arrays.asList(items));
+ }
+
+ return result;
+ }
+
+ public void set(final Request request, final Response response, final Map<String, List<String>> prefs) {
+ String prefString = cookieUtils.load(PREFMAN_KEY);
+
+ final Map<String, String> current = new HashMap<String, String>();
+ if (prefString != null) {
+ current.putAll(getPrefs(new String(Base64.decodeBase64(prefString.getBytes()))));
+ }
+
+ // after retrieved previous setting in order to overwrite the key ...
+ for (Entry<String, List<String>> entry : prefs.entrySet()) {
+ current.put(entry.getKey(), StringUtils.collectionToDelimitedString(entry.getValue(), ";"));
+ }
+
+ try {
+ cookieUtils.save(PREFMAN_KEY, new String(Base64.encodeBase64(setPrefs(current).getBytes())));
+ } catch (IOException e) {
+ LOG.error("Could not save {} info: {}", getClass().getSimpleName(), current, e);
+ }
+ }
+
+ public void set(final Request request, final Response response, final String key, final String value) {
+ String prefString = cookieUtils.load(PREFMAN_KEY);
+
+ final Map<String, String> current = new HashMap<String, String>();
+ if (prefString != null) {
+ current.putAll(getPrefs(new String(Base64.decodeBase64(prefString.getBytes()))));
+ }
+
+ // after retrieved previous setting in order to overwrite the key ...
+ current.put(key, value);
+
+ try {
+ cookieUtils.save(PREFMAN_KEY, new String(Base64.encodeBase64(setPrefs(current).getBytes())));
+ } catch (IOException e) {
+ LOG.error("Could not save {} info: {}", getClass().getSimpleName(), current, e);
+ }
+ }
+
+ public void setList(final Request request, final Response response, final String key, final List<String> values) {
+ set(request, response, key, StringUtils.collectionToDelimitedString(values, ";"));
+ }
+
+ public void setList(final Request request, final Response response, final Map<String, List<String>> prefs) {
+ set(request, response, prefs);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleTreeBuilder.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleTreeBuilder.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleTreeBuilder.java
new file mode 100644
index 0000000..c6ab6e4
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleTreeBuilder.java
@@ -0,0 +1,116 @@
+/*
+ * 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.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeModel;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class RoleTreeBuilder {
+
+ @Autowired
+ private RoleRestClient restClient;
+
+ private final RoleTOComparator comparator = new RoleTOComparator();
+
+ private List<RoleTO> allRoles;
+
+ private List<RoleTO> getChildRoles(final long parentRoleId, final List<RoleTO> roles) {
+ List<RoleTO> result = new ArrayList<RoleTO>();
+ for (RoleTO role : roles) {
+ if (role.getParent() == parentRoleId) {
+ result.add(role);
+ }
+ }
+
+ Collections.sort(result, comparator);
+ return result;
+ }
+
+ private void populateSubtree(final DefaultMutableTreeNode subRoot, final List<RoleTO> roles) {
+ RoleTO role = (RoleTO) subRoot.getUserObject();
+
+ DefaultMutableTreeNode child;
+ for (RoleTO subRoleTO : getChildRoles(role.getKey(), roles)) {
+ child = new DefaultMutableTreeNode(subRoleTO);
+ subRoot.add(child);
+ populateSubtree(child, roles);
+ }
+ }
+
+ public List<RoleTO> getAllRoles() {
+ return this.allRoles;
+ }
+
+ public TreeModel build() {
+ this.allRoles = this.restClient.list();
+ return build(this.allRoles);
+ }
+
+ public TreeModel build(final List<RoleTO> roles) {
+ DefaultMutableTreeNode fakeroot = new DefaultMutableTreeNode(new FakeRootRoleTO());
+
+ populateSubtree(fakeroot, roles);
+
+ return new DefaultTreeModel(fakeroot);
+ }
+
+ private static class RoleTOComparator implements Comparator<RoleTO>, Serializable {
+
+ private static final long serialVersionUID = 7085057398406518811L;
+
+ @Override
+ public int compare(final RoleTO r1, final RoleTO r2) {
+ if (r1.getKey() < r2.getKey()) {
+ return -1;
+ }
+ if (r1.getKey() == r2.getKey()) {
+ return 0;
+ }
+
+ return 1;
+ }
+ }
+
+ private static class FakeRootRoleTO extends RoleTO {
+
+ private static final long serialVersionUID = 4839183625773925488L;
+
+ public FakeRootRoleTO() {
+ super();
+
+ setKey(0);
+ setName("");
+ setParent(-1);
+ }
+
+ @Override
+ public String getDisplayName() {
+ return "";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleUtils.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleUtils.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleUtils.java
new file mode 100644
index 0000000..27e062b
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/RoleUtils.java
@@ -0,0 +1,36 @@
+/*
+ * 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.commons;
+
+import org.apache.syncope.common.lib.to.RoleTO;
+
+public class RoleUtils {
+
+ public static RoleTO findRole(final RoleTreeBuilder roleTreeBuilder, final long roleKey) {
+ RoleTO found = null;
+ if (roleTreeBuilder.getAllRoles() != null) {
+ for (RoleTO roleTO : roleTreeBuilder.getAllRoles()) {
+ if (roleTO.getKey()== roleKey) {
+ found = roleTO;
+ }
+ }
+ }
+ return found;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SchemaModalPageFactory.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SchemaModalPageFactory.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SchemaModalPageFactory.java
new file mode 100644
index 0000000..38a60fa
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SchemaModalPageFactory.java
@@ -0,0 +1,58 @@
+/*
+ * 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.commons;
+
+import org.apache.syncope.client.console.pages.AbstractSchemaModalPage;
+import org.apache.syncope.client.console.pages.DerSchemaModalPage;
+import org.apache.syncope.client.console.pages.PlainSchemaModalPage;
+import org.apache.syncope.client.console.pages.VirSchemaModalPage;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+
+public final class SchemaModalPageFactory {
+
+ private static final long serialVersionUID = -3533177688264693505L;
+
+ private SchemaModalPageFactory() {
+ // empty constructor for static utility class
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T extends AbstractSchemaModalPage> T getSchemaModalPage(
+ final AttributableType entity, final SchemaType schemaType) {
+
+ T page;
+
+ switch (schemaType) {
+ case DERIVED:
+ page = (T) new DerSchemaModalPage(entity);
+ break;
+
+ case VIRTUAL:
+ page = (T) new VirSchemaModalPage(entity);
+ break;
+
+ default:
+ page = (T) new PlainSchemaModalPage(entity);
+ break;
+ }
+
+ return page;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectChoiceRenderer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectChoiceRenderer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectChoiceRenderer.java
new file mode 100644
index 0000000..7b9164d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectChoiceRenderer.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons;
+
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+
+public class SelectChoiceRenderer<T> implements IChoiceRenderer<T> {
+
+ private static final long serialVersionUID = -3242441544405909243L;
+
+ @Override
+ public Object getDisplayValue(T obj) {
+ if (obj instanceof SelectOption) {
+ return ((SelectOption) obj).getDisplayValue();
+ } else {
+ return obj.toString();
+ }
+ }
+
+ @Override
+ public String getIdValue(T obj, int i) {
+ return obj.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectOption.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectOption.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectOption.java
new file mode 100644
index 0000000..839df70
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SelectOption.java
@@ -0,0 +1,72 @@
+/*
+ * 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.commons;
+
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+public class SelectOption implements Serializable {
+
+ private static final long serialVersionUID = 2961127533930849828L;
+
+ private String displayValue;
+
+ private String keyValue;
+
+ public SelectOption(final String displayValue, final String keyValue) {
+ this.displayValue = displayValue;
+ this.keyValue = keyValue;
+ }
+
+ public String getDisplayValue() {
+ return displayValue;
+ }
+
+ public void setDisplayValue(final String displayValue) {
+ this.displayValue = displayValue;
+ }
+
+ public String getKeyValue() {
+ return keyValue;
+ }
+
+ public void setKeyValue(final String keyValue) {
+ this.keyValue = keyValue;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (obj == null || !(obj instanceof SelectOption)) {
+ return false;
+ }
+
+ return (keyValue == null && ((SelectOption) obj).keyValue == null) || keyValue != null
+ && keyValue.equals(((SelectOption) obj).keyValue);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+ @Override
+ public String toString() {
+ return keyValue;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
new file mode 100644
index 0000000..15fcddb
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAttributableProviderComparator.java
@@ -0,0 +1,122 @@
+/*
+ * 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.commons;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+
+public class SortableAttributableProviderComparator extends SortableDataProviderComparator<AbstractAttributableTO> {
+
+ private static final long serialVersionUID = 1775967163571699258L;
+
+ private static final Set<String> INLINE_PROPS = new HashSet<String>(Arrays.asList(
+ new String[] { "id", "status", "token", "username" }));
+
+ public SortableAttributableProviderComparator(final SortableDataProvider<AbstractAttributableTO, String> provider) {
+ super(provider);
+ }
+
+ @Override
+ public int compare(final AbstractAttributableTO attributable1, AbstractAttributableTO attributable2) {
+ if (INLINE_PROPS.contains(provider.getSort().getProperty())) {
+ return super.compare(attributable1, attributable2);
+ }
+
+ return super.compare(new AttrModel(attributable1), new AttrModel(attributable2));
+ }
+
+ @SuppressWarnings("rawtypes")
+ private class AttrModel extends AbstractReadOnlyModel<Comparable> {
+
+ private static final long serialVersionUID = -7856686374020091808L;
+
+ private final Map<String, AttrTO> attrs;
+
+ private final Map<String, AttrTO> derAttrs;
+
+ private final Map<String, AttrTO> virAttrs;
+
+ public AttrModel(final AbstractAttributableTO attributableTO) {
+ super();
+
+ this.attrs = attributableTO.getPlainAttrMap();
+ this.derAttrs = attributableTO.getDerAttrMap();
+ this.virAttrs = attributableTO.getVirAttrMap();
+ }
+
+ /**
+ * @see UserAttrColumn constructor
+ */
+ @Override
+ public Comparable getObject() {
+ int hashPos = provider.getSort().getProperty().indexOf('#');
+
+ SchemaType schemaType = null;
+ final String schema;
+ if (hashPos == -1) {
+ schema = provider.getSort().getProperty();
+ } else {
+ String[] splitted = provider.getSort().getProperty().split("#");
+ try {
+ schemaType = SchemaType.valueOf(splitted[0]);
+ } catch (IllegalArgumentException e) {
+ // this should never happen
+ }
+ schema = provider.getSort().getProperty().substring(hashPos + 1);
+ }
+
+ final AttrTO attr;
+ if (schemaType == null) {
+ attr = this.attrs.get(schema);
+ } else {
+ switch (schemaType) {
+ case PLAIN:
+ default:
+ attr = this.attrs.get(schema);
+ break;
+
+ case DERIVED:
+ attr = this.derAttrs.get(schema);
+ break;
+
+ case VIRTUAL:
+ attr = this.virAttrs.get(schema);
+ break;
+ }
+ }
+
+ Comparable result = null;
+
+ List<String> values = attr == null ? null : attr.getValues();
+ if (values != null && !values.isEmpty()) {
+ result = values.iterator().next();
+ }
+
+ return result;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
new file mode 100644
index 0000000..5600152
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/SortableDataProviderComparator.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.commons;
+
+import java.io.Serializable;
+import java.util.Comparator;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+
+public class SortableDataProviderComparator<T extends Object> implements Comparator<T>, Serializable {
+
+ private static final long serialVersionUID = -8897687699977460543L;
+
+ protected final SortableDataProvider<T, String> provider;
+
+ public SortableDataProviderComparator(final SortableDataProvider<T, String> provider) {
+ this.provider = provider;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected int compare(final IModel<Comparable> model1, final IModel<Comparable> model2) {
+ int result;
+
+ if (model1.getObject() == null && model2.getObject() == null) {
+ result = 0;
+ } else if (model1.getObject() == null) {
+ result = 1;
+ } else if (model2.getObject() == null) {
+ result = -1;
+ } else {
+ result = model1.getObject().compareTo(model2.getObject());
+ }
+
+ result = provider.getSort().isAscending()
+ ? result
+ : -result;
+
+ return result;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public int compare(final T object1, final T object2) {
+ IModel<Comparable> model1 = new PropertyModel<Comparable>(object1, provider.getSort().getProperty());
+ IModel<Comparable> model2 = new PropertyModel<Comparable>(object2, provider.getSort().getProperty());
+
+ return compare(model1, model2);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/XMLRolesReader.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/XMLRolesReader.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/XMLRolesReader.java
new file mode 100644
index 0000000..3a0b446
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/XMLRolesReader.java
@@ -0,0 +1,118 @@
+/*
+ * 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.commons;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * XMLRolesReader singleton class.
+ */
+public class XMLRolesReader {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(XMLRolesReader.class);
+
+ private String authorizations;
+
+ private Map<Pair<String, String>, String> authMap;
+
+ public void setAuthorizations(final String authorizations) {
+ this.authorizations = authorizations;
+ }
+
+ private void init() {
+ authMap = new HashMap<Pair<String, String>, String>();
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ try {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document doc = db.parse(getClass().getResource("/" + authorizations).openStream());
+ doc.getDocumentElement().normalize();
+
+ Node authNode = null;
+ NodeList root = doc.getChildNodes();
+ for (int i = 0; i < root.getLength() && authNode == null; i++) {
+ if ("auth".equals(root.item(i).getNodeName())) {
+ authNode = root.item(i);
+ }
+ }
+ if (authNode == null) {
+ throw new IllegalArgumentException("Could not find root <auth> node");
+ }
+
+ NodeList pages = authNode.getChildNodes();
+ for (int i = 0; i < pages.getLength(); i++) {
+ if ("page".equals(pages.item(i).getNodeName())) {
+ String page = pages.item(i).getAttributes().getNamedItem("id").getTextContent();
+
+ NodeList actions = pages.item(i).getChildNodes();
+ for (int j = 0; j < actions.getLength(); j++) {
+ if ("action".equals(actions.item(j).getNodeName())) {
+ String action = actions.item(j).getAttributes().getNamedItem("id").getTextContent();
+
+ NodeList entitlements = actions.item(j).getChildNodes();
+ for (int k = 0; k < entitlements.getLength(); k++) {
+ if ("entitlement".equals(entitlements.item(k).getNodeName())) {
+ String entitlement = entitlements.item(k).getTextContent();
+ authMap.put(new ImmutablePair<String, String>(page, action), entitlement);
+ }
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ LOG.error("While initializing parsing of {}", authorizations, e);
+ }
+ }
+
+ /**
+ * Get entitlement required for page / action.
+ *
+ * @param pageId page
+ * @param actionId action
+ * @return entitlement required
+ */
+ public String getEntitlement(final String pageId, final String actionId) {
+ synchronized (this) {
+ if (authMap == null) {
+ init();
+ }
+ }
+
+ Pair<String, String> key = new ImmutablePair<String, String>(pageId, actionId);
+ return authMap.containsKey(key)
+ ? authMap.get(key)
+ : StringUtils.EMPTY;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/AbstractStatusBeanProvider.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/AbstractStatusBeanProvider.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/AbstractStatusBeanProvider.java
new file mode 100644
index 0000000..c10f55c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/AbstractStatusBeanProvider.java
@@ -0,0 +1,69 @@
+/*
+ * 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.commons.status;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+
+public abstract class AbstractStatusBeanProvider extends SortableDataProvider<StatusBean, String> {
+
+ private static final long serialVersionUID = 4287357360778016173L;
+
+ private SortableDataProviderComparator<StatusBean> comparator;
+
+ public AbstractStatusBeanProvider(final String sort) {
+ //Default sorting
+ setSort(sort, SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<StatusBean>(this);
+ }
+
+ @Override
+ public Iterator<StatusBean> iterator(final long first, final long count) {
+ List<StatusBean> list = getStatusBeans();
+ Collections.sort(list, comparator);
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return getStatusBeans().size();
+ }
+
+ @Override
+ public IModel<StatusBean> model(final StatusBean resource) {
+ return new AbstractReadOnlyModel<StatusBean>() {
+
+ private static final long serialVersionUID = -7802635613997243712L;
+
+ @Override
+ public StatusBean getObject() {
+ return resource;
+ }
+ };
+ }
+
+ public abstract List<StatusBean> getStatusBeans();
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/ConnObjectWrapper.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/ConnObjectWrapper.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/ConnObjectWrapper.java
new file mode 100644
index 0000000..be038db
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/ConnObjectWrapper.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.commons.status;
+
+import java.io.Serializable;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+
+public class ConnObjectWrapper implements Serializable {
+
+ private static final long serialVersionUID = 9083721948999924299L;
+
+ private final AbstractAttributableTO attributable;
+
+ private final String resourceName;
+
+ private final ConnObjectTO connObjectTO;
+
+ public ConnObjectWrapper(final AbstractAttributableTO attributable, final String resourceName,
+ final ConnObjectTO connObjectTO) {
+
+ this.attributable = attributable;
+ this.resourceName = resourceName;
+ this.connObjectTO = connObjectTO;
+ }
+
+ public AbstractAttributableTO getAttributable() {
+ return attributable;
+ }
+
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ public ConnObjectTO getConnObjectTO() {
+ return connObjectTO;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/Status.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/Status.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/Status.java
new file mode 100644
index 0000000..7198c2c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/Status.java
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.status;
+
+public enum Status {
+
+ NOT_YET_SUBMITTED(""),
+ CREATED("created"),
+ ACTIVE("active"),
+ SUSPENDED("inactive"),
+ UNDEFINED("undefined"),
+ OBJECT_NOT_FOUND("objectnotfound");
+
+ public boolean isActive() {
+ return this == ACTIVE;
+ }
+
+ private Status(final String name) {
+ this.name = name;
+ }
+
+ private final String name;
+
+ @Override
+ public String toString() {
+ return name;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
new file mode 100644
index 0000000..96ddd14
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
@@ -0,0 +1,103 @@
+/*
+ * 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.commons.status;
+
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+
+public class StatusBean implements Serializable {
+
+ private static final long serialVersionUID = -5207260204921071129L;
+
+ private final Long attributableKey;
+
+ private final String attributableName;
+
+ private final String resourceName;
+
+ private String accountLink = null;
+
+ private Status status = Status.OBJECT_NOT_FOUND;
+
+ private boolean linked = true;
+
+ public StatusBean(final AbstractAttributableTO attributable, String resourceName) {
+ this.attributableKey = attributable.getKey();
+ this.attributableName = attributable instanceof UserTO
+ ? ((UserTO) attributable).getUsername() : ((RoleTO) attributable).getName();
+ this.resourceName = resourceName;
+ }
+
+ public String getAccountLink() {
+ return accountLink;
+ }
+
+ public void setAccountLink(final String accountLink) {
+ this.accountLink = accountLink;
+ }
+
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(final Status status) {
+ this.status = status;
+ }
+
+ public Long getAttributableId() {
+ return attributableKey;
+ }
+
+ public String getAttributableName() {
+ return attributableName;
+ }
+
+ public boolean isLinked() {
+ return linked;
+ }
+
+ public void setLinked(boolean linked) {
+ this.linked = linked;
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
new file mode 100644
index 0000000..8d59e25
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
@@ -0,0 +1,322 @@
+/*
+ * 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.commons.status;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.client.console.commons.ConnIdSpecialAttributeName;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.ImagePanel;
+import org.apache.syncope.client.console.panels.StatusPanel;
+import org.apache.syncope.client.console.rest.AbstractSubjectRestClient;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.image.Image;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StatusUtils implements Serializable {
+
+ private static final long serialVersionUID = 7238009174387184309L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(StatusUtils.class);
+
+ public static final String IMG_STATUES = "../statuses/";
+
+ private final AbstractSubjectRestClient restClient;
+
+ public StatusUtils(final AbstractSubjectRestClient restClient) {
+ this.restClient = restClient;
+ }
+
+ public List<ConnObjectWrapper> getConnectorObjects(final AbstractSubjectTO subject) {
+ final List<ConnObjectWrapper> objects = new ArrayList<>();
+ objects.addAll(getConnectorObjects(subject, subject.getResources()));
+ return objects;
+ }
+
+ public List<ConnObjectWrapper> getConnectorObjects(
+ final Collection<AbstractSubjectTO> subjects, final Collection<String> resources) {
+
+ final List<ConnObjectWrapper> objects = new ArrayList<>();
+
+ for (AbstractSubjectTO subject : subjects) {
+ objects.addAll(getConnectorObjects(subject, resources));
+ }
+
+ return objects;
+ }
+
+ private List<ConnObjectWrapper> getConnectorObjects(
+ final AbstractSubjectTO subject, final Collection<String> resources) {
+
+ final List<ConnObjectWrapper> objects = new ArrayList<>();
+
+ for (String resourceName : resources) {
+ ConnObjectTO objectTO = null;
+ try {
+ objectTO = restClient.getConnectorObject(resourceName, subject.getKey());
+ } catch (Exception e) {
+ LOG.warn("ConnObject '{}' not found on resource '{}'", subject.getKey(), resourceName);
+ }
+
+ objects.add(new ConnObjectWrapper(subject, resourceName, objectTO));
+ }
+
+ return objects;
+ }
+
+ public StatusBean getStatusBean(
+ final AbstractAttributableTO attributable,
+ final String resourceName,
+ final ConnObjectTO objectTO,
+ final boolean isRole) {
+
+ final StatusBean statusBean = new StatusBean(attributable, resourceName);
+
+ if (objectTO != null) {
+ final Boolean enabled = isEnabled(objectTO);
+
+ final Status status = enabled == null
+ ? (isRole ? Status.ACTIVE : Status.UNDEFINED)
+ : enabled
+ ? Status.ACTIVE
+ : Status.SUSPENDED;
+
+ final String accountLink = getAccountLink(objectTO);
+
+ statusBean.setStatus(status);
+ statusBean.setAccountLink(accountLink);
+ }
+
+ return statusBean;
+ }
+
+ private Boolean isEnabled(final ConnObjectTO objectTO) {
+ final Map<String, AttrTO> attributeTOs = objectTO.getPlainAttrMap();
+
+ final AttrTO status = attributeTOs.get(ConnIdSpecialAttributeName.ENABLE);
+
+ return status != null && status.getValues() != null && !status.getValues().isEmpty()
+ ? Boolean.parseBoolean(status.getValues().get(0))
+ : null;
+ }
+
+ private String getAccountLink(final ConnObjectTO objectTO) {
+ final Map<String, AttrTO> attributeTOs = objectTO == null
+ ? Collections.<String, AttrTO>emptyMap()
+ : objectTO.getPlainAttrMap();
+
+ final AttrTO name = attributeTOs.get(ConnIdSpecialAttributeName.NAME);
+
+ return name != null && name.getValues() != null && !name.getValues().isEmpty()
+ ? name.getValues().get(0)
+ : null;
+ }
+
+ public static StatusMod buildStatusMod(final Collection<StatusBean> statuses) {
+ return buildStatusMod(statuses, null);
+ }
+
+ public static StatusMod buildStatusMod(final Collection<StatusBean> statuses, final Boolean enable) {
+ StatusMod statusMod = new StatusMod();
+ statusMod.setOnSyncope(false);
+
+ for (StatusBean status : statuses) {
+ if (enable == null
+ || (enable && !status.getStatus().isActive()) || (!enable && status.getStatus().isActive())) {
+
+ if ("syncope".equalsIgnoreCase(status.getResourceName())) {
+ statusMod.setOnSyncope(true);
+ } else {
+ statusMod.getResourceNames().add(status.getResourceName());
+ }
+
+ }
+ }
+
+ return statusMod;
+ }
+
+ public static void update(
+ final AbstractAttributableTO attributable,
+ final StatusPanel statusPanel,
+ final AjaxRequestTarget target,
+ final Collection<String> resourcesToAdd,
+ final Collection<String> resourcesToRemove) {
+
+ if (statusPanel != null) {
+ Map<String, StatusBean> statusMap = new LinkedHashMap<String, StatusBean>();
+ for (StatusBean statusBean : statusPanel.getStatusBeans()) {
+ statusMap.put(statusBean.getResourceName(), statusBean);
+ }
+
+ for (String resourceName : resourcesToAdd) {
+ if (!statusMap.keySet().contains(resourceName)) {
+ StatusBean statusBean;
+ if (statusPanel.getInitialStatusBeanMap().containsKey(resourceName)) {
+ statusBean = statusPanel.getInitialStatusBeanMap().get(resourceName);
+ } else {
+ statusBean = new StatusBean(attributable, resourceName);
+ statusBean.setStatus(Status.NOT_YET_SUBMITTED);
+ }
+
+ statusMap.put(statusBean.getResourceName(), statusBean);
+ }
+ }
+
+ for (String resource : resourcesToRemove) {
+ statusMap.remove(resource);
+ }
+
+ statusPanel.updateStatusBeans(new ArrayList<StatusBean>(statusMap.values()));
+ target.add(statusPanel);
+ }
+ }
+
+ public ConnObjectTO getConnObjectTO(
+ final Long attributableId, final String resourceName, final List<ConnObjectWrapper> objects) {
+
+ for (ConnObjectWrapper object : objects) {
+ if (attributableId.equals(object.getAttributable().getKey())
+ && resourceName.equalsIgnoreCase(object.getResourceName())) {
+
+ return object.getConnObjectTO();
+ }
+ }
+
+ return null;
+ }
+
+ public Image getStatusImage(final String componentId, final Status status) {
+ final String alt, title, statusName;
+
+ switch (status) {
+
+ case NOT_YET_SUBMITTED:
+ statusName = Status.UNDEFINED.toString();
+ alt = "undefined icon";
+ title = "Not yet submitted";
+ break;
+
+ case ACTIVE:
+ statusName = Status.ACTIVE.toString();
+ alt = "active icon";
+ title = "Enabled";
+ break;
+
+ case UNDEFINED:
+ statusName = Status.UNDEFINED.toString();
+ alt = "undefined icon";
+ title = "Undefined status";
+ break;
+
+ case OBJECT_NOT_FOUND:
+ statusName = Status.OBJECT_NOT_FOUND.toString();
+ alt = "notfound icon";
+ title = "Not found";
+ break;
+
+ default:
+ statusName = Status.SUSPENDED.toString();
+ alt = "inactive icon";
+ title = "Disabled";
+ }
+
+ final Image img = new Image(componentId, IMG_STATUES + statusName + Constants.PNG_EXT);
+
+ img.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("alt", alt);
+ tag.put("title", title);
+ }
+ });
+
+ return img;
+ }
+
+ public ImagePanel getStatusImagePanel(final String componentId, final Status status) {
+ final String alt, title, statusName;
+
+ switch (status) {
+
+ case NOT_YET_SUBMITTED:
+ statusName = Status.UNDEFINED.toString();
+ alt = "undefined icon";
+ title = "Not yet submitted";
+ break;
+
+ case ACTIVE:
+ statusName = Status.ACTIVE.toString();
+ alt = "active icon";
+ title = "Enabled";
+ break;
+
+ case UNDEFINED:
+ statusName = Status.UNDEFINED.toString();
+ alt = "undefined icon";
+ title = "Undefined status";
+ break;
+
+ case OBJECT_NOT_FOUND:
+ statusName = Status.OBJECT_NOT_FOUND.toString();
+ alt = "notfound icon";
+ title = "Not found";
+ break;
+
+ default:
+ statusName = Status.SUSPENDED.toString();
+ alt = "inactive icon";
+ title = "Disabled";
+ }
+
+ final ImagePanel imagePanel = new ImagePanel(componentId, IMG_STATUES + statusName + Constants.PNG_EXT);
+ imagePanel.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("alt", alt);
+ tag.put("title", title);
+ }
+ });
+
+ return imagePanel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java
new file mode 100644
index 0000000..b52991a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesInitializer.java
@@ -0,0 +1,63 @@
+/*
+ * 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.init;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MIMETypesInitializer {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(MIMETypesInitializer.class);
+
+ private List<String> mimeTypes;
+
+ public void load() {
+ final Set<String> mediaTypes = new HashSet<>();
+ this.mimeTypes = new ArrayList<>();
+ try {
+ final String mimeTypesFile = IOUtils.toString(getClass().getResourceAsStream("/MIMETypes"));
+ for (String fileRow : mimeTypesFile.split("\n")) {
+ if (StringUtils.isNotBlank(fileRow) && !fileRow.startsWith("#")) {
+ mediaTypes.add(fileRow);
+ }
+ }
+ this.mimeTypes.addAll(mediaTypes);
+ Collections.sort(this.mimeTypes);
+ } catch (Exception e) {
+ LOG.error("Error reading file MIMETypes from resources", e);
+ }
+ }
+
+ public List<String> getMimeTypes() {
+ LOG.debug("Returning loaded MIME types list");
+ return mimeTypes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java
new file mode 100644
index 0000000..11739be
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/PreviewPanelClassInitializer.java
@@ -0,0 +1,69 @@
+/*
+ * 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.init;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.syncope.client.console.preview.BinaryPreview;
+import org.apache.syncope.client.console.preview.PreviewerClassScanner;
+import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PreviewPanelClassInitializer {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(PreviewPanelClassInitializer.class);
+
+ @Autowired
+ private PreviewerClassScanner classScanner;
+
+ private List<Class<? extends AbstractBinaryPreviewer>> classes;
+
+ public void load() {
+ classes = new ArrayList<Class<? extends AbstractBinaryPreviewer>>();
+ for (Class<? extends AbstractBinaryPreviewer> candidate : classScanner.getComponentClasses()) {
+ classes.add(candidate);
+ }
+ }
+
+ public List<Class<? extends AbstractBinaryPreviewer>> getClasses() {
+ LOG.debug("Returning loaded classes: {}", classes);
+ return classes;
+ }
+
+ public Class<? extends AbstractBinaryPreviewer> getClass(final String mimeType) {
+ LOG.debug("Searching for previewer class for MIME type: {}", mimeType);
+ Class<? extends AbstractBinaryPreviewer> previewer = null;
+ for (Class<? extends AbstractBinaryPreviewer> candidate : classes) {
+ LOG.debug("Evaluating previewer class {} for MIME type {}", candidate.getName(), mimeType);
+ if (Arrays.asList(candidate.getAnnotation(BinaryPreview.class).mimeTypes()).contains(mimeType)) {
+ LOG.debug("Found existing previewer for MIME type {}: {}", mimeType, candidate.getName());
+ previewer = candidate;
+ }
+ }
+ return previewer;
+ }
+}
[16/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxNumberFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxNumberFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxNumberFieldPanel.html
new file mode 100644
index 0000000..3a719d1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxNumberFieldPanel.html
@@ -0,0 +1,22 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <input type="text" class="ui-widget-content ui-corner-all medium_dynamicsize"
+ wicket:id="numberField" />
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.html
new file mode 100644
index 0000000..1833140
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.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>
+ <span wicket:id="paletteField">[Palette]</span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.html
new file mode 100644
index 0000000..1f7b8f3
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.html
@@ -0,0 +1,22 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <input type="password" class="ui-widget-content ui-corner-all long_dynamicsize"
+ wicket:id="passwordField" />
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
new file mode 100644
index 0000000..e6f1d7c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
@@ -0,0 +1,23 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <input type="text" class="ui-widget-content ui-corner-all long_dynamicsize" wicket:id="textField"/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
new file mode 100644
index 0000000..6b2556f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
@@ -0,0 +1,44 @@
+<!--
+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>
+ <input style="display: none;" wicket:id="textField"/>
+ <span style="margin-right: 20px;">
+ <div style="display: table-cell;">
+ <form wicket:id="uploadForm" encType="multipart/form-data" method="post" accept-charset="UTF-8">
+ <input wicket:id="fileUpload" type="file"/>
+ <div style="top: -25px; left: 100%; position: relative; vertical-align: middle;">
+ <a href="#" wicket:id="uploadLink"><img src="img/file-upload.png" alt="upload" title="upload" style="vertical-align: middle;"/></a>
+ <a href="#" wicket:id="downloadLink"><img src="img/file-download.png" alt="download" title="download" style="vertical-align: middle;"/></a>
+ <a href="#" wicket:id="resetLink"><img src="img/disable.png" alt="disable" title="remove value" style="vertical-align: middle;"/></a>
+ <span wicket:id="preview"/>
+ </div>
+ <span wicket:id="previewContainer">
+ <span wicket:id="panelPreview">[panelPreview]</span>
+ <wicket:fragment wicket:id="previewFragment">
+ <div wicket:id = "previewer" class="ui-widget-content ui-corner-all"></div>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ </span>
+ </form>
+ </div>
+ </span>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.html
new file mode 100644
index 0000000..52f1da9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.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>
+ <wicket:panel>
+ <span wicket:id="checkBoxMultipleChoice" />
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html
new file mode 100644
index 0000000..caaf991
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.html
@@ -0,0 +1,22 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <input type="text" class="text ui-widget-content ui-corner-all date_size"
+ wicket:id="field"/>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html
new file mode 100644
index 0000000..e3a191b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.html
@@ -0,0 +1,21 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <span wicket:id="field"/>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties
new file mode 100644
index 0000000..9a39f4c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+field.DateTimeFieldPanel$DateTimeFormValidator=Field '${label0}' must be fully valued
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties
new file mode 100644
index 0000000..c524834
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_it.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+field.DateTimeFieldPanel$DateTimeFormValidator=Il campo '${label0}' dev'essere completamente valorizzato
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties
new file mode 100644
index 0000000..95be437
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+field.DateTimeFieldPanel$DateTimeFormValidator=Campo'${label0}' precisa ser preenchido
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
new file mode 100644
index 0000000..55a77e1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
@@ -0,0 +1,34 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head></wicket:head>
+ <wicket:panel>
+
+ <wicket:fragment wicket:id="requiredFragment">
+ <span wicket:id="requiredLabel"/>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="notRequiredFragment">
+ </wicket:fragment>
+
+ <wicket:child />
+
+ <span wicket:id="required"/>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.html
new file mode 100644
index 0000000..c4b75f0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.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.
+-->
+<wicket:panel>
+ <a href="#" wicket:id="link">
+ <span wicket:id="linkTitle"/>
+ </a>
+</wicket:panel>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.html
new file mode 100644
index 0000000..963a087
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.html
@@ -0,0 +1,31 @@
+<!--
+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>
+
+ <a href="#" wicket:id="propagationPurposeLink"><img id="action" src="img/actions/propagation-icon.png" alt="Propagation icon" title="Propagation"/></a>
+
+ <a href="#" wicket:id="synchronizationPurposeLink"><img id="action" src="img/actions/synchronization-icon.png" alt="Synchronization icon" title="Synchronization"/></a>
+
+ <a href="#" wicket:id="bothPurposeLink"><img id="action" src="img/actions/both-icon.png" alt="Both icon" title="Both"/></a>
+
+ <a href="#" wicket:id="nonePurposeLink"><img id="action" src="img/actions/none-icon.png" alt="None icon" title="None"/></a>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html
new file mode 100644
index 0000000..2208220
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.html
@@ -0,0 +1,35 @@
+<!--
+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>
+ <span wicket:id="multiValueContainer">
+ <span wicket:id="view">
+ <span wicket:id="panel">[form field]</span>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button" /></a>
+ <span wicket:id="panelPlus">[plus]</span>
+ <br />
+ </span>
+ <wicket:fragment wicket:id="fragmentPlus">
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button" /></a>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ </span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.properties
new file mode 100644
index 0000000..958e9e0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.properties
@@ -0,0 +1,22 @@
+# 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.
+minLength=Minimum password size
+maxLength=Maximum password size
+historyLength=Password history length
+digitRequired=Password must contain one or more digits
+prefixesNotPermitted=Password prefixes not permitted
+apply=Save
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_it.properties
new file mode 100644
index 0000000..398d634
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_it.properties
@@ -0,0 +1,22 @@
+# 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.
+minLength=Lunghezza minima password
+maxLength=Lunghezza massima password
+historyLength=Lunghezza storico password
+digitRequired=La password deve contenere uno o pi\u00f9 numeri
+prefixesNotPermitted=Prefissi password non permessi
+apply=Salva
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_pt_BR.properties
new file mode 100644
index 0000000..d4f5693
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+minLength=Tamanho m\u00EDnimo de senha
+maxLength=Tamanho m\u00E1ximo de senha
+historyLength=Tamanho dos hist\u00F3rico de senha
+digitRequired=Senha precisa contar um ou mais d\u00EDgitos
+prefixesNotPermitted=Prefixos de senha n\u00E3o permitidos
+apply=Salvar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.html
new file mode 100644
index 0000000..5800d77
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.html
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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 style="display: inline-table;">
+ <input type="hidden" wicket:id="recorder"/>
+
+ <div style="display: table-row">
+ <div id="choices" style="display: table-cell; text-align: center; font-weight: bold;">
+ <span wicket:id="availableHeader">[available header]</span>
+ </div>
+
+ <div id="buttons" style="display: table-cell;">
+ </div>
+
+ <div id="selections" style="display: table-cell; text-align: center; font-weight: bold;">
+ <span wicket:id="selectedHeader">[selected header]</span>
+ </div>
+ </div>
+
+ <div style="display: table-row">
+ <div id="choices" style="display: table-cell;">
+ <select class="choicesSelect" style="min-width: 100px;" wicket:id="choices">[choices]</select>
+ </div>
+
+ <div id="buttons" style="display: table-cell; width: 30px; text-align: center; vertical-align: middle;">
+ <div style="padding-bottom: 2px;">
+ <a wicket:id="addAllButton"><img src="img/addAll.png" alt="remove icon"/></a>
+ </div>
+ <div style="padding-top: 2px; padding-bottom: 2px;">
+ <a wicket:id="removeAllButton"><img src="img/removeAll.png" alt="move up icon"/></a>
+ </div>
+ <div style="padding-top: 2px; padding-bottom: 2px;">
+ <a wicket:id="addButton"><img src="img/add.png" alt="add icon"/></a>
+ </div>
+ <div style="padding-top: 2px; padding-bottom: 2px;">
+ <a wicket:id="removeButton"><img src="img/remove.png" alt="remove icon"/></a>
+ </div>
+ <div style="padding-top: 2px; padding-bottom: 2px;">
+ <a wicket:id="moveUpButton"><img src="img/moveUp.png" alt="move up icon"/></a>
+ </div>
+ <div style="padding-top: 2px;">
+ <a wicket:id="moveDownButton"><img src="img/moveDown.png" alt="move down icon"/></a>
+ </div>
+ </div>
+
+ <div id="selections" style="display: table-cell;">
+ <select class="selectionSelect" style="min-width: 100px;" wicket:id="selection">[selection]</select>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.html
new file mode 100644
index 0000000..a6f0e51
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.html
@@ -0,0 +1,29 @@
+<!--
+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>
+ <script type="text/javascript" wicket:id="spinnerFieldJS">
+ </script>
+ <div style="display: inline-table;">
+ <div style="display: table-cell;">
+ <input wicket:id="spinnerField"/>
+ </div>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.html
new file mode 100644
index 0000000..81e0797
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.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">
+ <wicket:head></wicket:head>
+ <wicket:panel>
+ <wicket:child />
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
new file mode 100644
index 0000000..9733b29
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div wicket:id = "certCommonName">[certCommonName]</div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.html
new file mode 100644
index 0000000..3b891b0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.html
@@ -0,0 +1,23 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div><img wicket:id = "previewImage"/></div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.html
new file mode 100644
index 0000000..8294ed0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.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.
+-->
+<wicket:panel>
+ <div class="roleTable" wicket:id="treeContainer">
+ <div wicket:id="treeTable" class="role-tree"/>
+ </div>
+</wicket:panel>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java b/syncope620/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
index 11bfa51..43c2fea 100644
--- a/syncope620/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
+++ b/syncope620/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
@@ -26,7 +26,6 @@ import org.apache.syncope.common.lib.search.RoleFiqlSearchConditionBuilder;
import org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder;
import org.apache.syncope.common.rest.api.Preference;
import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
/**
* Entry point for client access to all REST services exposed by Syncope core; obtain instances via
@@ -203,39 +202,6 @@ public class SyncopeClient {
}
/**
- * Checks whether self-registration is allowed by calling <tt>UserSelfService</tt>'s options.
- *
- * @return whether self-registration is allowed
- * @see UserSelfService#getOptions()
- */
- public boolean isSelfRegAllowed() {
- return Boolean.valueOf(restClientFactory.createServiceInstance(UserSelfService.class, mediaType, null, null).
- getOptions().getHeaderString(RESTHeaders.SELFREG_ALLOWED));
- }
-
- /**
- * Checks whether password reset is allowed by calling <tt>UserSelfService</tt>'s options.
- *
- * @return whether password reset is allowed
- * @see UserSelfService#getOptions()
- */
- public boolean isPwdResetAllowed() {
- return Boolean.valueOf(restClientFactory.createServiceInstance(UserSelfService.class, mediaType, null, null).
- getOptions().getHeaderString(RESTHeaders.PWDRESET_ALLOWED));
- }
-
- /**
- * Checks whether password reset requires security question by calling <tt>UserSelfService</tt>'s options.
- *
- * @return whether password reset requires security question
- * @see UserSelfService#getOptions()
- */
- public boolean isPwdResetRequiringSecurityQuestions() {
- return Boolean.valueOf(restClientFactory.createServiceInstance(UserSelfService.class, mediaType, null, null).
- getOptions().getHeaderString(RESTHeaders.PWDRESET_NEEDS_SECURITYQUESTIONS));
- }
-
- /**
* Fetches <tt>ETag</tt> header value from latest service run (if available).
*
* @param <T> any service class
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/pom.xml b/syncope620/client/pom.xml
index f809200..0143d08 100644
--- a/syncope620/client/pom.xml
+++ b/syncope620/client/pom.xml
@@ -35,6 +35,7 @@ under the License.
<modules>
<module>lib</module>
+ <module>console</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
index d21e03f..b7d767b 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
@@ -35,6 +35,12 @@ public class SyncopeTO extends AbstractBaseBean {
private String version;
+ private boolean selfRegAllowed;
+
+ private boolean pwdResetAllowed;
+
+ private boolean pwdResetRequiringSecurityQuestions;
+
private final List<String> connIdLocations = new ArrayList<>();
private String attributableTransformer;
@@ -69,6 +75,18 @@ public class SyncopeTO extends AbstractBaseBean {
return version;
}
+ public boolean isSelfRegAllowed() {
+ return selfRegAllowed;
+ }
+
+ public boolean isPwdResetAllowed() {
+ return pwdResetAllowed;
+ }
+
+ public boolean isPwdResetRequiringSecurityQuestions() {
+ return pwdResetRequiringSecurityQuestions;
+ }
+
@XmlElementWrapper(name = "connIdLocations")
@XmlElement(name = "connIdLocation")
@JsonProperty("connIdLocations")
@@ -163,6 +181,18 @@ public class SyncopeTO extends AbstractBaseBean {
this.version = version;
}
+ public void setSelfRegAllowed(final boolean selfRegAllowed) {
+ this.selfRegAllowed = selfRegAllowed;
+ }
+
+ public void setPwdResetAllowed(final boolean pwdResetAllowed) {
+ this.pwdResetAllowed = pwdResetAllowed;
+ }
+
+ public void setPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions) {
+ this.pwdResetRequiringSecurityQuestions = pwdResetRequiringSecurityQuestions;
+ }
+
public void setAttributableTransformer(final String attributableTransformer) {
this.attributableTransformer = attributableTransformer;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
index 2e385fc..d491037 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
@@ -108,7 +108,7 @@ public class AuditLoggerName extends AbstractBaseBean {
eventCategory.getValue());
}
- private static Map.Entry<EventCategoryTO, Result> parseEventCategory(final String event) {
+ public static Map.Entry<EventCategoryTO, Result> parseEventCategory(final String event) {
final EventCategoryTO eventCategoryTO = new EventCategoryTO();
Result condition = null;
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
index e1af7e5..93ea67e 100644
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
@@ -34,21 +34,6 @@ public final class RESTHeaders {
public static final String USERNAME = "Syncope.Username";
/**
- * Option key stating if user request create is allowed or not.
- */
- public static final String SELFREG_ALLOWED = "Syncope.SelfRegistration.Allowed";
-
- /**
- * Option key stating if password reset is allowed or not.
- */
- public static final String PWDRESET_ALLOWED = "Syncope.PasswordReset.Allowed";
-
- /**
- * Option key stating if password reset requires security question or not.
- */
- public static final String PWDRESET_NEEDS_SECURITYQUESTIONS = "Syncope.PasswordReset.SecurityQuestions";
-
- /**
* HTTP header key for object ID assigned to an object after its creation.
*/
public static final String RESOURCE_ID = "Syncope.Id";
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
index 75b6af2..3046a5d 100644
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
@@ -23,7 +23,6 @@ import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
-import javax.ws.rs.OPTIONS;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -44,23 +43,6 @@ import org.apache.syncope.common.lib.to.UserTO;
public interface UserSelfService extends JAXRSService {
/**
- * Checks whether self-registration is allowed.
- *
- * @return <tt>Response</tt> contains special Syncope HTTP header indicating if user self registration and / or
- * password reset is allowed
- * @see org.apache.syncope.common.rest.api.RESTHeaders#SELFREG_ALLOWED
- * @see org.apache.syncope.common.rest.api.RESTHeaders#PWDRESET_ALLOWED
- * @see org.apache.syncope.common.rest.api.RESTHeaders#PWDRESET_NEEDS_SECURITYQUESTIONS
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Contains special Syncope HTTP header indicating if user self registration "
- + "and / or password reset is allowed")
- })
- @OPTIONS
- Response getOptions();
-
- /**
* Returns the user making the service call.
*
* @return calling user data
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/pom.xml b/syncope620/fit/pom.xml
index 54c847f..99cec38 100644
--- a/syncope620/fit/pom.xml
+++ b/syncope620/fit/pom.xml
@@ -35,7 +35,7 @@ under the License.
<modules>
<module>build-tools</module>
- <module>reference</module>
+ <module>server-reference</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/pom.xml b/syncope620/fit/reference/pom.xml
deleted file mode 100644
index 0fa46dd..0000000
--- a/syncope620/fit/reference/pom.xml
+++ /dev/null
@@ -1,526 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.syncope</groupId>
- <artifactId>syncope-fit</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <name>Apache Syncope FIT Server Reference</name>
- <description>Apache Syncope FIT Server Reference</description>
- <groupId>org.apache.syncope.fit</groupId>
- <artifactId>syncope-fit-server-reference</artifactId>
- <packaging>war</packaging>
-
- <properties>
- <jdbcdriver.groupId>com.h2database</jdbcdriver.groupId>
- <jdbcdriver.artifactId>h2</jdbcdriver.artifactId>
-
- <rootpom.basedir>${basedir}/../..</rootpom.basedir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>javax.servlet.jsp-api</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.syncope.server</groupId>
- <artifactId>syncope-server-rest-cxf</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.syncope.server</groupId>
- <artifactId>syncope-server-workflow-java</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.syncope.server</groupId>
- <artifactId>syncope-server-persistence-jpa</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.syncope.fit</groupId>
- <artifactId>syncope-fit-build-tools</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.tirasa.connid.bundles.soap</groupId>
- <artifactId>wssample</artifactId>
- <version>${connid.soap.version}</version>
- <type>war</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.lmax</groupId>
- <artifactId>disruptor</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>highlightjs</artifactId>
- </dependency>
-
- <!-- TEST -->
- <dependency>
- <groupId>org.apache.syncope.ext.camel</groupId>
- <artifactId>syncope-ext-camel-rest-cxf</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.syncope.client</groupId>
- <artifactId>syncope-client-lib</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>set-bundles</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>setupCSV</id>
- <phase>pre-integration-test</phase>
- <configuration>
- <target>
- <copy file="${project.build.directory}/test-classes/test.csv" todir="${test.csvdir.path}" overwrite="true"/>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <systemPropertyVariables>
- <jaxrsContentType>${jaxrs.content.type}</jaxrsContentType>
- </systemPropertyVariables>
- </configuration>
- <executions>
- <execution>
- <id>verify</id>
- <goals>
- <goal>verify</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <container>
- <dependencies>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
- <dependency>
- <groupId>${jdbcdriver.groupId}</groupId>
- <artifactId>${jdbcdriver.artifactId}</artifactId>
- </dependency>
- </dependencies>
- </container>
- <configuration>
- <type>standalone</type>
- <properties>
- <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
- <cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
- <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
-
- <cargo.jvmargs>-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
- </properties>
- <configfiles>
- <configfile>
- <file>${project.build.directory}/classes/context.xml</file>
- <todir>conf/</todir>
- <tofile>context.xml</tofile>
- </configfile>
- </configfiles>
- </configuration>
- <deployables>
- <deployable>
- <groupId>net.tirasa.connid.bundles.soap</groupId>
- <artifactId>wssample</artifactId>
- <type>war</type>
- <properties>
- <context>wssample</context>
- </properties>
- </deployable>
- <deployable>
- <groupId>org.apache.syncope.fit</groupId>
- <artifactId>syncope-fit-build-tools</artifactId>
- <type>war</type>
- <properties>
- <context>syncope-fit-build-tools</context>
- </properties>
- </deployable>
- <deployable>
- <location>${project.build.directory}/${project.build.finalName}</location>
- <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
- <pingTimeout>60000</pingTimeout>
- <properties>
- <context>syncope</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- </plugin>
- </plugins>
-
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- <resource>
- <directory>${basedir}/../../server/persistence-jpa/src/test/resources</directory>
- <includes>
- <include>content.xml</include>
- <include>persistence.properties</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- <resource>
- <directory>${basedir}/../../server/misc/src/main/resources</directory>
- <includes>
- <include>security.properties</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
- </build>
-
- <profiles>
- <profile>
- <id>debug</id>
-
- <properties>
- <skipTests>true</skipTests>
- </properties>
-
- <build>
- <defaultGoal>clean verify cargo:run</defaultGoal>
-
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <configuration>
- <properties>
- <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
- -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
- </properties>
- </configuration>
- </configuration>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>none</phase>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>skipTests</id>
-
- <dependencies>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <deployables>
- <deployable>
- <location>${project.build.directory}/${project.build.finalName}.war</location>
- </deployable>
- </deployables>
- </configuration>
- <executions>
- <execution>
- <id>install-container</id>
- <phase>package</phase>
- <goals>
- <goal>install</goal>
- </goals>
- </execution>
- <execution>
- <id>start-container</id>
- <phase>none</phase>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>light</id>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <excludes>
- <exclude>workflow.properties</exclude>
- <exclude>provisioning.properties</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src/main/resources/light</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </build>
- </profile>
-
- <profile>
- <id>all</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.syncope.server</groupId>
- <artifactId>syncope-server-workflow-activiti</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.syncope.ext.camel</groupId>
- <artifactId>syncope-ext-camel-rest-cxf</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.syncope.ext.camel</groupId>
- <artifactId>syncope-ext-camel-persistence-jpa</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.syncope.ext.camel</groupId>
- <artifactId>syncope-ext-camel-provisioning</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- Adds Activiti test content -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xml-maven-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <phase>prepare-package</phase>
- <goals>
- <goal>transform</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <transformationSets>
- <transformationSet>
- <dir>${project.build.directory}/classes</dir>
- <includes>
- <include>content.xml</include>
- </includes>
- <outputDir>${project.build.directory}/classes</outputDir>
- <stylesheet>${basedir}/src/test/resources/addActivitiToContent.xsl</stylesheet>
- <outputProperties>
- <outputProperty>
- <name>indent</name>
- <value>yes</value>
- </outputProperty>
- </outputProperties>
- </transformationSet>
- </transformationSets>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java b/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
deleted file mode 100644
index da25a34..0000000
--- a/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
+++ /dev/null
@@ -1,75 +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.fit.server.reference;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.to.AbstractAttributableTO;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.server.provisioning.api.AttributableTransformer;
-
-/**
- * Class for integration tests: transform (by making it double) any attribute value for defined schema.
- */
-public class DoubleValueAttributableTransformer implements AttributableTransformer {
-
- private static final String NAME = "makeItDouble";
-
- @Override
- public <T extends AbstractAttributableTO> T transform(final T input) {
- for (AttrTO attr : input.getPlainAttrs()) {
- if (NAME.equals(attr.getSchema())) {
- List<String> values = new ArrayList<>(attr.getValues().size());
- for (String value : attr.getValues()) {
- try {
- values.add(String.valueOf(2 * Long.valueOf(value)));
- } catch (NumberFormatException e) {
- // ignore
- }
- }
- attr.getValues().clear();
- attr.getValues().addAll(values);
- }
- }
-
- return input;
- }
-
- @Override
- public <T extends AbstractAttributableMod> T transform(final T input) {
- for (AttrMod attr : input.getPlainAttrsToUpdate()) {
- if (NAME.equals(attr.getSchema())) {
- List<String> values = new ArrayList<>(attr.getValuesToBeAdded().size());
- for (String value : attr.getValuesToBeAdded()) {
- try {
- values.add(String.valueOf(2 * Long.valueOf(value)));
- } catch (NumberFormatException e) {
- // ignore
- }
- }
- attr.getValuesToBeAdded().clear();
- attr.getValuesToBeAdded().addAll(values);
- }
- }
-
- return input;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java b/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
deleted file mode 100644
index 01da2c9..0000000
--- a/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
+++ /dev/null
@@ -1,83 +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.fit.server.reference;
-
-import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.server.provisioning.api.sync.ProvisioningProfile;
-import org.apache.syncope.server.provisioning.java.sync.DefaultSyncActions;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-import org.quartz.JobExecutionException;
-
-public class TestSyncActions extends DefaultSyncActions {
-
- private int counter = 0;
-
- @Override
- public <T extends AbstractSubjectTO> SyncDelta beforeProvision(
- final ProvisioningProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException {
-
- AttrTO attrTO = null;
- for (int i = 0; i < subject.getPlainAttrs().size(); i++) {
- if ("fullname".equals(subject.getPlainAttrs().get(i).getSchema())) {
- attrTO = subject.getPlainAttrs().get(i);
- }
- }
- if (attrTO == null) {
- attrTO = new AttrTO();
- attrTO.setSchema("fullname");
- subject.getPlainAttrs().add(attrTO);
- }
- attrTO.getValues().clear();
- attrTO.getValues().add(String.valueOf(counter++));
-
- return delta;
- }
-
- @Override
- public <T extends AbstractSubjectTO, K extends AbstractSubjectMod> SyncDelta beforeUpdate(
- final ProvisioningProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject,
- final K subjectMod) throws JobExecutionException {
-
- subjectMod.getPlainAttrsToRemove().add("fullname");
-
- AttrMod fullnameMod = null;
- for (AttrMod attrMod : subjectMod.getPlainAttrsToUpdate()) {
- if ("fullname".equals(attrMod.getSchema())) {
- fullnameMod = attrMod;
- }
- }
- if (fullnameMod == null) {
- fullnameMod = new AttrMod();
- fullnameMod.setSchema("fullname");
- subjectMod.getPlainAttrsToUpdate().add(fullnameMod);
- }
-
- fullnameMod.getValuesToBeAdded().clear();
- fullnameMod.getValuesToBeAdded().add(String.valueOf(counter++));
-
- return delta;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java b/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
deleted file mode 100644
index 8454ec6..0000000
--- a/syncope620/fit/reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
+++ /dev/null
@@ -1,37 +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.fit.server.reference;
-
-import org.apache.syncope.server.persistence.api.dao.search.AttributeCond;
-import org.apache.syncope.server.persistence.api.dao.search.SearchCond;
-import org.apache.syncope.server.provisioning.api.sync.SyncCorrelationRule;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-
-public class TestSyncRule implements SyncCorrelationRule {
-
- @Override
- public SearchCond getSearchCond(ConnectorObject connObj) {
- AttributeCond cond = new AttributeCond();
- cond.setSchema("email");
- cond.setType(AttributeCond.Type.EQ);
- cond.setExpression(connObj.getName().getNameValue());
-
- return SearchCond.getLeafCond(cond);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/connid.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/connid.properties b/syncope620/fit/reference/src/main/resources/connid.properties
deleted file mode 100644
index 40d649c..0000000
--- a/syncope620/fit/reference/src/main/resources/connid.properties
+++ /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.
-connid.locations=${connid.location},\
-connid://${testconnectorserver.key}@localhost:${testconnectorserver.port}
-
-## for test only
-testdb.url=${testdb.url}
-connid.soap.version=${connid.soap.version}
-connid.db.table.version=${connid.db.table.version}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/context.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/context.xml b/syncope620/fit/reference/src/main/resources/context.xml
deleted file mode 100644
index 471d561..0000000
--- a/syncope620/fit/reference/src/main/resources/context.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
-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.
--->
-<Context>
- <!-- Disable session persistence across Tomcat restarts -->
- <Manager pathname=""/>
-</Context>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/light/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/light/provisioning.properties b/syncope620/fit/reference/src/main/resources/light/provisioning.properties
deleted file mode 100644
index 2ed4d0d..0000000
--- a/syncope620/fit/reference/src/main/resources/light/provisioning.properties
+++ /dev/null
@@ -1,18 +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.
-userProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultUserProvisioningManager
-roleProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/light/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/light/workflow.properties b/syncope620/fit/reference/src/main/resources/light/workflow.properties
deleted file mode 100644
index 2c08d50..0000000
--- a/syncope620/fit/reference/src/main/resources/light/workflow.properties
+++ /dev/null
@@ -1,20 +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.
-wf.directory=${conf.directory}
-jobExecutorActivate=false
-uwfAdapter=org.apache.syncope.server.workflow.java.DefaultUserWorkflowAdapter
-rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
[40/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/EditUserModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/EditUserModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/EditUserModalPage.java
new file mode 100644
index 0000000..af502d2
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/EditUserModalPage.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.commons.status.StatusBean;
+import org.apache.syncope.client.console.panels.AccountInformationPanel;
+import org.apache.syncope.client.console.panels.MembershipsPanel;
+import org.apache.syncope.client.console.panels.ResourcesPanel;
+import org.apache.syncope.client.console.panels.StatusPanel;
+import org.apache.syncope.common.lib.AttributableOperations;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.UserTO;
+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.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Modal window with User form.
+ */
+public class EditUserModalPage extends UserModalPage {
+
+ private static final long serialVersionUID = -6479209496805705739L;
+
+ protected Form form;
+
+ private final UserTO initialUserTO;
+
+ private StatusPanel statusPanel;
+
+ public EditUserModalPage(final PageReference pageRef, final ModalWindow window, final UserTO userTO) {
+ super(pageRef, window, userTO, Mode.ADMIN, true);
+
+ this.initialUserTO = SerializationUtils.clone(userTO);
+
+ form = setupEditPanel();
+
+ // add resource assignment details in case of update
+ if (userTO.getKey() != 0) {
+ form.addOrReplace(new Label("pwdChangeInfo", new ResourceModel("pwdChangeInfo")));
+
+ statusPanel = new StatusPanel("statuspanel", userTO, new ArrayList<StatusBean>(), getPageReference());
+ statusPanel.setOutputMarkupId(true);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ statusPanel, RENDER, xmlRolesReader.getEntitlement("Resources", "getConnectorObject"));
+ form.addOrReplace(statusPanel);
+
+ form.addOrReplace(new AccountInformationPanel("accountinformation", userTO));
+
+ form.addOrReplace(new ResourcesPanel.Builder("resources").attributableTO(userTO).
+ statusPanel(statusPanel).build());
+
+ form.addOrReplace(new MembershipsPanel("memberships", userTO, mode, statusPanel, getPageReference()));
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ protected void submitAction(final AjaxRequestTarget target, final Form form) {
+ final UserTO updatedUserTO = (UserTO) form.getModelObject();
+
+ if (updatedUserTO.getKey() == 0) {
+ userTO = userRestClient.create(updatedUserTO, storePassword.getModelObject());
+ } else {
+ final UserMod userMod = AttributableOperations.diff(updatedUserTO, initialUserTO);
+
+ if (statusPanel != null) {
+ userMod.setPwdPropRequest(statusPanel.getStatusMod());
+ }
+
+ // update user just if it is changed
+ if (!userMod.isEmpty()) {
+ userTO = userRestClient.update(initialUserTO.getETagValue(), userMod);
+ }
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ protected void closeAction(final AjaxRequestTarget target, final Form form) {
+ setResponsePage(new ResultStatusModalPage.Builder(window, userTO).mode(mode).build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
new file mode 100644
index 0000000..db46171
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * Error WebPage.
+ */
+public class ErrorPage extends BasePage {
+
+ private static final long serialVersionUID = -390761262038796657L;
+
+ public ErrorPage(final PageParameters parameters) {
+ super(parameters);
+
+ add(new Label("errorTitle", new Model<String>(parameters.get("errorTitle").toString())));
+ add(new Label("errorMessage", new Model<String>(parameters.get("errorMessage").toString())));
+
+ add(new BookmarkablePageLink<Page>("home", getApplication().getHomePage()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ExecMessageModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ExecMessageModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ExecMessageModalPage.java
new file mode 100644
index 0000000..e39f3fc
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ExecMessageModalPage.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.pages;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.Model;
+
+public class ExecMessageModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 3163146190501510888L;
+
+ public ExecMessageModalPage(final String message) {
+ final Label dialogContent = new Label("message", new Model<String>(message));
+ add(dialogContent.setOutputMarkupId(true));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/FailureMessageModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/FailureMessageModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/FailureMessageModalPage.java
new file mode 100644
index 0000000..c0ee7ec
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/FailureMessageModalPage.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.Model;
+
+public class FailureMessageModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 9216117990503199258L;
+
+ public FailureMessageModalPage(final String message, final String failureMessage) {
+ final Label executionFailureMessage;
+ if (!failureMessage.isEmpty()) {
+ executionFailureMessage = new Label("failureMessage", new Model<String>(failureMessage));
+ } else {
+ executionFailureMessage = new Label("failureMessage");
+ }
+ add(executionFailureMessage.setOutputMarkupId(true));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/HomePage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/HomePage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/HomePage.java
new file mode 100644
index 0000000..7b4ba68
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/HomePage.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * Syncope Home-Page.
+ */
+public class HomePage extends BasePage {
+
+ private static final long serialVersionUID = -6712990478380766293L;
+
+ public HomePage(final PageParameters parameters) {
+ super(parameters);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/InfoModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/InfoModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/InfoModalPage.java
new file mode 100644
index 0000000..83e0163
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/InfoModalPage.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.ExternalLink;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class InfoModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 5558354927844399580L;
+
+ @SpringBean(name = "site")
+ private String siteUrl;
+
+ @SpringBean(name = "license")
+ private String licenseUrl;
+
+ public InfoModalPage() {
+ super();
+
+ add(new ExternalLink("syncopeLink", siteUrl));
+ add(new ExternalLink("licenseLink", licenseUrl));
+ add(new Label("version", SyncopeSession.get().getVersion()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
new file mode 100644
index 0000000..deaa359
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
@@ -0,0 +1,365 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.security.AccessControlException;
+import java.util.List;
+import java.util.Locale;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.NotificationPanel;
+import org.apache.syncope.client.console.rest.UserSelfRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.LinkPanel;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.wrap.EntitlementTO;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.EntitlementService;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Syncope Login page.
+ */
+public class Login extends WebPage {
+
+ private static final long serialVersionUID = -3744389270366566218L;
+
+ private final static int SELF_REG_WIN_HEIGHT = 550;
+
+ private final static int SELF_REG_WIN_WIDTH = 800;
+
+ private final static int PWD_RESET_WIN_HEIGHT = 300;
+
+ private final static int PWD_RESET_WIN_WIDTH = 800;
+
+ @SpringBean(name = "version")
+ private String version;
+
+ @SpringBean(name = "anonymousUser")
+ private String anonymousUser;
+
+ @SpringBean(name = "anonymousKey")
+ private String anonymousKey;
+
+ @SpringBean
+ private UserSelfRestClient userSelfRestClient;
+
+ private final StatelessForm<Void> form;
+
+ private final TextField<String> userIdField;
+
+ private final TextField<String> passwordField;
+
+ private final DropDownChoice<Locale> languageSelect;
+
+ private final NotificationPanel feedbackPanel;
+
+ public Login(final PageParameters parameters) {
+ super(parameters);
+ setStatelessHint(true);
+
+ feedbackPanel = new NotificationPanel(Constants.FEEDBACK);
+ add(feedbackPanel);
+
+ form = new StatelessForm<Void>("login");
+
+ userIdField = new TextField<String>("userId", new Model<String>());
+ userIdField.setMarkupId("userId");
+ form.add(userIdField);
+
+ passwordField = new PasswordTextField("password", new Model<String>());
+ passwordField.setMarkupId("password");
+ form.add(passwordField);
+
+ languageSelect = new LocaleDropDown("language");
+
+ form.add(languageSelect);
+
+ AjaxButton submitButton = new AjaxButton("submit", new Model<String>(getString("submit"))) {
+
+ private static final long serialVersionUID = 429178684321093953L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ try {
+ if (anonymousUser.equals(userIdField.getRawInput())) {
+ throw new AccessControlException("Illegal username");
+ }
+
+ authenticate(userIdField.getRawInput(), passwordField.getRawInput());
+
+ setResponsePage(WelcomePage.class, parameters);
+ } catch (AccessControlException e) {
+ error(getString("login-error"));
+ feedbackPanel.refresh(target);
+ SyncopeSession.get().resetClients();
+ }
+ }
+ };
+
+ submitButton.setDefaultFormProcessing(false);
+ form.add(submitButton);
+
+ add(form);
+
+ // Modal window for self registration
+ final ModalWindow selfRegModalWin = new ModalWindow("selfRegModal");
+ selfRegModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ selfRegModalWin.setInitialHeight(SELF_REG_WIN_HEIGHT);
+ selfRegModalWin.setInitialWidth(SELF_REG_WIN_WIDTH);
+ selfRegModalWin.setCookieName("self-reg-modal");
+ add(selfRegModalWin);
+
+ Fragment selfRegFrag;
+ if (userSelfRestClient.isSelfRegistrationAllowed()) {
+ selfRegFrag = new Fragment("selfRegistration", "selfRegAllowed", this);
+
+ final AjaxLink<Void> selfRegLink = new ClearIndicatingAjaxLink<Void>("link", getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ selfRegModalWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ // anonymous authentication needed for self-registration
+ authenticate(anonymousUser, anonymousKey);
+
+ return new UserSelfModalPage(Login.this.getPageReference(), selfRegModalWin, new UserTO());
+ }
+ });
+
+ selfRegModalWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 251794406325329768L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ SyncopeSession.get().invalidate();
+ }
+ });
+
+ selfRegModalWin.show(target);
+ }
+ };
+ selfRegLink.add(new Label("linkTitle", getString("selfRegistration")));
+
+ Panel panel = new LinkPanel("selfRegistration", new ResourceModel("selfRegistration"));
+ panel.add(selfRegLink);
+ selfRegFrag.add(panel);
+ } else {
+ selfRegFrag = new Fragment("selfRegistration", "selfRegNotAllowed", this);
+ }
+ add(selfRegFrag);
+
+ // Modal window for password reset request
+ final ModalWindow pwdResetReqModalWin = new ModalWindow("pwdResetReqModal");
+ pwdResetReqModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ pwdResetReqModalWin.setInitialHeight(PWD_RESET_WIN_HEIGHT);
+ pwdResetReqModalWin.setInitialWidth(PWD_RESET_WIN_WIDTH);
+ pwdResetReqModalWin.setCookieName("pwd-reset-req-modal");
+ add(pwdResetReqModalWin);
+
+ Fragment pwdResetFrag;
+ if (userSelfRestClient.isPasswordResetAllowed()) {
+ pwdResetFrag = new Fragment("passwordReset", "pwdResetAllowed", this);
+
+ final AjaxLink<Void> pwdResetLink = new ClearIndicatingAjaxLink<Void>("link", getPageReference()) {
+
+ private static final long serialVersionUID = -6957616042924610290L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ pwdResetReqModalWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ // anonymous authentication needed for password reset request
+ authenticate(anonymousUser, anonymousKey);
+
+ return new RequestPasswordResetModalPage(pwdResetReqModalWin);
+ }
+ });
+
+ pwdResetReqModalWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ SyncopeSession.get().invalidate();
+ setResponsePage(Login.class);
+ }
+ });
+
+ pwdResetReqModalWin.show(target);
+ }
+ };
+ pwdResetLink.add(new Label("linkTitle", getString("passwordReset")));
+
+ Panel panel = new LinkPanel("passwordReset", new ResourceModel("passwordReset"));
+ panel.add(pwdResetLink);
+ pwdResetFrag.add(panel);
+ } else {
+ pwdResetFrag = new Fragment("passwordReset", "pwdResetNotAllowed", this);
+ }
+ add(pwdResetFrag);
+
+ // Modal window for password reset confirm - automatically shown when token is available as request parameter
+ final String pwdResetToken = RequestCycle.get().getRequest().getRequestParameters().
+ getParameterValue(Constants.PARAM_PASSWORD_RESET_TOKEN).toOptionalString();
+ final ModalWindow pwdResetConfModalWin = new ModalWindow("pwdResetConfModal");
+ if (StringUtils.isNotBlank(pwdResetToken)) {
+ pwdResetConfModalWin.add(new AbstractDefaultAjaxBehavior() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ protected void respond(final AjaxRequestTarget target) {
+ ModalWindow window = (ModalWindow) getComponent();
+ window.show(target);
+ }
+
+ @Override
+ public void renderHead(final Component component, final IHeaderResponse response) {
+ response.render(JavaScriptHeaderItem.forScript(getCallbackScript(), null));
+ }
+ });
+ }
+ pwdResetConfModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ pwdResetConfModalWin.setInitialHeight(PWD_RESET_WIN_HEIGHT);
+ pwdResetConfModalWin.setInitialWidth(PWD_RESET_WIN_WIDTH);
+ pwdResetConfModalWin.setCookieName("pwd-reset-conf-modal");
+ pwdResetConfModalWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ // anonymous authentication needed for password reset confirm
+ authenticate(anonymousUser, anonymousKey);
+
+ return new ConfirmPasswordResetModalPage(pwdResetConfModalWin, pwdResetToken);
+ }
+ });
+ pwdResetConfModalWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ SyncopeSession.get().invalidate();
+ setResponsePage(Login.class);
+ }
+ });
+ add(pwdResetConfModalWin);
+ }
+
+ private void authenticate(final String username, final String password) {
+ List<EntitlementTO> entitlements = SyncopeSession.get().
+ getService(EntitlementService.class, username, password).getOwnEntitlements();
+
+ SyncopeSession.get().setUsername(username);
+ SyncopeSession.get().setPassword(password);
+ SyncopeSession.get().setEntitlements(CollectionWrapper.unwrap(entitlements).toArray(new String[0]));
+ SyncopeSession.get().setVersion(version);
+ }
+
+ /**
+ * Inner class which implements (custom) Locale DropDownChoice component.
+ */
+ private class LocaleDropDown extends DropDownChoice<Locale> {
+
+ private static final long serialVersionUID = 2349382679992357202L;
+
+ private class LocaleRenderer extends ChoiceRenderer<Locale> {
+
+ private static final long serialVersionUID = -3657529581555164741L;
+
+ @Override
+ public String getDisplayValue(final Locale locale) {
+ return locale.getDisplayName(getLocale());
+ }
+ }
+
+ public LocaleDropDown(final String id) {
+ super(id, SyncopeSession.SUPPORTED_LOCALES);
+
+ setChoiceRenderer(new LocaleRenderer());
+ setModel(new IModel<Locale>() {
+
+ private static final long serialVersionUID = -6985170095629312963L;
+
+ @Override
+ public Locale getObject() {
+ return getSession().getLocale();
+ }
+
+ @Override
+ public void setObject(final Locale object) {
+ getSession().setLocale(object);
+ }
+
+ @Override
+ public void detach() {
+ // Empty.
+ }
+ });
+
+ // set default value to English
+ getModel().setObject(Locale.ENGLISH);
+ }
+
+ @Override
+ protected boolean wantOnSelectionChangedNotifications() {
+ return true;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Logout.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Logout.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Logout.java
new file mode 100644
index 0000000..acf313b
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Logout.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * Syncope Logout.
+ */
+public class Logout extends BasePage {
+
+ private static final long serialVersionUID = -2143007520243939450L;
+
+ public Logout(final PageParameters parameters) {
+ super(parameters);
+
+ SyncopeSession.get().invalidate();
+
+ setResponsePage(getApplication().getHomePage());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/MembershipModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/MembershipModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/MembershipModalPage.java
new file mode 100644
index 0000000..f2e2189
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/MembershipModalPage.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.panels.AnnotatedBeanPanel;
+import org.apache.syncope.client.console.panels.DerAttrsPanel;
+import org.apache.syncope.client.console.panels.PlainAttrsPanel;
+import org.apache.syncope.client.console.panels.VirAttrsPanel;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class MembershipModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -4360802478081432549L;
+
+ private final AjaxButton submit;
+
+ public MembershipModalPage(final PageReference pageRef, final ModalWindow window, final MembershipTO membershipTO,
+ final Mode mode) {
+
+ final Form<MembershipTO> form = new Form<MembershipTO>("MembershipForm");
+
+ final UserTO userTO = ((UserModalPage) pageRef.getPage()).getUserTO();
+
+ form.setModel(new CompoundPropertyModel<MembershipTO>(membershipTO));
+
+ submit = new AjaxButton(SUBMIT, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
+ userTO.getMemberships().remove(membershipTO);
+ userTO.getMemberships().add(membershipTO);
+
+ ((UserModalPage) pageRef.getPage()).setUserTO(userTO);
+
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final IndicatingAjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ ((UserModalPage) pageRef.getPage()).setUserTO(userTO);
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ //--------------------------------
+ // Attributes panel
+ //--------------------------------
+ form.add(new PlainAttrsPanel("plainAttrs", membershipTO, form, mode));
+ form.add(new AnnotatedBeanPanel("systeminformation", membershipTO));
+ //--------------------------------
+
+ //--------------------------------
+ // Derived attributes container
+ //--------------------------------
+ form.add(new DerAttrsPanel("derAttrs", membershipTO));
+ //--------------------------------
+
+ //--------------------------------
+ // Virtual attributes container
+ //--------------------------------
+ form.add(new VirAttrsPanel("virAttrs", membershipTO, mode == Mode.TEMPLATE));
+ //--------------------------------
+
+ add(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
new file mode 100644
index 0000000..cb342ae
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationModalPage.java
@@ -0,0 +1,441 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.LoggerCategoryPanel;
+import org.apache.syncope.client.console.panels.RoleSearchPanel;
+import org.apache.syncope.client.console.panels.UserSearchPanel;
+import org.apache.syncope.client.console.rest.LoggerRestClient;
+import org.apache.syncope.client.console.rest.NotificationRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.TraceLevel;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.validation.validator.EmailAddressValidator;
+
+class NotificationModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -1975312550059578553L;
+
+ @SpringBean
+ private NotificationRestClient restClient;
+
+ @SpringBean
+ private LoggerRestClient loggerRestClient;
+
+ public NotificationModalPage(final PageReference pageRef, final ModalWindow window,
+ final NotificationTO notificationTO, final boolean createFlag) {
+
+ final Form<NotificationTO> form =
+ new Form<NotificationTO>(FORM, new CompoundPropertyModel<NotificationTO>(notificationTO));
+
+ final AjaxTextFieldPanel sender = new AjaxTextFieldPanel("sender", getString("sender"),
+ new PropertyModel<String>(notificationTO, "sender"));
+ sender.addRequiredLabel();
+ sender.addValidator(EmailAddressValidator.getInstance());
+ form.add(sender);
+
+ final AjaxTextFieldPanel subject = new AjaxTextFieldPanel("subject", getString("subject"),
+ new PropertyModel<String>(notificationTO, "subject"));
+ subject.addRequiredLabel();
+ form.add(subject);
+
+ final AjaxDropDownChoicePanel<String> template = new AjaxDropDownChoicePanel<String>(
+ "template", getString("template"),
+ new PropertyModel<String>(notificationTO, "template"));
+ template.setChoices(confRestClient.getMailTemplates());
+ template.addRequiredLabel();
+ form.add(template);
+
+ final AjaxDropDownChoicePanel<TraceLevel> traceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
+ "traceLevel", getString("traceLevel"),
+ new PropertyModel<TraceLevel>(notificationTO, "traceLevel"));
+ traceLevel.setChoices(Arrays.asList(TraceLevel.values()));
+ traceLevel.addRequiredLabel();
+ form.add(traceLevel);
+
+ final AjaxCheckBoxPanel isActive = new AjaxCheckBoxPanel("isActive",
+ getString("isActive"), new PropertyModel<Boolean>(notificationTO, "active"));
+ if (createFlag) {
+ isActive.getField().setDefaultModelObject(Boolean.TRUE);
+ }
+ form.add(isActive);
+
+ final WebMarkupContainer aboutContainer = new WebMarkupContainer("aboutContainer");
+ aboutContainer.setOutputMarkupId(true);
+
+ form.add(aboutContainer);
+
+ final AjaxCheckBoxPanel checkAbout = new AjaxCheckBoxPanel("checkAbout", "checkAbout", new Model<Boolean>(
+ notificationTO.getUserAbout() == null && notificationTO.getRoleAbout() == null));
+ aboutContainer.add(checkAbout);
+
+ final AjaxCheckBoxPanel checkUserAbout = new AjaxCheckBoxPanel("checkUserAbout", "checkUserAbout",
+ new Model<Boolean>(notificationTO.getUserAbout() != null));
+ aboutContainer.add(checkUserAbout);
+
+ final AjaxCheckBoxPanel checkRoleAbout = new AjaxCheckBoxPanel("checkRoleAbout", "checkRoleAbout",
+ new Model<Boolean>(notificationTO.getRoleAbout() != null));
+ aboutContainer.add(checkRoleAbout);
+
+ final UserSearchPanel userAbout =
+ new UserSearchPanel.Builder("userAbout").fiql(notificationTO.getUserAbout()).build();
+ aboutContainer.add(userAbout);
+ userAbout.setEnabled(checkUserAbout.getModelObject());
+
+ final RoleSearchPanel roleAbout =
+ new RoleSearchPanel.Builder("roleAbout").fiql(notificationTO.getRoleAbout()).build();
+ aboutContainer.add(roleAbout);
+ roleAbout.setEnabled(checkRoleAbout.getModelObject());
+
+ checkAbout.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (checkAbout.getModelObject()) {
+ checkUserAbout.setModelObject(Boolean.FALSE);
+ checkRoleAbout.setModelObject(Boolean.FALSE);
+ userAbout.setEnabled(Boolean.FALSE);
+ roleAbout.setEnabled(Boolean.FALSE);
+ } else {
+ checkAbout.setModelObject(Boolean.TRUE);
+ }
+ target.add(aboutContainer);
+ }
+ });
+
+ checkUserAbout.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (checkUserAbout.getModelObject()) {
+ checkAbout.setModelObject(!checkUserAbout.getModelObject());
+ checkRoleAbout.setModelObject(!checkUserAbout.getModelObject());
+ roleAbout.setEnabled(Boolean.FALSE);
+ } else {
+ checkUserAbout.setModelObject(Boolean.TRUE);
+ }
+ userAbout.setEnabled(Boolean.TRUE);
+ target.add(aboutContainer);
+ }
+ });
+
+ checkRoleAbout.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (checkRoleAbout.getModelObject()) {
+ checkAbout.setModelObject(Boolean.FALSE);
+ checkUserAbout.setModelObject(Boolean.FALSE);
+ userAbout.setEnabled(Boolean.FALSE);
+ } else {
+ checkRoleAbout.setModelObject(Boolean.TRUE);
+ }
+ roleAbout.setEnabled(Boolean.TRUE);
+ target.add(aboutContainer);
+ }
+ });
+
+ final AjaxDropDownChoicePanel<IntMappingType> recipientAttrType = new AjaxDropDownChoicePanel<IntMappingType>(
+ "recipientAttrType", new ResourceModel("recipientAttrType", "recipientAttrType").getObject(),
+ new PropertyModel<IntMappingType>(notificationTO, "recipientAttrType"));
+ recipientAttrType.setChoices(new ArrayList<IntMappingType>(
+ IntMappingType.getAttributeTypes(AttributableType.USER,
+ EnumSet.of(IntMappingType.UserId, IntMappingType.Password))));
+ recipientAttrType.setRequired(true);
+ form.add(recipientAttrType);
+
+ final AjaxDropDownChoicePanel<String> recipientAttrName = new AjaxDropDownChoicePanel<String>(
+ "recipientAttrName", new ResourceModel("recipientAttrName", "recipientAttrName").getObject(),
+ new PropertyModel<String>(notificationTO, "recipientAttrName"));
+ recipientAttrName.setChoices(getSchemaNames(recipientAttrType.getModelObject()));
+ recipientAttrName.setRequired(true);
+ form.add(recipientAttrName);
+
+ recipientAttrType.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ recipientAttrName.setChoices(getSchemaNames(recipientAttrType.getModelObject()));
+ target.add(recipientAttrName);
+ }
+ });
+
+ form.add(new LoggerCategoryPanel(
+ "eventSelection",
+ loggerRestClient.listEvents(),
+ new PropertyModel<List<String>>(notificationTO, "events"),
+ getPageReference(),
+ "Notification") {
+
+ private static final long serialVersionUID = 6429053774964787735L;
+
+ @Override
+ protected String[] getListRoles() {
+ return new String[] {};
+ }
+
+ @Override
+ protected String[] getChangeRoles() {
+ return new String[] {};
+ }
+ });
+
+ final WebMarkupContainer recipientsContainer = new WebMarkupContainer("recipientsContainer");
+ recipientsContainer.setOutputMarkupId(true);
+
+ form.add(recipientsContainer);
+
+ final AjaxCheckBoxPanel checkStaticRecipients = new AjaxCheckBoxPanel("checkStaticRecipients",
+ "recipients", new Model<Boolean>(!notificationTO.getStaticRecipients().isEmpty()));
+ form.add(checkStaticRecipients);
+
+ if (createFlag) {
+ checkStaticRecipients.getField().setDefaultModelObject(Boolean.FALSE);
+ }
+
+ final AjaxTextFieldPanel staticRecipientsFieldPanel =
+ new AjaxTextFieldPanel("panel", "staticRecipients", new Model<String>(null));
+ staticRecipientsFieldPanel.addValidator(EmailAddressValidator.getInstance());
+ staticRecipientsFieldPanel.setRequired(checkStaticRecipients.getModelObject());
+
+ if (notificationTO.getStaticRecipients().isEmpty()) {
+ notificationTO.getStaticRecipients().add(null);
+ }
+
+ final MultiFieldPanel<String> staticRecipients = new MultiFieldPanel<String>("staticRecipients",
+ new PropertyModel<List<String>>(notificationTO, "staticRecipients"), staticRecipientsFieldPanel);
+ staticRecipients.setEnabled(checkStaticRecipients.getModelObject());
+ form.add(staticRecipients);
+
+ final AjaxCheckBoxPanel checkRecipients =
+ new AjaxCheckBoxPanel("checkRecipients", "checkRecipients",
+ new Model<Boolean>(notificationTO.getRecipients() == null ? false : true));
+ recipientsContainer.add(checkRecipients);
+
+ if (createFlag) {
+ checkRecipients.getField().setDefaultModelObject(Boolean.TRUE);
+ }
+
+ final UserSearchPanel recipients =
+ new UserSearchPanel.Builder("recipients").fiql(notificationTO.getRecipients()).build();
+
+ recipients.setEnabled(checkRecipients.getModelObject());
+ recipientsContainer.add(recipients);
+
+ final AjaxCheckBoxPanel selfAsRecipient = new AjaxCheckBoxPanel("selfAsRecipient",
+ getString("selfAsRecipient"), new PropertyModel<Boolean>(notificationTO, "selfAsRecipient"));
+ form.add(selfAsRecipient);
+
+ if (createFlag) {
+ selfAsRecipient.getField().setDefaultModelObject(Boolean.FALSE);
+ }
+
+ selfAsRecipient.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (!selfAsRecipient.getModelObject()
+ && !checkRecipients.getModelObject()
+ && !checkStaticRecipients.getModelObject()) {
+
+ checkRecipients.getField().setDefaultModelObject(Boolean.TRUE);
+ target.add(checkRecipients);
+ recipients.setEnabled(checkRecipients.getModelObject());
+ target.add(recipients);
+ target.add(recipientsContainer);
+ }
+ }
+ });
+
+ checkRecipients.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (!checkRecipients.getModelObject()
+ && !selfAsRecipient.getModelObject()
+ && !checkStaticRecipients.getModelObject()) {
+
+ checkStaticRecipients.getField().setDefaultModelObject(Boolean.TRUE);
+ target.add(checkStaticRecipients);
+ staticRecipients.setEnabled(Boolean.TRUE);
+ target.add(staticRecipients);
+ staticRecipientsFieldPanel.setRequired(Boolean.TRUE);
+ target.add(staticRecipientsFieldPanel);
+ }
+ recipients.setEnabled(checkRecipients.getModelObject());
+ target.add(recipients);
+ target.add(recipientsContainer);
+ }
+ });
+
+ checkStaticRecipients.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (!checkStaticRecipients.getModelObject()
+ && !selfAsRecipient.getModelObject()
+ && !checkRecipients.getModelObject()) {
+ checkRecipients.getField().setDefaultModelObject(Boolean.TRUE);
+ checkRecipients.setEnabled(Boolean.TRUE);
+ target.add(checkRecipients);
+ }
+ staticRecipients.setEnabled(checkStaticRecipients.getModelObject());
+ staticRecipientsFieldPanel.setRequired(checkStaticRecipients.getModelObject());
+ recipients.setEnabled(checkRecipients.getModelObject());
+ target.add(staticRecipientsFieldPanel);
+ target.add(staticRecipients);
+ target.add(recipients);
+ target.add(recipientsContainer);
+ }
+ });
+
+ AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT))) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ notificationTO.setUserAbout(
+ !checkAbout.getModelObject() && checkUserAbout.getModelObject() ? userAbout.buildFIQL() : null);
+ notificationTO.setRoleAbout(
+ !checkAbout.getModelObject()
+ && checkRoleAbout.getModelObject() ? roleAbout.buildFIQL() : null);
+ notificationTO.setRecipients(checkRecipients.getModelObject() ? recipients.buildFIQL() : null);
+ notificationTO.getStaticRecipients().removeAll(Collections.singleton(null));
+
+ try {
+ if (createFlag) {
+ restClient.create(notificationTO);
+ } else {
+ restClient.update(notificationTO);
+ }
+ info(getString(Constants.OPERATION_SUCCEEDED));
+
+ Configuration callerPage = (Configuration) pageRef.getPage();
+ callerPage.setModalResult(true);
+
+ window.close(target);
+ } catch (SyncopeClientException scee) {
+ error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+
+ String allowedRoles = createFlag
+ ? xmlRolesReader.getEntitlement("Notification", "create")
+ : xmlRolesReader.getEntitlement("Notification", "update");
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
+
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ form.add(cancel);
+
+ add(form);
+ }
+
+ private List<String> getSchemaNames(final IntMappingType type) {
+ final List<String> result;
+
+ if (type == null) {
+ result = Collections.<String>emptyList();
+ } else {
+ switch (type) {
+ case UserPlainSchema:
+ result = schemaRestClient.getSchemaNames(AttributableType.USER);
+ break;
+
+ case UserDerivedSchema:
+ result = schemaRestClient.getDerSchemaNames(AttributableType.USER);
+ break;
+
+ case UserVirtualSchema:
+ result = schemaRestClient.getVirSchemaNames(AttributableType.USER);
+ break;
+
+ case Username:
+ result = Collections.singletonList("Username");
+ break;
+
+ default:
+ result = Collections.<String>emptyList();
+ }
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationTaskModalPage.java
new file mode 100644
index 0000000..70f63d6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/NotificationTaskModalPage.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
+import org.apache.wicket.markup.html.form.ListMultipleChoice;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.model.PropertyModel;
+
+public class NotificationTaskModalPage extends TaskModalPage {
+
+ private static final long serialVersionUID = -4399606755452034216L;
+
+ public NotificationTaskModalPage(final AbstractTaskTO taskTO) {
+ super(taskTO);
+
+ final AjaxTextFieldPanel sender = new AjaxTextFieldPanel("sender", getString("sender"),
+ new PropertyModel<String>(taskTO, "sender"));
+ sender.setEnabled(false);
+ profile.add(sender);
+
+ if (taskTO instanceof NotificationTaskTO) {
+ final ListMultipleChoice<String> recipients = new ListMultipleChoice<>("recipients",
+ new ArrayList<>(((NotificationTaskTO) taskTO).getRecipients()));
+ recipients.setMaxRows(5);
+ recipients.setEnabled(false);
+ profile.add(recipients);
+ }
+
+ final AjaxTextFieldPanel subject = new AjaxTextFieldPanel("subject", getString("subject"),
+ new PropertyModel<String>(taskTO, "subject"));
+ subject.setEnabled(false);
+ profile.add(subject);
+
+ final TextArea<String> textBody = new TextArea<String>("textBody",
+ new PropertyModel<String>(taskTO, "textBody"));
+ textBody.setEnabled(false);
+ profile.add(textBody);
+
+ final TextArea<String> htmlBody = new TextArea<String>("htmlBody",
+ new PropertyModel<String>(taskTO, "htmlBody"));
+ htmlBody.setEnabled(false);
+ profile.add(htmlBody);
+
+ final AjaxTextFieldPanel traceLevel = new AjaxTextFieldPanel("traceLevel", getString("traceLevel"),
+ new PropertyModel<String>(taskTO, "traceLevel"));
+ traceLevel.setEnabled(false);
+ profile.add(traceLevel);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
new file mode 100644
index 0000000..869f3a6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PlainSchemaModalPage.java
@@ -0,0 +1,456 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.JexlHelpUtil;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.util.string.Strings;
+
+/**
+ * Modal window with Schema form.
+ */
+public class PlainSchemaModalPage extends AbstractSchemaModalPage<PlainSchemaTO> {
+
+ private static final long serialVersionUID = -5991561277287424057L;
+
+ public PlainSchemaModalPage(final AttributableType kind) {
+ super(kind);
+ }
+
+ @Override
+ public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
+ final PlainSchemaTO schemaTO, final boolean createFlag) {
+
+ final PlainSchemaTO schema = schemaTO == null
+ ? new PlainSchemaTO()
+ : schemaTO;
+
+ final Form<PlainSchemaTO> schemaForm = new Form<>(FORM);
+
+ schemaForm.setModel(new CompoundPropertyModel<>(schema));
+ schemaForm.setOutputMarkupId(true);
+
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(schema, "name"));
+ name.addRequiredLabel();
+ name.setEnabled(createFlag);
+ schemaForm.add(name);
+
+ final AjaxDropDownChoicePanel<AttrSchemaType> type = new AjaxDropDownChoicePanel<>(
+ "type", getString("type"), new PropertyModel<AttrSchemaType>(schema, "type"));
+ type.setChoices(Arrays.asList(AttrSchemaType.values()));
+ type.addRequiredLabel();
+ schemaForm.add(type);
+
+ // -- long, double, date
+ final AjaxTextFieldPanel conversionPattern = new AjaxTextFieldPanel("conversionPattern",
+ getString("conversionPattern"), new PropertyModel<String>(schema, "conversionPattern"));
+ schemaForm.add(conversionPattern);
+
+ final WebMarkupContainer conversionParams = new WebMarkupContainer("conversionParams");
+ conversionParams.setOutputMarkupPlaceholderTag(true);
+ conversionParams.add(conversionPattern);
+ schemaForm.add(conversionParams);
+
+ final WebMarkupContainer typeParams = new WebMarkupContainer("typeParams");
+ typeParams.setOutputMarkupPlaceholderTag(true);
+ // -- enum
+ final AjaxTextFieldPanel enumerationValuesPanel =
+ new AjaxTextFieldPanel("panel", "enumerationValues", new Model<String>(null));
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final MultiFieldPanel<String> enumerationValues = new MultiFieldPanel<>("enumerationValues",
+ new Model(),
+ enumerationValuesPanel);
+ enumerationValues.setModelObject(getEnumValuesAsList(schema.getEnumerationValues()));
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final MultiFieldPanel<String> enumerationKeys = new MultiFieldPanel<>("enumerationKeys",
+ new Model(),
+ new AjaxTextFieldPanel("panel", "enumerationKeys", new Model<String>(null)));
+ enumerationKeys.setModelObject(getEnumValuesAsList(schema.getEnumerationKeys()));
+
+ final WebMarkupContainer enumParams = new WebMarkupContainer("enumParams");
+ enumParams.setOutputMarkupPlaceholderTag(true);
+ enumParams.add(enumerationValues);
+ enumParams.add(enumerationKeys);
+ typeParams.add(enumParams);
+
+ // -- encrypted
+ final AjaxTextFieldPanel secretKey = new AjaxTextFieldPanel("secretKey",
+ getString("secretKey"), new PropertyModel<String>(schema, "secretKey"));
+
+ final AjaxDropDownChoicePanel<CipherAlgorithm> cipherAlgorithm = new AjaxDropDownChoicePanel<>(
+ "cipherAlgorithm", getString("cipherAlgorithm"),
+ new PropertyModel<CipherAlgorithm>(schema, "cipherAlgorithm"));
+ cipherAlgorithm.setChoices(Arrays.asList(CipherAlgorithm.values()));
+
+ final WebMarkupContainer encryptedParams = new WebMarkupContainer("encryptedParams");
+ encryptedParams.setOutputMarkupPlaceholderTag(true);
+ encryptedParams.add(secretKey);
+ encryptedParams.add(cipherAlgorithm);
+ typeParams.add(encryptedParams);
+
+ // -- binary
+ final AjaxTextFieldPanel mimeType = new AjaxTextFieldPanel("mimeType",
+ getString("mimeType"), new PropertyModel<String>(schema, "mimeType"));
+ mimeType.setChoices(mimeTypesInitializer.getMimeTypes());
+
+ final WebMarkupContainer binaryParams = new WebMarkupContainer("binaryParams");
+ binaryParams.setOutputMarkupPlaceholderTag(true);
+ binaryParams.add(mimeType);
+ typeParams.add(binaryParams);
+
+ schemaForm.add(typeParams);
+
+ // -- show or hide
+ showHide(schema, type,
+ conversionParams, conversionPattern,
+ enumParams, enumerationValuesPanel, enumerationValues, enumerationKeys,
+ encryptedParams, secretKey, cipherAlgorithm,
+ binaryParams, mimeType);
+ type.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ PlainSchemaModalPage.this.showHide(schema, type,
+ conversionParams, conversionPattern,
+ enumParams, enumerationValuesPanel, enumerationValues, enumerationKeys,
+ encryptedParams, secretKey, cipherAlgorithm,
+ binaryParams, mimeType);
+ target.add(typeParams);
+ }
+ });
+
+ final IModel<List<String>> validatorsList = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return schemaRestClient.getAllValidatorClasses();
+ }
+ };
+ final AjaxDropDownChoicePanel<String> validatorClass = new AjaxDropDownChoicePanel<>("validatorClass",
+ getString("validatorClass"), new PropertyModel<String>(schema, "validatorClass"));
+ ((DropDownChoice) validatorClass.getField()).setNullValid(true);
+ validatorClass.setChoices(validatorsList.getObject());
+ schemaForm.add(validatorClass);
+
+ final AutoCompleteTextField<String> mandatoryCondition =
+ new AutoCompleteTextField<String>("mandatoryCondition") {
+
+ private static final long serialVersionUID = -2428903969518079100L;
+
+ @Override
+ protected Iterator<String> getChoices(final String input) {
+ List<String> choices = new ArrayList<String>();
+
+ if (Strings.isEmpty(input)) {
+ choices = Collections.emptyList();
+ } else if ("true".startsWith(input.toLowerCase())) {
+ choices.add("true");
+ } else if ("false".startsWith(input.toLowerCase())) {
+ choices.add("false");
+ }
+
+ return choices.iterator();
+ }
+ };
+ mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+ schemaForm.add(mandatoryCondition);
+
+ final WebMarkupContainer pwdJexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
+
+ final AjaxLink<Void> pwdQuestionMarkJexlHelp = JexlHelpUtil.getAjaxLink(pwdJexlHelp, "questionMarkJexlHelp");
+ schemaForm.add(pwdQuestionMarkJexlHelp);
+ pwdQuestionMarkJexlHelp.add(pwdJexlHelp);
+
+ final AjaxCheckBoxPanel multivalue = new AjaxCheckBoxPanel("multivalue", getString("multivalue"),
+ new PropertyModel<Boolean>(schema, "multivalue"));
+ schemaForm.add(multivalue);
+
+ final AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", getString("readonly"),
+ new PropertyModel<Boolean>(schema, "readonly"));
+ schemaForm.add(readonly);
+
+ final AjaxCheckBoxPanel uniqueConstraint = new AjaxCheckBoxPanel("uniqueConstraint",
+ getString("uniqueConstraint"), new PropertyModel<Boolean>(schema, "uniqueConstraint"));
+ schemaForm.add(uniqueConstraint);
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final PlainSchemaTO schemaTO = (PlainSchemaTO) form.getDefaultModelObject();
+
+ schemaTO.setEnumerationValues(getEnumValuesAsString(enumerationValues.getView().getModelObject()));
+ schemaTO.setEnumerationKeys(getEnumValuesAsString(enumerationKeys.getView().getModelObject()));
+
+ if (schemaTO.isMultivalue() && schemaTO.isUniqueConstraint()) {
+ error(getString("multivalueAndUniqueConstr.validation"));
+ feedbackPanel.refresh(target);
+ return;
+ }
+
+ try {
+ if (createFlag) {
+ schemaRestClient.createSchema(kind, schemaTO);
+ } else {
+ schemaRestClient.updateSchema(kind, schemaTO);
+ }
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ schemaForm.add(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ schemaForm.add(cancel);
+
+ String allowedRoles = createFlag
+ ? xmlRolesReader.getEntitlement("Schema", "create")
+ : xmlRolesReader.getEntitlement("Schema", "update");
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
+
+ add(schemaForm);
+ }
+
+ private void showHide(final PlainSchemaTO schema, final AjaxDropDownChoicePanel<AttrSchemaType> type,
+ final WebMarkupContainer conversionParams, final AjaxTextFieldPanel conversionPattern,
+ final WebMarkupContainer enumParams, final AjaxTextFieldPanel enumerationValuesPanel,
+ final MultiFieldPanel<String> enumerationValues, final MultiFieldPanel<String> enumerationKeys,
+ final WebMarkupContainer encryptedParams,
+ final AjaxTextFieldPanel secretKey, final AjaxDropDownChoicePanel<CipherAlgorithm> cipherAlgorithm,
+ final WebMarkupContainer binaryParams, final AjaxTextFieldPanel mimeType) {
+
+ final int typeOrdinal = Integer.parseInt(type.getField().getValue());
+ if (AttrSchemaType.Long.ordinal() == typeOrdinal
+ || AttrSchemaType.Double.ordinal() == typeOrdinal
+ || AttrSchemaType.Date.ordinal() == typeOrdinal) {
+
+ conversionParams.setVisible(true);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ } else if (AttrSchemaType.Enum.ordinal() == typeOrdinal) {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(true);
+ if (!enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.addRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(schema.getEnumerationValues()));
+ enumerationKeys.setModelObject(getEnumValuesAsList(schema.getEnumerationKeys()));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ } else if (AttrSchemaType.Encrypted.ordinal() == typeOrdinal) {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(true);
+ if (!secretKey.isRequired()) {
+ secretKey.addRequiredLabel();
+ }
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.addRequiredLabel();
+ }
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ } else if (AttrSchemaType.Binary.ordinal() == typeOrdinal) {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(true);
+ } else {
+ conversionParams.setVisible(false);
+ conversionPattern.setModelObject(null);
+
+ enumParams.setVisible(false);
+ if (enumerationValuesPanel.isRequired()) {
+ enumerationValuesPanel.removeRequiredLabel();
+ }
+ enumerationValues.setModelObject(getEnumValuesAsList(null));
+ enumerationKeys.setModelObject(getEnumValuesAsList(null));
+
+ encryptedParams.setVisible(false);
+ if (secretKey.isRequired()) {
+ secretKey.removeRequiredLabel();
+ }
+ secretKey.setModelObject(null);
+ if (cipherAlgorithm.isRequired()) {
+ cipherAlgorithm.removeRequiredLabel();
+ }
+ cipherAlgorithm.setModelObject(null);
+
+ binaryParams.setVisible(false);
+ mimeType.setModelObject(null);
+ }
+ }
+
+ private String getEnumValuesAsString(final List<String> enumerationValues) {
+ final StringBuilder builder = new StringBuilder();
+
+ for (String str : enumerationValues) {
+ if (StringUtils.isNotBlank(str)) {
+ if (builder.length() > 0) {
+ builder.append(SyncopeConstants.ENUM_VALUES_SEPARATOR);
+ }
+
+ builder.append(str.trim());
+ }
+ }
+
+ return builder.toString();
+ }
+
+ private List<String> getEnumValuesAsList(final String enumerationValues) {
+ final List<String> values = new ArrayList<String>();
+
+ if (StringUtils.isNotBlank(enumerationValues)) {
+ for (String value : enumerationValues.split(SyncopeConstants.ENUM_VALUES_SEPARATOR)) {
+ values.add(value.trim());
+ }
+ } else {
+ values.add(StringUtils.EMPTY);
+ }
+
+ return values;
+ }
+}
[12/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java
deleted file mode 100644
index 4b701c4..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java
+++ /dev/null
@@ -1,578 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.security.AccessControlException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.BulkAction;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.syncope.common.lib.to.MappingTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.ConnConfPropSchema;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.lib.types.MappingPurpose;
-import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class ResourceITCase extends AbstractITCase {
-
- private ResourceTO buildResourceTO(final String resourceName) {
- ResourceTO resourceTO = new ResourceTO();
-
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setExtAttrName("userId");
- item.setIntAttrName("userId");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
-
- item = new MappingItemTO();
- item.setExtAttrName("username");
- item.setIntAttrName("fullname");
- item.setIntMappingType(IntMappingType.UserId);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setExtAttrName("fullname");
- item.setIntAttrName("cn");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setAccountid(false);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
-
- resourceTO.setUmapping(mapping);
- return resourceTO;
- }
-
- @Test
- public void getPropagationActionsClasses() {
- List<String> actions = syncopeService.info().getPropagationActions();
- assertNotNull(actions);
- assertFalse(actions.isEmpty());
- }
-
- @Test
- public void create() {
- String resourceName = RESOURCE_NAME_CREATE;
- ResourceTO resourceTO = buildResourceTO(resourceName);
-
- Response response = resourceService.create(resourceTO);
- ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
- assertNotNull(actual);
-
- // check for existence
- actual = resourceService.read(resourceName);
- assertNotNull(actual);
- }
-
- @Test
- public void createOverridingProps() {
- String resourceName = "overriding-conn-conf-target-resource-create";
- ResourceTO resourceTO = new ResourceTO();
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setExtAttrName("uid");
- item.setIntAttrName("userId");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
-
- item = new MappingItemTO();
- item.setExtAttrName("username");
- item.setIntAttrName("fullname");
- item.setIntMappingType(IntMappingType.UserId);
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setExtAttrName("fullname");
- item.setIntAttrName("cn");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setAccountid(false);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
-
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
-
- resourceTO.setUmapping(mapping);
-
- ConnConfProperty p = new ConnConfProperty();
- ConnConfPropSchema schema = new ConnConfPropSchema();
- schema.setType("java.lang.String");
- schema.setName("endpoint");
- schema.setRequired(true);
- p.setSchema(schema);
- p.getValues().add("http://invalidurl/");
-
- Set<ConnConfProperty> connectorConfigurationProperties = new HashSet<ConnConfProperty>(Arrays.asList(p));
- resourceTO.getConnConfProperties().addAll(connectorConfigurationProperties);
-
- Response response = resourceService.create(resourceTO);
- ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
- assertNotNull(actual);
-
- // check the existence
- actual = resourceService.read(resourceName);
- assertNotNull(actual);
- }
-
- @Test
- public void createWithSingleMappingItem() {
- String resourceName = RESOURCE_NAME_CREATE_SINGLE;
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
-
- MappingTO umapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserId);
- item.setExtAttrName("userId");
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.PROPAGATION);
- umapping.setAccountIdItem(item);
-
- resourceTO.setUmapping(umapping);
-
- MappingTO rmapping = new MappingTO();
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.RoleId);
- item.setExtAttrName("roleId");
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.SYNCHRONIZATION);
- rmapping.setAccountIdItem(item);
-
- resourceTO.setRmapping(rmapping);
-
- Response response = resourceService.create(resourceTO);
- ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
-
- assertNotNull(actual);
- assertNotNull(actual.getUmapping());
- assertNotNull(actual.getUmapping().getItems());
- assertNotNull(actual.getRmapping());
- assertNotNull(actual.getRmapping().getItems());
- assertEquals(MappingPurpose.SYNCHRONIZATION, actual.getRmapping().getAccountIdItem().getPurpose());
- assertEquals(MappingPurpose.PROPAGATION, actual.getUmapping().getAccountIdItem().getPurpose());
- }
-
- @Test
- public void createWithInvalidMapping() {
- String resourceName = RESOURCE_NAME_CREATE_WRONG;
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserId);
- item.setExtAttrName("userId");
- item.setAccountid(true);
- mapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setExtAttrName("email");
- // missing intAttrName ...
- mapping.addItem(item);
-
- resourceTO.setUmapping(mapping);
-
- try {
- createResource(resourceTO);
- fail("Create should not have worked");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- assertEquals("intAttrName", e.getElements().iterator().next());
- }
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithoutExtAttr() {
- String resourceName = RESOURCE_NAME_CREATE_WRONG;
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserId);
- item.setExtAttrName("userId");
- item.setAccountid(true);
- mapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setIntAttrName("usernane");
- // missing extAttrName ...
- mapping.addItem(item);
-
- resourceTO.setUmapping(mapping);
-
- createResource(resourceTO);
- }
-
- @Test
- public void createWithPasswordPolicy() {
- String resourceName = "res-with-password-policy";
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
- resourceTO.setPasswordPolicy(4L);
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setExtAttrName("userId");
- item.setIntAttrName("userId");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.setAccountIdItem(item);
-
- resourceTO.setUmapping(mapping);
-
- Response response = resourceService.create(resourceTO);
- ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
- assertNotNull(actual);
-
- // check the existence
- actual = resourceService.read(resourceName);
- assertNotNull(actual);
- assertNotNull(actual.getPasswordPolicy());
- assertEquals(4L, (long) actual.getPasswordPolicy());
- }
-
- @Test
- public void updateWithException() {
- try {
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey("resourcenotfound");
-
- resourceService.update(resourceTO.getKey(), resourceTO);
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void update() {
- String resourceName = RESOURCE_NAME_UPDATE;
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(101L);
-
- MappingTO mapping = new MappingTO();
-
- // Update with an existing and already assigned mapping
- MappingItemTO item = new MappingItemTO();
- item.setKey(112L);
- item.setExtAttrName("test3");
- item.setIntAttrName("fullname");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
-
- // Update defining new mappings
- for (int i = 4; i < 6; i++) {
- item = new MappingItemTO();
- item.setExtAttrName("test" + i);
- item.setIntAttrName("fullname");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
- }
- item = new MappingItemTO();
- item.setExtAttrName("username");
- item.setIntAttrName("fullname");
- item.setIntMappingType(IntMappingType.UserId);
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.BOTH);
- mapping.setAccountIdItem(item);
-
- resourceTO.setUmapping(mapping);
-
- resourceService.update(resourceTO.getKey(), resourceTO);
- ResourceTO actual = resourceService.read(resourceTO.getKey());
- assertNotNull(actual);
-
- // check for existence
- Collection<MappingItemTO> mapItems = actual.getUmapping().getItems();
- assertNotNull(mapItems);
- assertEquals(4, mapItems.size());
- }
-
- @Test
- public void deleteWithException() {
- try {
- resourceService.delete("resourcenotfound");
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void updateResetSyncToken() {
- // create resource with sync token
- String resourceName = RESOURCE_NAME_RESETSYNCTOKEN + getUUIDString();
- ResourceTO pre = buildResourceTO(resourceName);
- pre.setUsyncToken("test");
- resourceService.create(pre);
-
- pre.setUsyncToken(null);
- resourceService.update(pre.getKey(), pre);
- ResourceTO actual = resourceService.read(pre.getKey());
- // check that the synctoken has been reset
- assertNull(actual.getUsyncToken());
- }
-
- @Test
- public void delete() {
- String resourceName = "tobedeleted";
-
- ResourceTO resource = buildResourceTO(resourceName);
- Response response = resourceService.create(resource);
- ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
- assertNotNull(actual);
-
- resourceService.delete(resourceName);
-
- try {
- resourceService.read(resourceName);
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void list() {
- List<ResourceTO> actuals = resourceService.list();
- assertNotNull(actuals);
- assertFalse(actuals.isEmpty());
- for (ResourceTO resourceTO : actuals) {
- assertNotNull(resourceTO);
- }
- }
-
- @Test
- public void read() {
- ResourceTO actual = resourceService.read(RESOURCE_NAME_TESTDB);
- assertNotNull(actual);
- }
-
- @Test
- public void issueSYNCOPE323() {
- ResourceTO actual = resourceService.read(RESOURCE_NAME_TESTDB);
- assertNotNull(actual);
-
- try {
- createResource(actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.EntityExists, e.getType());
- }
-
- actual.setKey(null);
- try {
- createResource(actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
- }
-
- @Test
- public void bulkAction() {
- resourceService.create(buildResourceTO("forBulk1"));
- resourceService.create(buildResourceTO("forBulk2"));
-
- assertNotNull(resourceService.read("forBulk1"));
- assertNotNull(resourceService.read("forBulk2"));
-
- final BulkAction bulkAction = new BulkAction();
- bulkAction.setOperation(BulkAction.Type.DELETE);
-
- bulkAction.getTargets().add(String.valueOf("forBulk1"));
- bulkAction.getTargets().add(String.valueOf("forBulk2"));
-
- resourceService.bulk(bulkAction);
-
- try {
- resourceService.read("forBulk1");
- fail();
- } catch (SyncopeClientException e) {
- }
-
- try {
- resourceService.read("forBulk2");
- fail();
- } catch (SyncopeClientException e) {
- }
- }
-
- @Test
- public void issueSYNCOPE360() {
- final String name = "SYNCOPE360-" + getUUIDString();
- resourceService.create(buildResourceTO(name));
-
- ResourceTO resource = resourceService.read(name);
- assertNotNull(resource);
- assertNotNull(resource.getUmapping());
-
- resource.setUmapping(new MappingTO());
- resourceService.update(name, resource);
-
- resource = resourceService.read(name);
- assertNotNull(resource);
- assertNull(resource.getUmapping());
- }
-
- @Test
- public void issueSYNCOPE368() {
- final String name = "SYNCOPE368-" + getUUIDString();
-
- ResourceTO resourceTO = new ResourceTO();
-
- resourceTO.setKey(name);
- resourceTO.setConnectorId(105L);
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.RoleName);
- item.setExtAttrName("cn");
- item.setPurpose(MappingPurpose.BOTH);
- mapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.RoleOwnerSchema);
- item.setExtAttrName("owner");
- item.setPurpose(MappingPurpose.BOTH);
- mapping.addItem(item);
-
- resourceTO.setRmapping(mapping);
-
- resourceTO = createResource(resourceTO);
- assertNotNull(resourceTO);
- assertEquals(2, resourceTO.getRmapping().getItems().size());
- }
-
- @Test
- public void issueSYNCOPE418() {
- try {
- resourceService.create(
- buildResourceTO("http://schemas.examples.org/security/authorization/organizationUnit"));
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidExternalResource, e.getType());
-
- assertTrue(e.getElements().iterator().next().toString().contains(EntityViolationType.InvalidName.name()));
- }
- }
-
- @Test
- public void anonymous() {
- ResourceService unauthenticated = clientFactory.createAnonymous().getService(ResourceService.class);
- try {
- unauthenticated.list();
- fail();
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- ResourceService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).
- getService(ResourceService.class);
- assertFalse(anonymous.list().isEmpty());
- }
-
- @Test
- public void issueSYNCOPE493() {
- // create resource with attribute mapping set to NONE and check its propagation
- String resourceName = RESOURCE_NAME_CREATE_NONE;
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(102L);
-
- MappingTO umapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserId);
- item.setExtAttrName("userId");
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.PROPAGATION);
- umapping.setAccountIdItem(item);
-
- MappingItemTO item2 = new MappingItemTO();
- item2.setIntMappingType(IntMappingType.UserPlainSchema);
- item2.setAccountid(false);
- item2.setIntAttrName("gender");
- item2.setExtAttrName("gender");
- item2.setPurpose(MappingPurpose.NONE);
- umapping.addItem(item2);
-
- resourceTO.setUmapping(umapping);
-
- Response response = resourceService.create(resourceTO);
- ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
-
- assertNotNull(actual);
- assertNotNull(actual.getUmapping());
- assertNotNull(actual.getUmapping().getItems());
- assertEquals(MappingPurpose.PROPAGATION, actual.getUmapping().getAccountIdItem().getPurpose());
- for (MappingItemTO itemTO : actual.getUmapping().getItems()) {
- if ("gender".equals(itemTO.getIntAttrName())) {
- assertEquals(MappingPurpose.NONE, itemTO.getPurpose());
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
deleted file mode 100644
index 18646f5..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
+++ /dev/null
@@ -1,889 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.AccessControlException;
-import java.util.List;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.ReferenceMod;
-import org.apache.syncope.common.lib.mod.RoleMod;
-import org.apache.syncope.common.lib.to.BulkActionResult;
-import org.apache.syncope.common.lib.to.ConnObjectTO;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.lib.types.MappingPurpose;
-import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
-import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.wrap.ResourceName;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
-import org.apache.syncope.common.rest.api.Preference;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.RoleService;
-import org.identityconnectors.framework.common.objects.Name;
-import org.junit.FixMethodOrder;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class RoleITCase extends AbstractITCase {
-
- private RoleTO buildBasicRoleTO(final String name) {
- RoleTO roleTO = new RoleTO();
- roleTO.setName(name + getUUIDString());
- roleTO.setParent(8L);
- return roleTO;
- }
-
- private RoleTO buildRoleTO(final String name) {
- RoleTO roleTO = buildBasicRoleTO(name);
-
- // verify inheritance password and account policies
- roleTO.setInheritAccountPolicy(false);
- // not inherited so setter execution shouldn't be ignored
- roleTO.setAccountPolicy(6L);
-
- roleTO.setInheritPasswordPolicy(true);
- // inherited so setter execution should be ignored
- roleTO.setPasswordPolicy(2L);
-
- roleTO.getRAttrTemplates().add("icon");
- roleTO.getPlainAttrs().add(attrTO("icon", "anIcon"));
-
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
- return roleTO;
- }
-
- @Test
- public void createWithException() {
- RoleTO newRoleTO = new RoleTO();
- newRoleTO.getPlainAttrs().add(attrTO("attr1", "value1"));
-
- try {
- createRole(newRoleTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidRole, e.getType());
- }
- }
-
- @Test
- @Ignore
- public void create() {
- RoleTO roleTO = buildRoleTO("lastRole");
- roleTO.getRVirAttrTemplates().add("rvirtualdata");
- roleTO.getVirAttrs().add(attrTO("rvirtualdata", "rvirtualvalue"));
- roleTO.setRoleOwner(8L);
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
-
- assertNotNull(roleTO.getVirAttrMap());
- assertNotNull(roleTO.getVirAttrMap().get("rvirtualdata").getValues());
- assertFalse(roleTO.getVirAttrMap().get("rvirtualdata").getValues().isEmpty());
- assertEquals("rvirtualvalue", roleTO.getVirAttrMap().get("rvirtualdata").getValues().get(0));
-
- assertNotNull(roleTO.getAccountPolicy());
- assertEquals(6L, (long) roleTO.getAccountPolicy());
-
- assertNotNull(roleTO.getPasswordPolicy());
- assertEquals(4L, (long) roleTO.getPasswordPolicy());
-
- assertTrue(roleTO.getResources().contains(RESOURCE_NAME_LDAP));
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getKey());
- assertNotNull(connObjectTO);
- assertNotNull(connObjectTO.getPlainAttrMap().get("owner"));
-
- // SYNCOPE-515: remove ownership
- final RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.setRoleOwner(new ReferenceMod());
-
- assertNull(updateRole(roleMod).getRoleOwner());
- }
-
- @Test
- public void createWithPasswordPolicy() {
- RoleTO roleTO = new RoleTO();
- roleTO.setName("roleWithPassword" + getUUIDString());
- roleTO.setParent(8L);
- roleTO.setPasswordPolicy(4L);
-
- RoleTO actual = createRole(roleTO);
- assertNotNull(actual);
-
- actual = roleService.read(actual.getKey());
- assertNotNull(actual);
- assertNotNull(actual.getPasswordPolicy());
- assertEquals(4L, (long) actual.getPasswordPolicy());
- }
-
- @Test
- public void delete() {
- try {
- roleService.delete(0L);
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
-
- RoleTO roleTO = new RoleTO();
- roleTO.setName("toBeDeleted" + getUUIDString());
- roleTO.setParent(8L);
-
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
-
- RoleTO deletedRole = deleteRole(roleTO.getKey());
- assertNotNull(deletedRole);
-
- try {
- roleService.read(deletedRole.getKey());
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void list() {
- PagedResult<RoleTO> roleTOs = roleService.list();
- assertNotNull(roleTOs);
- assertTrue(roleTOs.getResult().size() >= 8);
- for (RoleTO roleTO : roleTOs.getResult()) {
- assertNotNull(roleTO);
- }
- }
-
- @Test
- public void parent() {
- RoleTO roleTO = roleService.parent(7L);
-
- assertNotNull(roleTO);
- assertEquals(roleTO.getKey(), 6L);
- }
-
- @Test
- public void read() {
- RoleTO roleTO = roleService.read(1L);
-
- assertNotNull(roleTO);
- assertNotNull(roleTO.getPlainAttrs());
- assertFalse(roleTO.getPlainAttrs().isEmpty());
- }
-
- @Test
- public void selfRead() {
- UserTO userTO = userService.read(1L);
- assertNotNull(userTO);
-
- assertTrue(userTO.getMembershipMap().containsKey(1L));
- assertFalse(userTO.getMembershipMap().containsKey(3L));
-
- RoleService roleService2 = clientFactory.create("rossini", ADMIN_PWD).getService(RoleService.class);
-
- try {
- roleService2.readSelf(3L);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.UnauthorizedRole, e.getType());
- }
-
- RoleTO roleTO = roleService2.readSelf(1L);
- assertNotNull(roleTO);
- assertNotNull(roleTO.getPlainAttrs());
- assertFalse(roleTO.getPlainAttrs().isEmpty());
- }
-
- @Test
- public void update() {
- RoleTO roleTO = buildRoleTO("latestRole" + getUUIDString());
- roleTO.getRAttrTemplates().add("show");
- roleTO = createRole(roleTO);
-
- assertEquals(1, roleTO.getPlainAttrs().size());
-
- assertNotNull(roleTO.getAccountPolicy());
- assertEquals(6L, (long) roleTO.getAccountPolicy());
-
- assertNotNull(roleTO.getPasswordPolicy());
- assertEquals(4L, (long) roleTO.getPasswordPolicy());
-
- RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- String modName = "finalRole" + getUUIDString();
- roleMod.setName(modName);
- roleMod.getPlainAttrsToUpdate().add(attrMod("show", "FALSE"));
-
- // change password policy inheritance
- roleMod.setInheritPasswordPolicy(Boolean.FALSE);
-
- roleTO = updateRole(roleMod);
-
- assertEquals(modName, roleTO.getName());
- assertEquals(2, roleTO.getPlainAttrs().size());
-
- // changes ignored because not requested (null ReferenceMod)
- assertNotNull(roleTO.getAccountPolicy());
- assertEquals(6L, (long) roleTO.getAccountPolicy());
-
- // password policy null because not inherited
- assertNull(roleTO.getPasswordPolicy());
- }
-
- @Test
- public void updateRemovingVirAttribute() {
- RoleTO roleTO = buildBasicRoleTO("withvirtual" + getUUIDString());
- roleTO.getRVirAttrTemplates().add("rvirtualdata");
- roleTO.getVirAttrs().add(attrTO("rvirtualdata", null));
-
- roleTO = createRole(roleTO);
-
- assertNotNull(roleTO);
- assertEquals(1, roleTO.getVirAttrs().size());
-
- final RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.getVirAttrsToRemove().add("rvirtualdata");
-
- roleTO = updateRole(roleMod);
- assertNotNull(roleTO);
- assertTrue(roleTO.getVirAttrs().isEmpty());
- }
-
- @Test
- public void updateRemovingDerAttribute() {
- RoleTO roleTO = buildBasicRoleTO("withderived" + getUUIDString());
- roleTO.getRDerAttrTemplates().add("rderivedschema");
- roleTO.getDerAttrs().add(attrTO("rderivedschema", null));
-
- roleTO = createRole(roleTO);
-
- assertNotNull(roleTO);
- assertEquals(1, roleTO.getDerAttrs().size());
-
- final RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.getDerAttrsToRemove().add("rderivedschema");
-
- roleTO = updateRole(roleMod);
- assertNotNull(roleTO);
- assertTrue(roleTO.getDerAttrs().isEmpty());
- }
-
- @Test
- public void updateAsRoleOwner() {
- // 1. read role as admin
- RoleTO roleTO = roleService.read(7L);
-
- // issue SYNCOPE-15
- assertNotNull(roleTO.getCreationDate());
- assertNotNull(roleTO.getLastChangeDate());
- assertEquals("admin", roleTO.getCreator());
- assertEquals("admin", roleTO.getLastModifier());
-
- // 2. prepare update
- RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.setName("Managing Director");
-
- // 3. try to update as verdi, not owner of role 7 - fail
- RoleService roleService2 = clientFactory.create("verdi", ADMIN_PWD).getService(RoleService.class);
-
- try {
- roleService2.update(roleMod.getKey(), roleMod);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.UNAUTHORIZED, e.getType().getResponseStatus());
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- // 4. update as puccini, owner of role 7 because owner of role 6 with inheritance - success
- RoleService roleService3 = clientFactory.create("puccini", ADMIN_PWD).getService(RoleService.class);
-
- roleTO = roleService3.update(roleMod.getKey(), roleMod).readEntity(RoleTO.class);
- assertEquals("Managing Director", roleTO.getName());
-
- // issue SYNCOPE-15
- assertNotNull(roleTO.getCreationDate());
- assertNotNull(roleTO.getLastChangeDate());
- assertEquals("admin", roleTO.getCreator());
- assertEquals("puccini", roleTO.getLastModifier());
- assertTrue(roleTO.getCreationDate().before(roleTO.getLastChangeDate()));
- }
-
- /**
- * Role rename used to fail in case of parent null.
- *
- * http://code.google.com/p/syncope/issues/detail?id=178
- */
- @Test
- public void issue178() {
- RoleTO roleTO = new RoleTO();
- String roleName = "torename" + getUUIDString();
- roleTO.setName(roleName);
-
- RoleTO actual = createRole(roleTO);
-
- assertNotNull(actual);
- assertEquals(roleName, actual.getName());
- assertEquals(0L, actual.getParent());
-
- RoleMod roleMod = new RoleMod();
- roleMod.setKey(actual.getKey());
- String renamedRole = "renamed" + getUUIDString();
- roleMod.setName(renamedRole);
-
- actual = updateRole(roleMod);
- assertNotNull(actual);
- assertEquals(renamedRole, actual.getName());
- assertEquals(0L, actual.getParent());
- }
-
- @Test
- public void issueSYNCOPE228() {
- RoleTO roleTO = buildRoleTO("issueSYNCOPE228");
- roleTO.getEntitlements().add("USER_READ");
- roleTO.getEntitlements().add("SCHEMA_READ");
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
- assertNotNull(roleTO.getEntitlements());
- assertFalse(roleTO.getEntitlements().isEmpty());
-
- List<String> entitlements = roleTO.getEntitlements();
-
- RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.setInheritDerAttrs(Boolean.TRUE);
-
- roleTO = updateRole(roleMod);
- assertNotNull(roleTO);
- assertEquals(entitlements, roleTO.getEntitlements());
-
- roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.setModEntitlements(true);
- roleMod.getEntitlements().clear();
-
- roleTO = updateRole(roleMod);
- assertNotNull(roleTO);
- assertTrue(roleTO.getEntitlements().isEmpty());
- }
-
- @Test
- public void unlink() {
- RoleTO actual = createRole(buildRoleTO("unlink"));
- assertNotNull(actual);
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
-
- assertNotNull(roleService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.UNLINK,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
- }
-
- @Test
- public void link() {
- RoleTO roleTO = buildRoleTO("link");
- roleTO.getResources().clear();
-
- RoleTO actual = createRole(roleTO);
- assertNotNull(actual);
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- assertNotNull(roleService.bulkAssociation(actual.getKey(),
- ResourceAssociationActionType.LINK,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertFalse(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void unassign() {
- RoleTO actual = createRole(buildRoleTO("unassign"));
- assertNotNull(actual);
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
-
- assertNotNull(roleService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.UNASSIGN,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void assign() {
- RoleTO roleTO = buildRoleTO("assign");
- roleTO.getResources().clear();
-
- RoleTO actual = createRole(roleTO);
- assertNotNull(actual);
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- assertNotNull(roleService.bulkAssociation(actual.getKey(),
- ResourceAssociationActionType.ASSIGN,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertFalse(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
- }
-
- @Test
- public void deprovision() {
- RoleTO actual = createRole(buildRoleTO("deprovision"));
- assertNotNull(actual);
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
-
- assertNotNull(roleService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.DEPROVISION,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertNotNull(actual);
- assertFalse(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void provision() {
- RoleTO roleTO = buildRoleTO("assign");
- roleTO.getResources().clear();
-
- RoleTO actual = createRole(roleTO);
- assertNotNull(actual);
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- assertNotNull(roleService.bulkAssociation(actual.getKey(),
- ResourceAssociationActionType.PROVISION,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertTrue(actual.getResources().isEmpty());
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
- }
-
- @Test
- public void deprovisionUnlinked() {
- RoleTO roleTO = buildRoleTO("assign");
- roleTO.getResources().clear();
-
- RoleTO actual = createRole(roleTO);
- assertNotNull(actual);
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- assertNotNull(roleService.bulkAssociation(actual.getKey(),
- ResourceAssociationActionType.PROVISION,
- CollectionWrapper.wrap("resource-ldap", ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertTrue(actual.getResources().isEmpty());
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
-
- assertNotNull(roleService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.DEPROVISION,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = roleService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void createWithMandatorySchemaNotTemplate() {
- // 1. create a role mandatory schema
- PlainSchemaTO badge = new PlainSchemaTO();
- badge.setKey("badge");
- badge.setMandatoryCondition("true");
- schemaService.create(AttributableType.ROLE, SchemaType.PLAIN, badge);
-
- // 2. create a role *without* an attribute for that schema: it works
- RoleTO roleTO = buildRoleTO("lastRole");
- assertFalse(roleTO.getPlainAttrMap().containsKey(badge.getKey()));
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
- assertFalse(roleTO.getPlainAttrMap().containsKey(badge.getKey()));
-
- // 3. add a template for badge to the role just created -
- // failure since no values are provided and it is mandatory
- RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.setModRAttrTemplates(true);
- roleMod.getRPlainAttrTemplates().add("badge");
-
- try {
- updateRole(roleMod);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
-
- // 4. also add an actual attribute for badge - it will work
- roleMod.getPlainAttrsToUpdate().add(attrMod(badge.getKey(), "xxxxxxxxxx"));
-
- roleTO = updateRole(roleMod);
- assertNotNull(roleTO);
- assertTrue(roleTO.getPlainAttrMap().containsKey(badge.getKey()));
- }
-
- @Test
- public void anonymous() {
- RoleService unauthenticated = clientFactory.createAnonymous().getService(RoleService.class);
- try {
- unauthenticated.list();
- fail();
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- RoleService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).getService(RoleService.class);
- assertFalse(anonymous.list().getResult().isEmpty());
- }
-
- @Test
- public void noContent() throws IOException {
- SyncopeClient noContentclient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
- RoleService noContentService = noContentclient.prefer(RoleService.class, Preference.RETURN_NO_CONTENT);
-
- RoleTO role = buildRoleTO("noContent");
-
- Response response = noContentService.create(role);
- assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
-
- role = getObject(response.getLocation(), RoleService.class, RoleTO.class);
- assertNotNull(role);
-
- RoleMod roleMod = new RoleMod();
- roleMod.getPlainAttrsToUpdate().add(attrMod("badge", "xxxxxxxxxx"));
-
- response = noContentService.update(role.getKey(), roleMod);
- assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
-
- response = noContentService.delete(role.getKey());
- assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
- }
-
- @Test
- public void issueSYNCOPE455() {
- final String parentName = "issueSYNCOPE455-PRole";
- final String childName = "issueSYNCOPE455-CRole";
-
- // 1. create parent role
- RoleTO parent = buildBasicRoleTO(parentName);
- parent.getResources().add(RESOURCE_NAME_LDAP);
-
- parent = createRole(parent);
- assertTrue(parent.getResources().contains(RESOURCE_NAME_LDAP));
-
- final ConnObjectTO parentRemoteObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, parent.getKey());
- assertNotNull(parentRemoteObject);
- assertNotNull(getLdapRemoteObject(parentRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
-
- // 2. create child role
- RoleTO child = buildBasicRoleTO(childName);
- child.getResources().add(RESOURCE_NAME_LDAP);
- child.setParent(parent.getKey());
-
- child = createRole(child);
- assertTrue(child.getResources().contains(RESOURCE_NAME_LDAP));
-
- final ConnObjectTO childRemoteObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, child.getKey());
- assertNotNull(childRemoteObject);
- assertNotNull(getLdapRemoteObject(childRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
-
- // 3. remove parent role
- roleService.delete(parent.getKey());
-
- // 4. asserts for issue 455
- try {
- roleService.read(parent.getKey());
- fail();
- } catch (SyncopeClientException scce) {
- assertNotNull(scce);
- }
-
- try {
- roleService.read(child.getKey());
- fail();
- } catch (SyncopeClientException scce) {
- assertNotNull(scce);
- }
-
- assertNull(getLdapRemoteObject(parentRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
- assertNull(getLdapRemoteObject(childRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
- }
-
- @Test
- public void issueSYNCOPE543() {
- final String ancestorName = "issueSYNCOPE543-ARole";
- final String parentName = "issueSYNCOPE543-PRole";
- final String childName = "issueSYNCOPE543-CRole";
-
- // 1. create ancestor role
- RoleTO ancestor = buildBasicRoleTO(ancestorName);
- ancestor.setParent(0L);
- ancestor.getRAttrTemplates().add("icon");
- ancestor.getPlainAttrs().add(attrTO("icon", "ancestorIcon"));
- ancestor = createRole(ancestor);
- assertEquals("ancestorIcon", ancestor.getPlainAttrMap().get("icon").getValues().get(0));
-
- // 2. create parent role
- RoleTO parent = buildBasicRoleTO(parentName);
- parent.setParent(ancestor.getKey());
- parent.getRAttrTemplates().add("icon");
- parent.getPlainAttrs().add(attrTO("icon", "parentIcon"));
- parent = createRole(parent);
- assertEquals("parentIcon", parent.getPlainAttrMap().get("icon").getValues().get(0));
-
- // 3. create child role
- RoleTO child = buildBasicRoleTO(childName);
- child.setParent(parent.getKey());
- child.getRAttrTemplates().add("icon");
- child.getPlainAttrs().add(attrTO("icon", "childIcon"));
- child = createRole(child);
- assertEquals("childIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
-
- final RoleMod roleChildMod = new RoleMod();
- roleChildMod.setKey(child.getKey());
- roleChildMod.setInheritPlainAttrs(Boolean.TRUE);
- updateRole(roleChildMod);
-
- child = roleService.read(child.getKey());
- assertNotNull(child);
- assertNotNull(child.getPlainAttrMap().get("icon").getValues());
- assertEquals("parentIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
-
- final RoleMod roleParentMod = new RoleMod();
- roleParentMod.setKey(parent.getKey());
- roleParentMod.setInheritPlainAttrs(Boolean.TRUE);
- updateRole(roleParentMod);
-
- child = roleService.read(child.getKey());
- assertNotNull(child);
- assertNotNull(child.getPlainAttrMap().get("icon").getValues());
- assertEquals("ancestorIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
-
- parent = roleService.read(parent.getKey());
- assertNotNull(parent);
- assertNotNull(parent.getPlainAttrMap().get("icon").getValues());
- assertEquals("ancestorIcon", parent.getPlainAttrMap().get("icon").getValues().get(0));
-
- roleParentMod.setInheritPlainAttrs(Boolean.FALSE);
- updateRole(roleParentMod);
-
- child = roleService.read(child.getKey());
- assertNotNull(child);
- assertNotNull(child.getPlainAttrMap().get("icon").getValues());
- assertEquals("parentIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
- }
-
- @Test
- public void issueSYNCOPE632() {
- RoleTO roleTO = null;
- try {
- // 1. create new LDAP resource having account id mapped to a derived attribute
- ResourceTO newLDAP = resourceService.read(RESOURCE_NAME_LDAP);
- newLDAP.setKey("new-ldap");
- newLDAP.setPropagationPrimary(true);
- MappingItemTO accountId = newLDAP.getRmapping().getAccountIdItem();
- accountId.setIntMappingType(IntMappingType.RoleDerivedSchema);
- accountId.setIntAttrName("displayProperty");
- newLDAP.getRmapping().setAccountIdItem(accountId);
- newLDAP.getRmapping().setAccountLink("'cn=' + displayProperty + ',ou=groups,o=isp'");
-
- MappingItemTO description = new MappingItemTO();
- description.setIntMappingType(IntMappingType.RoleId);
- description.setExtAttrName("description");
- description.setPurpose(MappingPurpose.BOTH);
- newLDAP.getRmapping().addItem(description);
-
- newLDAP = createResource(newLDAP);
- assertNotNull(newLDAP);
-
- // 2. create a role and give the resource created above
- roleTO = buildRoleTO("lastRole");
- roleTO.getRAttrTemplates().add("icon");
- roleTO.getPlainAttrs().add(attrTO("icon", "anIcon"));
- roleTO.getRAttrTemplates().add("show");
- roleTO.getPlainAttrs().add(attrTO("show", "true"));
- roleTO.getRDerAttrTemplates().add("displayProperty");
- roleTO.getDerAttrs().add(attrTO("displayProperty", null));
- roleTO.getResources().clear();
- roleTO.getResources().add("new-ldap");
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
-
- // 3. update the role
- RoleMod roleMod = new RoleMod();
- roleMod.setKey(roleTO.getKey());
- roleMod.getPlainAttrsToRemove().add("icon");
- roleMod.getPlainAttrsToUpdate().add(attrMod("icon", "anotherIcon"));
-
- roleTO = updateRole(roleMod);
- assertNotNull(roleTO);
-
- // 4. check that a single group exists in LDAP for the role created and updated above
- int entries = 0;
- DirContext ctx = null;
- try {
- ctx = getLdapResourceDirContext(null, null);
-
- SearchControls ctls = new SearchControls();
- ctls.setReturningAttributes(new String[] { "*", "+" });
- ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
-
- NamingEnumeration<SearchResult> result =
- ctx.search("ou=groups,o=isp", "(description=" + roleTO.getKey() + ")", ctls);
- while (result.hasMore()) {
- result.next();
- entries++;
- }
- } catch (Exception e) {
- // ignore
- } finally {
- if (ctx != null) {
- try {
- ctx.close();
- } catch (NamingException e) {
- // ignore
- }
- }
- }
-
- assertEquals(1, entries);
- } finally {
- if (roleTO != null) {
- roleService.delete(roleTO.getKey());
- }
- resourceService.delete("new-ldap");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java
deleted file mode 100644
index 424ca08..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java
+++ /dev/null
@@ -1,107 +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.fit.server.reference;
-
-import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
-import static org.apache.syncope.fit.server.reference.AbstractTaskITCase.SCHED_TASK_ID;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.PushTaskTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
-import org.apache.syncope.common.lib.to.SyncTaskTO;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.rest.api.service.TaskService;
-import org.apache.syncope.server.provisioning.api.job.SyncJob;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class SchedTaskITCase extends AbstractTaskITCase {
-
- @Test
- public void getJobClasses() {
- List<String> jobClasses = syncopeService.info().getTaskJobs();
- assertNotNull(jobClasses);
- assertFalse(jobClasses.isEmpty());
- }
-
- @Test
- public void list() {
- final PagedResult<SchedTaskTO> tasks = taskService.list(TaskType.SCHEDULED);
- assertFalse(tasks.getResult().isEmpty());
- for (AbstractTaskTO task : tasks.getResult()) {
- if (!(task instanceof SchedTaskTO) || task instanceof SyncTaskTO || task instanceof PushTaskTO) {
- fail();
- }
- }
- }
-
- @Test
- public void update() {
- SchedTaskTO task = taskService.read(SCHED_TASK_ID);
- assertNotNull(task);
-
- final SchedTaskTO taskMod = new SchedTaskTO();
- taskMod.setKey(5);
- taskMod.setCronExpression(null);
-
- taskService.update(taskMod.getKey(), taskMod);
- SchedTaskTO actual = taskService.read(taskMod.getKey());
- assertNotNull(actual);
- assertEquals(task.getKey(), actual.getKey());
- assertNull(actual.getCronExpression());
- }
-
- @Test
- public void issueSYNCOPE144() {
- SchedTaskTO task = new SchedTaskTO();
- task.setName("issueSYNCOPE144");
- task.setDescription("issueSYNCOPE144 Description");
- task.setJobClassName(SyncJob.class.getName());
-
- Response response = taskService.create(task);
- SchedTaskTO actual = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
- assertNotNull(actual);
- assertEquals("issueSYNCOPE144", actual.getName());
- assertEquals("issueSYNCOPE144 Description", actual.getDescription());
-
- task = taskService.read(actual.getKey());
- assertNotNull(task);
- assertEquals("issueSYNCOPE144", task.getName());
- assertEquals("issueSYNCOPE144 Description", task.getDescription());
-
- task.setName("issueSYNCOPE144_2");
- task.setDescription("issueSYNCOPE144 Description_2");
-
- response = taskService.create(task);
- actual = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
- assertNotNull(actual);
- assertEquals("issueSYNCOPE144_2", actual.getName());
- assertEquals("issueSYNCOPE144 Description_2", actual.getDescription());
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java
deleted file mode 100644
index 57dfbb0..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SearchITCase.java
+++ /dev/null
@@ -1,182 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class SearchITCase extends AbstractITCase {
-
- @Test
- public void searchUser() {
- // LIKE
- PagedResult<UserTO> matchedUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().
- is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query());
- assertNotNull(matchedUsers);
- assertFalse(matchedUsers.getResult().isEmpty());
-
- for (UserTO user : matchedUsers.getResult()) {
- assertNotNull(user);
- }
-
- // ISNULL
- matchedUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().isNull("loginDate").query());
- assertNotNull(matchedUsers);
- assertFalse(matchedUsers.getResult().isEmpty());
-
- Set<Long> userIds = new HashSet<Long>(matchedUsers.getResult().size());
- for (UserTO user : matchedUsers.getResult()) {
- userIds.add(user.getKey());
- }
- assertTrue(userIds.contains(2L));
- assertTrue(userIds.contains(3L));
- }
-
- @Test
- public void searchByUsernameAndKey() {
- final PagedResult<UserTO> matchingUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().
- is("username").equalTo("rossini").and("key").lessThan(2).query());
-
- assertNotNull(matchingUsers);
- assertEquals(1, matchingUsers.getResult().size());
- assertEquals("rossini", matchingUsers.getResult().iterator().next().getUsername());
- assertEquals(1L, matchingUsers.getResult().iterator().next().getKey());
- }
-
- @Test
- public void searchByRolenameAndKey() {
- final PagedResult<RoleTO> matchingRoles = roleService.search(
- SyncopeClient.getRoleSearchConditionBuilder().
- is("name").equalTo("root").and("key").lessThan(2).query());
-
- assertNotNull(matchingRoles);
- assertEquals(1, matchingRoles.getResult().size());
- assertEquals("root", matchingRoles.getResult().iterator().next().getName());
- assertEquals(1L, matchingRoles.getResult().iterator().next().getKey());
- }
-
- @Test
- public void searchUserByResourceName() {
- PagedResult<UserTO> matchedUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().hasResources(RESOURCE_NAME_MAPPINGS2).query());
- assertNotNull(matchedUsers);
- assertFalse(matchedUsers.getResult().isEmpty());
-
- Set<Long> userIds = new HashSet<Long>(matchedUsers.getResult().size());
- for (UserTO user : matchedUsers.getResult()) {
- userIds.add(user.getKey());
- }
-
- assertEquals(1, userIds.size());
- assertTrue(userIds.contains(2L));
- }
-
- @Test
- public void paginatedSearch() {
- // LIKE
- PagedResult<UserTO> matchingUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().
- is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query(), 1, 2);
- assertNotNull(matchingUsers);
-
- assertFalse(matchingUsers.getResult().isEmpty());
- for (UserTO user : matchingUsers.getResult()) {
- assertNotNull(user);
- }
-
- // ISNULL
- matchingUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().isNull("loginDate").query(), 1, 2);
-
- assertNotNull(matchingUsers);
- assertFalse(matchingUsers.getResult().isEmpty());
- Set<Long> userIds = new HashSet<>(matchingUsers.getResult().size());
- for (UserTO user : matchingUsers.getResult()) {
- userIds.add(user.getKey());
- }
- assertEquals(2, userIds.size());
- }
-
- @Test
- public void searchByBooleanSubjectCond() {
- final PagedResult<RoleTO> matchingRoles = roleService.search(
- SyncopeClient.getRoleSearchConditionBuilder().is("inheritPlainAttrs").equalTo("true").query());
- assertNotNull(matchingRoles);
- assertFalse(matchingRoles.getResult().isEmpty());
- }
-
- @Test
- public void searchByEntitlement() {
- final PagedResult<RoleTO> matchingRoles = roleService.search(
- SyncopeClient.getRoleSearchConditionBuilder().hasEntitlements("USER_LIST", "USER_READ").query());
- assertNotNull(matchingRoles);
- assertFalse(matchingRoles.getResult().isEmpty());
- }
-
- @Test
- public void searchByRelationshipSubjectCond() {
- final PagedResult<RoleTO> matchingRoles = roleService.search(SyncopeClient.getRoleSearchConditionBuilder().
- isNotNull("passwordPolicy").and("userOwner").equalTo(5).query());
-
- assertNotNull(matchingRoles);
- assertEquals(1, matchingRoles.getResult().size());
- assertEquals("director", matchingRoles.getResult().iterator().next().getName());
- assertEquals(6L, matchingRoles.getResult().iterator().next().getKey());
- }
-
- @Test
- public void nested() {
- PagedResult<UserTO> matchedUsers = userService.search(
- "((fullname==*o*,fullname==*i*);$resources!=ws-target-resource-1)", 1, 2);
- assertNotNull(matchedUsers);
-
- assertFalse(matchedUsers.getResult().isEmpty());
- for (UserTO user : matchedUsers.getResult()) {
- assertNotNull(user);
- }
- }
-
- @Test
- public void orderBy() {
- final PagedResult<UserTO> matchedUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().is("userId").equalTo("*@apache.org").query(),
- SyncopeClient.getOrderByClauseBuilder().asc("status").desc("firstname").build());
-
- assertFalse(matchedUsers.getResult().isEmpty());
- for (UserTO user : matchedUsers.getResult()) {
- assertNotNull(user);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java
deleted file mode 100644
index da65d29..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SecurityQuestionITCase.java
+++ /dev/null
@@ -1,99 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.SecurityQuestionTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class SecurityQuestionITCase extends AbstractITCase {
-
- @Test
- public void read() {
- SecurityQuestionTO securityQuestionTO = securityQuestionService.read(1L);
- assertNotNull(securityQuestionTO);
- }
-
- @Test
- public void list() {
- List<SecurityQuestionTO> securityQuestionTOs = securityQuestionService.list();
- assertNotNull(securityQuestionTOs);
- assertFalse(securityQuestionTOs.isEmpty());
- for (SecurityQuestionTO instance : securityQuestionTOs) {
- assertNotNull(instance);
- }
- }
-
- @Test
- public void create() {
- SecurityQuestionTO securityQuestionTO = new SecurityQuestionTO();
- securityQuestionTO.setContent("What is your favorite pet's name?");
-
- Response response = securityQuestionService.create(securityQuestionTO);
- SecurityQuestionTO actual = getObject(response.getLocation(), SecurityQuestionService.class,
- SecurityQuestionTO.class);
-
- assertNotNull(actual);
- assertNotNull(actual.getKey());
- securityQuestionTO.setKey(actual.getKey());
- assertEquals(actual, securityQuestionTO);
- }
-
- @Test
- public void update() {
- SecurityQuestionTO securityQuestionTO = securityQuestionService.read(1L);
- securityQuestionTO.setContent("What is your favorite color?");
-
- securityQuestionService.update(securityQuestionTO.getKey(), securityQuestionTO);
- SecurityQuestionTO actual = securityQuestionService.read(securityQuestionTO.getKey());
- assertNotNull(actual);
- assertEquals(actual, securityQuestionTO);
- }
-
- @Test
- public void delete() {
- SecurityQuestionTO securityQuestion = new SecurityQuestionTO();
- securityQuestion.setContent("What is your first pet's name?");
-
- Response response = securityQuestionService.create(securityQuestion);
- securityQuestion = getObject(response.getLocation(), SecurityQuestionService.class, SecurityQuestionTO.class);
-
- securityQuestionService.delete(securityQuestion.getKey());
-
- try {
- securityQuestionService.read(securityQuestion.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
- }
-
-}
[36/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
new file mode 100644
index 0000000..7580f64
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
@@ -0,0 +1,641 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.status.AbstractStatusBeanProvider;
+import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
+import org.apache.syncope.client.console.commons.status.Status;
+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.ActionDataTablePanel;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+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.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.StringResourceModel;
+
+public class StatusModalPage<T extends AbstractSubjectTO> extends AbstractStatusModalPage {
+
+ private static final long serialVersionUID = -9148734710505211261L;
+
+ private final AbstractSubjectTO subjectTO;
+
+ private int rowsPerPage = 10;
+
+ final StatusUtils statusUtils;
+
+ final boolean statusOnly;
+
+ // --------------------------------
+ // password management fields ..
+ // --------------------------------
+ final ClearIndicatingAjaxButton cancel;
+
+ final WebMarkupContainer pwdMgt;
+
+ final Form<?> pwdMgtForm;
+
+ final AjaxCheckBoxPanel changepwd;
+
+ final PasswordTextField password;
+
+ final PasswordTextField confirm;
+ // --------------------------------
+
+ final PageReference pageRef;
+
+ final ModalWindow window;
+
+ final ActionDataTablePanel<StatusBean, String> table;
+
+ final List<IColumn<StatusBean, String>> columns;
+
+ public StatusModalPage(
+ final PageReference pageRef,
+ final ModalWindow window,
+ final AbstractSubjectTO attributableTO) {
+
+ this(pageRef, window, attributableTO, false);
+ }
+
+ public StatusModalPage(
+ final PageReference pageRef,
+ final ModalWindow window,
+ final AbstractSubjectTO subjectTO,
+ final boolean statusOnly) {
+
+ super();
+
+ this.pageRef = pageRef;
+ this.window = window;
+ this.statusOnly = statusOnly;
+ this.subjectTO = subjectTO;
+
+ statusUtils = new StatusUtils(subjectTO instanceof UserTO ? userRestClient : roleRestClient);
+
+ columns = new ArrayList<IColumn<StatusBean, String>>();
+ columns.add(new AbstractColumn<StatusBean, String>(
+ new StringResourceModel("resourceName", this, null, "Resource name"), "resourceName") {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public void populateItem(
+ final Item<ICellPopulator<StatusBean>> cellItem,
+ final String componentId,
+ final IModel<StatusBean> model) {
+
+ cellItem.add(new Label(componentId, model.getObject().getResourceName()) {
+
+ private static final long serialVersionUID = 8432079838783825801L;
+
+ @Override
+ protected void onComponentTag(final ComponentTag tag) {
+ if (model.getObject().isLinked()) {
+ super.onComponentTag(tag);
+ } else {
+ tag.put("style", "color: #DDDDDD");
+ }
+ }
+ });
+ }
+ });
+
+ columns.add(new PropertyColumn<StatusBean, String>(
+ new StringResourceModel("accountLink", this, null, "Account link"), "accountLink", "accountLink"));
+
+ columns.add(new AbstractColumn<StatusBean, String>(
+ new StringResourceModel("status", this, null, "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(
+ final Item<ICellPopulator<StatusBean>> cellItem,
+ final String componentId,
+ final IModel<StatusBean> model) {
+
+ if (model.getObject().isLinked()) {
+ cellItem.add(statusUtils.getStatusImagePanel(componentId, model.getObject().
+ getStatus()));
+ } else {
+ cellItem.add(new Label(componentId, ""));
+ }
+ }
+ });
+
+ table = new ActionDataTablePanel<StatusBean, String>(
+ "resourceDatatable",
+ columns,
+ (ISortableDataProvider<StatusBean, String>) new AttributableStatusProvider(),
+ rowsPerPage,
+ pageRef) {
+
+ private static final long serialVersionUID = 6510391461033818316L;
+
+ @Override
+ public boolean isElementEnabled(final StatusBean element) {
+ return !statusOnly || element.getStatus() != Status.OBJECT_NOT_FOUND;
+ }
+ };
+ table.setOutputMarkupId(true);
+
+ final String pageId = subjectTO instanceof RoleTO ? "Roles" : "Users";
+
+ final Fragment pwdMgtFragment = new Fragment("pwdMgtFields", "pwdMgtFragment", this);
+ addOrReplace(pwdMgtFragment);
+
+ pwdMgt = new WebMarkupContainer("pwdMgt");
+ pwdMgtFragment.add(pwdMgt.setOutputMarkupId(true));
+
+ pwdMgtForm = new Form("pwdMgtForm");
+ pwdMgtForm.setVisible(false).setEnabled(false);
+ pwdMgt.add(pwdMgtForm);
+
+ password = new PasswordTextField("password", new Model<String>());
+ pwdMgtForm.add(password.setRequired(false).setEnabled(false));
+
+ confirm = new PasswordTextField("confirm", new Model<String>());
+ pwdMgtForm.add(confirm.setRequired(false).setEnabled(false));
+
+ changepwd = new AjaxCheckBoxPanel("changepwd", "changepwd", new Model<Boolean>(false));
+ pwdMgtForm.add(changepwd.setModelObject(false));
+ pwdMgtForm.add(new Label("changePwdLabel", new ResourceModel("changePwdLabel", "Password propagation")));
+
+ changepwd.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ password.setEnabled(changepwd.getModelObject());
+ confirm.setEnabled(changepwd.getModelObject());
+ target.add(pwdMgt);
+ }
+ });
+
+ cancel = new ClearIndicatingAjaxButton("cancel", new ResourceModel("cancel"), pageRef) {
+
+ private static final long serialVersionUID = -2341391430136818026L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ // ignore
+ window.close(target);
+ }
+ }.feedbackPanelAutomaticReload(false);
+
+ pwdMgtForm.add(cancel);
+
+ final ClearIndicatingAjaxButton goon =
+ new ClearIndicatingAjaxButton("continue", new ResourceModel("continue"), pageRef) {
+
+ private static final long serialVersionUID = -2341391430136818027L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ // none
+ }
+ };
+
+ pwdMgtForm.add(goon);
+
+ if (statusOnly) {
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ userRestClient.reactivate(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+
+ window.close(target);
+ } catch (Exception e) {
+ LOG.error("Error enabling resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.REACTIVATE, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ userRestClient.suspend(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ window.close(target);
+ } catch (Exception e) {
+ LOG.error("Error disabling resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.SUSPEND, pageId);
+ } else {
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ if (subjectTO instanceof UserTO) {
+ userRestClient.unlink(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ } else {
+ roleRestClient.unlink(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ }
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ window.close(target);
+ } catch (Exception e) {
+ LOG.error("Error unlinking resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.UNLINK, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ if (subjectTO instanceof UserTO) {
+ userRestClient.link(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ } else {
+ roleRestClient.link(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ }
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ window.close(target);
+ } catch (Exception e) {
+ LOG.error("Error linking resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.LINK, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ BulkActionResult bulkActionResult;
+ if (subjectTO instanceof UserTO) {
+ bulkActionResult = userRestClient.deprovision(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ } else {
+ bulkActionResult = roleRestClient.deprovision(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ }
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
+ } catch (Exception e) {
+ LOG.error("Error de-provisioning user", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.DEPROVISION, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ if (subjectTO instanceof UserTO) {
+ StatusModalPage.this.passwordManagement(
+ target, ResourceAssociationActionType.PROVISION, table.getModelObject());
+ } else {
+ try {
+ final BulkActionResult bulkActionResult = roleRestClient.provision(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
+ } catch (Exception e) {
+ LOG.error("Error provisioning user", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }
+ }.feedbackPanelAutomaticReload(!(subjectTO instanceof UserTO)), ActionLink.ActionType.PROVISION, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ final BulkActionResult bulkActionResult;
+ if (subjectTO instanceof UserTO) {
+ bulkActionResult = userRestClient.unassign(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ } else {
+ bulkActionResult = roleRestClient.unassign(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+ }
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
+ } catch (Exception e) {
+ LOG.error("Error unassigning resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.UNASSIGN, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (subjectTO instanceof UserTO) {
+ StatusModalPage.this.passwordManagement(
+ target, ResourceAssociationActionType.ASSIGN, table.getModelObject());
+ } else {
+ try {
+ final BulkActionResult bulkActionResult = roleRestClient.assign(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(table.getModelObject()));
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ loadBulkActionResultPage(table.getModelObject(), bulkActionResult);
+ } catch (Exception e) {
+ LOG.error("Error assigning resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }
+ }.feedbackPanelAutomaticReload(!(subjectTO instanceof UserTO)), ActionLink.ActionType.ASSIGN, pageId);
+ }
+
+ table.addCancelButton(window);
+ add(table);
+ }
+
+ private class AttributableStatusProvider extends AbstractStatusBeanProvider {
+
+ private static final long serialVersionUID = 4586969457669796621L;
+
+ public AttributableStatusProvider() {
+ super(statusOnly ? "resourceName" : "accountLink");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<StatusBean> getStatusBeans() {
+ final List<String> resources = new ArrayList<>();
+ for (ResourceTO resourceTO : resourceRestClient.getAll()) {
+ resources.add(resourceTO.getKey());
+ }
+
+ final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects(subjectTO);
+
+ final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
+
+ for (ConnObjectWrapper entry : connObjects) {
+ final StatusBean statusBean = statusUtils.getStatusBean(
+ subjectTO,
+ entry.getResourceName(),
+ entry.getConnObjectTO(),
+ subjectTO instanceof RoleTO);
+
+ statusBeans.add(statusBean);
+ resources.remove(entry.getResourceName());
+ }
+
+ if (statusOnly) {
+ final StatusBean syncope = new StatusBean(subjectTO, "Syncope");
+
+ syncope.setAccountLink(((UserTO) subjectTO).getUsername());
+
+ Status syncopeStatus = Status.UNDEFINED;
+ if (((UserTO) subjectTO).getStatus() != null) {
+ try {
+ syncopeStatus = Status.valueOf(((UserTO) subjectTO).getStatus().toUpperCase());
+ } catch (IllegalArgumentException e) {
+ LOG.warn("Unexpected status found: {}", ((UserTO) subjectTO).getStatus(), e);
+ }
+ }
+ syncope.setStatus(syncopeStatus);
+
+ statusBeans.add(syncope);
+ } else {
+ for (String resource : resources) {
+ final StatusBean statusBean = statusUtils.getStatusBean(
+ subjectTO,
+ resource,
+ null,
+ subjectTO instanceof RoleTO);
+
+ statusBean.setLinked(false);
+ statusBeans.add(statusBean);
+ }
+ }
+
+ return statusBeans;
+ }
+ }
+
+ private void passwordManagement(
+ final AjaxRequestTarget target,
+ final ResourceAssociationActionType type,
+ final Collection<StatusBean> selection) {
+
+ final ClearIndicatingAjaxButton goon =
+ new ClearIndicatingAjaxButton("continue", new ResourceModel("continue", "Continue"), pageRef) {
+
+ private static final long serialVersionUID = -2341391430136818027L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ if (StringUtils.isNotBlank(password.getModelObject())
+ && !password.getModelObject().equals(confirm.getModelObject())) {
+ throw new Exception(getString("passwordMismatch"));
+ }
+
+ final BulkActionResult bulkActionResult;
+ switch (type) {
+ case ASSIGN:
+ bulkActionResult = userRestClient.assign(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(selection),
+ changepwd.getModelObject(),
+ password.getModelObject());
+ break;
+ case PROVISION:
+ bulkActionResult = userRestClient.provision(
+ subjectTO.getETagValue(),
+ subjectTO.getKey(),
+ new ArrayList<>(selection),
+ changepwd.getModelObject(),
+ password.getModelObject());
+ break;
+ default:
+ bulkActionResult = null;
+ // ignore
+ }
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+
+ if (bulkActionResult != null) {
+ loadBulkActionResultPage(selection, bulkActionResult);
+ } else {
+
+ target.add(((BasePage) pageRef.getPage()).getFeedbackPanel());
+ window.close(target);
+ }
+ } catch (Exception e) {
+ LOG.error("Error provisioning resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }.feedbackPanelAutomaticReload(false);
+
+ pwdMgtForm.addOrReplace(goon);
+
+ table.setVisible(false);
+ pwdMgtForm.setVisible(true).setEnabled(true);
+
+ target.add(table);
+ target.add(pwdMgt);
+ }
+
+ private void loadBulkActionResultPage(
+ final Collection<StatusBean> selection, final BulkActionResult bulkActionResult) {
+ final List<String> resources = new ArrayList<String>(selection.size());
+ for (StatusBean statusBean : selection) {
+ resources.add(statusBean.getResourceName());
+ }
+
+ final List<ConnObjectWrapper> connObjects =
+ statusUtils.getConnectorObjects(Collections.singletonList(subjectTO), resources);
+
+ final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size());
+
+ for (ConnObjectWrapper entry : connObjects) {
+ final StatusBean statusBean = statusUtils.getStatusBean(
+ subjectTO,
+ entry.getResourceName(),
+ entry.getConnObjectTO(),
+ subjectTO instanceof RoleTO);
+
+ statusBeans.add(statusBean);
+ }
+
+ setResponsePage(new BulkActionResultModalPage<StatusBean, String>(
+ window,
+ statusBeans,
+ columns,
+ bulkActionResult,
+ "resourceName"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SyncTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SyncTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SyncTaskModalPage.java
new file mode 100644
index 0000000..544f670
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SyncTaskModalPage.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.List;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.types.MatchingRule;
+import org.apache.syncope.common.lib.types.UnmatchingRule;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ * Modal window with Sync Task form.
+ */
+public class SyncTaskModalPage extends AbstractSyncTaskModalPage {
+
+ private static final long serialVersionUID = 2148403203517274669L;
+
+ public SyncTaskModalPage(final ModalWindow window, final SyncTaskTO taskTO, final PageReference pageRef) {
+
+ super(window, taskTO, pageRef);
+
+ // set default Matching rule
+ ((DropDownChoice) matchingRule.getField()).setDefaultModelObject(taskTO.getMatchingRule() == null
+ ? MatchingRule.UPDATE
+ : taskTO.getMatchingRule());
+ profile.add(matchingRule);
+
+ // set default Unmatching rule
+ ((DropDownChoice) unmatchingRule.getField()).setDefaultModelObject(taskTO.getUnmatchingRule() == null
+ ? UnmatchingRule.PROVISION
+ : taskTO.getUnmatchingRule());
+ profile.add(unmatchingRule);
+
+ final AjaxCheckBoxPanel fullReconciliation = new AjaxCheckBoxPanel("fullReconciliation",
+ getString("fullReconciliation"), new PropertyModel<Boolean>(taskTO, "fullReconciliation"));
+ profile.add(fullReconciliation);
+ }
+
+ @Override
+ protected List<String> getSyncActions() {
+ return taskRestClient.getSyncActionsClasses();
+ }
+
+ @Override
+ public void submitAction(final SchedTaskTO taskTO) {
+ if (taskTO.getKey() > 0) {
+ taskRestClient.updateSyncTask((SyncTaskTO) taskTO);
+ } else {
+ taskRestClient.createSyncTask((SyncTaskTO) taskTO);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
new file mode 100644
index 0000000..cd4e812
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/TaskModalPage.java
@@ -0,0 +1,257 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.springframework.util.StringUtils;
+
+/**
+ * Modal window with Task form (to stop and start execution).
+ */
+public abstract class TaskModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -4110576026663173545L;
+
+ protected WebMarkupContainer profile;
+
+ protected WebMarkupContainer executions;
+
+ protected Form<AbstractTaskTO> form;
+
+ public TaskModalPage(final AbstractTaskTO taskTO) {
+ final ModalWindow taskExecMessageWin = new ModalWindow("taskExecMessageWin");
+ taskExecMessageWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ taskExecMessageWin.setCookieName("task-exec-message-win-modal");
+ add(taskExecMessageWin);
+
+ form = new Form<AbstractTaskTO>(FORM);
+ form.setModel(new CompoundPropertyModel<AbstractTaskTO>(taskTO));
+ add(form);
+
+ profile = new WebMarkupContainer("profile");
+ profile.setOutputMarkupId(true);
+ form.add(profile);
+
+ executions = new WebMarkupContainer("executionContainer");
+ executions.setOutputMarkupId(true);
+ form.add(executions);
+
+ final Label idLabel = new Label("idLabel", new ResourceModel("id"));
+ profile.add(idLabel);
+
+ final AjaxTextFieldPanel id =
+ new AjaxTextFieldPanel("id", getString("id"), new PropertyModel<String>(taskTO, "id"));
+
+ id.setEnabled(false);
+ profile.add(id);
+
+ final List<IColumn<TaskExecTO, String>> columns = new ArrayList<IColumn<TaskExecTO, String>>();
+
+ final int paginatorRows = 10;
+
+ columns.add(new PropertyColumn<TaskExecTO, String>(new ResourceModel("id"), "id", "id"));
+
+ columns.add(new DatePropertyColumn<TaskExecTO>(new ResourceModel("startDate"), "startDate", "startDate"));
+
+ columns.add(new DatePropertyColumn<TaskExecTO>(new ResourceModel("endDate"), "endDate", "endDate"));
+
+ columns.add(new PropertyColumn<TaskExecTO, String>(new ResourceModel("status"), "status", "status"));
+
+ columns.add(new ActionColumn<TaskExecTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<TaskExecTO> model) {
+
+ final TaskExecTO taskExecutionTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ taskExecMessageWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ExecMessageModalPage(model.getObject().getMessage());
+ }
+ });
+ taskExecMessageWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, TASKS, StringUtils.hasText(model.getObject().getMessage()));
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ taskRestClient.deleteExecution(taskExecutionTO.getKey());
+
+ taskTO.getExecutions().remove(taskExecutionTO);
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ feedbackPanel.refresh(target);
+ target.add(executions);
+ }
+ }, ActionLink.ActionType.DELETE, TASKS);
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ final AjaxFallbackDefaultDataTable<TaskExecTO, String> currentTable =
+ new AjaxFallbackDefaultDataTable<TaskExecTO, String>("executionsTable", columns,
+ new TaskExecutionsProvider(getCurrentTaskExecution(taskTO)), paginatorRows);
+ currentTable.setOutputMarkupId(true);
+ target.add(currentTable);
+ executions.addOrReplace(currentTable);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ final AjaxFallbackDefaultDataTable<TaskExecTO, String> table =
+ new AjaxFallbackDefaultDataTable<TaskExecTO, String>("executionsTable", columns,
+ new TaskExecutionsProvider(getCurrentTaskExecution(taskTO)), paginatorRows);
+
+ executions.add(table);
+ }
+
+ protected static class TaskExecutionsProvider extends SortableDataProvider<TaskExecTO, String> {
+
+ private static final long serialVersionUID = 8943636537120648961L;
+
+ private SortableDataProviderComparator<TaskExecTO> comparator;
+
+ private AbstractTaskTO taskTO;
+
+ public TaskExecutionsProvider(final AbstractTaskTO taskTO) {
+ //Default sorting
+ this.taskTO = taskTO;
+ setSort("startDate", SortOrder.DESCENDING);
+ comparator = new SortableDataProviderComparator<TaskExecTO>(this);
+ }
+
+ @Override
+ public Iterator<TaskExecTO> iterator(final long first, final long count) {
+
+ List<TaskExecTO> list = taskTO.getExecutions();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return taskTO.getExecutions().size();
+ }
+
+ @Override
+ public IModel<TaskExecTO> model(final TaskExecTO taskExecution) {
+
+ return new AbstractReadOnlyModel<TaskExecTO>() {
+
+ private static final long serialVersionUID = 7485475149862342421L;
+
+ @Override
+ public TaskExecTO getObject() {
+ return taskExecution;
+ }
+ };
+ }
+ }
+
+ private AbstractTaskTO getCurrentTaskExecution(final AbstractTaskTO taskTO) {
+ final AbstractTaskTO currentTask = taskTO.getKey() == 0
+ ? taskTO
+ : taskTO instanceof PropagationTaskTO
+ ? taskRestClient.readPropagationTask(taskTO.getKey())
+ : taskTO instanceof NotificationTaskTO
+ ? taskRestClient.readNotificationTask(taskTO.getKey())
+ : taskTO instanceof SyncTaskTO
+ ? taskRestClient.readSchedTask(SyncTaskTO.class, taskTO.getKey())
+ : taskRestClient.readSchedTask(SchedTaskTO.class, taskTO.getKey());
+
+ taskTO.getExecutions().clear();
+ taskTO.getExecutions().addAll(currentTask.getExecutions());
+ return taskTO;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
new file mode 100644
index 0000000..948af72
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Tasks.java
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.AjaxDataTablePanel;
+import org.apache.syncope.client.console.panels.NotificationTasks;
+import org.apache.syncope.client.console.panels.PropagationTasks;
+import org.apache.syncope.client.console.panels.PushTasksPanel;
+import org.apache.syncope.client.console.panels.SchedTasks;
+import org.apache.syncope.client.console.panels.SyncTasksPanel;
+import org.apache.syncope.client.console.rest.BaseRestClient;
+import org.apache.syncope.client.console.rest.TaskRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+
+public class Tasks extends BasePage {
+
+ private static final long serialVersionUID = 5289215853622289061L;
+
+ public Tasks() {
+ super();
+
+ add(new PropagationTasks("propagation", getPageReference()));
+ add(new NotificationTasks("notification", getPageReference()));
+ add(new SchedTasks("sched", getPageReference()));
+ add(new SyncTasksPanel("sync", getPageReference()));
+ add(new PushTasksPanel("push", getPageReference()));
+
+ getPageReference();
+ }
+
+ @Override
+ public void setWindowClosedCallback(final ModalWindow window, final WebMarkupContainer container) {
+
+ super.setWindowClosedCallback(window, container);
+ }
+
+ public static class TaskExecutionsProvider extends SortableDataProvider<TaskExecTO, String> {
+
+ private static final long serialVersionUID = -5401263348984206145L;
+
+ private SortableDataProviderComparator<TaskExecTO> comparator;
+
+ private AbstractTaskTO taskTO;
+
+ public TaskExecutionsProvider(final AbstractTaskTO taskTO) {
+ super();
+
+ //Default sorting
+ this.taskTO = taskTO;
+ setSort("startDate", SortOrder.DESCENDING);
+ comparator = new SortableDataProviderComparator<TaskExecTO>(this);
+ }
+
+ @Override
+ public Iterator<TaskExecTO> iterator(final long first, final long count) {
+
+ List<TaskExecTO> list = getTaskDB();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return getTaskDB().size();
+ }
+
+ @Override
+ public IModel<TaskExecTO> model(final TaskExecTO taskExecution) {
+
+ return new AbstractReadOnlyModel<TaskExecTO>() {
+
+ private static final long serialVersionUID = 7485475149862342421L;
+
+ @Override
+ public TaskExecTO getObject() {
+ return taskExecution;
+ }
+ };
+ }
+
+ public List<TaskExecTO> getTaskDB() {
+ return taskTO.getExecutions();
+ }
+ }
+
+ public static class TasksProvider<T extends AbstractTaskTO> extends SortableDataProvider<T, String> {
+
+ private static final long serialVersionUID = -20112718133295756L;
+
+ private SortableDataProviderComparator<T> comparator;
+
+ private TaskRestClient restClient;
+
+ private int paginatorRows;
+
+ private String id;
+
+ private Class<T> reference;
+
+ public TasksProvider(
+ final TaskRestClient restClient, final int paginatorRows, final String id, final Class<T> reference) {
+
+ super();
+
+ //Default sorting
+ setSort("id", SortOrder.DESCENDING);
+ comparator = new SortableDataProviderComparator<T>(this);
+ this.paginatorRows = paginatorRows;
+ this.restClient = restClient;
+ this.id = id;
+ this.reference = reference;
+ }
+
+ @Override
+ public Iterator<T> iterator(final long first, final long count) {
+ final List<T> tasks = new ArrayList<T>();
+
+ final int page = ((int) first / paginatorRows);
+
+ for (T task : restClient.list(reference, (page < 0 ? 0 : page) + 1, paginatorRows, getSort())) {
+ if (task instanceof SchedTaskTO && ((SchedTaskTO) task).getLastExec() == null
+ && task.getExecutions() != null && !task.getExecutions().isEmpty()) {
+
+ Collections.sort(task.getExecutions(), new Comparator<TaskExecTO>() {
+
+ @Override
+ public int compare(final TaskExecTO left, final TaskExecTO right) {
+ return left.getStartDate().compareTo(right.getStartDate());
+ }
+ });
+
+ ((SchedTaskTO) task).setLastExec(task.getExecutions().get(task.getExecutions().size() - 1).
+ getStartDate());
+ }
+ tasks.add(task);
+ }
+
+ Collections.sort(tasks, comparator);
+ return tasks.iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.count(id);
+ }
+
+ @Override
+ public IModel<T> model(final T object) {
+ return new CompoundPropertyModel<T>(object);
+ }
+ }
+
+ /**
+ * Update task table.
+ *
+ * @param columns columns.
+ * @param dataProvider data provider.
+ * @param container container.
+ * @param currentPage current page index.
+ * @param pageRef page reference
+ * @param restClient syncope base rest client
+ * @return data table.
+ */
+ public static AjaxDataTablePanel<AbstractTaskTO, String> updateTaskTable(
+ final List<IColumn<AbstractTaskTO, String>> columns,
+ final TasksProvider<? extends AbstractTaskTO> dataProvider,
+ final WebMarkupContainer container,
+ final int currentPage,
+ final PageReference pageRef,
+ final BaseRestClient restClient) {
+
+ @SuppressWarnings("unchecked")
+ final AjaxDataTablePanel<AbstractTaskTO, String> table = new AjaxDataTablePanel<AbstractTaskTO, String>(
+ "datatable",
+ columns,
+ (ISortableDataProvider<AbstractTaskTO, String>) dataProvider,
+ dataProvider.paginatorRows,
+ Arrays.asList(new ActionLink.ActionType[] {
+ ActionLink.ActionType.DELETE, ActionLink.ActionType.DRYRUN, ActionLink.ActionType.EXECUTE }),
+ restClient,
+ "id",
+ TASKS,
+ pageRef);
+
+ table.setCurrentPage(currentPage);
+ table.setOutputMarkupId(true);
+
+ container.addOrReplace(table);
+
+ return table;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Todo.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Todo.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Todo.java
new file mode 100644
index 0000000..1329fe4
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Todo.java
@@ -0,0 +1,245 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.rest.ApprovalRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class Todo extends BasePage {
+
+ private static final long serialVersionUID = -7122136682275797903L;
+
+ @SpringBean
+ private ApprovalRestClient restClient;
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private final ModalWindow window;
+
+ private static final int WIN_HEIGHT = 400;
+
+ private static final int WIN_WIDTH = 600;
+
+ private WebMarkupContainer container;
+
+ private int paginatorRows;
+
+ public Todo(final PageParameters parameters) {
+ super(parameters);
+
+ add(window = new ModalWindow("editApprovalWin"));
+
+ container = new WebMarkupContainer("approvalContainer");
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ container, RENDER, xmlRolesReader.getEntitlement("Approval", "list"));
+
+ paginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_TODO_PAGINATOR_ROWS);
+
+ List<IColumn<WorkflowFormTO, String>> columns = new ArrayList<IColumn<WorkflowFormTO, String>>();
+ columns.add(new PropertyColumn<WorkflowFormTO, String>(
+ new ResourceModel("taskId"), "taskId", "taskId"));
+ columns.add(new PropertyColumn<WorkflowFormTO, String>(
+ new ResourceModel("key"), "key", "key"));
+ columns.add(new PropertyColumn<WorkflowFormTO, String>(
+ new ResourceModel("description"), "description", "description"));
+ columns.add(new DatePropertyColumn<WorkflowFormTO>(
+ new ResourceModel("createTime"), "createTime", "createTime"));
+ columns.add(new DatePropertyColumn<WorkflowFormTO>(
+ new ResourceModel("dueDate"), "dueDate", "dueDate"));
+ columns.add(new PropertyColumn<WorkflowFormTO, String>(new ResourceModel("owner"), "owner", "owner"));
+ columns.add(new AbstractColumn<WorkflowFormTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<WorkflowFormTO>> cellItem, final String componentId,
+ final IModel<WorkflowFormTO> model) {
+
+ final WorkflowFormTO formTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.claimForm(formTO.getTaskId());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scee) {
+ error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ }
+ feedbackPanel.refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.CLAIM, "Approval");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ApprovalModalPage(Todo.this.getPageReference(), window, formTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Approval",
+ SyncopeSession.get().getUsername().equals(formTO.getOwner()));
+
+ cellItem.add(panel);
+ }
+ });
+
+ final AjaxFallbackDefaultDataTable<WorkflowFormTO, String> approvalTable =
+ new AjaxFallbackDefaultDataTable<WorkflowFormTO, String>(
+ "approvalTable", columns, new ApprovalProvider(), paginatorRows);
+ container.add(approvalTable);
+
+ container.setOutputMarkupId(true);
+ add(container);
+
+ @SuppressWarnings("rawtypes")
+ Form approvalPaginatorForm = new Form("paginatorForm");
+
+ MetaDataRoleAuthorizationStrategy.authorize(approvalPaginatorForm, RENDER,
+ xmlRolesReader.getEntitlement("Approval", "list"));
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser",
+ new PropertyModel(this, "paginatorRows"), prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_TODO_PAGINATOR_ROWS,
+ String.valueOf(paginatorRows));
+ approvalTable.setItemsPerPage(paginatorRows);
+
+ target.add(container);
+ }
+ });
+
+ approvalPaginatorForm.add(rowsChooser);
+ add(approvalPaginatorForm);
+
+ window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ window.setInitialHeight(WIN_HEIGHT);
+ window.setInitialWidth(WIN_WIDTH);
+ window.setCookieName("edit-approval-modal");
+
+ setWindowClosedCallback(window, container);
+ }
+
+ private class ApprovalProvider extends SortableDataProvider<WorkflowFormTO, String> {
+
+ private static final long serialVersionUID = -2311716167583335852L;
+
+ private final SortableDataProviderComparator<WorkflowFormTO> comparator;
+
+ public ApprovalProvider() {
+ super();
+ //Default sorting
+ setSort("key", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<WorkflowFormTO>(this);
+ }
+
+ @Override
+ public Iterator<WorkflowFormTO> iterator(final long first, final long count) {
+ final List<WorkflowFormTO> list = restClient.getForms();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.getForms().size();
+ }
+
+ @Override
+ public IModel<WorkflowFormTO> model(final WorkflowFormTO configuration) {
+ return new AbstractReadOnlyModel<WorkflowFormTO>() {
+
+ private static final long serialVersionUID = -2566070996511906708L;
+
+ @Override
+ public WorkflowFormTO getObject() {
+ return configuration;
+ }
+ };
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
new file mode 100644
index 0000000..7319c38
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserModalPage.java
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.panels.DerAttrsPanel;
+import org.apache.syncope.client.console.panels.MembershipsPanel;
+import org.apache.syncope.client.console.panels.PlainAttrsPanel;
+import org.apache.syncope.client.console.panels.ResourcesPanel;
+import org.apache.syncope.client.console.panels.SecurityQuestionPanel;
+import org.apache.syncope.client.console.panels.UserDetailsPanel;
+import org.apache.syncope.client.console.panels.VirAttrsPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Modal window with User form.
+ */
+public abstract class UserModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 5002005009737457667L;
+
+ protected final PageReference pageRef;
+
+ protected final ModalWindow window;
+
+ protected UserTO userTO;
+
+ protected final Mode mode;
+
+ private Fragment fragment = null;
+
+ private final boolean resetPassword;
+
+ protected final AjaxCheckBoxPanel storePassword;
+
+ public UserModalPage(final PageReference callerPageRef, final ModalWindow window, final UserTO userTO,
+ final Mode mode, final boolean resetPassword) {
+
+ super();
+
+ this.pageRef = callerPageRef;
+ this.window = window;
+ this.userTO = userTO;
+ this.mode = mode;
+ this.resetPassword = resetPassword;
+
+ fragment = new Fragment("userModalFrag", "userModalEditFrag", this);
+ fragment.setOutputMarkupId(true);
+ add(fragment);
+
+ storePassword = new AjaxCheckBoxPanel("storePassword", "storePassword",
+ new Model<Boolean>(Boolean.TRUE));
+ }
+
+ public UserTO getUserTO() {
+ return userTO;
+ }
+
+ public void setUserTO(final UserTO userTO) {
+ this.userTO = userTO;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected Form setupEditPanel() {
+ fragment.add(new Label("id", userTO.getKey() == 0
+ ? ""
+ : userTO.getUsername()));
+
+ fragment.add(new Label("new", userTO.getKey() == 0
+ ? new ResourceModel("new")
+ : new Model("")));
+
+ final Form form = new Form("UserForm");
+ form.setModel(new CompoundPropertyModel(userTO));
+
+ //--------------------------------
+ // User details
+ //--------------------------------
+ form.add(new UserDetailsPanel("details", userTO, form, resetPassword, mode == Mode.TEMPLATE));
+
+ form.add(new Label("statuspanel", ""));
+
+ form.add(new Label("pwdChangeInfo", ""));
+
+ form.add(new Label("securityQuestion", ""));
+ form.addOrReplace(new SecurityQuestionPanel("securityQuestion", userTO));
+
+ form.add(new Label("accountinformation", ""));
+ //--------------------------------
+
+ //--------------------------------
+ // Store password internally checkbox
+ //--------------------------------
+ final Fragment storePwdFragment = new Fragment("storePwdFrag", "storePwdCheck", form);
+ storePwdFragment.setOutputMarkupId(true);
+ final Label storePasswordLabel = new Label("storePasswordLabel", new ResourceModel("storePassword"));
+ storePwdFragment.add(storePasswordLabel);
+ storePwdFragment.add(storePassword);
+ form.add(userTO.getKey() == 0 && mode != Mode.TEMPLATE
+ ? storePwdFragment : new Fragment("storePwdFrag", "emptyFragment", form));
+ //--------------------------------
+
+ //--------------------------------
+ // Attributes panel
+ //--------------------------------
+ form.add(new PlainAttrsPanel("plainAttrs", userTO, form, mode));
+ //--------------------------------
+
+ //--------------------------------
+ // Derived attributes panel
+ //--------------------------------
+ form.add(new DerAttrsPanel("derAttrs", userTO));
+ //--------------------------------
+
+ //--------------------------------
+ // Virtual attributes panel
+ //--------------------------------
+ form.add(new VirAttrsPanel("virAttrs", userTO, mode == Mode.TEMPLATE));
+ //--------------------------------
+
+ //--------------------------------
+ // Resources panel
+ //--------------------------------
+ form.add(new ResourcesPanel.Builder("resources").attributableTO(userTO).build());
+ //--------------------------------
+
+ //--------------------------------
+ // Roles panel
+ //--------------------------------
+ form.add(new MembershipsPanel("memberships", userTO, mode, null, getPageReference()));
+ //--------------------------------
+
+ final AjaxButton submit = getOnSubmit();
+
+ if (mode == Mode.ADMIN) {
+ String allowedRoles = userTO.getKey() == 0
+ ? xmlRolesReader.getEntitlement("Users", "create")
+ : xmlRolesReader.getEntitlement("Users", "update");
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, allowedRoles);
+ }
+
+ fragment.add(form);
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final AjaxButton cancel = new AjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = 530608535790823587L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ return form;
+ }
+
+ protected AjaxButton getOnSubmit() {
+ return new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ submitAction(target, form);
+
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ closeAction(target, form);
+ } catch (Exception e) {
+ LOG.error("While creating or updating user", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ }
+
+ protected abstract void submitAction(AjaxRequestTarget target, Form<?> form);
+
+ protected abstract void closeAction(AjaxRequestTarget target, Form<?> form);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.java
new file mode 100644
index 0000000..ae8a5da
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel;
+import org.apache.syncope.client.console.panels.SelectOnlyUserSearchResultPanel;
+import org.apache.syncope.client.console.panels.UserSearchPanel;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.Session;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.ResourceModel;
+
+public class UserOwnerSelectModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 2106489458494696439L;
+
+ public UserOwnerSelectModalPage(final PageReference pageRef, final ModalWindow window) {
+ super();
+
+ final SelectOnlyUserSearchResultPanel searchResult =
+ new SelectOnlyUserSearchResultPanel("searchResult", true, null, pageRef, window, userRestClient);
+ add(searchResult);
+
+ final Form<?> searchForm = new Form("searchForm");
+ add(searchForm);
+
+ final UserSearchPanel searchPanel = new UserSearchPanel.Builder("searchPanel").build();
+ searchForm.add(searchPanel);
+
+ searchForm.add(new IndicatingAjaxButton("search", new ResourceModel("search")) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final String searchCond = searchPanel.buildFIQL();
+ doSearch(target, searchCond, searchResult);
+
+ Session.get().getFeedbackMessages().clear();
+ searchPanel.getSearchFeedback().refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ searchPanel.getSearchFeedback().refresh(target);
+ }
+ });
+
+ }
+
+ private void doSearch(final AjaxRequestTarget target, final String fiql,
+ final AbstractSearchResultPanel resultsetPanel) {
+
+ if (fiql == null) {
+ error(getString(Constants.SEARCH_ERROR));
+ return;
+ }
+
+ resultsetPanel.search(fiql, target);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserSelfModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserSelfModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserSelfModalPage.java
new file mode 100644
index 0000000..087bd69
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserSelfModalPage.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.rest.UserSelfRestClient;
+import org.apache.syncope.common.lib.AttributableOperations;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Modal window with User form.
+ */
+public class UserSelfModalPage extends UserModalPage {
+
+ private static final long serialVersionUID = 603212869211672852L;
+
+ @SpringBean
+ private UserSelfRestClient restClient;
+
+ private final UserTO initialUserTO;
+
+ public UserSelfModalPage(final PageReference callerPageRef, final ModalWindow window, final UserTO userTO) {
+ super(callerPageRef, window, userTO, Mode.SELF, userTO.getKey() != 0);
+
+ this.initialUserTO = SerializationUtils.clone(userTO);
+ setupEditPanel();
+ }
+
+ @Override
+ protected void submitAction(final AjaxRequestTarget target, final Form<?> form) {
+ final UserTO updatedUserTO = (UserTO) form.getModelObject();
+
+ if (updatedUserTO.getKey() == 0) {
+ restClient.create(updatedUserTO, storePassword.getModelObject());
+ } else {
+ final UserMod userMod = AttributableOperations.diff(updatedUserTO, initialUserTO);
+
+ // update user only if it has changed
+ if (!userMod.isEmpty()) {
+ restClient.update(userMod);
+ }
+ }
+ }
+
+ @Override
+ protected void closeAction(final AjaxRequestTarget target, final Form<?> form) {
+ setResponsePage(new ResultStatusModalPage.Builder(window, userTO).mode(mode).build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserTemplateModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserTemplateModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserTemplateModalPage.java
new file mode 100644
index 0000000..2b04035
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/UserTemplateModalPage.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+
+/**
+ * Modal window with User form.
+ */
+public class UserTemplateModalPage extends UserModalPage {
+
+ private static final long serialVersionUID = 511003221213581368L;
+
+ private final SyncTaskTO syncTaskTO;
+
+ public UserTemplateModalPage(final PageReference callerPageRef, final ModalWindow window,
+ final SyncTaskTO syncTaskTO) {
+
+ super(callerPageRef, window, syncTaskTO.getUserTemplate() == null
+ ? new UserTO()
+ : syncTaskTO.getUserTemplate(), Mode.TEMPLATE, true);
+
+ this.syncTaskTO = syncTaskTO;
+
+ setupEditPanel();
+ }
+
+ @Override
+ protected void submitAction(final AjaxRequestTarget target, final Form form) {
+ syncTaskTO.setUserTemplate((UserTO) form.getModelObject());
+ taskRestClient.updateSyncTask(syncTaskTO);
+ }
+
+ @Override
+ protected void closeAction(final AjaxRequestTarget target, final Form form) {
+ window.close(target);
+ }
+}
[10/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
deleted file mode 100644
index 5df855a..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
+++ /dev/null
@@ -1,2442 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.AccessControlException;
-import java.text.SimpleDateFormat;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import javax.naming.NamingException;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.Response;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.cxf.common.util.Base64Utility;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.AttributableOperations;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
-import org.apache.syncope.common.lib.mod.ResourceAssociationMod;
-import org.apache.syncope.common.lib.mod.StatusMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.BulkAction;
-import org.apache.syncope.common.lib.to.BulkActionResult;
-import org.apache.syncope.common.lib.to.BulkActionResult.Status;
-import org.apache.syncope.common.lib.to.ConnObjectTO;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.syncope.common.lib.to.MappingTO;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.PasswordPolicyTO;
-import org.apache.syncope.common.lib.to.PropagationStatus;
-import org.apache.syncope.common.lib.to.PropagationTaskTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.CipherAlgorithm;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.MappingPurpose;
-import org.apache.syncope.common.lib.types.PolicyType;
-import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
-import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.lib.wrap.ResourceName;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
-import org.apache.syncope.common.rest.api.Preference;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.PolicyService;
-import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.common.rest.api.service.UserService;
-import org.apache.syncope.server.misc.security.Encryptor;
-import org.apache.syncope.server.provisioning.java.propagation.DBPasswordPropagationActions;
-import org.apache.syncope.server.provisioning.java.propagation.LDAPPasswordPropagationActions;
-import org.identityconnectors.framework.common.objects.Name;
-import org.identityconnectors.framework.common.objects.OperationalAttributes;
-import org.junit.Assume;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class UserITCase extends AbstractITCase {
-
- private String getStringAttribute(final ConnObjectTO connObjectTO, final String attrName) {
- return connObjectTO.getPlainAttrMap().get(attrName).getValues().get(0);
- }
-
- private boolean getBooleanAttribute(final ConnObjectTO connObjectTO, final String attrName) {
- return Boolean.parseBoolean(getStringAttribute(connObjectTO, attrName));
- }
-
- public static UserTO getUniqueSampleTO(final String email) {
- return getSampleTO(getUUIDString() + email);
- }
-
- public static UserTO getSampleTO(final String email) {
- String uid = email;
- UserTO userTO = new UserTO();
- userTO.setPassword("password123");
- userTO.setUsername(uid);
-
- userTO.getPlainAttrs().add(attrTO("fullname", uid));
- userTO.getPlainAttrs().add(attrTO("firstname", uid));
- userTO.getPlainAttrs().add(attrTO("surname", "surname"));
- userTO.getPlainAttrs().add(attrTO("type", "a type"));
- userTO.getPlainAttrs().add(attrTO("userId", uid));
- userTO.getPlainAttrs().add(attrTO("email", uid));
- userTO.getPlainAttrs().add(attrTO("loginDate", new SimpleDateFormat("yyyy-MM-dd").format(new Date())));
- userTO.getDerAttrs().add(attrTO("cn", null));
- userTO.getVirAttrs().add(attrTO("virtualdata", "virtualvalue"));
- return userTO;
- }
-
- @Test
- @SuppressWarnings("unchecked")
- public void createUserWithNoPropagation() {
- // get task list
- PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- long maxKey = tasks.getResult().iterator().next().getKey();
-
- // create a new user
- UserTO userTO = getUniqueSampleTO("xxx@xxx.xxx");
-
- userTO.setPassword("password123");
- userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION);
-
- createUser(userTO);
-
- // get the new task list
- tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- long newMaxId = tasks.getResult().iterator().next().getKey();
-
- assertTrue(newMaxId > maxKey);
-
- // get last task
- PropagationTaskTO taskTO = taskService.read(newMaxId);
-
- assertNotNull(taskTO);
- assertTrue(taskTO.getExecutions().isEmpty());
- }
-
- @Test
- public void issue172() {
- List<PasswordPolicyTO> policies = policyService.list(PolicyType.GLOBAL_PASSWORD);
- for (PasswordPolicyTO policyTO : policies) {
- policyService.delete(policyTO.getKey());
- }
-
- try {
- UserTO userTO = getUniqueSampleTO("issue172@syncope.apache.org");
- createUser(userTO);
- } finally {
- for (PasswordPolicyTO policyTO : policies) {
- Response response = policyService.create(policyTO);
- PasswordPolicyTO cPolicyTO = getObject(
- response.getLocation(), PolicyService.class, PasswordPolicyTO.class);
- assertNotNull(cPolicyTO);
- }
- }
- }
-
- @Test
- public void issue186() {
- // 1. create an user with strict mandatory attributes only
- UserTO userTO = new UserTO();
- String userId = getUUIDString() + "issue186@syncope.apache.org";
- userTO.setUsername(userId);
- userTO.setPassword("password");
-
- userTO.getPlainAttrs().add(attrTO("userId", userId));
- userTO.getPlainAttrs().add(attrTO("fullname", userId));
- userTO.getPlainAttrs().add(attrTO("surname", userId));
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertTrue(userTO.getResources().isEmpty());
-
- // 2. update assigning a resource forcing mandatory constraints: must fail with RequiredValuesMissing
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("newPassword");
- userMod.getResourcesToAdd().add(RESOURCE_NAME_WS2);
-
- try {
- userTO = updateUser(userMod);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
-
- // 3. update assigning a resource NOT forcing mandatory constraints
- // AND primary: must fail with PropagationException
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("newPassword");
- userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO.getPropagationStatusTOs().get(0).getFailureReason());
-
- // 4. update assigning a resource NOT forcing mandatory constraints
- // BUT not primary: must succeed
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("newPassword123456");
- userMod.getResourcesToAdd().add(RESOURCE_NAME_CSV);
- updateUser(userMod);
- }
-
- @Test
- public void enforceMandatoryCondition() {
- UserTO userTO = getUniqueSampleTO("enforce@apache.org");
- userTO.getResources().add(RESOURCE_NAME_WS2);
- userTO.setPassword("newPassword");
-
- AttrTO type = null;
- for (AttrTO attr : userTO.getPlainAttrs()) {
- if ("type".equals(attr.getSchema())) {
- type = attr;
- }
- }
- assertNotNull(type);
- userTO.getPlainAttrs().remove(type);
-
- try {
- userTO = createUser(userTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
-
- userTO.getPlainAttrs().add(type);
- userTO = createUser(userTO);
- assertNotNull(userTO);
- }
-
- @Test
- public void enforceMandatoryConditionOnDerived() {
- ResourceTO resourceTO = resourceService.read(RESOURCE_NAME_CSV);
- assertNotNull(resourceTO);
- resourceTO.setKey("resource-csv-enforcing");
- resourceTO.setEnforceMandatoryCondition(true);
-
- Response response = resourceService.create(resourceTO);
- resourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
- assertNotNull(resourceTO);
-
- UserTO userTO = getUniqueSampleTO("syncope222@apache.org");
- userTO.getResources().add(resourceTO.getKey());
- userTO.setPassword("newPassword");
-
- try {
- userTO = createUser(userTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
-
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals(Collections.singleton("resource-csv-enforcing"), userTO.getResources());
- }
-
- @Test
- public void createUserWithDbPropagation() {
- UserTO userTO = getUniqueSampleTO("yyy@yyy.yyy");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals(1, userTO.getPropagationStatusTOs().size());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithInvalidPassword() {
- UserTO userTO = getSampleTO("invalidpasswd@syncope.apache.org");
- userTO.setPassword("pass");
- createUser(userTO);
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithInvalidUsername() {
- UserTO userTO = getSampleTO("invalidusername@syncope.apache.org");
- userTO.setUsername("us");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
-
- userTO.getMemberships().add(membershipTO);
-
- createUser(userTO);
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithInvalidPasswordByRes() {
- UserTO userTO = getSampleTO("invalidPwdByRes@passwd.com");
-
- // configured to be minLength=16
- userTO.setPassword("password1");
- userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION);
- createUser(userTO);
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithInvalidPasswordByRole() {
- UserTO userTO = getSampleTO("invalidPwdByRole@passwd.com");
-
- // configured to be minLength=16
- userTO.setPassword("password1");
-
- final MembershipTO membership = new MembershipTO();
- membership.setRoleId(8L);
-
- userTO.getMemberships().add(membership);
-
- createUser(userTO);
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithException() {
- UserTO newUserTO = new UserTO();
- newUserTO.getPlainAttrs().add(attrTO("userId", "userId@nowhere.org"));
- createUser(newUserTO);
- }
-
- @Test
- public void create() {
- // get task list
- PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- long maxKey = tasks.getResult().iterator().next().getKey();
- PropagationTaskTO taskTO = taskService.read(maxKey);
-
- assertNotNull(taskTO);
- int maxTaskExecutions = taskTO.getExecutions().size();
-
- UserTO userTO = getUniqueSampleTO("a.b@c.com");
-
- // add a membership
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- userTO.getMemberships().add(membershipTO);
-
- // add an attribute with no values: must be ignored
- membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", null));
-
- // add an attribute with a non-existing schema: must be ignored
- AttrTO attrWithInvalidSchemaTO = attrTO("invalid schema", "a value");
- userTO.getPlainAttrs().add(attrWithInvalidSchemaTO);
-
- // add an attribute with null value: must be ignored
- userTO.getPlainAttrs().add(attrTO("activationDate", null));
-
- // 1. create user
- UserTO newUserTO = createUser(userTO);
-
- assertNotNull(newUserTO);
-
- // issue SYNCOPE-15
- assertNotNull(newUserTO.getCreationDate());
- assertNotNull(newUserTO.getCreator());
- assertNotNull(newUserTO.getLastChangeDate());
- assertNotNull(newUserTO.getLastModifier());
- assertEquals(newUserTO.getCreationDate(), newUserTO.getLastChangeDate());
-
- assertFalse(newUserTO.getPlainAttrs().contains(attrWithInvalidSchemaTO));
-
- // check for changePwdDate
- assertNotNull(newUserTO.getCreationDate());
-
- // 2. check for virtual attribute value
- newUserTO = userService.read(newUserTO.getKey());
- assertNotNull(newUserTO);
-
- assertNotNull(newUserTO.getVirAttrMap());
- assertNotNull(newUserTO.getVirAttrMap().get("virtualdata").getValues());
- assertFalse(newUserTO.getVirAttrMap().get("virtualdata").getValues().isEmpty());
- assertEquals("virtualvalue", newUserTO.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // get the new task list
- tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- long newMaxKey = tasks.getResult().iterator().next().getKey();
-
- // default configuration for ws-target-resource2:
- // only failed executions have to be registered
- // --> no more tasks/executions should be added
- assertEquals(newMaxKey, maxKey);
-
- // get last task
- taskTO = taskService.read(newMaxKey);
-
- assertNotNull(taskTO);
- assertEquals(maxTaskExecutions, taskTO.getExecutions().size());
-
- // 3. verify password
- UserSelfService userSelfService1 = clientFactory.create(
- newUserTO.getUsername(), "password123").getService(UserSelfService.class);
- try {
- UserTO user = userSelfService1.read();
- assertNotNull(user);
- } catch (AccessControlException e) {
- fail("Credentials should be valid and not cause AccessControlException");
- }
-
- UserSelfService userSelfService2 = clientFactory.create(
- newUserTO.getUsername(), "passwordXX").getService(UserSelfService.class);
- try {
- userSelfService2.read();
- fail("Credentials are invalid, thus request should raise AccessControlException");
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- // 4. try (and fail) to create another user with same (unique) values
- userTO = getSampleTO(userTO.getUsername());
- AttrTO userIdAttr = userTO.getPlainAttrMap().get("userId");
- userIdAttr.getValues().clear();
- userIdAttr.getValues().add("a.b@c.com");
-
- try {
- createUser(userTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.DataIntegrityViolation, e.getType());
- }
- }
-
- @Test
- public void createWithRequiredValueMissing() {
- UserTO userTO = getSampleTO("a.b@c.it");
-
- AttrTO type = userTO.getPlainAttrMap().get("type");
- userTO.getPlainAttrs().remove(type);
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- userTO.getMemberships().add(membershipTO);
-
- // 1. create user without type (mandatory by UserSchema)
- try {
- createUser(userTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
-
- userTO.getPlainAttrs().add(attrTO("type", "F"));
-
- AttrTO surname = userTO.getPlainAttrMap().get("surname");
- userTO.getPlainAttrs().remove(surname);
-
- // 2. create user without surname (mandatory when type == 'F')
- try {
- createUser(userTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
- }
-
- @Test
- public void delete() {
- try {
- userService.delete(0L);
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
-
- UserTO userTO = getSampleTO("qqgf.z@nn.com");
-
- // specify a propagation
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- userTO = createUser(userTO);
-
- long id = userTO.getKey();
-
- userTO = deleteUser(id);
-
- assertNotNull(userTO);
- assertEquals(id, userTO.getKey());
- assertTrue(userTO.getPlainAttrs().isEmpty());
-
- // check for propagation result
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
-
- try {
- userService.delete(userTO.getKey());
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void deleteByUsername() {
- UserTO userTO = getSampleTO("delete.by.username@apache.org");
-
- // specify a propagation
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- userTO = createUser(userTO);
-
- long id = userTO.getKey();
- userTO = userService.read(id);
- userTO = deleteUser(userTO.getKey());
-
- assertNotNull(userTO);
- assertEquals(id, userTO.getKey());
- assertTrue(userTO.getPlainAttrs().isEmpty());
-
- // check for propagation result
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
-
- try {
- userService.read(userTO.getKey());
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void list() {
- PagedResult<UserTO> users = userService.list();
- assertNotNull(users);
- assertFalse(users.getResult().isEmpty());
-
- for (UserTO user : users.getResult()) {
- assertNotNull(user);
- }
- }
-
- @Test
- public void paginatedList() {
- PagedResult<UserTO> users = userService.list(1, 2);
- assertNotNull(users);
- assertFalse(users.getResult().isEmpty());
- assertEquals(2, users.getResult().size());
-
- for (UserTO user : users.getResult()) {
- assertNotNull(user);
- }
-
- users = userService.list(2, 2);
- assertNotNull(users);
- assertFalse(users.getResult().isEmpty());
- assertEquals(2, users.getResult().size());
-
- users = userService.list(100, 2);
- assertNotNull(users);
- assertTrue(users.getResult().isEmpty());
- }
-
- @Test
- public void read() {
- UserTO userTO = userService.read(1L);
-
- assertNotNull(userTO);
- assertNotNull(userTO.getPlainAttrs());
- assertFalse(userTO.getPlainAttrs().isEmpty());
- }
-
- @Test
- public void readWithMailAddressAsUserName() {
- UserTO userTO = createUser(getUniqueSampleTO("mail@domain.org"));
- userTO = userService.read(userTO.getKey());
- assertNotNull(userTO);
- }
-
- @Test
- public void updateWithouPassword() {
- UserTO userTO = getUniqueSampleTO("updatewithout@password.com");
-
- userTO = createUser(userTO);
-
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getDerAttrsToRemove().add("cn");
-
- userTO = updateUser(userMod);
-
- assertNotNull(userTO);
- assertNotNull(userTO.getDerAttrMap());
- assertFalse(userTO.getDerAttrMap().containsKey("cn"));
- }
-
- @Test(expected = SyncopeClientException.class)
- public void updateInvalidPassword() {
- UserTO userTO = getSampleTO("updateinvalid@password.com");
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("pass");
-
- userService.update(userMod.getKey(), userMod);
- }
-
- @Test(expected = SyncopeClientException.class)
- public void updateSamePassword() {
- UserTO userTO = getSampleTO("updatesame@password.com");
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("password123");
-
- userService.update(userMod.getKey(), userMod);
- }
-
- @Test
- public void update() {
- UserTO userTO = getUniqueSampleTO("g.h@t.com");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", "2009-08-18T16:33:12.203+0200"));
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
-
- assertFalse(userTO.getDerAttrs().isEmpty());
- assertEquals(1, userTO.getMemberships().size());
-
- MembershipMod membershipMod = new MembershipMod();
- membershipMod.setRole(8L);
- membershipMod.getPlainAttrsToUpdate().add(attrMod("subscriptionDate", "2010-08-18T16:33:12.203+0200"));
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("new2Password");
-
- userMod.getPlainAttrsToRemove().add("userId");
- String newUserId = getUUIDString() + "t.w@spre.net";
- userMod.getPlainAttrsToUpdate().add(attrMod("userId", newUserId));
-
- userMod.getPlainAttrsToRemove().add("fullname");
- String newFullName = getUUIDString() + "g.h@t.com";
- userMod.getPlainAttrsToUpdate().add(attrMod("fullname", newFullName));
-
- userMod.getDerAttrsToAdd().add("cn");
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- // issue SYNCOPE-15
- assertNotNull(userTO.getCreationDate());
- assertNotNull(userTO.getCreator());
- assertNotNull(userTO.getLastChangeDate());
- assertNotNull(userTO.getLastModifier());
- assertTrue(userTO.getCreationDate().before(userTO.getLastChangeDate()));
-
- assertEquals(1, userTO.getMemberships().size());
- assertEquals(1, userTO.getMemberships().iterator().next().getPlainAttrs().size());
- assertFalse(userTO.getDerAttrs().isEmpty());
-
- AttrTO userIdAttr = userTO.getPlainAttrMap().get("userId");
- assertEquals(Collections.singletonList(newUserId), userIdAttr.getValues());
-
- AttrTO fullNameAttr = userTO.getPlainAttrMap().get("fullname");
- assertEquals(Collections.singletonList(newFullName), fullNameAttr.getValues());
- }
-
- @Test
- public void updatePasswordOnly() {
- int beforeTasks = taskService.list(TaskType.PROPAGATION, 1, 1).getTotalCount();
- assertFalse(beforeTasks <= 0);
-
- UserTO userTO = getUniqueSampleTO("pwdonly@t.com");
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", "2009-08-18T16:33:12.203+0200"));
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("newPassword123");
-
- userTO = updateUser(userMod);
-
- // check for changePwdDate
- assertNotNull(userTO.getChangePwdDate());
-
- int afterTasks = taskService.list(TaskType.PROPAGATION, 1, 1).getTotalCount();
- assertFalse(beforeTasks <= 0);
-
- assertTrue(beforeTasks < afterTasks);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void verifyTaskRegistration() {
- // get task list
- PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- long maxKey = tasks.getResult().iterator().next().getKey();
-
- // --------------------------------------
- // Create operation
- // --------------------------------------
- UserTO userTO = getUniqueSampleTO("t@p.mode");
-
- // add a membership
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- userTO.getMemberships().add(membershipTO);
-
- // 1. create user
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- // get the new task list
- tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- long newMaxKey = tasks.getResult().iterator().next().getKey();
-
- // default configuration for ws-target-resource2:
- // only failed executions have to be registered
- // --> no more tasks/executions should be added
- assertEquals(newMaxKey, maxKey);
-
- // --------------------------------------
- // Update operation
- // --------------------------------------
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
-
- userMod.getPlainAttrsToUpdate().add(attrMod("surname", "surname"));
-
- userTO = updateUser(userMod);
-
- assertNotNull(userTO);
-
- // get the new task list
- tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
-
- maxKey = newMaxKey;
- newMaxKey = tasks.getResult().iterator().next().getKey();
-
- // default configuration for ws-target-resource2:
- // all update executions have to be registered
- assertTrue(newMaxKey > maxKey);
-
- final PropagationTaskTO taskTO = taskService.read(newMaxKey);
-
- assertNotNull(taskTO);
- assertEquals(1, taskTO.getExecutions().size());
-
- // --------------------------------------
- // Delete operation
- // --------------------------------------
- userService.delete(userTO.getKey());
-
- // get the new task list
- tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
-
- maxKey = newMaxKey;
- newMaxKey = tasks.getResult().iterator().next().getKey();
-
- // default configuration for ws-target-resource2: no delete executions have to be registered
- // --> no more tasks/executions should be added
- assertEquals(newMaxKey, maxKey);
- }
-
- @Test
- public void createActivate() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- UserTO userTO = getUniqueSampleTO("createActivate@syncope.apache.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(11L);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
-
- assertNotNull(userTO);
- assertNotNull(userTO.getToken());
- assertNotNull(userTO.getTokenExpireTime());
-
- assertEquals("created", userTO.getStatus());
-
- StatusMod statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.ACTIVATE);
- statusMod.setToken(userTO.getToken());
- userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
-
- assertNotNull(userTO);
- assertNull(userTO.getToken());
- assertNull(userTO.getTokenExpireTime());
- assertEquals("active", userTO.getStatus());
- }
-
- @Test
- public void suspendReactivate() {
- UserTO userTO = getUniqueSampleTO("suspendReactivate@syncope.apache.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
-
- assertNotNull(userTO);
- assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
- ? "active"
- : "created", userTO.getStatus());
-
- StatusMod statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.SUSPEND);
- userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("suspended", userTO.getStatus());
-
- statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.REACTIVATE);
- userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
- }
-
- @Test
- public void suspendReactivateOnResource() {
- // Assert resources are present
- ResourceTO dbTable = resourceService.read(RESOURCE_NAME_TESTDB);
- assertNotNull(dbTable);
- ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP);
- assertNotNull(ldap);
-
- // Create user with reference to resources
- UserTO userTO = getUniqueSampleTO("suspreactonresource@syncope.apache.org");
- userTO.getMemberships().clear();
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
- userTO.getResources().add(RESOURCE_NAME_LDAP);
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
- ? "active"
- : "created", userTO.getStatus());
- long userId = userTO.getKey();
-
- // Suspend with effect on syncope, ldap and db => user should be suspended in syncope and all resources
- StatusMod statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.SUSPEND);
- statusMod.setOnSyncope(true);
- statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
- statusMod.getResourceNames().add(RESOURCE_NAME_LDAP);
- userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("suspended", userTO.getStatus());
-
- ConnObjectTO connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
- assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userId);
- assertNotNull(connObjectTO);
-
- // Suspend and reactivate only on ldap => db and syncope should still show suspended
- statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.SUSPEND);
- statusMod.setOnSyncope(false);
- statusMod.getResourceNames().add(RESOURCE_NAME_LDAP);
- userService.status(userId, statusMod);
- statusMod.setType(StatusMod.ModType.REACTIVATE);
- userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("suspended", userTO.getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
- assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
-
- // Reactivate on syncope and db => syncope and db should show the user as active
- statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.REACTIVATE);
- statusMod.setOnSyncope(true);
- statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
-
- userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
- assertTrue(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
- }
-
- public void updateMultivalueAttribute() {
- UserTO userTO = getSampleTO("multivalue@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- AttrTO loginDate = userTO.getPlainAttrMap().get("loginDate");
- assertNotNull(loginDate);
- assertEquals(1, loginDate.getValues().size());
-
- UserMod userMod = new UserMod();
-
- AttrMod loginDateMod = new AttrMod();
- loginDateMod.getValuesToBeAdded().add("2000-01-01");
-
- userMod.setKey(userTO.getKey());
- userMod.getPlainAttrsToUpdate().add(loginDateMod);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- loginDate = userTO.getPlainAttrMap().get("loginDate");
- assertNotNull(loginDate);
- assertEquals(2, loginDate.getValues().size());
- }
-
- @Test(expected = EmptyResultDataAccessException.class)
- public void issue213() {
- UserTO userTO = getUniqueSampleTO("issue213@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals(1, userTO.getResources().size());
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- String username = jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class,
- userTO.getUsername());
-
- assertEquals(userTO.getUsername(), username);
-
- UserMod userMod = new UserMod();
-
- userMod.setKey(userTO.getKey());
- userMod.getResourcesToRemove().add(RESOURCE_NAME_TESTDB);
-
- userTO = updateUser(userMod);
- assertTrue(userTO.getResources().isEmpty());
-
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class, userTO.getUsername());
- }
-
- @Test
- public void issue234() {
- UserTO inUserTO = getUniqueSampleTO("issue234@syncope.apache.org");
- inUserTO.getResources().add(RESOURCE_NAME_LDAP);
-
- UserTO userTO = createUser(inUserTO);
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
-
- userMod.setKey(userTO.getKey());
- userMod.setUsername("1" + userTO.getUsername());
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- assertEquals("1" + inUserTO.getUsername(), userTO.getUsername());
- }
-
- @Test
- public void issue270() {
- // 1. create a new user without virtual attributes
- UserTO original = getUniqueSampleTO("issue270@syncope.apache.org");
- // be sure to remove all virtual attributes
- original.getVirAttrs().clear();
-
- original = createUser(original);
-
- assertNotNull(original);
-
- assertTrue(original.getVirAttrs().isEmpty());
-
- UserTO toBeUpdated = userService.read(original.getKey());
-
- AttrTO virtual = attrTO("virtualdata", "virtualvalue");
- toBeUpdated.getVirAttrs().add(virtual);
-
- // 2. try to update by adding a resource, but no password: must fail
- UserMod userMod = AttributableOperations.diff(toBeUpdated, original);
- assertNotNull(userMod);
-
- toBeUpdated = updateUser(userMod);
- assertNotNull(toBeUpdated);
-
- assertFalse(toBeUpdated.getVirAttrs().isEmpty());
- assertNotNull(toBeUpdated.getVirAttrs().get(0));
-
- assertEquals(virtual.getSchema(), toBeUpdated.getVirAttrs().get(0).getSchema());
- }
-
- @Test
- public final void issue280() {
- UserTO userTO = getUniqueSampleTO("issue280@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("123password");
- userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- final List<PropagationStatus> propagations = userTO.getPropagationStatusTOs();
-
- assertNotNull(propagations);
- assertEquals(1, propagations.size());
-
- final PropagationTaskExecStatus status = propagations.get(0).getStatus();
- final String resource = propagations.get(0).getResource();
-
- assertNotNull(status);
- assertEquals(RESOURCE_NAME_TESTDB, resource);
- assertTrue(status.isSuccessful());
- }
-
- @Test
- public void issue281() {
- UserTO userTO = getUniqueSampleTO("issue281@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- final List<PropagationStatus> propagations = userTO.getPropagationStatusTOs();
-
- assertNotNull(propagations);
- assertEquals(1, propagations.size());
-
- final PropagationTaskExecStatus status = propagations.get(0).getStatus();
- final String resource = propagations.get(0).getResource();
-
- assertNotNull(status);
- assertEquals(RESOURCE_NAME_CSV, resource);
- assertFalse(status.isSuccessful());
- }
-
- @Test
- public void issue288() {
- UserTO userTO = getSampleTO("issue288@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO("aLong", "STRING"));
-
- try {
- createUser(userTO);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidValues, e.getType());
- }
- }
-
- @Test
- public void roleAttrPropagation() {
- UserTO userTO = getUniqueSampleTO("checkRoleAttrPropagation@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
-
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(1L);
-
- userTO.getMemberships().add(membershipTO);
-
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertNotNull(actual.getDerAttrMap().get("csvuserid"));
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
- assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("ROLE").getValues().get(0));
- }
-
- @Test
- public void membershipAttrPropagation() {
- UserTO userTO = getUniqueSampleTO("checkMembAttrPropagation@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(1L);
- membershipTO.getPlainAttrs().add(attrTO("mderived_sx", "sx"));
- membershipTO.getPlainAttrs().add(attrTO("mderived_dx", "dx"));
- membershipTO.getDerAttrs().add(attrTO("mderToBePropagated", null));
- userTO.getMemberships().add(membershipTO);
-
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertNotNull(actual.getDerAttrMap().get("csvuserid"));
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
- assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("MEMBERSHIP").getValues().get(0));
- }
-
- @Test
- public void noContent() throws IOException {
- SyncopeClient noContentclient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
- UserService noContentService = noContentclient.prefer(UserService.class, Preference.RETURN_NO_CONTENT);
-
- UserTO user = getUniqueSampleTO("nocontent@syncope.apache.org");
-
- Response response = noContentService.create(user, true);
- assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
-
- user = getObject(response.getLocation(), UserService.class, UserTO.class);
- assertNotNull(user);
-
- UserMod userMod = new UserMod();
- userMod.setPassword("password321");
-
- response = noContentService.update(user.getKey(), userMod);
- assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
-
- response = noContentService.delete(user.getKey());
- assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
- }
-
- @Test
- public void issueSYNCOPE108() {
- UserTO userTO = getUniqueSampleTO("syncope108@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- MembershipTO memb12 = new MembershipTO();
- memb12.setRoleId(12L);
-
- userTO.getMemberships().add(memb12);
-
- MembershipTO memb13 = new MembershipTO();
- memb13.setRoleId(13L);
-
- userTO.getMemberships().add(memb13);
-
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertEquals(2, actual.getMemberships().size());
- assertEquals(1, actual.getResources().size());
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
-
- // -----------------------------------
- // Remove the first membership: de-provisioning shouldn't happen
- // -----------------------------------
- UserMod userMod = new UserMod();
- userMod.setKey(actual.getKey());
-
- userMod.getMembershipsToRemove().add(actual.getMemberships().get(0).getKey());
-
- actual = updateUser(userMod);
- assertNotNull(actual);
- assertEquals(1, actual.getMemberships().size());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
- // -----------------------------------
-
- // -----------------------------------
- // Remove the resource assigned directly: de-provisioning shouldn't happen
- // -----------------------------------
- userMod = new UserMod();
- userMod.setKey(actual.getKey());
-
- userMod.getResourcesToRemove().add(actual.getResources().iterator().next());
-
- actual = updateUser(userMod);
- assertNotNull(actual);
- assertEquals(1, actual.getMemberships().size());
- assertFalse(actual.getResources().isEmpty());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
- // -----------------------------------
-
- // -----------------------------------
- // Remove the first membership: de-provisioning should happen
- // -----------------------------------
- userMod = new UserMod();
- userMod.setKey(actual.getKey());
-
- userMod.getMembershipsToRemove().add(actual.getMemberships().get(0).getKey());
-
- actual = updateUser(userMod);
- assertNotNull(actual);
- assertTrue(actual.getMemberships().isEmpty());
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail("Read should not succeeed");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE111() {
- UserTO userTO = getUniqueSampleTO("syncope111@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- MembershipTO memb12 = new MembershipTO();
- memb12.setRoleId(12L);
- memb12.getPlainAttrs().add(attrTO("postalAddress", "postalAddress"));
- userTO.getMemberships().add(memb12);
-
- MembershipTO memb13 = new MembershipTO();
- memb13.setRoleId(13L);
- userTO.getMemberships().add(memb13);
-
- userTO.getResources().add(RESOURCE_NAME_LDAP);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertEquals(2, actual.getMemberships().size());
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
-
- AttrTO postalAddress = connObjectTO.getPlainAttrMap().get("postalAddress");
- assertNotNull(postalAddress);
- assertEquals(1, postalAddress.getValues().size());
- assertEquals("postalAddress", postalAddress.getValues().get(0));
-
- AttrTO title = connObjectTO.getPlainAttrMap().get("title");
- assertNotNull(title);
- assertEquals(2, title.getValues().size());
- assertTrue(title.getValues().contains("r12") && title.getValues().contains("r13"));
-
- // -----------------------------------
- // Remove the first membership and check for membership attr propagation and role attr propagation
- // -----------------------------------
- UserMod userMod = new UserMod();
- userMod.setKey(actual.getKey());
-
- MembershipTO membershipTO = actual.getMemberships().get(0).getRoleId() == 12L
- ? actual.getMemberships().get(0)
- : actual.getMemberships().get(1);
-
- userMod.getMembershipsToRemove().add(membershipTO.getKey());
-
- actual = updateUser(userMod);
- assertNotNull(actual);
- assertEquals(1, actual.getMemberships().size());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
- assertNotNull(connObjectTO);
-
- postalAddress = connObjectTO.getPlainAttrMap().get("postalAddress");
- assertTrue(postalAddress == null || postalAddress.getValues().isEmpty()
- || StringUtils.isNotBlank(postalAddress.getValues().get(0)));
-
- title = connObjectTO.getPlainAttrMap().get("title");
- assertNotNull(title);
- assertEquals(1, title.getValues().size());
- assertTrue(title.getValues().contains("r13"));
- // -----------------------------------
- }
-
- @Test
- public void issueSYNCOPE185() {
- // 1. create user with LDAP resource, succesfully propagated
- UserTO userTO = getSampleTO("syncope185@syncope.apache.org");
- userTO.getVirAttrs().clear();
- userTO.getResources().add(RESOURCE_NAME_LDAP);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertEquals(RESOURCE_NAME_LDAP, userTO.getPropagationStatusTOs().get(0).getResource());
- assertEquals(PropagationTaskExecStatus.SUCCESS, userTO.getPropagationStatusTOs().get(0).getStatus());
-
- // 2. delete this user
- userService.delete(userTO.getKey());
-
- // 3. try (and fail) to find this user on the external LDAP resource
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
- fail("This entry should not be present on this resource");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
- }
-
- @Test()
- public void issueSYNCOPE51() {
- AttrTO defaultCA = configurationService.read("password.cipher.algorithm");
- final String originalCAValue = defaultCA.getValues().get(0);
- defaultCA.getValues().set(0, "MD5");
- configurationService.set(defaultCA.getSchema(), defaultCA);
-
- AttrTO newCA = configurationService.read(defaultCA.getSchema());
- assertEquals(defaultCA, newCA);
-
- UserTO userTO = getSampleTO("syncope51@syncope.apache.org");
- userTO.setPassword("password");
-
- try {
- createUser(userTO);
- fail("Create user should not succeed");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- assertTrue(e.getElements().iterator().next().contains("MD5"));
- }
-
- defaultCA.getValues().set(0, originalCAValue);
- configurationService.set(defaultCA.getSchema(), defaultCA);
-
- AttrTO oldCA = configurationService.read(defaultCA.getSchema());
- assertEquals(defaultCA, oldCA);
- }
-
- @Test
- public void issueSYNCOPE267() {
- // ----------------------------------
- // create user and check virtual attribute value propagation
- // ----------------------------------
- UserTO userTO = getUniqueSampleTO("syncope267@apache.org");
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertEquals(RESOURCE_NAME_DBVIRATTR, userTO.getPropagationStatusTOs().get(0).getResource());
- assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_DBVIRATTR, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
- assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("USERNAME").getValues().get(0));
- // ----------------------------------
-
- userTO = userService.read(userTO.getKey());
-
- assertNotNull(userTO);
- assertEquals(1, userTO.getVirAttrs().size());
- assertEquals("virtualvalue", userTO.getVirAttrs().get(0).getValues().get(0));
- }
-
- @Test
- public void issueSYNCOPE266() {
- UserTO userTO = getUniqueSampleTO("syncope266@apache.org");
- userTO.getResources().clear();
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
-
- // this resource has not a mapping for Password
- userMod.getResourcesToAdd().add(RESOURCE_NAME_UPDATE);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- }
-
- @Test
- public void issueSYNCOPE279() {
- UserTO userTO = getUniqueSampleTO("syncope279@apache.org");
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_TIMEOUT);
- userTO = createUser(userTO);
- assertEquals(RESOURCE_NAME_TIMEOUT, userTO.getPropagationStatusTOs().get(0).getResource());
- assertNotNull(userTO.getPropagationStatusTOs().get(0).getFailureReason());
- assertEquals(PropagationTaskExecStatus.UNSUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
- }
-
- @Test
- public void issueSYNCOPE122() {
- // 1. create user on testdb and testdb2
- UserTO userTO = getUniqueSampleTO("syncope122@apache.org");
- userTO.getResources().clear();
-
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
- userTO.getResources().add(RESOURCE_NAME_TESTDB2);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB2));
-
- final String pwdOnSyncope = userTO.getPassword();
-
- ConnObjectTO userOnDb = resourceService.getConnectorObject(
- RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
- final AttrTO pwdOnTestDbAttr = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
- assertNotNull(pwdOnTestDbAttr);
- assertNotNull(pwdOnTestDbAttr.getValues());
- assertFalse(pwdOnTestDbAttr.getValues().isEmpty());
- final String pwdOnTestDb = pwdOnTestDbAttr.getValues().iterator().next();
-
- ConnObjectTO userOnDb2 = resourceService.getConnectorObject(
- RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getKey());
- final AttrTO pwdOnTestDb2Attr = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
- assertNotNull(pwdOnTestDb2Attr);
- assertNotNull(pwdOnTestDb2Attr.getValues());
- assertFalse(pwdOnTestDb2Attr.getValues().isEmpty());
- final String pwdOnTestDb2 = pwdOnTestDb2Attr.getValues().iterator().next();
-
- // 2. request to change password only on testdb (no Syncope, no testdb2)
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword(getUUIDString());
- StatusMod pwdPropRequest = new StatusMod();
- pwdPropRequest.setOnSyncope(false);
- pwdPropRequest.getResourceNames().add(RESOURCE_NAME_TESTDB);
- userMod.setPwdPropRequest(pwdPropRequest);
-
- userTO = updateUser(userMod);
-
- // 3a. Chech that only a single propagation took place
- assertNotNull(userTO.getPropagationStatusTOs());
- assertEquals(1, userTO.getPropagationStatusTOs().size());
- assertEquals(RESOURCE_NAME_TESTDB, userTO.getPropagationStatusTOs().iterator().next().getResource());
-
- // 3b. verify that password hasn't changed on Syncope
- assertEquals(pwdOnSyncope, userTO.getPassword());
-
- // 3c. verify that password *has* changed on testdb
- userOnDb = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
- final AttrTO pwdOnTestDbAttrAfter = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
- assertNotNull(pwdOnTestDbAttrAfter);
- assertNotNull(pwdOnTestDbAttrAfter.getValues());
- assertFalse(pwdOnTestDbAttrAfter.getValues().isEmpty());
- assertNotEquals(pwdOnTestDb, pwdOnTestDbAttrAfter.getValues().iterator().next());
-
- // 3d. verify that password hasn't changed on testdb2
- userOnDb2 = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getKey());
- final AttrTO pwdOnTestDb2AttrAfter = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
- assertNotNull(pwdOnTestDb2AttrAfter);
- assertNotNull(pwdOnTestDb2AttrAfter.getValues());
- assertFalse(pwdOnTestDb2AttrAfter.getValues().isEmpty());
- assertEquals(pwdOnTestDb2, pwdOnTestDb2AttrAfter.getValues().iterator().next());
- }
-
- @Test
- public void isseSYNCOPE136AES() {
- // 1. read configured cipher algorithm in order to be able to restore it at the end of test
- AttrTO pwdCipherAlgo = configurationService.read("password.cipher.algorithm");
- final String origpwdCipherAlgo = pwdCipherAlgo.getValues().get(0);
-
- // 2. set AES password cipher algorithm
- pwdCipherAlgo.getValues().set(0, "AES");
- configurationService.set(pwdCipherAlgo.getSchema(), pwdCipherAlgo);
-
- // 3. create user with no resources
- UserTO userTO = getUniqueSampleTO("syncope136_AES@apache.org");
- userTO.getResources().clear();
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- // 4. update user, assign a propagation primary resource but don't provide any password
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- // 5. verify that propagation was successful
- List<PropagationStatus> props = userTO.getPropagationStatusTOs();
- assertNotNull(props);
- assertEquals(1, props.size());
- PropagationStatus prop = props.iterator().next();
- assertNotNull(prop);
- assertEquals(RESOURCE_NAME_WS1, prop.getResource());
- assertEquals(PropagationTaskExecStatus.SUBMITTED, prop.getStatus());
-
- // 6. restore initial cipher algorithm
- pwdCipherAlgo.getValues().set(0, origpwdCipherAlgo);
- configurationService.set(pwdCipherAlgo.getSchema(), pwdCipherAlgo);
- }
-
- @Test
- public void isseSYNCOPE136Random() {
- // 1. create user with no resources
- UserTO userTO = getUniqueSampleTO("syncope136_Random@apache.org");
- userTO.getResources().clear();
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- // 2. update user, assign a propagation primary resource but don't provide any password
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getResourcesToAdd().add(RESOURCE_NAME_LDAP);
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- // 3. verify that propagation was successful
- List<PropagationStatus> props = userTO.getPropagationStatusTOs();
- assertNotNull(props);
- assertEquals(1, props.size());
- PropagationStatus prop = props.iterator().next();
- assertNotNull(prop);
- assertEquals(RESOURCE_NAME_LDAP, prop.getResource());
- assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
- }
-
- @Test
- public void mappingPurpose() {
- UserTO userTO = getUniqueSampleTO("mpurpose@apache.org");
-
- AttrTO csvuserid = new AttrTO();
- csvuserid.setSchema("csvuserid");
- userTO.getDerAttrs().add(csvuserid);
-
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- assertNull(connObjectTO.getPlainAttrMap().get("email"));
- }
-
- @Test
- public void issueSYNCOPE265() {
- for (long i = 1; i <= 5; i++) {
- UserMod userMod = new UserMod();
- userMod.setKey(i);
-
- AttrMod attributeMod = new AttrMod();
- attributeMod.setSchema("type");
- attributeMod.getValuesToBeAdded().add("a type");
-
- userMod.getPlainAttrsToRemove().add("type");
- userMod.getPlainAttrsToUpdate().add(attributeMod);
-
- UserTO userTO = updateUser(userMod);
- assertEquals("a type", userTO.getPlainAttrMap().get("type").getValues().get(0));
- }
- }
-
- @Test
- public void bulkActions() {
- final BulkAction bulkAction = new BulkAction();
-
- for (int i = 0; i < 10; i++) {
- UserTO userTO = getUniqueSampleTO("bulk_" + i + "@apache.org");
- bulkAction.getTargets().add(String.valueOf(createUser(userTO).getKey()));
- }
-
- // check for a fail
- bulkAction.getTargets().add(String.valueOf(Long.MAX_VALUE));
-
- assertEquals(11, bulkAction.getTargets().size());
-
- bulkAction.setOperation(BulkAction.Type.SUSPEND);
- BulkActionResult res = userService.bulk(bulkAction);
- assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
- assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
- assertEquals("suspended", userService.read(
- Long.parseLong(res.getResultByStatus(Status.SUCCESS).get(3).toString())).getStatus());
-
- bulkAction.setOperation(BulkAction.Type.REACTIVATE);
- res = userService.bulk(bulkAction);
- assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
- assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
- assertEquals("active", userService.read(
- Long.parseLong(res.getResultByStatus(Status.SUCCESS).get(3).toString())).getStatus());
-
- bulkAction.setOperation(BulkAction.Type.DELETE);
- res = userService.bulk(bulkAction);
- assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
- assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
- }
-
- @Test
- public void issueSYNCOPE354() {
- // change resource-ldap role mapping for including uniqueMember (need for assertions below)
- ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP);
- for (MappingItemTO item : ldap.getRmapping().getItems()) {
- if ("description".equals(item.getExtAttrName())) {
- item.setExtAttrName("uniqueMember");
- }
- }
- resourceService.update(ldap.getKey(), ldap);
-
- // 1. create role with LDAP resource
- RoleTO roleTO = new RoleTO();
- roleTO.setName("SYNCOPE354-" + getUUIDString());
- roleTO.setParent(8L);
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
-
- // 2. create user with LDAP resource and membership of the above role
- UserTO userTO = getUniqueSampleTO("syncope354@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_LDAP);
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(roleTO.getKey());
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
-
- // 3. read role on resource, check that user DN is included in uniqueMember
- ConnObjectTO connObj = resourceService.getConnectorObject(
- RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getKey());
- assertNotNull(connObj);
- assertTrue(connObj.getPlainAttrMap().get("uniqueMember").getValues().
- contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
-
- // 4. remove membership
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
- userTO = updateUser(userMod);
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
-
- // 5. read role on resource, check that user DN was removed from uniqueMember
- connObj = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getKey());
- assertNotNull(connObj);
- assertFalse(connObj.getPlainAttrMap().get("uniqueMember").getValues().
- contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
-
- // 6. restore original resource-ldap role mapping
- for (MappingItemTO item : ldap.getRmapping().getItems()) {
- if ("uniqueMember".equals(item.getExtAttrName())) {
- item.setExtAttrName("description");
- }
- }
- resourceService.update(ldap.getKey(), ldap);
- }
-
- @Test
- public void issueSYNCOPE357() throws IOException {
- // 1. create role with LDAP resource
- RoleTO roleTO = new RoleTO();
- roleTO.setName("SYNCOPE357-" + getUUIDString());
- roleTO.setParent(8L);
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
-
- // 2. create user with membership of the above role
- UserTO userTO = getUniqueSampleTO("syncope357@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO("obscure", "valueToBeObscured"));
- userTO.getPlainAttrs().add(attrTO("photo",
- Base64Utility.encode(IOUtils.readBytesFromStream(getClass().getResourceAsStream("/favicon.jpg")))));
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(roleTO.getKey());
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
- assertNotNull(userTO.getPlainAttrMap().get("obscure"));
- assertNotNull(userTO.getPlainAttrMap().get("photo"));
-
- // 3. read user on resource
- ConnObjectTO connObj = resourceService.getConnectorObject(
- RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
- assertNotNull(connObj);
- AttrTO registeredAddress = connObj.getPlainAttrMap().get("registeredAddress");
- assertNotNull(registeredAddress);
- assertEquals(userTO.getPlainAttrMap().get("obscure").getValues(), registeredAddress.getValues());
- AttrTO jpegPhoto = connObj.getPlainAttrMap().get("jpegPhoto");
- assertNotNull(jpegPhoto);
- assertEquals(userTO.getPlainAttrMap().get("photo").getValues(), jpegPhoto.getValues());
-
- // 4. remove role
- roleService.delete(roleTO.getKey());
-
- // 5. try to read user on resource: fail
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE383() {
- // 1. create user without resources
- UserTO userTO = getUniqueSampleTO("syncope383@apache.org");
- userTO.getResources().clear();
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- // 2. assign resource without specifying a new pwd and check propagation failure
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
- userTO = updateUser(userMod);
- assertEquals(RESOURCE_NAME_TESTDB, userTO.getResources().iterator().next());
- assertFalse(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- assertNotNull(userTO.getPropagationStatusTOs().get(0).getFailureReason());
-
- // 3. request to change password only on testdb
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword(getUUIDString());
- StatusMod pwdPropRequest = new StatusMod();
- pwdPropRequest.getResourceNames().add(RESOURCE_NAME_TESTDB);
- userMod.setPwdPropRequest(pwdPropRequest);
-
- userTO = updateUser(userMod);
- assertEquals(RESOURCE_NAME_TESTDB, userTO.getResources().iterator().next());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- }
-
- @Test
- public void issueSYNCOPE402() {
- // 1. create an user with strict mandatory attributes only
- UserTO userTO = new UserTO();
- String userId = getUUIDString() + "syncope402@syncope.apache.org";
- userTO.setUsername(userId);
- userTO.setPassword("password");
-
- userTO.getPlainAttrs().add(attrTO("userId", userId));
- userTO.getPlainAttrs().add(attrTO("fullname", userId));
- userTO.getPlainAttrs().add(attrTO("surname", userId));
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertTrue(userTO.getResources().isEmpty());
-
- //2. update assigning a resource NOT forcing mandatory constraints
- // AND primary: must fail with PropagationException
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("newPassword");
-
- userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
- userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
- userTO = updateUser(userMod);
-
- List<PropagationStatus> propagationStatuses = userTO.getPropagationStatusTOs();
- PropagationStatus ws1PropagationStatus = null;
- if (propagationStatuses != null) {
- for (PropagationStatus propStatus : propagationStatuses) {
- if (RESOURCE_NAME_WS1.equals(propStatus.getResource())) {
- ws1PropagationStatus = propStatus;
- break;
- }
- }
- }
- assertNotNull(ws1PropagationStatus);
- assertEquals(RESOURCE_NAME_WS1, ws1PropagationStatus.getResource());
- assertNotNull(ws1PropagationStatus.getFailureReason());
- assertEquals(PropagationTaskExecStatus.UNSUBMITTED, ws1PropagationStatus.getStatus());
- }
-
- @Test
- public void unlink() {
- UserTO userTO = getUniqueSampleTO("unlink@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
-
- assertNotNull(userService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.UNLINK,
- CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
- }
-
- @Test
- public void link() {
- UserTO userTO = getUniqueSampleTO("link@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- final ResourceAssociationMod associationMod = new ResourceAssociationMod();
- associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
-
- assertNotNull(userService.bulkAssociation(
- actual.getKey(), ResourceAssociationActionType.LINK, associationMod).readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertFalse(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void unassign() {
- UserTO userTO = getUniqueSampleTO("unassign@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
-
- assertNotNull(userService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.UNASSIGN,
- CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void assign() {
- UserTO userTO = getUniqueSampleTO("assign@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- final ResourceAssociationMod associationMod = new ResourceAssociationMod();
- associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
- associationMod.setChangePwd(true);
- associationMod.setPassword("password");
-
- assertNotNull(userService.bulkAssociation(actual.getKey(), ResourceAssociationActionType.ASSIGN, associationMod)
- .readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertFalse(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
- }
-
- @Test
- public void deprovision() {
- UserTO userTO = getUniqueSampleTO("deprovision@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
-
- assertNotNull(userService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.DEPROVISION,
- CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertFalse(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void provision() {
- UserTO userTO = getUniqueSampleTO("provision@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- final ResourceAssociationMod associationMod = new ResourceAssociationMod();
- associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
- associationMod.setChangePwd(true);
- associationMod.setPassword("password");
-
- assertNotNull(userService.bulkAssociation(actual.getKey(), ResourceAssociationActionType.PROVISION,
- associationMod)
- .readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
- }
-
- @Test
- public void deprovisionUnlinked() {
- UserTO userTO = getUniqueSampleTO("provision@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
-
- final ResourceAssociationMod associationMod = new ResourceAssociationMod();
- associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
- associationMod.setChangePwd(true);
- associationMod.setPassword("password");
-
- assertNotNull(userService.bulkAssociation(actual.getKey(), ResourceAssociationActionType.PROVISION,
- associationMod)
- .readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
-
- assertNotNull(userService.bulkDeassociation(actual.getKey(),
- ResourceDeassociationActionType.DEPROVISION,
- CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertTrue(actual.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
- fail();
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void issueSYNCOPE420() {
- UserTO userTO = getUniqueSampleTO("syncope420@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO("makeItDouble", "3"));
-
- userTO = createUser(userTO);
- assertEquals("6", userTO.getPlainAttrMap().get("makeItDouble").getValues().get(0));
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getPlainAttrsToRemove().add("makeItDouble");
- userMod.getPlainAttrsToUpdate().add(attrMod("makeItDouble", "7"));
-
- userTO = updateUser(userMod);
- assertEquals("14", userTO.getPlainAttrMap().get("makeItDouble").getValues().get(0));
- }
-
- @Test
- public void issueSYNCOPE426() {
- UserTO userTO = getUniqueSampleTO("syncope426@syncope.apache.org");
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserMod userMod = new UserMod();
- userMod.setPassword("anotherPassword123");
- userTO = userService.update(userTO.getKey(), userMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- }
-
- @Test
- public void issueSYNCOPE435() {
- // 1. create user without password
- UserTO userTO = getUniqueSampleTO("syncope435@syncope.apache.org");
- userTO.setPassword(null);
- userTO = createUser(userTO, false);
- assertNotNull(userTO);
-
- // 2. try to update user by subscribing a resource - works but propagation is not even attempted
- UserMod userMod = new UserMod();
- userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
-
- userTO = userService.update(userTO.getKey(), userMod).readEntity(UserTO.class);
- assertEquals(Collections.singleton(RESOURCE_NAME_WS1), userTO.getResources());
- assertFalse(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getFailureReason().
- startsWith("Not attempted because there are mandatory attributes without value(s): [__PASSWORD__]"));
- }
-
- @Test
- public void ifMatch() {
- UserTO userTO = userService.create(getUniqueSampleTO("ifmatch@syncope.apache.org"), true).
- readEntity(UserTO.class);
- assertNotNull(userTO);
- assertNotNull(userTO.getKey());
-
- EntityTag etag = adminClient.getLatestEntityTag(userService);
- assertNotNull(etag);
- assertTrue(StringUtils.isNotBlank(etag.getValue()));
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setUsername(userTO.getUsername() + "XX");
- userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
- assertTrue(userTO.getUsername().endsWith("XX"));
- EntityTag etag1 = adminClient.getLatestEntityTag(userService);
- assertFalse(etag.getValue().equals(etag1.getValue()));
-
- UserService ifMatchService = adminClient.ifMatch(UserService.class, etag);
- userMod.setUsername(userTO.getUsername() + "YY");
- try {
- ifMatchService.update(userMod.getKey(), userMod);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.ConcurrentModification, e.getType());
- }
-
- userTO = userService.read(userTO.getKey());
- assertTrue(userTO.getUsername().endsWith("XX"));
- }
-
- @Test
- public void issueSYNCOPE454() throws NamingException {
- // 1. create user with LDAP resource (with 'Generate password if missing' enabled)
- UserTO userTO = getUniqueSampleTO("syncope454@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_LDAP);
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- // 2. read resource configuration for LDAP binding
- ConnObjectTO connObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
-
- // 3. try (and succeed) to perform simple LDAP binding with provided password ('password123')
- assertNotNull(getLdapRemoteObject(
- connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
- "password123",
- connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
-
- // 4. update user without any password change request
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPwdPropRequest(new StatusMod());
- userMod.getPlainAttrsToUpdate().add(attrMod("surname", "surname2"));
-
- userService.update(userTO.getKey(), userMod);
-
- // 5. try (and succeed again) to perform simple LDAP binding: password has not changed
- assertNotNull(getLdapRemoteObject(
- connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
- "password123",
- connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
- }
-
- @Test
- public void issueSYNCOPE493() {
- // 1. create user and check that firstname is not propagated on resource with mapping for firstname set to NONE
- UserTO userTO = getUniqueSampleTO("issueSYNCOPE493@test.org");
- userTO.getR
<TRUNCATED>
[48/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
index a308eef..b1729c1 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
@@ -29,18 +29,18 @@ under the License.
<span wicket:id="templates">[templates]</span>
</div>
- <div id="attrs">
+ <div id="plainAttrs">
<div id="formtable">
<div class="tablerow">
<div class="tablecolumn_label short_dynamicsize">
- <wicket:message key="inheritAttrs"/>
+ <wicket:message key="inheritPlainAttrs"/>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="inheritAttrs" />
+ <span wicket:id="inheritPlainAttrs" />
</div>
</div>
- <span wicket:id="attrs">[role attributes]</span>
+ <span wicket:id="plainAttrs">[role attributes]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
index 38b4584..86aace6 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
@@ -46,6 +46,6 @@ virAttrValue=Virtual value
addAttributeBtn=Add
-inheritAttrs=Inherit attributes
+inheritPlainAttrs=Inherit plain attributes
inheritDerAttrs=Inherit derived attributes
inheritVirAttrs=Inherit virtual attributes
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
index 8fc1ccf..068abdc 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
@@ -46,7 +46,7 @@ virAttrValue=Valore virtuale
addAttributeBtn=Aggiungi
-inheritAttrs=Eredita attributi
+inheritPlainAttrs=Eredita attributi normali
inheritDerAttrs=Eredita attributi derivati
inheritVirAttrs=Eredita attributi virtuali
firstEntitlementsList=Entitlement ruolo
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
index bf48ab6..e480811 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
@@ -35,6 +35,6 @@ virAttrValue=Valor Virtual
addAttributeBtn=Adicionar
-inheritAttrs=Atributos Herdados
+inheritPlainAttrs=Atributos Herdados Normal
inheritDerAttrs=Atributos Herdados Derivados
inheritVirAttrs=Atributos Virtuais Herdados
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
index 113fc12..226c172 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
@@ -20,10 +20,10 @@ under the License.
<wicket:panel>
<div style="float:left; width:70%;">
<script type="text/javascript">
- $(document).ready(function() {
+ $(document).ready(function () {
$("div form #tabs").tabs();
});
- $(document).ready(function() {
+ $(document).ready(function () {
$("div form #tabs #templates").tabs();
});
</script>
@@ -38,7 +38,7 @@ under the License.
<ul>
<li><a href="#details"><span><wicket:message key="details"/></span></a></li>
<li><a href="#templates"><span><wicket:message key="templates"/></span></a></li>
- <li><a href="#attrs"><span><wicket:message key="attrs"/></span></a></li>
+ <li><a href="#plainAttrs"><span><wicket:message key="plainAttrs"/></span></a></li>
<li><a href="#derAttrs"><span><wicket:message key="derAttrs"/></span></a></li>
<li><a href="#virAttrs"><span><wicket:message key="virAttrs"/></span></a></li>
<li><a href="#resources"><span><wicket:message key="resources"/></span></a></li>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
index 605c289..b49cf51 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
@@ -16,7 +16,7 @@
# under the License.
title=Role
details=Details
-attrs=Attributes
+plainAttrs=Plain attributes
derAttrs=Derived attributes
virAttrs=Virtual attributes
resources=Resources
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
index 26ef8a5..727fe69 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
@@ -16,7 +16,7 @@
# under the License.
title=Ruolo
details=Dettagli
-attrs=Attributi
+plainAttrs=Attributi normali
derAttrs=Attributi derivati
virAttrs=Attributi virtuali
resources=Risorse
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
index 2ecc202..f01ecac 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
@@ -16,7 +16,7 @@
# under the License.
title=Fun\u00e7\u00e3o
details=Detalhes
-attrs=Atributos
+plainAttrs=Atributos Normal
derAttrs=Atributos Derivados
virAttrs=Atributos Virtuais
resources=Recursos
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/AttributableOperations.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/AttributableOperations.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/AttributableOperations.java
index ad5d322..1c53db6 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/AttributableOperations.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/AttributableOperations.java
@@ -358,14 +358,14 @@ public final class AttributableOperations {
}
// 5. templates
- Set<String> updatedTemplates = new HashSet<>(updated.getRAttrTemplates());
- Set<String> originalTemplates = new HashSet<>(original.getRAttrTemplates());
+ Set<String> updatedTemplates = new HashSet<>(updated.getRPlainAttrTemplates());
+ Set<String> originalTemplates = new HashSet<>(original.getRPlainAttrTemplates());
if (updatedTemplates.equals(originalTemplates)) {
result.setModRAttrTemplates(false);
result.getRPlainAttrTemplates().clear();
} else {
result.setModRAttrTemplates(true);
- result.getRPlainAttrTemplates().addAll(updated.getRAttrTemplates());
+ result.getRPlainAttrTemplates().addAll(updated.getRPlainAttrTemplates());
}
updatedTemplates = new HashSet<>(updated.getRDerAttrTemplates());
originalTemplates = new HashSet<>(original.getRDerAttrTemplates());
@@ -385,14 +385,14 @@ public final class AttributableOperations {
result.setModRVirAttrTemplates(true);
result.getRVirAttrTemplates().addAll(updated.getRVirAttrTemplates());
}
- updatedTemplates = new HashSet<>(updated.getMAttrTemplates());
- originalTemplates = new HashSet<>(original.getMAttrTemplates());
+ updatedTemplates = new HashSet<>(updated.getMPlainAttrTemplates());
+ originalTemplates = new HashSet<>(original.getMPlainAttrTemplates());
if (updatedTemplates.equals(originalTemplates)) {
result.setModMAttrTemplates(false);
result.getMPlainAttrTemplates().clear();
} else {
result.setModMAttrTemplates(true);
- result.getMPlainAttrTemplates().addAll(updated.getMAttrTemplates());
+ result.getMPlainAttrTemplates().addAll(updated.getMPlainAttrTemplates());
}
updatedTemplates = new HashSet<>(updated.getMDerAttrTemplates());
originalTemplates = new HashSet<>(original.getMDerAttrTemplates());
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/RoleReportletConf.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/RoleReportletConf.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/RoleReportletConf.java
index e91252d..9f73d3d 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/RoleReportletConf.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/RoleReportletConf.java
@@ -53,7 +53,7 @@ public class RoleReportletConf extends AbstractReportletConf {
private String matchingCond;
@FormAttributeField(schema = IntMappingType.RolePlainSchema)
- private final List<String> attrs = new ArrayList<>();
+ private final List<String> plainAttrs = new ArrayList<>();
@FormAttributeField(schema = IntMappingType.RoleDerivedSchema)
private final List<String> derAttrs = new ArrayList<>();
@@ -75,7 +75,7 @@ public class RoleReportletConf extends AbstractReportletConf {
@XmlElement(name = "plainAttribute")
@JsonProperty("plainAttributes")
public List<String> getPlainAttrs() {
- return attrs;
+ return plainAttrs;
}
@XmlElementWrapper(name = "derivedAttributes")
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
index c82052c..78735eb 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/UserReportletConf.java
@@ -58,7 +58,7 @@ public class UserReportletConf extends AbstractReportletConf {
private String matchingCond;
@FormAttributeField(schema = IntMappingType.UserPlainSchema)
- private final List<String> attrs = new ArrayList<>();
+ private final List<String> plainAttrs = new ArrayList<>();
@FormAttributeField(schema = IntMappingType.UserDerivedSchema)
private final List<String> derAttrs = new ArrayList<>();
@@ -80,7 +80,7 @@ public class UserReportletConf extends AbstractReportletConf {
@XmlElement(name = "plainAttribute")
@JsonProperty("plainAttributes")
public List<String> getPlainAttrs() {
- return attrs;
+ return plainAttrs;
}
@XmlElementWrapper(name = "derivedAttributes")
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java
index 5a006f5..4945cca 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/search/SearchableFields.java
@@ -20,8 +20,10 @@ package org.apache.syncope.common.lib.search;
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.syncope.common.lib.to.AbstractAttributableTO;
import org.apache.syncope.common.lib.to.RoleTO;
@@ -31,9 +33,7 @@ import org.apache.syncope.common.lib.types.SubjectType;
public class SearchableFields {
protected static final String[] ATTRIBUTES_NOTINCLUDED = {
- "plainAttrs", "derAttrs", "virAttrs",
- "serialVersionUID", "memberships", "entitlements", "resources", "password",
- "propagationTOs", "propagationStatusMap"
+ "serialVersionUID", "password"
};
public static final List<String> get(final SubjectType subjectType) {
@@ -49,7 +49,10 @@ public class SearchableFields {
Class<?> clazz = attributableRef;
while (clazz != null && clazz != Object.class) {
for (Field field : clazz.getDeclaredFields()) {
- if (!ArrayUtils.contains(ATTRIBUTES_NOTINCLUDED, field.getName())) {
+ if (!ArrayUtils.contains(ATTRIBUTES_NOTINCLUDED, field.getName())
+ && !Collection.class.isAssignableFrom(field.getType())
+ && !Map.class.isAssignableFrom(field.getType())) {
+
fieldNames.add(field.getName());
}
}
@@ -58,7 +61,6 @@ public class SearchableFields {
Collections.reverse(fieldNames);
return fieldNames;
-
}
private SearchableFields() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSubjectTO.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSubjectTO.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSubjectTO.java
index 5c9fa42..a2e1b3a 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSubjectTO.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSubjectTO.java
@@ -45,7 +45,7 @@ public abstract class AbstractSubjectTO extends AbstractAttributableTO {
public boolean removePropagationTO(final String resource) {
if (resource != null && getPropagationStatusTOs().isEmpty()) {
- final List<PropagationStatus> toBeRemoved = new ArrayList<PropagationStatus>();
+ final List<PropagationStatus> toBeRemoved = new ArrayList<>();
for (PropagationStatus propagationTO : getPropagationStatusTOs()) {
if (resource.equals(propagationTO.getResource())) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
index b921e53..51feffa 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
@@ -37,7 +37,7 @@ public class NotificationTO extends AbstractBaseBean {
private Long key;
- private List<String> events = new ArrayList<>();
+ private final List<String> events = new ArrayList<>();
private String userAbout;
@@ -45,7 +45,7 @@ public class NotificationTO extends AbstractBaseBean {
private String recipients;
- private List<String> staticRecipients = new ArrayList<>();
+ private final List<String> staticRecipients = new ArrayList<>();
private IntMappingType recipientAttrType;
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
index 2a353cf..7f0f0af 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
@@ -59,13 +59,13 @@ public class RoleTO extends AbstractSubjectTO {
private final List<String> entitlements = new ArrayList<>();
- private List<String> rAttrTemplates = new ArrayList<>();
+ private List<String> rPlainAttrTemplates = new ArrayList<>();
private List<String> rDerAttrTemplates = new ArrayList<>();
private List<String> rVirAttrTemplates = new ArrayList<>();
- private List<String> mAttrTemplates = new ArrayList<>();
+ private List<String> mPlainAttrTemplates = new ArrayList<>();
private List<String> mDerAttrTemplates = new ArrayList<>();
@@ -154,11 +154,11 @@ public class RoleTO extends AbstractSubjectTO {
return entitlements;
}
- @XmlElementWrapper(name = "rAttrTemplates")
- @XmlElement(name = "rAttrTemplate")
- @JsonProperty("rAttrTemplates")
- public List<String> getRAttrTemplates() {
- return rAttrTemplates;
+ @XmlElementWrapper(name = "rPlainAttrTemplates")
+ @XmlElement(name = "rPlainAttrTemplate")
+ @JsonProperty("rPlainAttrTemplates")
+ public List<String> getRPlainAttrTemplates() {
+ return rPlainAttrTemplates;
}
@XmlElementWrapper(name = "rDerAttrTemplates")
@@ -175,11 +175,11 @@ public class RoleTO extends AbstractSubjectTO {
return rVirAttrTemplates;
}
- @XmlElementWrapper(name = "mAttrTemplates")
- @XmlElement(name = "mAttrTemplate")
- @JsonProperty("mAttrTemplates")
- public List<String> getMAttrTemplates() {
- return mAttrTemplates;
+ @XmlElementWrapper(name = "mPlainAttrTemplates")
+ @XmlElement(name = "mPlainAttrTemplate")
+ @JsonProperty("mPlainAttrTemplates")
+ public List<String> getMPlainAttrTemplates() {
+ return mPlainAttrTemplates;
}
@XmlElementWrapper(name = "mDerAttrTemplates")
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
index cac7c1c..7de0e48 100644
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.common.lib.types;
-public interface PolicySpec {
+import java.io.Serializable;
+
+public interface PolicySpec extends Serializable {
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectId.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectId.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectId.java
deleted file mode 100644
index d61f1d9..0000000
--- a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectId.java
+++ /dev/null
@@ -1,25 +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.common.lib.wrap;
-
-public class SubjectId extends AbstractWrappable<Long> {
-
- private static final long serialVersionUID = -8664228651057889297L;
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectKey.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectKey.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectKey.java
new file mode 100644
index 0000000..930cf35
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/SubjectKey.java
@@ -0,0 +1,25 @@
+/*
+ * 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.common.lib.wrap;
+
+public class SubjectKey extends AbstractWrappable<Long> {
+
+ private static final long serialVersionUID = -8664228651057889297L;
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
index b0580c3..9199d37 100644
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
@@ -39,7 +39,7 @@ import org.apache.syncope.common.lib.to.ConnObjectTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.wrap.SubjectId;
+import org.apache.syncope.common.lib.wrap.SubjectKey;
/**
* REST operations for external resources.
@@ -133,7 +133,7 @@ public interface ResourceService extends JAXRSService {
* @param resourceKey name of resource
* @param subjectType subject type (user or role)
* @param type resource de-association action type
- * @param subjectIds users or roles against which the bulk action will be performed
+ * @param subjectKeys users or roles against which the bulk action will be performed
* @return <tt>Response</tt> object featuring {@link BulkActionResult} as <tt>Entity</tt>
*/
@Descriptions({
@@ -146,7 +146,7 @@ public interface ResourceService extends JAXRSService {
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
BulkActionResult bulkDeassociation(@NotNull @PathParam("resourceKey") String resourceKey,
@NotNull @PathParam("subjType") SubjectType subjectType,
- @NotNull @PathParam("type") ResourceDeassociationActionType type, @NotNull List<SubjectId> subjectIds);
+ @NotNull @PathParam("type") ResourceDeassociationActionType type, @NotNull List<SubjectKey> subjectKeys);
/**
* Executes the provided bulk action.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/pom.xml b/syncope620/fit/console-reference/pom.xml
new file mode 100644
index 0000000..6d94373
--- /dev/null
+++ b/syncope620/fit/console-reference/pom.xml
@@ -0,0 +1,525 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.syncope</groupId>
+ <artifactId>syncope-fit</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope FIT Console Reference</name>
+ <description>Apache Syncope FIT Console Reference</description>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-console-reference</artifactId>
+ <packaging>war</packaging>
+
+ <properties>
+ <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>javax.servlet.jsp-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.client</groupId>
+ <artifactId>syncope-client-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.lmax</groupId>
+ <artifactId>disruptor</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>jquery-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>codemirror</artifactId>
+ </dependency>
+
+ <!-- TEST -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.activiti</groupId>
+ <artifactId>activiti-webapp-explorer2</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-build-tools</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.tirasa.connid.bundles.soap</groupId>
+ <artifactId>wssample</artifactId>
+ <version>${connid.soap.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- SELENIUM INTEGRATION TEST -->
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-java</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>setupActivitiModeler</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war" dest="${project.build.directory}/activiti-webapp-explorer2" />
+
+ <mkdir dir="${activiti-modeler.directory}" />
+
+ <mkdir dir="${activiti-modeler.directory}/editor" />
+ <copy todir="${activiti-modeler.directory}/editor">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/editor">
+ <exclude name="oryx.js" />
+ </fileset>
+ </copy>
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml" todir="${activiti-modeler.directory}/editor" />
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json" todir="${activiti-modeler.directory}/editor" />
+
+ <mkdir dir="${activiti-modeler.directory}/explorer" />
+ <copy todir="${activiti-modeler.directory}/explorer">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/explorer" />
+ </copy>
+
+ <mkdir dir="${activiti-modeler.directory}/libs" />
+ <copy todir="${activiti-modeler.directory}/libs">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/libs" />
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>replacer</artifactId>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <file>${activiti-modeler.directory}/editor/oryx.debug.js</file>
+ <tokenValueMap>${basedir}/src/main/resources/oryx.debug.js-tokenValueMap.properties</tokenValueMap>
+ <unescape>true</unescape>
+ <regex>false</regex>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <container>
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ </dependencies>
+ </container>
+ <configuration>
+ <type>standalone</type>
+ <properties>
+ <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
+ <cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
+ <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
+
+ <cargo.jvmargs>-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
+ </properties>
+ <configfiles>
+ <configfile>
+ <file>${project.build.directory}/classes/context.xml</file>
+ <todir>conf/</todir>
+ <tofile>context.xml</tofile>
+ </configfile>
+ </configfiles>
+ </configuration>
+ <deployables>
+ <deployable>
+ <groupId>net.tirasa.connid.bundles.soap</groupId>
+ <artifactId>wssample</artifactId>
+ <type>war</type>
+ <properties>
+ <context>wssample</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-build-tools</artifactId>
+ <type>war</type>
+ <properties>
+ <context>syncope-fit-build-tools</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <location>${basedir}/../server-reference/target/syncope-fit-server-reference-${project.version}</location>
+ <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
+ <pingTimeout>60000</pingTimeout>
+ <properties>
+ <context>syncope</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <location>${project.build.directory}/${project.build.finalName}</location>
+ <properties>
+ <context>syncope-console</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>debug</id>
+
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+
+ <build>
+ <defaultGoal>clean verify cargo:run</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <configuration>
+ <properties>
+ <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
+ -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
+ </properties>
+ </configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>skipTests</id>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <deployables>
+ <deployable>
+ <location>${project.build.directory}/${project.build.finalName}.war</location>
+ </deployable>
+ </deployables>
+ </configuration>
+ <executions>
+ <execution>
+ <id>install-container</id>
+ <phase>package</phase>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>start-container</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>selenium</id>
+
+ <build>
+ <defaultGoal>clean verify</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <wait>false</wait>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>jrebel</id>
+
+ <properties>
+ <javaagent>-javaagent:${env.REBEL_HOME}/jrebel.jar</javaagent>
+ </properties>
+
+ <build>
+ <defaultGoal>clean verify cargo:run</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <classpath>
+ <fallback>default</fallback>
+ <resources>
+ <resource/>
+ <resource>
+ <directory>${basedir}/../../client/console/target/classes</directory>
+ </resource>
+ </resources>
+ </classpath>
+
+ <web>
+ <resources>
+ <resource/>
+ <resource>
+ <target>/</target>
+ <directory>${basedir}/../../client/console/target/classes/META-INF/resources/</directory>
+ </resource>
+ </resources>
+ </web>
+
+ <alwaysGenerate>true</alwaysGenerate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <configuration>
+ <properties>
+ <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
+ -noverify ${javaagent} -Drebel.spring_plugin=true
+ -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m</cargo.jvmargs>
+ </properties>
+ </configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/main/resources/console.properties b/syncope620/fit/console-reference/src/main/resources/console.properties
new file mode 100644
index 0000000..cf20f3c
--- /dev/null
+++ b/syncope620/fit/console-reference/src/main/resources/console.properties
@@ -0,0 +1,22 @@
+# 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.
+console.directory=${conf.directory}
+scheme=http
+host=localhost
+port=9080
+rootPath=/syncope/rest/
+activitiModelerDirectory=${activiti-modeler.directory}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/main/resources/context.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/main/resources/context.xml b/syncope620/fit/console-reference/src/main/resources/context.xml
new file mode 100644
index 0000000..471d561
--- /dev/null
+++ b/syncope620/fit/console-reference/src/main/resources/context.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+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.
+-->
+<Context>
+ <!-- Disable session persistence across Tomcat restarts -->
+ <Manager pathname=""/>
+</Context>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/main/resources/log4j2.xml b/syncope620/fit/console-reference/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..a7c1fa6
--- /dev/null
+++ b/syncope620/fit/console-reference/src/main/resources/log4j2.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<configuration status="WARN">
+
+ <appenders>
+
+ <RollingRandomAccessFile name="main" fileName="${log.directory}/console.log"
+ filePattern="${log.directory}/console-%d{yyyy-MM-dd}.log.gz"
+ immediateFlush="false" append="true">
+ <PatternLayout>
+ <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+ </PatternLayout>
+ <Policies>
+ <TimeBasedTriggeringPolicy/>
+ <SizeBasedTriggeringPolicy size="250 MB"/>
+ </Policies>
+ </RollingRandomAccessFile>
+
+ </appenders>
+
+ <loggers>
+
+ <asyncLogger name="org.apache.syncope.client.lib" additivity="false" level="OFF">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.apache.syncope.client.console" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.apache.wicket" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.springframework" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.apache.cxf" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
+ <root level="ERROR">
+ <appender-ref ref="main"/>
+ </root>
+
+ </loggers>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties b/syncope620/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
new file mode 100644
index 0000000..17fdbcc
--- /dev/null
+++ b/syncope620/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
@@ -0,0 +1,35 @@
+# 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.
+ORYX.CONFIG.ROOT_PATH \= "../editor/"; //TODO: Remove last slash!!=BASE_PATH = window.location.toString().substr(0, window.location.toString().indexOf('/wicket'));\nORYX.CONFIG.ROOT_PATH = BASE_PATH + "/activiti-modeler/editor/";
+ORYX.CONFIG.EXPLORER_PATH \= "../explorer";=ORYX.CONFIG.EXPLORER_PATH = BASE_PATH + "/activiti-modeler/explorer";
+ORYX.CONFIG.LIBS_PATH \= "../libs";=ORYX.CONFIG.LIBS_PATH = BASE_PATH + "/activiti-modeler/libs";
+ORYX.CONFIG.SYNTAXCHECKER_URL \==ORYX.CONFIG.PLUGINS_CONFIG = ORYX.CONFIG.ROOT_PATH + "plugins.xml";\nORYX.CONFIG.SYNTAXCHECKER_URL =
+this._baseUrl \= "../editor/stencilsets/bpmn2.0/";=this._baseUrl = ORYX.CONFIG.ROOT_PATH + "stencilsets/bpmn2.0/";
+this._source \= "../stencilsets/bpmn2.0/bpmn2.0.json";=this._source = ORYX.CONFIG.ROOT_PATH + "stencilsets/bpmn2.0/bpmn2.0.json";
+"../service/editor/stencilset"=ORYX.CONFIG.ROOT_PATH + "stencilset.json"
+ORYX.Editor.createByUrl=modelUrl = BASE_PATH + "/workflowDefGET";\nORYX.Editor.createByUrl
+../explorer/src/img/signavio/smoky/logo2.png="+ORYX.CONFIG.EXPLORER_PATH+"/src/img/signavio/smoky/logo2.png
+<a href\=\\""+ORYX.CONFIG.WEB_URL+"\\" target\=\\"_self\\" title\=\\"close modeler\\">=<a href=\\"#\\" title=\\"close modeler\\" onclick=\\"window.close();\\">
+../editor/images/close_button.png="+ORYX.CONFIG.ROOT_PATH+"images/close_button.png
+height:16px;width:16px;margin-bottom:-4px;background: transparent url(../libs/ext-2.0.2/resources/images/default/tree/loading.gif) no-repeat center;=height:16px;width:16px;margin-bottom:-4px;background: transparent url("+ORYX.CONFIG.LIBS_PATH+"/ext-2.0.2/resources/images/default/tree/loading.gif) no-repeat center;
+icon: '../editor/images/add.png',=icon: ORYX.CONFIG.ROOT_PATH + 'images/add.png',
+icon: '../editor/images/delete.png',=icon: ORYX.CONFIG.ROOT_PATH + 'images/delete.png',
+id\="edit_model_title"=id="edit_model_title" readonly="readonly"
+id\="edit_model_summary"=id="edit_model_summary" readonly="readonly"
+"../service/model/" + modelMeta.modelId + "/json"=BASE_PATH + "/workflowDefGET"
+// Send the request to the server.=saveUri = BASE_PATH + "/workflowDefPUT";\n// Send the request to the server.
+'Accept':"application/json", 'Content-Type':'charset\=UTF-8'='Accept':"application/json", 'Content-Type':'application/json'
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
new file mode 100644
index 0000000..1bd2027
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AbstractITCase.java
@@ -0,0 +1,70 @@
+/*
+ * 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.fit.console.reference;
+
+import org.junit.After;
+import org.junit.Before;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractITCase {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractITCase.class);
+
+ public static final String ADMIN = "admin";
+
+ public static final String PASSWORD = "password";
+
+ public static final String BASE_URL = "http://localhost:9080/syncope-console/";
+
+ protected WebDriver seleniumDriver;
+
+ protected WebDriverWait wait;
+
+ @Before
+ public void setUp() throws Exception {
+ seleniumDriver = new FirefoxDriver();
+ seleniumDriver.get(BASE_URL);
+ wait = new WebDriverWait(seleniumDriver, 10);
+
+ WebElement element = seleniumDriver.findElement(By.name("userId"));
+ element.sendKeys(ADMIN);
+ element = seleniumDriver.findElement(By.name("password"));
+ element.sendKeys(PASSWORD);
+ seleniumDriver.findElement(By.name("p::submit")).click();
+
+ (new WebDriverWait(seleniumDriver, 10))
+ .until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt='Logout']")));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Logout\"]")).click();
+ seleniumDriver.quit();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java
new file mode 100644
index 0000000..557e9af
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.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.fit.console.reference;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+public class AccessITCase extends AbstractITCase {
+
+ @Test
+ public void clickAround() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Schema\"]")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']/ul/li[2]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[@id='uschema']/div/div/span/ul/li[2]/a")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='uschema']/div/div/span/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='uschema']/div/div/span/ul/li[3]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='mschema']/div/div/span/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='mschema']/div/div/span/ul/li[3]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[4]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[@id='rschema']/div/div/span/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='rschema']/div/div/span/ul/li[3]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Users\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[3]/ul/li[2]/a/span")));
+ seleniumDriver.findElement(By.xpath("//div[3]/ul/li[2]/a/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Roles\"]")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt=\"Resources\"]")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt=\"TODO\"]")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"TODO\"]")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt=\"Reports\"]")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Reports\"]")).click();
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt=\"Configuration\"]")));
+
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Tasks\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Tasks\"]")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[5]/a/span")).click();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java
new file mode 100644
index 0000000..b4a06f5
--- /dev/null
+++ b/syncope620/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java
@@ -0,0 +1,402 @@
+/*
+ * 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.fit.console.reference;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+
+public class ConfigurationITCase extends AbstractITCase {
+
+ @Test
+ public void editParameters() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@title='Parameters']")));
+
+ seleniumDriver.findElement(By.xpath("//img[@title='Parameters']/ancestor::a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ seleniumDriver.findElement(
+ By.xpath("//span[contains(text(), 'log.lastlogindate')]/../../div[2]/span/input")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/input[@type='submit']")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(
+ seleniumDriver.findElement(By.tagName("body")).getText().contains("Operation executed successfully"));
+ }
+
+ @Test
+ public void browsePasswordPolicy() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='policies']/ul/li[2]/a")).click();
+ seleniumDriver.findElement(By.xpath("//div[@id='password']/span/div/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@name='key:textField']")));
+
+ WebElement element = seleniumDriver.findElement(By.name("description:textField"));
+ element.sendKeys("new description");
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/input[@type='submit']")).click();
+ seleniumDriver.switchTo().defaultContent();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(
+ seleniumDriver.findElement(By.tagName("body")).getText().contains("Operation executed successfully"));
+ }
+
+ @Test
+ public void browseWorkflowDef() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[5]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='workflow']/div/span/img")));
+ }
+
+ @Test
+ public void setLogLevel() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[6]/a")).click();
+
+ final Select select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[@id='core']/div/span/table/tbody/tr/td[2]/select")));
+ select.selectByVisibleText("ERROR");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='workflow']/div/span/img")));
+ wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("feedback")));
+ assertTrue(
+ seleniumDriver.findElement(By.tagName("body")).getText().contains("Operation executed successfully"));
+ }
+
+ @Test
+ public void createNotification() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[@id='notifications']/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[3]/div/div/div/div/label")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@name='sender:textField']")));
+
+ seleniumDriver.findElement(By.name("sender:textField")).sendKeys("test@syncope.it");
+
+ seleniumDriver.findElement(By.name("subject:textField")).sendKeys("test@syncope.it");
+
+ Select select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[3]/div[2]/span/select")));
+ select.selectByVisibleText("UserPlainSchema");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[3]/div/div/div[4]/div[2]/span/select/option[2]")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[4]/div[2]/span/select")));
+ select.selectByVisibleText("fullname");
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[5]/div[2]/span/select")));
+ select.selectByVisibleText("optin");
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[6]/div[2]/span/select")));
+ select.selectByVisibleText("ALL");
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[3]/a/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[2]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']"
+ + "/option[text()='PROPAGATION']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']")));
+ select.selectByVisibleText("PROPAGATION");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']"
+ + "/option[text()='role']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']")));
+ select.selectByVisibleText("role");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']"
+ + "/option[text()='resource-db-sync']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']")));
+ select.selectByVisibleText("resource-db-sync");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//input[@name='eventSelection:eventsContainer:eventsPanel:failureGroup']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@class='eventSelectionWidzard']/div[2]/div[3]/span/div/input")).
+ click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[4]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div[4]/div/div/span/input")).click();
+
+ wait.until(ExpectedConditions.elementToBeClickable(By.name(
+ "staticRecipients:multiValueContainer:view:0:panel:textField")));
+
+ seleniumDriver.findElement(By.name(
+ "staticRecipients:multiValueContainer:view:0:panel:textField")).
+ sendKeys("syncope445@syncope.apache.org");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[3]/div[4]/div/div[2]/label")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[4]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+ }
+
+ @Test
+ public void createDisabledNotification() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[@id='notifications']/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[3]/div/div/div/div/label")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@name='sender:textField']")));
+
+ seleniumDriver.findElement(By.name("sender:textField")).sendKeys("test@syncope.it");
+
+ Select select = new Select(seleniumDriver.findElement(
+ By.xpath("//div[2]/form/div[3]/div/div[1]/div[3]/div[2]/span/select")));
+ select.selectByVisibleText("UserPlainSchema");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//div[2]/form/div[3]/div/div/div[4]/div[2]/span/select/option[2]")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[4]/div[2]/span/select")));
+ select.selectByVisibleText("fullname");
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[5]/div[2]/span/select")));
+ select.selectByVisibleText("optin");
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[6]/div[2]/span/select")));
+ select.selectByVisibleText("ALL");
+
+ // disable notification
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[7]/div[2]/span/input")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[3]/a/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[2]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']"
+ + "/option[text()='PROPAGATION']")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']")));
+ select.selectByVisibleText("PROPAGATION");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']"
+ + "/option[text()='role']")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']")));
+ select.selectByVisibleText("role");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']"
+ + "/option[text()='resource-db-sync']")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']")));
+ select.selectByVisibleText("resource-db-sync");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//input[@name='eventSelection:eventsContainer:eventsPanel:failureGroup']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@class='eventSelectionWidzard']/div[2]/div[3]/span/div/input")).
+ click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[4]/a/span")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div[4]/div/div/span/input")).click();
+
+ wait.until(ExpectedConditions.elementToBeClickable(By.name(
+ "staticRecipients:multiValueContainer:view:0:panel:textField")));
+
+ seleniumDriver.findElement(
+ By.name("staticRecipients:multiValueContainer:view:0:panel:textField"))
+ .sendKeys("syncope492@syncope.apache.org");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//div[2]/form/div[3]/div[4]/div/div[2]/label")));
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[4]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+ }
+
+ @Test
+ public void issueSYNCOPE446() {
+ seleniumDriver.findElement(By.xpath("//img[@alt=\"Configuration\"]")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[@id='tabs']")));
+
+ seleniumDriver.findElement(By.xpath("//div[@id='tabs']/ul/li[3]/a")).click();
+
+ seleniumDriver.findElement(By.xpath("//div[@id='notifications']/a")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe")));
+ seleniumDriver.switchTo().frame(0);
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[2]/form/div[3]/div/div/div/div/label")));
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@name='sender:textField']")));
+
+ seleniumDriver.findElement(By.name("sender:textField")).sendKeys("syncope446@syncope.it");
+ seleniumDriver.findElement(By.name("subject:textField")).sendKeys("Test issue Syncope 446");
+
+ Select select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[3]/div[2]/span/select")));
+ select.selectByVisibleText("UserPlainSchema");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//div[2]/form/div[3]/div/div/div[4]/div[2]/span/select/option[2]")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[4]/div[2]/span/select")));
+ select.selectByVisibleText("email");
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[5]/div[2]/span/select")));
+ select.selectByVisibleText("optin");
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div/div/div[6]/div[2]/span/select")));
+ select.selectByVisibleText("ALL");
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[2]/a/span")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']"
+ + "/option[text()='REST']")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']")));
+ select.selectByVisibleText("REST");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']"
+ + "/option[text()='RoleLogic']")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath(
+ "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']")));
+ select.selectByVisibleText("RoleLogic");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//input[@name='eventSelection:eventsContainer:eventsPanel:successGroup']")));
+
+ seleniumDriver.findElement(
+ By.xpath("//div[@class='eventSelectionWidzard']/div[2]/div[3]/span/div/input")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[3]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/div[3]/span/div[4]/div/span/input")).click();
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(
+ By.xpath("//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:type']"
+ + "/option[text()='ENTITLEMENT']")));
+
+ wait.until(ExpectedConditions.elementToBeClickable(
+ By.xpath("//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:type']")));
+
+ select = new Select(
+ seleniumDriver.findElement(By.xpath(
+ "//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:type']")));
+ select.selectByVisibleText("ENTITLEMENT");
+
+ wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(
+ "//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:property']"
+ + "/option[text()='ROLE_CREATE']")));
+
+ select = new Select(seleniumDriver.findElement(By.xpath(
+ "//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:property']")));
+ select.selectByVisibleText("ROLE_CREATE");
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[3]/ul/li[4]/a/span")).click();
+ seleniumDriver.findElement(By.xpath("//input[@name='recipientsContainer:checkRecipients:checkboxField']")).
+ click();
+
+ wait.until(ExpectedConditions.elementToBeClickable(By.name(
+ "staticRecipients:multiValueContainer:view:0:panel:textField")));
+
+ seleniumDriver.findElement(By.name("staticRecipients:multiValueContainer:view:0:panel:textField")).
+ sendKeys("syncope446@syncope.apache.org");
+
+ seleniumDriver.findElement(By.xpath("//div[2]/form/div[4]/input")).click();
+
+ seleniumDriver.switchTo().defaultContent();
+ }
+}
[08/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/pom.xml b/syncope620/fit/server-reference/pom.xml
new file mode 100644
index 0000000..0fa46dd
--- /dev/null
+++ b/syncope620/fit/server-reference/pom.xml
@@ -0,0 +1,526 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.syncope</groupId>
+ <artifactId>syncope-fit</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>Apache Syncope FIT Server Reference</name>
+ <description>Apache Syncope FIT Server Reference</description>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-server-reference</artifactId>
+ <packaging>war</packaging>
+
+ <properties>
+ <jdbcdriver.groupId>com.h2database</jdbcdriver.groupId>
+ <jdbcdriver.artifactId>h2</jdbcdriver.artifactId>
+
+ <rootpom.basedir>${basedir}/../..</rootpom.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>javax.servlet.jsp-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.server</groupId>
+ <artifactId>syncope-server-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.server</groupId>
+ <artifactId>syncope-server-workflow-java</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.server</groupId>
+ <artifactId>syncope-server-persistence-jpa</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-build-tools</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.tirasa.connid.bundles.soap</groupId>
+ <artifactId>wssample</artifactId>
+ <version>${connid.soap.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.lmax</groupId>
+ <artifactId>disruptor</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>jquery</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>jquery-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>highlightjs</artifactId>
+ </dependency>
+
+ <!-- TEST -->
+ <dependency>
+ <groupId>org.apache.syncope.ext.camel</groupId>
+ <artifactId>syncope-ext-camel-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.client</groupId>
+ <artifactId>syncope-client-lib</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>set-bundles</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>setupCSV</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <target>
+ <copy file="${project.build.directory}/test-classes/test.csv" todir="${test.csvdir.path}" overwrite="true"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <systemPropertyVariables>
+ <jaxrsContentType>${jaxrs.content.type}</jaxrsContentType>
+ </systemPropertyVariables>
+ </configuration>
+ <executions>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <container>
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${jdbcdriver.groupId}</groupId>
+ <artifactId>${jdbcdriver.artifactId}</artifactId>
+ </dependency>
+ </dependencies>
+ </container>
+ <configuration>
+ <type>standalone</type>
+ <properties>
+ <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
+ <cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
+ <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
+
+ <cargo.jvmargs>-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
+ </properties>
+ <configfiles>
+ <configfile>
+ <file>${project.build.directory}/classes/context.xml</file>
+ <todir>conf/</todir>
+ <tofile>context.xml</tofile>
+ </configfile>
+ </configfiles>
+ </configuration>
+ <deployables>
+ <deployable>
+ <groupId>net.tirasa.connid.bundles.soap</groupId>
+ <artifactId>wssample</artifactId>
+ <type>war</type>
+ <properties>
+ <context>wssample</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-build-tools</artifactId>
+ <type>war</type>
+ <properties>
+ <context>syncope-fit-build-tools</context>
+ </properties>
+ </deployable>
+ <deployable>
+ <location>${project.build.directory}/${project.build.finalName}</location>
+ <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
+ <pingTimeout>60000</pingTimeout>
+ <properties>
+ <context>syncope</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../server/persistence-jpa/src/test/resources</directory>
+ <includes>
+ <include>content.xml</include>
+ <include>persistence.properties</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>${basedir}/../../server/misc/src/main/resources</directory>
+ <includes>
+ <include>security.properties</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>debug</id>
+
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+
+ <build>
+ <defaultGoal>clean verify cargo:run</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <configuration>
+ <properties>
+ <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
+ -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs>
+ </properties>
+ </configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>skipTests</id>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <skipTests>${skipTests}</skipTests>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <deployables>
+ <deployable>
+ <location>${project.build.directory}/${project.build.finalName}.war</location>
+ </deployable>
+ </deployables>
+ </configuration>
+ <executions>
+ <execution>
+ <id>install-container</id>
+ <phase>package</phase>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>start-container</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>light</id>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <excludes>
+ <exclude>workflow.properties</exclude>
+ <exclude>provisioning.properties</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/main/resources/light</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+
+ <profile>
+ <id>all</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.syncope.server</groupId>
+ <artifactId>syncope-server-workflow-activiti</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.ext.camel</groupId>
+ <artifactId>syncope-ext-camel-rest-cxf</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.camel</groupId>
+ <artifactId>syncope-ext-camel-persistence-jpa</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.camel</groupId>
+ <artifactId>syncope-ext-camel-provisioning</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Adds Activiti test content -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <transformationSets>
+ <transformationSet>
+ <dir>${project.build.directory}/classes</dir>
+ <includes>
+ <include>content.xml</include>
+ </includes>
+ <outputDir>${project.build.directory}/classes</outputDir>
+ <stylesheet>${basedir}/src/test/resources/addActivitiToContent.xsl</stylesheet>
+ <outputProperties>
+ <outputProperty>
+ <name>indent</name>
+ <value>yes</value>
+ </outputProperty>
+ </outputProperties>
+ </transformationSet>
+ </transformationSets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
new file mode 100644
index 0000000..da25a34
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/DoubleValueAttributableTransformer.java
@@ -0,0 +1,75 @@
+/*
+ * 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.fit.server.reference;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.server.provisioning.api.AttributableTransformer;
+
+/**
+ * Class for integration tests: transform (by making it double) any attribute value for defined schema.
+ */
+public class DoubleValueAttributableTransformer implements AttributableTransformer {
+
+ private static final String NAME = "makeItDouble";
+
+ @Override
+ public <T extends AbstractAttributableTO> T transform(final T input) {
+ for (AttrTO attr : input.getPlainAttrs()) {
+ if (NAME.equals(attr.getSchema())) {
+ List<String> values = new ArrayList<>(attr.getValues().size());
+ for (String value : attr.getValues()) {
+ try {
+ values.add(String.valueOf(2 * Long.valueOf(value)));
+ } catch (NumberFormatException e) {
+ // ignore
+ }
+ }
+ attr.getValues().clear();
+ attr.getValues().addAll(values);
+ }
+ }
+
+ return input;
+ }
+
+ @Override
+ public <T extends AbstractAttributableMod> T transform(final T input) {
+ for (AttrMod attr : input.getPlainAttrsToUpdate()) {
+ if (NAME.equals(attr.getSchema())) {
+ List<String> values = new ArrayList<>(attr.getValuesToBeAdded().size());
+ for (String value : attr.getValuesToBeAdded()) {
+ try {
+ values.add(String.valueOf(2 * Long.valueOf(value)));
+ } catch (NumberFormatException e) {
+ // ignore
+ }
+ }
+ attr.getValuesToBeAdded().clear();
+ attr.getValuesToBeAdded().addAll(values);
+ }
+ }
+
+ return input;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
new file mode 100644
index 0000000..01da2c9
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncActions.java
@@ -0,0 +1,83 @@
+/*
+ * 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.fit.server.reference;
+
+import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.server.provisioning.api.sync.ProvisioningProfile;
+import org.apache.syncope.server.provisioning.java.sync.DefaultSyncActions;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+import org.quartz.JobExecutionException;
+
+public class TestSyncActions extends DefaultSyncActions {
+
+ private int counter = 0;
+
+ @Override
+ public <T extends AbstractSubjectTO> SyncDelta beforeProvision(
+ final ProvisioningProfile<?, ?> profile,
+ final SyncDelta delta,
+ final T subject) throws JobExecutionException {
+
+ AttrTO attrTO = null;
+ for (int i = 0; i < subject.getPlainAttrs().size(); i++) {
+ if ("fullname".equals(subject.getPlainAttrs().get(i).getSchema())) {
+ attrTO = subject.getPlainAttrs().get(i);
+ }
+ }
+ if (attrTO == null) {
+ attrTO = new AttrTO();
+ attrTO.setSchema("fullname");
+ subject.getPlainAttrs().add(attrTO);
+ }
+ attrTO.getValues().clear();
+ attrTO.getValues().add(String.valueOf(counter++));
+
+ return delta;
+ }
+
+ @Override
+ public <T extends AbstractSubjectTO, K extends AbstractSubjectMod> SyncDelta beforeUpdate(
+ final ProvisioningProfile<?, ?> profile,
+ final SyncDelta delta,
+ final T subject,
+ final K subjectMod) throws JobExecutionException {
+
+ subjectMod.getPlainAttrsToRemove().add("fullname");
+
+ AttrMod fullnameMod = null;
+ for (AttrMod attrMod : subjectMod.getPlainAttrsToUpdate()) {
+ if ("fullname".equals(attrMod.getSchema())) {
+ fullnameMod = attrMod;
+ }
+ }
+ if (fullnameMod == null) {
+ fullnameMod = new AttrMod();
+ fullnameMod.setSchema("fullname");
+ subjectMod.getPlainAttrsToUpdate().add(fullnameMod);
+ }
+
+ fullnameMod.getValuesToBeAdded().clear();
+ fullnameMod.getValuesToBeAdded().add(String.valueOf(counter++));
+
+ return delta;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
new file mode 100644
index 0000000..8454ec6
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/java/org/apache/syncope/fit/server/reference/TestSyncRule.java
@@ -0,0 +1,37 @@
+/*
+ * 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.fit.server.reference;
+
+import org.apache.syncope.server.persistence.api.dao.search.AttributeCond;
+import org.apache.syncope.server.persistence.api.dao.search.SearchCond;
+import org.apache.syncope.server.provisioning.api.sync.SyncCorrelationRule;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+
+public class TestSyncRule implements SyncCorrelationRule {
+
+ @Override
+ public SearchCond getSearchCond(ConnectorObject connObj) {
+ AttributeCond cond = new AttributeCond();
+ cond.setSchema("email");
+ cond.setType(AttributeCond.Type.EQ);
+ cond.setExpression(connObj.getName().getNameValue());
+
+ return SearchCond.getLeafCond(cond);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/connid.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/connid.properties b/syncope620/fit/server-reference/src/main/resources/connid.properties
new file mode 100644
index 0000000..40d649c
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/connid.properties
@@ -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.
+connid.locations=${connid.location},\
+connid://${testconnectorserver.key}@localhost:${testconnectorserver.port}
+
+## for test only
+testdb.url=${testdb.url}
+connid.soap.version=${connid.soap.version}
+connid.db.table.version=${connid.db.table.version}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/context.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/context.xml b/syncope620/fit/server-reference/src/main/resources/context.xml
new file mode 100644
index 0000000..471d561
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/context.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+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.
+-->
+<Context>
+ <!-- Disable session persistence across Tomcat restarts -->
+ <Manager pathname=""/>
+</Context>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
new file mode 100644
index 0000000..2ed4d0d
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/light/provisioning.properties
@@ -0,0 +1,18 @@
+# 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.
+userProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultUserProvisioningManager
+roleProvisioningManager=org.apache.syncope.server.provisioning.java.DefaultRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/light/workflow.properties b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
new file mode 100644
index 0000000..2c08d50
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/light/workflow.properties
@@ -0,0 +1,20 @@
+# 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.
+wf.directory=${conf.directory}
+jobExecutorActivate=false
+uwfAdapter=org.apache.syncope.server.workflow.java.DefaultUserWorkflowAdapter
+rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/log4j2.xml b/syncope620/fit/server-reference/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..0ed8903
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/log4j2.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<configuration status="WARN">
+
+ <appenders>
+
+ <RollingRandomAccessFile name="main" fileName="${log.directory}/server.log"
+ filePattern="${log.directory}/server-%d{yyyy-MM-dd}.log.gz"
+ immediateFlush="false" append="true">
+ <PatternLayout>
+ <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+ </PatternLayout>
+ <Policies>
+ <TimeBasedTriggeringPolicy/>
+ <SizeBasedTriggeringPolicy size="250 MB"/>
+ </Policies>
+ </RollingRandomAccessFile>
+
+ <RollingRandomAccessFile name="persistence" fileName="${log.directory}/server-persistence.log"
+ filePattern="${log.directory}/server-persistence-%d{yyyy-MM-dd}.log.gz"
+ immediateFlush="false" append="true">
+ <PatternLayout>
+ <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+ </PatternLayout>
+ <Policies>
+ <TimeBasedTriggeringPolicy/>
+ <SizeBasedTriggeringPolicy size="250 MB"/>
+ </Policies>
+ </RollingRandomAccessFile>
+
+ <RollingRandomAccessFile name="rest" fileName="${log.directory}/server-rest.log"
+ filePattern="${log.directory}/server-rest-%d{yyyy-MM-dd}.log.gz"
+ immediateFlush="false" append="true">
+ <PatternLayout>
+ <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
+ </PatternLayout>
+ <Policies>
+ <TimeBasedTriggeringPolicy/>
+ <SizeBasedTriggeringPolicy size="250 MB"/>
+ </Policies>
+ </RollingRandomAccessFile>
+
+ <RollingRandomAccessFile name="connid" fileName="${log.directory}/server-connid.log"
+ filePattern="${log.directory}/server-connid-%d{yyyy-MM-dd}.log.gz"
+ immediateFlush="false" append="true">
+ <PatternLayout>
+ <pattern>%d{HH:mm:ss.SSS} %-5level %msg%n</pattern>
+ </PatternLayout>
+ <Policies>
+ <TimeBasedTriggeringPolicy/>
+ <SizeBasedTriggeringPolicy size="250 MB"/>
+ </Policies>
+ </RollingRandomAccessFile>
+
+ <!-- Audit -->
+ <Jdbc name="audit" tableName="SYNCOPEAUDIT">
+ <ConnectionFactory class="org.apache.syncope.server.logic.audit.AuditConnectionFactory" method="getConnection"/>
+ <Column name="EVENT_DATE" isEventTimestamp="true"/>
+ <Column name="LOGGER_LEVEL" pattern="%level" isUnicode="false"/>
+ <Column name="LOGGER" pattern="%logger" isUnicode="false"/>
+ <Column name="MESSAGE" pattern="%message" isUnicode="false"/>
+ <Column name="THROWABLE" pattern="%ex{full}" isUnicode="false"/>
+ </Jdbc>
+
+ </appenders>
+
+ <loggers>
+
+ <asyncLogger name="org.apache.syncope.server.persistence" additivity="false" level="INFO">
+ <appender-ref ref="persistence"/>
+ </asyncLogger>
+ <asyncLogger name="org.springframework.orm" additivity="false" level="INFO">
+ <appender-ref ref="persistence"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.apache.syncope.server.rest" additivity="false" level="INFO">
+ <appender-ref ref="rest"/>
+ </asyncLogger>
+ <asyncLogger name="org.springframework.web" additivity="false" level="INFO">
+ <appender-ref ref="rest"/>
+ </asyncLogger>
+ <asyncLogger name="org.apache.http" additivity="false" level="INFO">
+ <appender-ref ref="rest"/>
+ </asyncLogger>
+ <asyncLogger name="org.apache.cxf" additivity="false" level="ERROR">
+ <appender-ref ref="rest"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.identityconnectors" additivity="false" level="DEBUG">
+ <appender-ref ref="connid"/>
+ </asyncLogger>
+ <asyncLogger name="net.tirasa.connid" additivity="false" level="DEBUG">
+ <appender-ref ref="connid"/>
+ </asyncLogger>
+ <asyncLogger name="org.apache.syncope.server.provisioning.api.ConnIdBundleManager" additivity="false" level="INFO">
+ <appender-ref ref="connid"/>
+ </asyncLogger>
+
+ <asyncLogger name="org.apache.syncope.server.provisioning" additivity="false" level="INFO">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+ <asyncLogger name="org.springframework" additivity="false" level="INFO">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+ <asyncLogger name="org.apache.camel" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
+ <logger name="syncope.audit" additivity="false" level="DEBUG">
+ <appender-ref ref="audit"/>
+ </logger>
+
+ <root level="INFO">
+ <appender-ref ref="main"/>
+ </root>
+
+ </loggers>
+</configuration>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/logic.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/logic.properties b/syncope620/fit/server-reference/src/main/resources/logic.properties
new file mode 100644
index 0000000..2477c4b
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/logic.properties
@@ -0,0 +1,18 @@
+# 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.
+attributableTransformer=org.apache.syncope.fit.server.reference.DoubleValueAttributableTransformer
+logicInvocationHandler=org.apache.syncope.server.logic.LogicInvocationHandler
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/provisioning.properties b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
new file mode 100644
index 0000000..b0c8917
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/provisioning.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+camel.directory=${conf.directory}
+userProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelUserProvisioningManager
+roleProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/serverContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/serverContext.xml b/syncope620/fit/server-reference/src/main/resources/serverContext.xml
new file mode 100644
index 0000000..7bf75a1
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/serverContext.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="confDirectoryPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="order" value="1"/>
+ <property name="ignoreResourceNotFound" value="true"/>
+ <property name="ignoreUnresolvablePlaceholders" value="true"/>
+ <property name="locations">
+ <list>
+ <value>file:${conf.directory}/persistence.properties</value>
+ <value>file:${conf.directory}/security.properties</value>
+ <value>file:${conf.directory}/connid.properties</value>
+ <value>file:${conf.directory}/mail.properties</value>
+ <value>file:${conf.directory}/logic.properties</value>
+ <value>file:${conf.directory}/workflow.properties</value>
+ <value>file:${conf.directory}/provisioning.properties</value>
+ </list>
+ </property>
+ </bean>
+ <bean id="classpathPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:persistence.properties</value>
+ <value>classpath:security.properties</value>
+ <value>classpath:connid.properties</value>
+ <value>classpath:mail.properties</value>
+ <value>classpath:logic.properties</value>
+ <value>classpath:workflow.properties</value>
+ <value>classpath:provisioning.properties</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean class="org.apache.syncope.server.misc.spring.ApplicationContextProvider"/>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml b/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml
new file mode 100644
index 0000000..d26dbe3
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/userWorkflow.bpmn20.xml
@@ -0,0 +1,577 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:activiti="http://activiti.org/bpmn"
+ xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
+ xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
+ xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://activiti.org/bpmn20">
+
+ <process id="userWorkflow" name="User Workflow" isExecutable="true">
+ <startEvent id="theStart"/>
+ <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
+ <serviceTask id="create" name="Create" activiti:expression="#{create.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow2" sourceRef="create" targetRef="createGW"/>
+ <exclusiveGateway id="createGW"/>
+ <sequenceFlow id="createAsAnonymous2Approval" sourceRef="createGW" targetRef="createApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == 'anonymous' || user.getRoleKeys().contains(9)}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.getRoleKeys().contains(9)}]]></conditionExpression>
+ </sequenceFlow>
+ <userTask id="createApproval" name="Create approval" activiti:candidateGroups="7" activiti:formKey="createApproval">
+ <extensionElements>
+ <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
+ <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <sequenceFlow id="flow3" sourceRef="createApproval" targetRef="createApprovalGW"/>
+ <exclusiveGateway id="createApprovalGW"/>
+ <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+ </sequenceFlow>
+ <exclusiveGateway id="enableGW"/>
+ <sequenceFlow id="createApprovalGW2OptIn" sourceRef="enableGW" targetRef="generateToken">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.getRoleKeys().contains(11)}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="createApprovalGW2Activate" sourceRef="enableGW" targetRef="activate">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled == null}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="createApprovalGW2Active" sourceRef="enableGW" targetRef="active">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="createApprovalGW2Suspended" sourceRef="enableGW" targetRef="suspend">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!enabled}]]></conditionExpression>
+ </sequenceFlow>
+ <serviceTask id="activate" name="Activate" activiti:expression="#{autoActivate.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow4" sourceRef="activate" targetRef="active"/>
+ <serviceTask id="generateToken" name="Generate token" activiti:expression="#{generateToken.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow5" sourceRef="generateToken" targetRef="created"/>
+ <userTask id="created" name="Created"/>
+ <sequenceFlow id="flow6" sourceRef="created" targetRef="optinGW"/>
+ <exclusiveGateway id="optinGW"/>
+ <sequenceFlow id="created2Activate" sourceRef="optinGW" targetRef="removeToken">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.checkToken(token)}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="created2Created" sourceRef="optinGW" targetRef="created">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.checkToken(token)}]]></conditionExpression>
+ </sequenceFlow>
+ <scriptTask id="removeToken" name="Remove Token and Activate" scriptFormat="groovy" activiti:autoStoreVariables="false">
+ <script>
+ user.removeToken()
+ </script>
+ </scriptTask>
+ <sequenceFlow id="flow7" sourceRef="removeToken" targetRef="active"/>
+ <userTask id="active" name="Active"/>
+ <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
+ <exclusiveGateway id="activeGw"/>
+ <sequenceFlow id="active2UpdateApproval" sourceRef="activeGw" targetRef="updateApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == user.getUsername() and task == 'update'
+ and (!userMod.getMembershipsToAdd().isEmpty() or !userMod.getMembershipsToRemove().isEmpty())}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="active2DeleteApproval" sourceRef="activeGw" targetRef="deleteApproval">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == user.getUsername() and task == 'delete'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="active2Update" sourceRef="activeGw" targetRef="update">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="active2Suspend" sourceRef="activeGw" targetRef="suspend">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'suspend'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="active2Delete" sourceRef="activeGw" targetRef="delete">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="active2RequestPasswordReset" sourceRef="activeGw" targetRef="generateToken4PasswordReset">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'requestPasswordReset'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="active2ConfirmPasswordReset" sourceRef="activeGw" targetRef="checkToken4ConfirmPasswordReset">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'confirmPasswordReset'}]]></conditionExpression>
+ </sequenceFlow>
+ <userTask id="updateApproval" name="Update approval" activiti:candidateGroups="7" activiti:formKey="updateApproval">
+ <extensionElements>
+ <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
+ <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <sequenceFlow id="flow8bis" sourceRef="updateApproval" targetRef="updateApprovalGW"/>
+ <exclusiveGateway id="updateApprovalGW"/>
+ <sequenceFlow id="updateApprovalGW2Update" sourceRef="updateApprovalGW" targetRef="update">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="updateApprovalGW2Reject" sourceRef="updateApprovalGW" targetRef="rejectUpdate">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+ </sequenceFlow>
+ <scriptTask id="rejectUpdate" name="Reject update" scriptFormat="groovy" activiti:autoStoreVariables="false">
+ <script>
+ execution.setVariable("propByResource", null);
+ </script>
+ </scriptTask>
+ <sequenceFlow id="flow8ter" sourceRef="rejectUpdate" targetRef="active"/>
+ <serviceTask id="update" name="Update" activiti:expression="#{update.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow9" sourceRef="update" targetRef="active"/>
+ <serviceTask id="suspend" name="Suspend" activiti:expression="#{suspend.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow10" sourceRef="suspend" targetRef="suspended"/>
+ <userTask id="suspended" name="Suspended"/>
+ <sequenceFlow id="flow11" sourceRef="suspended" targetRef="suspendedGw"/>
+ <exclusiveGateway id="suspendedGw"/>
+ <sequenceFlow id="suspended2Reactivate" sourceRef="suspendedGw" targetRef="reactivate">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reactivate'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="suspended2Delete" sourceRef="suspendedGw" targetRef="delete">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+ </sequenceFlow>
+ <serviceTask id="reactivate" name="Reactivate" activiti:expression="#{reactivate.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
+ <scriptTask id="reject" name="Reject" scriptFormat="groovy" activiti:autoStoreVariables="false">
+ <script>
+ def scriptVar = rejectReason
+ execution.setVariable("propByResource", null);
+ </script>
+ </scriptTask>
+ <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
+ <userTask id="rejected" name="Rejected"/>
+ <sequenceFlow id="flow14" sourceRef="rejected" targetRef="rejectedGw"/>
+ <exclusiveGateway id="rejectedGw"/>
+ <sequenceFlow id="rejected2Delete" sourceRef="rejectedGw" targetRef="delete">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="rejected2Rejected" sourceRef="rejectedGw" targetRef="rejected">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${empty task}]]></conditionExpression>
+ </sequenceFlow>
+ <userTask id="deleteApproval" name="Delete approval" activiti:candidateGroups="7" activiti:formKey="deleteApproval">
+ <extensionElements>
+ <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
+ <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
+ <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
+ </extensionElements>
+ </userTask>
+ <sequenceFlow id="flow14bis" sourceRef="deleteApproval" targetRef="deleteApprovalGW"/>
+ <exclusiveGateway id="deleteApprovalGW"/>
+ <sequenceFlow id="deleteApprovalGW2Delete" sourceRef="deleteApprovalGW" targetRef="delete">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
+ </sequenceFlow>
+ <sequenceFlow id="deleteApprovalGW2Reject" sourceRef="deleteApprovalGW" targetRef="rejectDelete">
+ <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
+ </sequenceFlow>
+ <scriptTask id="rejectDelete" name="Reject delete" scriptFormat="groovy" activiti:autoStoreVariables="false">
+ <script>
+ execution.setVariable("propByResource", null);
+ </script>
+ </scriptTask>
+ <sequenceFlow id="flow14ter" sourceRef="rejectDelete" targetRef="active"/>
+
+ <serviceTask id="generateToken4PasswordReset" name="Generate token" activiti:expression="#{generateToken.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow15" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
+ <serviceTask id="notify4RequestPasswordReset" name="Notification" activiti:expression="#{notify.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow16" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
+
+ <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" activiti:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow17" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
+ <serviceTask id="notify4ConfirmPasswordReset" name="Notification" activiti:expression="#{notify.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow18" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
+
+ <serviceTask id="delete" name="Delete" activiti:expression="#{delete.execute(execution.processInstanceId)}"/>
+ <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
+ <endEvent id="theEnd"/>
+ </process>
+
+ <bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
+ <bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
+ <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
+ <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="512.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
+ <omgdc:Bounds height="60.0" width="100.0" x="80.0" y="497.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="createGW" id="BPMNShape_createGW">
+ <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="506.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="createApproval" id="BPMNShape_createApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="320.0" y="560.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="createApprovalGW" id="BPMNShape_createApprovalGW">
+ <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="556.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="enableGW" id="BPMNShape_enableGW">
+ <omgdc:Bounds height="40.0" width="40.0" x="590.0" y="429.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
+ <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="610.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="generateToken" id="BPMNShape_generateToken">
+ <omgdc:Bounds height="60.0" width="100.0" x="702.0" y="188.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="created" id="BPMNShape_created">
+ <omgdc:Bounds height="60.0" width="100.0" x="852.0" y="213.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="optinGW" id="BPMNShape_optinGW">
+ <omgdc:Bounds height="40.0" width="40.0" x="1002.0" y="240.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="removeToken" id="BPMNShape_removeToken">
+ <omgdc:Bounds height="60.0" width="100.0" x="1092.0" y="248.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="active" id="BPMNShape_active">
+ <omgdc:Bounds height="60.0" width="100.0" x="1030.0" y="511.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="activeGw" id="BPMNShape_activeGw">
+ <omgdc:Bounds height="40.0" width="40.0" x="1400.0" y="520.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="updateApproval" id="BPMNShape_updateApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="740.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="updateApprovalGW" id="BPMNShape_updateApprovalGW">
+ <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="740.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="rejectUpdate" id="BPMNShape_rejectUpdate">
+ <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="840.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="update" id="BPMNShape_update">
+ <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="700.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
+ <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="100.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
+ <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="120.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
+ <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="180.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
+ <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="110.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="reject" id="BPMNShape_reject">
+ <omgdc:Bounds height="60.0" width="100.0" x="560.0" y="659.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected">
+ <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="770.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="rejectedGw" id="BPMNShape_rejectedGw">
+ <omgdc:Bounds height="40.0" width="40.0" x="890.0" y="775.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="deleteApproval" id="BPMNShape_deleteApproval">
+ <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="280.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="deleteApprovalGW" id="BPMNShape_deleteApprovalGW">
+ <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="300.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="rejectDelete" id="BPMNShape_rejectDelete">
+ <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="240.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
+ <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="358.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
+ <omgdc:Bounds height="28.0" width="28.0" x="2078.1893792531678" y="374.0"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
+ <omgdc:Bounds height="59.99999999999994" width="100.0" x="1543.209935088986" y="452.6749142927693"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
+ <omgdc:Bounds height="60.00000000000006" width="100.0" x="1748.9712597675173" y="452.6749142927692"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
+ <omgdc:Bounds height="60.0" width="100.0" x="1558.797798366986" y="561.167207412115"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
+ <omgdc:Bounds height="60.0" width="100.0" x="1748.971259767517" y="561.167207412115"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
+ <omgdi:waypoint x="1658.797798366986" y="591.167207412115"/>
+ <omgdi:waypoint x="1748.971259767517" y="591.167207412115"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+ <omgdi:waypoint x="1940.0" y="129.51612903225805"/>
+ <omgdi:waypoint x="1928.0" y="127.0"/>
+ <omgdi:waypoint x="1378.0" y="40.0"/>
+ <omgdi:waypoint x="1097.8443113772455" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+ <omgdi:waypoint x="1740.0" y="150.0"/>
+ <omgdi:waypoint x="1752.0" y="150.0"/>
+ <omgdi:waypoint x="1752.0" y="200.0"/>
+ <omgdi:waypoint x="1820.0" y="200.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
+ <omgdi:waypoint x="1440.0" y="540.0"/>
+ <omgdi:waypoint x="1454.0" y="540.0"/>
+ <omgdi:waypoint x="1454.0" y="310.0"/>
+ <omgdi:waypoint x="1490.0" y="310.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow14bis" id="BPMNEdge_flow14bis">
+ <omgdi:waypoint x="1590.0" y="310.0"/>
+ <omgdi:waypoint x="1602.0" y="310.0"/>
+ <omgdi:waypoint x="1602.0" y="320.0"/>
+ <omgdi:waypoint x="1670.0" y="320.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+ <omgdi:waypoint x="1590.0" y="130.0"/>
+ <omgdi:waypoint x="1602.0" y="130.0"/>
+ <omgdi:waypoint x="1602.0" y="150.0"/>
+ <omgdi:waypoint x="1640.0" y="150.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
+ <omgdi:waypoint x="1439.5" y="540.5"/>
+ <omgdi:waypoint x="1593.209935088986" y="540.5"/>
+ <omgdi:waypoint x="1593.209935088986" y="512.6749142927692"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
+ <omgdi:waypoint x="1439.5" y="540.5"/>
+ <omgdi:waypoint x="1608.797798366986" y="540.5"/>
+ <omgdi:waypoint x="1608.797798366986" y="561.167207412115"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
+ <omgdi:waypoint x="1710.0" y="320.0"/>
+ <omgdi:waypoint x="1752.0" y="320.0"/>
+ <omgdi:waypoint x="1752.0" y="388.0"/>
+ <omgdi:waypoint x="1940.0" y="388.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
+ <omgdi:waypoint x="510.0" y="576.0"/>
+ <omgdi:waypoint x="522.0" y="576.0"/>
+ <omgdi:waypoint x="522.0" y="689.0"/>
+ <omgdi:waypoint x="560.0" y="689.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
+ <omgdi:waypoint x="1440.0" y="540.0"/>
+ <omgdi:waypoint x="1452.0" y="540.0"/>
+ <omgdi:waypoint x="1452.0" y="680.6812757582483"/>
+ <omgdi:waypoint x="1955.9214707261015" y="680.6812757582483"/>
+ <omgdi:waypoint x="1986.506931044467" y="418.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
+ <omgdi:waypoint x="1710.0" y="760.0"/>
+ <omgdi:waypoint x="1752.0" y="760.0"/>
+ <omgdi:waypoint x="1752.0" y="730.0"/>
+ <omgdi:waypoint x="1790.0" y="730.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
+ <omgdi:waypoint x="1440.0" y="540.0"/>
+ <omgdi:waypoint x="1454.0" y="540.0"/>
+ <omgdi:waypoint x="1454.0" y="770.0"/>
+ <omgdi:waypoint x="1490.0" y="770.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
+ <omgdi:waypoint x="930.0" y="795.0"/>
+ <omgdi:waypoint x="972.0" y="795.0"/>
+ <omgdi:waypoint x="1470.0" y="911.0"/>
+ <omgdi:waypoint x="1990.0" y="911.0"/>
+ <omgdi:waypoint x="1990.0" y="418.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
+ <omgdi:waypoint x="630.0" y="449.0"/>
+ <omgdi:waypoint x="674.0" y="449.0"/>
+ <omgdi:waypoint x="674.0" y="540.0"/>
+ <omgdi:waypoint x="1030.0" y="540.8768472906404"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
+ <omgdi:waypoint x="1710.0" y="760.0"/>
+ <omgdi:waypoint x="1752.0" y="760.0"/>
+ <omgdi:waypoint x="1752.0" y="870.0"/>
+ <omgdi:waypoint x="1790.0" y="870.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
+ <omgdi:waypoint x="1790.0" y="879.6774193548387"/>
+ <omgdi:waypoint x="1778.0" y="882.0"/>
+ <omgdi:waypoint x="1225.0" y="787.0"/>
+ <omgdi:waypoint x="1080.0" y="726.0"/>
+ <omgdi:waypoint x="1080.0" y="571.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
+ <omgdi:waypoint x="1643.209935088986" y="482.6749142927693"/>
+ <omgdi:waypoint x="1748.9712597675173" y="482.67491429276924"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
+ <omgdi:waypoint x="1860.0" y="200.0"/>
+ <omgdi:waypoint x="1902.0" y="200.0"/>
+ <omgdi:waypoint x="1902.0" y="140.0"/>
+ <omgdi:waypoint x="1940.0" y="140.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
+ <omgdi:waypoint x="660.0" y="689.0"/>
+ <omgdi:waypoint x="672.0" y="689.0"/>
+ <omgdi:waypoint x="672.0" y="800.0"/>
+ <omgdi:waypoint x="710.0" y="800.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
+ <omgdi:waypoint x="760.0" y="770.0"/>
+ <omgdi:waypoint x="760.0" y="732.8074937730017"/>
+ <omgdi:waypoint x="910.0" y="732.8074937730017"/>
+ <omgdi:waypoint x="910.0" y="775.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
+ <omgdi:waypoint x="510.0" y="576.0"/>
+ <omgdi:waypoint x="522.0" y="576.0"/>
+ <omgdi:waypoint x="522.0" y="449.0"/>
+ <omgdi:waypoint x="590.0" y="449.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
+ <omgdi:waypoint x="1440.0" y="540.0"/>
+ <omgdi:waypoint x="1456.0" y="540.0"/>
+ <omgdi:waypoint x="1456.0" y="730.0"/>
+ <omgdi:waypoint x="1790.0" y="730.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
+ <omgdi:waypoint x="270.0" y="526.0"/>
+ <omgdi:waypoint x="282.0" y="526.0"/>
+ <omgdi:waypoint x="282.0" y="449.0"/>
+ <omgdi:waypoint x="590.0" y="449.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
+ <omgdi:waypoint x="1440.0" y="540.0"/>
+ <omgdi:waypoint x="1452.0" y="540.0"/>
+ <omgdi:waypoint x="1452.0" y="130.0"/>
+ <omgdi:waypoint x="1490.0" y="130.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
+ <omgdi:waypoint x="1860.0" y="200.0"/>
+ <omgdi:waypoint x="1990.0" y="200.0"/>
+ <omgdi:waypoint x="1990.0" y="358.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
+ <omgdi:waypoint x="1042.0" y="260.0"/>
+ <omgdi:waypoint x="1054.0" y="260.0"/>
+ <omgdi:waypoint x="1054.0" y="278.0"/>
+ <omgdi:waypoint x="1092.0" y="278.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
+ <omgdi:waypoint x="270.0" y="526.0"/>
+ <omgdi:waypoint x="282.0" y="526.0"/>
+ <omgdi:waypoint x="282.0" y="590.0"/>
+ <omgdi:waypoint x="320.0" y="590.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+ <omgdi:waypoint x="420.0" y="590.0"/>
+ <omgdi:waypoint x="432.0" y="590.0"/>
+ <omgdi:waypoint x="432.0" y="576.0"/>
+ <omgdi:waypoint x="470.0" y="576.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+ <omgdi:waypoint x="180.0" y="527.0"/>
+ <omgdi:waypoint x="192.0" y="527.0"/>
+ <omgdi:waypoint x="192.0" y="526.0"/>
+ <omgdi:waypoint x="230.0" y="526.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
+ <omgdi:waypoint x="890.6451612903226" y="795.6451612903226"/>
+ <omgdi:waypoint x="810.0" y="798.3333333333334"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+ <omgdi:waypoint x="802.0" y="218.0"/>
+ <omgdi:waypoint x="814.0" y="218.0"/>
+ <omgdi:waypoint x="814.0" y="243.0"/>
+ <omgdi:waypoint x="852.0" y="243.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+ <omgdi:waypoint x="810.0" y="640.0"/>
+ <omgdi:waypoint x="822.0" y="640.0"/>
+ <omgdi:waypoint x="959.0" y="640.0"/>
+ <omgdi:waypoint x="1043.3333333333333" y="571.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Suspended" id="BPMNEdge_createApprovalGW2Suspended">
+ <omgdi:waypoint x="630.0" y="449.0"/>
+ <omgdi:waypoint x="672.0" y="449.0"/>
+ <omgdi:waypoint x="672.0" y="130.0"/>
+ <omgdi:waypoint x="1490.0" y="130.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
+ <omgdi:waypoint x="1790.0" y="260.7608891486752"/>
+ <omgdi:waypoint x="1424.117736926915" y="193.1523534073587"/>
+ <omgdi:waypoint x="1109.678315230625" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
+ <omgdi:waypoint x="630.0" y="449.0"/>
+ <omgdi:waypoint x="674.0" y="449.0"/>
+ <omgdi:waypoint x="700.0" y="449.0"/>
+ <omgdi:waypoint x="745.2467532467532" y="248.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+ <omgdi:waypoint x="30.0" y="527.0"/>
+ <omgdi:waypoint x="80.0" y="527.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
+ <omgdi:waypoint x="1748.9712597675173" y="459.5470829510475"/>
+ <omgdi:waypoint x="1592.4096593525787" y="387.128477171313"/>
+ <omgdi:waypoint x="1130.0" y="525.9854974413342"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
+ <omgdi:waypoint x="1002.0" y="260.0"/>
+ <omgdi:waypoint x="990.0" y="260.0"/>
+ <omgdi:waypoint x="990.0" y="243.0"/>
+ <omgdi:waypoint x="952.0" y="243.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
+ <omgdi:waypoint x="1748.971259767517" y="619.7464352880323"/>
+ <omgdi:waypoint x="1673.525420205687" y="662.8701121105813"/>
+ <omgdi:waypoint x="1130.0" y="551.266629529393"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Activate" id="BPMNEdge_createApprovalGW2Activate">
+ <omgdi:waypoint x="630.0" y="449.0"/>
+ <omgdi:waypoint x="672.0" y="449.0"/>
+ <omgdi:waypoint x="672.0" y="640.0"/>
+ <omgdi:waypoint x="710.0" y="640.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+ <omgdi:waypoint x="1134.9277566539924" y="308.0"/>
+ <omgdi:waypoint x="1087.0722433460076" y="511.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+ <omgdi:waypoint x="952.0" y="252.67741935483872"/>
+ <omgdi:waypoint x="964.0" y="255.0"/>
+ <omgdi:waypoint x="964.0" y="260.0"/>
+ <omgdi:waypoint x="1002.0" y="260.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+ <omgdi:waypoint x="1828.6246202240113" y="760.0"/>
+ <omgdi:waypoint x="1811.88836468294" y="804.1381014189917"/>
+ <omgdi:waypoint x="1474.4398193359375" y="804.1381014189917"/>
+ <omgdi:waypoint x="1124.969521769241" y="571.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
+ <omgdi:waypoint x="1710.0" y="320.0"/>
+ <omgdi:waypoint x="1752.0" y="320.0"/>
+ <omgdi:waypoint x="1752.0" y="270.0"/>
+ <omgdi:waypoint x="1790.0" y="270.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8bis" id="BPMNEdge_flow8bis">
+ <omgdi:waypoint x="1590.0" y="770.0"/>
+ <omgdi:waypoint x="1602.0" y="770.0"/>
+ <omgdi:waypoint x="1602.0" y="760.0"/>
+ <omgdi:waypoint x="1670.0" y="760.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
+ <omgdi:waypoint x="2040.0" y="388.0"/>
+ <omgdi:waypoint x="2078.1893792531678" y="388.0"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+ <omgdi:waypoint x="1130.0" y="540.8529411764706"/>
+ <omgdi:waypoint x="1400.058651026393" y="540.0586510263929"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/resources/workflow.properties b/syncope620/fit/server-reference/src/main/resources/workflow.properties
new file mode 100644
index 0000000..0cad37e
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/resources/workflow.properties
@@ -0,0 +1,20 @@
+# 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.
+wf.directory=${conf.directory}
+jobExecutorActivate=true
+uwfAdapter=org.apache.syncope.server.workflow.activiti.ActivitiUserWorkflowAdapter
+rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp b/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp
new file mode 100644
index 0000000..5ff8a6b
--- /dev/null
+++ b/syncope620/fit/server-reference/src/main/webapp/cacheStats.jsp
@@ -0,0 +1,190 @@
+<%--
+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.
+--%>
+<%@page import="org.apache.syncope.common.lib.SyncopeConstants"%>
+<%@page import="org.apache.syncope.server.misc.spring.ApplicationContextProvider"%>
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
+<%@page import="java.text.SimpleDateFormat"%>
+<%@page import="java.util.Date"%>
+<%@page import="org.apache.openjpa.datacache.CacheStatisticsImpl"%>
+<%@page import="javax.persistence.EntityManagerFactory"%>
+<%@page import="org.apache.openjpa.persistence.OpenJPAPersistence"%>
+<%@page import="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"%>
+<%@page import="org.springframework.context.ConfigurableApplicationContext"%>
+<%@page import="org.apache.openjpa.datacache.QueryKey"%>
+<%@page import="org.apache.openjpa.kernel.QueryStatistics"%>
+<%@page import="org.apache.openjpa.persistence.QueryResultCacheImpl"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Cache Statistics</title>
+ <style type="text/css">
+ .c{
+ text-align: center;
+ }
+ .r{
+ text-align: right;
+ }
+ .l{
+ text-align: left;
+ }
+ .t{
+ vertical-align: top;
+ }
+ .b{
+ vertical-align: bottom;
+ }
+ .odd{
+ background-color: #D4D4D4;
+ }
+ .even{
+ background-color: #EEEEEE;
+ }
+ .bd1{
+ border: solid #888888 1px;
+ }
+ .bg1{
+ background-color: #CCCCCC;
+ }
+ .bg2{
+ background-color: #DDDDDD;
+ }
+ </style>
+ </head>
+ <body>
+ <p/>
+ <%
+ ConfigurableApplicationContext context = ApplicationContextProvider.getApplicationContext();
+
+ EntityManagerFactory emf = context.getBean(EntityManagerFactory.class);
+ OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
+
+ QueryStatistics<QueryKey> queryStatistics =
+ ((QueryResultCacheImpl) oemf.getQueryResultCache()).getDelegate().getStatistics();
+
+ CacheStatisticsImpl statistics = (CacheStatisticsImpl) oemf.getStoreCache().getStatistics();
+
+ String action = request.getParameter("do");
+ StringBuilder info = new StringBuilder(512);
+
+ if ("activate".equals(action) && !statistics.isEnabled()) {
+ statistics.enable();
+ info.append("Statistics enabled\n");
+ } else if ("deactivate".equals(action) && !statistics.isEnabled()) {
+ statistics.disable();
+ info.append("Statistics disabled\n");
+ } else if ("clear".equals(action)) {
+ queryStatistics.reset();
+ statistics.reset();
+ info.append("Statistics cleared\n");
+ }
+
+ SimpleDateFormat sdf = new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN);
+ if (info.length() > 0) {
+ %>
+ <p/><div class="success">
+ <c:out value="${fn:escapeXml(info)}"/>
+ </div>
+ <% }%>
+ <p/>
+ <a href="?">Reload</a>
+ <p/>
+ <a href="?do=<%=(statistics.isEnabled() ? "deactivate" : "activate")%>">
+ <%=(statistics.isEnabled() ? "DEACTIVATE" : "ACTIVATE")%></a>
+ <a href="?do=clear">CLEAR</a>
+ <p/>
+ Last update: <%=sdf.format(statistics.since())%><br/>
+ Activation: <%=sdf.format(statistics.start())%><br/>
+ <p/>
+ <table>
+ <tr>
+ <th class="c bd1 bg1">Hits</th>
+ <td><%=statistics.getHitCount()%></td>
+ </tr>
+ <tr>
+ <th class="c bd1 bg1">Reads</th>
+ <td><%=statistics.getReadCount()%></td>
+ </tr>
+ <tr>
+ <th class="c bd1 bg1">Writes</th>
+ <td><%=statistics.getWriteCount()%></td>
+ </tr>
+ <tr>
+ <th class="c bd1 bg1">Query Hits</th>
+ <td><%=queryStatistics.getHitCount()%></td>
+ </tr>
+ <tr>
+ <th class="c bd1 bg1">Query Executions</th>
+ <td><%=queryStatistics.getExecutionCount()%></td>
+ </tr>
+ <tr>
+ <th class="c bd1 bg1">Query Evictions</th>
+ <td><%=queryStatistics.getEvictionCount()%></td>
+ </tr>
+ </table>
+ <p/>
+ <table width="100%">
+ <tr><th colspan="3" class="c bd1 bg2">Query statistics</th></tr>
+ <tr>
+ <th class="c bd1 bg1">Query</th>
+ <th class="c bd1 bg1">Hits</th>
+ <th class="c bd1 bg1">Executions</th>
+ </tr>
+ <%
+ boolean odd = true;
+ for (QueryKey key : queryStatistics.keys()) {
+ %>
+ <tr class="<%=(odd ? "odd" : "even")%>">
+ <td><%=key%></td>
+ <td><%=queryStatistics.getHitCount(key)%></td>
+ <td><%=queryStatistics.getExecutionCount(key)%></td>
+ </tr>
+ <%
+ odd = !odd;
+ }
+ %>
+ </table>
+ <p/>
+ <table width="100%">
+ <tr><th colspan="4" class="c bd1 bg2">2nd level cache statistics</th></tr>
+ <tr>
+ <th class="c bd1 bg1">Region</th>
+ <th class="c bd1 bg1">Hits</th>
+ <th class="c bd1 bg1">Reads</th>
+ <th class="c bd1 bg1">Writes</th>
+ </tr>
+ <%
+ odd = true;
+ for (String className : statistics.classNames()) {
+ %>
+ <tr class="<%=(odd ? "odd" : "even")%>">
+ <td><%=className%></td>
+ <td><%=statistics.getHitCount(className)%></td>
+ <td><%=statistics.getReadCount(className)%></td>
+ <td><%=statistics.getWriteCount(className)%></td>
+ </tr>
+ <%
+ odd = !odd;
+ }
+ %>
+ </table>
+ </body>
+</html>
[45/52] syncope git commit: Merge branch '2_0_X' of
https://git-wip-us.apache.org/repos/asf/syncope into 2_0_X
Posted by il...@apache.org.
Merge branch '2_0_X' of https://git-wip-us.apache.org/repos/asf/syncope into 2_0_X
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/246ff1f1
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/246ff1f1
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/246ff1f1
Branch: refs/heads/2_0_X
Commit: 246ff1f175a7e33a05dac5c919f38ca20193b627
Parents: 32707b3 8be42f8
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Feb 4 10:40:25 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Feb 4 10:40:25 2015 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
syncope620/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/246ff1f1/syncope620/pom.xml
----------------------------------------------------------------------
[11/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java
deleted file mode 100644
index 7b66d26..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/SyncTaskITCase.java
+++ /dev/null
@@ -1,694 +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.fit.server.reference;
-
-import static org.apache.syncope.fit.server.reference.AbstractITCase.RESOURCE_NAME_TESTDB;
-import static org.apache.syncope.fit.server.reference.AbstractITCase.RESOURCE_NAME_WS2;
-import static org.apache.syncope.fit.server.reference.AbstractITCase.roleService;
-import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.mod.StatusMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.ConnInstanceTO;
-import org.apache.syncope.common.lib.to.ConnObjectTO;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.SyncPolicyTO;
-import org.apache.syncope.common.lib.to.SyncTaskTO;
-import org.apache.syncope.common.lib.to.TaskExecTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.CipherAlgorithm;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.lib.wrap.ResourceName;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
-import org.apache.syncope.common.rest.api.service.TaskService;
-import org.apache.syncope.server.misc.security.Encryptor;
-import org.apache.syncope.server.provisioning.java.sync.DBPasswordSyncActions;
-import org.apache.syncope.server.provisioning.java.sync.LDAPPasswordSyncActions;
-import org.identityconnectors.framework.common.objects.Name;
-import org.junit.BeforeClass;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class SyncTaskITCase extends AbstractTaskITCase {
-
- @BeforeClass
- public static void testSyncActionsSetup() {
- SyncTaskTO syncTask = taskService.read(SYNC_TASK_ID);
- syncTask.getActionsClassNames().add(TestSyncActions.class.getName());
- taskService.update(SYNC_TASK_ID, syncTask);
- }
-
- @Test
- public void getSyncActionsClasses() {
- List<String> actions = syncopeService.info().getSyncActions();
- assertNotNull(actions);
- assertFalse(actions.isEmpty());
- }
-
- @Test
- public void list() {
- final PagedResult<SyncTaskTO> tasks = taskService.list(TaskType.SYNCHRONIZATION);
- assertFalse(tasks.getResult().isEmpty());
- for (AbstractTaskTO task : tasks.getResult()) {
- if (!(task instanceof SyncTaskTO)) {
- fail();
- }
- }
- }
-
- @Test
- public void create() {
- SyncTaskTO task = new SyncTaskTO();
- task.setName("Test create Sync");
- task.setResource(RESOURCE_NAME_WS2);
-
- UserTO userTemplate = new UserTO();
- userTemplate.getResources().add(RESOURCE_NAME_WS2);
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- userTemplate.getMemberships().add(membershipTO);
- task.setUserTemplate(userTemplate);
-
- RoleTO roleTemplate = new RoleTO();
- roleTemplate.getResources().add(RESOURCE_NAME_LDAP);
- task.setRoleTemplate(roleTemplate);
-
- Response response = taskService.create(task);
- SyncTaskTO actual = getObject(response.getLocation(), TaskService.class, SyncTaskTO.class);
- assertNotNull(actual);
-
- task = taskService.read(actual.getKey());
- assertNotNull(task);
- assertEquals(actual.getKey(), task.getKey());
- assertEquals(actual.getJobClassName(), task.getJobClassName());
- assertEquals(userTemplate, task.getUserTemplate());
- assertEquals(roleTemplate, task.getRoleTemplate());
- }
-
- @Test
- public void sync() throws Exception {
- removeTestUsers();
-
- // -----------------------------
- // Create a new user ... it should be updated applying sync policy
- // -----------------------------
- UserTO inUserTO = new UserTO();
- inUserTO.setPassword("password123");
- String userName = "test9";
- inUserTO.setUsername(userName);
- inUserTO.getPlainAttrs().add(attrTO("firstname", "nome9"));
- inUserTO.getPlainAttrs().add(attrTO("surname", "cognome"));
- inUserTO.getPlainAttrs().add(attrTO("type", "a type"));
- inUserTO.getPlainAttrs().add(attrTO("fullname", "nome cognome"));
- inUserTO.getPlainAttrs().add(attrTO("userId", "puccini@syncope.apache.org"));
- inUserTO.getPlainAttrs().add(attrTO("email", "puccini@syncope.apache.org"));
- inUserTO.getDerAttrs().add(attrTO("csvuserid", null));
-
- inUserTO = createUser(inUserTO);
- assertNotNull(inUserTO);
- assertFalse(inUserTO.getResources().contains(RESOURCE_NAME_CSV));
-
- // -----------------------------
- try {
- int usersPre = userService.list(1, 1).getTotalCount();
- assertNotNull(usersPre);
-
- execSyncTask(SYNC_TASK_ID, 50, false);
-
- // after execution of the sync task the user data should be synced from
- // csv datasource and processed by user template
- UserTO userTO = userService.read(inUserTO.getKey());
- assertNotNull(userTO);
- assertEquals(userName, userTO.getUsername());
- assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
- ? "active" : "created", userTO.getStatus());
- assertEquals("test9@syncope.apache.org", userTO.getPlainAttrMap().get("email").getValues().get(0));
- assertEquals("test9@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
- assertTrue(Integer.valueOf(userTO.getPlainAttrMap().get("fullname").getValues().get(0)) <= 10);
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_WS2));
-
- // Matching --> Update (no link)
- assertFalse(userTO.getResources().contains(RESOURCE_NAME_CSV));
-
- // check for user template
- userTO = readUser("test7");
- assertNotNull(userTO);
- assertEquals("TYPE_OTHER", userTO.getPlainAttrMap().get("type").getValues().get(0));
- assertEquals(3, userTO.getResources().size());
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_WS2));
- assertEquals(1, userTO.getMemberships().size());
- assertTrue(userTO.getMemberships().get(0).getPlainAttrMap().containsKey("subscriptionDate"));
-
- // Unmatching --> Assign (link)
- assertTrue(userTO.getResources().contains(RESOURCE_NAME_CSV));
-
- userTO = readUser("test8");
- assertNotNull(userTO);
- assertEquals("TYPE_8", userTO.getPlainAttrMap().get("type").getValues().get(0));
-
- // check for sync results
- int usersPost = userService.list(1, 1).getTotalCount();
- assertNotNull(usersPost);
- assertEquals(usersPre + 9, usersPost);
-
- // Check for issue 215:
- // * expected disabled user test1
- // * expected enabled user test2
- userTO = readUser("test1");
- assertNotNull(userTO);
- assertEquals("suspended", userTO.getStatus());
-
- userTO = readUser("test3");
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
-
- // SYNCOPE-317
- execSyncTask(SYNC_TASK_ID, 50, false);
-
- final Set<Long> pushTaskIds = new HashSet<>();
- pushTaskIds.add(25L);
- pushTaskIds.add(26L);
-
- execSyncTasks(pushTaskIds, 50, false);
- // Matching --> UNLINK
- assertFalse(readUser("test9").getResources().contains(RESOURCE_NAME_CSV));
- assertFalse(readUser("test7").getResources().contains(RESOURCE_NAME_CSV));
- } finally {
- removeTestUsers();
- }
- }
-
- @Test
- public void dryRun() {
- TaskExecTO execution = execSyncTask(SYNC_TASK_ID, 50, true);
- assertEquals("Execution of task " + execution.getTask() + " failed with message " + execution.getMessage(),
- "SUCCESS", execution.getStatus());
- }
-
- @Test
- public void reconcileFromDB() {
- // update sync task
- TaskExecTO execution = execSyncTask(7L, 50, false);
- assertNotNull(execution.getStatus());
- assertTrue(PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful());
-
- UserTO userTO = readUser("testuser1");
- assertNotNull(userTO);
- assertEquals("reconciled@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
- assertEquals("suspended", userTO.getStatus());
-
- // enable user on external resource
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- jdbcTemplate.execute("UPDATE TEST SET STATUS=TRUE");
-
- // re-execute the same SyncTask: now user must be active
- execution = execSyncTask(7L, 50, false);
- assertNotNull(execution.getStatus());
- assertTrue(PropagationTaskExecStatus.valueOf(execution.getStatus()).isSuccessful());
-
- userTO = readUser("testuser1");
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
- }
-
- /**
- * Clean Syncope and LDAP resource status.
- */
- private void ldapCleanup() {
- PagedResult<RoleTO> matchingRoles = roleService.search(
- SyncopeClient.getRoleSearchConditionBuilder().is("name").equalTo("testLDAPGroup").query());
- if (matchingRoles.getSize() > 0) {
- for (RoleTO role : matchingRoles.getResult()) {
- roleService.bulkDeassociation(role.getKey(),
- ResourceDeassociationActionType.UNLINK,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class));
- roleService.delete(role.getKey());
- }
- }
- PagedResult<UserTO> matchingUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().is("username").equalTo("syncFromLDAP").query());
- if (matchingUsers.getSize() > 0) {
- for (UserTO user : matchingUsers.getResult()) {
- userService.bulkDeassociation(user.getKey(),
- ResourceDeassociationActionType.UNLINK,
- CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class));
- userService.delete(user.getKey());
- }
- }
- }
-
- @Test
- public void reconcileFromLDAP() {
- // First of all, clear any potential conflict with existing user / role
- ldapCleanup();
-
- // Update sync task
- TaskExecTO execution = execSyncTask(11L, 50, false);
-
- // 1. verify execution status
- final String status = execution.getStatus();
- assertNotNull(status);
- assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
-
- // 2. verify that synchronized role is found, with expected attributes
- final PagedResult<RoleTO> matchingRoles = roleService.search(
- SyncopeClient.getRoleSearchConditionBuilder().is("name").equalTo("testLDAPGroup").query());
- assertNotNull(matchingRoles);
- assertEquals(1, matchingRoles.getResult().size());
-
- final PagedResult<UserTO> matchingUsers = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().is("username").equalTo("syncFromLDAP").query());
- assertNotNull(matchingUsers);
- assertEquals(1, matchingUsers.getResult().size());
-
- // Check for SYNCOPE-436
- assertEquals("syncFromLDAP",
- matchingUsers.getResult().get(0).getVirAttrMap().get("virtualReadOnly").getValues().get(0));
- // Check for SYNCOPE-270
- assertNotNull(matchingUsers.getResult().get(0).getPlainAttrMap().get("obscure"));
- // Check for SYNCOPE-123
- assertNotNull(matchingUsers.getResult().get(0).getPlainAttrMap().get("photo"));
-
- final RoleTO roleTO = matchingRoles.getResult().iterator().next();
- assertNotNull(roleTO);
- assertEquals("testLDAPGroup", roleTO.getName());
- assertEquals(8L, roleTO.getParent());
- assertEquals("true", roleTO.getPlainAttrMap().get("show").getValues().get(0));
- assertEquals(matchingUsers.getResult().iterator().next().getKey(), (long) roleTO.getUserOwner());
- assertNull(roleTO.getRoleOwner());
-
- // 3. verify that LDAP group membership is propagated as Syncope role membership
- final PagedResult<UserTO> members = userService.search(
- SyncopeClient.getUserSearchConditionBuilder().hasRoles(roleTO.getKey()).query());
- assertNotNull(members);
- assertEquals(1, members.getResult().size());
- }
-
- @Test
- public void issueSYNCOPE68() {
- //-----------------------------
- // Create a new user ... it should be updated applying sync policy
- //-----------------------------
- UserTO userTO = new UserTO();
- userTO.setPassword("password123");
- userTO.setUsername("testuser2");
-
- userTO.getPlainAttrs().add(attrTO("firstname", "testuser2"));
- userTO.getPlainAttrs().add(attrTO("surname", "testuser2"));
- userTO.getPlainAttrs().add(attrTO("type", "a type"));
- userTO.getPlainAttrs().add(attrTO("fullname", "a type"));
- userTO.getPlainAttrs().add(attrTO("userId", "testuser2@syncope.apache.org"));
- userTO.getPlainAttrs().add(attrTO("email", "testuser2@syncope.apache.org"));
-
- userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION2);
- userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION4);
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
-
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals("testuser2", userTO.getUsername());
- assertEquals(1, userTO.getMemberships().size());
- assertEquals(3, userTO.getResources().size());
- //-----------------------------
-
- try {
- //-----------------------------
- // add user template
- //-----------------------------
- UserTO template = new UserTO();
-
- membershipTO = new MembershipTO();
- membershipTO.setRoleId(10L);
-
- template.getMemberships().add(membershipTO);
-
- template.getResources().add(RESOURCE_NAME_NOPROPAGATION4);
- //-----------------------------
-
- // Update sync task
- SyncTaskTO task = taskService.read(9L);
- assertNotNull(task);
-
- task.setUserTemplate(template);
-
- taskService.update(task.getKey(), task);
- SyncTaskTO actual = taskService.read(task.getKey());
- assertNotNull(actual);
- assertEquals(task.getKey(), actual.getKey());
- assertFalse(actual.getUserTemplate().getResources().isEmpty());
- assertFalse(actual.getUserTemplate().getMemberships().isEmpty());
-
- TaskExecTO execution = execSyncTask(actual.getKey(), 50, false);
- final String status = execution.getStatus();
- assertNotNull(status);
- assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
-
- userTO = readUser("testuser2");
- assertNotNull(userTO);
- assertEquals("testuser2@syncope.apache.org", userTO.getPlainAttrMap().get("userId").getValues().get(0));
- assertEquals(2, userTO.getMemberships().size());
- assertEquals(4, userTO.getResources().size());
- } finally {
- UserTO dUserTO = deleteUser(userTO.getKey());
- assertNotNull(dUserTO);
- }
- }
-
- @Test
- public void issueSYNCOPE230() {
- // 1. read SyncTask for resource-db-sync (table TESTSYNC on external H2)
- execSyncTask(10L, 50, false);
-
- // 3. read e-mail address for user created by the SyncTask first execution
- UserTO userTO = readUser("issuesyncope230");
- assertNotNull(userTO);
- String email = userTO.getPlainAttrMap().get("email").getValues().iterator().next();
- assertNotNull(email);
-
- // 4. update TESTSYNC on external H2 by changing e-mail address
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- jdbcTemplate.execute("UPDATE TESTSYNC SET email='updatedSYNCOPE230@syncope.apache.org'");
-
- // 5. re-execute the SyncTask
- execSyncTask(10L, 50, false);
-
- // 6. verify that the e-mail was updated
- userTO = readUser("issuesyncope230");
- assertNotNull(userTO);
- email = userTO.getPlainAttrMap().get("email").getValues().iterator().next();
- assertNotNull(email);
- assertEquals("updatedSYNCOPE230@syncope.apache.org", email);
- }
-
- @Test
- public void issueSYNCOPE258() {
- // -----------------------------
- // Add a custom correlation rule
- // -----------------------------
- SyncPolicyTO policyTO = policyService.read(9L);
- policyTO.getSpecification().setUserJavaRule(TestSyncRule.class.getName());
-
- policyService.update(policyTO.getKey(), policyTO);
- // -----------------------------
-
- SyncTaskTO task = new SyncTaskTO();
- task.setName("Test Sync Rule");
- task.setResource(RESOURCE_NAME_WS2);
- task.setFullReconciliation(true);
- task.setPerformCreate(true);
- task.setPerformDelete(true);
- task.setPerformUpdate(true);
-
- Response response = taskService.create(task);
- SyncTaskTO actual = getObject(response.getLocation(), TaskService.class, SyncTaskTO.class);
- assertNotNull(actual);
-
- UserTO userTO = UserITCase.getUniqueSampleTO("s258_1@apache.org");
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_WS2);
-
- createUser(userTO);
-
- userTO = UserITCase.getUniqueSampleTO("s258_2@apache.org");
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_WS2);
-
- userTO = createUser(userTO);
-
- // change email in order to unmatch the second user
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getPlainAttrsToRemove().add("email");
- userMod.getPlainAttrsToUpdate().add(attrMod("email", "s258@apache.org"));
-
- userService.update(userMod.getKey(), userMod);
-
- execSyncTask(actual.getKey(), 50, false);
-
- SyncTaskTO executed = taskService.read(actual.getKey());
- assertEquals(1, executed.getExecutions().size());
-
- // asser for just one match
- assertTrue(executed.getExecutions().get(0).getMessage().substring(0, 55) + "...",
- executed.getExecutions().get(0).getMessage().contains("[updated/failures]: 1/0"));
- }
-
- @Test
- public void issueSYNCOPE272() {
- removeTestUsers();
-
- // create user with testdb resource
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope272@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- userTO = createUser(userTO);
- try {
- assertNotNull(userTO);
- assertEquals(1, userTO.getPropagationStatusTOs().size());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
-
- TaskExecTO taskExecTO = execSyncTask(24L, 50, false);
-
- assertNotNull(taskExecTO.getStatus());
- assertTrue(PropagationTaskExecStatus.valueOf(taskExecTO.getStatus()).isSuccessful());
-
- userTO = userService.read(userTO.getKey());
- assertNotNull(userTO);
- assertNotNull(userTO.getPlainAttrMap().get("firstname").getValues().get(0));
- } finally {
- removeTestUsers();
- }
- }
-
- @Test
- public void issueSYNCOPE307() {
- UserTO userTO = UserITCase.getUniqueSampleTO("s307@apache.org");
-
- AttrTO csvuserid = new AttrTO();
- csvuserid.setSchema("csvuserid");
- userTO.getDerAttrs().add(csvuserid);
-
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_WS2);
- userTO.getResources().add(RESOURCE_NAME_CSV);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- userTO = userService.read(userTO.getKey());
- assertEquals("virtualvalue", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // Update sync task
- SyncTaskTO task = taskService.read(12L);
- assertNotNull(task);
-
- // add user template
- UserTO template = new UserTO();
- template.getResources().add(RESOURCE_NAME_DBVIRATTR);
-
- AttrTO userId = attrTO("userId", "'s307@apache.org'");
- template.getPlainAttrs().add(userId);
-
- AttrTO email = attrTO("email", "'s307@apache.org'");
- template.getPlainAttrs().add(email);
-
- task.setUserTemplate(template);
-
- taskService.update(task.getKey(), task);
- execSyncTask(task.getKey(), 50, false);
-
- // check for sync policy
- userTO = userService.read(userTO.getKey());
- assertEquals("virtualvalue", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- try {
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- String value = jdbcTemplate.queryForObject(
- "SELECT USERNAME FROM testsync WHERE ID=?", String.class, userTO.getKey());
- assertEquals("virtualvalue", value);
- } catch (EmptyResultDataAccessException e) {
- assertTrue(false);
- }
- }
-
- @Test
- public void issueSYNCOPE313DB() throws Exception {
- // 1. create user in DB
- UserTO user = UserITCase.getUniqueSampleTO("syncope313-db@syncope.apache.org");
- user.setPassword("security");
- user.getResources().add(RESOURCE_NAME_TESTDB);
- user = createUser(user);
- assertNotNull(user);
- assertFalse(user.getResources().isEmpty());
-
- // 2. Check that the DB resource has the correct password
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- String value = jdbcTemplate.queryForObject(
- "SELECT PASSWORD FROM test WHERE ID=?", String.class, user.getUsername());
- assertEquals(Encryptor.getInstance().encode("security", CipherAlgorithm.SHA1), value.toUpperCase());
-
- // 3. Update the password in the DB
- String newPassword = Encryptor.getInstance().encode("new-security", CipherAlgorithm.SHA1);
- jdbcTemplate.execute(
- "UPDATE test set PASSWORD='" + newPassword + "' where ID='" + user.getUsername() + "'");
-
- // 4. Sync the user from the resource
- SyncTaskTO syncTask = new SyncTaskTO();
- syncTask.setName("DB Sync Task");
- syncTask.setPerformCreate(true);
- syncTask.setPerformUpdate(true);
- syncTask.setFullReconciliation(true);
- syncTask.setResource(RESOURCE_NAME_TESTDB);
- syncTask.getActionsClassNames().add(DBPasswordSyncActions.class.getName());
- Response taskResponse = taskService.create(syncTask);
-
- SyncTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, SyncTaskTO.class);
- assertNotNull(actual);
-
- syncTask = taskService.read(actual.getKey());
- assertNotNull(syncTask);
- assertEquals(actual.getKey(), syncTask.getKey());
- assertEquals(actual.getJobClassName(), syncTask.getJobClassName());
-
- TaskExecTO execution = execSyncTask(syncTask.getKey(), 50, false);
- final String status = execution.getStatus();
- assertNotNull(status);
- assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
-
- // 5. Test the sync'd user
- UserTO updatedUser = userService.read(user.getKey());
- assertEquals(newPassword, updatedUser.getPassword());
-
- // 6. Delete SyncTask + user
- taskService.delete(syncTask.getKey());
- deleteUser(user.getKey());
- }
-
- @Test
- public void issueSYNCOPE313LDAP() throws Exception {
- // First of all, clear any potential conflict with existing user / role
- ldapCleanup();
-
- // 1. create user in LDAP
- UserTO user = UserITCase.getUniqueSampleTO("syncope313-ldap@syncope.apache.org");
- user.setPassword("security");
- user.getResources().add(RESOURCE_NAME_LDAP);
- user = createUser(user);
- assertNotNull(user);
- assertFalse(user.getResources().isEmpty());
-
- // 2. request to change password only on Syncope and not on LDAP
- UserMod userMod = new UserMod();
- userMod.setKey(user.getKey());
- userMod.setPassword("new-security");
- StatusMod pwdPropRequest = new StatusMod();
- pwdPropRequest.setOnSyncope(true);
- pwdPropRequest.getResourceNames().clear();
- userMod.setPwdPropRequest(pwdPropRequest);
- updateUser(userMod);
-
- // 3. Check that the Syncope user now has the changed password
- UserTO updatedUser = userService.read(user.getKey());
- String encodedNewPassword = Encryptor.getInstance().encode("new-security", CipherAlgorithm.SHA1);
- assertEquals(encodedNewPassword, updatedUser.getPassword());
-
- // 4. Check that the LDAP resource has the old password
- ConnObjectTO connObject =
- resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, user.getKey());
- assertNotNull(getLdapRemoteObject(
- connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
- "security",
- connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
-
- // 5. Update the LDAP Connector to retrieve passwords
- ResourceTO ldapResource = resourceService.read(RESOURCE_NAME_LDAP);
- ConnInstanceTO resourceConnector = connectorService.read(ldapResource.getConnectorId());
- ConnConfProperty property = resourceConnector.getConfigurationMap().get("retrievePasswordsWithSearch");
- property.getValues().clear();
- property.getValues().add(Boolean.TRUE);
- connectorService.update(ldapResource.getConnectorId(), resourceConnector);
-
- // 6. Sync the user from the resource
- SyncTaskTO syncTask = new SyncTaskTO();
- syncTask.setName("LDAP Sync Task");
- syncTask.setPerformCreate(true);
- syncTask.setPerformUpdate(true);
- syncTask.setFullReconciliation(true);
- syncTask.setResource(RESOURCE_NAME_LDAP);
- syncTask.getActionsClassNames().add(LDAPPasswordSyncActions.class.getName());
- Response taskResponse = taskService.create(syncTask);
-
- SyncTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, SyncTaskTO.class);
- assertNotNull(actual);
-
- syncTask = taskService.read(actual.getKey());
- assertNotNull(syncTask);
- assertEquals(actual.getKey(), syncTask.getKey());
- assertEquals(actual.getJobClassName(), syncTask.getJobClassName());
-
- TaskExecTO execution = execSyncTask(syncTask.getKey(), 50, false);
- final String status = execution.getStatus();
- assertNotNull(status);
- assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
-
- // 7. Test the sync'd user
- String syncedPassword = Encryptor.getInstance().encode("security", CipherAlgorithm.SHA1);
- updatedUser = userService.read(user.getKey());
- assertEquals(syncedPassword, updatedUser.getPassword());
-
- // 8. Delete SyncTask + user + reset the connector
- taskService.delete(syncTask.getKey());
- property.getValues().clear();
- property.getValues().add(Boolean.FALSE);
- connectorService.update(ldapResource.getConnectorId(), resourceConnector);
- deleteUser(updatedUser.getKey());
- }
-}
[09/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
deleted file mode 100644
index 665e482..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
+++ /dev/null
@@ -1,344 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.AccessControlException;
-import java.util.Map;
-import javax.ws.rs.core.Response;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
-import org.apache.syncope.common.lib.mod.StatusMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.rest.api.Preference;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.common.rest.api.service.UserService;
-import org.junit.Assume;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class UserSelfITCase extends AbstractITCase {
-
- @Test
- public void selfRegistrationAllowed() {
- assertTrue(clientFactory.createAnonymous().isSelfRegAllowed());
- }
-
- @Test
- public void create() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- // 1. self-registration as admin: failure
- try {
- userSelfService.create(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"), true);
- fail();
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- // 2. self-registration as anonymous: works
- SyncopeClient anonClient = clientFactory.createAnonymous();
- UserTO self = anonClient.getService(UserSelfService.class).
- create(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"), true).
- readEntity(UserTO.class);
- assertNotNull(self);
- assertEquals("createApproval", self.getStatus());
- }
-
- @Test
- public void createAndApprove() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- // self-create user with membership: goes 'createApproval' with resources and membership but no propagation
- UserTO userTO = UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org");
- MembershipTO membership = new MembershipTO();
- membership.setRoleId(3L);
- userTO.getMemberships().add(membership);
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- SyncopeClient anonClient = clientFactory.createAnonymous();
- userTO = anonClient.getService(UserSelfService.class).
- create(userTO, true).
- readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("createApproval", userTO.getStatus());
- assertFalse(userTO.getMemberships().isEmpty());
- assertFalse(userTO.getResources().isEmpty());
-
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
-
- // now approve and verify that propagation has happened
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
- Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
- props.get("approve").setValue(Boolean.TRUE.toString());
- form.getProperties().clear();
- form.getProperties().addAll(props.values());
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey()));
- }
-
- @Test
- public void read() {
- UserService userService2 = clientFactory.create("rossini", ADMIN_PWD).getService(UserService.class);
-
- try {
- userService2.read(1L);
- fail();
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- UserSelfService userSelfService2 = clientFactory.create("rossini", ADMIN_PWD).getService(UserSelfService.class);
- UserTO userTO = userSelfService2.read();
- assertEquals("rossini", userTO.getUsername());
- }
-
- @Test
- public void updateWithoutApproval() {
- // 1. create user as admin
- UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
- assertNotNull(created);
- assertFalse(created.getUsername().endsWith("XX"));
-
- // 2. self-update (username) - works
- UserMod userMod = new UserMod();
- userMod.setUsername(created.getUsername() + "XX");
-
- SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
- UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(), userMod).
- readEntity(UserTO.class);
- assertNotNull(updated);
- assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
- ? "active" : "created", updated.getStatus());
- assertTrue(updated.getUsername().endsWith("XX"));
- }
-
- @Test
- public void updateWithApproval() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- // 1. create user as admin
- UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
- assertNotNull(created);
- assertFalse(created.getUsername().endsWith("XX"));
-
- // 2. self-update (username + memberships + resource) - works but needs approval
- MembershipMod membershipMod = new MembershipMod();
- membershipMod.setRole(7L);
- AttrMod testAttrMod = new AttrMod();
- testAttrMod.setSchema("testAttribute");
- testAttrMod.getValuesToBeAdded().add("a value");
- membershipMod.getPlainAttrsToUpdate().add(testAttrMod);
-
- UserMod userMod = new UserMod();
- userMod.setUsername(created.getUsername() + "XX");
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
- userMod.setPassword("newPassword123");
- StatusMod statusMod = new StatusMod();
- statusMod.setOnSyncope(false);
- statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
- userMod.setPwdPropRequest(statusMod);
-
- SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
- UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(), userMod).
- readEntity(UserTO.class);
- assertNotNull(updated);
- assertEquals("updateApproval", updated.getStatus());
- assertFalse(updated.getUsername().endsWith("XX"));
- assertTrue(updated.getMemberships().isEmpty());
-
- // no propagation happened
- assertTrue(updated.getResources().isEmpty());
- try {
- resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
-
- // 3. approve self-update as admin
- WorkflowFormTO form = userWorkflowService.getFormForUser(updated.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
- Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
- props.get("approve").setValue(Boolean.TRUE.toString());
- form.getProperties().clear();
- form.getProperties().addAll(props.values());
- updated = userWorkflowService.submitForm(form);
- assertNotNull(updated);
- assertEquals("active", updated.getStatus());
- assertTrue(updated.getUsername().endsWith("XX"));
- assertEquals(1, updated.getMemberships().size());
-
- // check that propagation also happened
- assertTrue(updated.getResources().contains(RESOURCE_NAME_TESTDB));
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getKey()));
- }
-
- @Test
- public void delete() {
- UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
- assertNotNull(created);
-
- SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
- UserTO deleted = authClient.getService(UserSelfService.class).delete().readEntity(UserTO.class);
- assertNotNull(deleted);
- assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
- ? "deleteApproval" : null, deleted.getStatus());
- }
-
- @Test
- public void issueSYNCOPE373() {
- UserTO userTO = userSelfService.read();
- assertEquals(ADMIN_UNAME, userTO.getUsername());
- }
-
- @Test
- public void noContent() throws IOException {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- SyncopeClient anonClient = clientFactory.createAnonymous();
- UserSelfService noContentService = anonClient.prefer(UserSelfService.class, Preference.RETURN_NO_CONTENT);
-
- UserTO user = UserITCase.getUniqueSampleTO("nocontent-anonymous@syncope.apache.org");
-
- Response response = noContentService.create(user, true);
- assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
- assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
- assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
- }
-
- @Test
- public void passwordReset() {
- // 1. create an user with security question and answer
- UserTO user = UserITCase.getUniqueSampleTO("pwdReset@syncope.apache.org");
- user.setSecurityQuestion(1L);
- user.setSecurityAnswer("Rossi");
- createUser(user);
-
- // 2. verify that new user is able to authenticate
- SyncopeClient authClient = clientFactory.create(user.getUsername(), "password123");
- UserTO read = authClient.getService(UserSelfService.class).read();
- assertNotNull(read);
-
- // 3. request password reset (as anonymous) providing the expected security answer
- SyncopeClient anonClient = clientFactory.createAnonymous();
- try {
- anonClient.getService(UserSelfService.class).requestPasswordReset(user.getUsername(), "WRONG");
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidSecurityAnswer, e.getType());
- }
- anonClient.getService(UserSelfService.class).requestPasswordReset(user.getUsername(), "Rossi");
-
- // 4. get token (normally sent via e-mail, now reading as admin)
- String token = userService.read(read.getKey()).getToken();
- assertNotNull(token);
-
- // 5. confirm password reset
- try {
- anonClient.getService(UserSelfService.class).confirmPasswordReset("WRONG TOKEN", "newPassword");
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- assertTrue(e.getMessage().contains("WRONG TOKEN"));
- }
- anonClient.getService(UserSelfService.class).confirmPasswordReset(token, "newPassword");
-
- // 6. verify that password was reset and token removed
- authClient = clientFactory.create(user.getUsername(), "newPassword");
- read = authClient.getService(UserSelfService.class).read();
- assertNotNull(read);
- assertNull(read.getToken());
- }
-
- @Test
- public void passwordResetWithoutSecurityQuestion() {
- // 0. disable security question for password reset
- configurationService.set("passwordReset.securityQuestion",
- attrTO("passwordReset.securityQuestion", "false"));
-
- // 1. create an user with security question and answer
- UserTO user = UserITCase.getUniqueSampleTO("pwdResetNoSecurityQuestion@syncope.apache.org");
- createUser(user);
-
- // 2. verify that new user is able to authenticate
- SyncopeClient authClient = clientFactory.create(user.getUsername(), "password123");
- UserTO read = authClient.getService(UserSelfService.class).read();
- assertNotNull(read);
-
- // 3. request password reset (as anonymous) with no security answer
- SyncopeClient anonClient = clientFactory.createAnonymous();
- anonClient.getService(UserSelfService.class).requestPasswordReset(user.getUsername(), null);
-
- // 4. get token (normally sent via e-mail, now reading as admin)
- String token = userService.read(read.getKey()).getToken();
- assertNotNull(token);
-
- // 5. confirm password reset
- try {
- anonClient.getService(UserSelfService.class).confirmPasswordReset("WRONG TOKEN", "newPassword");
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- assertTrue(e.getMessage().contains("WRONG TOKEN"));
- }
- anonClient.getService(UserSelfService.class).confirmPasswordReset(token, "newPassword");
-
- // 6. verify that password was reset and token removed
- authClient = clientFactory.create(user.getUsername(), "newPassword");
- read = authClient.getService(UserSelfService.class).read();
- assertNotNull(read);
- assertNull(read.getToken());
-
- // 7. re-enable security question for password reset
- configurationService.set("passwordReset.securityQuestion",
- attrTO("passwordReset.securityQuestion", "true"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
deleted file mode 100644
index c7354dd..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
+++ /dev/null
@@ -1,299 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.junit.Assume;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class UserWorkflowITCase extends AbstractITCase {
-
- @Test
- public void createWithReject() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- // User with role 9 are defined in workflow as subject to approval
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(9L);
- userTO.getMemberships().add(membershipTO);
-
- // 1. create user with role 9
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals(1, userTO.getMemberships().size());
- assertEquals(9, userTO.getMemberships().get(0).getRoleId());
- assertEquals("createApproval", userTO.getStatus());
-
- // 2. request if there is any pending task for user just created
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
- assertNotNull(form.getUserKey());
- assertEquals(userTO.getKey(), form.getUserKey());
- assertNotNull(form.getTaskId());
- assertNull(form.getOwner());
-
- // 3. claim task from rossini, not in role 7 (designated for approval in workflow definition): fail
- UserWorkflowService userService2 = clientFactory.create(
- "rossini", ADMIN_PWD).getService(UserWorkflowService.class);
-
- try {
- userService2.claimForm(form.getTaskId());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.Workflow, e.getType());
- }
-
- // 4. claim task from bellini, in role 7
- UserWorkflowService userService3 = clientFactory.create(
- "bellini", ADMIN_PWD).getService(UserWorkflowService.class);
-
- form = userService3.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 5. reject user
- Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
- props.get("approve").setValue(Boolean.FALSE.toString());
- props.get("rejectReason").setValue("I don't like him.");
- form.getProperties().clear();
- form.getProperties().addAll(props.values());
- userTO = userService3.submitForm(form);
- assertNotNull(userTO);
- assertEquals("rejected", userTO.getStatus());
-
- // 6. check that rejected user was not propagated to external resource (SYNCOPE-364)
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- Exception exception = null;
- try {
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] { userTO.getUsername() }, Integer.class);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNotNull(exception);
- }
-
- @Test
- public void createWithApproval() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- List<WorkflowFormTO> forms = userWorkflowService.getForms();
- assertNotNull(forms);
- int preForms = forms.size();
-
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithApproval@syncope.apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
- // User with role 9 are defined in workflow as subject to approval
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(9L);
- userTO.getMemberships().add(membershipTO);
-
- // 1. create user with role 9 (and verify that no propagation occurred)
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals(1, userTO.getMemberships().size());
- assertEquals(9, userTO.getMemberships().get(0).getRoleId());
- assertEquals("createApproval", userTO.getStatus());
- assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
-
- assertTrue(userTO.getPropagationStatusTOs().isEmpty());
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- Exception exception = null;
- try {
- jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
- new String[] { userTO.getUsername() }, Integer.class);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNotNull(exception);
-
- // 2. request if there is any pending form for user just created
- forms = userWorkflowService.getForms();
- assertNotNull(forms);
- assertEquals(preForms + 1, forms.size());
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNull(form.getOwner());
-
- // 4. claim task (from admin)
- form = userWorkflowService.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 5. approve user (and verify that propagation occurred)
- Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
- props.get("approve").setValue(Boolean.TRUE.toString());
- form.getProperties().clear();
- form.getProperties().addAll(props.values());
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
- assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
-
- exception = null;
- try {
- final String username = jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class,
- userTO.getUsername());
- assertEquals(userTO.getUsername(), username);
- } catch (EmptyResultDataAccessException e) {
- exception = e;
- }
- assertNull(exception);
-
- // 6. update user
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.setPassword("anotherPassword123");
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- }
-
- @Test
- public void issueSYNCOPE15() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- // read forms *before* any operation
- List<WorkflowFormTO> forms = userWorkflowService.getForms();
- assertNotNull(forms);
- int preForms = forms.size();
-
- UserTO userTO = UserITCase.getUniqueSampleTO("issueSYNCOPE15@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().clear();
- userTO.getMemberships().clear();
-
- // User with role 9 are defined in workflow as subject to approval
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(9L);
- userTO.getMemberships().add(membershipTO);
-
- // 1. create user with role 9 (and verify that no propagation occurred)
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertNotEquals(0L, userTO.getKey());
- assertNotNull(userTO.getCreationDate());
- assertNotNull(userTO.getCreator());
- assertNotNull(userTO.getLastChangeDate());
- assertNotNull(userTO.getLastModifier());
- assertEquals(userTO.getCreationDate(), userTO.getLastChangeDate());
-
- // 2. request if there is any pending form for user just created
- forms = userWorkflowService.getForms();
- assertEquals(preForms + 1, forms.size());
-
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- assertNotNull(form);
-
- // 3. first claim ny bellini ....
- UserWorkflowService userService3 = clientFactory.create(
- "bellini", ADMIN_PWD).getService(UserWorkflowService.class);
-
- form = userService3.claimForm(form.getTaskId());
- assertNotNull(form);
- assertNotNull(form.getTaskId());
- assertNotNull(form.getOwner());
-
- // 4. second claim task by admin
- form = userWorkflowService.claimForm(form.getTaskId());
- assertNotNull(form);
-
- // 5. approve user
- final Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
- props.get("approve").setValue(Boolean.TRUE.toString());
- form.getProperties().clear();
- form.getProperties().addAll(props.values());
-
- // 6. submit approve
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals(preForms, userWorkflowService.getForms().size());
- assertNull(userWorkflowService.getFormForUser(userTO.getKey()));
-
- // 7. search approval into the history as well
- forms = userWorkflowService.getFormsByName(userTO.getKey(), "Create approval");
- assertFalse(forms.isEmpty());
-
- int count = 0;
- for (WorkflowFormTO hform : forms) {
- if (form.getTaskId().equals(hform.getTaskId())) {
- count++;
-
- assertEquals("createApproval", hform.getKey());
- assertNotNull(hform.getCreateTime());
- assertNotNull(hform.getDueDate());
- assertTrue(Boolean.parseBoolean(hform.getPropertyMap().get("approve").getValue()));
- assertNull(hform.getPropertyMap().get("rejectReason").getValue());
- }
- }
- assertEquals(1, count);
-
- userService.delete(userTO.getKey());
-
- try {
- userService.read(userTO.getKey());
- fail();
- } catch (Exception ignore) {
- assertNotNull(ignore);
- }
-
- try {
- userWorkflowService.getFormsByName(userTO.getKey(), "Create approval");
- fail();
- } catch (Exception ignore) {
- assertNotNull(ignore);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java
deleted file mode 100644
index 1dc6f20..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java
+++ /dev/null
@@ -1,872 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Collections;
-import java.util.Map;
-import org.apache.commons.lang3.SerializationUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
-import org.apache.syncope.common.lib.mod.StatusMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.ConnInstanceTO;
-import org.apache.syncope.common.lib.to.ConnObjectTO;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.syncope.common.lib.to.MappingTO;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.lib.types.MappingPurpose;
-import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class VirAttrITCase extends AbstractITCase {
-
- @Test
- public void issueSYNCOPE16() {
- UserTO userTO = UserITCase.getUniqueSampleTO("issue16@apache.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(8L);
- userTO.getMemberships().add(membershipTO);
-
- // 1. create user
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
-
- // 2. check for virtual attribute value
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertEquals("virtualvalue", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- UserMod userMod = new UserMod();
- userMod.setKey(actual.getKey());
- userMod.getVirAttrsToRemove().add("virtualdata");
- userMod.getVirAttrsToUpdate().add(attrMod("virtualdata", "virtualupdated"));
-
- // 3. update virtual attribute
- actual = updateUser(userMod);
- assertNotNull(actual);
-
- // 4. check for virtual attribute value
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertEquals("virtualupdated", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
- }
-
- @Test
- public void issueSYNCOPE260() {
- // ----------------------------------
- // create user and check virtual attribute value propagation
- // ----------------------------------
- UserTO userTO = UserITCase.getUniqueSampleTO("260@a.com");
- userTO.getResources().add(RESOURCE_NAME_WS2);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
- assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
-
- ConnObjectTO connObjectTO =
- resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
- assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
- // ----------------------------------
-
- // ----------------------------------
- // update user virtual attribute and check virtual attribute value update propagation
- // ----------------------------------
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
-
- AttrMod attrMod = new AttrMod();
- attrMod.setSchema("virtualdata");
- attrMod.getValuesToBeRemoved().add("virtualvalue");
- attrMod.getValuesToBeAdded().add("virtualvalue2");
-
- userMod.getVirAttrsToUpdate().add(attrMod);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertEquals("ws-target-resource-2", userTO.getPropagationStatusTOs().get(0).getResource());
- assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
- assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
- // ----------------------------------
-
- // ----------------------------------
- // suspend/reactivate user and check virtual attribute value (unchanged)
- // ----------------------------------
- StatusMod statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.SUSPEND);
- userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
- assertEquals("suspended", userTO.getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
- assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
- assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
-
- statusMod = new StatusMod();
- statusMod.setType(StatusMod.ModType.REACTIVATE);
- userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
- assertEquals("active", userTO.getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
- assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
- assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
- // ----------------------------------
-
- // ----------------------------------
- // update user attribute and check virtual attribute value (unchanged)
- // ----------------------------------
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
-
- attrMod = new AttrMod();
- attrMod.setSchema("surname");
- attrMod.getValuesToBeRemoved().add("Surname");
- attrMod.getValuesToBeAdded().add("Surname2");
-
- userMod.getPlainAttrsToUpdate().add(attrMod);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
- assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
- assertEquals("Surname2", connObjectTO.getPlainAttrMap().get("SURNAME").getValues().get(0));
-
- // attribute "name" mapped on virtual attribute "virtualdata" shouldn't be changed
- assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
- assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
- // ----------------------------------
-
- // ----------------------------------
- // remove user virtual attribute and check virtual attribute value (reset)
- // ----------------------------------
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getVirAttrsToRemove().add("virtualdata");
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- assertTrue(userTO.getVirAttrs().isEmpty());
- assertFalse(userTO.getPropagationStatusTOs().isEmpty());
- assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
- assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
-
- connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
- assertNotNull(connObjectTO);
-
- // attribute "name" mapped on virtual attribute "virtualdata" should be reset
- assertTrue(connObjectTO.getPlainAttrMap().get("NAME").getValues() == null
- || connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
- // ----------------------------------
- }
-
- @Test
- public void virAttrCache() {
- UserTO userTO = UserITCase.getUniqueSampleTO("virattrcache@apache.org");
- userTO.getVirAttrs().clear();
-
- AttrTO virAttrTO = new AttrTO();
- virAttrTO.setSchema("virtualdata");
- virAttrTO.getValues().add("virattrcache");
- userTO.getVirAttrs().add(virAttrTO);
-
- userTO.getMemberships().clear();
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
-
- // 1. create user
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
-
- // 2. check for virtual attribute value
- actual = userService.read(actual.getKey());
- assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // 3. update virtual attribute directly
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- String value = jdbcTemplate.queryForObject(
- "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
- assertEquals("virattrcache", value);
-
- jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getKey());
-
- value = jdbcTemplate.queryForObject(
- "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
- assertEquals("virattrcache2", value);
-
- // 4. check for cached attribute value
- actual = userService.read(actual.getKey());
- assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- UserMod userMod = new UserMod();
- userMod.setKey(actual.getKey());
-
- AttrMod virtualdata = new AttrMod();
- virtualdata.setSchema("virtualdata");
- virtualdata.getValuesToBeAdded().add("virtualupdated");
-
- userMod.getVirAttrsToRemove().add("virtualdata");
- userMod.getVirAttrsToUpdate().add(virtualdata);
-
- // 5. update virtual attribute
- actual = updateUser(userMod);
- assertNotNull(actual);
-
- // 6. check for virtual attribute value
- actual = userService.read(actual.getKey());
- assertNotNull(actual);
- assertEquals("virtualupdated", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
- }
-
- @Test
- public void issueSYNCOPE397() {
- ResourceTO csv = resourceService.read(RESOURCE_NAME_CSV);
- final MappingTO origMapping = SerializationUtils.clone(csv.getUmapping());
- try {
- // change mapping of resource-csv
- assertNotNull(origMapping);
- for (MappingItemTO item : csv.getUmapping().getItems()) {
- if ("email".equals(item.getIntAttrName())) {
- // unset internal attribute mail and set virtual attribute virtualdata as mapped to external email
- item.setIntMappingType(IntMappingType.UserVirtualSchema);
- item.setIntAttrName("virtualdata");
- item.setPurpose(MappingPurpose.BOTH);
- item.setExtAttrName("email");
- }
- }
-
- resourceService.update(csv.getKey(), csv);
- csv = resourceService.read(RESOURCE_NAME_CSV);
- assertNotNull(csv.getUmapping());
-
- boolean found = false;
- for (MappingItemTO item : csv.getUmapping().getItems()) {
- if ("email".equals(item.getExtAttrName()) && "virtualdata".equals(item.getIntAttrName())) {
- found = true;
- }
- }
-
- assertTrue(found);
-
- // create a new user
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope397@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getDerAttrs().clear();
- userTO.getVirAttrs().clear();
-
- userTO.getDerAttrs().add(attrTO("csvuserid", null));
- userTO.getDerAttrs().add(attrTO("cn", null));
- userTO.getVirAttrs().add(attrTO("virtualdata", "test@testone.org"));
- // assign resource-csv to user
- userTO.getResources().add(RESOURCE_NAME_CSV);
- // save user
- UserTO created = createUser(userTO);
- // make std controls about user
- assertNotNull(created);
- assertTrue(RESOURCE_NAME_CSV.equals(created.getResources().iterator().next()));
- // update user
- UserTO toBeUpdated = userService.read(created.getKey());
- UserMod userMod = new UserMod();
- userMod.setKey(toBeUpdated.getKey());
- userMod.setPassword("password2");
- // assign new resource to user
- userMod.getResourcesToAdd().add(RESOURCE_NAME_WS2);
- //modify virtual attribute
- userMod.getVirAttrsToRemove().add("virtualdata");
- userMod.getVirAttrsToUpdate().add(attrMod("virtualdata", "test@testoneone.com"));
-
- // check Syncope change password
- StatusMod pwdPropRequest = new StatusMod();
- pwdPropRequest.setOnSyncope(true);
- pwdPropRequest.getResourceNames().add(RESOURCE_NAME_WS2);
- userMod.setPwdPropRequest(pwdPropRequest);
-
- toBeUpdated = updateUser(userMod);
- assertNotNull(toBeUpdated);
- assertEquals("test@testoneone.com", toBeUpdated.getVirAttrs().get(0).getValues().get(0));
- // check if propagates correctly with assertEquals on size of tasks list
- assertEquals(2, toBeUpdated.getPropagationStatusTOs().size());
- } finally {
- // restore mapping of resource-csv
- csv.setUmapping(origMapping);
- resourceService.update(csv.getKey(), csv);
- }
- }
-
- @Test
- public void issueSYNCOPE442() {
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope442@apache.org");
- userTO.getVirAttrs().clear();
-
- AttrTO virAttrTO = new AttrTO();
- virAttrTO.setSchema("virtualdata");
- virAttrTO.getValues().add("virattrcache");
- userTO.getVirAttrs().add(virAttrTO);
-
- userTO.getMemberships().clear();
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
-
- // 1. create user
- UserTO actual = createUser(userTO);
- assertNotNull(actual);
-
- // 2. check for virtual attribute value
- actual = userService.read(actual.getKey());
- assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // ----------------------------------------
- // 3. force cache expiring without any modification
- // ----------------------------------------
- String jdbcURL = null;
- ConnInstanceTO connInstanceBean = connectorService.readByResource(RESOURCE_NAME_DBVIRATTR);
- for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
- if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
- jdbcURL = prop.getValues().iterator().next().toString();
- prop.getValues().clear();
- prop.getValues().add("jdbc:h2:tcp://localhost:9092/xxx");
- }
- }
-
- connectorService.update(connInstanceBean.getKey(), connInstanceBean);
-
- UserMod userMod = new UserMod();
- userMod.setKey(actual.getKey());
-
- AttrMod virtualdata = new AttrMod();
- virtualdata.setSchema("virtualdata");
- virtualdata.getValuesToBeAdded().add("virtualupdated");
-
- userMod.getVirAttrsToRemove().add("virtualdata");
- userMod.getVirAttrsToUpdate().add(virtualdata);
-
- actual = updateUser(userMod);
- assertNotNull(actual);
- // ----------------------------------------
-
- // ----------------------------------------
- // 4. update virtual attribute
- // ----------------------------------------
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- String value = jdbcTemplate.queryForObject(
- "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
- assertEquals("virattrcache", value);
-
- jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getKey());
-
- value = jdbcTemplate.queryForObject(
- "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
- assertEquals("virattrcache2", value);
- // ----------------------------------------
-
- actual = userService.read(actual.getKey());
- assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // ----------------------------------------
- // 5. restore connector
- // ----------------------------------------
- for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
- if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
- prop.getValues().clear();
- prop.getValues().add(jdbcURL);
- }
- }
-
- connectorService.update(connInstanceBean.getKey(), connInstanceBean);
- // ----------------------------------------
-
- actual = userService.read(actual.getKey());
- assertEquals("virattrcache2", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
- }
-
- @Test
- public void issueSYNCOPE436() {
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope436@syncope.apache.org");
- userTO.getMemberships().clear();
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_LDAP);
- userTO.getVirAttrs().add(attrTO("virtualReadOnly", "readOnly"));
- userTO = createUser(userTO);
- //Finding no values because the virtual attribute is readonly
- assertTrue(userTO.getVirAttrMap().get("virtualReadOnly").getValues().isEmpty());
- }
-
- @Test
- public void issueSYNCOPE453() {
- final String resourceName = "issueSYNCOPE453-Res-" + getUUIDString();
- final String roleName = "issueSYNCOPE453-Role-" + getUUIDString();
-
- // -------------------------------------------
- // Create a resource ad-hoc
- // -------------------------------------------
- final ResourceTO resourceTO = new ResourceTO();
-
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(107L);
-
- MappingTO mapping = new MappingTO();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntAttrName("aLong");
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setExtAttrName(roleName);
- item.setPurpose(MappingPurpose.PROPAGATION);
- item.setAccountid(true);
- mapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setExtAttrName("USERNAME");
- item.setIntAttrName("username");
- item.setIntMappingType(IntMappingType.Username);
- item.setPurpose(MappingPurpose.PROPAGATION);
- mapping.getItems().add(item);
-
- item = new MappingItemTO();
- item.setExtAttrName("EMAIL");
- item.setIntAttrName("rvirtualdata");
- item.setIntMappingType(IntMappingType.RoleVirtualSchema);
- item.setPurpose(MappingPurpose.PROPAGATION);
- mapping.getItems().add(item);
-
- resourceTO.setUmapping(mapping);
- assertNotNull(getObject(
- resourceService.create(resourceTO).getLocation(), ResourceService.class, ResourceTO.class));
- // -------------------------------------------
-
- // -------------------------------------------
- // Create a role ad-hoc
- // -------------------------------------------
- RoleTO roleTO = new RoleTO();
- roleTO.setName(roleName);
- roleTO.setParent(8L);
- roleTO.getRVirAttrTemplates().add("rvirtualdata");
- roleTO.getVirAttrs().add(attrTO("rvirtualdata", "ml@role.it"));
- roleTO.getResources().add(RESOURCE_NAME_LDAP);
- roleTO = createRole(roleTO);
- assertEquals(1, roleTO.getVirAttrs().size());
- assertEquals("ml@role.it", roleTO.getVirAttrs().get(0).getValues().get(0));
- // -------------------------------------------
-
- // -------------------------------------------
- // Create new user
- // -------------------------------------------
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope453@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO("aLong", "123"));
- userTO.getResources().clear();
- userTO.getResources().add(resourceName);
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().clear();
- userTO.getMemberships().clear();
-
- final MembershipTO membership = new MembershipTO();
- membership.setRoleId(roleTO.getKey());
- membership.getVirAttrs().add(attrTO("mvirtualdata", "mvirtualvalue"));
- userTO.getMemberships().add(membership);
-
- userTO = createUser(userTO);
- assertEquals(2, userTO.getPropagationStatusTOs().size());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- assertTrue(userTO.getPropagationStatusTOs().get(1).getStatus().isSuccessful());
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- final Map<String, Object> actuals = jdbcTemplate.queryForMap(
- "SELECT id, surname, email FROM testsync WHERE id=?",
- new Object[] { Integer.parseInt(userTO.getPlainAttrMap().get("aLong").getValues().get(0)) });
-
- assertEquals(userTO.getPlainAttrMap().get("aLong").getValues().get(0), actuals.get("id").toString());
- assertEquals("ml@role.it", actuals.get("email"));
- // -------------------------------------------
-
- // -------------------------------------------
- // Delete resource and role ad-hoc
- // -------------------------------------------
- resourceService.delete(resourceName);
- roleService.delete(roleTO.getKey());
- // -------------------------------------------
- }
-
- @Test
- public void issueSYNCOPE459() {
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope459@apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getVirAttrs().clear();
-
- final AttrTO virtualReadOnly = attrTO("virtualReadOnly", "");
- virtualReadOnly.getValues().clear();
-
- userTO.getVirAttrs().add(virtualReadOnly);
-
- userTO = createUser(userTO);
-
- assertNotNull(userTO.getVirAttrMap().get("virtualReadOnly"));
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
-
- AttrMod virtualdata = new AttrMod();
- virtualdata.setSchema("virtualdata");
-
- userMod.getVirAttrsToUpdate().add(virtualdata);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO.getVirAttrMap().get("virtualdata"));
- }
-
- @Test
- public void issueSYNCOPE458() {
- // -------------------------------------------
- // Create a role ad-hoc
- // -------------------------------------------
- final String roleName = "issueSYNCOPE458-Role-" + getUUIDString();
- RoleTO roleTO = new RoleTO();
- roleTO.setName(roleName);
- roleTO.setParent(2L);
- roleTO.setInheritTemplates(true);
- roleTO = createRole(roleTO);
- // -------------------------------------------
-
- // -------------------------------------------
- // Update resource-db-virattr mapping adding new membership virtual schema mapping
- // -------------------------------------------
- ResourceTO resourceDBVirAttr = resourceService.read(RESOURCE_NAME_DBVIRATTR);
- assertNotNull(resourceDBVirAttr);
-
- final MappingTO resourceUMapping = resourceDBVirAttr.getUmapping();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntAttrName("mvirtualdata");
- item.setIntMappingType(IntMappingType.MembershipVirtualSchema);
- item.setExtAttrName("EMAIL");
- item.setPurpose(MappingPurpose.BOTH);
-
- resourceUMapping.addItem(item);
-
- resourceDBVirAttr.setUmapping(resourceUMapping);
-
- resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
- // -------------------------------------------
-
- // -------------------------------------------
- // Create new user
- // -------------------------------------------
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope458@syncope.apache.org");
- userTO.getResources().clear();
- userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
- userTO.getVirAttrs().clear();
- userTO.getDerAttrs().clear();
- userTO.getMemberships().clear();
-
- // add membership, with virtual attribute populated, to user
- MembershipTO membership = new MembershipTO();
- membership.setRoleId(roleTO.getKey());
- membership.getVirAttrs().add(attrTO("mvirtualdata", "syncope458@syncope.apache.org"));
- userTO.getMemberships().add(membership);
-
- //propagate user
- userTO = createUser(userTO);
- assertEquals(1, userTO.getPropagationStatusTOs().size());
- assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
- // -------------------------------------------
-
- // 1. check if membership has virtual attribute populated
- assertNotNull(userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata"));
- assertEquals("syncope458@syncope.apache.org",
- userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata").getValues().get(0));
- // -------------------------------------------
-
- // 2. update membership virtual attribute
- MembershipMod membershipMod = new MembershipMod();
- membershipMod.setRole(roleTO.getKey());
- membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope458_NEW@syncope.apache.org"));
-
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- // 3. check again after update if membership has virtual attribute populated with new value
- assertNotNull(userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata"));
- assertEquals("syncope458_NEW@syncope.apache.org", userTO.getMemberships().get(0).getVirAttrMap().get(
- "mvirtualdata").getValues().get(0));
-
- // ----------------------------------------
- // force cache expiring without any modification
- // ----------------------------------------
- String jdbcURL = null;
- ConnInstanceTO connInstanceBean = connectorService.readByResource(RESOURCE_NAME_DBVIRATTR);
- for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
- if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
- jdbcURL = prop.getValues().iterator().next().toString();
- prop.getValues().clear();
- prop.getValues().add("jdbc:h2:tcp://localhost:9092/xxx");
- }
- }
-
- connectorService.update(connInstanceBean.getKey(), connInstanceBean);
-
- membershipMod = new MembershipMod();
- membershipMod.setRole(roleTO.getKey());
- membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope458_updated@syncope.apache.org"));
-
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- // ----------------------------------
-
- // change attribute value directly on resource
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- String value = jdbcTemplate.queryForObject(
- "SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
- assertEquals("syncope458_NEW@syncope.apache.org", value);
-
- jdbcTemplate.update("UPDATE testsync set EMAIL='syncope458_NEW_TWO@syncope.apache.org' WHERE ID=?", userTO.
- getKey());
-
- value = jdbcTemplate.queryForObject("SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
- assertEquals("syncope458_NEW_TWO@syncope.apache.org", value);
- // ----------------------------------------
-
- // ----------------------------------------
- // restore connector
- // ----------------------------------------
- for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
- if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
- prop.getValues().clear();
- prop.getValues().add(jdbcURL);
- }
- }
- connectorService.update(connInstanceBean.getKey(), connInstanceBean);
- // ----------------------------------------
-
- userTO = userService.read(userTO.getKey());
- assertNotNull(userTO);
- // 4. check virtual attribute synchronization after direct update on resource
- assertEquals("syncope458_NEW_TWO@syncope.apache.org", userTO.getMemberships().get(0).getVirAttrMap().get(
- "mvirtualdata").getValues().get(0));
-
- // 5. remove membership virtual attribute
- membershipMod = new MembershipMod();
- membershipMod.setRole(roleTO.getKey());
- membershipMod.getVirAttrsToRemove().add("mvirtualdata");
-
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- // check again after update if membership hasn't any virtual attribute
- assertTrue(userTO.getMemberships().get(0).getVirAttrMap().isEmpty());
-
- // -------------------------------------------
- // Delete role ad-hoc and restore resource mapping
- // -------------------------------------------
- roleService.delete(roleTO.getKey());
-
- resourceUMapping.removeItem(item);
- resourceDBVirAttr.setUmapping(resourceUMapping);
- resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
- // -------------------------------------------
- }
-
- @Test
- public void issueSYNCOPE501() {
- // PHASE 1: update only user virtual attributes
-
- // 1. create user and propagate him on resource-db-virattr
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope501@apache.org");
- userTO.getResources().clear();
- userTO.getMemberships().clear();
- userTO.getVirAttrs().clear();
-
- userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
-
- // virtualdata is mapped with username
- final AttrTO virtualData = attrTO("virtualdata", "syncope501@apache.org");
- userTO.getVirAttrs().add(virtualData);
-
- userTO = createUser(userTO);
-
- assertNotNull(userTO.getVirAttrMap().get("virtualdata"));
- assertEquals("syncope501@apache.org", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // 2. update virtual attribute
- UserMod userMod = new UserMod();
- userMod.setKey(userTO.getKey());
-
- final StatusMod statusMod = new StatusMod();
- statusMod.getResourceNames().addAll(Collections.<String>emptySet());
- statusMod.setOnSyncope(false);
-
- userMod.setPwdPropRequest(statusMod);
- // change virtual attribute value
- final AttrMod virtualDataMod = new AttrMod();
- virtualDataMod.setSchema("virtualdata");
- virtualDataMod.getValuesToBeAdded().add("syncope501_updated@apache.org");
- virtualDataMod.getValuesToBeRemoved().add("syncope501@apache.org");
- userMod.getVirAttrsToUpdate().add(virtualDataMod);
- userMod.getVirAttrsToRemove().add("virtualdata");
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- // 3. check that user virtual attribute has really been updated
- assertFalse(userTO.getVirAttrMap().get("virtualdata").getValues().isEmpty());
- assertEquals("syncope501_updated@apache.org", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
-
- // ----------------------------------------------------------
- // PHASE 2: update only membership virtual attributes
- // -------------------------------------------
- // Update resource-db-virattr mapping adding new membership virtual schema mapping
- // -------------------------------------------
- ResourceTO resourceDBVirAttr = resourceService.read(RESOURCE_NAME_DBVIRATTR);
- assertNotNull(resourceDBVirAttr);
-
- final MappingTO resourceUMapping = resourceDBVirAttr.getUmapping();
-
- MappingItemTO item = new MappingItemTO();
- item.setIntAttrName("mvirtualdata");
- item.setIntMappingType(IntMappingType.MembershipVirtualSchema);
- item.setExtAttrName("EMAIL");
- item.setPurpose(MappingPurpose.BOTH);
-
- resourceUMapping.addItem(item);
-
- resourceDBVirAttr.setUmapping(resourceUMapping);
-
- resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
- // -------------------------------------------
-
- // -------------------------------------------
- // Create a role ad-hoc
- // -------------------------------------------
- final String roleName = "issueSYNCOPE501-Role-" + getUUIDString();
- RoleTO roleTO = new RoleTO();
- roleTO.setName(roleName);
- roleTO.setParent(2L);
- roleTO.setInheritTemplates(true);
- roleTO = createRole(roleTO);
- // -------------------------------------------
-
- // 1. add membership, with virtual attribute populated, to user
- MembershipMod membershipMod = new MembershipMod();
- membershipMod.setRole(roleTO.getKey());
- membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope501membership@test.org"));
-
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.setPwdPropRequest(statusMod);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- assertEquals("syncope501membership@test.org",
- userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata").getValues().get(0));
-
- // 2. update only membership virtual attribute and propagate user
- membershipMod = new MembershipMod();
- membershipMod.setRole(roleTO.getKey());
- membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata",
- "syncope501membership_updated@test.org"));
- membershipMod.getVirAttrsToRemove().add("syncope501membership@test.org");
-
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToAdd().add(membershipMod);
- userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
- userMod.setPwdPropRequest(statusMod);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
-
- // 3. check if change has been propagated
- assertEquals("syncope501membership_updated@test.org", userTO.getMemberships().get(0).getVirAttrMap().
- get("mvirtualdata").getValues().get(0));
-
- // 4. delete membership and check on resource attribute deletion
- userMod = new UserMod();
- userMod.setKey(userTO.getKey());
- userMod.getMembershipsToRemove().add(userTO.getMemberships().get(0).getKey());
- userMod.setPwdPropRequest(statusMod);
-
- userTO = updateUser(userMod);
- assertNotNull(userTO);
- assertTrue(userTO.getMemberships().isEmpty());
-
- // read attribute value directly on resource
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
-
- final String emailValue = jdbcTemplate.queryForObject(
- "SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
- assertTrue(StringUtils.isBlank(emailValue));
- // ----------------------------------------
-
- // -------------------------------------------
- // Delete role ad-hoc and restore resource mapping
- // -------------------------------------------
- roleService.delete(roleTO.getKey());
-
- resourceUMapping.removeItem(item);
- resourceDBVirAttr.setUmapping(resourceUMapping);
- resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
- // -------------------------------------------
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java
deleted file mode 100644
index 884b5cb..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java
+++ /dev/null
@@ -1,122 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.VirSchemaTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class VirSchemaITCase extends AbstractITCase {
-
- @Test
- public void list() {
- List<VirSchemaTO> vSchemas = schemaService.list(AttributableType.USER, SchemaType.VIRTUAL);
- assertFalse(vSchemas.isEmpty());
- for (VirSchemaTO vSchemaTO : vSchemas) {
- assertNotNull(vSchemaTO);
- }
- }
-
- @Test
- public void read() {
- VirSchemaTO vSchemaTO = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL,
- "mvirtualdata");
- assertNotNull(vSchemaTO);
- }
-
- @Test
- public void create() {
- VirSchemaTO schema = new VirSchemaTO();
- schema.setKey("virtual");
-
- VirSchemaTO actual = createSchema(AttributableType.USER, SchemaType.VIRTUAL, schema);
- assertNotNull(actual);
-
- actual = schemaService.read(AttributableType.USER, SchemaType.VIRTUAL, actual.getKey());
- assertNotNull(actual);
- }
-
- @Test
- public void delete() {
- VirSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaType.VIRTUAL, "rvirtualdata");
- assertNotNull(schema);
-
- schemaService.delete(AttributableType.ROLE, SchemaType.VIRTUAL, schema.getKey());
-
- try {
- schemaService.read(AttributableType.ROLE, SchemaType.VIRTUAL, "rvirtualdata");
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE323() {
- VirSchemaTO actual = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, "mvirtualdata");
- assertNotNull(actual);
-
- try {
- createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.EntityExists, e.getType());
- }
-
- actual.setKey(null);
- try {
- createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE418() {
- VirSchemaTO schema = new VirSchemaTO();
- schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
-
- try {
- createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, schema);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidVirSchema, e.getType());
-
- assertTrue(e.getElements().iterator().next().toString().contains(EntityViolationType.InvalidName.name()));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
deleted file mode 100644
index 2f203e6..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
+++ /dev/null
@@ -1,77 +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.fit.server.reference;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.junit.Assume;
-import org.junit.Test;
-
-public class WorkflowITCase extends AbstractITCase {
-
- private void exportDefinition(final SubjectType type) throws IOException {
- Response response = workflowService.exportDefinition(type);
- assertTrue(response.getMediaType().toString().
- startsWith(clientFactory.getContentType().getMediaType().toString()));
- assertTrue(response.getEntity() instanceof InputStream);
- String definition = IOUtils.toString((InputStream) response.getEntity());
- assertNotNull(definition);
- assertFalse(definition.isEmpty());
- }
-
- @Test
- public void exportUserDefinition() throws IOException {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
- exportDefinition(SubjectType.USER);
- }
-
- @Test
- public void getRoleDefinition() throws IOException {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles(syncopeService));
- exportDefinition(SubjectType.ROLE);
- }
-
- private void importDefinition(final SubjectType type) throws IOException {
- Response response = workflowService.exportDefinition(type);
- String definition = IOUtils.toString((InputStream) response.getEntity());
-
- workflowService.importDefinition(type, definition);
- }
-
- @Test
- public void updateUserDefinition() throws IOException {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- importDefinition(SubjectType.USER);
- }
-
- @Test
- public void updateRoleDefinition() throws IOException {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles(syncopeService));
-
- importDefinition(SubjectType.ROLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl b/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl
deleted file mode 100644
index 44fd18e..0000000
--- a/syncope620/fit/reference/src/test/resources/addActivitiToContent.xsl
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:template match="/dataset">
- <dataset>
- <xsl:apply-templates/>
-
- <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
- <ACT_RU_TASK ID_="5" REV_="2" EXECUTION_ID_="4" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
-
- <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
- <ACT_RU_TASK ID_="7" REV_="2" EXECUTION_ID_="6" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
-
- <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
- <ACT_RU_TASK ID_="9" REV_="2" EXECUTION_ID_="8" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
-
- <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
- <ACT_RU_TASK ID_="11" REV_="2" EXECUTION_ID_="10" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
-
- <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
- <ACT_RU_TASK ID_="13" REV_="2" EXECUTION_ID_="12" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
- </dataset>
- </xsl:template>
-
- <xsl:template match="node()|@*|comment()">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
-
-</xsl:stylesheet>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/resources/favicon.jpg
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/resources/favicon.jpg b/syncope620/fit/reference/src/test/resources/favicon.jpg
deleted file mode 100644
index cf212be..0000000
Binary files a/syncope620/fit/reference/src/test/resources/favicon.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/resources/test.csv
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/resources/test.csv b/syncope620/fit/reference/src/test/resources/test.csv
deleted file mode 100644
index f227366..0000000
--- a/syncope620/fit/reference/src/test/resources/test.csv
+++ /dev/null
@@ -1,10 +0,0 @@
-test0,nome0,cognome0,test0@syncope.apache.org,password0,role1,membership1,true,false
-test1,nome1,cognome1,test1@syncope.apache.org,password1,role1,membership1,false,false
-test2,nome2,cognome2,test2@syncope.apache.org,notpermitted1,role1,membership1,true,false
-test3,nome3,cognome3,test3@syncope.apache.org,password3,role1,membership1,true,false
-test4,nome4,cognome4,test4@syncope.apache.org,password4,role1,membership1,true,false
-test5,nome5,cognome5,test5@syncope.apache.org,password5,role1,membership1,true,false
-test6,nome6,cognome6,test6@syncope.apache.org,password6,role1,membership1,true,false
-test7,nome7,cognome7,test7@syncope.apache.org,password7,role1,membership1,true,false
-test8,nome8,cognome8,test8@syncope.apache.org,password8,role1,membership1,true,false
-test9,nome9,cognome9,test9@syncope.apache.org,password999,role1,membership1,true,false
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/resources/testJDBCContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/resources/testJDBCContext.xml b/syncope620/fit/reference/src/test/resources/testJDBCContext.xml
deleted file mode 100644
index d89e067..0000000
--- a/syncope620/fit/reference/src/test/resources/testJDBCContext.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="testDataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="${testdb.driver}"/>
- <property name="url" value="${testdb.url}"/>
- <property name="username" value="${testdb.username}"/>
- <property name="password" value="${testdb.password}"/>
- </bean>
-
-</beans>
[13/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java
deleted file mode 100644
index cb09ea8..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java
+++ /dev/null
@@ -1,172 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.NotificationTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.lib.types.TraceLevel;
-import org.apache.syncope.common.rest.api.service.NotificationService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class NotificationITCase extends AbstractITCase {
-
- private NotificationTO buildNotificationTO() {
- NotificationTO notificationTO = new NotificationTO();
- notificationTO.setTraceLevel(TraceLevel.SUMMARY);
- notificationTO.getEvents().add("create");
-
- notificationTO.setUserAbout(SyncopeClient.getUserSearchConditionBuilder().
- is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query());
-
- notificationTO.setRecipientAttrName("email");
- notificationTO.setRecipientAttrType(IntMappingType.UserPlainSchema);
-
- notificationTO.setSender("syncope@syncope.apache.org");
- notificationTO.setSubject("Test notification");
- notificationTO.setTemplate("test");
- return notificationTO;
- }
-
- @Test
- public void read() {
- NotificationTO notificationTO = notificationService.read(10L);
- assertNotNull(notificationTO);
- }
-
- @Test
- public void list() {
- List<NotificationTO> notificationTOs = notificationService.list();
- assertNotNull(notificationTOs);
- assertFalse(notificationTOs.isEmpty());
- for (NotificationTO instance : notificationTOs) {
- assertNotNull(instance);
- }
- }
-
- @Test
- public void create() {
- NotificationTO notificationTO = buildNotificationTO();
- notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
-
- Response response = notificationService.create(notificationTO);
- NotificationTO actual = getObject(response.getLocation(), NotificationService.class,
- NotificationTO.class);
-
- assertNotNull(actual);
- assertNotNull(actual.getKey());
- notificationTO.setKey(actual.getKey());
- assertEquals(actual, notificationTO);
- }
-
- @Test
- public void update() {
- NotificationTO notificationTO = notificationService.read(10L);
- notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
-
- notificationService.update(notificationTO.getKey(), notificationTO);
- NotificationTO actual = notificationService.read(notificationTO.getKey());
- assertNotNull(actual);
- assertEquals(actual, notificationTO);
- }
-
- @Test
- public void delete() {
- NotificationTO notification = buildNotificationTO();
- notification.setSelfAsRecipient(true);
- Response response = notificationService.create(notification);
- notification = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
-
- notificationService.delete(notification.getKey());
-
- try {
- notificationService.read(notification.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE83() {
- NotificationTO notificationTO = buildNotificationTO();
- notificationTO.setSelfAsRecipient(true);
-
- NotificationTO actual = null;
- try {
- Response response = notificationService.create(notificationTO);
- actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- }
- assertNotNull(actual);
- assertNotNull(actual.getKey());
- notificationTO.setKey(actual.getKey());
- assertEquals(actual, notificationTO);
- }
-
- @Test
- public void issueSYNCOPE445() {
- NotificationTO notificationTO = buildNotificationTO();
- notificationTO.getStaticRecipients().add("syncope445@syncope.apache.org");
-
- NotificationTO actual = null;
- try {
- Response response = notificationService.create(notificationTO);
- actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- }
- assertNotNull(actual);
- assertNotNull(actual.getKey());
- notificationTO.setKey(actual.getKey());
- assertEquals(actual, notificationTO);
- }
-
- @Test
- public void issueSYNCOPE446() {
- NotificationTO notificationTO = buildNotificationTO();
- notificationTO.getStaticRecipients().add("syncope446@syncope.apache.org");
- notificationTO.setRoleAbout(SyncopeClient.getRoleSearchConditionBuilder().hasEntitlements("ROLE_READ").query());
-
- NotificationTO actual = null;
- try {
- Response response = notificationService.create(notificationTO);
- actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- }
- assertNotNull(actual);
- assertNotNull(actual.getKey());
- notificationTO.setKey(actual.getKey());
- assertEquals(actual, notificationTO);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java
deleted file mode 100644
index 4cd302b..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java
+++ /dev/null
@@ -1,156 +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.fit.server.reference;
-
-import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.NotificationTO;
-import org.apache.syncope.common.lib.to.NotificationTaskTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.TaskExecTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.lib.types.TraceLevel;
-import org.apache.syncope.common.rest.api.service.NotificationService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class NotificationTaskITCase extends AbstractTaskITCase {
-
- @Test
- public void issueSYNCOPE81() {
- String sender = "syncope81@syncope.apache.org";
- createNotificationTask(sender);
- NotificationTaskTO taskTO = findNotificationTaskBySender(sender);
- assertNotNull(taskTO);
-
- assertTrue(taskTO.getExecutions().isEmpty());
-
- // generate an execution in order to verify the deletion of a notification task with one or more executions
- TaskExecTO execution = taskService.execute(taskTO.getKey(), false);
- assertEquals("NOT_SENT", execution.getStatus());
-
- int i = 0;
- int maxit = 50;
- int executions = 0;
-
- // wait for task exec completion (executions incremented)
- do {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
-
- taskTO = taskService.read(taskTO.getKey());
-
- assertNotNull(taskTO);
- assertNotNull(taskTO.getExecutions());
-
- i++;
- } while (executions == taskTO.getExecutions().size() && i < maxit);
-
- assertFalse(taskTO.getExecutions().isEmpty());
-
- taskService.delete(taskTO.getKey());
- }
-
- @Test
- public void issueSYNCOPE86() {
- // 1. create notification task
- String sender = "syncope86@syncope.apache.org";
- createNotificationTask(sender);
-
- // 2. get NotificationTaskTO for user just created
- NotificationTaskTO taskTO = findNotificationTaskBySender(sender);
- assertNotNull(taskTO);
- assertTrue(taskTO.getExecutions().isEmpty());
-
- try {
- // 3. execute the generated NotificationTask
- TaskExecTO execution = taskService.execute(taskTO.getKey(), false);
- assertNotNull(execution);
-
- // 4. verify
- taskTO = taskService.read(taskTO.getKey());
- assertNotNull(taskTO);
- assertEquals(1, taskTO.getExecutions().size());
- } finally {
- // Remove execution to make test re-runnable
- taskService.deleteExecution(taskTO.getExecutions().get(0).getKey());
- }
- }
-
- private NotificationTaskTO findNotificationTaskBySender(final String sender) {
- PagedResult<NotificationTaskTO> tasks = taskService.list(TaskType.NOTIFICATION);
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
- NotificationTaskTO taskTO = null;
- for (NotificationTaskTO task : tasks.getResult()) {
- if (sender.equals(task.getSender())) {
- taskTO = task;
- }
- }
- return taskTO;
- }
-
- private void createNotificationTask(final String sender) {
- // 1. Create notification
- NotificationTO notification = new NotificationTO();
- notification.setTraceLevel(TraceLevel.FAILURES);
- notification.getEvents().add("[REST]:[UserLogic]:[]:[create]:[SUCCESS]");
-
- notification.setUserAbout(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
-
- notification.setRecipients(SyncopeClient.getUserSearchConditionBuilder().hasRoles(8L).query());
- notification.setSelfAsRecipient(true);
-
- notification.setRecipientAttrName("email");
- notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
-
- notification.setSender(sender);
- String subject = "Test notification";
- notification.setSubject(subject);
- notification.setTemplate("optin");
- notification.setActive(true);
-
- Response response = notificationService.create(notification);
- notification = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
- assertNotNull(notification);
-
- // 2. create user
- UserTO userTO = UserITCase.getUniqueSampleTO("syncope@syncope.apache.org");
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java
deleted file mode 100644
index 448d1fa..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java
+++ /dev/null
@@ -1,317 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.security.AccessControlException;
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.commons.lang3.SerializationUtils;
-import org.apache.syncope.common.lib.AttributableOperations;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.CipherAlgorithm;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.rest.api.service.SchemaService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class PlainSchemaITCase extends AbstractITCase {
-
- private PlainSchemaTO buildPlainSchemaTO(final String name, final AttrSchemaType type) {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey(name + getUUIDString());
- schemaTO.setType(type);
- return schemaTO;
- }
-
- @Test
- public void create() {
- PlainSchemaTO schemaTO = buildPlainSchemaTO("testAttribute", AttrSchemaType.String);
- schemaTO.setMandatoryCondition("false");
-
- PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- assertEquals(schemaTO, newPlainSchemaTO);
-
- newPlainSchemaTO = createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, schemaTO);
- assertEquals(schemaTO, newPlainSchemaTO);
- }
-
- @Test
- public void createWithNotPermittedName() {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("failedLogins");
- schemaTO.setType(AttrSchemaType.String);
-
- try {
- createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- fail("This should not be reacheable");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
-
- assertTrue(e.getElements().iterator().next().toString().
- contains(EntityViolationType.InvalidName.name()));
- }
- }
-
- @Test
- public void createREnumWithoutEnumeration() {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("enumcheck");
- schemaTO.setType(AttrSchemaType.Enum);
-
- try {
- createSchema(AttributableType.ROLE, SchemaType.PLAIN, schemaTO);
- fail("This should not be reacheable");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
-
- assertTrue(e.getElements().iterator().next().toString().
- contains(EntityViolationType.InvalidSchemaEnum.name()));
- }
- }
-
- @Test
- public void createUEnumWithoutEnumeration() {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("enumcheck");
- schemaTO.setType(AttrSchemaType.Enum);
-
- try {
- createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- fail("This should not be reacheable");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
-
- assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidSchemaEnum.name()));
- }
- }
-
- @Test
- public void createEncrypted() {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("encrypted");
- schemaTO.setType(AttrSchemaType.Encrypted);
- schemaTO.setCipherAlgorithm(CipherAlgorithm.AES);
- schemaTO.setSecretKey("huhadfhsjfsfsdkj!####");
-
- createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, schemaTO);
- }
-
- @Test
- public void createBinary() {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("x509certificate");
- schemaTO.setType(AttrSchemaType.Binary);
- schemaTO.setMimeType("application/x-x509-ca-cert");
-
- createSchema(AttributableType.ROLE, SchemaType.PLAIN, schemaTO);
- }
-
- @Test
- public void delete() {
- PlainSchemaTO schemaTO = buildPlainSchemaTO("todelete", AttrSchemaType.String);
- schemaTO.setMandatoryCondition("false");
- createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
-
- schemaService.delete(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey());
- PlainSchemaTO firstname = null;
- try {
- firstname = schemaService.read(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey());
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- assertNull(firstname);
- }
-
- @Test
- public void list() {
- List<PlainSchemaTO> userSchemas = schemaService.list(AttributableType.USER, SchemaType.PLAIN);
- assertFalse(userSchemas.isEmpty());
- for (PlainSchemaTO schemaTO : userSchemas) {
- assertNotNull(schemaTO);
- }
-
- List<PlainSchemaTO> roleSchemas = schemaService.list(AttributableType.ROLE, SchemaType.PLAIN);
- assertFalse(roleSchemas.isEmpty());
- for (PlainSchemaTO schemaTO : roleSchemas) {
- assertNotNull(schemaTO);
- }
-
- List<PlainSchemaTO> membershipSchemas = schemaService.list(AttributableType.MEMBERSHIP, SchemaType.PLAIN);
- assertFalse(membershipSchemas.isEmpty());
- for (PlainSchemaTO schemaTO : membershipSchemas) {
- assertNotNull(schemaTO);
- }
- }
-
- @Test
- public void update() {
- PlainSchemaTO schemaTO = schemaService.read(AttributableType.ROLE, SchemaType.PLAIN, "icon");
- assertNotNull(schemaTO);
-
- schemaService.update(AttributableType.ROLE, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
- PlainSchemaTO updatedTO = schemaService.read(AttributableType.ROLE, SchemaType.PLAIN, "icon");
- assertEquals(schemaTO, updatedTO);
-
- updatedTO.setType(AttrSchemaType.Date);
- try {
- schemaService.update(AttributableType.ROLE, SchemaType.PLAIN, schemaTO.getKey(), updatedTO);
- fail("This should not be reacheable");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
- }
- }
-
- @Test
- public void issue258() {
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("schema_issue258");
- schemaTO.setType(AttrSchemaType.Double);
-
- schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- assertNotNull(schemaTO);
-
- UserTO userTO = UserITCase.getUniqueSampleTO("issue258@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO(schemaTO.getKey(), "1.2"));
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- schemaTO.setType(AttrSchemaType.Long);
- try {
- schemaService.update(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
- fail("This should not be reacheable");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
- }
- }
-
- @Test
- public void issue259() {
- PlainSchemaTO schemaTO = buildPlainSchemaTO("schema_issue259", AttrSchemaType.Double);
- schemaTO.setUniqueConstraint(true);
-
- schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- assertNotNull(schemaTO);
-
- UserTO userTO = UserITCase.getUniqueSampleTO("issue259@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO(schemaTO.getKey(), "1"));
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserTO newUserTO = SerializationUtils.clone(userTO);
- MembershipTO membership = new MembershipTO();
- membership.setRoleId(2L);
- newUserTO.getMemberships().add(membership);
-
- UserMod userMod = AttributableOperations.diff(newUserTO, userTO);
-
- userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
- assertNotNull(userTO);
- }
-
- @Test
- public void issue260() {
- PlainSchemaTO schemaTO = buildPlainSchemaTO("schema_issue260", AttrSchemaType.Double);
- schemaTO.setUniqueConstraint(true);
-
- schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- assertNotNull(schemaTO);
-
- UserTO userTO = UserITCase.getUniqueSampleTO("issue260@syncope.apache.org");
- userTO.getPlainAttrs().add(attrTO(schemaTO.getKey(), "1.2"));
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- schemaTO.setUniqueConstraint(false);
- try {
- schemaService.update(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
- fail("This should not be reacheable");
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE323() {
- PlainSchemaTO actual = schemaService.read(AttributableType.ROLE, SchemaType.PLAIN, "icon");
- assertNotNull(actual);
-
- try {
- createSchema(AttributableType.ROLE, SchemaType.PLAIN, actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.EntityExists, e.getType());
- }
-
- actual.setKey(null);
- try {
- createSchema(AttributableType.ROLE, SchemaType.PLAIN, actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE418() {
- PlainSchemaTO schema = buildPlainSchemaTO("http://schemas.examples.org/security/authorization/organizationUnit",
- AttrSchemaType.Double);
-
- try {
- createSchema(AttributableType.ROLE, SchemaType.PLAIN, schema);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
- assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
- }
- }
-
- @Test
- public void anonymous() {
- SchemaService unauthenticated = clientFactory.createAnonymous().getService(SchemaService.class);
- try {
- unauthenticated.list(AttributableType.USER, SchemaType.VIRTUAL);
- fail();
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- SchemaService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).getService(SchemaService.class);
- assertFalse(anonymous.list(AttributableType.USER, SchemaType.VIRTUAL).isEmpty());
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java
deleted file mode 100644
index c25dc7f..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java
+++ /dev/null
@@ -1,238 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.Arrays;
-import java.util.List;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AccountPolicyTO;
-import org.apache.syncope.common.lib.to.PasswordPolicyTO;
-import org.apache.syncope.common.lib.to.SyncPolicyTO;
-import org.apache.syncope.common.lib.types.AccountPolicySpec;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.PasswordPolicySpec;
-import org.apache.syncope.common.lib.types.PolicyType;
-import org.apache.syncope.common.lib.types.SyncPolicySpec;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class PolicyITCase extends AbstractITCase {
-
- private SyncPolicyTO buildSyncPolicyTO() {
- SyncPolicyTO policy = new SyncPolicyTO();
-
- SyncPolicySpec spec = new SyncPolicySpec();
- spec.setUserJavaRule(TestSyncRule.class.getName());
-
- policy.setSpecification(spec);
- policy.setDescription("Sync policy");
-
- return policy;
- }
-
- @Test
- public void listByType() {
- List<SyncPolicyTO> policyTOs = policyService.list(PolicyType.SYNC);
-
- assertNotNull(policyTOs);
- assertFalse(policyTOs.isEmpty());
- }
-
- @Test
- public void getAccountPolicy() {
- AccountPolicyTO policyTO = policyService.read(6L);
-
- assertNotNull(policyTO);
- assertTrue(policyTO.getUsedByResources().isEmpty());
- assertEquals(Arrays.asList(6L, 7L, 10L, 14L), policyTO.getUsedByRoles());
- }
-
- @Test
- public void getPasswordPolicy() {
- PasswordPolicyTO policyTO = policyService.read(4L);
-
- assertNotNull(policyTO);
- assertTrue(policyTO.getUsedByResources().contains(RESOURCE_NAME_NOPROPAGATION));
- assertEquals(Arrays.asList(6L, 7L, 10L, 8L), policyTO.getUsedByRoles());
- }
-
- @Test
- public void getSyncPolicy() {
- SyncPolicyTO policyTO = policyService.read(1L);
-
- assertNotNull(policyTO);
- assertTrue(policyTO.getUsedByRoles().isEmpty());
- }
-
- @Test
- public void getGlobalAccountPolicy() {
- AccountPolicyTO policyTO = policyService.readGlobal(PolicyType.ACCOUNT);
-
- assertNotNull(policyTO);
- assertEquals(PolicyType.GLOBAL_ACCOUNT, policyTO.getType());
- }
-
- @Test
- public void getGlobalPasswordPolicy() {
- PasswordPolicyTO policyTO = policyService.readGlobal(PolicyType.PASSWORD);
-
- assertNotNull(policyTO);
- assertEquals(PolicyType.GLOBAL_PASSWORD, policyTO.getType());
- assertEquals(8, policyTO.getSpecification().getMinLength());
- assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_NOPROPAGATION));
- }
-
- @Test
- public void getGlobalSyncPolicy() {
- SyncPolicyTO policyTO = policyService.readGlobal(PolicyType.SYNC);
-
- assertNotNull(policyTO);
- assertEquals(PolicyType.GLOBAL_SYNC, policyTO.getType());
- assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_CSV));
- assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_WS2));
- assertTrue(policyTO.getUsedByRoles().isEmpty());
- }
-
- @Test
- public void createWithException() {
- PasswordPolicyTO policy = new PasswordPolicyTO(true);
- policy.setSpecification(new PasswordPolicySpec());
- policy.setDescription("global password policy");
-
- try {
- createPolicy(policy);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
- }
- }
-
- @Test
- public void createMissingDescription() {
- SyncPolicyTO policy = new SyncPolicyTO();
- policy.setSpecification(new SyncPolicySpec());
-
- try {
- createPolicy(policy);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
- }
- }
-
- @Test
- public void create() {
- SyncPolicyTO policy = buildSyncPolicyTO();
-
- SyncPolicyTO policyTO = createPolicy(policy);
-
- assertNotNull(policyTO);
- assertEquals(PolicyType.SYNC, policyTO.getType());
- assertEquals(TestSyncRule.class.getName(), policyTO.getSpecification().getUserJavaRule());
- }
-
- @Test
- public void update() {
- // get global password
- PasswordPolicyTO globalPolicy = policyService.read(2L);
-
- PasswordPolicyTO policy = new PasswordPolicyTO();
- policy.setDescription("A simple password policy");
- policy.setSpecification(globalPolicy.getSpecification());
-
- // create a new password policy using global password as a template
- policy = createPolicy(policy);
-
- // read new password policy
- policy = policyService.read(policy.getKey());
-
- assertNotNull("find to update did not work", policy);
-
- PasswordPolicySpec policySpec = policy.getSpecification();
- policySpec.setMaxLength(22);
- policy.setSpecification(policySpec);
-
- // update new password policy
- policyService.update(policy.getKey(), policy);
- policy = policyService.read(policy.getKey());
-
- assertNotNull(policy);
- assertEquals(PolicyType.PASSWORD, policy.getType());
- assertEquals(22, policy.getSpecification().getMaxLength());
- assertEquals(8, policy.getSpecification().getMinLength());
- }
-
- @Test
- public void delete() {
- SyncPolicyTO policy = buildSyncPolicyTO();
-
- SyncPolicyTO policyTO = createPolicy(policy);
- assertNotNull(policyTO);
-
- policyService.delete(policyTO.getKey());
-
- try {
- policyService.read(policyTO.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void getCorrelationRules() {
- assertEquals(1, syncopeService.info().getSyncCorrelationRules().size());
- }
-
- @Test
- public void issueSYNCOPE466() {
- PasswordPolicyTO policy = policyService.read(4L);
- assertEquals(PolicyType.PASSWORD, policy.getType());
-
- policy.setType(PolicyType.GLOBAL_PASSWORD);
- try {
- policyService.update(policy.getKey(), policy);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE553() {
- AccountPolicyTO policy = new AccountPolicyTO(false);
- policy.setDescription("SYNCOPE553");
-
- final AccountPolicySpec accountPolicySpec = new AccountPolicySpec();
- accountPolicySpec.setMinLength(3);
- accountPolicySpec.setMaxLength(8);
- policy.setSpecification(accountPolicySpec);
-
- policy = createPolicy(policy);
- assertNotNull(policy);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java
deleted file mode 100644
index a79e1d8..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java
+++ /dev/null
@@ -1,150 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
-import org.apache.syncope.common.lib.to.BulkAction;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.PropagationTaskTO;
-import org.apache.syncope.common.lib.to.ReportExecTO;
-import org.apache.syncope.common.lib.to.TaskExecTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class PropagationTaskITCase extends AbstractTaskITCase {
-
- @Test
- public void paginatedList() {
- PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 2);
-
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
- assertEquals(2, tasks.getResult().size());
-
- for (AbstractTaskTO task : tasks.getResult()) {
- assertNotNull(task);
- }
-
- tasks = taskService.list(TaskType.PROPAGATION, 2, 2);
-
- assertNotNull(tasks);
- assertFalse(tasks.getResult().isEmpty());
-
- for (AbstractTaskTO task : tasks.getResult()) {
- assertNotNull(task);
- }
-
- tasks = taskService.list(TaskType.PROPAGATION, 1000, 2);
-
- assertNotNull(tasks);
- assertTrue(tasks.getResult().isEmpty());
- }
-
- @Test
- public void read() {
- final PropagationTaskTO taskTO = taskService.read(3L);
- assertNotNull(taskTO);
- assertNotNull(taskTO.getExecutions());
- assertTrue(taskTO.getExecutions().isEmpty());
- }
-
- @Test
- public void readExecution() {
- TaskExecTO taskTO = taskService.readExecution(6L);
- assertNotNull(taskTO);
- }
-
- @Test
- public void deal() {
- // Currently test is not re-runnable.
- // To successfully run test second time it is necessary to restart cargo
- try {
- taskService.delete(0L);
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- TaskExecTO exec = taskService.execute(1L, false);
- assertEquals(PropagationTaskExecStatus.SUBMITTED.name(), exec.getStatus());
-
- ReportExecTO report = new ReportExecTO();
- report.setStatus(PropagationTaskExecStatus.SUCCESS.name());
- report.setMessage("OK");
- taskService.report(exec.getKey(), report);
- exec = taskService.readExecution(exec.getKey());
- assertEquals(PropagationTaskExecStatus.SUCCESS.name(), exec.getStatus());
- assertEquals("OK", exec.getMessage());
-
- taskService.delete(1L);
- try {
- taskService.readExecution(exec.getKey());
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void issue196() {
- TaskExecTO exec = taskService.execute(6L, false);
- assertNotNull(exec);
- assertEquals(0, exec.getKey());
- assertNotNull(exec.getTask());
- }
-
- @Test
- public void bulkAction() {
- final PagedResult<PropagationTaskTO> before = taskService.list(TaskType.PROPAGATION);
-
- // create user with testdb resource
- final UserTO userTO = UserITCase.getUniqueSampleTO("taskBulk@apache.org");
- userTO.getResources().add(RESOURCE_NAME_TESTDB);
- createUser(userTO);
-
- final List<PropagationTaskTO> after = new ArrayList<>(
- taskService.<PropagationTaskTO>list(TaskType.PROPAGATION).getResult());
-
- after.removeAll(before.getResult());
-
- assertFalse(after.isEmpty());
-
- final BulkAction bulkAction = new BulkAction();
- bulkAction.setOperation(BulkAction.Type.DELETE);
-
- for (AbstractTaskTO taskTO : after) {
- bulkAction.getTargets().add(String.valueOf(taskTO.getKey()));
- }
-
- taskService.bulk(bulkAction);
-
- assertFalse(taskService.list(TaskType.PROPAGATION).getResult().containsAll(after));
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
deleted file mode 100644
index f845997..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
+++ /dev/null
@@ -1,354 +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.fit.server.reference;
-
-import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.syncope.common.lib.to.MappingTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.PushTaskTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.TaskExecTO;
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.lib.types.MappingPurpose;
-import org.apache.syncope.common.lib.types.MatchingRule;
-import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.lib.types.UnmatchingRule;
-import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.apache.syncope.common.rest.api.service.TaskService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class PushTaskITCase extends AbstractTaskITCase {
-
- @Test
- public void getPushActionsClasses() {
- List<String> actions = syncopeService.info().getPushActions();
- assertNotNull(actions);
- }
-
- @Test
- public void read() {
- PushTaskTO pushTaskTO = taskService.<PushTaskTO>read(17L);
- assertEquals(UnmatchingRule.ASSIGN, pushTaskTO.getUnmatchingRule());
- assertEquals(MatchingRule.UPDATE, pushTaskTO.getMatchingRule());
- }
-
- @Test
- public void list() {
- final PagedResult<PushTaskTO> tasks = taskService.list(TaskType.PUSH);
- assertFalse(tasks.getResult().isEmpty());
- for (AbstractTaskTO task : tasks.getResult()) {
- if (!(task instanceof PushTaskTO)) {
- fail();
- }
- }
- }
-
- @Test
- public void createPushTask() {
- PushTaskTO task = new PushTaskTO();
- task.setName("Test create Push");
- task.setResource(RESOURCE_NAME_WS2);
- task.setUserFilter(
- SyncopeClient.getUserSearchConditionBuilder().hasNotResources(RESOURCE_NAME_TESTDB2).query());
- task.setRoleFilter(
- SyncopeClient.getRoleSearchConditionBuilder().isNotNull("cool").query());
- task.setMatchingRule(MatchingRule.LINK);
-
- final Response response = taskService.create(task);
- final PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
- assertNotNull(actual);
-
- task = taskService.read(actual.getKey());
- assertNotNull(task);
- assertEquals(task.getKey(), actual.getKey());
- assertEquals(task.getJobClassName(), actual.getJobClassName());
- assertEquals(task.getUserFilter(), actual.getUserFilter());
- assertEquals(task.getRoleFilter(), actual.getRoleFilter());
- assertEquals(UnmatchingRule.ASSIGN, actual.getUnmatchingRule());
- assertEquals(MatchingRule.LINK, actual.getMatchingRule());
- }
-
- @Test
- public void pushMatchingUnmatchingRoles() {
- assertFalse(roleService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
-
- execSyncTask(23L, 50, false);
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, 3L));
- assertTrue(roleService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
-
- execSyncTask(23L, 50, false);
-
- assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, 3L));
- assertFalse(roleService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
- }
-
- @Test
- public void pushUnmatchingUsers() throws Exception {
- assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertFalse(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertFalse(userService.read(4L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertTrue(userService.read(5L).getResources().contains(RESOURCE_NAME_TESTDB2));
-
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='puccini'").size());
-
- // ------------------------------------------
- // Unmatching --> Assign --> dryRuyn
- // ------------------------------------------
- execSyncTask(13L, 50, true);
- assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
- assertFalse(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
- // ------------------------------------------
-
- final Set<Long> pushTaskIds = new HashSet<>();
- pushTaskIds.add(13L);
- pushTaskIds.add(14L);
- pushTaskIds.add(15L);
- pushTaskIds.add(16L);
- execSyncTasks(pushTaskIds, 50, false);
-
- // ------------------------------------------
- // Unatching --> Ignore
- // ------------------------------------------
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
- assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
- // ------------------------------------------
-
- // ------------------------------------------
- // Unmatching --> Assign
- // ------------------------------------------
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
- assertTrue(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
- jdbcTemplate.execute("DELETE FROM test2 WHERE ID='vivaldi'");
- // ------------------------------------------
-
- // ------------------------------------------
- // Unmatching --> Provision
- // ------------------------------------------
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='bellini'").size());
- assertFalse(userService.read(4L).getResources().contains(RESOURCE_NAME_TESTDB2));
- jdbcTemplate.execute("DELETE FROM test2 WHERE ID='bellini'");
- // ------------------------------------------
-
- // ------------------------------------------
- // Unmatching --> Unlink
- // ------------------------------------------
- assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='puccini'").size());
- assertFalse(userService.read(5L).getResources().contains(RESOURCE_NAME_TESTDB2));
- // ------------------------------------------
- }
-
- @Test
- public void pushMatchingUser() throws Exception {
- assertTrue(userService.read(1L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
-
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
-
- // ------------------------------------------
- // Matching --> Deprovision --> dryRuyn
- // ------------------------------------------
- execSyncTask(19L, 50, true);
- assertTrue(userService.read(1L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
- // ------------------------------------------
-
- final Set<Long> pushTaskIds = new HashSet<>();
- pushTaskIds.add(18L);
- pushTaskIds.add(19L);
- pushTaskIds.add(16L);
-
- execSyncTasks(pushTaskIds, 50, false);
-
- // ------------------------------------------
- // Matching --> Deprovision && Ignore
- // ------------------------------------------
- assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
- // DELETE Capability not available ....
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
- // ------------------------------------------
-
- // ------------------------------------------
- // Matching --> Unassign
- // ------------------------------------------
- assertFalse(userService.read(1L).getResources().contains(RESOURCE_NAME_TESTDB2));
- // DELETE Capability not available ....
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
- // ------------------------------------------
-
- // ------------------------------------------
- // Matching --> Link
- // ------------------------------------------
- execSyncTask(20L, 50, false);
- assertTrue(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
- // ------------------------------------------
-
- pushTaskIds.clear();
- pushTaskIds.add(21L);
- pushTaskIds.add(22L);
-
- execSyncTasks(pushTaskIds, 50, false);
-
- // ------------------------------------------
- // Matching --> Unlink && Update
- // ------------------------------------------
- assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
- assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
- // ------------------------------------------
- }
-
- @Test
- public void issueSYNCOPE598() {
- // create a new role schema
- final PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("LDAPGroupName" + getUUIDString());
- schemaTO.setType(AttrSchemaType.String);
- schemaTO.setMandatoryCondition("true");
-
- final PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.ROLE, SchemaType.PLAIN, schemaTO);
- assertEquals(schemaTO, newPlainSchemaTO);
-
- // create a new sample role
- RoleTO roleTO = new RoleTO();
- roleTO.setName("all" + getUUIDString());
- roleTO.setParent(8L);
-
- roleTO.getRAttrTemplates().add(newPlainSchemaTO.getKey());
- roleTO.getPlainAttrs().add(attrTO(newPlainSchemaTO.getKey(), "all"));
-
- roleTO = createRole(roleTO);
- assertNotNull(roleTO);
-
- String resourceName = "resource-ldap-roleonly";
- ResourceTO newResourceTO = null;
-
- try {
- // Create resource ad-hoc
- ResourceTO resourceTO = new ResourceTO();
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(105L);
-
- final MappingTO umapping = new MappingTO();
- MappingItemTO item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.Username);
- item.setExtAttrName("cn");
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.PROPAGATION);
- item.setMandatoryCondition("true");
- umapping.setAccountIdItem(item);
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setExtAttrName("surname");
- item.setIntAttrName("sn");
- item.setPurpose(MappingPurpose.BOTH);
- umapping.addItem(item);
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.UserPlainSchema);
- item.setExtAttrName("email");
- item.setIntAttrName("mail");
- item.setPurpose(MappingPurpose.BOTH);
- umapping.addItem(item);
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.Password);
- item.setPassword(true);
- item.setPurpose(MappingPurpose.BOTH);
- item.setMandatoryCondition("true");
- umapping.addItem(item);
-
- umapping.setAccountLink("'cn=' + username + ',ou=people,o=isp'");
-
- final MappingTO rmapping = new MappingTO();
-
- item = new MappingItemTO();
- item.setIntMappingType(IntMappingType.RolePlainSchema);
- item.setExtAttrName("cn");
- item.setIntAttrName(newPlainSchemaTO.getKey());
- item.setAccountid(true);
- item.setPurpose(MappingPurpose.BOTH);
- rmapping.setAccountIdItem(item);
-
- rmapping.setAccountLink("'cn=' + " + newPlainSchemaTO.getKey() + " + ',ou=groups,o=isp'");
-
- resourceTO.setRmapping(rmapping);
-
- Response response = resourceService.create(resourceTO);
- newResourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
-
- assertNotNull(newResourceTO);
- assertNull(newResourceTO.getUmapping());
- assertNotNull(newResourceTO.getRmapping());
-
- // create push task ad-hoc
- final PushTaskTO task = new PushTaskTO();
- task.setName("issueSYNCOPE598");
- task.setResource(resourceName);
- task.setPerformCreate(true);
- task.setPerformDelete(true);
- task.setPerformUpdate(true);
- task.setUnmatchingRule(UnmatchingRule.ASSIGN);
- task.setMatchingRule(MatchingRule.UPDATE);
-
- response = taskService.create(task);
- final PushTaskTO push = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
-
- assertNotNull(push);
-
- // execute the new task
- final TaskExecTO pushExec = execSyncTask(push.getKey(), 50, false);
- assertTrue(PropagationTaskExecStatus.valueOf(pushExec.getStatus()).isSuccessful());
- } finally {
- roleService.delete(roleTO.getKey());
- if (newResourceTO != null) {
- resourceService.delete(resourceName);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java
deleted file mode 100644
index 8102fe0..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java
+++ /dev/null
@@ -1,252 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.report.UserReportletConf;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.ReportExecTO;
-import org.apache.syncope.common.lib.to.ReportTO;
-import org.apache.syncope.common.lib.types.ReportExecExportFormat;
-import org.apache.syncope.common.lib.types.ReportExecStatus;
-import org.apache.syncope.common.lib.wrap.ReportletConfClass;
-import org.apache.syncope.common.rest.api.service.ReportService;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class ReportITCase extends AbstractITCase {
-
- private ReportTO createReport(final ReportTO report) {
- Response response = reportService.create(report);
- assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusInfo().getStatusCode());
- return getObject(response.getLocation(), ReportService.class, ReportTO.class);
- }
-
- @Test
- public void getReportletClasses() {
- List<ReportletConfClass> reportletClasses = reportService.getReportletConfClasses();
- assertNotNull(reportletClasses);
- assertFalse(reportletClasses.isEmpty());
- }
-
- @Test
- public void list() {
- PagedResult<ReportTO> reports = reportService.list();
- assertNotNull(reports);
- assertFalse(reports.getResult().isEmpty());
- for (ReportTO report : reports.getResult()) {
- assertNotNull(report);
- }
- }
-
- @Test
- public void read() {
- ReportTO reportTO = reportService.read(1L);
-
- assertNotNull(reportTO);
- assertNotNull(reportTO.getExecutions());
- assertFalse(reportTO.getExecutions().isEmpty());
- }
-
- @Test
- public void readExecution() {
- ReportExecTO reportExecTO = reportService.readExecution(1L);
- assertNotNull(reportExecTO);
- }
-
- @Test
- public void create() {
- ReportTO report = new ReportTO();
- report.setName("testReportForCreate" + getUUIDString());
- report.getReportletConfs().add(new UserReportletConf("first"));
- report.getReportletConfs().add(new UserReportletConf("second"));
-
- report = createReport(report);
- assertNotNull(report);
-
- ReportTO actual = reportService.read(report.getKey());
- assertNotNull(actual);
-
- assertEquals(actual, report);
- }
-
- @Test
- public void update() {
- ReportTO report = new ReportTO();
- report.setName("testReportForUpdate" + getUUIDString());
-
- report.getReportletConfs().add(new UserReportletConf("first"));
- report.getReportletConfs().add(new UserReportletConf("second"));
-
- report = createReport(report);
- assertNotNull(report);
- assertEquals(2, report.getReportletConfs().size());
-
- report.getReportletConfs().add(new UserReportletConf("last"));
-
- reportService.update(report.getKey(), report);
- ReportTO updated = reportService.read(report.getKey());
- assertNotNull(updated);
- assertEquals(3, updated.getReportletConfs().size());
- }
-
- @Test
- public void delete() {
- ReportTO report = new ReportTO();
- report.setName("testReportForDelete" + getUUIDString());
- report.getReportletConfs().add(new UserReportletConf("first"));
- report.getReportletConfs().add(new UserReportletConf("second"));
-
- report = createReport(report);
- assertNotNull(report);
-
- reportService.delete(report.getKey());
-
- try {
- reportService.read(report.getKey());
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- private void checkExport(final Long execId, final ReportExecExportFormat fmt) throws IOException {
- final Response response = reportService.exportExecutionResult(execId, fmt);
- assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
- assertNotNull(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION));
- assertTrue(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION).
- endsWith("." + fmt.name().toLowerCase()));
-
- Object entity = response.getEntity();
- assertTrue(entity instanceof InputStream);
- assertFalse(IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING).isEmpty());
- }
-
- @Test
- public void executeAndExport() throws IOException {
- ReportTO reportTO = reportService.read(1L);
- reportTO.setKey(0);
- reportTO.setName("executeAndExport" + getUUIDString());
- reportTO.getExecutions().clear();
- reportTO = createReport(reportTO);
- assertNotNull(reportTO);
-
- ReportExecTO execution = reportService.execute(reportTO.getKey());
- assertNotNull(execution);
-
- int i = 0;
- int maxit = 50;
-
- // wait for report execution completion (executions incremented)
- do {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
-
- reportTO = reportService.read(reportTO.getKey());
-
- assertNotNull(reportTO);
- assertNotNull(reportTO.getExecutions());
-
- i++;
- } while (reportTO.getExecutions().isEmpty()
- || (!ReportExecStatus.SUCCESS.name().equals(reportTO.getExecutions().get(0).getStatus()) && i < maxit));
- assertEquals(ReportExecStatus.SUCCESS.name(), reportTO.getExecutions().get(0).getStatus());
-
- long execId = reportTO.getExecutions().get(0).getKey();
-
- checkExport(execId, ReportExecExportFormat.XML);
- checkExport(execId, ReportExecExportFormat.HTML);
- checkExport(execId, ReportExecExportFormat.PDF);
- checkExport(execId, ReportExecExportFormat.RTF);
- checkExport(execId, ReportExecExportFormat.CSV);
- }
-
- @Test
- public void issueSYNCOPE43() {
- ReportTO reportTO = new ReportTO();
- reportTO.setName("issueSYNCOPE43" + getUUIDString());
- reportTO = createReport(reportTO);
- assertNotNull(reportTO);
-
- ReportExecTO execution = reportService.execute(reportTO.getKey());
- assertNotNull(execution);
-
- int maxit = 50;
- do {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
-
- reportTO = reportService.read(reportTO.getKey());
-
- maxit--;
- } while (reportTO.getExecutions().isEmpty() && maxit > 0);
-
- assertEquals(1, reportTO.getExecutions().size());
- }
-
- @Test
- public void issueSYNCOPE102() throws IOException {
- // Create
- ReportTO reportTO = reportService.read(1L);
- reportTO.setKey(0);
- reportTO.setName("issueSYNCOPE102" + getUUIDString());
- reportTO = createReport(reportTO);
- assertNotNull(reportTO);
-
- // Execute (multiple requests)
- for (int i = 0; i < 10; i++) {
- ReportExecTO execution = reportService.execute(reportTO.getKey());
- assertNotNull(execution);
- }
-
- // Wait for one execution
- int maxit = 50;
- do {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
-
- reportTO = reportService.read(reportTO.getKey());
-
- maxit--;
- } while (reportTO.getExecutions().isEmpty() && maxit > 0);
- assertFalse(reportTO.getExecutions().isEmpty());
- }
-}
[19/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.html
new file mode 100644
index 0000000..4e0e5a0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+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">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="Content-Style-Type" content="text/css"/>
+
+ <title>Apache Syncope - <wicket:message key="welcome"/></title>
+
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all"/>
+ <style type="text/css">
+ em {
+ font-size: 14px;
+ color: gray;
+ }
+ em img {
+ opacity:0.4;
+ filter:alpha(opacity=40);
+ }
+ </style>
+ </head>
+ <body style="text-align:center">
+ <div id="splash">
+ <img src="img/logo.png" alt="syncope" title="syncope" id="logo" />
+ <div style="display: table-row;height: 20px;">
+ <div id="username" style="display: table-cell; padding-left: 5px; cursor: pointer; width: 100%;vertical-align: bottom;">
+ <a href="#" wicket:id="editProfileLink" style="font-family: monospace;">
+ <span style="color: #B9CFB3;"><wicket:message key="welcome"/>,
+ <span wicket:id="username" style="color: #B9CFB3;text-decoration: underline;"/>
+ </span>
+ </a>
+ </div>
+ <div style="display: table-cell; padding-right: 5px;vertical-align: bottom;">
+ <div wicket:id="infoModal"/>
+ <a wicket:id="infoLink"><img src="img/info.png" alt="info"/></a>
+ </div>
+ </div>
+ <ul>
+ <li><a href="#" wicket:id="todo" class="todo"><img wicket:id="todoIcon" alt="TODO" width="80" height="80" /><br /><wicket:message key="todo"/></a></li>
+ <li><a href="#" wicket:id="schema" class="schema"><img wicket:id="schemaIcon" alt="Schema" width="80" height="80" /><br /><wicket:message key="schema"/></a></li>
+ <li><a href="#" wicket:id="users" class="users"><img wicket:id="usersIcon" alt="Users" width="80" height="80" /><br /><wicket:message key="users"/></a></li>
+ <li><a href="#" wicket:id="roles" class="roles"><img wicket:id="rolesIcon" alt="Roles" width="80" height="80" /><br /><wicket:message key="roles"/></a></li>
+ <li><a href="#" wicket:id="resources" class="resources"><img wicket:id="resourcesIcon" alt="Resources" width="80" height="80" /><br /><wicket:message key="resources"/></a></li>
+ <li><a href="#" wicket:id="tasks" class="tasks"><img wicket:id="tasksIcon" alt="Tasks" width="80" height="80" /><br /><wicket:message key="tasks"/></a></li>
+ <li><a href="#" wicket:id="reports" class="reports"><img wicket:id="reportsIcon" alt="Reports" width="80" height="80" /><br /><wicket:message key="reports"/></a></li>
+ <li><a href="#" wicket:id="configuration" class="configuration"><img wicket:id="configurationIcon" alt="Configuration" width="80" height="80" /><br /><wicket:message key="configuration"/></a></li>
+ <li><a href="#" wicket:id="logout" class="logout"><img src="img/menu/logout.png" alt="Logout" width="80" height="80" /><br /><wicket:message key="logout"/></a></li>
+ </ul>
+ </div>
+ <div wicket:id="editProfileModal"></div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.properties
new file mode 100644
index 0000000..f08be49
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage.properties
@@ -0,0 +1,18 @@
+# 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.
+welcome=Welcome
+version=VERSION
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_it.properties
new file mode 100644
index 0000000..2499ae4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_it.properties
@@ -0,0 +1,18 @@
+# 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.
+welcome=Benvenuto
+version=VERSIONE
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_pt_BR.properties
new file mode 100644
index 0000000..c22a518
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/WelcomePage_pt_BR.properties
@@ -0,0 +1,18 @@
+# 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.
+welcome=Bem Vindo
+version=VERS\u00C3O
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
new file mode 100644
index 0000000..07aba41
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
@@ -0,0 +1,82 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="webjars/codemirror/${codemirror.version}/lib/codemirror.css"/>
+
+ <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/lib/codemirror.js"></script>
+ <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/mode/xml/xml.js"></script>
+ <script type="text/javascript">
+ function updateTextArea(editor) {
+ document.getElementById("workflowDefArea").value = editor.getValue();
+ }
+ </script>
+ <script>
+ window.onunload = refreshParent;
+ function refreshParent() {
+ if (window.opener.location.toString().indexOf('#workflow') === -1) {
+ window.opener.location = window.opener.location + "#workflow";
+ }
+ window.opener.location.reload();
+ }
+ </script>
+ <style>
+ .w_content_3 {
+ padding: 0;
+ color: #333333;
+ font-family: Verdana,Tahoma,sans-serif;
+ font-size: 100%;
+ border: 1px solid #BBBBBB;
+ padding: 1%;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+ <div style="padding: 1%;">
+ <div class="w_content_3">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/>
+ </p>
+ <form wicket:id="workflowDefForm">
+ <div class="ui-tabs ui-widget ui-widget-content ui-corner-all">
+ <textarea wicket:id="workflowDefArea" id="workflowDefArea" style="width: 100%; height: 350px;">
+ </textarea>
+ </div>
+ <div style="padding-top: 1%;">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"
+ style="width: 50px"/>
+ <input type="submit"
+ wicket:id="closePage"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ onclick="window.close();"
+ style="width: 50px"/>
+ </div>
+ </form>
+ </div>
+ </div>
+ <script>
+ window.onload = function() {
+ var editor = CodeMirror.fromTextArea(document.getElementById("workflowDefArea"), {lineNumbers: true});
+ editor.on("change", updateTextArea);
+ };
+ </script>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
new file mode 100644
index 0000000..2276791
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+submit=Save
+cancel=Close
+title=Workflow XML Editor
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
new file mode 100644
index 0000000..818dfb4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+submit=Salva
+cancel=Chiudi
+title=Workflow XML Editor
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
new file mode 100644
index 0000000..4152188
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+submit=Salvar
+cancel=Fechar
+title=Workflow XML Editor
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png
new file mode 100644
index 0000000..79332c0
Binary files /dev/null and b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png
new file mode 100644
index 0000000..68975bd
Binary files /dev/null and b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png
new file mode 100644
index 0000000..a0a2933
Binary files /dev/null and b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png
new file mode 100644
index 0000000..97188ba
Binary files /dev/null and b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchPanel.html
new file mode 100644
index 0000000..a2af697
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchPanel.html
@@ -0,0 +1,50 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="searchBox">
+ <div wicket:id="searchFeedback"></div>
+ <table border="0">
+ <tbody wicket:id="searchFormContainer">
+ <tr wicket:id="searchView">
+ <td width="60">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="operator"/>
+ </td>
+ <td>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="type"/>
+ </td>
+ <td>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="property"/>
+ </td>
+ <td>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="comparator"/>
+ </td>
+ <td>
+ <input type="text" class="text ui-widget-content ui-corner-all" wicket:id="value"/>
+ </td>
+ <td>
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button"/></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
new file mode 100644
index 0000000..487165b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.html
@@ -0,0 +1,43 @@
+<!--
+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="container">
+ <span wicket:id="resultTable">[Table]</span>
+
+ <span style="float:right">
+ <form wicket:id="paginator" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="editModal">
+ </div>
+
+ <div wicket:id="displayModal">
+ </div>
+
+ <div wicket:id="statusModal">
+ </div>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
new file mode 100644
index 0000000..6f016a4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
@@ -0,0 +1,30 @@
+# 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.
+displayRows=Display rows
+
+firstname=Firstname
+surname=Surname
+userId=User Id
+edit=Edit
+delete=Delete
+id=Id
+status=Status
+token=Token
+username=Username
+creationDate=Creation Date
+tokenValued=Valued
+tokenNotValued=Not valued
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties
new file mode 100644
index 0000000..02b3b57
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties
@@ -0,0 +1,30 @@
+# 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.
+displayRows=display rows
+
+firstname=Nome
+surname=Cognome
+userId=User Id
+edit=Edit
+delete=Rimuovi
+id=Id
+status=Stato
+token=Token
+username=Username
+creationDate=Data Creazione
+tokenValued=Valued
+tokenNotValued=Not valued
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties
new file mode 100644
index 0000000..1591edc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties
@@ -0,0 +1,30 @@
+# 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.
+displayRows=Mostrar linhas
+
+firstname=Nome
+surname=Sobrenome
+userId=Identificador do Usu\u00E1rio
+edit=Alterar
+delete=Excluir
+id=Identificador
+status=Estatus
+token=Token
+username=Nome de Usu\u00E1rio
+creationDate=Data de Cria\u00E7\u00E3o
+tokenValued=Atribu\u00EDdo
+tokenNotValued=N\u00E3o Atribu\u00EDdo
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html
new file mode 100644
index 0000000..cbe6296
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html
@@ -0,0 +1,41 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="container">
+ <span wicket:id="datatable">[datatable]</span>
+ <span style="float:right">
+ <form wicket:id="PaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </span>
+ </div>
+ <div wicket:id="taskWin">
+ [Show modal window for viewing task]
+ </div>
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createLink">
+ <wicket:message key="create"/>
+ </a>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.html
new file mode 100644
index 0000000..5e0fe54
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.html
@@ -0,0 +1,67 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+
+ <div class="infoleft">
+ <div class="infolabel">
+ <wicket:message key="lastLoginDate"/>:
+ </div>
+ <div>
+ <span wicket:id="lastLoginDate"/>
+ </div>
+ </div>
+
+ <div class="inforight">
+ <div class="infolabel">
+ <wicket:message key="failedLogins"/>:
+ </div>
+ <div>
+ <span wicket:id="failedLogins"/>
+ </div>
+ </div>
+
+ <div class="infoleft">
+ <div class="infolabel">
+ <wicket:message key="changePwdDate"/>:
+ </div>
+ <div>
+ <span wicket:id="changePwdDate"/>
+ </div>
+ </div>
+
+ <div class="inforight">
+ <div class="infolabel">
+ <wicket:message key="tokenExpireTime"/>
+ </div>
+ <div>
+ <span wicket:id="tokenExpireTime"/>
+ </div>
+ </div>
+
+ <div class="inforow">
+ <div class="infolabel">
+ <wicket:message key="token"/>:
+ </div>
+ <div style="word-wrap: break-word; width: 550px; margin-left: 155px;">
+ <span wicket:id="token"/>
+ </div>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.properties
new file mode 100644
index 0000000..799c968
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel.properties
@@ -0,0 +1,22 @@
+# 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.
+changePwdDate=Last Change Password Date
+lastLoginDate=Last Login Data
+failedLogins=Subsequent Failed Logins
+token=Token
+tokenExpireTime=Token Expire Time
+confirmPassword=Password (confirm)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_it.properties
new file mode 100644
index 0000000..844a0c3
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_it.properties
@@ -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.
+creationDate=Data Di Creazione
+changePwdDate=Data Ultimo Cambio Password
+lastLoginDate=Data Di Ultimo Login
+failedLogins=Login Consecutivi Falliti
+token=Token
+tokenExpireTime=Scadenza Token
+confirmPassword=Password (conferma)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_pt_BR.properties
new file mode 100644
index 0000000..27e99f5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AccountInformationPanel_pt_BR.properties
@@ -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.
+creationDate=Data de Cria\u00E7\u00E3o
+changePwdDate=Data da \u00DAltima Troca de Senha
+lastLoginDate=Data do \u00DAltimo Login
+failedLogins=Falhas Subsequentes de Logins
+token=Token
+tokenExpireTime=Tempo de Expira\u00E7\u00E3o do Token
+confirmPassword=Senha (confirmar)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ActionDataTablePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ActionDataTablePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ActionDataTablePanel.html
new file mode 100644
index 0000000..5ad205f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ActionDataTablePanel.html
@@ -0,0 +1,45 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
+ </wicket:head>
+ <wicket:panel>
+
+ <form wicket:id="groupForm">
+ <span wicket:id="checkgroup">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="dataTable">[Data Table]</table>
+ </span>
+
+ <div id="actionRow" class="pageRowElement">
+ <div id="actions">
+ <div id="actionPanel" wicket:id="actionPanelContainer" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <span wicket:id="actions">[Actions]</span>
+ </div>
+
+ <div id="cancelBtmForm">
+ <input type="button" wicket:id="cancel" id="cancel"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"/>
+ </div>
+ </div>
+ </div>
+ </form>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AjaxDataTablePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AjaxDataTablePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AjaxDataTablePanel.html
new file mode 100644
index 0000000..f67ba10
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AjaxDataTablePanel.html
@@ -0,0 +1,47 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
+ </wicket:head>
+ <wicket:panel>
+ <span wicket:id="tablePanel">[Table panel]</span>
+ <div wicket:id="bulkModal" />
+
+ <wicket:fragment wicket:id="bulkAvailable">
+ <form wicket:id="groupForm">
+ <span wicket:id="checkgroup">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="dataTable">[DataTable]</table>
+ </span>
+ </form>
+ <div class="bulkAction">
+ <div class="bulkActionCell" style="width: 40px">
+ <a href="#" wicket:id="bulkActionLink">
+ <img src="img/actions/bulk.png" alt="bulk action icon" title="Bulk action"/>
+ </a>
+ </div>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="bulkNotAvailable">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="dataTable">[DataTable]</table>
+ </wicket:fragment>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.html
new file mode 100644
index 0000000..4d459ce
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.html
@@ -0,0 +1,98 @@
+<!--
+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>
+ <wicket:head>
+ <style>
+ div.information{
+ margin-top: 30px;
+ border: 1px solid #DDDDDD;
+ font-size: 8px;
+ color: #555555;
+ display: inline-table;
+ width: 100%;
+ clear: both;
+ float:none;
+ }
+
+ div.infolabel{
+ margin-left: 5px;
+ float:left;
+ width: 150px;
+ font-weight: bold
+ }
+
+ div.infoleft{
+ float:left;
+ display: inline-table;
+ width: 50%
+ }
+
+ div.inforight{
+ display: inline-table;
+ width: 50%
+ }
+
+ div.inforow{
+ display: inline-table;
+ width: 100%
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <div class="information">
+ <div class="infoleft">
+ <div class="infolabel">
+ <wicket:message key="creationDate"/>:
+ </div>
+ <div>
+ <span wicket:id="creationDate" />
+ </div>
+ </div>
+
+ <div class="inforight">
+ <div class="infolabel">
+ <wicket:message key="lastChangeDate"/>:
+ </div>
+ <div>
+ <span wicket:id="lastChangeDate" />
+ </div>
+ </div>
+
+ <div class="infoleft">
+ <div class="infolabel">
+ <wicket:message key="creator"/>:
+ </div>
+ <div>
+ <span wicket:id="creator" />
+ </div>
+ </div>
+
+ <div class="inforight">
+ <div class="infolabel">
+ <wicket:message key="lastModifier"/>:
+ </div>
+ <div>
+ <span wicket:id="lastModifier" />
+ </div>
+ </div>
+
+ <wicket:child />
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.properties
new file mode 100644
index 0000000..54a0fcf
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.properties
@@ -0,0 +1,20 @@
+# 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.
+creationDate=Creation Date
+creator=Creator
+lastChangeDate=Last change date
+lastModifier=Last modifier
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_it.properties
new file mode 100644
index 0000000..7fae3ab
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_it.properties
@@ -0,0 +1,20 @@
+# 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.
+creationDate=Data Di Creazione
+creator=Creatore
+lastChangeDate=Data Di Ultima Modifica
+lastModifier=Ultimo Modificatore
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_pt_BR.properties
new file mode 100644
index 0000000..689436f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AnnotatedBeanPanel_pt_BR.properties
@@ -0,0 +1,20 @@
+# 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.
+creationDate=Data de Cria\u00e7\u00e3o
+creator=Criador
+lastChangeDate=Data De \u00daltima Altera\u00e7\u00e3o
+lastModifier=\u00daltima Modificador
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
new file mode 100644
index 0000000..000b8f5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
@@ -0,0 +1,58 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#attrTemplateTabs").tabs();
+ });
+ </script>
+ </wicket:head>
+ <wicket:panel>
+ <div id="attrTemplateTabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
+ <ul>
+ <li class="tabs-selected"><a href="#rattr"><wicket:message key="rattr"/></a></li>
+ <li><a href="#rderattr"><wicket:message key="rderattr"/></a></li>
+ <li><a href="#rvirattr"><wicket:message key="rvirattr"/></a></li>
+ <li><a href="#mattr"><wicket:message key="mattr"/></a></li>
+ <li><a href="#mderattr"><wicket:message key="mderattr"/></a></li>
+ <li><a href="#mvirattr"><wicket:message key="mvirattr"/></a></li>
+ </ul>
+
+ <div id="rattr">
+ <div wicket:id="rAttrTemplates"/>
+ </div>
+ <div id="rderattr">
+ <div wicket:id="rDerAttrTemplates"/>
+ </div>
+ <div id="rvirattr">
+ <div wicket:id="rVirAttrTemplates"/>
+ </div>
+ <div id="mattr">
+ <div wicket:id="mAttrTemplates"/>
+ </div>
+ <div id="mderattr">
+ <div wicket:id="mDerAttrTemplates"/>
+ </div>
+ <div id="mvirattr">
+ <div wicket:id="mVirAttrTemplates"/>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
new file mode 100644
index 0000000..4d8133c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
@@ -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.
+
+rattr=Normal
+rderattr=Derived
+rvirattr=Virtual
+mattr=Normal (Membership)
+mderattr=Derived (Membership)
+mvirattr=Virtual (Membership)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
new file mode 100644
index 0000000..69e4ee0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
@@ -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.
+
+rattr=Normali
+rderattr=Derivati
+rvirattr=Virtuali
+mattr=Normali (Membership)
+mderattr=Derivati (Membership)
+mvirattr=Virtuali (Membership)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
new file mode 100644
index 0000000..838a459
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
@@ -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.
+
+rattr=Normal
+rderattr=Derivado
+rvirattr=Virtual
+mattr=Normal (Membro)
+mderattr=Derivado (Membro)
+mvirattr=Virtual (Membro)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AuditEventsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AuditEventsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AuditEventsPanel.html
new file mode 100644
index 0000000..c86473a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AuditEventsPanel.html
@@ -0,0 +1,122 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ .container {
+ display: block;
+ width: 100%;
+ }
+
+ .label {
+ font-size: 12px;
+ vertical-align: middle;
+ font-family: Verdana,Tahoma,sans-serif;
+ display: table-cell;
+ width: 300px;
+ height: 20px;
+ }
+
+ .divtableheaderlabel {
+ font-weight: bold;
+ float: left;
+ margin-left: 5px;
+ display: table-cell;
+ width: 70px;
+ }
+
+ .divtableheadercell {
+ display: inline-table;
+ vertical-align: top;
+ text-align: right;
+ width: 105px;
+ height: 20px;
+ }
+
+ .divtablecheckcolumn {
+ display: table-cell;
+ vertical-align: top;
+ text-align: right;
+ width: 105px;
+ }
+
+ .divtablecheck {
+ width: 105px;
+ height: 20px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <div class="container">
+ <div style="display:inline-table;">
+ <div class="label">
+
+ </div>
+ <div style="display: table-cell">
+ <div class="divtableheadercell">
+ <div class="divtableheaderlabel">
+ <label wicket:id="successLabel"/>
+ </div>
+ <div style="display: table-cell">
+ <input type="checkbox" wicket:id="successSelector" style="margin-top: 0px;margin-bottom: 0px;"/>
+ </div>
+ </div>
+ </div>
+ <div style="display: table-cell">
+ <div class="divtableheadercell">
+ <div class="divtableheaderlabel">
+ <label wicket:id="failureLabel"/>
+ </div>
+ <div style="display: table-cell">
+ <input type="checkbox" wicket:id="failureSelector" style="margin-top: 0px;margin-bottom: 0px;"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="label">
+ <div id="divtablerow-label" wicket:id="categoryView">
+ <div class="label">
+ <span wicket:id="subcategory">[subcategory]</span>
+ </div>
+ </div>
+ </div>
+
+ <div id="divtablerow-success" class="divtablecheckcolumn">
+ <span wicket:id="successGroup">
+ <div wicket:id="successView" class="divtablecheck">
+ <div class="divtableheaderlabel"> </div>
+ <input type="checkbox" wicket:id="successCheck"/>
+ </div>
+ </span>
+ </div>
+
+ <div id="divtablerow-failure" class="divtablecheckcolumn">
+ <span wicket:id="failureGroup">
+ <div wicket:id="failureView" class="divtablecheck">
+ <div class="divtableheaderlabel"> </div>
+ <input type="checkbox" wicket:id="failureCheck"/>
+ </div>
+ </span>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.html
new file mode 100644
index 0000000..40d55ee
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.html
@@ -0,0 +1,60 @@
+<!--
+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>
+ <table class="ui-widget ui-widget-content ui-corner-all"
+ style="font-size: 1em;margin-top:2px;"
+ width="100%" cellpadding="2px" cellspacing="1px">
+ <thead>
+ <tr class="ui-widget-header">
+ <th><wicket:message key="derAttrToRemove"/></th>
+ <th><wicket:message key="derAttrName"/></th>
+ <th><wicket:message key="derAttrValue"/></th>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <td>
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="addAttributeBtn"/>
+ </td>
+ </tr>
+ </tfoot>
+
+ <tbody wicket:id="derAttrContainer">
+ <tr wicket:id="attrs">
+ <td align="center" valign="middle">
+ <input type="checkbox" class="text ui-widget-content ui-corner-all" wicket:id="toRemove"/>
+ </td>
+
+ <td>
+ <select class="text ui-widget-content ui-corner-all"
+ style="width:100%" wicket:id="schema"/>
+ </td>
+
+ <td align="center" valign="middle">
+ <input type="text"
+ style="width:98%; padding-left: 0px; padding-right: 0px" wicket:id="value"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.properties
new file mode 100644
index 0000000..a09c0b0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+addAttributeBtn=Add
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_it.properties
new file mode 100644
index 0000000..9a4df9c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_it.properties
@@ -0,0 +1,18 @@
+# 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.
+addAttributeBtn=Aggiungi
+
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_pt_BR.properties
new file mode 100644
index 0000000..a7ac4dc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/DerAttrsPanel_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+addAttributeBtn=Adicionar
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/EventSelectionPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/EventSelectionPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/EventSelectionPanel.html
new file mode 100644
index 0000000..ac7c9fc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/EventSelectionPanel.html
@@ -0,0 +1,125 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ .container {
+ display: block;
+ width: 100%;
+ }
+
+ .label {
+ font-size: 12px;
+ vertical-align: middle;
+ font-family: Verdana,Tahoma,sans-serif;
+ display: table-cell;
+ width: 300px;
+ height: 20px;
+ }
+
+ .divtableheaderlabel {
+ font-weight: bold;
+ float: left;
+ margin-left: 5px;
+ display: table-cell;
+ width: 70px;
+ }
+
+ .divtableheadercell {
+ display: inline-table;
+ vertical-align: top;
+ text-align: right;
+ width: 105px;
+ height: 20px;
+ }
+
+ .divtablecheckcolumn {
+ display: table-cell;
+ vertical-align: top;
+ text-align: right;
+ width: 105px;
+ }
+
+ .divtablecheck {
+ width: 105px;
+ height: 20px;
+ }
+
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <div class="eventSelectionWidzard">
+ <div class="container">
+ <div style="display:inline-table;">
+ <div class="label">
+
+ </div>
+ <div style="display: table-cell">
+ <div class="divtableheadercell">
+ <div class="divtableheaderlabel">
+ <label wicket:id="successLabel"/>
+ </div>
+ <div style="display: table-cell">
+ <input type="checkbox" wicket:id="successSelector" style="margin-top: 0px;margin-bottom: 0px;"/>
+ </div>
+ </div>
+ </div>
+ <div style="display: table-cell">
+ <div class="divtableheadercell">
+ <div class="divtableheaderlabel">
+ <label wicket:id="failureLabel"/>
+ </div>
+ <div style="display: table-cell">
+ <input type="checkbox" wicket:id="failureSelector" style="margin-top: 0px;margin-bottom: 0px;"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="container">
+ <div class="label">
+ <div id="divtablerow-label" wicket:id="categoryView">
+ <div class="label">
+ <span wicket:id="subcategory">[subcategory]</span>
+ </div>
+ </div>
+ </div>
+
+ <div id="divtablerow-success" class="divtablecheckcolumn">
+ <span wicket:id="successGroup">
+ <div wicket:id="successView" class="divtablecheck">
+ <div class="divtableheaderlabel"> </div>
+ <input type="checkbox" wicket:id="successCheck"/>
+ </div>
+ </span>
+ </div>
+
+ <div id="divtablerow-failure" class="divtablecheckcolumn">
+ <span wicket:id="failureGroup">
+ <div wicket:id="failureView" class="divtablecheck">
+ <div class="divtableheaderlabel"> </div>
+ <input type="checkbox" wicket:id="failureCheck"/>
+ </div>
+ </span>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ImagePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ImagePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ImagePanel.html
new file mode 100644
index 0000000..63a568e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ImagePanel.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>
+ <img wicket:id="img" />
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.html
new file mode 100644
index 0000000..9f66972
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.html
@@ -0,0 +1,41 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ li.selected {
+ margin-bottom: -1px !important;
+ padding-bottom: 1px !important;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel xmlns:wicket="http://wicket.apache.org">
+ <div>
+ <span wicket:id="tabs-container">
+ <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
+ <li wicket:id="tabs" class="ui-state-default ui-corner-top">
+ <a class="ui-tabs-anchor" href="#" wicket:id="link"><span wicket:id="title">[[tab title]]</span></a>
+ </li>
+ </ul>
+ </span>
+ <div wicket:id="panel" class="ui-tabs-panel ui-widget-content ui-corner-bottom"
+ style="border-width: 1px;border-top-width: 0px;">[panel]</div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.html
new file mode 100644
index 0000000..51840f4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.html
@@ -0,0 +1,41 @@
+<!--
+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>
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="container">
+ <form wicket:id="form">
+ <div id="fields">
+ <span wicket:id="fields">[fields]</span>
+ </div>
+ <div style="margin: 20px 0px 0">
+ <input type="submit" style="padding: 7px 15px;"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button" style="padding: 7px 15px;"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </span>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.properties
new file mode 100644
index 0000000..a7a1683
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel.properties
@@ -0,0 +1,18 @@
+# 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.
+apply=Save
+cancel=Cancel
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_it.properties
new file mode 100644
index 0000000..a7a1683
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_it.properties
@@ -0,0 +1,18 @@
+# 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.
+apply=Save
+cancel=Cancel
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_pt_BR.properties
new file mode 100644
index 0000000..a7a1683
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LayoutsPanel_pt_BR.properties
@@ -0,0 +1,18 @@
+# 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.
+apply=Save
+cancel=Cancel
[14/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java
deleted file mode 100644
index 5b3b4b0..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AuthenticationITCase.java
+++ /dev/null
@@ -1,440 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.security.AccessControlException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ws.rs.core.Response;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.mod.StatusMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.BulkActionResult;
-import org.apache.syncope.common.lib.to.MembershipTO;
-import org.apache.syncope.common.lib.to.PagedResult;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.CipherAlgorithm;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.lib.wrap.EntitlementTO;
-import org.apache.syncope.common.lib.wrap.ResourceName;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
-import org.apache.syncope.common.rest.api.service.EntitlementService;
-import org.apache.syncope.common.rest.api.service.SchemaService;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.common.rest.api.service.UserService;
-import org.apache.syncope.server.misc.security.Encryptor;
-import org.junit.Assume;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class AuthenticationITCase extends AbstractITCase {
-
- private int getFailedLogins(UserService testUserService, long userId) {
- UserTO readUserTO = testUserService.read(userId);
- assertNotNull(readUserTO);
- assertNotNull(readUserTO.getFailedLogins());
- return readUserTO.getFailedLogins();
- }
-
- private void assertReadFails(UserService userService, long id) {
- try {
- userService.read(id);
- fail("access should not work");
- } catch (Exception e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void testAdminEntitlements() {
- // 1. as anonymous, read all available entitlements
- List<EntitlementTO> allEntitlements = entitlementService.getAllEntitlements();
- assertNotNull(allEntitlements);
- assertFalse(allEntitlements.isEmpty());
-
- // 2. as admin, read own entitlements
- List<EntitlementTO> adminEntitlements = entitlementService.getOwnEntitlements();
-
- assertEquals(new HashSet<String>(CollectionWrapper.unwrap(allEntitlements)),
- new HashSet<String>(CollectionWrapper.unwrap(adminEntitlements)));
- }
-
- @Test
- public void testUserSchemaAuthorization() {
- // 0. create a role that can only read schemas
- RoleTO authRoleTO = new RoleTO();
- authRoleTO.setName("authRole" + getUUIDString());
- authRoleTO.setParent(8L);
- authRoleTO.getEntitlements().add("SCHEMA_READ");
-
- authRoleTO = createRole(authRoleTO);
- assertNotNull(authRoleTO);
-
- String schemaName = "authTestSchema" + getUUIDString();
-
- // 1. create a schema (as admin)
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey(schemaName);
- schemaTO.setMandatoryCondition("false");
- schemaTO.setType(AttrSchemaType.String);
-
- PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
- assertEquals(schemaTO, newPlainSchemaTO);
-
- // 2. create an user with the role created above (as admin)
- UserTO userTO = UserITCase.getUniqueSampleTO("auth@test.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(authRoleTO.getKey());
- AttrTO testAttrTO = new AttrTO();
- testAttrTO.setSchema("testAttribute");
- testAttrTO.getValues().add("a value");
- membershipTO.getPlainAttrs().add(testAttrTO);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- // 3. read the schema created above (as admin) - success
- schemaTO = schemaService.read(AttributableType.USER, SchemaType.PLAIN, schemaName);
- assertNotNull(schemaTO);
-
- // 4. read the schema created above (as user) - success
- SchemaService schemaService2 = clientFactory.create(userTO.getUsername(), "password123").getService(
- SchemaService.class);
-
- schemaTO = schemaService2.read(AttributableType.USER, SchemaType.PLAIN, schemaName);
- assertNotNull(schemaTO);
-
- // 5. update the schema create above (as user) - failure
- try {
- schemaService2.update(AttributableType.ROLE, SchemaType.PLAIN, schemaName, schemaTO);
- fail("Schemaupdate as user schould not work");
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- assertEquals(Response.Status.UNAUTHORIZED, e.getType().getResponseStatus());
- } catch (AccessControlException e) {
- // CXF Service will throw this exception
- assertNotNull(e);
- }
-
- assertEquals(0, getFailedLogins(userService, userTO.getKey()));
- }
-
- @Test
- public void testUserRead() {
- UserTO userTO = UserITCase.getUniqueSampleTO("testuserread@test.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
- AttrTO testAttrTO = new AttrTO();
- testAttrTO.setSchema("testAttribute");
- testAttrTO.getValues().add("a value");
- membershipTO.getPlainAttrs().add(testAttrTO);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").
- getService(UserService.class);
-
- UserTO readUserTO = userService2.read(1L);
- assertNotNull(readUserTO);
-
- UserService userService3 = clientFactory.create("verdi", ADMIN_PWD).getService(UserService.class);
-
- SyncopeClientException exception = null;
- try {
- userService3.read(1L);
- fail();
- } catch (SyncopeClientException e) {
- exception = e;
- }
- assertNotNull(exception);
- assertEquals(ClientExceptionType.UnauthorizedRole, exception.getType());
- }
-
- @Test
- public void testUserSearch() {
- UserTO userTO = UserITCase.getUniqueSampleTO("testusersearch@test.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
- AttrTO testAttrTO = new AttrTO();
- testAttrTO.setSchema("testAttribute");
- testAttrTO.getValues().add("a value");
- membershipTO.getPlainAttrs().add(testAttrTO);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
-
- UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").
- getService(UserService.class);
-
- PagedResult<UserTO> matchedUsers = userService2.search(
- SyncopeClient.getUserSearchConditionBuilder().isNotNull("loginDate").query());
- assertNotNull(matchedUsers);
- assertFalse(matchedUsers.getResult().isEmpty());
- Set<Long> userIds = new HashSet<Long>(matchedUsers.getResult().size());
- for (UserTO user : matchedUsers.getResult()) {
- userIds.add(user.getKey());
- }
- assertTrue(userIds.contains(1L));
-
- UserService userService3 = clientFactory.create("verdi", "password").getService(UserService.class);
-
- matchedUsers = userService3.search(
- SyncopeClient.getUserSearchConditionBuilder().isNotNull("loginDate").query());
- assertNotNull(matchedUsers);
-
- userIds = new HashSet<>(matchedUsers.getResult().size());
-
- for (UserTO user : matchedUsers.getResult()) {
- userIds.add(user.getKey());
- }
- assertFalse(userIds.contains(1L));
- }
-
- @Test
- public void checkFailedLogins() {
- UserTO userTO = UserITCase.getUniqueSampleTO("checkFailedLogin@syncope.apache.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
- AttrTO testAttrTO = new AttrTO();
- testAttrTO.setSchema("testAttribute");
- testAttrTO.getValues().add("a value");
- membershipTO.getPlainAttrs().add(testAttrTO);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- long userId = userTO.getKey();
-
- UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").getService(
- UserService.class);
- assertEquals(0, getFailedLogins(userService2, userId));
-
- // authentications failed ...
- UserService userService3 = clientFactory.create(userTO.getUsername(), "wrongpwd1").getService(
- UserService.class);
- assertReadFails(userService3, userId);
- assertReadFails(userService3, userId);
-
- assertEquals(2, getFailedLogins(userService, userId));
-
- UserService userService4 = clientFactory.create(userTO.getUsername(), "password123").getService(
- UserService.class);
- assertEquals(0, getFailedLogins(userService4, userId));
- }
-
- @Test
- public void checkUserSuspension() {
- UserTO userTO = UserITCase.getUniqueSampleTO("checkSuspension@syncope.apache.org");
-
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(7L);
- AttrTO testAttrTO = new AttrTO();
- testAttrTO.setSchema("testAttribute");
- testAttrTO.getValues().add("a value");
- membershipTO.getPlainAttrs().add(testAttrTO);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- long userId = userTO.getKey();
- assertNotNull(userTO);
-
- UserService userService2 = clientFactory.create(userTO.getUsername(), "password123").
- getService(UserService.class);
- assertEquals(0, getFailedLogins(userService2, userId));
-
- // authentications failed ...
- UserService userService3 = clientFactory.create(userTO.getUsername(), "wrongpwd1").
- getService(UserService.class);
- assertReadFails(userService3, userId);
- assertReadFails(userService3, userId);
- assertReadFails(userService3, userId);
-
- assertEquals(3, getFailedLogins(userService, userId));
-
- // last authentication before suspension
- assertReadFails(userService3, userId);
-
- userTO = userService.read(userTO.getKey());
- assertNotNull(userTO);
- assertNotNull(userTO.getFailedLogins());
- assertEquals(3, userTO.getFailedLogins(), 0);
- assertEquals("suspended", userTO.getStatus());
-
- // Access with correct credentials should fail as user is suspended
- userService2 = clientFactory.create(userTO.getUsername(), "password123").getService(UserService.class);
- assertReadFails(userService2, userId);
-
- StatusMod reactivate = new StatusMod();
- reactivate.setType(StatusMod.ModType.REACTIVATE);
- userTO = userService.status(userTO.getKey(), reactivate).readEntity(UserTO.class);
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
-
- userService2 = clientFactory.create(userTO.getUsername(), "password123").getService(UserService.class);
- assertEquals(0, getFailedLogins(userService2, userId));
- }
-
- @Test
- public void issueSYNCOPE48() {
- // Parent role, able to create users with role 1
- RoleTO parentRole = new RoleTO();
- parentRole.setName("parentAdminRole" + getUUIDString());
- parentRole.getEntitlements().add("USER_CREATE");
- parentRole.getEntitlements().add("ROLE_1");
- parentRole.setParent(1L);
- parentRole = createRole(parentRole);
- assertNotNull(parentRole);
-
- // Child role, with no entitlements
- RoleTO childRole = new RoleTO();
- childRole.setName("childAdminRole");
- childRole.setParent(parentRole.getKey());
-
- childRole = createRole(childRole);
- assertNotNull(childRole);
-
- // User with child role, created by admin
- UserTO role1Admin = UserITCase.getUniqueSampleTO("syncope48admin@apache.org");
- role1Admin.setPassword("password");
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(childRole.getKey());
- role1Admin.getMemberships().add(membershipTO);
-
- role1Admin = createUser(role1Admin);
- assertNotNull(role1Admin);
-
- UserService userService2 = clientFactory.create(role1Admin.getUsername(), "password").getService(
- UserService.class);
-
- // User with role 1, created by user with child role created above
- UserTO role1User = UserITCase.getUniqueSampleTO("syncope48user@apache.org");
- membershipTO = new MembershipTO();
- membershipTO.setRoleId(1L);
- role1User.getMemberships().add(membershipTO);
-
- Response response = userService2.create(role1User, true);
- assertNotNull(response);
- role1User = response.readEntity(UserTO.class);
- assertNotNull(role1User);
- }
-
- @Test
- public void issueSYNCOPE434() {
- Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
-
- // 1. create user with role 9 (users with role 9 are defined in workflow as subject to approval)
- UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
- MembershipTO membershipTO = new MembershipTO();
- membershipTO.setRoleId(9L);
- userTO.getMemberships().add(membershipTO);
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals("createApproval", userTO.getStatus());
-
- // 2. try to authenticate: fail
- EntitlementService myEntitlementService = clientFactory.create(userTO.getUsername(), "password123").
- getService(EntitlementService.class);
- try {
- myEntitlementService.getOwnEntitlements();
- fail();
- } catch (AccessControlException e) {
- assertNotNull(e);
- }
-
- // 3. approve user
- WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
- form = userWorkflowService.claimForm(form.getTaskId());
- Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
- props.get("approve").setValue(Boolean.TRUE.toString());
- form.getProperties().clear();
- form.getProperties().addAll(props.values());
- userTO = userWorkflowService.submitForm(form);
- assertNotNull(userTO);
- assertEquals("active", userTO.getStatus());
-
- // 4. try to authenticate again: success
- assertNotNull(myEntitlementService.getOwnEntitlements());
- }
-
- @Test
- public void issueSYNCOPE164() throws Exception {
- // 1. create user with db resource
- UserTO user = UserITCase.getUniqueSampleTO("syncope164@syncope.apache.org");
- user.setPassword("password1");
- user.getResources().add(RESOURCE_NAME_TESTDB);
- user = createUser(user);
- assertNotNull(user);
-
- // 2. unlink the resource from the created user
- assertNotNull(userService.bulkDeassociation(user.getKey(),
- ResourceDeassociationActionType.UNLINK,
- CollectionWrapper.wrap(RESOURCE_NAME_TESTDB, ResourceName.class)).
- readEntity(BulkActionResult.class));
-
- // 3. change password on Syncope
- UserMod userMod = new UserMod();
- userMod.setKey(user.getKey());
- userMod.setPassword("password2");
- user = updateUser(userMod);
- assertNotNull(user);
-
- // 4. check that the db resource has still the initial password value
- final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
- String value = jdbcTemplate.queryForObject(
- "SELECT PASSWORD FROM test WHERE ID=?", String.class, user.getUsername());
- assertEquals(Encryptor.getInstance().encode("password1", CipherAlgorithm.SHA1), value.toUpperCase());
-
- // 5. successfully authenticate with old (on db resource) and new (on internal storage) password values
- user = clientFactory.create(user.getUsername(), "password1").getService(UserSelfService.class).read();
- assertNotNull(user);
- user = clientFactory.create(user.getUsername(), "password2").getService(UserSelfService.class).read();
- assertNotNull(user);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java
deleted file mode 100644
index 81eaa4e..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelDetector.java
+++ /dev/null
@@ -1,32 +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.fit.server.reference;
-
-import org.apache.syncope.common.rest.api.service.SyncopeService;
-
-public class CamelDetector {
-
- public static boolean isCamelEnabledForUsers(final SyncopeService syncopeService) {
- return syncopeService.info().getUserProvisioningManager().indexOf("Camel") != -1;
- }
-
- public static boolean isCamelEnabledForRoles(final SyncopeService syncopeService) {
- return syncopeService.info().getRoleProvisioningManager().indexOf("Camel") != -1;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java
deleted file mode 100644
index 46d813e..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/CamelRouteITCase.java
+++ /dev/null
@@ -1,164 +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.fit.server.reference;
-
-import static org.apache.syncope.fit.server.reference.AbstractITCase.syncopeService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.List;
-import org.apache.syncope.common.lib.to.CamelRouteTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.lib.types.SubjectType;
-import org.junit.Assume;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class CamelRouteITCase extends AbstractITCase {
-
- @Test
- public void userRoutes() {
- Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
-
- List<CamelRouteTO> userRoutes = camelRouteService.list(SubjectType.USER);
- assertNotNull(userRoutes);
- assertEquals(15, userRoutes.size());
- for (CamelRouteTO route : userRoutes) {
- assertNotNull(route.getContent());
- }
- }
-
- @Test
- public void roleRoutes() {
- Assume.assumeTrue(CamelDetector.isCamelEnabledForRoles(syncopeService));
-
- List<CamelRouteTO> roleRoutes = camelRouteService.list(SubjectType.ROLE);
- assertNotNull(roleRoutes);
- assertEquals(7, roleRoutes.size());
- for (CamelRouteTO route : roleRoutes) {
- assertNotNull(route.getContent());
- }
- }
-
- private CamelRouteTO doUpdate(final String key, String content) {
- CamelRouteTO route = camelRouteService.read(key);
- route.setContent(content);
- camelRouteService.update(route.getKey(), route);
- //getting new route definition
- return camelRouteService.read(key);
- }
-
- @Test
- public void update() {
- Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
-
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
- assertNotNull(oldRoute);
- String routeContent = "<route id=\"createUser\">\n"
- + " <from uri=\"direct:createUser\"/>\n"
- + " <setProperty propertyName=\"actual\">\n"
- + " <simple>${body}</simple>\n"
- + " </setProperty>\n"
- + " <doTry>\n"
- + " <bean ref=\"uwfAdapter\" method=\"create(${body},${property.disablePwdPolicyCheck},\n"
- + " ${property.enabled},${property.storePassword})\"/>\n"
- + " <process ref=\"userCreateProcessor\" />\n"
- + " <to uri=\"direct:createPort\"/>\n"
- + " <to uri=\"log:myLog\"/>\n"
- + " <doCatch> \n"
- + " <exception>java.lang.RuntimeException</exception>\n"
- + " <handled>\n"
- + " <constant>false</constant>\n"
- + " </handled>\n"
- + " <to uri=\"direct:createPort\"/>\n"
- + " </doCatch>\n"
- + " </doTry>\n"
- + "</route>";
- try {
- CamelRouteTO route = doUpdate("createUser", routeContent);
- assertEquals(routeContent, route.getContent());
- } finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
- }
- }
-
- @Test
- public void scriptingUpdate() {
- Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
-
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
- //updating route content including new attribute management
- String routeContent = "<route id=\"createUser\">\n"
- + " <from uri=\"direct:createUser\"/>\n"
- + " <setProperty propertyName=\"actual\">\n"
- + " <simple>${body}</simple>\n"
- + " </setProperty>\n"
- + " <setBody>\n"
- + " <groovy>\n"
- + " request.body.getPlainAttrs().get(3).getValues().set(0,\"true\")\n"
- + " return request.body\n"
- + " </groovy>\n"
- + " </setBody>\n"
- + " <doTry>\n"
- + " <bean ref=\"uwfAdapter\" method=\"create(${body},${property.disablePwdPolicyCheck},\n"
- + " ${property.enabled},${property.storePassword})\"/>\n"
- + " <process ref=\"userCreateProcessor\" />\n"
- + " <to uri=\"direct:createPort\"/>\n"
- + " <doCatch> \n"
- + " <exception>java.lang.RuntimeException</exception>\n"
- + " <handled>\n"
- + " <constant>false</constant>\n"
- + " </handled>\n"
- + " <to uri=\"direct:createPort\"/>\n"
- + " </doCatch>\n"
- + " </doTry>\n"
- + "</route>";
- try {
- doUpdate("createUser", routeContent);
-
- //creating new schema attribute for user
- PlainSchemaTO schemaTO = new PlainSchemaTO();
- schemaTO.setKey("camelAttribute");
- schemaTO.setType(AttrSchemaType.String);
- createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
-
- UserTO userTO = new UserTO();
- String userId = getUUIDString() + "camelUser@syncope.apache.org";
- userTO.setUsername(userId);
- userTO.setPassword("password");
- userTO.getPlainAttrs().add(attrTO("userId", userId));
- userTO.getPlainAttrs().add(attrTO("fullname", userId));
- userTO.getPlainAttrs().add(attrTO("surname", userId));
- userTO.getPlainAttrs().add(attrTO("camelAttribute", "false"));
-
- userTO = createUser(userTO);
- assertNotNull(userTO);
- assertEquals("true", userTO.getPlainAttrs().get(3).getValues().get(0));
- } finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
deleted file mode 100644
index bf35a9c..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConfigurationITCase.java
+++ /dev/null
@@ -1,210 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.ConfTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.types.AttrSchemaType;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class ConfigurationITCase extends AbstractITCase {
-
- @Test
- public void create() {
- PlainSchemaTO testKey = new PlainSchemaTO();
- testKey.setKey("testKey");
- testKey.setType(AttrSchemaType.String);
- createSchema(AttributableType.CONFIGURATION, SchemaType.PLAIN, testKey);
-
- AttrTO conf = new AttrTO();
- conf.setSchema("testKey");
- conf.getValues().add("testValue");
-
- configurationService.set(conf.getSchema(), conf);
-
- AttrTO actual = configurationService.read(conf.getSchema());
- assertEquals(actual, conf);
- }
-
- @Test
- public void delete() throws UnsupportedEncodingException {
- try {
- configurationService.delete("nonExistent");
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
-
- AttrTO tokenLength = configurationService.read("token.length");
-
- configurationService.delete("token.length");
- try {
- configurationService.read("token.length");
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
-
- configurationService.set(tokenLength.getSchema(), tokenLength);
-
- AttrTO actual = configurationService.read(tokenLength.getSchema());
- assertEquals(actual, tokenLength);
- }
-
- @Test
- public void list() {
- ConfTO wholeConf = configurationService.list();
- assertNotNull(wholeConf);
- for (AttrTO conf : wholeConf.getPlainAttrs()) {
- assertNotNull(conf);
- }
- }
-
- @Test
- public void read() {
- AttrTO conf = configurationService.read("token.expireTime");
- assertNotNull(conf);
- }
-
- @Test
- public void update() {
- AttrTO expireTime = configurationService.read("token.expireTime");
- int value = Integer.parseInt(expireTime.getValues().get(0));
- value++;
- expireTime.getValues().set(0, value + "");
-
- configurationService.set(expireTime.getSchema(), expireTime);
-
- AttrTO newConfigurationTO = configurationService.read(expireTime.getSchema());
- assertEquals(expireTime, newConfigurationTO);
- }
-
- @Test
- public void dbExport() throws IOException {
- Response response = configurationService.export();
- assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
- assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
- String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
- assertNotNull(contentDisposition);
-
- Object entity = response.getEntity();
- assertTrue(entity instanceof InputStream);
- String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
- assertFalse(configExport.isEmpty());
- assertTrue(configExport.length() > 1000);
- }
-
- @Test
- public void issueSYNCOPE418() {
- PlainSchemaTO failing = new PlainSchemaTO();
- failing.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
- failing.setType(AttrSchemaType.String);
-
- try {
- createSchema(AttributableType.CONFIGURATION, SchemaType.PLAIN, failing);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
-
- assertNotNull(e.getElements());
- assertEquals(1, e.getElements().size());
- assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
- }
- }
-
- @Test
- public void issueSYNCOPE629() throws IOException {
- PlainSchemaTO membershipKey = new PlainSchemaTO();
- membershipKey.setKey("membershipKey" + getUUIDString());
- membershipKey.setType(AttrSchemaType.String);
- createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, membershipKey);
-
- PlainSchemaTO roleKey = new PlainSchemaTO();
- roleKey.setKey("roleKey" + getUUIDString());
- roleKey.setType(AttrSchemaType.String);
- createSchema(AttributableType.ROLE, SchemaType.PLAIN, roleKey);
-
- RoleTO roleTO = new RoleTO();
- roleTO.setName("aRole" + getUUIDString());
- roleTO.getMAttrTemplates().add(membershipKey.getKey());
- roleTO.getRAttrTemplates().add(roleKey.getKey());
- roleTO = createRole(roleTO);
-
- try {
- Response response = configurationService.export();
- assertNotNull(response);
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
- assertTrue(response.getMediaType().toString().startsWith(MediaType.TEXT_XML));
- String contentDisposition = response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION);
- assertNotNull(contentDisposition);
-
- Object entity = response.getEntity();
- assertTrue(entity instanceof InputStream);
- String configExport = IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING);
- assertFalse(configExport.isEmpty());
- assertTrue(configExport.length() > 1000);
-
- String[] result = StringUtils.substringsBetween(configExport, "<RPLAINATTRTEMPLATE", "/>");
- assertNotNull(result);
- boolean rattrExists = false;
- for (String entry : result) {
- if (entry.contains(roleKey.getKey())) {
- rattrExists = true;
- }
- }
- assertTrue(rattrExists);
-
- result = StringUtils.substringsBetween(configExport, "<MPLAINATTRTEMPLATE", "/>");
- assertNotNull(result);
- boolean mattrExists = false;
- for (String entry : result) {
- if (entry.contains(membershipKey.getKey())) {
- mattrExists = true;
- }
- }
- assertTrue(mattrExists);
- } finally {
- deleteRole(roleTO.getKey());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java
deleted file mode 100644
index 83e0832..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java
+++ /dev/null
@@ -1,730 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.BulkAction;
-import org.apache.syncope.common.lib.to.ConnBundleTO;
-import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
-import org.apache.syncope.common.lib.to.ConnInstanceTO;
-import org.apache.syncope.common.lib.to.ConnPoolConfTO;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.syncope.common.lib.to.MappingTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.types.ConnConfPropSchema;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.common.lib.types.ConnectorCapability;
-import org.apache.syncope.common.lib.types.IntMappingType;
-import org.apache.syncope.common.rest.api.service.ConnectorService;
-import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.identityconnectors.common.security.GuardedString;
-import org.junit.BeforeClass;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class ConnectorITCase extends AbstractITCase {
-
- private static String connectorServerLocation;
-
- private static String connidSoapVersion;
-
- private static String connidDbTableVersion;
-
- private static String testJDBCURL;
-
- @BeforeClass
- public static void setUpConnIdBundles() throws IOException {
- InputStream propStream = null;
- try {
- Properties props = new Properties();
- propStream = ConnectorITCase.class.getResourceAsStream("/connid.properties");
- props.load(propStream);
-
- for (String location : props.getProperty("connid.locations").split(",")) {
- if (!location.startsWith("file")) {
- connectorServerLocation = location;
- }
- }
-
- connidSoapVersion = props.getProperty("connid.soap.version");
- connidDbTableVersion = props.getProperty("connid.db.table.version");
-
- testJDBCURL = props.getProperty("testdb.url");
- } catch (Exception e) {
- LOG.error("Could not load /connid.properties", e);
- } finally {
- IOUtils.closeQuietly(propStream);
- }
- assertNotNull(connectorServerLocation);
- assertNotNull(connidSoapVersion);
- assertNotNull(connidDbTableVersion);
- assertNotNull(testJDBCURL);
- }
-
- @Test(expected = SyncopeClientException.class)
- public void createWithException() {
- ConnInstanceTO connectorTO = new ConnInstanceTO();
-
- Response response = connectorService.create(connectorTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
- }
- }
-
- @Test
- public void create() {
- ConnInstanceTO connectorTO = new ConnInstanceTO();
- connectorTO.setLocation(connectorService.read(100L).getLocation());
- connectorTO.setVersion(connidSoapVersion);
- connectorTO.setConnectorName("net.tirasa.connid.bundles.soap.WebServiceConnector");
- connectorTO.setBundleName("net.tirasa.connid.bundles.soap");
- connectorTO.setDisplayName("Display name");
- connectorTO.setConnRequestTimeout(15);
-
- // set the connector configuration using PropertyTO
- Set<ConnConfProperty> conf = new HashSet<>();
-
- ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
- endpointSchema.setName("endpoint");
- endpointSchema.setType(String.class.getName());
- endpointSchema.setRequired(true);
- ConnConfProperty endpoint = new ConnConfProperty();
- endpoint.setSchema(endpointSchema);
- endpoint.getValues().add("http://localhost:8888/wssample/services");
- endpoint.getValues().add("Provisioning");
- conf.add(endpoint);
-
- ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
- servicenameSchema.setName("servicename");
- servicenameSchema.setType(String.class.getName());
- servicenameSchema.setRequired(true);
- ConnConfProperty servicename = new ConnConfProperty();
- servicename.setSchema(servicenameSchema);
- conf.add(servicename);
-
- // set connector configuration
- connectorTO.getConfiguration().addAll(conf);
-
- // set connector capabilities
- connectorTO.getCapabilities().add(ConnectorCapability.TWO_PHASES_CREATE);
- connectorTO.getCapabilities().add(ConnectorCapability.ONE_PHASE_CREATE);
- connectorTO.getCapabilities().add(ConnectorCapability.TWO_PHASES_UPDATE);
-
- // set connector pool conf
- ConnPoolConfTO cpc = new ConnPoolConfTO();
- cpc.setMaxObjects(1534);
- connectorTO.setPoolConf(cpc);
-
- Response response = connectorService.create(connectorTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
- }
-
- ConnInstanceTO actual = getObject(
- response.getLocation(), ConnectorService.class, ConnInstanceTO.class);
- assertNotNull(actual);
-
- assertEquals(actual.getBundleName(), connectorTO.getBundleName());
- assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
- assertEquals(actual.getVersion(), connectorTO.getVersion());
- assertEquals("Display name", actual.getDisplayName());
- assertEquals(Integer.valueOf(15), actual.getConnRequestTimeout());
- assertEquals(connectorTO.getCapabilities(), actual.getCapabilities());
- assertNotNull(actual.getPoolConf());
- assertEquals(1534, actual.getPoolConf().getMaxObjects().intValue());
- assertEquals(10, actual.getPoolConf().getMaxIdle().intValue());
-
- Throwable t = null;
-
- // check update
- actual.getCapabilities().remove(ConnectorCapability.TWO_PHASES_UPDATE);
- actual.getPoolConf().setMaxObjects(null);
-
- try {
- connectorService.update(actual.getKey(), actual);
- actual = connectorService.read(actual.getKey());
- } catch (SyncopeClientException e) {
- LOG.error("update failed", e);
- t = e;
- }
-
- assertNull(t);
- assertNotNull(actual);
- assertEquals(EnumSet.of(ConnectorCapability.ONE_PHASE_CREATE, ConnectorCapability.TWO_PHASES_CREATE),
- actual.getCapabilities());
- assertEquals(10, actual.getPoolConf().getMaxObjects().intValue());
-
- // check also for the deletion of the created object
- try {
- connectorService.delete(actual.getKey());
- } catch (SyncopeClientException e) {
- LOG.error("delete failed", e);
- t = e;
- }
-
- assertNull(t);
-
- // check the non existence
- try {
- connectorService.read(actual.getKey());
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void update() {
- ConnInstanceTO connectorTO = new ConnInstanceTO();
-
- // set connector instance id
- connectorTO.setKey(103L);
-
- // set connector version
- connectorTO.setVersion(connidSoapVersion);
-
- // set connector name
- connectorTO.setConnectorName("net.tirasa.connid.bundles.soap.WebServiceConnector");
-
- // set bundle name
- connectorTO.setBundleName("net.tirasa.connid.bundles.soap");
-
- connectorTO.setConnRequestTimeout(20);
-
- // set the connector configuration using PropertyTO
- Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
- ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
- endpointSchema.setName("endpoint");
- endpointSchema.setType(String.class.getName());
- endpointSchema.setRequired(true);
- ConnConfProperty endpoint = new ConnConfProperty();
- endpoint.setSchema(endpointSchema);
- endpoint.getValues().add("http://localhost:8888/wssample/services");
- conf.add(endpoint);
-
- ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
- servicenameSchema.setName("servicename");
- servicenameSchema.setType(String.class.getName());
- servicenameSchema.setRequired(true);
- ConnConfProperty servicename = new ConnConfProperty();
- servicename.setSchema(servicenameSchema);
- servicename.getValues().add("Provisioning");
- conf.add(servicename);
-
- // set connector configuration
- connectorTO.getConfiguration().addAll(conf);
-
- connectorService.update(connectorTO.getKey(), connectorTO);
- ConnInstanceTO actual = connectorService.read(connectorTO.getKey());
-
- assertNotNull(actual);
-
- actual = connectorService.read(actual.getKey());
-
- assertNotNull(actual);
- assertEquals(actual.getBundleName(), connectorTO.getBundleName());
- assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
- assertEquals(actual.getVersion(), connectorTO.getVersion());
- assertEquals(Integer.valueOf(20), actual.getConnRequestTimeout());
- }
-
- private List<ResourceTO> filter(final List<ResourceTO> input, final Long connectorKey) {
- List<ResourceTO> result = new ArrayList<>();
-
- for (ResourceTO resource : input) {
- if (connectorKey.equals(resource.getConnectorId())) {
- result.add(resource);
- }
- }
-
- return result;
- }
-
- @Test
- public void issueSYNCOPE10() {
- // ----------------------------------
- // Copy resource and connector in order to create new objects.
- // ----------------------------------
- // Retrieve a connector instance template.
- ConnInstanceTO connInstanceTO = connectorService.read(103L);
- assertNotNull(connInstanceTO);
-
- // check for resource
- List<ResourceTO> resources = filter(resourceService.list(), 103L);
- assertEquals(4, resources.size());
-
- // Retrieve a resource TO template.
- ResourceTO resourceTO = resources.get(0);
-
- // Make it new.
- resourceTO.setKey("newAbout103");
-
- // Make it new.
- connInstanceTO.setKey(0);
- connInstanceTO.setDisplayName("newDisplayName" + getUUIDString());
- // ----------------------------------
-
- // ----------------------------------
- // Create a new connector instance.
- // ----------------------------------
- Response response = connectorService.create(connInstanceTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
- }
-
- connInstanceTO = getObject(response.getLocation(), ConnectorService.class, ConnInstanceTO.class);
- assertNotNull(connInstanceTO);
- assertFalse(connInstanceTO.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
-
- long connId = connInstanceTO.getKey();
-
- // Link resourceTO to the new connector instance.
- resourceTO.setConnectorId(connId);
- // ----------------------------------
-
- // ----------------------------------
- // Check for connector instance update after resource creation.
- // ----------------------------------
- response = resourceService.create(resourceTO);
- resourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
-
- assertNotNull(resourceTO);
-
- resources = filter(resourceService.list(), connId);
- assertEquals(1, resources.size());
- // ----------------------------------
-
- // ----------------------------------
- // Check for spring bean.
- // ----------------------------------
- ConnInstanceTO connInstanceBean = connectorService.readByResource(resourceTO.getKey());
- assertNotNull(connInstanceBean);
- assertFalse(connInstanceBean.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
- // ----------------------------------
-
- // ----------------------------------
- // Check for spring bean update after connector instance update.
- // ----------------------------------
- connInstanceTO.getCapabilities().add(ConnectorCapability.AUTHENTICATE);
-
- connectorService.update(connInstanceTO.getKey(), connInstanceTO);
- ConnInstanceTO actual = connectorService.read(connInstanceTO.getKey());
- assertNotNull(actual);
- assertTrue(connInstanceTO.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
-
- // check for spring bean update
- connInstanceBean = connectorService.readByResource(resourceTO.getKey());
- assertTrue(connInstanceBean.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
- // ----------------------------------
- }
-
- @Test
- public void deleteWithException() {
- try {
- connectorService.delete(0L);
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
- }
- }
-
- @Test
- public void list() {
- List<ConnInstanceTO> connectorInstanceTOs = connectorService.list(null);
- assertNotNull(connectorInstanceTOs);
- assertFalse(connectorInstanceTOs.isEmpty());
- for (ConnInstanceTO instance : connectorInstanceTOs) {
- assertNotNull(instance);
- }
- }
-
- @Test
- public void read() {
- ConnInstanceTO connectorInstanceTO = connectorService.read(100L);
- assertNotNull(connectorInstanceTO);
- }
-
- @Test
- public void getBundles() {
- List<ConnBundleTO> bundles = connectorService.getBundles(null);
- assertNotNull(bundles);
- assertFalse(bundles.isEmpty());
- for (ConnBundleTO bundle : bundles) {
- assertNotNull(bundle);
- }
- }
-
- @Test
- public void getConnectorConfiguration() {
- List<ConnConfProperty> props = connectorService.getConfigurationProperties(104L);
- assertNotNull(props);
- assertFalse(props.isEmpty());
- }
-
- @Test
- public void checkHiddenProperty() {
- ConnInstanceTO connInstanceTO = connectorService.read(100L);
-
- boolean check = false;
-
- for (ConnConfProperty prop : connInstanceTO.getConfiguration()) {
- if ("receiveTimeout".equals(prop.getSchema().getName())) {
- check = true;
- }
- }
- assertTrue(check);
- }
-
- @Test
- public void checkSelectedLanguage() {
- // 1. Check Italian
- List<ConnInstanceTO> connectorInstanceTOs = connectorService.list("it");
-
- Map<String, ConnConfProperty> instanceConfMap;
- for (ConnInstanceTO instance : connectorInstanceTOs) {
- if ("net.tirasa.connid.bundles.db.table".equals(instance.getBundleName())) {
- instanceConfMap = instance.getConfigurationMap();
- assertEquals("Utente", instanceConfMap.get("user").getSchema().getDisplayName());
- }
- }
-
- // 2. Check English (default)
- connectorInstanceTOs = connectorService.list(null);
-
- for (ConnInstanceTO instance : connectorInstanceTOs) {
- if ("net.tirasa.connid.bundles.db.table".equals(instance.getBundleName())) {
- instanceConfMap = instance.getConfigurationMap();
- assertEquals("User", instanceConfMap.get("user").getSchema().getDisplayName());
- }
- }
- }
-
- @Test
- public void validate() {
- ConnInstanceTO connectorTO = new ConnInstanceTO();
- connectorTO.setLocation(connectorServerLocation);
- connectorTO.setVersion(connidDbTableVersion);
- connectorTO.setConnectorName("net.tirasa.connid.bundles.db.table.DatabaseTableConnector");
- connectorTO.setBundleName("net.tirasa.connid.bundles.db.table");
- connectorTO.setDisplayName("H2Test");
-
- // set the connector configuration using PropertyTO
- Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
- ConnConfPropSchema jdbcDriverSchema = new ConnConfPropSchema();
- jdbcDriverSchema.setName("jdbcDriver");
- jdbcDriverSchema.setType(String.class.getName());
- jdbcDriverSchema.setRequired(true);
- ConnConfProperty jdbcDriver = new ConnConfProperty();
- jdbcDriver.setSchema(jdbcDriverSchema);
- jdbcDriver.getValues().add("org.h2.Driver");
- conf.add(jdbcDriver);
-
- ConnConfPropSchema jdbcUrlTemplateSchema = new ConnConfPropSchema();
- jdbcUrlTemplateSchema.setName("jdbcUrlTemplate");
- jdbcUrlTemplateSchema.setType(String.class.getName());
- jdbcUrlTemplateSchema.setRequired(true);
- ConnConfProperty jdbcUrlTemplate = new ConnConfProperty();
- jdbcUrlTemplate.setSchema(jdbcUrlTemplateSchema);
- jdbcUrlTemplate.getValues().add(testJDBCURL);
- conf.add(jdbcUrlTemplate);
-
- ConnConfPropSchema userSchema = new ConnConfPropSchema();
- userSchema.setName("user");
- userSchema.setType(String.class.getName());
- userSchema.setRequired(false);
- ConnConfProperty user = new ConnConfProperty();
- user.setSchema(userSchema);
- user.getValues().add("sa");
- conf.add(user);
-
- ConnConfPropSchema passwordSchema = new ConnConfPropSchema();
- passwordSchema.setName("password");
- passwordSchema.setType(GuardedString.class.getName());
- passwordSchema.setRequired(true);
- ConnConfProperty password = new ConnConfProperty();
- password.setSchema(passwordSchema);
- password.getValues().add("sa");
- conf.add(password);
-
- ConnConfPropSchema tableSchema = new ConnConfPropSchema();
- tableSchema.setName("table");
- tableSchema.setType(String.class.getName());
- tableSchema.setRequired(true);
- ConnConfProperty table = new ConnConfProperty();
- table.setSchema(tableSchema);
- table.getValues().add("test");
- conf.add(table);
-
- ConnConfPropSchema keyColumnSchema = new ConnConfPropSchema();
- keyColumnSchema.setName("keyColumn");
- keyColumnSchema.setType(String.class.getName());
- keyColumnSchema.setRequired(true);
- ConnConfProperty keyColumn = new ConnConfProperty();
- keyColumn.setSchema(keyColumnSchema);
- keyColumn.getValues().add("id");
- conf.add(keyColumn);
-
- ConnConfPropSchema passwordColumnSchema = new ConnConfPropSchema();
- passwordColumnSchema.setName("passwordColumn");
- passwordColumnSchema.setType(String.class.getName());
- passwordColumnSchema.setRequired(true);
- ConnConfProperty passwordColumn = new ConnConfProperty();
- passwordColumn.setSchema(passwordColumnSchema);
- passwordColumn.getValues().add("password");
- conf.add(passwordColumn);
-
- // set connector configuration
- connectorTO.getConfiguration().addAll(conf);
-
- assertTrue(connectorService.check(connectorTO));
-
- conf.remove(password);
- password.getValues().clear();
- password.getValues().add("password");
- conf.add(password);
-
- assertFalse(connectorService.check(connectorTO));
- }
-
- @Test
- public void getSchemaNames() {
- ConnInstanceTO conn = connectorService.read(101L);
-
- List<PlainSchemaTO> schemaNames = connectorService.getSchemaNames(conn.getKey(), conn, true);
- assertNotNull(schemaNames);
- assertFalse(schemaNames.isEmpty());
- assertNotNull(schemaNames.get(0).getKey());
- assertNull(schemaNames.get(0).getEnumerationValues());
-
- schemaNames = connectorService.getSchemaNames(conn.getKey(), conn, false);
-
- assertNotNull(schemaNames);
- assertEquals(0, schemaNames.size());
-
- conn = connectorService.read(104L);
-
- // to be used with overridden properties
- conn.getConfiguration().clear();
-
- schemaNames = connectorService.getSchemaNames(conn.getKey(), conn, true);
- assertNotNull(schemaNames);
- assertFalse(schemaNames.isEmpty());
- }
-
- @Test
- public void getSupportedObjectClasses() {
- ConnInstanceTO ldap = connectorService.read(105L);
- assertNotNull(ldap);
-
- List<ConnIdObjectClassTO> objectClasses = connectorService.getSupportedObjectClasses(ldap.getKey(), ldap);
- assertNotNull(objectClasses);
- assertEquals(2, objectClasses.size());
- assertTrue(objectClasses.contains(ConnIdObjectClassTO.ACCOUNT));
- assertTrue(objectClasses.contains(ConnIdObjectClassTO.GROUP));
-
- ConnInstanceTO csv = connectorService.read(104L);
- assertNotNull(csv);
-
- objectClasses = connectorService.getSupportedObjectClasses(csv.getKey(), csv);
- assertNotNull(objectClasses);
- assertEquals(1, objectClasses.size());
- assertTrue(objectClasses.contains(ConnIdObjectClassTO.ACCOUNT));
- }
-
- @Test
- public void issueSYNCOPE112() {
- // ----------------------------------------
- // Create a new connector
- // ----------------------------------------
- ConnInstanceTO connectorTO = new ConnInstanceTO();
-
- connectorTO.setLocation(connectorService.read(100L).getLocation());
-
- // set connector version
- connectorTO.setVersion(connidSoapVersion);
-
- // set connector name
- connectorTO.setConnectorName("net.tirasa.connid.bundles.soap.WebServiceConnector");
-
- // set bundle name
- connectorTO.setBundleName("net.tirasa.connid.bundles.soap");
-
- // set display name
- connectorTO.setDisplayName("WSSoap");
-
- // set the connector configuration using PropertyTO
- Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
- ConnConfPropSchema userSchema = new ConnConfPropSchema();
- userSchema.setName("endpoint");
- userSchema.setType(String.class.getName());
- userSchema.setRequired(true);
- ConnConfProperty endpoint = new ConnConfProperty();
- endpoint.setSchema(userSchema);
- endpoint.getValues().add("http://localhost:9080/does_not_work");
- endpoint.setOverridable(true);
-
- ConnConfPropSchema keyColumnSchema = new ConnConfPropSchema();
- keyColumnSchema.setName("servicename");
- keyColumnSchema.setType(String.class.getName());
- keyColumnSchema.setRequired(true);
- ConnConfProperty servicename = new ConnConfProperty();
- servicename.setSchema(keyColumnSchema);
- servicename.getValues().add("net.tirasa.connid.bundles.soap.provisioning.interfaces.Provisioning");
- servicename.setOverridable(false);
-
- conf.add(endpoint);
- conf.add(servicename);
-
- // set connector configuration
- connectorTO.getConfiguration().addAll(conf);
-
- try {
- assertFalse(connectorService.check(connectorTO));
-
- Response response = connectorService.create(connectorTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
- }
-
- connectorTO = getObject(response.getLocation(), ConnectorService.class, ConnInstanceTO.class);
- assertNotNull(connectorTO);
- // ----------------------------------------
-
- // ----------------------------------------
- // create a resourceTO
- // ----------------------------------------
- String resourceName = "checkForPropOverriding";
- ResourceTO resourceTO = new ResourceTO();
-
- resourceTO.setKey(resourceName);
- resourceTO.setConnectorId(connectorTO.getKey());
-
- conf = new HashSet<ConnConfProperty>();
- endpoint.getValues().clear();
- endpoint.getValues().add("http://localhost:9080/wssample/services/provisioning");
- conf.add(endpoint);
-
- resourceTO.getConnConfProperties().addAll(conf);
-
- MappingTO mapping = new MappingTO();
- resourceTO.setUmapping(mapping);
-
- MappingItemTO mapItem = new MappingItemTO();
- mapItem.setExtAttrName("uid");
- mapItem.setIntAttrName("userId");
- mapItem.setIntMappingType(IntMappingType.UserPlainSchema);
- mapItem.setAccountid(true);
- mapping.setAccountIdItem(mapItem);
- // ----------------------------------------
-
- // ----------------------------------------
- // Check connection without saving the resource ....
- // ----------------------------------------
- assertTrue(resourceService.check(resourceTO));
- // ----------------------------------------
- } finally {
- // Remove connector from db to make test re-runnable
- connectorService.delete(connectorTO.getKey());
- }
- }
-
- @Test
- public void reload() {
- connectorService.reload();
- }
-
- @Test
- public void bulkAction() {
- final BulkAction bulkAction = new BulkAction();
- bulkAction.setOperation(BulkAction.Type.DELETE);
-
- ConnInstanceTO conn = connectorService.read(101L);
-
- conn.setKey(0);
- conn.setDisplayName("forBulk1");
-
- bulkAction.getTargets().add(String.valueOf(getObject(
- connectorService.create(conn).getLocation(), ConnectorService.class, ConnInstanceTO.class).getKey()));
-
- conn.setDisplayName("forBulk2");
-
- bulkAction.getTargets().add(String.valueOf(getObject(
- connectorService.create(conn).getLocation(), ConnectorService.class, ConnInstanceTO.class).getKey()));
-
- Iterator<String> iter = bulkAction.getTargets().iterator();
-
- assertNotNull(connectorService.read(Long.valueOf(iter.next())));
- assertNotNull(connectorService.read(Long.valueOf(iter.next())));
-
- connectorService.bulk(bulkAction);
-
- iter = bulkAction.getTargets().iterator();
-
- try {
- connectorService.read(Long.valueOf(iter.next()));
- fail();
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- }
-
- try {
- connectorService.read(Long.valueOf(iter.next()));
- fail();
- } catch (SyncopeClientException e) {
- assertNotNull(e);
- }
- }
-
- @Test
- public void issueSYNCOPE605() {
-
- ConnInstanceTO connectorInstanceTO = connectorService.read(103L);
- assertTrue(connectorInstanceTO.getCapabilities().isEmpty());
-
- connectorInstanceTO.getCapabilities().add(ConnectorCapability.SEARCH);
- connectorService.update(connectorInstanceTO.getKey(), connectorInstanceTO);
-
- ConnInstanceTO updatedCapabilities = connectorService.read(connectorInstanceTO.getKey());
- assertNotNull(updatedCapabilities.getCapabilities());
- assertTrue(updatedCapabilities.getCapabilities().size() == 1);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java
deleted file mode 100644
index 9ac24ea..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java
+++ /dev/null
@@ -1,151 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.DerSchemaTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class DerSchemaITCase extends AbstractITCase {
-
- @Test
- public void list() {
- List<DerSchemaTO> derivedSchemas = schemaService.list(AttributableType.USER, SchemaType.DERIVED);
- assertFalse(derivedSchemas.isEmpty());
- for (DerSchemaTO derivedSchemaTO : derivedSchemas) {
- assertNotNull(derivedSchemaTO);
- }
- }
-
- @Test
- public void read() {
- DerSchemaTO derivedSchemaTO = schemaService.read(AttributableType.USER, SchemaType.DERIVED,
- "cn");
- assertNotNull(derivedSchemaTO);
- }
-
- @Test
- public void create() {
- DerSchemaTO schema = new DerSchemaTO();
- schema.setKey("derived");
- schema.setExpression("derived_sx + '_' + derived_dx");
-
- DerSchemaTO actual = createSchema(AttributableType.USER, SchemaType.DERIVED, schema);
- assertNotNull(actual);
-
- actual = schemaService.read(AttributableType.USER, SchemaType.DERIVED, actual.getKey());
- assertNotNull(actual);
- assertEquals(actual.getExpression(), "derived_sx + '_' + derived_dx");
- }
-
- @Test
- public void delete() {
- DerSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
- assertNotNull(schema);
-
- schemaService.delete(AttributableType.ROLE, SchemaType.DERIVED, schema.getKey());
-
- try {
- schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.NotFound, e.getType());
- } finally {
- // Recreate schema to make test re-runnable
- schema = createSchema(AttributableType.ROLE, SchemaType.DERIVED, schema);
- assertNotNull(schema);
- }
- }
-
- @Test
- public void update() {
- DerSchemaTO schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
- "mderiveddata");
- assertNotNull(schema);
- assertEquals("mderived_sx + '-' + mderived_dx", schema.getExpression());
- try {
- schema.setExpression("mderived_sx + '.' + mderived_dx");
-
- schemaService.update(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
- schema.getKey(), schema);
-
- schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.DERIVED, "mderiveddata");
- assertNotNull(schema);
- assertEquals("mderived_sx + '.' + mderived_dx", schema.getExpression());
- } finally {
- // Set updated back to make test re-runnable
- schema.setExpression("mderived_sx + '-' + mderived_dx");
- schemaService.update(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
- schema.getKey(), schema);
- }
- }
-
- @Test
- public void issueSYNCOPE323() {
- DerSchemaTO actual = schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
- assertNotNull(actual);
-
- try {
- createSchema(AttributableType.ROLE, SchemaType.DERIVED, actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.EntityExists, e.getType());
- }
-
- actual.setKey(null);
- try {
- createSchema(AttributableType.ROLE, SchemaType.DERIVED, actual);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
- assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
- }
- }
-
- @Test
- public void issueSYNCOPE418() {
- DerSchemaTO schema = new DerSchemaTO();
- schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
- schema.setExpression("derived_sx + '_' + derived_dx");
-
- try {
- createSchema(AttributableType.ROLE, SchemaType.DERIVED, schema);
- fail();
- } catch (SyncopeClientException e) {
- assertEquals(ClientExceptionType.InvalidDerSchema, e.getType());
- assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java
deleted file mode 100644
index 68510bf..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java
+++ /dev/null
@@ -1,215 +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.fit.server.reference;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-
-import java.text.ParseException;
-import java.util.List;
-import org.apache.syncope.common.lib.to.EventCategoryTO;
-import org.apache.syncope.common.lib.to.LoggerTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.AuditElements;
-import org.apache.syncope.common.lib.types.AuditElements.EventCategoryType;
-import org.apache.syncope.common.lib.types.AuditLoggerName;
-import org.apache.syncope.common.lib.types.LoggerLevel;
-import org.apache.syncope.common.lib.types.LoggerType;
-import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
-import org.apache.syncope.server.logic.ReportLogic;
-import org.apache.syncope.server.logic.ResourceLogic;
-import org.apache.syncope.server.logic.RoleLogic;
-import org.apache.syncope.server.logic.UserLogic;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
-
-@FixMethodOrder(MethodSorters.JVM)
-public class LoggerITCase extends AbstractITCase {
-
- @Test
- public void listLogs() {
- List<LoggerTO> loggers = loggerService.list(LoggerType.LOG);
- assertNotNull(loggers);
- assertFalse(loggers.isEmpty());
- for (LoggerTO logger : loggers) {
- assertNotNull(logger);
- }
- }
-
- @Test
- public void listAudits() throws ParseException {
- List<LoggerTO> audits = loggerService.list(LoggerType.AUDIT);
-
- assertNotNull(audits);
- assertFalse(audits.isEmpty());
- for (LoggerTO audit : audits) {
- assertNotNull(AuditLoggerName.fromLoggerName(audit.getKey()));
- }
- }
-
- @Test
- public void setLevel() {
- List<LoggerTO> loggers = loggerService.list(LoggerType.LOG);
- assertNotNull(loggers);
- int startSize = loggers.size();
-
- LoggerTO logger = new LoggerTO();
- logger.setKey("TEST");
- logger.setLevel(LoggerLevel.INFO);
- loggerService.update(LoggerType.LOG, logger.getKey(), logger);
- logger = loggerService.read(LoggerType.LOG, logger.getKey());
- assertNotNull(logger);
- assertEquals(LoggerLevel.INFO, logger.getLevel());
-
- loggers = loggerService.list(LoggerType.LOG);
- assertNotNull(loggers);
- assertEquals(startSize + 1, loggers.size());
-
- // TEST Delete
- loggerService.delete(LoggerType.LOG, "TEST");
- loggers = loggerService.list(LoggerType.LOG);
- assertNotNull(loggers);
- assertEquals(startSize, loggers.size());
- }
-
- @Test
- public void enableDisableAudit() {
- AuditLoggerName auditLoggerName = new AuditLoggerName(
- EventCategoryType.REST,
- ReportLogic.class.getSimpleName(),
- null,
- "deleteExecution",
- AuditElements.Result.FAILURE);
-
- List<AuditLoggerName> audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
- assertNotNull(audits);
- assertFalse(audits.contains(auditLoggerName));
-
- LoggerTO loggerTO = new LoggerTO();
- String name = auditLoggerName.toLoggerName();
- loggerTO.setKey(name);
- loggerTO.setLevel(LoggerLevel.DEBUG);
- loggerService.update(LoggerType.AUDIT, name, loggerTO);
-
- audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
- assertNotNull(audits);
- assertTrue(audits.contains(auditLoggerName));
-
- loggerService.delete(LoggerType.AUDIT, auditLoggerName.toLoggerName());
-
- audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
- assertNotNull(audits);
- assertFalse(audits.contains(auditLoggerName));
- }
-
- @Test
- public void listAuditEvents() {
- final List<EventCategoryTO> events = loggerService.events();
-
- boolean found = false;
-
- for (EventCategoryTO eventCategoryTO : events) {
- if (UserLogic.class.getSimpleName().equals(eventCategoryTO.getCategory())) {
- assertEquals(EventCategoryType.REST, eventCategoryTO.getType());
- assertTrue(eventCategoryTO.getEvents().contains("create"));
- assertTrue(eventCategoryTO.getEvents().contains("list"));
- assertFalse(eventCategoryTO.getEvents().contains("doCreate"));
- assertFalse(eventCategoryTO.getEvents().contains("setStatusOnWfAdapter"));
- assertFalse(eventCategoryTO.getEvents().contains("resolveReference"));
- found = true;
- }
- }
- assertTrue(found);
-
- found = false;
- for (EventCategoryTO eventCategoryTO : events) {
- if (RoleLogic.class.getSimpleName().equals(eventCategoryTO.getCategory())) {
- assertEquals(EventCategoryType.REST, eventCategoryTO.getType());
- assertTrue(eventCategoryTO.getEvents().contains("create"));
- assertTrue(eventCategoryTO.getEvents().contains("list"));
- assertFalse(eventCategoryTO.getEvents().contains("resolveReference"));
- found = true;
- }
- }
- assertTrue(found);
-
- found = false;
- for (EventCategoryTO eventCategoryTO : events) {
- if (ResourceLogic.class.getSimpleName().equals(eventCategoryTO.getCategory())) {
- assertEquals(EventCategoryType.REST, eventCategoryTO.getType());
- assertTrue(eventCategoryTO.getEvents().contains("create"));
- assertTrue(eventCategoryTO.getEvents().contains("read"));
- assertTrue(eventCategoryTO.getEvents().contains("delete"));
- assertFalse(eventCategoryTO.getEvents().contains("resolveReference"));
- found = true;
- }
- }
- assertTrue(found);
-
- found = false;
- for (EventCategoryTO eventCategoryTO : events) {
- if (AttributableType.USER.name().toLowerCase().equals(eventCategoryTO.getCategory())) {
- if (RESOURCE_NAME_LDAP.equals(eventCategoryTO.getSubcategory())
- && EventCategoryType.SYNCHRONIZATION == eventCategoryTO.getType()) {
- assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.CREATE.name().toLowerCase()));
- assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.UPDATE.name().toLowerCase()));
- assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.DELETE.name().toLowerCase()));
- found = true;
- }
- }
- }
- assertTrue(found);
-
- found = false;
- for (EventCategoryTO eventCategoryTO : events) {
- if (AttributableType.USER.name().toLowerCase().equals(eventCategoryTO.getCategory())) {
- if (RESOURCE_NAME_CSV.equals(eventCategoryTO.getSubcategory())
- && EventCategoryType.PROPAGATION == eventCategoryTO.getType()) {
- assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.CREATE.name().toLowerCase()));
- assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.UPDATE.name().toLowerCase()));
- assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.DELETE.name().toLowerCase()));
- found = true;
- }
- }
- }
- assertTrue(found);
-
- found = false;
- for (EventCategoryTO eventCategoryTO : events) {
- if (EventCategoryType.TASK == eventCategoryTO.getType()
- && "SampleJob".equals(eventCategoryTO.getCategory())) {
- found = true;
- }
- }
- assertTrue(found);
-
- found = false;
- for (EventCategoryTO eventCategoryTO : events) {
- if (EventCategoryType.TASK == eventCategoryTO.getType()
- && "SyncJob".equals(eventCategoryTO.getCategory())) {
- found = true;
- }
- }
- assertTrue(found);
- }
-}
[38/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
new file mode 100644
index 0000000..9c625e1
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportletConfModalPage.java
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.ParameterizedType;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.RoleSearchPanel;
+import org.apache.syncope.client.console.panels.UserSearchPanel;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+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.CheckBoxMultipleChoiceFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.DateTimeFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.annotation.FormAttributeField;
+import org.apache.syncope.common.lib.report.AbstractReportletConf;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.Component;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.util.visit.IVisit;
+import org.apache.wicket.util.visit.IVisitor;
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.PropertyAccessorFactory;
+import org.springframework.util.ClassUtils;
+
+public class ReportletConfModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 3910027601200382958L;
+
+ private static final String[] EXCLUDE_PROPERTIES = new String[] { "serialVersionUID", "class", "name",
+ "reportletClassName" };
+
+ private AbstractReportletConf reportletConf;
+
+ private final AjaxTextFieldPanel name;
+
+ private WebMarkupContainer propertiesContainer;
+
+ private ListView<String> propView;
+
+ public ReportletConfModalPage(final AbstractReportletConf reportletConf, final ModalWindow window,
+ final PageReference pageRef) {
+
+ this.reportletConf = reportletConf;
+
+ final Form form = new Form(FORM);
+ add(form);
+
+ propertiesContainer = new WebMarkupContainer("container");
+ propertiesContainer.setOutputMarkupId(true);
+ form.add(propertiesContainer);
+
+ name = new AjaxTextFieldPanel("name", "name", this.reportletConf == null
+ ? new Model<String>()
+ : new PropertyModel<String>(this.reportletConf, "name"));
+ name.setOutputMarkupId(true);
+ name.addRequiredLabel();
+ form.add(name);
+
+ final AjaxDropDownChoicePanel<String> reportletClass = new AjaxDropDownChoicePanel<String>("reportletClass",
+ "reportletClass", new IModel<String>() {
+
+ private static final long serialVersionUID = -2316468110411802130L;
+
+ @Override
+ public String getObject() {
+ return ReportletConfModalPage.this.reportletConf == null
+ ? null
+ : ReportletConfModalPage.this.reportletConf.getClass().getName();
+ }
+
+ @Override
+ public void setObject(final String object) {
+ try {
+ Class<?> reportletClass = Class.forName(object);
+ ReportletConfModalPage.this.reportletConf = (AbstractReportletConf) reportletClass.
+ newInstance();
+ propertiesContainer.replace(buildPropView());
+ } catch (Exception e) {
+ LOG.error("Cannot find or initialize {}", object, e);
+ }
+ }
+
+ @Override
+ public void detach() {
+ }
+ });
+ reportletClass.setStyleSheet("long_dynamicsize");
+ reportletClass.setChoices(reportRestClient.getReportletConfClasses());
+ ((DropDownChoice) reportletClass.getField()).setNullValid(true);
+ reportletClass.addRequiredLabel();
+ reportletClass.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = 5538299138211283825L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ ((DropDownChoice) reportletClass.getField()).setNullValid(false);
+ target.add(reportletClass.getField());
+ target.add(propertiesContainer);
+ }
+ });
+ form.add(reportletClass);
+
+ propertiesContainer.add(buildPropView());
+
+ final AjaxButton submit = new AjaxButton(APPLY, new ResourceModel(APPLY)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final BeanWrapper wrapper = PropertyAccessorFactory.
+ forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
+ wrapper.setPropertyValue("name", name.getField().getInput());
+
+ // Iterate over properties in order to find UserSearchPanel instances and manually update
+ // this.reportletConf with select search criteria - this is needed because UserSearchPanel
+ // does not comply with usual Wicket model paradigm.
+ ReportletConfModalPage.this.propView.visitChildren(new IVisitor<Component, Void>() {
+
+ @Override
+ public void component(final Component component, final IVisit<Void> ivisit) {
+ if (component instanceof UserSearchPanel) {
+ // using component.getDefaultModelObjectAsString() to fetch field name (set above)
+ wrapper.setPropertyValue(component.getDefaultModelObjectAsString(),
+ ((UserSearchPanel) component).buildFIQL());
+ }
+ }
+ });
+
+ ((ReportModalPage) pageRef.getPage()).setModalReportletConf(ReportletConfModalPage.this.reportletConf);
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ form.add(submit);
+
+ final AjaxButton cancel = new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), pageRef) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private FieldPanel buildSinglePanel(final Class<?> type, final String fieldName, final String id) {
+ FieldPanel result = null;
+ PropertyModel model = new PropertyModel(ReportletConfModalPage.this.reportletConf, fieldName);
+ if (ClassUtils.isAssignable(Boolean.class, type)) {
+ result = new AjaxCheckBoxPanel(id, fieldName, model);
+ } else if (ClassUtils.isAssignable(Number.class, type)) {
+ result = new SpinnerFieldPanel<Number>(id, fieldName,
+ (Class<Number>) ClassUtils.resolvePrimitiveIfNecessary(type), model, null, null);
+ } else if (Date.class.equals(type)) {
+ result = new DateTimeFieldPanel(id, fieldName, model, SyncopeConstants.DEFAULT_DATE_PATTERN);
+ } else if (type.isEnum()) {
+ result = new AjaxDropDownChoicePanel(id, fieldName, model).setChoices(
+ Arrays.asList(type.getEnumConstants()));
+ }
+
+ // treat as String if nothing matched above
+ if (result == null) {
+ result = new AjaxTextFieldPanel(id, fieldName, model);
+ }
+
+ return result;
+ }
+
+ private ListView<String> buildPropView() {
+ LoadableDetachableModel<List<String>> propViewModel = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ List<String> result = new ArrayList<String>();
+ if (ReportletConfModalPage.this.reportletConf != null) {
+ for (Field field : ReportletConfModalPage.this.reportletConf.getClass().getDeclaredFields()) {
+ if (!ArrayUtils.contains(EXCLUDE_PROPERTIES, field.getName())) {
+ result.add(field.getName());
+ }
+ }
+ }
+
+ return result;
+ }
+ };
+
+ propView = new ListView<String>("propView", propViewModel) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ final String fieldName = item.getModelObject();
+
+ Label label = new Label("key", fieldName);
+ item.add(label);
+
+ Field field = null;
+ try {
+ field = ReportletConfModalPage.this.reportletConf.getClass().getDeclaredField(fieldName);
+ } catch (Exception e) {
+ LOG.error("Could not find field {} in class {}",
+ fieldName, ReportletConfModalPage.this.reportletConf.getClass(), e);
+ }
+ if (field == null) {
+ return;
+ }
+
+ FormAttributeField annotation = field.getAnnotation(FormAttributeField.class);
+
+ BeanWrapper wrapper = PropertyAccessorFactory.
+ forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
+
+ Panel panel;
+
+ if (String.class.equals(field.getType()) && annotation != null && annotation.userSearch()) {
+ panel = new UserSearchPanel.Builder("value").
+ fiql((String) wrapper.getPropertyValue(fieldName)).required(false).build();
+ // This is needed in order to manually update this.reportletConf with search panel selections
+ panel.setDefaultModel(new Model<String>(fieldName));
+ } else if (String.class.equals(field.getType()) && annotation != null && annotation.roleSearch()) {
+ panel = new RoleSearchPanel.Builder("value").
+ fiql((String) wrapper.getPropertyValue(fieldName)).required(false).build();
+ // This is needed in order to manually update this.reportletConf with search panel selections
+ panel.setDefaultModel(new Model<String>(fieldName));
+ } else if (List.class.equals(field.getType())) {
+ Class<?> listItemType = String.class;
+ if (field.getGenericType() instanceof ParameterizedType) {
+ listItemType =
+ (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
+ }
+
+ if (listItemType.equals(String.class) && annotation != null) {
+ List<String> choices;
+ switch (annotation.schema()) {
+ case UserPlainSchema:
+ choices = schemaRestClient.getSchemaNames(AttributableType.USER);
+ break;
+
+ case UserDerivedSchema:
+ choices = schemaRestClient.getDerSchemaNames(AttributableType.USER);
+ break;
+
+ case UserVirtualSchema:
+ choices = schemaRestClient.getVirSchemaNames(AttributableType.USER);
+ break;
+
+ case RolePlainSchema:
+ choices = schemaRestClient.getSchemaNames(AttributableType.ROLE);
+ break;
+
+ case RoleDerivedSchema:
+ choices = schemaRestClient.getDerSchemaNames(AttributableType.ROLE);
+ break;
+
+ case RoleVirtualSchema:
+ choices = schemaRestClient.getVirSchemaNames(AttributableType.ROLE);
+ break;
+
+ case MembershipPlainSchema:
+ choices = schemaRestClient.getSchemaNames(AttributableType.MEMBERSHIP);
+ break;
+
+ case MembershipDerivedSchema:
+ choices = schemaRestClient.getDerSchemaNames(AttributableType.MEMBERSHIP);
+ break;
+
+ case MembershipVirtualSchema:
+ choices = schemaRestClient.getVirSchemaNames(AttributableType.MEMBERSHIP);
+ break;
+
+ default:
+ choices = Collections.emptyList();
+ }
+
+ panel = new AjaxPalettePanel("value", new PropertyModel<List<String>>(
+ ReportletConfModalPage.this.reportletConf, fieldName), new ListModel<String>(choices),
+ true);
+ } else if (listItemType.isEnum()) {
+ panel = new CheckBoxMultipleChoiceFieldPanel("value", new PropertyModel(
+ ReportletConfModalPage.this.reportletConf, fieldName),
+ new ListModel(Arrays.asList(listItemType.getEnumConstants())));
+ } else {
+ if (((List) wrapper.getPropertyValue(fieldName)).isEmpty()) {
+ ((List) wrapper.getPropertyValue(fieldName)).add(null);
+ }
+
+ panel = new MultiFieldPanel("value", new PropertyModel<List>(
+ ReportletConfModalPage.this.reportletConf, fieldName),
+ buildSinglePanel(field.getType(), fieldName, "panel"));
+ }
+ } else {
+ panel = buildSinglePanel(field.getType(), fieldName, "value");
+ }
+
+ item.add(panel);
+ }
+ };
+
+ return propView;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
new file mode 100644
index 0000000..6c53dee
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Reports.java
@@ -0,0 +1,413 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.LoggerCategoryPanel;
+import org.apache.syncope.client.console.panels.SelectedEventsPanel;
+import org.apache.syncope.client.console.rest.LoggerRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.AuditElements.Result;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * Auditing and Reporting.
+ */
+public class Reports extends BasePage {
+
+ private static final long serialVersionUID = -2071214196989178694L;
+
+ private static final int WIN_HEIGHT = 500;
+
+ private static final int WIN_WIDTH = 700;
+
+ @SpringBean
+ private LoggerRestClient loggerRestClient;
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private WebMarkupContainer reportContainer;
+
+ private WebMarkupContainer auditContainer;
+
+ private int paginatorRows;
+
+ private final ModalWindow window;
+
+ public Reports(final PageParameters parameters) {
+ super(parameters);
+
+ window = new ModalWindow("reportWin");
+ window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ window.setInitialHeight(WIN_HEIGHT);
+ window.setInitialWidth(WIN_WIDTH);
+ window.setCookieName("view-report-win");
+ add(window);
+
+ setupReport();
+ setupAudit();
+ }
+
+ private void setupReport() {
+ reportContainer = new WebMarkupContainer("reportContainer");
+ setWindowClosedCallback(window, reportContainer);
+
+ MetaDataRoleAuthorizationStrategy.authorize(reportContainer, RENDER,
+ xmlRolesReader.getEntitlement("Reports", "list"));
+
+ paginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_REPORT_PAGINATOR_ROWS);
+
+ List<IColumn<ReportTO, String>> columns = new ArrayList<IColumn<ReportTO, String>>();
+ columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("id"), "id", "id"));
+ columns.add(new PropertyColumn<ReportTO, String>(new ResourceModel("name"), "name", "name"));
+ columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("lastExec"), "lastExec", "lastExec"));
+ columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("nextExec"), "nextExec", "nextExec"));
+ columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("startDate"), "startDate", "startDate"));
+ columns.add(new DatePropertyColumn<ReportTO>(new ResourceModel("endDate"), "endDate", "endDate"));
+ columns.add(new PropertyColumn<ReportTO, String>(
+ new ResourceModel("latestExecStatus"), "latestExecStatus", "latestExecStatus"));
+ columns.add(new ActionColumn<ReportTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<ReportTO> model) {
+
+ final ReportTO reportTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ReportModalPage(window, reportTO, Reports.this.getPageReference());
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Reports");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ reportRestClient.startExecution(reportTO.getKey());
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ feedbackPanel.refresh(target);
+ target.add(reportContainer);
+ }
+ }, ActionLink.ActionType.EXECUTE, "Reports");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ reportRestClient.delete(reportTO.getKey());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+ target.add(reportContainer);
+ feedbackPanel.refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, "Reports");
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(reportContainer);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ final AjaxFallbackDefaultDataTable<ReportTO, String> reportTable =
+ new AjaxFallbackDefaultDataTable<ReportTO, String>(
+ "reportTable", columns, new ReportProvider(), paginatorRows);
+
+ reportContainer.add(reportTable);
+ reportContainer.setOutputMarkupId(true);
+
+ add(reportContainer);
+
+ @SuppressWarnings("rawtypes")
+ Form paginatorForm = new Form("paginatorForm");
+
+ MetaDataRoleAuthorizationStrategy.authorize(paginatorForm, RENDER,
+ xmlRolesReader.getEntitlement("Reports", "list"));
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
+ prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_REPORT_PAGINATOR_ROWS,
+ String.valueOf(paginatorRows));
+ reportTable.setItemsPerPage(paginatorRows);
+
+ target.add(reportContainer);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+
+ AjaxLink createLink = new ClearIndicatingAjaxLink("createLink", getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ReportModalPage(window, new ReportTO(), Reports.this.getPageReference());
+ }
+ });
+
+ window.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(createLink, RENDER, xmlRolesReader.getEntitlement("Reports",
+ "create"));
+
+ add(createLink);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private void setupAudit() {
+ auditContainer = new WebMarkupContainer("auditContainer");
+ auditContainer.setOutputMarkupId(true);
+ add(auditContainer);
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ auditContainer, RENDER, xmlRolesReader.getEntitlement("Audit", "list"));
+
+ final Form form = new Form("auditForm");
+ auditContainer.add(form);
+
+ final List<String> events = new ArrayList<>();
+
+ final List<AuditLoggerName> audits = loggerRestClient.listAudits();
+ for (AuditLoggerName audit : audits) {
+ events.add(AuditLoggerName.buildEvent(
+ audit.getType(),
+ audit.getCategory(),
+ audit.getSubcategory(),
+ audit.getEvent(),
+ audit.getResult()));
+ }
+
+ final ListModel<String> model = new ListModel<String>(new ArrayList<String>(events));
+
+ form.add(new LoggerCategoryPanel(
+ "events", loggerRestClient.listEvents(), model, getPageReference(), "Reports") {
+
+ private static final long serialVersionUID = 6113164334533550277L;
+
+ @Override
+ protected String[] getListRoles() {
+ return new String[] {
+ xmlRolesReader.getEntitlement("Audit", "list")
+ };
+ }
+
+ @Override
+ protected String[] getChangeRoles() {
+ return new String[] {
+ xmlRolesReader.getEntitlement("Audit", "enable"),
+ xmlRolesReader.getEntitlement("Audit", "disable")
+ };
+ }
+
+ @Override
+ public void onEventAction(final IEvent<?> event) {
+ if (event.getPayload() instanceof SelectedEventsPanel.EventSelectionChanged) {
+
+ final SelectedEventsPanel.EventSelectionChanged eventSelectionChanged =
+ (SelectedEventsPanel.EventSelectionChanged) event.getPayload();
+
+ for (String toBeRemoved : eventSelectionChanged.getToBeRemoved()) {
+ if (events.contains(toBeRemoved)) {
+ final Map.Entry<EventCategoryTO, Result> eventCategory =
+ AuditLoggerName.parseEventCategory(toBeRemoved);
+
+ final AuditLoggerName auditLoggerName = new AuditLoggerName(
+ eventCategory.getKey().getType(),
+ eventCategory.getKey().getCategory(),
+ eventCategory.getKey().getSubcategory(),
+ CollectionUtils.isEmpty(eventCategory.getKey().getEvents())
+ ? null : eventCategory.getKey().getEvents().iterator().next(),
+ eventCategory.getValue());
+
+ loggerRestClient.disableAudit(auditLoggerName);
+ events.remove(toBeRemoved);
+ }
+ }
+
+ for (String toBeAdded : eventSelectionChanged.getToBeAdded()) {
+ if (!events.contains(toBeAdded)) {
+ final Map.Entry<EventCategoryTO, Result> eventCategory =
+ AuditLoggerName.parseEventCategory(toBeAdded);
+
+ final AuditLoggerName auditLoggerName = new AuditLoggerName(
+ eventCategory.getKey().getType(),
+ eventCategory.getKey().getCategory(),
+ eventCategory.getKey().getSubcategory(),
+ CollectionUtils.isEmpty(eventCategory.getKey().getEvents())
+ ? null : eventCategory.getKey().getEvents().iterator().next(),
+ eventCategory.getValue());
+
+ loggerRestClient.enableAudit(auditLoggerName);
+ events.add(toBeAdded);
+ }
+ }
+ }
+ }
+ });
+ }
+
+ private class ReportProvider extends SortableDataProvider<ReportTO, String> {
+
+ private static final long serialVersionUID = -2311716167583335852L;
+
+ private final SortableDataProviderComparator<ReportTO> comparator;
+
+ public ReportProvider() {
+ super();
+
+ //Default sorting
+ setSort("id", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<ReportTO>(this);
+ }
+
+ @Override
+ public Iterator<ReportTO> iterator(final long first, final long count) {
+ final int page = ((int) first / paginatorRows);
+
+ final List<ReportTO> list =
+ reportRestClient.list((page < 0 ? 0 : page) + 1, paginatorRows, getSort());
+ Collections.sort(list, comparator);
+ return list.iterator();
+ }
+
+ @Override
+ public long size() {
+ return reportRestClient.count();
+ }
+
+ @Override
+ public IModel<ReportTO> model(final ReportTO configuration) {
+
+ return new AbstractReadOnlyModel<ReportTO>() {
+
+ private static final long serialVersionUID = 4921104837546595602L;
+
+ @Override
+ public ReportTO getObject() {
+ return configuration;
+ }
+ };
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.java
new file mode 100644
index 0000000..d8b762f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.rest.SecurityQuestionRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class RequestPasswordResetModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -8419445804421211904L;
+
+ @SpringBean
+ private SecurityQuestionRestClient securityQuestionRestClient;
+
+ public RequestPasswordResetModalPage(final ModalWindow window) {
+ super();
+ setOutputMarkupId(true);
+
+ final boolean handleSecurityQuestion = userSelfRestClient.isPwdResetRequiringSecurityQuestions();
+
+ final StatelessForm<?> form = new StatelessForm<Object>(FORM);
+ form.setOutputMarkupId(true);
+
+ final Label securityQuestionLabel = new Label("securityQuestionLabel", getString("securityQuestion"));
+ securityQuestionLabel.setOutputMarkupPlaceholderTag(true);
+ securityQuestionLabel.setVisible(handleSecurityQuestion);
+ form.add(securityQuestionLabel);
+ final AjaxTextFieldPanel securityQuestion =
+ new AjaxTextFieldPanel("securityQuestion", "securityQuestion", new Model<String>());
+ securityQuestion.setReadOnly(true);
+ securityQuestion.setRequired(true);
+ securityQuestion.getField().setOutputMarkupId(true);
+ securityQuestion.setOutputMarkupPlaceholderTag(true);
+ securityQuestion.setVisible(handleSecurityQuestion);
+ form.add(securityQuestion);
+
+ final AjaxTextFieldPanel username =
+ new AjaxTextFieldPanel("username", "username", new Model<String>());
+ username.setRequired(true);
+ username.getField().setOutputMarkupId(true);
+ if (handleSecurityQuestion) {
+ username.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ getFeedbackMessages().clear();
+ target.add(feedbackPanel);
+ try {
+ SecurityQuestionTO read = securityQuestionRestClient.readByUser(username.getModelObject());
+ securityQuestion.setModelObject(read.getContent());
+ } catch (Exception e) {
+ LOG.error("While fetching security question for {}", username.getModelObject(), e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ securityQuestion.setModelObject(null);
+ } finally {
+ target.add(securityQuestion);
+ }
+ }
+ });
+ }
+ form.add(username);
+
+ final Label securityAnswerLabel = new Label("securityAnswerLabel", getString("securityAnswer"));
+ securityAnswerLabel.setOutputMarkupPlaceholderTag(true);
+ securityAnswerLabel.setVisible(handleSecurityQuestion);
+ form.add(securityAnswerLabel);
+ final AjaxTextFieldPanel securityAnswer =
+ new AjaxTextFieldPanel("securityAnswer", "securityAnswer", new Model<String>());
+ securityAnswer.setRequired(handleSecurityQuestion);
+ securityAnswer.setOutputMarkupPlaceholderTag(true);
+ securityAnswer.setVisible(handleSecurityQuestion);
+ form.add(securityAnswer);
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT, SUBMIT)) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ userSelfRestClient.requestPasswordReset(username.getModelObject(), securityAnswer.getModelObject());
+
+ setResponsePage(new ResultStatusModalPage.Builder(window, new UserTO()).
+ mode(Mode.SELF).build());
+ } catch (Exception e) {
+ LOG.error("While requesting password reset for {}", username.getModelObject(), e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ // do nothing
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ add(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
new file mode 100644
index 0000000..824c39c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResourceModalPage.java
@@ -0,0 +1,217 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AnnotatedBeanPanel;
+import org.apache.syncope.client.console.panels.ResourceConnConfPanel;
+import org.apache.syncope.client.console.panels.ResourceDetailsPanel;
+import org.apache.syncope.client.console.panels.ResourceMappingPanel;
+import org.apache.syncope.client.console.panels.ResourceSecurityPanel;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Modal window with Resource form.
+ */
+public class ResourceModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 1734415311027284221L;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public ResourceModalPage(final PageReference pageRef, final ModalWindow window, final ResourceTO resourceTO,
+ final boolean createFlag) {
+
+ super();
+
+ this.add(new Label("new", StringUtils.isBlank(resourceTO.getKey())
+ ? new ResourceModel("new")
+ : new Model("")));
+
+ this.add(new Label("name", StringUtils.isBlank(resourceTO.getKey())
+ ? ""
+ : resourceTO.getKey()));
+
+ final Form<ResourceTO> form = new Form<ResourceTO>(FORM);
+ form.setModel(new CompoundPropertyModel<ResourceTO>(resourceTO));
+
+ //--------------------------------
+ // Resource details panel
+ //--------------------------------
+ form.add(new ResourceDetailsPanel("details", resourceTO,
+ resourceRestClient.getPropagationActionsClasses(), createFlag));
+
+ form.add(new AnnotatedBeanPanel("systeminformation", resourceTO));
+ //--------------------------------
+
+ //--------------------------------
+ // Resource mapping panels
+ //--------------------------------
+ form.add(new ResourceMappingPanel("umapping", resourceTO, AttributableType.USER));
+ form.add(new ResourceMappingPanel("rmapping", resourceTO, AttributableType.ROLE));
+ //--------------------------------
+
+ //--------------------------------
+ // Resource connector configuration panel
+ //--------------------------------
+ ResourceConnConfPanel resourceConnConfPanel = new ResourceConnConfPanel("connconf", resourceTO, createFlag);
+ MetaDataRoleAuthorizationStrategy.authorize(
+ resourceConnConfPanel, ENABLE, xmlRolesReader.getEntitlement("Connectors", "read"));
+ form.add(resourceConnConfPanel);
+ //--------------------------------
+
+ //--------------------------------
+ // Resource security panel
+ //--------------------------------
+ form.add(new ResourceSecurityPanel("security", resourceTO));
+ //--------------------------------
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT, SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final ResourceTO resourceTO = (ResourceTO) form.getDefaultModelObject();
+
+ boolean accountIdError = false;
+
+ if (resourceTO.getUmapping() == null || resourceTO.getUmapping().getItems().isEmpty()) {
+ resourceTO.setUmapping(null);
+ } else {
+ int uAccountIdCount = 0;
+ for (MappingItemTO item : resourceTO.getUmapping().getItems()) {
+ if (item.isAccountid()) {
+ uAccountIdCount++;
+ }
+ }
+ accountIdError = uAccountIdCount != 1;
+ }
+
+ if (resourceTO.getRmapping() == null || resourceTO.getRmapping().getItems().isEmpty()) {
+ resourceTO.setRmapping(null);
+ } else {
+ int rAccountIdCount = 0;
+ for (MappingItemTO item : resourceTO.getRmapping().getItems()) {
+ if (item.isAccountid()) {
+ rAccountIdCount++;
+ }
+ }
+ accountIdError |= rAccountIdCount != 1;
+ }
+
+ if (accountIdError) {
+ error(getString("accountIdValidation"));
+ feedbackPanel.refresh(target);
+ } else {
+ try {
+ if (createFlag) {
+ resourceRestClient.create(resourceTO);
+ } else {
+ resourceRestClient.update(resourceTO);
+ }
+
+ if (pageRef != null && pageRef.getPage() instanceof AbstractBasePage) {
+ ((AbstractBasePage) pageRef.getPage()).setModalResult(true);
+ }
+ window.close(target);
+ } catch (Exception e) {
+ LOG.error("Failure managing resource {}", resourceTO, e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ add(form);
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getEntitlement("Resources",
+ createFlag
+ ? "create"
+ : "update"));
+ }
+
+ /**
+ * Generic resource event.
+ */
+ public static class ResourceEvent {
+
+ /**
+ * Request target.
+ */
+ private AjaxRequestTarget target;
+
+ /**
+ * Constructor.
+ *
+ * @param target request target.
+ */
+ public ResourceEvent(final AjaxRequestTarget target) {
+ this.target = target;
+ }
+
+ /**
+ * Target getter.
+ *
+ * @return request target.
+ */
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
new file mode 100644
index 0000000..c0ebfa0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Resources.java
@@ -0,0 +1,732 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel;
+import org.apache.syncope.client.console.panels.AjaxDataTablePanel;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+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.wicket.markup.html.form.LinkPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Resources WebPage.
+ */
+public class Resources extends BasePage {
+
+ private static final long serialVersionUID = -3789252860990261728L;
+
+ private static final int WIN_HEIGHT = 600;
+
+ private static final int WIN_WIDTH = 1100;
+
+ @SpringBean
+ private ConnectorRestClient connectorRestClient;
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private final ModalWindow createResourceWin;
+
+ private final ModalWindow editResourceWin;
+
+ private final ModalWindow createConnectorWin;
+
+ private final ModalWindow editConnectorWin;
+
+ private final int resourcePaginatorRows;
+
+ private final int connectorPaginatorRows;
+
+ private WebMarkupContainer resourceContainer;
+
+ private WebMarkupContainer connectorContainer;
+
+ /**
+ * Modal window to be used for user status management.
+ */
+ protected final ModalWindow statusmodal = new ModalWindow("statusModal");
+
+ /**
+ * Schemas to be shown modal window height.
+ */
+ private final static int STATUS_MODAL_WIN_HEIGHT = 500;
+
+ /**
+ * Schemas to be shown modal window width.
+ */
+ private final static int STATUS_MODAL_WIN_WIDTH = 700;
+
+ public Resources(final PageParameters parameters) {
+ super(parameters);
+
+ add(createResourceWin = new ModalWindow("createResourceWin"));
+ add(editResourceWin = new ModalWindow("editResourceWin"));
+ add(createConnectorWin = new ModalWindow("createConnectorWin"));
+ add(editConnectorWin = new ModalWindow("editConnectorWin"));
+
+ statusmodal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ statusmodal.setInitialHeight(STATUS_MODAL_WIN_HEIGHT);
+ statusmodal.setInitialWidth(STATUS_MODAL_WIN_WIDTH);
+ statusmodal.setCookieName("status-modal");
+ add(statusmodal);
+
+ AjaxLink<Void> reloadLink = new ClearIndicatingAjaxLink<Void>("reloadLink", getPageReference()) {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ try {
+ connectorRestClient.reload();
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (Exception e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ }
+ feedbackPanel.refresh(target);
+ target.add(connectorContainer);
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+
+ final AjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component component) {
+ return "if (!confirm('" + getString("confirmReloadConnectors") + "')) "
+ + "{return false;} else {return true;}";
+ }
+ };
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(reloadLink, ENABLE, xmlRolesReader.getEntitlement(
+ "Connectors", "reload"));
+ add(reloadLink);
+
+ resourcePaginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_RESOURCES_PAGINATOR_ROWS);
+ connectorPaginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_CONNECTORS_PAGINATOR_ROWS);
+
+ setupResources();
+ setupConnectors();
+ }
+
+ private void setupResources() {
+ List<IColumn<ResourceTO, String>> columns = new ArrayList<IColumn<ResourceTO, String>>();
+
+ columns.add(
+ new PropertyColumn<ResourceTO, String>(new StringResourceModel("name", this, null), "name", "name"));
+
+ columns.add(new AbstractColumn<ResourceTO, String>(
+ new StringResourceModel("connector", this, null, "connector")) {
+
+ private static final long serialVersionUID = 8263694778917279290L;
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId,
+ final IModel<ResourceTO> rowModel) {
+
+ final AjaxLink<String> editLink =
+ new ClearIndicatingAjaxLink<String>("link", getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+
+ editConnectorWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ConnectorModalPage(Resources.this.getPageReference(),
+ editConnectorWin,
+ connectorRestClient.read(rowModel.getObject().getConnectorId()));
+ }
+ });
+
+ editConnectorWin.show(target);
+ }
+ };
+ editLink.add(new Label("linkTitle", rowModel.getObject().getConnectorDisplayName()));
+
+ LinkPanel editConnPanel = new LinkPanel(componentId);
+ editConnPanel.add(editLink);
+
+ cellItem.add(editConnPanel);
+
+ MetaDataRoleAuthorizationStrategy.authorize(editConnPanel, ENABLE, xmlRolesReader.
+ getEntitlement(
+ "Connectors", "read"));
+ }
+ });
+
+ columns.add(new AbstractColumn<ResourceTO, String>(
+ new StringResourceModel("propagationPrimary", this, null)) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<ResourceTO>> item,
+ final String componentId, final IModel<ResourceTO> model) {
+
+ item.add(new Label(componentId, ""));
+ item.add(new AttributeModifier("class", new Model<String>(
+ Boolean.toString(model.getObject().isPropagationPrimary()))));
+ }
+
+ @Override
+ public String getCssClass() {
+ return "narrowcolumn";
+ }
+ });
+
+ columns.add(new PropertyColumn<ResourceTO, String>(new StringResourceModel(
+ "propagationPriority", this, null), "propagationPriority", "propagationPriority") {
+
+ @Override
+ public String getCssClass() {
+ return "narrowcolumn";
+ }
+ });
+
+ columns.add(new AbstractColumn<ResourceTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId,
+ final IModel<ResourceTO> model) {
+
+ final ResourceTO resourceTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ statusmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ProvisioningModalPage<>(
+ getPageReference(), statusmodal, model.getObject(), UserTO.class);
+ }
+ });
+
+ statusmodal.show(target);
+ }
+ }, ActionLink.ActionType.MANAGE_USERS, "Resources");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ statusmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ProvisioningModalPage<RoleTO>(
+ getPageReference(), statusmodal, model.getObject(), RoleTO.class);
+ }
+ });
+
+ statusmodal.show(target);
+ }
+ }, ActionLink.ActionType.MANAGE_ROLES, "Resources");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ resourceTO.setUsyncToken(null);
+ resourceTO.setRsyncToken(null);
+ try {
+ resourceRestClient.update(resourceTO);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ":" + e.getMessage());
+
+ LOG.error("While resetting sync token from " + resourceTO.getKey(), e);
+ }
+
+ feedbackPanel.refresh(target);
+ target.add(resourceContainer);
+ }
+ }, ActionLink.ActionType.RESET, "Resources");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ editResourceWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ResourceModalPage(Resources.this.getPageReference(),
+ editResourceWin, resourceTO, false);
+ }
+ });
+
+ editResourceWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Resources");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ resourceRestClient.delete(resourceTO.getKey());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+
+ LOG.error("While deleting resource " + resourceTO.getKey(), e);
+ }
+
+ feedbackPanel.refresh(target);
+ target.add(resourceContainer);
+ }
+ }, ActionLink.ActionType.DELETE, "Resources");
+
+ cellItem.add(panel);
+ }
+ });
+
+ final AjaxDataTablePanel<ResourceTO, String> table = new AjaxDataTablePanel<ResourceTO, String>(
+ "resourceDatatable",
+ columns,
+ (ISortableDataProvider<ResourceTO, String>) new ResourcesProvider(),
+ resourcePaginatorRows,
+ Arrays.asList(new ActionLink.ActionType[] { ActionLink.ActionType.DELETE }),
+ resourceRestClient,
+ "name",
+ "Resources",
+ getPageReference());
+
+ resourceContainer = new WebMarkupContainer("resourceContainer");
+ resourceContainer.add(table);
+ resourceContainer.setOutputMarkupId(true);
+
+ add(resourceContainer);
+
+ setWindowClosedCallback(createResourceWin, resourceContainer);
+ setWindowClosedCallback(editResourceWin, resourceContainer);
+
+ createResourceWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ createResourceWin.setInitialHeight(WIN_HEIGHT);
+ createResourceWin.setInitialWidth(WIN_WIDTH);
+ createResourceWin.setCookieName("create-res-modal");
+
+ editResourceWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editResourceWin.setInitialHeight(WIN_HEIGHT);
+ editResourceWin.setInitialWidth(WIN_WIDTH);
+ editResourceWin.setCookieName("edit-res-modal");
+
+ AjaxLink<Void> createResourceLink =
+ new ClearIndicatingAjaxLink<Void>("createResourceLink", getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ createResourceWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ final ResourceModalPage windows = new ResourceModalPage(Resources.this.
+ getPageReference(),
+ editResourceWin, new ResourceTO(), true);
+ return windows;
+ }
+ });
+
+ createResourceWin.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(createResourceLink, ENABLE, xmlRolesReader.getEntitlement(
+ "Resources", "create"));
+
+ add(createResourceLink);
+
+ @SuppressWarnings("rawtypes")
+ final Form paginatorForm = new Form("resourcePaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this,
+ "resourcePaginatorRows"), prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_RESOURCES_PAGINATOR_ROWS,
+ String.valueOf(resourcePaginatorRows));
+
+ table.setItemsPerPage(resourcePaginatorRows);
+ target.add(resourceContainer);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+ }
+
+ private void setupConnectors() {
+ List<IColumn<ConnInstanceTO, String>> columns = new ArrayList<IColumn<ConnInstanceTO, String>>();
+
+ columns.add(new PropertyColumn<ConnInstanceTO, String>(
+ new StringResourceModel("id", this, null), "id", "id"));
+ columns.add(new PropertyColumn<ConnInstanceTO, String>(
+ new StringResourceModel("name", this, null), "connectorName", "connectorName"));
+ columns.add(new PropertyColumn<ConnInstanceTO, String>(
+ new StringResourceModel("displayName", this, null), "displayName", "displayName"));
+ columns.add(new PropertyColumn<ConnInstanceTO, String>(
+ new StringResourceModel("bundleName", this, null), "bundleName", "bundleName"));
+ columns.add(new PropertyColumn<ConnInstanceTO, String>(
+ new StringResourceModel("version", this, null), "version", "version"));
+ columns.add(new AbstractColumn<ConnInstanceTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<ConnInstanceTO>> cellItem, final String componentId,
+ final IModel<ConnInstanceTO> model) {
+
+ final ConnInstanceTO connectorTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ editConnectorWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ConnectorModalPage(Resources.this.getPageReference(), editConnectorWin,
+ connectorTO);
+ }
+ });
+
+ editConnectorWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Connectors");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ connectorRestClient.delete(connectorTO.getKey());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+
+ LOG.error("While deleting connector " + connectorTO.getKey(), e);
+ }
+
+ target.add(connectorContainer);
+ feedbackPanel.refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, "Connectors");
+
+ cellItem.add(panel);
+ }
+ });
+
+ final AjaxDataTablePanel<ConnInstanceTO, String> table = new AjaxDataTablePanel<ConnInstanceTO, String>(
+ "connectorDatatable",
+ columns,
+ (ISortableDataProvider<ConnInstanceTO, String>) new ConnectorsProvider(),
+ connectorPaginatorRows,
+ Arrays.asList(new ActionLink.ActionType[] { ActionLink.ActionType.DELETE }),
+ connectorRestClient,
+ "id",
+ "Connectors",
+ getPageReference());
+
+ connectorContainer = new WebMarkupContainer("connectorContainer");
+ connectorContainer.add(table);
+ connectorContainer.setOutputMarkupId(true);
+
+ MetaDataRoleAuthorizationStrategy.authorize(connectorContainer, RENDER, xmlRolesReader.getEntitlement(
+ "Connectors", "list"));
+
+ add(connectorContainer);
+
+ setWindowClosedCallback(createConnectorWin, connectorContainer);
+ setWindowClosedCallback(editConnectorWin, connectorContainer);
+
+ createConnectorWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ createConnectorWin.setInitialHeight(WIN_HEIGHT);
+ createConnectorWin.setInitialWidth(WIN_WIDTH);
+ createConnectorWin.setCookieName("create-conn-modal");
+
+ editConnectorWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editConnectorWin.setInitialHeight(WIN_HEIGHT);
+ editConnectorWin.setInitialWidth(WIN_WIDTH);
+ editConnectorWin.setCookieName("edit-conn-modal");
+
+ AjaxLink<Void> createConnectorLink =
+ new ClearIndicatingAjaxLink<Void>("createConnectorLink", getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ createConnectorWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ ConnectorModalPage form = new ConnectorModalPage(Resources.this.getPageReference(),
+ editConnectorWin, new ConnInstanceTO());
+ return form;
+ }
+ });
+
+ createConnectorWin.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(createConnectorLink, ENABLE, xmlRolesReader.getEntitlement(
+ "Connectors", "create"));
+
+ add(createConnectorLink);
+
+ @SuppressWarnings("rawtypes")
+ Form paginatorForm = new Form("connectorPaginatorForm");
+
+ MetaDataRoleAuthorizationStrategy.authorize(paginatorForm, RENDER, xmlRolesReader.getEntitlement(
+ "Connectors", "list"));
+
+ final DropDownChoice<Integer> rowsChooser = new DropDownChoice<Integer>(
+ "rowsChooser",
+ new PropertyModel<Integer>(this,
+ "connectorPaginatorRows"),
+ prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_CONNECTORS_PAGINATOR_ROWS,
+ String.valueOf(connectorPaginatorRows));
+ table.setItemsPerPage(connectorPaginatorRows);
+
+ target.add(connectorContainer);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+ }
+
+ class ResourcesProvider extends SortableDataProvider<ResourceTO, String> {
+
+ private static final long serialVersionUID = -9055916672926643975L;
+
+ private final SortableDataProviderComparator<ResourceTO> comparator;
+
+ public ResourcesProvider() {
+ super();
+ //Default sorting
+ setSort("name", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<ResourceTO>(this);
+ }
+
+ @Override
+ public Iterator<ResourceTO> iterator(final long first, final long count) {
+ List<ResourceTO> list = getResourcesListDB();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return getResourcesListDB().size();
+ }
+
+ @Override
+ public IModel<ResourceTO> model(final ResourceTO resource) {
+ return new AbstractReadOnlyModel<ResourceTO>() {
+
+ private static final long serialVersionUID = 8952474152465381634L;
+
+ @Override
+ public ResourceTO getObject() {
+ return resource;
+ }
+ };
+ }
+
+ public List<ResourceTO> getResourcesListDB() {
+ return resourceRestClient.getAll();
+ }
+ }
+
+ private class ConnectorsProvider extends SortableDataProvider<ConnInstanceTO, String> {
+
+ private static final long serialVersionUID = 4445909568349448518L;
+
+ private final SortableDataProviderComparator<ConnInstanceTO> comparator;
+
+ public ConnectorsProvider() {
+ super();
+ //Default sorting
+ setSort("id", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<ConnInstanceTO>(this);
+ }
+
+ @Override
+ public Iterator<ConnInstanceTO> iterator(long first, long count) {
+ List<ConnInstanceTO> list = getConnectorsListDB();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return getConnectorsListDB().size();
+ }
+
+ @Override
+ public IModel<ConnInstanceTO> model(final ConnInstanceTO connector) {
+
+ return new AbstractReadOnlyModel<ConnInstanceTO>() {
+
+ private static final long serialVersionUID = -6033068018293569398L;
+
+ @Override
+ public ConnInstanceTO getObject() {
+ return connector;
+ }
+ };
+ }
+
+ public List<ConnInstanceTO> getConnectorsListDB() {
+ return connectorRestClient.getAllConnectors();
+ }
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof AbstractSearchResultPanel.EventDataWrapper) {
+ ((AbstractSearchResultPanel.EventDataWrapper) event.getPayload()).getTarget().add(resourceContainer);
+ ((AbstractSearchResultPanel.EventDataWrapper) event.getPayload()).getTarget().add(connectorContainer);
+ }
+ }
+}
[24/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_it.properties
new file mode 100644
index 0000000..9973e99
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_it.properties
@@ -0,0 +1,20 @@
+# 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.
+submit=Salva
+add=Aggiungi
+remove=Elimina
+cancel=Annulla
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_pt_BR.properties
new file mode 100644
index 0000000..bf17b75
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage_pt_BR.properties
@@ -0,0 +1,20 @@
+# 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.
+submit=Salvar
+add=Adicionar
+remove=Remover
+cancel=Cancelar
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
new file mode 100644
index 0000000..44b0e45
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+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>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="Content-Style-Type" content="text/css"/>
+ <meta http-equiv="Content-Script-Type" content="text/javascript"/>
+
+ <title>Apache Syncope</title>
+
+ <link rel="shortcut icon" href="img/favicon.ico" />
+
+ <style type="text/css">
+ div.wicket-modal div.w_caption {
+ height: 16px !important;
+ }
+ </style>
+ <link rel="stylesheet" type="text/css" href="webjars/jquery-ui/${jquery-ui.version}/themes/base/minified/jquery-ui.min.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/style.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/fieldstyle.css" />
+
+ <script type="text/javascript" src="webjars/jquery-ui/${jquery-ui.version}/ui/minified/jquery-ui.min.js"></script>
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#tabs").tabs();
+ });
+
+ /** Add rollover effect to tables supporting Ajax events */
+ $(document).on('mouseover mouseout', 'table.ui-widget.ui-widget-content.table-hover tbody tr',
+ function(event) {
+ if (event.type == 'mouseover') {
+ $(this).addClass('selectedRow');
+ } else if (event.type == 'mouseout') {
+ $(this).removeClass('selectedRow');
+ }
+ });
+
+ var notificationShownTimes = 0;
+
+ function showNotification(componentId, messagecount) {
+ notificationShownTimes++;
+ timeout = 1700 + (messagecount * 500) + notificationShownTimes * 200;
+ $('div#' + componentId).fadeTo('normal', 1.0);
+ setTimeout("$('div#" + componentId + "').fadeOut('normal')", timeout);
+ }
+ </script>
+ </head>
+ <body>
+ <div id="navigationPane">
+ <ul>
+ <li style="position: absolute; left: 0px; top: 10px;width:240px;">
+ <img src="img/logo.png" alt="logo"/><br />
+ </li>
+ <li><span>
+ <a href="#" wicket:id="todo"><img wicket:id="todoIcon" alt="TODO" width="80" height="80" /><br />
+ <wicket:message key="todo"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="schema"><img wicket:id="schemaIcon" alt="Schema" width="80" height="80" /><br />
+ <wicket:message key="schema"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="users"><img wicket:id="usersIcon" alt="Users" width="80" height="80" /><br />
+ <wicket:message key="users"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="roles"><img wicket:id="rolesIcon" alt="Roles" width="80" height="80" /><br />
+ <wicket:message key="roles"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="resources"><img wicket:id="resourcesIcon" alt="Resources" width="80" height="80" /><br />
+ <wicket:message key="resources"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="tasks"><img wicket:id="tasksIcon" alt="Tasks" width="80" height="80" /><br />
+ <wicket:message key="tasks"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="reports"><img wicket:id="reportsIcon" alt="Reports" width="80" height="80" /><br />
+ <wicket:message key="reports"/>
+ </a>
+ </span>
+ </li>
+ <li><span>
+ <a href="#" wicket:id="configuration"><img wicket:id="configurationIcon" alt="Configuration" width="80" height="80" /><br />
+ <wicket:message key="configuration"/>
+ </a></span>
+ </li>
+ <li style="float:right;width:auto;text-align:right;">
+ <a href="#" wicket:id="logout"><img src="img/menu/logout.png" alt="Logout" width="80" height="80" /><br /></a>
+ <div style="display: table-row;">
+ <div id="username" style="padding-right: 5px;width: 100px;cursor: pointer;display: table-cell;">
+ <a href="#" wicket:id="editProfileLink">
+ <span wicket:id="username" style="color: #B9CFB3;font-family: monospace;"/>
+ </a>
+ </div>
+ <div>
+ <div wicket:id="infoModal"/>
+ <a wicket:id="infoLink" style="vertical-align: middle;"><img src="img/info.png" alt="info" style="padding-right: 10px;"/></a>
+ </div>
+ </div>
+ </li>
+ </ul>
+ <div wicket:id="editProfileModal"></div>
+ </div>
+
+ <div wicket:id="feedback"/>
+
+ <wicket:child />
+
+ <div id="veil" style="display:none;position:absolute;top:0;left:0;z-index:99999;background-color:black;width:100%;height:20000px;color:white;opacity:0.3;filter:alpha(opacity=30);">
+ <img src="img/busy.gif" style="position:absolute;top:300px;left:50%;margin-left:-75px;width:150px;"/>
+ </div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
new file mode 100644
index 0000000..c40d8a5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+displayRows=Rows to display:
+home=Home
+version=VERSION
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
new file mode 100644
index 0000000..8560ce7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+displayRows=Righe per pagina:
+home=Home
+version=VERSIONE
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
new file mode 100644
index 0000000..97349d4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+displayRows=Linhas para mostrar\:
+home=In\u00EDcio
+version=VERS\u00C3O
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
new file mode 100644
index 0000000..fea606c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
@@ -0,0 +1,51 @@
+<!--
+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>
+
+ <link rel="stylesheet" type="text/css" href="webjars/jquery-ui/${jquery-ui.version}/themes/base/minified/jquery-ui.min.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/style.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/fieldstyle.css" media="all"/>
+
+ <style type="text/css">
+ table.palette td.header {
+ background:url("images/ui-bg_glass_75_e6e6e6_1x400.png")
+ repeat-x scroll 50% 50% #E6E6E6 !important;
+ }
+ </style>
+
+ <script type="text/javascript">
+ var notificationShownTimes = 0;
+
+ function showNotification(componentId, messagecount) {
+ notificationShownTimes++;
+ timeout = 1700 + (messagecount * 500) + notificationShownTimes * 200;
+ $('div#' + componentId).fadeTo('normal', 1.0);
+ setTimeout("$('div#" + componentId + "').fadeOut('normal')", timeout);
+ }
+ </script>
+ </head>
+ <body onload="setTimeout('window.focus();', 0);">
+ <div wicket:id="feedback"/>
+
+ <wicket:child />
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.html
new file mode 100644
index 0000000..9e5d497
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.html
@@ -0,0 +1,45 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
+ </wicket:head>
+ <wicket:extend>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+
+ <div id="selectedObjects">
+ <table class="ui-widget ui-widget-content table-hover pageRowElement" wicket:id="selectedObjects">[DataTable]</table>
+
+ <div id="actionRow" class="pageRowElement">
+ <div id="actions">
+ <div id="actionPanel" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <span wicket:id="actions">[Actions]</span>
+ </div>
+
+ <div id="cancelBtmForm">
+ <form wicket:id="form">
+ <input type="button" wicket:id="cancel" id="cancel"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"/>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.properties
new file mode 100644
index 0000000..bd28d80
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Bulk action
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_it.properties
new file mode 100644
index 0000000..3989422
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_it.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Operazioni di gruppo
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_pt_BR.properties
new file mode 100644
index 0000000..ec07d02
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionModalPage_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=A\u00E7\u00E3o Composta
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.html
new file mode 100644
index 0000000..16dd256
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.html
@@ -0,0 +1,57 @@
+<!--
+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.
+-->
+
+<!--
+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.
+-->
+<wicket:head>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
+</wicket:head>
+<wicket:extend>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+
+<div id="selectedObjects">
+ <table class="ui-widget ui-widget-content table-hover pageRowElement" wicket:id="selectedObjects">[DataTable]</table>
+
+ <div id="actionRow" class="pageRowElement">
+ <div id="actions">
+ <div id="cancelBtmForm" style="padding: 0px">
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="close">
+ <wicket:message key="close"/>
+ </a>
+ </div>
+ </div>
+ </div>
+</div>
+</wicket:extend>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.properties
new file mode 100644
index 0000000..7ba550c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Bulk Action Result
+close=Close
+bulkActionResultLabel=Result
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_it.properties
new file mode 100644
index 0000000..4268c00
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Risultato esecuzion Bulk Action
+close=Chiudi
+bulkActionResultLabel=Esito
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_pt_BR.properties
new file mode 100644
index 0000000..00c3a51
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BulkActionResultModalPage_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Resultado da A\u00E7\u00E3o Composta
+close=Fechar
+bulkActionResultLabel=Implantar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.html
new file mode 100644
index 0000000..4ce5575
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.html
@@ -0,0 +1,39 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/>
+ </p>
+ <form wicket:id="confForm">
+ <span wicket:id="paramAttrs"/>
+
+ <div style="bottom:0;margin:10px">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="submit"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.properties
new file mode 100644
index 0000000..363bef4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Parameters
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_it.properties
new file mode 100644
index 0000000..0fd85ae
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_it.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Parametri
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_pt_BR.properties
new file mode 100644
index 0000000..e7f3992
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfModalPage_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Par\u00e2metros
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
new file mode 100644
index 0000000..130c89a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
@@ -0,0 +1,236 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $("#policies").tabs();
+ $("#logs").tabs();
+ $("#layouts").tabs();
+ });
+ </script>
+ </wicket:head>
+
+ <wicket:extend>
+
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#layouts"><span><wicket:message key="layouts"/></span></a>
+ </li>
+ <li><a href="#policies"><span><wicket:message key="policies"/></span></a></li>
+ <li><a href="#notifications"><span><wicket:message key="notifications"/></span></a></li>
+ <li><a href="#securityQuestions"><span><wicket:message key="securityQuestions"/></span></a></li>
+ <li><a href="#workflow"><span><wicket:message key="workflow"/></span></a></li>
+ <li wicket:id="routeTab"><a href="#routes"><span><wicket:message key="routes"/></span></a></li>
+ <li><a href="#logs"><span><wicket:message key="logs"/></span></a></li>
+ </ul>
+ <div id="layouts">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#adminUser"><span><wicket:message key="adminUser"/></span></a>
+ </li>
+ <li><a href="#selfUser"><span><wicket:message key="selfUser"/></span></a></li>
+ <li><a href="#adminRole"><span><wicket:message key="adminRole"/></span></a></li>
+ <li><a href="#selfRole"><span><wicket:message key="selfRole"/></span></a></li>
+ <li><a href="#adminMembership"><span><wicket:message key="adminMembership"/></span></a></li>
+ <li><a href="#selfMembership"><span><wicket:message key="selfMembership"/></span></a></li>
+ </ul>
+ <div id="adminUser" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="adminUserLayoutPanel">[admin user layout panel]</span>
+ </div>
+ <div id="selfUser" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="selfUserLayoutPanel">[self user layout panel]</span>
+ </div>
+ <div id="adminRole" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="adminRoleLayoutPanel">[admin role layout panel]</span>
+ </div>
+ <div id="selfRole" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="selfRoleLayoutPanel">[self role layout panel]</span>
+ </div>
+ <div id="adminMembership" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="adminMembershipLayoutPanel">[admin membership layout panel]</span>
+ </div>
+ <div id="selfMembership" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="selfMembershipLayoutPanel">[self membership layout panel]</span>
+ </div>
+ </div>
+ <div id="policies">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#account"><span><wicket:message key="account"/></span></a>
+ </li>
+ <li><a href="#password"><span><wicket:message key="password"/></span></a></li>
+ <li><a href="#sync"><span><wicket:message key="sync"/></span></a></li>
+ </ul>
+ <div id="account" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="accountPoliciesPanel">[account policies]</span>
+ </div>
+ <div id="password" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="passwordPoliciesPanel">[password policies]</span>
+ </div>
+ <div id="sync" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="syncPoliciesPanel">[sync policies]</span>
+ </div>
+ </div>
+ <div id="notifications">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="notificationContainer">
+ <table class="ui-widget ui-widget-content table-hover"
+ wicket:id="notificationTable"/>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="notificationPaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="createNotificationWin">[Show modal window for creating notification]</div>
+ <div wicket:id="editNotificationWin">[Show modal window for editing notification]</div>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createNotificationLink">
+ <wicket:message key="create"/>
+ </a>
+ </div>
+ <div id="securityQuestions">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="securityQuestionContainer">
+ <table class="ui-widget ui-widget-content table-hover"
+ wicket:id="securityQuestionTable"/>
+ </span>
+ </div>
+
+ <div wicket:id="createSecurityQuestionWin">[Show modal window for creating security questions]</div>
+ <div wicket:id="editSecurityQuestionWin">[Show modal window for editing security questions]</div>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createSecurityQuestionLink">
+ <wicket:message key="create"/>
+ </a>
+ </div>
+ <div id="workflow">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="noActivitiEnabledForUsers"><i><wicket:message key="noActivitiEnabledForUsers"/></i></span>
+ <span wicket:id="workflowDefContainer">
+ <div style="float: left;">
+ <button wicket:id="activitiModeler" style="width: 122px">
+ <div style="display: table-row;">
+ <div style="display: table-cell">
+ <img src="img/modeler.png" alt="Activiti Modeler" title="Activiti Modeler"/>
+ </div>
+ <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
+ Activiti Modeler
+ </div>
+ </div>
+ </button>
+ </div>
+ <div>
+ <button wicket:id="xmlEditor" style="width: 122px">
+ <div style="display: table-row;">
+ <div style="display: table-cell">
+ <img src="img/xml.png" alt="XML editor" title="XML editor"/>
+ </div>
+ <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
+ XML editor
+ </div>
+ </div>
+ </button>
+ </div>
+ <img wicket:id="workflowDefDiagram" style="width: 100%;"/>
+ </span>
+ </div>
+ </div>
+ <div id="routes">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="routesContainer">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="routeTable"/>
+ </span>
+ </div>
+ <div wicket:id="editRouteWin">[Show modal window for editing route]</div>
+ </div>
+ <div id="logs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#core"><span>Core</span></a>
+ </li>
+ <li><a href="#console"><span>Console</span></a></li>
+ </ul>
+ <div id="core" style="border-width: 1px;border-top-width: 0px;">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="coreLoggerContainer">
+ <table class="ui-widget ui-widget-content table-hover">
+ <thead class="ui-widget-header">
+ <tr class="heaaders">
+ <th><wicket:message key="logger"/></th>
+ <th><wicket:message key="level"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="corelogger">
+ <td><span wicket:id="name"/></td>
+ <td id="level"><select wicket:id="level"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+ <div id="console" style="border-width: 1px;border-top-width: 0px;">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="consoleLoggerContainer">
+ <table class="ui-widget ui-widget-content table-hover">
+ <thead class="ui-widget-header">
+ <tr class="heaaders">
+ <th><wicket:message key="logger"/></th>
+ <th><wicket:message key="level"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="consolelogger">
+ <td><span wicket:id="name"/></td>
+ <td id="level"><select wicket:id="level"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div wicket:id="parameters">
+ <a style="position: absolute; top: 2px; right:50px;" wicket:id="confLink">
+ <img src="img/actions/settings-icon.png" width="30" height="30"
+ alt="Parameters" title="title" wicket:message="title:parameters"/>
+ </a>
+ </div>
+ <div wicket:id="syncopeConfWin">[Show modal window for conf parameters]</div>
+
+ <a style="position: absolute; top: 2px; right:20px;" wicket:id="dbExportLink">
+ <img src="img/db_export.png" width="30" height="30"
+ alt="DB export" title="title" wicket:message="title:db_export"/>
+ </a>
+ </div>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
new file mode 100644
index 0000000..f59b50f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+parameters=Parameters
+password=Password
+account=Account
+sync=Synchronization
+notifications=Notifications
+workflow=Workflow
+coreLog=Core Log
+consoleLog=Console Log
+edit=Edit
+delete=Delete
+db_export=DB export
+logger=Logger
+level=Level
+events=Events
+template=Template
+traceLevel=Trace level
+subject=Subject
+noActivitiEnabledForUsers=Activiti not enabled for users
+policies=Policies
+logs=Logs
+active=Enabled
+apply=Save
+securityQuestions=Security Questions
+content=Text
+layouts=Layouts
+adminUser=Administrator User Form
+selfUser=Self User Form
+adminRole=Administrator Role Form
+selfRole=Self Role Form
+adminMembership=Administrator Membership Form
+selfMembership=Self Membership Form
+routes=Routes
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_it.properties
new file mode 100644
index 0000000..4969e24
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_it.properties
@@ -0,0 +1,47 @@
+# 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.
+parameters=Parametri
+password=Password
+account=Account
+sync=Sincronizzazione
+notifications=Notifiche
+workflow=Workflow
+coreLog=Log Core
+consoleLog=Log Console
+edit=Modifica
+delete=Rimuovi
+db_export=Esportazione DB
+logger=Logger
+level=Livello
+events=Eventi
+template=Modello
+traceLevel=Tracciamento
+subject=Oggetto
+noActivitiEnabledForUsers=Activiti non configurato per gli utenti
+policies=Politiche
+logs=Logs
+active=Abilitata
+apply=Salva
+securityQuestions=Domande di sicurezza
+content=Testo
+layouts=Layouts
+adminUser=Form Amministrazione Utente
+selfUser=Form Utente
+adminRole=Form Amministrazione Ruolo
+selfRole=Form Ruolo
+adminMembership=Form Amministrazione Membership
+selfMembership=Form Membership
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_pt_BR.properties
new file mode 100644
index 0000000..cc2dd2b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration_pt_BR.properties
@@ -0,0 +1,47 @@
+# 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.
+parameters=Par\u00e2metros
+password=Senha
+account=Conta
+sync=Sincroniza\u00e7\u00e3o
+notifications=Notifica\u00e7\u00f5es
+workflow=Fluxo de Trabalho
+coreLog=Log Central
+consoleLog=Log do Console
+edit=Editar
+delete=Excluir
+db_export=Exportar Banco de Dados
+logger=Logger
+level=N\u00edvel
+events=Eventos
+template=Template
+traceLevel=N\u00edvel de Trace
+subject=Assunto
+noActivitiEnabledForUsers=Activiti n\u00e3o habilitado para usu\u00e1rios
+policies=Pol\u00edticas
+logs=Logs
+active=Ativada
+apply=Salvar
+securityQuestions=Quest\u00f5es de seguran\u00e7a
+content=Texto
+layouts=Layouts
+adminUser=Forma do usu\u00e1rio de administra\u00e7\u00e3o
+selfUser=Forma Usu\u00e1rio
+adminRole=Forma Fun\u00e7\u00e3o de administra\u00e7\u00e3o
+selfRole=Form Fun\u00e7\u00e3o
+adminMembership=Forma de membro de administra\u00e7\u00e3o
+selfMembership=Forma Membro
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.html
new file mode 100644
index 0000000..2471b30
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.html
@@ -0,0 +1,55 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="password"><wicket:message key="password"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="password">[password]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="confirmPassword"><wicket:message key="confirmPassword"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="confirmPassword">[confirmPassword]</span>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.properties
new file mode 100644
index 0000000..eb8d9f6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Password reset
+submit=Submit
+password=Password
+confirmPassword=Password (confirm)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_it.properties
new file mode 100644
index 0000000..2254365
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_it.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Password smarrita
+submit=Invia
+password=Password
+confirmPassword=Password (conferma)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_pt_BR.properties
new file mode 100644
index 0000000..fa270b9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage_pt_BR.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Redefini\u00e7\u00e3o de senha
+submit=Apresentar
+password=Senha
+confirmPassword=Senha (confirmar)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.html
new file mode 100644
index 0000000..e6d4676
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.html
@@ -0,0 +1,39 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow" wicket:id="propView">
+ <div class="tablecolumn_label medium_dynamicsize">
+ <span wicket:id="key">[key]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="value">[value]</span>
+
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.properties
new file mode 100644
index 0000000..109326f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Resource data
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_it.properties
new file mode 100644
index 0000000..0f4f94f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_it.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Dati sulla risorsa
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_pt_BR.properties
new file mode 100644
index 0000000..daca223
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnObjectModalPage_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Dados do Recurso
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
new file mode 100644
index 0000000..2507acf
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
@@ -0,0 +1,159 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#tabs-1"><span><wicket:message key="tab1"/></span></a></li>
+ <li><a href="#tabs-2"><span><wicket:message key="tab2"/></span></a></li>
+ <li><a href="#tabs-3"><span><wicket:message key="tab3"/></span></a></li>
+ </ul>
+ <div id="tabs-1">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="displayName"><wicket:message key="displayName"/></label>
+ </div>
+ <div class="tablecolumn_field short_dynamicsize">
+ <span wicket:id="displayName">[displayName]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="location"><wicket:message key="location"/></label>
+ </div>
+ <div class="tablecolumn_field short_dynamicsize">
+ <span wicket:id="location">[location]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="connectorName">[connectorName]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="version"><wicket:message key="version"/></label>
+ </div>
+ <div class="tablecolumn_field short_dynamicsize">
+ <span wicket:id="version">[version]</span>
+ </div>
+ </div>
+ </div>
+ <div style="display: table; border: 1px solid #BBBBBB;">
+ <div class="tablerow2 alt">
+ <div class="tablecolumn2_label short_dynamicsize">
+ <label for="connRequestTimeout"><wicket:message key="connRequestTimeout"/></label>
+ </div>
+ <div class="tablecolumn2_field short_dynamicsize">
+ <span wicket:id="connRequestTimeout">[connRequestTimeout]</span>
+ </div>
+ <div class="tablecolumn2_label short_dynamicsize">
+ <label for="poolMaxObjects"><wicket:message key="poolMaxObjects"/></label>
+ </div>
+ <div class="tablecolumn2_field short_dynamicsize">
+ <span wicket:id="poolMaxObjects">[poolMaxObjects]</span>
+ </div>
+ </div>
+ <div class="tablerow2">
+ <div class="tablecolumn2_label short_dynamicsize">
+ <label for="poolMinIdle"><wicket:message key="poolMinIdle"/></label>
+ </div>
+ <div class="tablecolumn2_field short_dynamicsize">
+ <span wicket:id="poolMinIdle">[poolMinIdle]</span>
+ </div>
+ <div class="tablecolumn2_label short_dynamicsize">
+ <label for="poolMaxIdle"><wicket:message key="poolMaxIdle"/></label>
+ </div>
+ <div class="tablecolumn2_field short_dynamicsize">
+ <span wicket:id="poolMaxIdle">[poolMaxIdle]</span>
+ </div>
+ </div>
+ <div class="tablerow2 alt">
+ <div class="tablecolumn2_label short_dynamicsize">
+ <label for="poolMaxWait"><wicket:message key="poolMaxWait"/></label>
+ </div>
+ <div class="tablecolumn2_field short_dynamicsize">
+ <span wicket:id="poolMaxWait">[poolMaxWait]</span>
+ </div>
+ <div class="tablecolumn2_label short_dynamicsize">
+ <label for="poolMinEvictableIdleTime"><wicket:message key="poolMinEvictableIdleTime"/></label>
+ </div>
+ <div class="tablecolumn2_field short_dynamicsize">
+ <span wicket:id="poolMinEvictableIdleTime">[poolMinEvictableIdleTime]</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="tabs-2">
+ <div id="formtable">
+ <span wicket:id="container">
+ <div style="border-bottom: 10px">
+ <div style="width: 40px; text-align: center; font-size: 7px">
+ <label for="version"><wicket:message key="overridable"/></label>
+ </div>
+ </div>
+ <form wicket:id="connectorPropForm">
+ <div class="tablerow connectorProp" wicket:id="connectorProperties">
+ <div class="tablecolumn_check" style="width: 27px; text-align: center; margin-right: 10px">
+ <span wicket:id="connPropAttrOverridable">[connPropAttrOverridable]</span>
+ </div>
+ <div class="tablecolumn_connPropAttr">
+ <span wicket:id="connPropAttrSchema">[connPropAttrSchema]</span>
+ </div>
+ <div class="tablecolumn_field veryshort_fixedsize">
+ <span wicket:id="panel">[panel]</span>
+ </div>
+ </div>
+ <div>
+ <a style="position: absolute; top: 2px; right:20px;" wicket:id="check">
+ <img src="img/ping.png"width="30" height="30"
+ alt="ping" title="title" wicket:message="title:check"/>
+ </a>
+ </div>
+ </form>
+ </span>
+ </div>
+ </div>
+ <div id="tabs-3">
+ <span wicket:id="capabilitiesPalette"/>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
new file mode 100644
index 0000000..5ded4ac
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
@@ -0,0 +1,42 @@
+# 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.
+tab1=General
+tab2=Configuration
+tab3=Capabilities
+displayName=Display name
+bundleName=Bundle name
+version=Version
+connRequestTimeout=Request timeout (sec)
+action=Action
+edit=Edit
+edit_attribute=Edit attribute
+serviceName=Service name
+endpoint=Endpoint
+title=Connectors
+overridable=Overridable
+property=Property
+value=Value
+
+success_connection=Successful connection
+error_connection=Connection failure
+check=Check connection
+location=Location
+poolMaxObjects=Max objects (idle+active)
+poolMinIdle=Min idle objects
+poolMaxIdle=Max idle objects
+poolMaxWait=Max waiting time (msec)
+poolMinEvictableIdleTime=Min eviction time (msec)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
new file mode 100644
index 0000000..4c329af
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
@@ -0,0 +1,42 @@
+# 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.
+tab1=Generale
+tab2=Configurazione
+tab3=Capabilities
+bundleName=Bundle name
+version=Versione
+connRequestTimeout=Timeout richiesta (sec)
+action=Azione
+edit=Edit
+edit_attribute=Edit attribute
+serviceName=Nome servizio
+endpoint=Endpoint
+title=Connettori
+displayName=Nome visualizzato
+overridable=Sovrascrivibile
+property=Propriet\u00e0
+value=Valore
+
+success_connection=Connessione avvenuta con successo
+error_connection=Connessione non riuscita
+check=Verifica connessione
+location=Posizione
+poolMaxObjects=Max oggetti (attivi e non)
+poolMinIdle=Max oggetti attivi
+poolMaxIdle=Max oggetti inattivi
+poolMaxWait=Tempo max attesa
+poolMinEvictableIdleTime=Tempo min espulsione
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
new file mode 100644
index 0000000..30a7e4a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
@@ -0,0 +1,42 @@
+# 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.
+tab1=Geral
+tab2=Configura\u00e7\u00e3o
+tab3=Capacidades
+displayName=Mostrar Nome
+bundleName=Nome do Pacote
+version=Vers\u00e3o
+connRequestTimeout=Timeout da Requisi\u00e7\u00e3o (seg)
+action=A\u00e7\u00e3o
+edit=Alterar
+edit_attribute=Alterar Atributo
+serviceName=Nome de Servi\u00e7o
+endpoint=Endpoint
+title=Conectores
+overridable=Alter\u00e1vel
+property=Propriedade
+value=Valor
+
+success_connection=Sucesso na Conex\u00e3o
+error_connection=Falha na Conex\u00e3o
+check=Verificar a Conex\u00e3o
+location=Localiza\u00e7\u00e3o
+poolMaxObjects=Max objects (idle+active)
+poolMinIdle=Min idle objects
+poolMaxIdle=Max idle objects
+poolMaxWait=Max waiting time (msec)
+poolMinEvictableIdleTime=Min eviction time (msec)
[29/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java
new file mode 100644
index 0000000..ddab7af
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.io.Serializable;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.search.OrderByClauseBuilder;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class BaseRestClient implements Serializable {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(BaseRestClient.class);
+
+ private static final long serialVersionUID = 1523999867826481989L;
+
+ protected <T> T getAnonymousService(final Class<T> serviceClass) {
+ return SyncopeSession.get().getAnonymousService(serviceClass);
+ }
+
+ protected <T> T getService(final Class<T> serviceClass) {
+ return SyncopeSession.get().getService(serviceClass);
+ }
+
+ protected <T> T getService(final String etag, final Class<T> serviceClass) {
+ return SyncopeSession.get().getService(etag, serviceClass);
+ }
+
+ protected <T> void resetClient(final Class<T> serviceClass) {
+ SyncopeSession.get().resetClient(serviceClass);
+ }
+
+ protected String toOrderBy(final SortParam<String> sort) {
+ OrderByClauseBuilder builder = SyncopeClient.getOrderByClauseBuilder();
+
+ String property = sort.getProperty();
+ if (property.indexOf('#') != -1) {
+ property = property.substring(property.indexOf('#') + 1);
+ }
+
+ if (sort.isAscending()) {
+ builder.asc(property);
+ } else {
+ builder.desc(property);
+ }
+
+ return builder.build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
new file mode 100644
index 0000000..9d09984
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConfigurationRestClient.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.Iterator;
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.client.console.commons.AttrLayoutType;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConfTO;
+import org.apache.syncope.common.rest.api.service.ConfigurationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ConfigurationRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 7692363064029538722L;
+
+ @Autowired
+ private SchemaRestClient schemaRestClient;
+
+ public ConfTO list() {
+ ConfTO conf = getService(ConfigurationService.class).list();
+
+ for (Iterator<AttrTO> it = conf.getPlainAttrs().iterator(); it.hasNext();) {
+ AttrTO attr = it.next();
+ for (AttrLayoutType type : AttrLayoutType.values()) {
+ if (type.getConfKey().equals(attr.getSchema())) {
+ it.remove();
+ }
+ }
+ }
+
+ return conf;
+ }
+
+ public AttrTO read(final String key) {
+ try {
+ return getService(ConfigurationService.class).read(key);
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading a configuration schema", e);
+ }
+ return null;
+ }
+
+ public AttrTO readAttrLayout(final AttrLayoutType type) {
+ if (type == null) {
+ return null;
+ }
+
+ AttrTO attrLayout = read(type.getConfKey());
+ if (attrLayout == null) {
+ attrLayout = new AttrTO();
+ attrLayout.setSchema(type.getConfKey());
+ }
+ if (attrLayout.getValues().isEmpty()) {
+ attrLayout.getValues().addAll(schemaRestClient.getSchemaNames(type.getAttrType()));
+ }
+
+ return attrLayout;
+ }
+
+ public void set(final AttrTO attributeTO) {
+ getService(ConfigurationService.class).set(attributeTO.getSchema(), attributeTO);
+ }
+
+ public void delete(final String key) {
+ getService(ConfigurationService.class).delete(key);
+ }
+
+ public List<String> getMailTemplates() {
+ return SyncopeSession.get().getSyncopeTO().getMailTemplates();
+ }
+
+ public Response dbExport() {
+ return getService(ConfigurationService.class).export();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
new file mode 100644
index 0000000..d9a729d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
@@ -0,0 +1,217 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.rest.api.service.ConnectorService;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Connectors services.
+ */
+@Component
+public class ConnectorRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -6870366819966266617L;
+
+ public List<ConnInstanceTO> getAllConnectors() {
+ List<ConnInstanceTO> connectors = Collections.<ConnInstanceTO>emptyList();
+ try {
+ connectors = getService(ConnectorService.class).list(SyncopeSession.get().getLocale().toString());
+ } catch (Exception e) {
+ LOG.error("While reading connectors", e);
+ }
+ return connectors;
+ }
+
+ public void create(final ConnInstanceTO connectorTO) {
+ Set<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConfiguration());
+ connectorTO.getConfiguration().clear();
+ connectorTO.getConfiguration().addAll(filteredConf);
+ getService(ConnectorService.class).create(connectorTO);
+ }
+
+ /**
+ * Load an already existent connector by its name.
+ *
+ * @param connectorInstanceId the id
+ * @return ConnInstanceTO
+ */
+ public ConnInstanceTO read(final Long connectorInstanceId) {
+ ConnInstanceTO connectorTO = null;
+
+ try {
+ connectorTO = getService(ConnectorService.class).read(connectorInstanceId);
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading a connector", e);
+ }
+
+ return connectorTO;
+ }
+
+ public void update(final ConnInstanceTO connectorTO) {
+ Set<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConfiguration());
+ connectorTO.getConfiguration().clear();
+ connectorTO.getConfiguration().addAll(filteredConf);
+ getService(ConnectorService.class).update(connectorTO.getKey(), connectorTO);
+ }
+
+ public ConnInstanceTO delete(final Long id) {
+ ConnInstanceTO instanceTO = getService(ConnectorService.class).read(id);
+ getService(ConnectorService.class).delete(id);
+ return instanceTO;
+ }
+
+ public List<ConnBundleTO> getAllBundles() {
+ List<ConnBundleTO> bundles = Collections.<ConnBundleTO>emptyList();
+
+ try {
+ bundles = getService(ConnectorService.class).getBundles(SyncopeSession.get().getLocale().toString());
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting connector bundles", e);
+ }
+
+ return bundles;
+ }
+
+ /**
+ * Get all configuration properties for the given connector instance.
+ *
+ * @param connectorId the connector id
+ * @return List of ConnConfProperty, or an empty list in case none found
+ */
+ public List<ConnConfProperty> getConnectorProperties(final Long connectorId) {
+ List<ConnConfProperty> properties = null;
+
+ try {
+ properties = getService(ConnectorService.class).getConfigurationProperties(connectorId);
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting connector configuration properties", e);
+ }
+
+ return properties;
+ }
+
+ private Set<ConnConfProperty> filterProperties(final Set<ConnConfProperty> properties) {
+ Set<ConnConfProperty> newProperties = new HashSet<ConnConfProperty>();
+
+ for (ConnConfProperty property : properties) {
+ ConnConfProperty prop = new ConnConfProperty();
+ prop.setSchema(property.getSchema());
+ prop.setOverridable(property.isOverridable());
+
+ final List<Object> parsed = new ArrayList<Object>();
+ if (property.getValues() != null) {
+ for (Object obj : property.getValues()) {
+ if (obj != null && !obj.toString().isEmpty()) {
+ parsed.add(obj);
+ }
+ }
+ }
+ prop.getValues().addAll(parsed);
+ newProperties.add(prop);
+ }
+ return newProperties;
+ }
+
+ /**
+ * Test connector connection.
+ *
+ * @param connectorTO connector
+ * @return Connection status
+ */
+ public boolean check(final ConnInstanceTO connectorTO) {
+ ConnInstanceTO toBeChecked = new ConnInstanceTO();
+ BeanUtils.copyProperties(connectorTO, toBeChecked, new String[] { "configuration", "configurationMap" });
+ toBeChecked.getConfiguration().addAll(filterProperties(connectorTO.getConfiguration()));
+
+ boolean check = false;
+ try {
+ check = getService(ConnectorService.class).check(toBeChecked);
+ } catch (Exception e) {
+ LOG.error("While checking {}", toBeChecked, e);
+ }
+
+ return check;
+ }
+
+ public boolean check(final ResourceTO resourceTO) {
+ boolean check = false;
+ try {
+ check = getService(ResourceService.class).check(resourceTO);
+ } catch (Exception e) {
+ LOG.error("Connector not found {}", resourceTO.getConnectorId(), e);
+ }
+
+ return check;
+ }
+
+ public List<String> getSchemaNames(final ConnInstanceTO connectorTO) {
+ List<String> schemaNames = new ArrayList<String>();
+ try {
+ List<PlainSchemaTO> response = getService(ConnectorService.class).
+ getSchemaNames(connectorTO.getKey(), connectorTO, false);
+ for (PlainSchemaTO schema : response) {
+ schemaNames.add(schema.getKey());
+ }
+ } catch (Exception e) {
+ LOG.error("While getting schema names", e);
+ } finally {
+ // re-order schema names list
+ Collections.sort(schemaNames);
+ }
+
+ return schemaNames;
+ }
+
+ public List<ConnIdObjectClassTO> getSupportedObjectClasses(final ConnInstanceTO connectorTO) {
+ List<ConnIdObjectClassTO> result = Collections.emptyList();
+ try {
+ result = getService(ConnectorService.class).getSupportedObjectClasses(connectorTO.getKey(), connectorTO);
+ } catch (Exception e) {
+ LOG.error("While getting supported object classes", e);
+ }
+
+ return result;
+ }
+
+ public void reload() {
+ getService(ConnectorService.class).reload();
+ }
+
+ public BulkActionResult bulkAction(final BulkAction action) {
+ return getService(ConnectorService.class).bulk(action);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ExecutionRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ExecutionRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ExecutionRestClient.java
new file mode 100644
index 0000000..f78a682
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ExecutionRestClient.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+public interface ExecutionRestClient {
+
+ void startExecution(long executionCollectorId);
+
+ void deleteExecution(long executionId);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/InvalidPolicyType.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/InvalidPolicyType.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/InvalidPolicyType.java
new file mode 100644
index 0000000..6c7959c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/InvalidPolicyType.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+public class InvalidPolicyType extends RuntimeException {
+
+ private static final long serialVersionUID = -1230154509336169378L;
+
+ public InvalidPolicyType() {
+ }
+
+ public InvalidPolicyType(final String msg) {
+ super(msg);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
new file mode 100644
index 0000000..a8b40ac
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.to.LoggerTO;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+import org.apache.syncope.common.lib.types.LoggerLevel;
+import org.apache.syncope.common.lib.types.LoggerType;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.LoggerService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LoggerRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 4579786978763032240L;
+
+ public List<LoggerTO> listLogs() {
+ return getService(LoggerService.class).list(LoggerType.LOG);
+ }
+
+ public List<AuditLoggerName> listAudits() {
+ return CollectionWrapper.wrapLogger(getService(LoggerService.class).list(LoggerType.AUDIT));
+ }
+
+ public Map<String, Set<AuditLoggerName>> listAuditsByCategory() {
+ Map<String, Set<AuditLoggerName>> result = new HashMap<String, Set<AuditLoggerName>>();
+ for (AuditLoggerName auditLoggerName : listAudits()) {
+ if (!result.containsKey(auditLoggerName.getCategory())) {
+ result.put(auditLoggerName.getCategory(), new HashSet<AuditLoggerName>());
+ }
+
+ result.get(auditLoggerName.getCategory()).add(auditLoggerName);
+ }
+
+ return result;
+ }
+
+ public void setLogLevel(final String name, final LoggerLevel level) {
+ LoggerTO loggerTO = new LoggerTO();
+ loggerTO.setKey(name);
+ loggerTO.setLevel(level);
+ getService(LoggerService.class).update(LoggerType.LOG, name, loggerTO);
+ }
+
+ public void enableAudit(final AuditLoggerName auditLoggerName) {
+ String name = auditLoggerName.toLoggerName();
+ LoggerTO loggerTO = new LoggerTO();
+ loggerTO.setKey(name);
+ loggerTO.setLevel(LoggerLevel.DEBUG);
+ getService(LoggerService.class).update(LoggerType.AUDIT, name, loggerTO);
+ }
+
+ public void deleteLog(final String name) {
+ getService(LoggerService.class).delete(LoggerType.LOG, name);
+ }
+
+ public void disableAudit(final AuditLoggerName auditLoggerName) {
+ getService(LoggerService.class).delete(LoggerType.AUDIT, auditLoggerName.toLoggerName());
+ }
+
+ public List<EventCategoryTO> listEvents() {
+ try {
+ return getService(LoggerService.class).events();
+ } catch (Exception e) {
+ return Collections.<EventCategoryTO>emptyList();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/NotificationRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/NotificationRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/NotificationRestClient.java
new file mode 100644
index 0000000..687ade0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/NotificationRestClient.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.rest.api.service.NotificationService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class NotificationRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 6328933265096511690L;
+
+ public List<NotificationTO> getAllNotifications() {
+ return getService(NotificationService.class).list();
+ }
+
+ public NotificationTO read(final Long id) {
+ return getService(NotificationService.class).read(id);
+ }
+
+ public void create(final NotificationTO notificationTO) {
+ getService(NotificationService.class).create(notificationTO);
+ }
+
+ public void update(final NotificationTO notificationTO) {
+ getService(NotificationService.class).update(notificationTO.getKey(), notificationTO);
+ }
+
+ public void delete(final Long id) {
+ getService(NotificationService.class).delete(id);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
new file mode 100644
index 0000000..eb9e7cb
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.to.AbstractPolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.rest.api.service.PolicyService;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Policy services.
+ */
+@Component
+public class PolicyRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -1392090291817187902L;
+
+ public <T extends AbstractPolicyTO> T getGlobalPolicy(final PolicyType type) {
+ T policy = null;
+ try {
+ policy = getService(PolicyService.class).readGlobal(type);
+ } catch (Exception e) {
+ LOG.warn("No global " + type + " policy found", e);
+ }
+ return policy;
+ }
+
+ public <T extends AbstractPolicyTO> T getPolicy(final Long id) {
+ T policy = null;
+ try {
+ policy = getService(PolicyService.class).read(id);
+ } catch (Exception e) {
+ LOG.warn("No policy found for id {}", id, e);
+ }
+ return policy;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends AbstractPolicyTO> List<T> getPolicies(final PolicyType type, final boolean includeGlobal) {
+ final List<T> res = new ArrayList<>();
+
+ try {
+ res.addAll((List<T>) getService(PolicyService.class).list(type));
+ } catch (Exception ignore) {
+ LOG.debug("No policy found", ignore);
+ }
+
+ if (includeGlobal) {
+ try {
+ AbstractPolicyTO globalPolicy = getGlobalPolicy(type);
+ if (globalPolicy != null) {
+ res.add(0, (T) globalPolicy);
+ }
+ } catch (Exception ignore) {
+ LOG.warn("No global policy found", ignore);
+ }
+ }
+
+ return res;
+ }
+
+ public <T extends AbstractPolicyTO> void createPolicy(final T policy) {
+ getService(PolicyService.class).create(policy);
+ }
+
+ public <T extends AbstractPolicyTO> void updatePolicy(final T policy) {
+ getService(PolicyService.class).update(policy.getKey(), policy);
+ }
+
+ public void delete(final Long id, final Class<? extends AbstractPolicyTO> policyClass) {
+ getService(PolicyService.class).delete(id);
+ }
+
+ public List<String> getCorrelationRuleClasses() {
+ List<String> rules = null;
+
+ try {
+ rules = SyncopeSession.get().getSyncopeTO().getSyncCorrelationRules();
+ } catch (Exception e) {
+ LOG.error("While getting all correlation rule classes", e);
+ }
+
+ return rules;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
new file mode 100644
index 0000000..81b58ac
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ReportRestClient.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.ReportExecExportFormat;
+import org.apache.syncope.common.lib.wrap.ReportletConfClass;
+import org.apache.syncope.common.rest.api.service.ReportService;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ReportRestClient extends BaseRestClient implements ExecutionRestClient {
+
+ private static final long serialVersionUID = 1644689667998953604L;
+
+ public List<String> getReportletConfClasses() {
+ List<String> result = new ArrayList<String>();
+
+ try {
+ List<ReportletConfClass> reportletConfClasses = getService(ReportService.class).getReportletConfClasses();
+ for (ReportletConfClass clazz : reportletConfClasses) {
+ result.add(clazz.getElement());
+ }
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting available reportlet classes", e);
+ }
+
+ return result;
+ }
+
+ public ReportTO read(final Long reportId) {
+ return getService(ReportService.class).read(reportId);
+ }
+
+ public List<ReportTO> list() {
+ return getService(ReportService.class).list().getResult();
+ }
+
+ public List<ReportTO> list(final int page, final int size, final SortParam<String> sort) {
+ return getService(ReportService.class).list(page, size, toOrderBy(sort)).getResult();
+ }
+
+ public int count() {
+ return getService(ReportService.class).list(1, 1).getTotalCount();
+ }
+
+ public void create(final ReportTO reportTO) {
+ getService(ReportService.class).create(reportTO);
+ }
+
+ public void update(final ReportTO reportTO) {
+ getService(ReportService.class).update(reportTO.getKey(), reportTO);
+ }
+
+ /**
+ * Delete specified report.
+ *
+ * @param reportId report to delete
+ */
+ public void delete(final Long reportId) {
+ getService(ReportService.class).delete(reportId);
+ }
+
+ /**
+ * Start execution for the specified report.
+ *
+ * @param reportId report id
+ */
+ @Override
+ public void startExecution(final long reportId) {
+ getService(ReportService.class).execute(reportId);
+ }
+
+ /**
+ * Delete specified report execution.
+ *
+ * @param reportExecId report execution id
+ */
+ @Override
+ public void deleteExecution(final long reportExecId) {
+ getService(ReportService.class).deleteExecution(reportExecId);
+ }
+
+ public Response exportExecutionResult(final Long executionId, final ReportExecExportFormat fmt) {
+ return getService(ReportService.class).exportExecutionResult(executionId, fmt);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
new file mode 100644
index 0000000..a62b644
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.wrap.SubjectId;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Resources services.
+ */
+@Component
+public class ResourceRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -6898907679835668987L;
+
+ public List<String> getPropagationActionsClasses() {
+ return SyncopeSession.get().getSyncopeTO().getPropagationActions();
+ }
+
+ public List<ResourceTO> getAll() {
+ List<ResourceTO> resources = null;
+
+ try {
+ resources = getService(ResourceService.class).list();
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading all resources", e);
+ }
+
+ return resources;
+ }
+
+ public void create(final ResourceTO resourceTO) {
+ getService(ResourceService.class).create(resourceTO);
+ }
+
+ public ResourceTO read(final String name) {
+ ResourceTO resourceTO = null;
+
+ try {
+ resourceTO = getService(ResourceService.class).read(name);
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading a resource", e);
+ }
+ return resourceTO;
+ }
+
+ public void update(final ResourceTO resourceTO) {
+ getService(ResourceService.class).update(resourceTO.getKey(), resourceTO);
+ }
+
+ public void delete(final String name) {
+ getService(ResourceService.class).delete(name);
+ }
+
+ public BulkActionResult bulkAction(final BulkAction action) {
+ return getService(ResourceService.class).bulk(action);
+ }
+
+ public BulkActionResult bulkAssociationAction(
+ final String resourceName, final Class<? extends AbstractAttributableTO> typeRef,
+ final ResourceDeassociationActionType type, final List<SubjectId> subjtectIds) {
+
+ return getService(ResourceService.class).bulkDeassociation(resourceName,
+ UserTO.class.isAssignableFrom(typeRef) ? SubjectType.USER : SubjectType.ROLE,
+ type, subjtectIds);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
new file mode 100644
index 0000000..5cffe09
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.console.commons.status.StatusBean;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.RoleService;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Role's services.
+ */
+@Component
+public class RoleRestClient extends AbstractSubjectRestClient {
+
+ private static final long serialVersionUID = -8549081557283519638L;
+
+ @Override
+ public int count() {
+ return getService(RoleService.class).list(1, 1).getTotalCount();
+ }
+
+ public List<RoleTO> list() {
+ return getService(RoleService.class).list(1, 1000).getResult();
+ }
+
+ @Override
+ public List<RoleTO> list(final int page, final int size, final SortParam<String> sort) {
+ return getService(RoleService.class).list(page, size, toOrderBy(sort)).getResult();
+ }
+
+ @Override
+ public int searchCount(final String fiql) {
+ return getService(RoleService.class).search(fiql, 1, 1).getTotalCount();
+ }
+
+ @Override
+ public List<RoleTO> search(final String fiql, final int page, final int size, final SortParam<String> sort) {
+ return getService(RoleService.class).search(fiql, page, size, toOrderBy(sort)).getResult();
+ }
+
+ @Override
+ public ConnObjectTO getConnectorObject(final String resourceName, final Long id) {
+ return getService(ResourceService.class).getConnectorObject(resourceName, SubjectType.ROLE, id);
+ }
+
+ public RoleTO create(final RoleTO roleTO) {
+ Response response = getService(RoleService.class).create(roleTO);
+ return response.readEntity(RoleTO.class);
+ }
+
+ public RoleTO read(final Long id) {
+ return getAnonymousService(RoleService.class).read(id);
+ }
+
+ public RoleTO update(final String etag, final RoleMod roleMod) {
+ RoleTO result;
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ result = service.update(roleMod.getKey(), roleMod).readEntity(RoleTO.class);
+ resetClient(RoleService.class);
+ }
+ return result;
+ }
+
+ @Override
+ public RoleTO delete(final String etag, final Long id) {
+ RoleTO result;
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ result = service.delete(id).readEntity(RoleTO.class);
+ resetClient(RoleService.class);
+ }
+ return result;
+ }
+
+ @Override
+ public BulkActionResult bulkAction(final BulkAction action) {
+ return getService(RoleService.class).bulk(action);
+ }
+
+ public void unlink(final String etag, final long roleId, final List<StatusBean> statuses) {
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ service.bulkDeassociation(roleId, ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class));
+ resetClient(RoleService.class);
+ }
+ }
+
+ public void link(final String etag, final long roleId, final List<StatusBean> statuses) {
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ service.bulkAssociation(roleId, ResourceAssociationActionType.LINK,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class));
+ resetClient(RoleService.class);
+ }
+ }
+
+ public BulkActionResult deprovision(final String etag, final long roleId, final List<StatusBean> statuses) {
+ BulkActionResult result;
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ result = service.bulkDeassociation(roleId, ResourceDeassociationActionType.DEPROVISION,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class)).
+ readEntity(BulkActionResult.class);
+ resetClient(RoleService.class);
+ }
+ return result;
+ }
+
+ public BulkActionResult provision(final String etag, final long roleId, final List<StatusBean> statuses) {
+ BulkActionResult result;
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ result = service.bulkAssociation(roleId, ResourceAssociationActionType.PROVISION,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class)).
+ readEntity(BulkActionResult.class);
+ resetClient(RoleService.class);
+ }
+ return result;
+ }
+
+ public BulkActionResult unassign(final String etag, final long roleId, final List<StatusBean> statuses) {
+ BulkActionResult result;
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ result = service.bulkDeassociation(roleId, ResourceDeassociationActionType.UNASSIGN,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class)).
+ readEntity(BulkActionResult.class);
+ resetClient(RoleService.class);
+ }
+ return result;
+ }
+
+ public BulkActionResult assign(final String etag, final long roleId, final List<StatusBean> statuses) {
+ BulkActionResult result;
+ synchronized (this) {
+ RoleService service = getService(etag, RoleService.class);
+ result = service.bulkAssociation(roleId, ResourceAssociationActionType.ASSIGN,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class)).
+ readEntity(BulkActionResult.class);
+ resetClient(RoleService.class);
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
new file mode 100644
index 0000000..d5d7046
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
@@ -0,0 +1,253 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.client.console.commons.AttrLayoutType;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.DerSchemaTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.VirSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.rest.api.service.SchemaService;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking rest schema services.
+ */
+@Component
+public class SchemaRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -2479730152700312373L;
+
+ public void filter(
+ final List<? extends AbstractSchemaTO> schemaTOs, final Collection<String> allowed, final boolean exclude) {
+
+ for (ListIterator<? extends AbstractSchemaTO> itor = schemaTOs.listIterator(); itor.hasNext();) {
+ AbstractSchemaTO schema = itor.next();
+ if (exclude) {
+ if (!allowed.contains(schema.getKey())) {
+ itor.remove();
+ }
+ } else {
+ if (allowed.contains(schema.getKey())) {
+ itor.remove();
+ }
+ }
+ }
+ }
+
+ public List<? extends AbstractSchemaTO> getSchemas(final AttributableType attrType, final SchemaType schemaType) {
+ List<? extends AbstractSchemaTO> schemas = Collections.emptyList();
+
+ try {
+ schemas = getService(SchemaService.class).list(attrType, schemaType);
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all schemas for {} and {}", attrType, schemaType, e);
+ }
+
+ if (attrType == AttributableType.CONFIGURATION) {
+ filter(schemas, AttrLayoutType.confKeys(), false);
+ }
+
+ return schemas;
+ }
+
+ public List<PlainSchemaTO> getSchemas(final AttributableType type) {
+ List<PlainSchemaTO> schemas = null;
+
+ try {
+ schemas = getService(SchemaService.class).list(type, SchemaType.PLAIN);
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all schemas", e);
+ }
+
+ return schemas;
+ }
+
+ public List<String> getSchemaNames(final AttributableType attrType, final SchemaType schemaType) {
+ final List<String> schemaNames = new ArrayList<String>();
+
+ try {
+ final List<? extends AbstractSchemaTO> schemas = getSchemas(attrType, schemaType);
+ for (AbstractSchemaTO schemaTO : schemas) {
+ schemaNames.add(schemaTO.getKey());
+ }
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all user schema names", e);
+ }
+
+ return schemaNames;
+ }
+
+ public List<String> getSchemaNames(final AttributableType type) {
+ final List<String> schemaNames = new ArrayList<String>();
+
+ try {
+ final List<PlainSchemaTO> schemas = getSchemas(type);
+ for (PlainSchemaTO schemaTO : schemas) {
+ schemaNames.add(schemaTO.getKey());
+ }
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all user schema names", e);
+ }
+
+ return schemaNames;
+ }
+
+ public List<DerSchemaTO> getDerSchemas(final AttributableType type) {
+ List<DerSchemaTO> userDerSchemas = null;
+
+ try {
+ userDerSchemas = getService(SchemaService.class).list(type, SchemaType.DERIVED);
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all user derived schemas", e);
+ }
+
+ return userDerSchemas;
+ }
+
+ public List<String> getDerSchemaNames(final AttributableType type) {
+ final List<String> userDerSchemasNames = new ArrayList<String>();
+
+ try {
+ final List<DerSchemaTO> userDerSchemas = getService(SchemaService.class).list(type, SchemaType.DERIVED);
+
+ for (DerSchemaTO schemaTO : userDerSchemas) {
+ userDerSchemasNames.add(schemaTO.getKey());
+ }
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all {} derived schema names", type, e);
+ }
+
+ return userDerSchemasNames;
+ }
+
+ public List<VirSchemaTO> getVirSchemas(final AttributableType type) {
+ List<VirSchemaTO> userVirSchemas = null;
+
+ try {
+ userVirSchemas = getService(SchemaService.class).list(type, SchemaType.VIRTUAL);
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all {} virtual schemas", type, e);
+ }
+
+ return userVirSchemas;
+ }
+
+ public List<String> getVirSchemaNames(final AttributableType type) {
+ final List<String> userVirSchemasNames = new ArrayList<String>();
+
+ try {
+ @SuppressWarnings("unchecked")
+ final List<VirSchemaTO> userVirSchemas = getService(SchemaService.class).list(type, SchemaType.VIRTUAL);
+ for (VirSchemaTO schemaTO : userVirSchemas) {
+ userVirSchemasNames.add(schemaTO.getKey());
+ }
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all user derived schema names", e);
+ }
+
+ return userVirSchemasNames;
+ }
+
+ public void createSchema(final AttributableType type, final PlainSchemaTO schemaTO) {
+ getService(SchemaService.class).create(type, SchemaType.PLAIN, schemaTO);
+ }
+
+ public PlainSchemaTO readSchema(final AttributableType type, final String name) {
+ PlainSchemaTO schema = null;
+
+ try {
+ schema = getService(SchemaService.class).read(type, SchemaType.PLAIN, name);
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading a user schema", e);
+ }
+ return schema;
+ }
+
+ public void updateSchema(final AttributableType type, final PlainSchemaTO schemaTO) {
+ getService(SchemaService.class).update(type, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+ }
+
+ public PlainSchemaTO deleteSchema(final AttributableType type, final String name) {
+ PlainSchemaTO response = getService(SchemaService.class).read(type, SchemaType.PLAIN, name);
+ getService(SchemaService.class).delete(type, SchemaType.PLAIN, name);
+ return response;
+ }
+
+ public void createDerSchema(final AttributableType type, final DerSchemaTO schemaTO) {
+ getService(SchemaService.class).create(type, SchemaType.DERIVED, schemaTO);
+ }
+
+ public DerSchemaTO readDerSchema(final AttributableType type, final String name) {
+ DerSchemaTO derivedSchemaTO = null;
+ try {
+ derivedSchemaTO = getService(SchemaService.class).read(type, SchemaType.DERIVED, name);
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading a derived user schema", e);
+ }
+ return derivedSchemaTO;
+ }
+
+ public void updateVirSchema(final AttributableType type, final VirSchemaTO schemaTO) {
+ getService(SchemaService.class).update(type, SchemaType.VIRTUAL, schemaTO.getKey(), schemaTO);
+ }
+
+ public DerSchemaTO deleteDerSchema(final AttributableType type, final String name) {
+ DerSchemaTO schemaTO = getService(SchemaService.class).read(type, SchemaType.DERIVED, name);
+ getService(SchemaService.class).delete(type, SchemaType.DERIVED, name);
+ return schemaTO;
+ }
+
+ public void createVirSchema(final AttributableType type, final VirSchemaTO schemaTO) {
+ getService(SchemaService.class).create(type, SchemaType.VIRTUAL, schemaTO);
+ }
+
+ public void updateDerSchema(final AttributableType type, final DerSchemaTO schemaTO) {
+ getService(SchemaService.class).update(type, SchemaType.DERIVED, schemaTO.getKey(), schemaTO);
+ }
+
+ public VirSchemaTO deleteVirSchema(final AttributableType type, final String name) {
+ VirSchemaTO schemaTO = getService(SchemaService.class).read(type, SchemaType.VIRTUAL, name);
+ getService(SchemaService.class).delete(type, SchemaType.VIRTUAL, name);
+ return schemaTO;
+ }
+
+ /**
+ * Populator for Validator Schema DropDown components.
+ */
+ public List<String> getAllValidatorClasses() {
+ List<String> response = null;
+
+ try {
+ response = SyncopeSession.get().getSyncopeTO().getValidators();
+ } catch (SyncopeClientException e) {
+ LOG.error("While getting all validators", e);
+ }
+ return response;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SecurityQuestionRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SecurityQuestionRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SecurityQuestionRestClient.java
new file mode 100644
index 0000000..119b3b5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/SecurityQuestionRestClient.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SecurityQuestionRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -3167730221361895176L;
+
+ public List<SecurityQuestionTO> list() {
+ return getService(SecurityQuestionService.class).list();
+ }
+
+ public void create(final SecurityQuestionTO securityQuestionTO) {
+ getService(SecurityQuestionService.class).create(securityQuestionTO);
+ }
+
+ public void update(final SecurityQuestionTO securityQuestionTO) {
+ getService(SecurityQuestionService.class).update(securityQuestionTO.getKey(), securityQuestionTO);
+ }
+
+ public void delete(final Long securityQuestionId) {
+ getService(SecurityQuestionService.class).delete(securityQuestionId);
+ }
+
+ public SecurityQuestionTO readByUser(final String username) {
+ return getService(SecurityQuestionService.class).readByUser(username);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
new file mode 100644
index 0000000..541b5cd
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.rest.api.service.TaskService;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Tasks services.
+ */
+@Component
+public class TaskRestClient extends BaseRestClient implements ExecutionRestClient {
+
+ private static final long serialVersionUID = 6284485820911028843L;
+
+ public List<String> getJobClasses() {
+ return SyncopeSession.get().getSyncopeTO().getTaskJobs();
+ }
+
+ public List<String> getSyncActionsClasses() {
+ return SyncopeSession.get().getSyncopeTO().getSyncActions();
+ }
+
+ public List<String> getPushActionsClasses() {
+ return SyncopeSession.get().getSyncopeTO().getPushActions();
+ }
+
+ /**
+ * Return the number of tasks.
+ *
+ * @param kind of task (propagation, sched, sync).
+ * @return number of stored tasks.
+ */
+ public int count(final String kind) {
+ return getService(TaskService.class).list(TaskType.fromString(kind), 1, 1).getTotalCount();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends AbstractTaskTO> List<T> list(final Class<T> reference,
+ final int page, final int size, final SortParam<String> sort) {
+
+ return (List<T>) getService(TaskService.class).list(getTaskType(reference), page, size, toOrderBy(sort)).
+ getResult();
+ }
+
+ private TaskType getTaskType(final Class<?> reference) {
+ TaskType result = null;
+ if (PropagationTaskTO.class.equals(reference)) {
+ result = TaskType.PROPAGATION;
+ } else if (NotificationTaskTO.class.equals(reference)) {
+ result = TaskType.NOTIFICATION;
+ } else if (SchedTaskTO.class.equals(reference)) {
+ result = TaskType.SCHEDULED;
+ } else if (SyncTaskTO.class.equals(reference)) {
+ result = TaskType.SYNCHRONIZATION;
+ } else if (PushTaskTO.class.equals(reference)) {
+ result = TaskType.PUSH;
+ }
+ return result;
+ }
+
+ public PropagationTaskTO readPropagationTask(final Long taskId) {
+ return getService(TaskService.class).read(taskId);
+ }
+
+ public NotificationTaskTO readNotificationTask(final Long taskId) {
+ return getService(TaskService.class).read(taskId);
+ }
+
+ public <T extends SchedTaskTO> T readSchedTask(final Class<T> reference, final Long taskId) {
+ return getService(TaskService.class).read(taskId);
+ }
+
+ public void delete(final Long taskId, final Class<? extends AbstractTaskTO> taskToClass) {
+ getService(TaskService.class).delete(taskId);
+ }
+
+ @Override
+ public void startExecution(final long taskId) {
+ startExecution(taskId, false);
+ }
+
+ public void startExecution(final long taskId, final boolean dryRun) {
+ getService(TaskService.class).execute(taskId, dryRun);
+ }
+
+ @Override
+ public void deleteExecution(final long taskExecId) {
+ getService(TaskService.class).deleteExecution(taskExecId);
+ }
+
+ public void createSyncTask(final SyncTaskTO taskTO) {
+ getService(TaskService.class).create(taskTO);
+ }
+
+ public void createSchedTask(final SchedTaskTO taskTO) {
+ getService(TaskService.class).create(taskTO);
+ }
+
+ public void updateSchedTask(final SchedTaskTO taskTO) {
+ getService(TaskService.class).update(taskTO.getKey(), taskTO);
+ }
+
+ public void updateSyncTask(final SyncTaskTO taskTO) {
+ getService(TaskService.class).update(taskTO.getKey(), taskTO);
+ }
+
+ public BulkActionResult bulkAction(final BulkAction action) {
+ return getService(TaskService.class).bulk(action);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
new file mode 100644
index 0000000..bca0e28
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.console.commons.status.StatusBean;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.ResourceAssociationMod;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.UserService;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking rest users services.
+ */
+@Component
+public class UserRestClient extends AbstractSubjectRestClient {
+
+ private static final long serialVersionUID = -1575748964398293968L;
+
+ @Override
+ public int count() {
+ return getService(UserService.class).list(1, 1).getTotalCount();
+ }
+
+ @Override
+ public List<UserTO> list(final int page, final int size, final SortParam<String> sort) {
+ return getService(UserService.class).list(page, size, toOrderBy(sort)).getResult();
+ }
+
+ public UserTO create(final UserTO userTO, final boolean storePassword) {
+ Response response = getService(UserService.class).create(userTO, storePassword);
+ return response.readEntity(UserTO.class);
+ }
+
+ public UserTO update(final String etag, final UserMod userMod) {
+ UserTO result;
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ result = service.update(userMod.getKey(), userMod).readEntity(UserTO.class);
+ resetClient(UserService.class);
+ }
+ return result;
+ }
+
+ @Override
+ public UserTO delete(final String etag, final Long id) {
+ UserTO result;
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ result = service.delete(id).readEntity(UserTO.class);
+ resetClient(UserService.class);
+ }
+ return result;
+ }
+
+ public UserTO read(final Long id) {
+ UserTO userTO = null;
+ try {
+ userTO = getService(UserService.class).read(id);
+ } catch (SyncopeClientException e) {
+ LOG.error("While reading a user", e);
+ }
+ return userTO;
+ }
+
+ @Override
+ public int searchCount(final String fiql) {
+ return getService(UserService.class).search(fiql, 1, 1).getTotalCount();
+ }
+
+ @Override
+ public List<UserTO> search(final String fiql, final int page, final int size, final SortParam<String> sort) {
+ return getService(UserService.class).search(fiql, page, size, toOrderBy(sort)).getResult();
+ }
+
+ @Override
+ public ConnObjectTO getConnectorObject(final String resourceName, final Long id) {
+ return getService(ResourceService.class).getConnectorObject(resourceName, SubjectType.USER, id);
+ }
+
+ public void suspend(final String etag, final long userId, final List<StatusBean> statuses) {
+ StatusMod statusMod = StatusUtils.buildStatusMod(statuses, false);
+ statusMod.setType(StatusMod.ModType.SUSPEND);
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ service.status(userId, statusMod);
+ resetClient(UserService.class);
+ }
+ }
+
+ public void reactivate(final String etag, final long userId, final List<StatusBean> statuses) {
+ StatusMod statusMod = StatusUtils.buildStatusMod(statuses, true);
+ statusMod.setType(StatusMod.ModType.REACTIVATE);
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ service.status(userId, statusMod);
+ resetClient(UserService.class);
+ }
+ }
+
+ @Override
+ public BulkActionResult bulkAction(final BulkAction action) {
+ return getService(UserService.class).bulk(action);
+ }
+
+ public void unlink(final String etag, final long userId, final List<StatusBean> statuses) {
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ service.bulkDeassociation(userId, ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class));
+ resetClient(UserService.class);
+ }
+ }
+
+ public void link(final String etag, final long userId, final List<StatusBean> statuses) {
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class));
+ service.bulkAssociation(userId, ResourceAssociationActionType.LINK, associationMod);
+
+ resetClient(UserService.class);
+ }
+ }
+
+ public BulkActionResult deprovision(final String etag, final long userId, final List<StatusBean> statuses) {
+ BulkActionResult result;
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ result = service.bulkDeassociation(userId, ResourceDeassociationActionType.DEPROVISION,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class)).
+ readEntity(BulkActionResult.class);
+ resetClient(UserService.class);
+ }
+ return result;
+ }
+
+ public BulkActionResult provision(final String etag, final long userId,
+ final List<StatusBean> statuses, final boolean changepwd, final String password) {
+
+ BulkActionResult result;
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class));
+ associationMod.setChangePwd(changepwd);
+ associationMod.setPassword(password);
+
+ result = service.bulkAssociation(userId, ResourceAssociationActionType.PROVISION, associationMod).
+ readEntity(BulkActionResult.class);
+ resetClient(UserService.class);
+ }
+ return result;
+ }
+
+ public BulkActionResult unassign(final String etag, final long userId, final List<StatusBean> statuses) {
+ BulkActionResult result;
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+ result = service.bulkDeassociation(userId, ResourceDeassociationActionType.UNASSIGN,
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class)).
+ readEntity(BulkActionResult.class);
+ resetClient(UserService.class);
+ }
+ return result;
+ }
+
+ public BulkActionResult assign(final String etag, final long userId,
+ final List<StatusBean> statuses, final boolean changepwd, final String password) {
+
+ BulkActionResult result;
+ synchronized (this) {
+ UserService service = getService(etag, UserService.class);
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(),
+ ResourceName.class));
+ associationMod.setChangePwd(changepwd);
+ associationMod.setPassword(password);
+
+ result = service.bulkAssociation(userId, ResourceAssociationActionType.ASSIGN, associationMod).
+ readEntity(BulkActionResult.class);
+ resetClient(UserService.class);
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
new file mode 100644
index 0000000..1bb1079
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.rest.api.service.UserSelfService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class UserSelfRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 2994691796924731295L;
+
+ public boolean isSelfRegistrationAllowed() {
+ Boolean result = null;
+ try {
+ result = SyncopeSession.get().getSyncopeTO().isSelfRegAllowed();
+ } catch (SyncopeClientException e) {
+ LOG.error("While seeking if self registration is allowed", e);
+ }
+
+ return result == null
+ ? false
+ : result.booleanValue();
+ }
+
+ public UserTO read() {
+ return getService(UserSelfService.class).read();
+ }
+
+ public void create(final UserTO userTO, final boolean storePassword) {
+ getService(UserSelfService.class).create(userTO, storePassword);
+ }
+
+ public void update(final UserMod userMod) {
+ getService(UserSelfService.class).update(userMod.getKey(), userMod);
+ }
+
+ public void delete() {
+ getService(UserSelfService.class).delete();
+ }
+
+ public boolean isPasswordResetAllowed() {
+ Boolean result = null;
+ try {
+ result = SyncopeSession.get().getSyncopeTO().isPwdResetAllowed();
+ } catch (SyncopeClientException e) {
+ LOG.error("While seeking if password reset is allowed", e);
+ }
+
+ return result == null
+ ? false
+ : result.booleanValue();
+ }
+
+ public boolean isPwdResetRequiringSecurityQuestions() {
+ Boolean result = null;
+ try {
+ result = SyncopeSession.get().getSyncopeTO().isPwdResetRequiringSecurityQuestions();
+ } catch (SyncopeClientException e) {
+ LOG.error("While seeking if password reset requires security question", e);
+ }
+
+ return result == null
+ ? false
+ : result.booleanValue();
+ }
+
+ public void requestPasswordReset(final String username, final String securityAnswer) {
+ getService(UserSelfService.class).requestPasswordReset(username, securityAnswer);
+ }
+
+ public void confirmPasswordReset(final String token, final String password) {
+ getService(UserSelfService.class).confirmPasswordReset(token, password);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
new file mode 100644
index 0000000..f3bf60c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.io.InputStream;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.WorkflowService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WorkflowRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 5049285686167071017L;
+
+ private WorkflowService getService(final MediaType mediaType) {
+ return SyncopeSession.get().getService(mediaType, WorkflowService.class);
+ }
+
+ public InputStream getDefinition(final MediaType mediaType) {
+ Response response = getService(mediaType).exportDefinition(SubjectType.USER);
+
+ return (InputStream) response.getEntity();
+ }
+
+ public byte[] getDiagram() {
+ WorkflowService service = getService(WorkflowService.class);
+ WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
+ Response response = service.exportDiagram(SubjectType.USER);
+
+ byte[] diagram;
+ try {
+ diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
+ } catch (Exception e) {
+ LOG.error("Could not get workflow diagram", e);
+ diagram = new byte[0];
+ }
+ return diagram;
+ }
+
+ public boolean isActivitiEnabledForUsers() {
+ return SyncopeSession.get().getSyncopeTO().getUserWorkflowAdapter().indexOf("Activiti") != -1;
+ }
+
+ public void updateDefinition(final MediaType mediaType, final String definition) {
+ getService(mediaType).importDefinition(SubjectType.USER, definition);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/form/AbstractAjaxDownloadBehavior.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/form/AbstractAjaxDownloadBehavior.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/form/AbstractAjaxDownloadBehavior.java
new file mode 100644
index 0000000..8074d37
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/form/AbstractAjaxDownloadBehavior.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.wicket.ajax.form;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.behavior.AbstractAjaxBehavior;
+import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
+import org.apache.wicket.util.resource.IResourceStream;
+
+public abstract class AbstractAjaxDownloadBehavior extends AbstractAjaxBehavior {
+
+ private static final long serialVersionUID = 6833760760338614245L;
+
+ /**
+ * Call this method to initiate the download.
+ */
+ public void initiate(final AjaxRequestTarget target) {
+ CharSequence url = getCallbackUrl();
+
+ target.appendJavaScript("window.location.href='" + url + "'");
+ }
+
+ @Override
+ public void onRequest() {
+ getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
+ new ResourceStreamRequestHandler(getResourceStream(), getFileName()));
+ }
+
+ protected abstract String getFileName();
+
+ protected abstract IResourceStream getResourceStream();
+}
[27/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java
new file mode 100644
index 0000000..547d91a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDecoratedCheckbox.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.wicket.markup.html.form;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
+import org.apache.wicket.model.IModel;
+
+/**
+ * AjaxCheckBox allowing AjaxCallDecorator.
+ */
+public abstract class AjaxDecoratedCheckbox extends AjaxCheckBox {
+
+ private static final long serialVersionUID = 7345848589265633002L;
+
+ public AjaxDecoratedCheckbox(final String id) {
+ this(id, null);
+ }
+
+ public AjaxDecoratedCheckbox(final String id, final IModel<Boolean> model) {
+ super(id, model);
+
+ add(new AjaxEventBehavior(Constants.ON_CLICK) {
+
+ private static final long serialVersionUID = -295188647830294610L;
+
+ @Override
+ protected void onEvent(final AjaxRequestTarget target) {
+ refreshComponent(target);
+ }
+ });
+ }
+
+ private void refreshComponent(final AjaxRequestTarget target) {
+ target.add(this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java
new file mode 100644
index 0000000..19e0e1d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java
@@ -0,0 +1,87 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class AjaxDropDownChoicePanel<T extends Serializable> extends FieldPanel<T> implements Cloneable {
+
+ private static final long serialVersionUID = -4716376580659196095L;
+
+ public AjaxDropDownChoicePanel(final String id, final String name, final IModel<T> model) {
+ this(id, name, model, true);
+ }
+
+ public AjaxDropDownChoicePanel(final String id, final String name, final IModel<T> model, boolean enableOnBlur) {
+ super(id, model);
+
+ field = new DropDownChoice<T>(
+ "dropDownChoiceField", model, Collections.<T>emptyList(), new ChoiceRenderer<T>());
+ add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
+
+ if (enableOnBlur) {
+ field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // nothing to do
+ }
+ });
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public AjaxDropDownChoicePanel<T> setChoiceRenderer(final IChoiceRenderer renderer) {
+ ((DropDownChoice) field).setChoiceRenderer(renderer);
+ return this;
+ }
+
+ @SuppressWarnings("unchecked")
+ public AjaxDropDownChoicePanel<T> setChoices(final List<T> choices) {
+ ((DropDownChoice) field).setChoices(choices);
+ return this;
+ }
+
+ @SuppressWarnings("unchecked")
+ public AjaxDropDownChoicePanel<T> setChoices(final IModel<? extends List<? extends T>> choices) {
+ ((DropDownChoice) field).setChoices(choices);
+ return this;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public FieldPanel clone() {
+ final AjaxDropDownChoicePanel<T> panel = (AjaxDropDownChoicePanel<T>) super.clone();
+ panel.setChoiceRenderer(((DropDownChoice) field).getChoiceRenderer());
+ panel.setChoices(((DropDownChoice) field).getChoices());
+ return panel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
new file mode 100644
index 0000000..91b6306
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
@@ -0,0 +1,70 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.wicket.extensions.markup.html.form.palette.Palette;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.util.ListModel;
+
+public class AjaxPalettePanel<T> extends AbstractFieldPanel<List<T>> {
+
+ private static final long serialVersionUID = 7738499668258805567L;
+
+ protected final Palette<T> palette;
+
+ public AjaxPalettePanel(final String id, final IModel<List<T>> model, final ListModel<T> choices) {
+ this(id, model, choices, false);
+ }
+
+ public AjaxPalettePanel(final String id, final IModel<List<T>> model, final ListModel<T> choices,
+ final boolean allowOrder) {
+
+ this(id, model, choices, new SelectChoiceRenderer<T>(), allowOrder, false);
+ }
+
+ public AjaxPalettePanel(final String id, final IModel<List<T>> model, final ListModel<T> choices,
+ final IChoiceRenderer<T> renderer, final boolean allowOrder, final boolean allowMoveAll) {
+
+ super(id, model);
+
+ this.palette = createPalette(model, choices, renderer, allowOrder, allowMoveAll);
+ add(palette.setOutputMarkupId(true));
+ setOutputMarkupId(true);
+ }
+
+ protected Palette<T> createPalette(final IModel<List<T>> model, final ListModel<T> choices,
+ final IChoiceRenderer<T> renderer, final boolean allowOrder, final boolean allowMoveAll) {
+
+ return new NonI18nPalette<T>("paletteField", model, choices, renderer, 8, allowOrder, allowMoveAll);
+ }
+
+ @Override
+ public AjaxPalettePanel<T> setModelObject(final List<T> object) {
+ palette.setDefaultModelObject(object);
+ return this;
+ }
+
+ public Collection<T> getModelCollection() {
+ return palette.getModelCollection();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java
new file mode 100644
index 0000000..14fdf9e
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPasswordFieldPanel.java
@@ -0,0 +1,60 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class AjaxPasswordFieldPanel extends FieldPanel<String> {
+
+ private static final long serialVersionUID = -5490115280336667460L;
+
+ public AjaxPasswordFieldPanel(final String id, final String name, final IModel<String> model) {
+ super(id, model);
+
+ field = new PasswordTextField("passwordField", model);
+ add(field.setLabel(new Model<String>(name)).setRequired(false).setOutputMarkupId(true));
+
+ if (!isReadOnly()) {
+ field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget art) {
+ // nothing to do
+ }
+ });
+ }
+ }
+
+ @Override
+ public FieldPanel<String> addRequiredLabel() {
+ if (!isRequired()) {
+ setRequired(true);
+ }
+
+ this.isRequiredLabelAdded = true;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.java
new file mode 100644
index 0000000..6854fb0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.java
@@ -0,0 +1,98 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Pattern;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings;
+import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.IValidator;
+
+public class AjaxTextFieldPanel extends FieldPanel<String> implements Cloneable {
+
+ private static final long serialVersionUID = 238940918106696068L;
+
+ private List<String> choices = Collections.emptyList();
+
+ public AjaxTextFieldPanel(final String id, final String name, final IModel<String> model) {
+ super(id, model);
+
+ final AutoCompleteSettings settings = new AutoCompleteSettings();
+ settings.setShowCompleteListOnFocusGain(true);
+ settings.setShowListOnEmptyInput(true);
+
+ field = new AutoCompleteTextField<String>("textField", model, settings) {
+
+ private static final long serialVersionUID = -6648767303091874219L;
+
+ @Override
+ protected Iterator<String> getChoices(final String input) {
+ final Pattern pattern = Pattern.compile(".*" + Pattern.quote(input) + ".*", Pattern.CASE_INSENSITIVE);
+
+ final List<String> result = new ArrayList<String>();
+
+ for (String choice : choices) {
+ if (pattern.matcher(choice).matches()) {
+ result.add(choice);
+ }
+ }
+
+ return result.iterator();
+ }
+ };
+ add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
+
+ if (!isReadOnly()) {
+ field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // nothing to do
+ }
+ });
+ }
+ }
+
+ public void addValidator(final IValidator<? super String> validator) {
+ this.field.add(validator);
+ }
+
+ public void setChoices(final List<String> choices) {
+ if (choices != null) {
+ this.choices = choices;
+ }
+ }
+
+ @Override
+ public FieldPanel<String> clone() {
+ final AjaxTextFieldPanel panel = (AjaxTextFieldPanel) super.clone();
+ panel.setChoices(choices);
+ return panel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
new file mode 100644
index 0000000..df91c7d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.java
@@ -0,0 +1,211 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.ByteArrayInputStream;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.preview.PreviewUtil;
+import org.apache.syncope.client.console.commons.HttpResourceStream;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BaseModalPage;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.form.upload.FileUpload;
+import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
+import org.apache.wicket.request.resource.ContentDisposition;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.util.crypt.Base64;
+import org.apache.wicket.util.lang.Bytes;
+
+public class BinaryFieldPanel extends FieldPanel<String> {
+
+ private static final long serialVersionUID = 6264462604183088931L;
+
+ private final String mimeType;
+
+ private final WebMarkupContainer container;
+
+ private final Link<Void> downloadLink;
+
+ private final Form<?> uploadForm;
+
+ private final Fragment emptyFragment;
+
+ @SpringBean
+ private PreviewUtil previewUtil;
+
+ public BinaryFieldPanel(final String id, final String name, final IModel<String> model, final String mimeType) {
+ super(id, model);
+ this.mimeType = mimeType;
+
+ uploadForm = new StatelessForm<Void>("uploadForm");
+ uploadForm.setMultiPart(true);
+ uploadForm.setMaxSize(Bytes.megabytes(4));
+ add(uploadForm);
+
+ container = new WebMarkupContainer("previewContainer");
+ container.setOutputMarkupId(true);
+
+ emptyFragment = new Fragment("panelPreview", "emptyFragment", container);
+ emptyFragment.setOutputMarkupId(true);
+ container.add(emptyFragment);
+ uploadForm.add(container);
+
+ field = new TextField<String>("textField", model);
+ add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
+
+ uploadForm.add(new Label("preview", StringUtils.isBlank(mimeType) ? StringUtils.EMPTY : "(" + mimeType + ")"));
+
+ downloadLink = new Link<Void>("downloadLink") {
+
+ private static final long serialVersionUID = -4331619903296515985L;
+
+ @Override
+ public void onClick() {
+ try {
+ HttpResourceStream stream = new HttpResourceStream(buildResponse());
+
+ ResourceStreamRequestHandler rsrh = new ResourceStreamRequestHandler(stream);
+ rsrh.setFileName(stream.getFilename() == null ? name : stream.getFilename());
+ rsrh.setContentDisposition(ContentDisposition.ATTACHMENT);
+
+ getRequestCycle().scheduleRequestHandlerAfterCurrent(rsrh);
+ } catch (Exception e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ }
+ }
+ };
+ downloadLink.setOutputMarkupId(true);
+ uploadForm.add(downloadLink);
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final FileUploadField fileUpload = new FileUploadField("fileUpload", new Model());
+ fileUpload.setOutputMarkupId(true);
+ fileUpload.add(new AjaxFormSubmitBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target) {
+ final FileUpload uploadedFile = fileUpload.getFileUpload();
+ if (uploadedFile != null) {
+ try {
+ final byte[] uploadedBytes = uploadedFile.getBytes();
+ final String uploaded = new String(
+ Base64.encodeBase64(uploadedBytes),
+ SyncopeConstants.DEFAULT_ENCODING);
+ field.setModelObject(uploaded);
+ target.add(field);
+
+ final Component panelPreview = previewUtil.getPreviewer(mimeType, uploadedBytes);
+
+ if (panelPreview != null) {
+ changePreviewer(panelPreview);
+ }
+
+ fileUpload.setModelObject(null);
+ uploadForm.addOrReplace(fileUpload);
+ downloadLink.setEnabled(StringUtils.isNotBlank(uploaded));
+ target.add(uploadForm);
+ } catch (Exception e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ ((BaseModalPage) getPage()).getFeedbackPanel().refresh(target);
+ LOG.error("While saving uploaded file", e);
+ }
+ }
+ }
+ });
+
+ uploadForm.add(fileUpload);
+
+ IndicatingAjaxLink<Void> uploadLink = new IndicatingAjaxLink<Void>("uploadLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ }
+ };
+ uploadForm.add(uploadLink);
+
+ IndicatingAjaxLink<Void> resetLink = new IndicatingAjaxLink<Void>("resetLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ field.setModelObject(null);
+ target.add(field);
+ downloadLink.setEnabled(false);
+ container.addOrReplace(emptyFragment);
+ uploadForm.addOrReplace(container);
+ target.add(uploadForm);
+ }
+ };
+ uploadForm.add(resetLink);
+ }
+
+ private Response buildResponse() {
+ return Response.ok(new ByteArrayInputStream(Base64.decodeBase64(getModelObject()))).
+ type(StringUtils.isBlank(mimeType) ? MediaType.APPLICATION_OCTET_STREAM : mimeType).build();
+ }
+
+ private void changePreviewer(final Component panelPreview) {
+ final Fragment fragment = new Fragment("panelPreview", "previewFragment", container);
+ fragment.add(panelPreview);
+ container.addOrReplace(fragment);
+ uploadForm.addOrReplace(container);
+ }
+
+ @Override
+ public BinaryFieldPanel clone() {
+ return (BinaryFieldPanel) super.clone();
+ }
+
+ @Override
+ public FieldPanel<String> setNewModel(final IModel<String> model) {
+ field.setModel(model);
+ try {
+ final Component panelPreview = previewUtil.getPreviewer(mimeType, model.getObject());
+ if (panelPreview != null) {
+ changePreviewer(panelPreview);
+ }
+ } catch (Exception e) {
+ LOG.error("While loading saved file", e);
+ }
+ downloadLink.setEnabled(StringUtils.isNotBlank(model.getObject()));
+ uploadForm.addOrReplace(downloadLink);
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
new file mode 100644
index 0000000..3c5119b
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/CheckBoxMultipleChoiceFieldPanel.java
@@ -0,0 +1,46 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.List;
+
+import org.apache.wicket.markup.html.form.CheckBoxMultipleChoice;
+import org.apache.wicket.model.IModel;
+
+public class CheckBoxMultipleChoiceFieldPanel<E> extends AbstractFieldPanel<List<E>> {
+
+ private static final long serialVersionUID = 4124935025837737298L;
+
+ private final CheckBoxMultipleChoice<E> field;
+
+ public CheckBoxMultipleChoiceFieldPanel(
+ final String id, final IModel<List<E>> model, final IModel<List<E>> choices) {
+
+ super(id, model);
+
+ field = new CheckBoxMultipleChoice<E>("checkBoxMultipleChoice", model, choices);
+ add(field);
+ }
+
+ @Override
+ public AbstractFieldPanel<List<E>> setModelObject(final List<E> object) {
+ field.setModelObject(object);
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateFieldPanel.java
new file mode 100644
index 0000000..1f5aaf6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateFieldPanel.java
@@ -0,0 +1,132 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.springframework.util.StringUtils;
+
+public class DateFieldPanel extends FieldPanel<Date> {
+
+ private static final long serialVersionUID = -428975732068281726L;
+
+ protected final String name;
+
+ protected final String datePattern;
+
+ protected DateFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) {
+ super(id, model);
+ this.name = name;
+ this.datePattern = datePattern;
+ }
+
+ @Override
+ public FieldPanel<Date> setNewModel(final List<Serializable> list) {
+ final SimpleDateFormat formatter = datePattern == null
+ ? new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN, Locale.getDefault())
+ : new SimpleDateFormat(datePattern, Locale.getDefault());
+
+ setNewModel(new Model<Date>() {
+
+ private static final long serialVersionUID = 527651414610325237L;
+
+ @Override
+ public Date getObject() {
+ Date date = null;
+
+ if (list != null && !list.isEmpty() && StringUtils.hasText(list.get(0).toString())) {
+ try {
+ // Parse string using datePattern
+ date = formatter.parse(list.get(0).toString());
+ } catch (ParseException e) {
+ LOG.error("invalid parse exception", e);
+ }
+ }
+
+ return date;
+ }
+
+ @Override
+ public void setObject(final Date object) {
+ list.clear();
+ if (object != null) {
+ list.add(formatter.format(object));
+ }
+ }
+ });
+
+ return this;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public FieldPanel<Date> setNewModel(final ListItem item) {
+ final SimpleDateFormat formatter = datePattern == null
+ ? new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN, Locale.getDefault())
+ : new SimpleDateFormat(datePattern, Locale.getDefault());
+
+ IModel<Date> model = new Model<Date>() {
+
+ private static final long serialVersionUID = 6799404673615637845L;
+
+ @Override
+ public Date getObject() {
+ Date date = null;
+
+ final Object obj = item.getModelObject();
+
+ if (obj != null && !obj.toString().isEmpty()) {
+ if (obj instanceof String) {
+ // Parse string using datePattern
+ try {
+ date = formatter.parse(obj.toString());
+ } catch (ParseException e) {
+ LOG.error("While parsing date", e);
+ }
+ } else if (obj instanceof Date) {
+ // Don't parse anything
+ date = (Date) obj;
+ } else {
+ // consider Long
+ date = new Date((Long) obj);
+ }
+ }
+
+ return date;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void setObject(final Date object) {
+ item.setModelObject(object != null ? formatter.format(object) : null);
+ }
+ };
+
+ field.setModel(model);
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.java
new file mode 100644
index 0000000..add3de6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTextFieldPanel.java
@@ -0,0 +1,88 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.Date;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.datetime.markup.html.form.DateTextField;
+import org.apache.wicket.extensions.yui.calendar.DatePicker;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class DateTextFieldPanel extends DateFieldPanel {
+
+ private static final long serialVersionUID = 1919852712185883648L;
+
+ public DateTextFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) {
+ super(id, name, model, datePattern);
+
+ field = DateTextField.forDatePattern("field", model, datePattern);
+
+ if (!isReadOnly()) {
+ field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // nothing to do
+ }
+ });
+ }
+
+ field.add(getDatePicker());
+
+ add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
+ }
+
+ /**
+ * Setup a DatePicker component.
+ */
+ private DatePicker getDatePicker() {
+ final DatePicker picker = new DatePicker() {
+
+ private static final long serialVersionUID = 4166072895162221956L;
+
+ @Override
+ protected boolean enableMonthYearSelection() {
+ return true;
+ }
+ };
+
+ picker.setShowOnFieldClick(true);
+
+ return picker;
+ }
+
+ @Override
+ public FieldPanel<Date> clone() {
+ final FieldPanel<Date> panel = new DateTextFieldPanel(getId(), name, new Model<Date>(), datePattern);
+ panel.setRequired(isRequired());
+ panel.setReadOnly(isReadOnly());
+ panel.setTitle(title);
+
+ if (isRequiredLabelAdded) {
+ panel.addRequiredLabel();
+ }
+
+ return panel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
new file mode 100644
index 0000000..d8014f6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/DateTimeFieldPanel.java
@@ -0,0 +1,195 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.Calendar;
+import java.util.Date;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.yui.calendar.DateTimeField;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.validation.IValidationError;
+import org.apache.wicket.validation.ValidationError;
+
+public class DateTimeFieldPanel extends DateFieldPanel {
+
+ private static final long serialVersionUID = -428975732068281726L;
+
+ private Form form = null;
+
+ public DateTimeFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) {
+ super(id, name, model, datePattern);
+
+ field = new DateTimeField("field", model);
+
+ final Calendar cal = Calendar.getInstance();
+
+ field.get("hours").add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ final Integer hours = ((DateTimeField) field).getHours();
+ if (hours != null) {
+ cal.set(hours > 12 ? Calendar.HOUR_OF_DAY : Calendar.HOUR, hours);
+ field.setModelObject(cal.getTime());
+ }
+ }
+ });
+
+ field.get("minutes").add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ final Integer minutes = ((DateTimeField) field).getMinutes();
+ if (minutes != null) {
+ cal.set(Calendar.MINUTE, minutes);
+ field.setModelObject(cal.getTime());
+ }
+ }
+ });
+
+ field.get("date").add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ final Date date = ((DateTimeField) field).getDate();
+ if (date == null) {
+ field.setModelObject(null);
+ } else {
+ cal.setTime(date);
+ cal.set(Calendar.AM_PM, "PM".equals("" + ((DateTimeField) field).getAmOrPm()) ? Calendar.PM
+ : Calendar.AM);
+ field.setModelObject(cal.getTime());
+ }
+ }
+ });
+
+ field.get("amOrPmChoice").add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ cal.set(Calendar.AM_PM, "PM".equals("" + ((DateTimeField) field).getAmOrPm()) ? Calendar.PM
+ : Calendar.AM);
+ field.setModelObject(cal.getTime());
+ }
+ });
+
+ add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
+ }
+
+ /**
+ * Custom form validator for registering and handling DateTimeField components that are in it.
+ */
+ private class DateTimeFormValidator extends AbstractFormValidator {
+
+ private static final long serialVersionUID = 6842264694946633582L;
+
+ private FormComponent[] dateTimeComponents;
+
+ public DateTimeFormValidator(final DateTimeField dateTimeComponent) {
+ if (dateTimeComponent == null) {
+ throw new IllegalArgumentException("argument dateTimeComponent cannot be null");
+ }
+
+ dateTimeComponents = new FormComponent[] { dateTimeComponent };
+ }
+
+ @Override
+ public FormComponent[] getDependentFormComponents() {
+ return dateTimeComponents;
+ }
+
+ /**
+ * Validation rule : all 3 fields (date,hours,minutes) must be not-null.
+ *
+ * @param form
+ */
+ @Override
+ public void validate(final Form form) {
+ final DateTimeField dateTimeField = (DateTimeField) dateTimeComponents[0];
+
+ if (!(dateTimeField.getDate() != null && dateTimeField.getHours() != null
+ && dateTimeField.getMinutes() != null)) {
+
+ ValidationError ve = new ValidationError();
+ ve.setVariables(DateTimeFormValidator.this.variablesMap());
+ ve.addKey(resourceKey());
+ dateTimeComponents[0].error((IValidationError) ve);
+ }
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ public FieldPanel<Date> setFormValidator(final Form form) {
+ if (field == null) {
+ LOG.error("Error setting form validator");
+ } else {
+ form.add(new DateTimeFormValidator(((DateTimeField) field)));
+ this.form = form;
+ }
+
+ return this;
+ }
+
+ @Override
+ public FieldPanel<Date> setStyleSheet(final String classes) {
+ field.get("date").add(AttributeModifier.replace("class", (classes == null ? "" : classes) + " date_size"));
+
+ field.get("hours").add(AttributeModifier.replace("class", classes == null ? "" : classes));
+
+ field.get("minutes").add(AttributeModifier.replace("class", classes == null ? "" : classes));
+
+ field.get("amOrPmChoice").add(AttributeModifier.replace("class", classes == null ? "" : classes));
+
+ return this;
+ }
+
+ @Override
+ public FieldPanel<Date> clone() {
+ final FieldPanel<Date> panel = new DateTimeFieldPanel(getId(), name, new Model<Date>(null), datePattern);
+
+ panel.setRequired(isRequired());
+ panel.setReadOnly(isReadOnly());
+ panel.setTitle(title);
+
+ if (isRequiredLabelAdded) {
+ panel.addRequiredLabel();
+ }
+
+ if (form != null && isRequired()) {
+ ((DateTimeFieldPanel) panel).setFormValidator(form);
+ }
+
+ return panel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
new file mode 100644
index 0000000..8dbc434
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
@@ -0,0 +1,199 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.Serializable;
+import java.util.List;
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public abstract class FieldPanel<T> extends AbstractFieldPanel<T> implements Cloneable {
+
+ private static final long serialVersionUID = -198988924922541273L;
+
+ protected FormComponent<T> field = null;
+
+ protected String title = null;
+
+ protected boolean isRequiredLabelAdded = false;
+
+ public FieldPanel(final String id, final IModel<T> model) {
+ super(id, model);
+
+ final Fragment fragment = new Fragment("required", "notRequiredFragment", this);
+ add(fragment);
+
+ setOutputMarkupId(true);
+ }
+
+ public FormComponent<T> getField() {
+ return field;
+ }
+
+ public FieldPanel<T> setTitle(final String title) {
+ this.title = title;
+ field.add(AttributeModifier.replace("title", title != null
+ ? title
+ : ""));
+
+ return this;
+ }
+
+ public FieldPanel<T> setStyleSheet(final String classes) {
+ field.add(AttributeModifier.replace("class", classes != null
+ ? classes
+ : ""));
+
+ return this;
+ }
+
+ public FieldPanel<T> setRequired(boolean required) {
+ field.setRequired(required);
+
+ return this;
+ }
+
+ public FieldPanel<T> setReadOnly(boolean readOnly) {
+ field.setEnabled(!readOnly);
+
+ return this;
+ }
+
+ public boolean isRequired() {
+ return field.isRequired();
+ }
+
+ public boolean isReadOnly() {
+ return !field.isEnabled();
+ }
+
+ public FieldPanel<T> addRequiredLabel() {
+ if (!isRequired()) {
+ setRequired(true);
+ }
+
+ final Fragment fragment = new Fragment("required", "requiredFragment", this);
+
+ fragment.add(new Label("requiredLabel", "*"));
+
+ replace(fragment);
+
+ this.isRequiredLabelAdded = true;
+
+ return this;
+ }
+
+ public FieldPanel<T> removeRequiredLabel() {
+ if (isRequired()) {
+ setRequired(false);
+ }
+
+ final Fragment fragment = new Fragment("required", "notRequiredFragment", this);
+
+ replace(fragment);
+
+ this.isRequiredLabelAdded = false;
+
+ return this;
+ }
+
+ @Override
+ public FieldPanel<T> setModelObject(final T object) {
+ field.setModelObject(object);
+ return this;
+ }
+
+ public T getModelObject() {
+ return (T) field.getModelObject();
+ }
+
+ public FieldPanel<T> setNewModel(final IModel<T> model) {
+ field.setModel(model);
+ return this;
+ }
+
+ /**
+ * Used by MultiValueSelectorPanel to attach items.
+ *
+ * @param item item to attach.
+ * @return updated FieldPanel object.
+ */
+ public FieldPanel<T> setNewModel(final ListItem<T> item) {
+ setNewModel(new IModel<T>() {
+
+ private static final long serialVersionUID = 6799404673615637845L;
+
+ @Override
+ public T getObject() {
+ return item.getModelObject();
+ }
+
+ @Override
+ public void setObject(final T object) {
+ item.setModelObject(object);
+ }
+
+ @Override
+ public void detach() {
+ // no detach
+ }
+ });
+ return this;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public FieldPanel<T> setNewModel(final List<Serializable> list) {
+ setNewModel(new Model() {
+
+ private static final long serialVersionUID = 1088212074765051906L;
+
+ @Override
+ public Serializable getObject() {
+ return list == null || list.isEmpty()
+ ? null
+ : list.get(0);
+ }
+
+ @Override
+ public void setObject(final Serializable object) {
+ list.clear();
+
+ if (object != null) {
+ list.add(object);
+ }
+ }
+ });
+
+ return this;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public FieldPanel<T> clone() {
+ final FieldPanel<T> panel = SerializationUtils.clone(this);
+ panel.setModelObject(null);
+ return panel;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.java
new file mode 100644
index 0000000..b31bbab
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/LinkPanel.java
@@ -0,0 +1,39 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+
+/**
+ * This empty class must exist because there not seems to be alternative to
+ * provide specialized HTML for links.
+ */
+public class LinkPanel extends Panel {
+
+ private static final long serialVersionUID = 4799005986804366330L;
+
+ public LinkPanel(final String id) {
+ super(id);
+ }
+
+ public LinkPanel(final String id, final IModel<?> model) {
+ super(id, model);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.java
new file mode 100644
index 0000000..2c41f37
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MappingPurposePanel.java
@@ -0,0 +1,133 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class MappingPurposePanel extends Panel {
+
+ private static final long serialVersionUID = 322966537010107771L;
+
+ private final AjaxLink<Void> propagation;
+
+ private final AjaxLink<Void> synchronization;
+
+ private final AjaxLink<Void> both;
+
+ private final AjaxLink<Void> none;
+
+ public MappingPurposePanel(final String componentId, final IModel<MappingPurpose> model,
+ final WebMarkupContainer container) {
+
+ super(componentId, model);
+
+ propagation = new AjaxLink<Void>("propagationPurposeLink") {
+
+ private static final long serialVersionUID = -6957616042924610305L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ model.setObject(MappingPurpose.PROPAGATION);
+ setOpacity(MappingPurpose.PROPAGATION);
+ target.add(container);
+ }
+ };
+
+ synchronization = new AjaxLink<Void>("synchronizationPurposeLink") {
+
+ private static final long serialVersionUID = -6957616042924610305L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ model.setObject(MappingPurpose.SYNCHRONIZATION);
+ setOpacity(MappingPurpose.SYNCHRONIZATION);
+ target.add(container);
+ }
+ };
+
+ both = new AjaxLink<Void>("bothPurposeLink") {
+
+ private static final long serialVersionUID = -6957616042924610305L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ model.setObject(MappingPurpose.BOTH);
+ setOpacity(MappingPurpose.BOTH);
+ target.add(container);
+ }
+ };
+
+ none = new AjaxLink<Void>("nonePurposeLink") {
+
+ private static final long serialVersionUID = -6957616042924610305L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ model.setObject(MappingPurpose.NONE);
+ setOpacity(MappingPurpose.NONE);
+ target.add(container);
+ }
+ };
+
+ add(propagation);
+ add(synchronization);
+ add(both);
+ add(none);
+
+ setOpacity(model.getObject());
+ }
+
+ private void setOpacity(final MappingPurpose mappingPurpose) {
+ switch (mappingPurpose) {
+ case PROPAGATION:
+ propagation.add(new AttributeModifier("style", new Model<String>("opacity: 1;")));
+ synchronization.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ both.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ none.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ break;
+ case SYNCHRONIZATION:
+ synchronization.add(new AttributeModifier("style", new Model<String>("opacity: 1;")));
+ propagation.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ both.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ none.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ break;
+ case BOTH:
+ both.add(new AttributeModifier("style", new Model<String>("opacity: 1;")));
+ propagation.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ synchronization.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ none.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ break;
+ case NONE:
+ none.add(new AttributeModifier("style", new Model<String>("opacity: 1;")));
+ synchronization.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ propagation.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ both.add(new AttributeModifier("style", new Model<String>("opacity: 0.3;")));
+ break;
+ default:
+ // do nothing
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java
new file mode 100644
index 0000000..cd4ab2a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/MultiFieldPanel.java
@@ -0,0 +1,172 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.IModel;
+
+public class MultiFieldPanel<E> extends AbstractFieldPanel<List<E>> {
+
+ private static final long serialVersionUID = -6322397761456513324L;
+
+ private ListView<E> view;
+
+ private WebMarkupContainer container;
+
+ public MultiFieldPanel(final String id, final IModel<List<E>> model, final FieldPanel<E> panelTemplate) {
+ this(id, model, panelTemplate, false);
+ }
+
+ public MultiFieldPanel(final String id, final IModel<List<E>> model, final FieldPanel<E> panelTemplate,
+ final boolean eventTemplate) {
+
+ super(id, model);
+
+ // -----------------------
+ // Object container definition
+ // -----------------------
+ container = new WebMarkupContainer("multiValueContainer");
+ container.setOutputMarkupId(true);
+ add(container);
+ // -----------------------
+
+ view = new ListView<E>("view", model) {
+
+ private static final long serialVersionUID = -9180479401817023838L;
+
+ @Override
+ protected void populateItem(final ListItem<E> item) {
+ final FieldPanel<E> fieldPanel = panelTemplate.clone();
+
+ if (eventTemplate) {
+ fieldPanel.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(getPage(), Broadcast.BREADTH, new MultiValueSelectorEvent(target));
+ }
+ });
+ }
+
+ fieldPanel.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+
+ fieldPanel.setNewModel(item);
+ item.add(fieldPanel);
+
+ AjaxLink<Void> minus = new IndicatingAjaxLink<Void>("drop") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ //Drop current component
+ model.getObject().remove(item.getModelObject());
+ fieldPanel.getField().clearInput();
+ target.add(container);
+
+ if (eventTemplate) {
+ send(getPage(), Broadcast.BREADTH, new MultiValueSelectorEvent(target));
+ }
+ }
+ };
+
+ item.add(minus);
+
+ if (model.getObject().size() <= 1) {
+ minus.setVisible(false);
+ minus.setEnabled(false);
+ } else {
+ minus.setVisible(true);
+ minus.setEnabled(true);
+ }
+
+ final Fragment fragment;
+ if (item.getIndex() == model.getObject().size() - 1) {
+ final AjaxLink<Void> plus = new IndicatingAjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ //Add current component
+ model.getObject().add(null);
+ target.add(container);
+ }
+ };
+
+ fragment = new Fragment("panelPlus", "fragmentPlus", container);
+
+ fragment.add(plus);
+ } else {
+ fragment = new Fragment("panelPlus", "emptyFragment", container);
+ }
+ item.add(fragment);
+ }
+ };
+
+ container.add(view.setOutputMarkupId(true));
+ setOutputMarkupId(true);
+ }
+
+ public ListView<E> getView() {
+ return view;
+ }
+
+ public WebMarkupContainer getContainer() {
+ return container;
+ }
+
+ @Override
+ public MultiFieldPanel<E> setModelObject(final List<E> object) {
+ view.setModelObject(object);
+ return this;
+ }
+
+ public static class MultiValueSelectorEvent {
+
+ final AjaxRequestTarget target;
+
+ public MultiValueSelectorEvent(final AjaxRequestTarget target) {
+ this.target = target;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java
new file mode 100644
index 0000000..55038da
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/NonI18nPalette.java
@@ -0,0 +1,44 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.Collection;
+import java.util.List;
+import org.apache.wicket.extensions.markup.html.form.palette.Palette;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.IModel;
+
+public class NonI18nPalette<T> extends Palette<T> {
+
+ private static final long serialVersionUID = 2659070187837941889L;
+
+ public NonI18nPalette(final String id,
+ final IModel<? extends List<? extends T>> model,
+ final IModel<? extends Collection<? extends T>> choicesModel,
+ final IChoiceRenderer<T> choiceRenderer, final int rows,
+ final boolean allowOrder, final boolean allowMoveAll) {
+
+ super(id, model, choicesModel, choiceRenderer, rows, allowOrder, allowMoveAll);
+ }
+
+ @Override
+ protected boolean localizeDisplayValues() {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectableRecorder.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectableRecorder.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectableRecorder.java
new file mode 100644
index 0000000..2893533
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SelectableRecorder.java
@@ -0,0 +1,204 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.wicket.WicketRuntimeException;
+import org.apache.wicket.extensions.markup.html.form.palette.Palette;
+import org.apache.wicket.extensions.markup.html.form.palette.component.Recorder;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.string.Strings;
+
+/**
+ * A variant of Recorder, supporting single element selection (for editing purpose, for example). <b>Note</b>: this
+ * class extends Recorder<T> but in fact it is a bare copy of most source code; this was done because the original class
+ * is keeping everything private.
+ *
+ * @param <T> Type of the palette
+ */
+public class SelectableRecorder<T> extends Recorder<T> {
+
+ private static final long serialVersionUID = -3009044376132921879L;
+
+ private boolean attached = false;
+
+ private static final String[] EMPTY_IDS = new String[0];
+
+ /**
+ * Conveniently maintained array of selected ids.
+ */
+ private String[] ids;
+
+ private String selectedId;
+
+ public SelectableRecorder(final String id, final Palette<T> palette) {
+ super(id, palette);
+ }
+
+ @Override
+ protected void onBeforeRender() {
+ super.onBeforeRender();
+
+ if (!getForm().hasError()) {
+ initIds();
+ } else if (ids == null) {
+ ids = EMPTY_IDS;
+ }
+ attached = true;
+ }
+
+ /**
+ * Synchronize ids collection from the palette's model
+ */
+ private void initIds() {
+ // construct the model string based on selection collection
+ IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+ StringBuilder modelStringBuffer = new StringBuilder();
+ Collection<T> modelCollection = getPalette().getModelCollection();
+ if (modelCollection == null) {
+ throw new WicketRuntimeException("Expected getPalette().getModelCollection() to return a non-null value."
+ + " Please make sure you have model object assigned to the palette");
+ }
+ Iterator<T> selection = modelCollection.iterator();
+
+ int i = 0;
+ while (selection.hasNext()) {
+ modelStringBuffer.append(renderer.getIdValue(selection.next(), i++));
+ if (selection.hasNext()) {
+ modelStringBuffer.append(",");
+ }
+ }
+
+ // set model and update ids array
+ String modelString = modelStringBuffer.toString();
+ setDefaultModel(new Model<String>(modelString));
+ updateIds(modelString);
+ }
+
+ public T getSelectedItem() {
+ if (selectedId == null) {
+ return null;
+ }
+
+ IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+
+ T selected = null;
+ for (T choice : getPalette().getChoices()) {
+ if (renderer.getIdValue(choice, 0).equals(selectedId)) {
+ selected = choice;
+ break;
+ }
+ }
+
+ return selected;
+ }
+
+ /**
+ * @return iterator over selected choices
+ */
+ @Override
+ public Iterator<T> getSelectedChoices() {
+ IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+ if (ids.length == 0) {
+ return Collections.<T>emptyList().iterator();
+ }
+
+ List<T> selected = new ArrayList<T>(ids.length);
+ for (String id : ids) {
+ for (T choice : getPalette().getChoices()) {
+ if (renderer.getIdValue(choice, 0).equals(id)) {
+ selected.add(choice);
+ break;
+ }
+ }
+ }
+ return selected.iterator();
+ }
+
+ /**
+ * @return iterator over unselected choices
+ */
+ @Override
+ public Iterator<T> getUnselectedChoices() {
+ IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
+ Collection<? extends T> choices = getPalette().getChoices();
+
+ if (choices.size() - ids.length == 0) {
+ return Collections.<T>emptyList().iterator();
+ }
+
+ List<T> unselected = new ArrayList<T>(Math.max(1, choices.size() - ids.length));
+ for (T choice : choices) {
+ final String choiceId = renderer.getIdValue(choice, 0);
+ boolean selected = false;
+ for (String id : ids) {
+ if (id.equals(choiceId)) {
+ selected = true;
+ break;
+ }
+ }
+ if (!selected) {
+ unselected.add(choice);
+ }
+ }
+ return unselected.iterator();
+ }
+
+ @Override
+ protected void onValid() {
+ super.onValid();
+ if (attached) {
+ updateIds();
+ }
+ }
+
+ @Override
+ protected void onInvalid() {
+ super.onInvalid();
+ if (attached) {
+ updateIds();
+ }
+ }
+
+ private void updateIds() {
+ updateIds(getValue());
+ }
+
+ @Override
+ protected void updateIds(final String value) {
+ if (Strings.isEmpty(value)) {
+ ids = EMPTY_IDS;
+ } else {
+ if (value.indexOf('|') == -1) {
+ ids = value.split(",");
+ selectedId = null;
+ } else {
+ String[] splitted = value.split("\\|");
+ selectedId = splitted[0];
+ ids = splitted[1].split(",");
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.java
new file mode 100644
index 0000000..4f71f81
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/SpinnerFieldPanel.java
@@ -0,0 +1,197 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.UUID;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.springframework.util.StringUtils;
+
+public class SpinnerFieldPanel<T extends Number> extends FieldPanel<T> {
+
+ private static final long serialVersionUID = 6413819574530703577L;
+
+ private final String name;
+
+ private final Class<T> reference;
+
+ private final IModel<T> model;
+
+ private final T min;
+
+ private final T max;
+
+ @SuppressWarnings("unchecked")
+ public SpinnerFieldPanel(final String id, final String name, final Class<T> reference, final IModel<T> model,
+ final T min, final T max) {
+
+ super(id, model);
+ this.name = name;
+ this.reference = reference;
+ this.model = model;
+ this.min = min;
+ this.max = max;
+
+ String uuid = UUID.randomUUID().toString();
+ field = new TextField<T>("spinnerField", model, reference);
+ field.setMarkupId(uuid);
+ add(field.setLabel(new Model<String>(name)));
+
+ if (!isReadOnly()) {
+ field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // nothing to do
+ }
+ });
+ }
+
+ final StringBuilder statements = new StringBuilder();
+ statements.append("jQuery(function() {").
+ append("var spinner = $('#").append(uuid).append("').spinner();").
+ append("$('#").append(uuid).append("').spinner(").
+ append("'option', 'stop', function(event, ui) { $(this).change(); });");
+ if (this.min != null) {
+ statements.
+ append("$('#").append(uuid).append("').spinner(").
+ append("'option', 'min', ").append(this.min).append(");");
+ }
+ if (this.max != null) {
+ statements.
+ append("$('#").append(uuid).append("').spinner(").
+ append("'option', 'max', ").append(this.max).append(");");
+ }
+ statements.append("});");
+ Label spinnerFieldJS = new Label("spinnerFieldJS", statements.toString());
+ spinnerFieldJS.setEscapeModelStrings(false);
+ add(spinnerFieldJS);
+ }
+
+ @Override
+ public SpinnerFieldPanel<T> setNewModel(final List<Serializable> list) {
+ setNewModel(new Model<T>() {
+
+ private static final long serialVersionUID = 527651414610325237L;
+
+ @Override
+ public T getObject() {
+ T value = null;
+
+ if (list != null && !list.isEmpty() && StringUtils.hasText(list.get(0).toString())) {
+ value = reference.equals(Integer.class)
+ ? reference.cast(NumberUtils.toInt(list.get(0).toString()))
+ : reference.equals(Long.class)
+ ? reference.cast(NumberUtils.toLong(list.get(0).toString()))
+ : reference.equals(Short.class)
+ ? reference.cast(NumberUtils.toShort(list.get(0).toString()))
+ : reference.equals(Float.class)
+ ? reference.cast(NumberUtils.toFloat(list.get(0).toString()))
+ : reference.equals(byte.class)
+ ? reference.cast(NumberUtils.toByte(list.get(0).toString()))
+ : reference.cast(NumberUtils.toDouble(list.get(0).toString()));
+ }
+
+ return value;
+ }
+
+ @Override
+ public void setObject(final T object) {
+ list.clear();
+ if (object != null) {
+ list.add(object.toString());
+ }
+ }
+ });
+
+ return this;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public SpinnerFieldPanel<T> setNewModel(final ListItem item) {
+ field.setModel(new Model<T>() {
+
+ private static final long serialVersionUID = 6799404673615637845L;
+
+ @Override
+ public T getObject() {
+ T number = null;
+
+ final Object obj = item.getModelObject();
+
+ if (obj != null && !obj.toString().isEmpty()) {
+ if (obj instanceof String) {
+ number = reference.equals(Integer.class)
+ ? reference.cast(Integer.valueOf((String) obj))
+ : reference.equals(Long.class)
+ ? reference.cast(Long.valueOf((String) obj))
+ : reference.equals(Short.class)
+ ? reference.cast(Short.valueOf((String) obj))
+ : reference.equals(Float.class)
+ ? reference.cast(Float.valueOf((String) obj))
+ : reference.equals(byte.class)
+ ? reference.cast(Byte.valueOf((String) obj))
+ : reference.cast(Double.valueOf((String) obj));
+ } else if (obj instanceof Number) {
+ // Don't parse anything
+ number = reference.cast(obj);
+ }
+ }
+
+ return number;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void setObject(final T object) {
+ item.setModelObject(object == null ? null : object.toString());
+ }
+ });
+
+ return this;
+ }
+
+ @Override
+ public SpinnerFieldPanel<T> clone() {
+ SpinnerFieldPanel<T> panel = new SpinnerFieldPanel<T>(getId(), name, reference, model, min, max);
+
+ panel.setRequired(isRequired());
+ panel.setReadOnly(isReadOnly());
+ panel.setTitle(title);
+
+ if (isRequiredLabelAdded) {
+ panel.addRequiredLabel();
+ }
+
+ return panel;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.java
new file mode 100644
index 0000000..24bdb47
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/AbstractBinaryPreviewer.java
@@ -0,0 +1,46 @@
+/*
+ * 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.wicket.markup.html.form.preview;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractBinaryPreviewer extends Panel {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractBinaryPreviewer.class);
+
+ private static final long serialVersionUID = -2482706463911903025L;
+
+ protected final String mimeType;
+
+ protected final byte[] uploadedBytes;
+
+ public AbstractBinaryPreviewer(final String id, final String mimeType, final byte[] uploadedBytes) {
+ super(id);
+ this.mimeType = mimeType;
+ this.uploadedBytes = uploadedBytes;
+ }
+
+ public abstract Component preview();
+}
[37/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
new file mode 100644
index 0000000..4a3589c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModalPage.java
@@ -0,0 +1,426 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.ConnIdSpecialAttributeName;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.commons.status.Status;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Show user or role status after performing a successful operation.
+ */
+public class ResultStatusModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 2646115294319713723L;
+
+ private static final String IMG_STATUSES = "statuses/";
+
+ @SpringBean(name = "anonymousUser")
+ private String anonymousUser;
+
+ private final AbstractSubjectTO subject;
+
+ private final Mode mode;
+
+ /**
+ * Status management utilities.
+ */
+ private final StatusUtils statusUtils;
+
+ public static class Builder implements Serializable {
+
+ private static final long serialVersionUID = 220361441802274899L;
+
+ private ModalWindow window;
+
+ private Mode mode;
+
+ private AbstractSubjectTO subject;
+
+ public Builder(final ModalWindow window, final AbstractSubjectTO attributable) {
+ this.window = window;
+ this.subject = attributable;
+ }
+
+ public ResultStatusModalPage.Builder mode(final Mode mode) {
+ this.mode = mode;
+ return this;
+ }
+
+ public ResultStatusModalPage build() {
+ return new ResultStatusModalPage(this);
+ }
+ }
+
+ private ResultStatusModalPage(final Builder builder) {
+ super();
+ this.subject = builder.subject;
+ statusUtils = new StatusUtils(this.userRestClient);
+ if (builder.mode == null) {
+ this.mode = Mode.ADMIN;
+ } else {
+ this.mode = builder.mode;
+ }
+
+ final BaseModalPage page = this;
+
+ final WebMarkupContainer container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ final Fragment fragment = new Fragment("resultFrag", mode == Mode.SELF
+ ? "userSelfResultFrag"
+ : "propagationResultFrag", this);
+ fragment.setOutputMarkupId(true);
+ container.add(fragment);
+
+ if (mode == Mode.ADMIN) {
+ // add Syncope propagation status
+ PropagationStatus syncope = new PropagationStatus();
+ syncope.setResource("Syncope");
+ syncope.setStatus(PropagationTaskExecStatus.SUCCESS);
+
+ List<PropagationStatus> propagations = new ArrayList<PropagationStatus>();
+ propagations.add(syncope);
+ propagations.addAll(subject.getPropagationStatusTOs());
+
+ fragment.add(new Label("info",
+ ((subject instanceof UserTO) && ((UserTO) subject).getUsername() != null)
+ ? ((UserTO) subject).getUsername()
+ : ((subject instanceof RoleTO) && ((RoleTO) subject).getName() != null)
+ ? ((RoleTO) subject).getName()
+ : String.valueOf(subject.getKey())));
+
+ final ListView<PropagationStatus> propRes = new ListView<PropagationStatus>("resources",
+ propagations) {
+
+ private static final long serialVersionUID = -1020475259727720708L;
+
+ @Override
+ protected void populateItem(final ListItem<PropagationStatus> item) {
+ final PropagationStatus propTO = (PropagationStatus) item.getDefaultModelObject();
+
+ final ListView attributes = getConnObjectView(propTO);
+
+ final Fragment attrhead;
+ if (attributes.getModelObject() == null || attributes.getModelObject().isEmpty()) {
+ attrhead = new Fragment("attrhead", "emptyAttrHeadFrag", page);
+ } else {
+ attrhead = new Fragment("attrhead", "attrHeadFrag", page);
+ }
+
+ item.add(attrhead);
+ item.add(attributes);
+
+ attrhead.add(new Label("resource", propTO.getResource()));
+
+ attrhead.add(new Label("propagation", propTO.getStatus() == null
+ ? "UNDEFINED" : propTO.getStatus().toString()));
+
+ final Image image;
+ final String alt, title;
+ final ModalWindow failureWindow = new ModalWindow("failureWindow");
+ final AjaxLink<?> failureWindowLink = new AjaxLink<Void>("showFailureWindow") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ failureWindow.show(target);
+ }
+ };
+
+ switch (propTO.getStatus()) {
+
+ case SUCCESS:
+ case SUBMITTED:
+ case CREATED:
+ image = new Image("icon", IMG_STATUSES + Status.ACTIVE.toString()
+ + Constants.PNG_EXT);
+ alt = "success icon";
+ title = "success";
+ failureWindow.setVisible(false);
+ failureWindowLink.setEnabled(false);
+ break;
+
+ default:
+ image = new Image("icon", IMG_STATUSES + Status.SUSPENDED.toString()
+ + Constants.PNG_EXT);
+ alt = "failure icon";
+ title = "failure";
+ }
+
+ image.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("alt", alt);
+ tag.put("title", title);
+ }
+ });
+ final FailureMessageModalPage executionFailureMessagePage;
+ if (propTO.getFailureReason() == null) {
+ executionFailureMessagePage =
+ new FailureMessageModalPage(failureWindow.getContentId(), StringUtils.EMPTY);
+ } else {
+ executionFailureMessagePage =
+ new FailureMessageModalPage(failureWindow.getContentId(), propTO.getFailureReason());
+ }
+
+ failureWindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return executionFailureMessagePage;
+ }
+ });
+ failureWindow.setCookieName("failureWindow");
+ failureWindow.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ failureWindowLink.add(image);
+ attrhead.add(failureWindowLink);
+ attrhead.add(failureWindow);
+ }
+ };
+ fragment.add(propRes);
+ }
+
+ final AjaxLink<Void> close = new IndicatingAjaxLink<Void>("close") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ builder.window.close(target);
+ }
+ };
+ container.add(close);
+
+ setOutputMarkupId(true);
+ }
+
+ /**
+ * Get remote attributes list view.
+ *
+ * @param propTO propagation TO.
+ * @return list view.
+ */
+ private ListView<String> getConnObjectView(final PropagationStatus propTO) {
+ final ConnObjectTO before = propTO.getBeforeObj();
+ final ConnObjectTO after = propTO.getAfterObj();
+
+ // sorted in reversed presentation order
+ final List<String> head = new ArrayList<String>();
+ if (subject instanceof UserTO) {
+ head.add(ConnIdSpecialAttributeName.PASSWORD);
+ head.add(ConnIdSpecialAttributeName.ENABLE);
+ }
+ head.add(ConnIdSpecialAttributeName.UID);
+ head.add(ConnIdSpecialAttributeName.NAME);
+
+ final Map<String, AttrTO> beforeAttrMap = before == null
+ ? Collections.<String, AttrTO>emptyMap()
+ : before.getPlainAttrMap();
+
+ final Map<String, AttrTO> afterAttrMap = after == null
+ ? Collections.<String, AttrTO>emptyMap()
+ : after.getPlainAttrMap();
+
+ final Set<String> attributes = new HashSet<String>();
+ attributes.addAll(beforeAttrMap.keySet());
+ attributes.addAll(afterAttrMap.keySet());
+
+ if (!(subject instanceof UserTO)) {
+ attributes.remove(ConnIdSpecialAttributeName.PASSWORD);
+ attributes.remove(ConnIdSpecialAttributeName.ENABLE);
+ }
+
+ final List<String> profile = new ArrayList<String>();
+ profile.addAll(attributes);
+ profile.removeAll(head);
+ Collections.sort(profile);
+
+ for (String attr : head) {
+ if (attributes.contains(attr)) {
+ profile.add(0, attr);
+ }
+ }
+
+ return new ListView<String>("attrs", profile) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ String name = item.getModelObject();
+
+ final Fragment beforeValue;
+ final Fragment afterValue;
+ if (ConnIdSpecialAttributeName.ENABLE.equals(name)) {
+ beforeValue = getStatusIcon("beforeValue", propTO.getResource(), before);
+ afterValue = getStatusIcon("afterValue", propTO.getResource(), after);
+ } else {
+ beforeValue = getLabelValue("beforeValue", name, beforeAttrMap);
+ afterValue = getLabelValue("afterValue", name, afterAttrMap);
+ }
+
+ item.add(new Label("attrName", new ResourceModel(name, name)));
+
+ item.add(beforeValue);
+ item.add(afterValue);
+ }
+ };
+ }
+
+ /**
+ * Get fragment for attribute value (not remote status).
+ *
+ * @param id component id to be replaced with the fragment content.
+ * @param attrName remote attribute name
+ * @param attrMap remote attributes map.
+ * @return fragment.
+ */
+ private Fragment getLabelValue(final String id, final String attrName, final Map<String, AttrTO> attrMap) {
+ final String value;
+
+ final AttrTO attr = attrMap.get(attrName);
+
+ if (attr == null || attr.getValues() == null || attr.getValues().isEmpty()) {
+ value = "";
+ } else {
+ if (ConnIdSpecialAttributeName.PASSWORD.equals(attrName)) {
+ value = "********";
+ } else {
+ value = attr.getValues().size() > 1
+ ? attr.getValues().toString()
+ : attr.getValues().get(0);
+ }
+ }
+
+ Component label = new Label("value", value.length() > 50 ? value.substring(0, 50) + "..." : value).
+ add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("title", value);
+ }
+ });
+
+ final Fragment frag = new Fragment(id, "attrValueFrag", this);
+ frag.add(label);
+
+ return frag;
+ }
+
+ /**
+ * Get fragment for user status icon.
+ *
+ * @param id component id to be replaced with the fragment content
+ * @param resourceName resource name
+ * @param objectTO connector object TO
+ * @return fragment.
+ */
+ private Fragment getStatusIcon(final String id, final String resourceName, final ConnObjectTO objectTO) {
+ final Image image;
+ final String alt, title;
+ switch (statusUtils.getStatusBean(
+ subject, resourceName, objectTO, this.subject instanceof RoleTO).getStatus()) {
+
+ case ACTIVE:
+ image = new Image("status", IMG_STATUSES + Status.ACTIVE.toString()
+ + Constants.PNG_EXT);
+ alt = "active icon";
+ title = "Enabled";
+ break;
+
+ case SUSPENDED:
+ image = new Image("status", IMG_STATUSES + Status.SUSPENDED.toString()
+ + Constants.PNG_EXT);
+ alt = "inactive icon";
+ title = "Disabled";
+ break;
+
+ default:
+ image = null;
+ alt = null;
+ title = null;
+ }
+
+ final Fragment frag;
+ if (image == null) {
+ frag = new Fragment(id, "emptyFrag", this);
+ } else {
+ image.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("alt", alt);
+ tag.put("title", title);
+ tag.put("width", "12px");
+ tag.put("height", "12px");
+ }
+ });
+
+ frag = new Fragment(id, "remoteStatusFrag", this);
+ frag.add(image);
+ }
+
+ return frag;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java
new file mode 100644
index 0000000..3cb9148
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleModalPage.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.panels.RolePanel;
+import org.apache.syncope.common.lib.AttributableOperations;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Modal window with Role form.
+ */
+public class RoleModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -1732493223434085205L;
+
+ protected final PageReference pageRef;
+
+ protected final ModalWindow window;
+
+ protected final Mode mode;
+
+ protected final boolean createFlag;
+
+ protected final RolePanel rolePanel;
+
+ protected RoleTO originalRoleTO;
+
+ public RoleModalPage(final PageReference pageRef, final ModalWindow window, final RoleTO roleTO) {
+ this(pageRef, window, roleTO, Mode.ADMIN);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public RoleModalPage(final PageReference pageRef, final ModalWindow window, final RoleTO roleTO, final Mode mode) {
+ super();
+
+ this.pageRef = pageRef;
+ this.window = window;
+ this.mode = mode;
+
+ this.createFlag = roleTO.getKey() == 0;
+ if (!createFlag) {
+ originalRoleTO = SerializationUtils.clone(roleTO);
+ }
+
+ final Form<RoleTO> form = new Form<RoleTO>("roleForm");
+ form.setMultiPart(true);
+
+ add(new Label("displayName", roleTO.getKey() == 0 ? "" : roleTO.getDisplayName()));
+
+ form.setModel(new CompoundPropertyModel<RoleTO>(roleTO));
+
+ this.rolePanel = new RolePanel.Builder("rolePanel").form(form).roleTO(roleTO).
+ roleModalPageMode(mode).pageRef(getPageReference()).build();
+ form.add(rolePanel);
+
+ final AjaxButton submit = new IndicatingAjaxButton(SUBMIT, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ submitAction(target, form);
+
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ closeAction(target, form);
+ } catch (Exception e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ closeAction(target, form);
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getEntitlement("Roles",
+ createFlag
+ ? "create"
+ : "update"));
+
+ add(form);
+ }
+
+ protected void submitAction(final AjaxRequestTarget target, final Form<?> form) {
+ final RoleTO roleTO = (RoleTO) form.getDefaultModelObject();
+ final List<String> entitlementList = new ArrayList<String>(rolePanel.getSelectedEntitlements());
+ roleTO.getEntitlements().clear();
+ roleTO.getEntitlements().addAll(entitlementList);
+
+ RoleTO result;
+ if (createFlag) {
+ result = roleRestClient.create(roleTO);
+ } else {
+ RoleMod roleMod = AttributableOperations.diff(roleTO, originalRoleTO);
+
+ // update role just if it is changed
+ if (roleMod.isEmpty()) {
+ result = roleTO;
+ } else {
+ result = roleRestClient.update(originalRoleTO.getETagValue(), roleMod);
+ }
+ }
+
+ setResponsePage(new ResultStatusModalPage.Builder(window, result).build());
+ }
+
+ protected void closeAction(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java
new file mode 100644
index 0000000..26b1aea
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleSelectModalPage.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.lang.reflect.Constructor;
+import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.syncope.client.console.commons.RoleTreeBuilder;
+import org.apache.syncope.client.console.wicket.markup.html.tree.DefaultMutableTreeNodeExpansion;
+import org.apache.syncope.client.console.wicket.markup.html.tree.DefaultMutableTreeNodeExpansionModel;
+import org.apache.syncope.client.console.wicket.markup.html.tree.TreeRoleProvider;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.tree.DefaultNestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.ITreeProvider;
+import org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder;
+import org.apache.wicket.extensions.markup.html.repeater.tree.theme.WindowsTheme;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class RoleSelectModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 2106489458494696439L;
+
+ @SpringBean
+ private RoleTreeBuilder roleTreeBuilder;
+
+ private final NestedTree<DefaultMutableTreeNode> tree;
+
+ public RoleSelectModalPage(final PageReference pageRef, final ModalWindow window, final Class<?> payloadClass) {
+ super();
+
+ final ITreeProvider<DefaultMutableTreeNode> treeProvider = new TreeRoleProvider(roleTreeBuilder, true);
+ final DefaultMutableTreeNodeExpansionModel treeModel = new DefaultMutableTreeNodeExpansionModel();
+
+ tree = new DefaultNestedTree<DefaultMutableTreeNode>("treeTable", treeProvider, treeModel) {
+
+ private static final long serialVersionUID = 7137658050662575546L;
+
+ @Override
+ protected Component newContentComponent(final String id, final IModel<DefaultMutableTreeNode> node) {
+ final DefaultMutableTreeNode treeNode = node.getObject();
+ final RoleTO roleTO = (RoleTO) treeNode.getUserObject();
+
+ return new Folder<DefaultMutableTreeNode>(id, RoleSelectModalPage.this.tree, node) {
+
+ private static final long serialVersionUID = 9046323319920426493L;
+
+ @Override
+ protected boolean isClickable() {
+ return true;
+ }
+
+ @Override
+ protected IModel<?> newLabelModel(final IModel<DefaultMutableTreeNode> model) {
+ return new Model<>(roleTO.getDisplayName());
+ }
+
+ @Override
+ protected void onClick(final AjaxRequestTarget target) {
+ super.onClick(target);
+
+ try {
+ Constructor<?> constructor = payloadClass.getConstructor(Long.class);
+ Object payload = constructor.newInstance(roleTO.getKey());
+
+ send(pageRef.getPage(), Broadcast.BREADTH, payload);
+ } catch (Exception e) {
+ LOG.error("Could not send role select event", e);
+ }
+
+ window.close(target);
+ }
+ };
+ }
+ };
+ tree.add(new WindowsTheme());
+ tree.setOutputMarkupId(true);
+
+ DefaultMutableTreeNodeExpansion.get().expandAll();
+
+ this.add(tree);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java
new file mode 100644
index 0000000..6639517
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/RoleTemplateModalPage.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+
+public class RoleTemplateModalPage extends RoleModalPage {
+
+ private static final long serialVersionUID = -3849135555203409845L;
+
+ private final SyncTaskTO syncTaskTO;
+
+ public RoleTemplateModalPage(final PageReference callerPageRef, final ModalWindow window,
+ final SyncTaskTO syncTaskTO) {
+
+ super(callerPageRef, window, syncTaskTO.getRoleTemplate() == null
+ ? new RoleTO()
+ : syncTaskTO.getRoleTemplate(), Mode.TEMPLATE);
+
+ this.syncTaskTO = syncTaskTO;
+ }
+
+ @Override
+ protected void submitAction(final AjaxRequestTarget target, final Form form) {
+ syncTaskTO.setRoleTemplate((RoleTO) form.getModelObject());
+ taskRestClient.updateSyncTask(syncTaskTO);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
new file mode 100644
index 0000000..8310792
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Roles.java
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel;
+import org.apache.syncope.client.console.panels.RoleSearchPanel;
+import org.apache.syncope.client.console.panels.RoleSearchResultPanel;
+import org.apache.syncope.client.console.panels.RoleSummaryPanel;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.client.console.wicket.markup.html.tree.TreeRolePanel;
+import org.apache.wicket.Session;
+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.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Roles WebPage.
+ */
+public class Roles extends BasePage {
+
+ private static final long serialVersionUID = -2147758241610831969L;
+
+ private static final int WIN_HEIGHT = 500;
+
+ private static final int WIN_WIDTH = 800;
+
+ @SpringBean
+ private RoleRestClient restClient;
+
+ private final ModalWindow editRoleWin;
+
+ private final WebMarkupContainer roleTabsContainer;
+
+ public Roles(final PageParameters parameters) {
+ super(parameters);
+
+ roleTabsContainer = new WebMarkupContainer("roleTabsContainer");
+ roleTabsContainer.setOutputMarkupId(true);
+ add(roleTabsContainer);
+
+ editRoleWin = new ModalWindow("editRoleWin");
+ editRoleWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editRoleWin.setInitialHeight(WIN_HEIGHT);
+ editRoleWin.setInitialWidth(WIN_WIDTH);
+ editRoleWin.setCookieName("edit-role-modal");
+ add(editRoleWin);
+
+ final TreeRolePanel treePanel = new TreeRolePanel("treePanel");
+ treePanel.setOutputMarkupId(true);
+ roleTabsContainer.add(treePanel);
+
+ final RoleSummaryPanel summaryPanel = new RoleSummaryPanel.Builder("summaryPanel")
+ .window(editRoleWin).callerPageRef(Roles.this.getPageReference()).build();
+ roleTabsContainer.add(summaryPanel);
+
+ editRoleWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ final RoleSummaryPanel summaryPanel = (RoleSummaryPanel) roleTabsContainer.get("summaryPanel");
+
+ final TreeNodeClickUpdate data = new TreeNodeClickUpdate(target,
+ summaryPanel == null || summaryPanel.getSelectedNode() == null
+ ? 0
+ : summaryPanel.getSelectedNode().getKey());
+
+ send(getPage(), Broadcast.BREADTH, data);
+
+ if (modalResult) {
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ feedbackPanel.refresh(target);
+ modalResult = false;
+ }
+
+ }
+ });
+
+ final AbstractSearchResultPanel searchResult =
+ new RoleSearchResultPanel("searchResult", true, null, getPageReference(), restClient);
+ add(searchResult);
+
+ final Form searchForm = new Form("searchForm");
+ add(searchForm);
+
+ final RoleSearchPanel searchPanel = new RoleSearchPanel.Builder("searchPanel").build();
+ searchForm.add(searchPanel);
+
+ searchForm.add(new ClearIndicatingAjaxButton("search", new ResourceModel("search"), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ final String fiql = searchPanel.buildFIQL();
+ LOG.debug("Node condition {}", fiql);
+
+ doSearch(target, fiql, searchResult);
+
+ Session.get().getFeedbackMessages().clear();
+ searchPanel.getSearchFeedback().refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ searchPanel.getSearchFeedback().refresh(target);
+ }
+ });
+ }
+
+ private void doSearch(final AjaxRequestTarget target, final String fiql,
+ final AbstractSearchResultPanel resultsetPanel) {
+
+ if (fiql == null) {
+ error(getString(Constants.SEARCH_ERROR));
+ return;
+ }
+
+ resultsetPanel.search(fiql, target);
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ super.onEvent(event);
+
+ if (event.getPayload() instanceof TreeNodeClickUpdate) {
+ final TreeNodeClickUpdate update = (TreeNodeClickUpdate) event.getPayload();
+
+ final RoleSummaryPanel summaryPanel = new RoleSummaryPanel.Builder("summaryPanel")
+ .window(editRoleWin).callerPageRef(Roles.this.getPageReference())
+ .selectedNodeId(update.getSelectedNodeId()).build();
+
+ roleTabsContainer.addOrReplace(summaryPanel);
+ update.getTarget().add(roleTabsContainer);
+ }
+ }
+
+ public static class TreeNodeClickUpdate {
+
+ private final AjaxRequestTarget target;
+
+ private Long selectedNodeId;
+
+ public TreeNodeClickUpdate(final AjaxRequestTarget target, final Long selectedNodeId) {
+ this.target = target;
+ this.selectedNodeId = selectedNodeId;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public Long getSelectedNodeId() {
+ return selectedNodeId;
+ }
+
+ public void setSelectedNodeId(final Long selectedNodeId) {
+ this.selectedNodeId = selectedNodeId;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SchedTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SchedTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SchedTaskModalPage.java
new file mode 100644
index 0000000..6222717
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SchedTaskModalPage.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.List;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ * Modal window with Task form (to stop and start execution).
+ */
+public class SchedTaskModalPage extends AbstractSchedTaskModalPage {
+
+ private static final long serialVersionUID = -2501860242590060867L;
+
+ public SchedTaskModalPage(final ModalWindow window, final SchedTaskTO taskTO, final PageReference callerPageRef) {
+
+ super(window, taskTO, callerPageRef);
+
+ final IModel<List<String>> classNames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return taskRestClient.getJobClasses();
+ }
+ };
+
+ final AjaxDropDownChoicePanel<String> className = new AjaxDropDownChoicePanel<String>("jobClassName",
+ getString("class"), new PropertyModel<String>(taskTO, "jobClassName"));
+ className.setChoices(classNames.getObject());
+ className.addRequiredLabel();
+ className.setEnabled(taskTO.getKey() == 0);
+ className.setStyleSheet("ui-widget-content ui-corner-all long_dynamicsize");
+ profile.add(className);
+ }
+
+ @Override
+ public void submitAction(final SchedTaskTO taskTO) {
+ if (taskTO.getKey() > 0) {
+ taskRestClient.updateSchedTask(taskTO);
+ } else {
+ taskRestClient.createSchedTask(taskTO);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
new file mode 100644
index 0000000..8852862
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Schema.java
@@ -0,0 +1,467 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.lang.reflect.Field;
+import java.util.AbstractMap.SimpleEntry;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SchemaModalPageFactory;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.JQueryUITabbedPanel;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.extensions.markup.html.tabs.ITab;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.BeanWrapperImpl;
+import org.springframework.util.ReflectionUtils;
+
+/**
+ * Schema WebPage.
+ */
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class Schema extends BasePage {
+
+ private static final long serialVersionUID = 8091922398776299403L;
+
+ private static final Map<SchemaType, List<String>> COL_NAMES = new HashMap<SchemaType, List<String>>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ {
+ put(SchemaType.PLAIN, Arrays.asList(new String[] { "name", "type",
+ "mandatoryCondition", "uniqueConstraint", "multivalue", "readonly" }));
+ put(SchemaType.DERIVED, Arrays.asList(new String[] { "name", "expression" }));
+ put(SchemaType.VIRTUAL, Arrays.asList(new String[] { "name", "readonly" }));
+ }
+ };
+
+ private static final Map<Map.Entry<AttributableType, SchemaType>, String> PAGINATOR_ROWS_KEYS =
+ new HashMap<Map.Entry<AttributableType, SchemaType>, String>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ {
+ put(new SimpleEntry<>(AttributableType.CONFIGURATION, SchemaType.PLAIN),
+ Constants.PREF_CONF_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.USER, SchemaType.PLAIN),
+ Constants.PREF_USER_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.USER, SchemaType.DERIVED),
+ Constants.PREF_USER_DER_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.USER, SchemaType.VIRTUAL),
+ Constants.PREF_USER_VIR_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.MEMBERSHIP, SchemaType.PLAIN),
+ Constants.PREF_MEMBERSHIP_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.MEMBERSHIP, SchemaType.DERIVED),
+ Constants.PREF_MEMBERSHIP_DER_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL),
+ Constants.PREF_MEMBERSHIP_VIR_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.ROLE, SchemaType.PLAIN),
+ Constants.PREF_ROLE_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.ROLE, SchemaType.DERIVED),
+ Constants.PREF_ROLE_DER_SCHEMA_PAGINATOR_ROWS);
+ put(new SimpleEntry<>(AttributableType.ROLE, SchemaType.VIRTUAL),
+ Constants.PREF_ROLE_VIR_SCHEMA_PAGINATOR_ROWS);
+ }
+ };
+
+ private static final int WIN_WIDTH = 600;
+
+ private static final int WIN_HEIGHT = 200;
+
+ private static final int PLAIN_WIN_HEIGHT = 500;
+
+ @SpringBean
+ private SchemaRestClient restClient;
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private final String allowedCreateRoles = xmlRolesReader.getEntitlement("Schema", "create");
+
+ private final String allowedReadRoles = xmlRolesReader.getEntitlement("Schema", "read");
+
+ private final String allowedDeleteRoles = xmlRolesReader.getEntitlement("Schema", "delete");
+
+ public Schema() {
+ super();
+
+ for (final AttributableType attrType : AttributableType.values()) {
+ final String attrTypeAsString = attrType.name().toLowerCase();
+
+ List<ITab> tabs = new ArrayList<ITab>();
+
+ for (final SchemaType schemaType : SchemaType.values()) {
+ if (attrType != AttributableType.CONFIGURATION || schemaType == SchemaType.PLAIN) {
+ final String schemaTypeAsString = schemaType.name().toLowerCase();
+
+ tabs.add(new AbstractTab(new Model<String>(getString(schemaTypeAsString))) {
+
+ private static final long serialVersionUID = -5861786415855103549L;
+
+ @Override
+ public WebMarkupContainer getPanel(final String panelId) {
+ return new SchemaTypePanel(panelId, attrType, schemaType);
+ }
+ });
+ }
+ }
+
+ add(new JQueryUITabbedPanel(attrTypeAsString + "Tabs", tabs));
+ }
+ }
+
+ private <T extends AbstractSchemaModalPage> List<IColumn> getColumns(
+ final WebMarkupContainer webContainer, final ModalWindow modalWindow,
+ final AttributableType attributableType, final SchemaType schemaType,
+ final Collection<String> fields) {
+
+ List<IColumn> columns = new ArrayList<IColumn>();
+
+ for (final String field : fields) {
+ final Field clazzField = ReflectionUtils.findField(schemaType.getToClass(), field);
+
+ if (clazzField != null) {
+ if (clazzField.getType().equals(Boolean.class) || clazzField.getType().equals(boolean.class)) {
+ columns.add(new AbstractColumn<AbstractSchemaTO, String>(new ResourceModel(field)) {
+
+ private static final long serialVersionUID = 8263694778917279290L;
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractSchemaTO>> item,
+ final String componentId, final IModel<AbstractSchemaTO> model) {
+
+ BeanWrapper bwi = new BeanWrapperImpl(model.getObject());
+ Object obj = bwi.getPropertyValue(field);
+
+ item.add(new Label(componentId, ""));
+ item.add(new AttributeModifier("class", new Model<String>(obj.toString())));
+ }
+
+ @Override
+ public String getCssClass() {
+ return "small_fixedsize";
+ }
+ });
+ } else {
+ IColumn column = new PropertyColumn(new ResourceModel(field), field, field) {
+
+ private static final long serialVersionUID = 3282547854226892169L;
+
+ @Override
+ public String getCssClass() {
+ String css = super.getCssClass();
+ if ("name".equals(field)) {
+ css = StringUtils.isBlank(css)
+ ? "medium_fixedsize"
+ : css + " medium_fixedsize";
+ }
+ return css;
+ }
+ };
+ columns.add(column);
+ }
+ }
+ }
+
+ columns.add(new AbstractColumn<AbstractSchemaTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractSchemaTO>> item, final String componentId,
+ final IModel<AbstractSchemaTO> model) {
+
+ final AbstractSchemaTO schemaTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ modalWindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ AbstractSchemaModalPage page = SchemaModalPageFactory.getSchemaModalPage(
+ attributableType, schemaType);
+
+ page.setSchemaModalPage(Schema.this.getPageReference(), modalWindow, schemaTO, false);
+
+ return page;
+ }
+ });
+
+ modalWindow.show(target);
+ }
+ }, ActionType.EDIT, allowedReadRoles);
+
+ panel.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ switch (schemaType) {
+ case DERIVED:
+ restClient.deleteDerSchema(attributableType, schemaTO.getKey());
+ break;
+
+ case VIRTUAL:
+ restClient.deleteVirSchema(attributableType, schemaTO.getKey());
+ break;
+
+ default:
+ restClient.deleteSchema(attributableType, schemaTO.getKey());
+ break;
+ }
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ feedbackPanel.refresh(target);
+
+ target.add(webContainer);
+ }
+ }, ActionType.DELETE, allowedDeleteRoles);
+
+ item.add(panel);
+ }
+ });
+
+ return columns;
+ }
+
+ private Form<Void> getPaginatorForm(final WebMarkupContainer webContainer,
+ final AjaxFallbackDefaultDataTable dataTable,
+ final String formname, final SchemaTypePanel schemaTypePanel, final String rowsPerPagePrefName) {
+
+ Form<Void> form = new Form<Void>(formname);
+
+ final DropDownChoice<Integer> rowChooser = new DropDownChoice<Integer>("rowsChooser",
+ new PropertyModel<Integer>(schemaTypePanel, "pageRows"), prefMan.getPaginatorChoices(),
+ new SelectChoiceRenderer<Integer>());
+
+ rowChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), rowsPerPagePrefName, rowChooser.getInput());
+ dataTable.setItemsPerPage(rowChooser.getModelObject());
+
+ target.add(webContainer);
+ }
+ });
+
+ form.add(rowChooser);
+
+ return form;
+ }
+
+ private <T extends AbstractSchemaModalPage> AjaxLink<Void> getCreateSchemaLink(final ModalWindow modalWindow,
+ final AttributableType attrType, final SchemaType schemaType, final String winLinkName) {
+
+ AjaxLink<Void> link = new ClearIndicatingAjaxLink<Void>(winLinkName, getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ modalWindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ T page = SchemaModalPageFactory.getSchemaModalPage(attrType, schemaType);
+ page.setSchemaModalPage(Schema.this.getPageReference(), modalWindow, null, true);
+
+ return page;
+ }
+ });
+
+ modalWindow.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(link, ENABLE, allowedCreateRoles);
+
+ return link;
+
+ }
+
+ private class SchemaProvider extends SortableDataProvider<AbstractSchemaTO, String> {
+
+ private static final long serialVersionUID = -185944053385660794L;
+
+ private final SortableDataProviderComparator<AbstractSchemaTO> comparator;
+
+ private final AttributableType attrType;
+
+ private final SchemaType schemaType;
+
+ public SchemaProvider(final AttributableType attrType, final SchemaType schemaType) {
+ super();
+
+ this.attrType = attrType;
+ this.schemaType = schemaType;
+
+ // Default sorting
+ setSort("name", SortOrder.ASCENDING);
+
+ comparator = new SortableDataProviderComparator<AbstractSchemaTO>(this);
+ }
+
+ @Override
+ public Iterator<AbstractSchemaTO> iterator(final long first, final long count) {
+ @SuppressWarnings("unchecked")
+ List<AbstractSchemaTO> list =
+ (List<AbstractSchemaTO>) restClient.getSchemas(this.attrType, this.schemaType);
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.getSchemas(this.attrType, this.schemaType).size();
+ }
+
+ @Override
+ public IModel<AbstractSchemaTO> model(final AbstractSchemaTO object) {
+ return new CompoundPropertyModel<AbstractSchemaTO>(object);
+ }
+ }
+
+ private class SchemaTypePanel extends Panel {
+
+ private static final long serialVersionUID = 2854050613688773575L;
+
+ private int pageRows;
+
+ private final AttributableType attrType;
+
+ private final SchemaType schemaType;
+
+ public SchemaTypePanel(final String id, final AttributableType attrType, final SchemaType schemaType) {
+ super(id);
+
+ this.attrType = attrType;
+ this.schemaType = schemaType;
+
+ setup();
+ }
+
+ private void setup() {
+ ModalWindow editSchemaWin = new ModalWindow("editSchemaWin");
+ editSchemaWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editSchemaWin.setInitialWidth(WIN_WIDTH);
+ if (schemaType == SchemaType.PLAIN) {
+ editSchemaWin.setInitialHeight(PLAIN_WIN_HEIGHT);
+ } else {
+ editSchemaWin.setInitialHeight(WIN_HEIGHT);
+ }
+ editSchemaWin.setCookieName("editSchemaWin");
+ editSchemaWin.setMarkupId("editSchemaWin");
+ add(editSchemaWin);
+
+ WebMarkupContainer schemaWrapContainer = new WebMarkupContainer("schemaWrapContainer");
+ schemaWrapContainer.setOutputMarkupId(true);
+ if (schemaType != SchemaType.VIRTUAL) {
+ schemaWrapContainer.add(new AttributeModifier("style", "width:auto;"));
+ }
+ add(schemaWrapContainer);
+
+ WebMarkupContainer schemaContainer = new WebMarkupContainer("schemaContainer");
+ schemaContainer.setOutputMarkupId(true);
+ schemaWrapContainer.add(schemaContainer);
+ setWindowClosedCallback(editSchemaWin, schemaContainer);
+
+ final String paginatorRowsKey = PAGINATOR_ROWS_KEYS.get(
+ new SimpleEntry<AttributableType, SchemaType>(attrType, schemaType));
+ pageRows = prefMan.getPaginatorRows(getRequest(), paginatorRowsKey);
+
+ List<IColumn> tableCols = getColumns(schemaContainer, editSchemaWin, attrType,
+ schemaType, COL_NAMES.get(schemaType));
+ final AjaxFallbackDefaultDataTable table = new AjaxFallbackDefaultDataTable("datatable", tableCols,
+ new SchemaProvider(attrType, schemaType), pageRows);
+ table.setOutputMarkupId(true);
+ schemaContainer.add(table);
+
+ schemaWrapContainer.add(getPaginatorForm(schemaContainer, table, "paginatorForm", this, paginatorRowsKey));
+
+ add(getCreateSchemaLink(editSchemaWin, attrType, schemaType, "createSchemaLink"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.java
new file mode 100644
index 0000000..12bfc2b
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.SecurityQuestionRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+class SecurityQuestionModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -6709838862698327502L;
+
+ @SpringBean
+ private SecurityQuestionRestClient restClient;
+
+ public SecurityQuestionModalPage(final PageReference pageRef, final ModalWindow window,
+ final SecurityQuestionTO securityQuestionTO, final boolean createFlag) {
+
+ final Form<SecurityQuestionTO> form =
+ new Form<SecurityQuestionTO>(FORM, new CompoundPropertyModel<SecurityQuestionTO>(securityQuestionTO));
+
+ final AjaxTextFieldPanel contentFieldPanel =
+ new AjaxTextFieldPanel("content", "content", new PropertyModel<String>(securityQuestionTO, "content"));
+ contentFieldPanel.setRequired(true);
+ form.add(contentFieldPanel);
+
+ AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT))) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ if (createFlag) {
+ restClient.create(securityQuestionTO);
+ } else {
+ restClient.update(securityQuestionTO);
+ }
+ info(getString(Constants.OPERATION_SUCCEEDED));
+
+ Configuration callerPage = (Configuration) pageRef.getPage();
+ callerPage.setModalResult(true);
+
+ window.close(target);
+ } catch (SyncopeClientException scee) {
+ error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+
+ String allowedRoles = createFlag
+ ? xmlRolesReader.getEntitlement("SecurityQuestion", "create")
+ : xmlRolesReader.getEntitlement("SecurityQuestion", "update");
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
+
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ form.add(cancel);
+
+ add(form);
+ }
+}
[42/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java
new file mode 100644
index 0000000..116f82c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/init/SpringContextInitializer.java
@@ -0,0 +1,45 @@
+/*
+ * 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.init;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Configurable;
+import org.springframework.stereotype.Component;
+
+/**
+ * Take care of all initializations needed by Syncope Console to run up and safe.
+ */
+@Component
+@Configurable
+public class SpringContextInitializer implements InitializingBean {
+
+ @Autowired
+ private PreviewPanelClassInitializer previewPanelClassInitializer;
+
+ @Autowired
+ private MIMETypesInitializer mimeTypesInitializer;
+
+ @Override
+ public void afterPropertiesSet() {
+ previewPanelClassInitializer.load();
+ mimeTypesInitializer.load();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
new file mode 100644
index 0000000..ca330d8
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.init.MIMETypesInitializer;
+import org.apache.syncope.client.console.panels.NotificationPanel;
+import org.apache.syncope.client.console.rest.ConfigurationRestClient;
+import org.apache.syncope.client.console.rest.ReportRestClient;
+import org.apache.syncope.client.console.rest.ResourceRestClient;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.rest.TaskRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
+import org.apache.syncope.client.console.rest.UserSelfRestClient;
+import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
+import org.apache.wicket.markup.head.HeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.PriorityHeaderItem;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AbstractBasePage extends WebPage {
+
+ private static final long serialVersionUID = 8611724965544132636L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractBasePage.class);
+
+ protected static final String TASKS = "Tasks";
+
+ protected static final String FORM = "form";
+
+ protected static final String CANCEL = "cancel";
+
+ protected static final String SUBMIT = "submit";
+
+ protected static final String APPLY = "apply";
+
+ protected static final String NAME = "name";
+
+ protected final HeaderItem meta = new MetaHeaderItem("X-UA-Compatible", "IE=edge");
+
+ @SpringBean
+ protected XMLRolesReader xmlRolesReader;
+
+ @SpringBean
+ protected UserRestClient userRestClient;
+
+ @SpringBean
+ protected UserSelfRestClient userSelfRestClient;
+
+ @SpringBean
+ protected RoleRestClient roleRestClient;
+
+ @SpringBean
+ protected TaskRestClient taskRestClient;
+
+ @SpringBean
+ protected SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ protected ResourceRestClient resourceRestClient;
+
+ @SpringBean
+ protected ReportRestClient reportRestClient;
+
+ @SpringBean
+ protected ConfigurationRestClient confRestClient;
+
+ @SpringBean
+ protected MIMETypesInitializer mimeTypesInitializer;
+
+ protected NotificationPanel feedbackPanel;
+
+ /**
+ * Response flag set by the Modal Window after the operation is completed.
+ */
+ protected boolean modalResult = false;
+
+ public AbstractBasePage() {
+ this(null);
+ }
+
+ public AbstractBasePage(final PageParameters parameters) {
+ super(parameters);
+
+ feedbackPanel = new NotificationPanel(Constants.FEEDBACK);
+ feedbackPanel.setOutputMarkupId(true);
+ add(feedbackPanel);
+ }
+
+ public NotificationPanel getFeedbackPanel() {
+ return feedbackPanel;
+ }
+
+ public boolean isModalResult() {
+ return modalResult;
+ }
+
+ public void setModalResult(final boolean operationResult) {
+ this.modalResult = operationResult;
+ }
+
+ @Override
+ public void renderHead(final IHeaderResponse response) {
+ super.renderHead(response);
+ response.render(new PriorityHeaderItem(meta));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
new file mode 100644
index 0000000..5cc8885
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchedTaskModalPage.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DateFormatROModel;
+import org.apache.syncope.client.console.wicket.markup.html.CrontabContainer;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.springframework.util.StringUtils;
+
+/**
+ * Modal window with Task form (to stop and start execution).
+ */
+public abstract class AbstractSchedTaskModalPage extends TaskModalPage {
+
+ private static final long serialVersionUID = 2892005971093059242L;
+
+ protected CrontabContainer crontab;
+
+ public AbstractSchedTaskModalPage(final ModalWindow window, final SchedTaskTO taskTO,
+ final PageReference pageRef) {
+
+ super(taskTO);
+
+ crontab = new CrontabContainer("crontab", new PropertyModel<String>(taskTO, "cronExpression"),
+ taskTO.getCronExpression());
+ form.add(crontab);
+
+ final AjaxTextFieldPanel name =
+ new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(taskTO, "name"));
+ name.setEnabled(true);
+ profile.add(name);
+
+ final AjaxTextFieldPanel description = new AjaxTextFieldPanel("description", "description",
+ new PropertyModel<String>(taskTO, "description"));
+ description.setEnabled(true);
+ profile.add(description);
+
+ final AjaxTextFieldPanel lastExec = new AjaxTextFieldPanel("lastExec", getString("lastExec"),
+ new DateFormatROModel(new PropertyModel<String>(taskTO, "lastExec")));
+ lastExec.setEnabled(false);
+ profile.add(lastExec);
+
+ final AjaxTextFieldPanel nextExec = new AjaxTextFieldPanel("nextExec", getString("nextExec"),
+ new DateFormatROModel(new PropertyModel<String>(taskTO, "nextExec")));
+ nextExec.setEnabled(false);
+ profile.add(nextExec);
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(APPLY)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ SchedTaskTO taskTO = (SchedTaskTO) form.getModelObject();
+ taskTO.setCronExpression(StringUtils.hasText(taskTO.getCronExpression())
+ ? crontab.getCronExpression()
+ : null);
+
+ try {
+ submitAction(taskTO);
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ LOG.error("While creating or updating task", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+
+ if (taskTO.getKey() > 0) {
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getEntitlement(TASKS,
+ "update"));
+ } else {
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getEntitlement(TASKS,
+ "create"));
+ }
+
+ form.add(submit);
+ form.add(cancel);
+ }
+
+ protected abstract void submitAction(SchedTaskTO taskTO);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchemaModalPage.java
new file mode 100644
index 0000000..1c1bd0f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSchemaModalPage.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+
+/**
+ * Modal window with Schema form.
+ */
+public abstract class AbstractSchemaModalPage<T extends AbstractSchemaTO> extends BaseModalPage {
+
+ private static final long serialVersionUID = 7369215690388444748L;
+
+ protected AttributableType kind;
+
+ public AbstractSchemaModalPage(final AttributableType kind) {
+ this.kind = kind;
+ }
+
+ public abstract void setSchemaModalPage(PageReference callerPageRef, ModalWindow window, T schema,
+ boolean createFlag);
+
+ public AttributableType getKind() {
+ return kind;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractStatusModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractStatusModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractStatusModalPage.java
new file mode 100644
index 0000000..f5dfbca
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractStatusModalPage.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.markup.html.panel.Fragment;
+
+public class AbstractStatusModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 6633408683036028540L;
+
+ public AbstractStatusModalPage() {
+ add(new Fragment("pwdMgtFields", "emptyFragment", this));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSyncTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSyncTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSyncTaskModalPage.java
new file mode 100644
index 0000000..aa62b41
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractSyncTaskModalPage.java
@@ -0,0 +1,209 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.common.lib.to.AbstractProvisioningTaskTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.MatchingRule;
+import org.apache.syncope.common.lib.types.UnmatchingRule;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ * Abstract Modal window for Sync and Push Task form.
+ */
+public abstract class AbstractSyncTaskModalPage extends AbstractSchedTaskModalPage {
+
+ private static final long serialVersionUID = 2148403203517274669L;
+
+ protected AjaxDropDownChoicePanel<MatchingRule> matchingRule;
+
+ protected AjaxDropDownChoicePanel<UnmatchingRule> unmatchingRule;
+
+ protected abstract List<String> getSyncActions();
+
+ final IModel<List<String>> allResources = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ final List<String> resourceNames = new ArrayList<>();
+
+ for (ResourceTO resourceTO : resourceRestClient.getAll()) {
+ resourceNames.add(resourceTO.getKey());
+ }
+
+ Collections.sort(resourceNames);
+ return resourceNames;
+ }
+ };
+
+ final IModel<List<String>> syncActionsClasses = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157438L;
+
+ @Override
+ protected List<String> load() {
+ return getSyncActions();
+ }
+ };
+
+ public AbstractSyncTaskModalPage(
+ final ModalWindow window, final AbstractProvisioningTaskTO taskTO, final PageReference pageRef) {
+
+ super(window, taskTO, pageRef);
+
+ final AjaxDropDownChoicePanel<String> resource = new AjaxDropDownChoicePanel<>("resource",
+ getString("resourceName"), new PropertyModel<String>(taskTO, "resource"));
+ resource.setChoices(allResources.getObject());
+ resource.setChoiceRenderer(new SelectChoiceRenderer<String>());
+ resource.addRequiredLabel();
+ resource.setEnabled(taskTO.getKey() == 0);
+ resource.setStyleSheet("ui-widget-content ui-corner-all long_dynamicsize");
+
+ profile.add(resource);
+
+ final WebMarkupContainer syncActionsClassNames = new WebMarkupContainer("syncActionsClassNames");
+ syncActionsClassNames.setOutputMarkupId(true);
+ profile.add(syncActionsClassNames);
+
+ final AjaxLink<Void> first = new IndicatingAjaxLink<Void>("first") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ taskTO.getActionsClassNames().add(StringUtils.EMPTY);
+ setVisible(false);
+ target.add(syncActionsClassNames);
+ }
+ };
+ first.setOutputMarkupPlaceholderTag(true);
+ first.setVisible(taskTO.getActionsClassNames().isEmpty());
+ syncActionsClassNames.add(first);
+
+ final ListView<String> actionsClasses = new ListView<String>(
+ "actionsClasses", new PropertyModel<List<String>>(taskTO, "actionsClassNames")) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ final String className = item.getModelObject();
+
+ final DropDownChoice<String> actionsClass = new DropDownChoice<String>(
+ "actionsClass", new Model<String>(className), syncActionsClasses.getObject());
+ actionsClass.setNullValid(true);
+ actionsClass.setRequired(true);
+ actionsClass.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ taskTO.getActionsClassNames().set(item.getIndex(), actionsClass.getModelObject());
+ target.add(syncActionsClassNames);
+ }
+ });
+ actionsClass.setRequired(true);
+ actionsClass.setOutputMarkupId(true);
+ actionsClass.setRequired(true);
+ item.add(actionsClass);
+
+ AjaxLink<Void> minus = new IndicatingAjaxLink<Void>("drop") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ taskTO.getActionsClassNames().remove(className);
+ first.setVisible(taskTO.getActionsClassNames().isEmpty());
+ target.add(syncActionsClassNames);
+ }
+ };
+ item.add(minus);
+
+ final AjaxLink<Void> plus = new IndicatingAjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ taskTO.getActionsClassNames().add(StringUtils.EMPTY);
+ target.add(syncActionsClassNames);
+ }
+ };
+ plus.setOutputMarkupPlaceholderTag(true);
+ plus.setVisible(item.getIndex() == taskTO.getActionsClassNames().size() - 1);
+ item.add(plus);
+ }
+ };
+ syncActionsClassNames.add(actionsClasses);
+
+ syncActionsClassNames.setEnabled(!syncActionsClasses.getObject().isEmpty());
+
+ final AjaxCheckBoxPanel creates = new AjaxCheckBoxPanel("performCreate", getString("creates"),
+ new PropertyModel<Boolean>(taskTO, "performCreate"));
+ profile.add(creates);
+
+ final AjaxCheckBoxPanel updates = new AjaxCheckBoxPanel("performUpdate", getString("updates"),
+ new PropertyModel<Boolean>(taskTO, "performUpdate"));
+ profile.add(updates);
+
+ final AjaxCheckBoxPanel deletes = new AjaxCheckBoxPanel("performDelete", getString("updates"),
+ new PropertyModel<Boolean>(taskTO, "performDelete"));
+ profile.add(deletes);
+
+ final AjaxCheckBoxPanel syncStatus = new AjaxCheckBoxPanel("syncStatus", getString("syncStatus"),
+ new PropertyModel<Boolean>(taskTO, "syncStatus"));
+ profile.add(syncStatus);
+
+ matchingRule = new AjaxDropDownChoicePanel<MatchingRule>(
+ "matchingRule", "matchingRule", new PropertyModel<MatchingRule>(taskTO, "matchingRule"));
+ matchingRule.setChoices(Arrays.asList(MatchingRule.values()));
+ ((DropDownChoice) matchingRule.getField()).setNullValid(false);
+
+ unmatchingRule = new AjaxDropDownChoicePanel<UnmatchingRule>(
+ "unmatchingRule", "unmatchingRule", new PropertyModel<UnmatchingRule>(taskTO, "unmatchingRule"));
+ unmatchingRule.setChoices(Arrays.asList(UnmatchingRule.values()));
+ ((DropDownChoice) unmatchingRule.getField()).setNullValid(false);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
new file mode 100644
index 0000000..05658fc
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class ActivitiModelerPopupPage extends WebPage {
+
+ private static final long serialVersionUID = -7031206743629422898L;
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ApprovalModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ApprovalModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ApprovalModalPage.java
new file mode 100644
index 0000000..79deeb0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ApprovalModalPage.java
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.io.Serializable;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.MapChoiceRenderer;
+import org.apache.syncope.client.console.rest.ApprovalRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.DateTimeFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.list.AltListView;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class ApprovalModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -8847854414429745216L;
+
+ private final static int USER_WIN_HEIGHT = 550;
+
+ private final static int USER_WIN_WIDTH = 800;
+
+ @SpringBean
+ private ApprovalRestClient restClient;
+
+ private final ModalWindow editUserWin;
+
+ public ApprovalModalPage(final PageReference pageRef, final ModalWindow window, final WorkflowFormTO formTO) {
+ super();
+
+ IModel<List<WorkflowFormPropertyTO>> formProps = new LoadableDetachableModel<List<WorkflowFormPropertyTO>>() {
+
+ private static final long serialVersionUID = 3169142472626817508L;
+
+ @Override
+ protected List<WorkflowFormPropertyTO> load() {
+ return formTO.getProperties();
+ }
+ };
+
+ final ListView<WorkflowFormPropertyTO> propView =
+ new AltListView<WorkflowFormPropertyTO>("propView", formProps) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected void populateItem(final ListItem<WorkflowFormPropertyTO> item) {
+ final WorkflowFormPropertyTO prop = item.getModelObject();
+
+ Label label = new Label("key", prop.getName() == null
+ ? prop.getId()
+ : prop.getName());
+ item.add(label);
+
+ FieldPanel field;
+ switch (prop.getType()) {
+ case Boolean:
+ field = new AjaxDropDownChoicePanel("value", label.getDefaultModelObjectAsString(),
+ new Model<Boolean>(Boolean.valueOf(prop.getValue()))).setChoices(Arrays.asList(
+ new String[] { "Yes", "No" }));
+ break;
+
+ case Date:
+ SimpleDateFormat df = StringUtils.isNotBlank(prop.getDatePattern())
+ ? new SimpleDateFormat(prop.getDatePattern())
+ : new SimpleDateFormat();
+ Date parsedDate = null;
+ if (StringUtils.isNotBlank(prop.getValue())) {
+ try {
+ parsedDate = df.parse(prop.getValue());
+ } catch (ParseException e) {
+ LOG.error("Unparsable date: {}", prop.getValue(), e);
+ }
+ }
+
+ field = new DateTimeFieldPanel("value", label.getDefaultModelObjectAsString(),
+ new Model<Date>(parsedDate), df.toLocalizedPattern());
+ break;
+
+ case Enum:
+ MapChoiceRenderer<String, String> enumCR =
+ new MapChoiceRenderer<String, String>(prop.getEnumValues());
+
+ field = new AjaxDropDownChoicePanel("value", label.getDefaultModelObjectAsString(),
+ new Model(prop.getValue())).setChoiceRenderer(enumCR).setChoices(new Model() {
+
+ private static final long serialVersionUID = -858521070366432018L;
+
+ @Override
+ public Serializable getObject() {
+ return new ArrayList<String>(prop.getEnumValues().keySet());
+ }
+ });
+ break;
+
+ case Long:
+ field = new SpinnerFieldPanel<Long>("value", label.getDefaultModelObjectAsString(),
+ Long.class, new Model<Long>(NumberUtils.toLong(prop.getValue())),
+ null, null);
+ break;
+
+ case String:
+ default:
+ field = new AjaxTextFieldPanel("value", PARENT_PATH,
+ new Model<String>(prop.getValue()));
+ break;
+ }
+
+ field.setReadOnly(!prop.isWritable());
+ if (prop.isRequired()) {
+ field.addRequiredLabel();
+ }
+
+ item.add(field);
+ }
+ };
+
+ final AjaxButton userDetails = new IndicatingAjaxButton("userDetails",
+ new Model<String>(getString("userDetails"))) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ editUserWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ViewUserModalPage(ApprovalModalPage.this.getPageReference(), editUserWin,
+ userRestClient.read(formTO.getUserKey())) {
+
+ private static final long serialVersionUID = -2819994749866481607L;
+
+ @Override
+ protected void closeAction(final AjaxRequestTarget target, final Form form) {
+ setResponsePage(ApprovalModalPage.this);
+ }
+ };
+ }
+ });
+
+ editUserWin.show(target);
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE,
+ xmlRolesReader.getEntitlement("Users", "read"));
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT))) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+
+ Map<String, WorkflowFormPropertyTO> props = formTO.getPropertyMap();
+
+ for (int i = 0; i < propView.size(); i++) {
+ @SuppressWarnings("unchecked")
+ ListItem<WorkflowFormPropertyTO> item = (ListItem<WorkflowFormPropertyTO>) propView.get(i);
+ String input = ((FieldPanel) item.get("value")).getField().getInput();
+
+ if (!props.containsKey(item.getModelObject().getId())) {
+ props.put(item.getModelObject().getId(), new WorkflowFormPropertyTO());
+ }
+
+ if (item.getModelObject().isWritable()) {
+ switch (item.getModelObject().getType()) {
+ case Boolean:
+ props.get(item.getModelObject().getId()).setValue(String.valueOf("0".equals(input)));
+ break;
+
+ case Date:
+ case Enum:
+ case String:
+ case Long:
+ default:
+ props.get(item.getModelObject().getId()).setValue(input);
+ break;
+ }
+ }
+ }
+
+ formTO.getProperties().clear();
+ formTO.getProperties().addAll(props.values());
+ try {
+ restClient.submitForm(formTO);
+
+ ((Todo) pageRef.getPage()).setModalResult(true);
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ LOG.error("While submitting form {}", formTO, e);
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form form) {
+ // nothing
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+
+ Form form = new Form(FORM);
+ form.add(propView);
+ form.add(userDetails);
+ form.add(submit);
+ form.add(cancel);
+
+ MetaDataRoleAuthorizationStrategy.authorize(form, ENABLE, xmlRolesReader.getEntitlement("Approval",
+ SUBMIT));
+
+ editUserWin = new ModalWindow("editUserWin");
+ editUserWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editUserWin.setInitialHeight(USER_WIN_HEIGHT);
+ editUserWin.setInitialWidth(USER_WIN_WIDTH);
+ editUserWin.setCookieName("edit-user-modal");
+ add(editUserWin);
+
+ add(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BaseModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BaseModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BaseModalPage.java
new file mode 100644
index 0000000..20892dd
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BaseModalPage.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.CloseOnESCBehavior;
+
+/**
+ * Syncope Modal Window.
+ */
+public abstract class BaseModalPage extends AbstractBasePage {
+
+ private static final long serialVersionUID = -1443079028368471943L;
+
+ public BaseModalPage() {
+ super();
+
+ add(new CloseOnESCBehavior("keyup"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
new file mode 100644
index 0000000..2540c37
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.SyncopeApplication;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.IAjaxIndicatorAware;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * Syncope Wicket base-page.
+ */
+public class BasePage extends AbstractBasePage implements IAjaxIndicatorAware {
+
+ private static final long serialVersionUID = 1571997737305598502L;
+
+ public BasePage() {
+ this(null);
+ }
+
+ public BasePage(final PageParameters parameters) {
+ super(parameters);
+
+ pageSetup();
+ }
+
+ private void pageSetup() {
+ ((SyncopeApplication) getApplication()).setupNavigationPanel(this, xmlRolesReader, true);
+
+ final String kind = getClass().getSimpleName().toLowerCase();
+ final BookmarkablePageLink kindLink = (BookmarkablePageLink) get(kind);
+ if (kindLink != null) {
+ kindLink.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("class", kind);
+ }
+ });
+
+ Component kindIcon = kindLink.get(0);
+ if (kindIcon != null) {
+ kindIcon.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ tag.put("src", "../.." + SyncopeApplication.IMG_PREFIX + kind + Constants.PNG_EXT);
+ }
+ });
+ }
+ }
+
+ ((SyncopeApplication) getApplication()).setupEditProfileModal(this, userSelfRestClient);
+ }
+
+ @Override
+ public String getAjaxIndicatorMarkupId() {
+ return "veil";
+ }
+
+ /**
+ * Set a WindowClosedCallback for a ModalWindow instance.
+ *
+ * @param window window
+ * @param container container
+ */
+ protected void setWindowClosedCallback(final ModalWindow window, final WebMarkupContainer container) {
+
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ target.add(container);
+ if (isModalResult()) {
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ feedbackPanel.refresh(target);
+ setModalResult(false);
+ }
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java
new file mode 100644
index 0000000..856f469
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+public class BasePopupPage extends AbstractBasePage {
+
+ private static final long serialVersionUID = -2633667311332659505L;
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
new file mode 100644
index 0000000..0733f63
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionModalPage.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.BaseRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+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.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.form.Form;
+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.springframework.beans.BeanUtils;
+
+public class BulkActionModalPage<T, S> extends BaseModalPage {
+
+ private static final long serialVersionUID = 4114026480146090962L;
+
+ public BulkActionModalPage(
+ final ModalWindow window,
+ final Collection<T> items,
+ final List<IColumn<T, S>> columns,
+ final Collection<ActionLink.ActionType> actions,
+ final BaseRestClient bulkActionExecutor,
+ final String idFieldName,
+ final String pageId) {
+
+ super();
+
+ final SortableDataProvider<T, S> dataProvider = new SortableDataProvider<T, S>() {
+
+ private static final long serialVersionUID = 5291903859908641954L;
+
+ @Override
+ public Iterator<? extends T> iterator(final long first, final long count) {
+ return items.iterator();
+ }
+
+ @Override
+ public long size() {
+ return items.size();
+ }
+
+ @Override
+ public IModel<T> model(final T object) {
+ return new CompoundPropertyModel<T>(object);
+ }
+ };
+
+ add(new AjaxFallbackDefaultDataTable<T, S>(
+ "selectedObjects",
+ new ArrayList<IColumn<T, S>>(columns.subList(1, columns.size() - 1)),
+ dataProvider,
+ Integer.MAX_VALUE).setVisible(items != null && !items.isEmpty()));
+
+ @SuppressWarnings("rawtypes")
+ final ActionLinksPanel actionPanel = new ActionLinksPanel("actions", new Model(), getPageReference());
+ add(actionPanel);
+
+ for (ActionLink.ActionType action : actions) {
+ final BulkAction bulkAction = new BulkAction();
+ for (T item : items) {
+ try {
+ bulkAction.getTargets().add(getTargetId(item, idFieldName).toString());
+ } catch (Exception e) {
+ LOG.error("Error retrieving item id {}", idFieldName, e);
+ }
+ }
+
+ switch (action) {
+ case DELETE:
+ bulkAction.setOperation(BulkAction.Type.DELETE);
+ break;
+ case SUSPEND:
+ bulkAction.setOperation(BulkAction.Type.SUSPEND);
+ break;
+ case REACTIVATE:
+ bulkAction.setOperation(BulkAction.Type.REACTIVATE);
+ break;
+ case EXECUTE:
+ bulkAction.setOperation(BulkAction.Type.EXECUTE);
+ break;
+ case DRYRUN:
+ bulkAction.setOperation(BulkAction.Type.DRYRUN);
+ break;
+ default:
+ LOG.error("Bulk action type not supported");
+ }
+
+ actionPanel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ final BulkActionResult res = (BulkActionResult) bulkActionExecutor.getClass().
+ getMethod("bulkAction", BulkAction.class).invoke(bulkActionExecutor, bulkAction);
+
+ setResponsePage(new BulkActionResultModalPage<>(window, items, columns, res, idFieldName));
+ } catch (Exception e) {
+ error(getString(Constants.ERROR)
+ + ": Operation " + bulkAction.getOperation() + " not supported");
+ feedbackPanel.refresh(target);
+ }
+
+ }
+ }, action, pageId, !items.isEmpty());
+ }
+
+ final Form<Void> form = new Form<Void>(FORM);
+ add(form);
+
+ final AjaxButton cancel =
+ new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+ }
+
+ private Object getTargetId(final Object target, final String idFieldName)
+ throws IllegalAccessException, InvocationTargetException {
+
+ return BeanUtils.getPropertyDescriptor(target.getClass(), idFieldName).
+ getReadMethod().invoke(target, new Object[0]);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionResultModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionResultModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionResultModalPage.java
new file mode 100644
index 0000000..4ada6ba
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/BulkActionResultModalPage.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionResultColumn;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+
+/**
+ * Show user or role status after performing a successful operation.
+ */
+public class BulkActionResultModalPage<T, S> extends BaseModalPage {
+
+ /**
+ * Serial version id.
+ */
+ private static final long serialVersionUID = 2646115294319713724L;
+
+ public BulkActionResultModalPage(
+ final ModalWindow window,
+ final Collection<T> items,
+ final List<IColumn<T, S>> columns,
+ final BulkActionResult results,
+ final String idFieldName) {
+
+ super();
+
+ final List<IColumn<T, S>> newColumnList = new ArrayList<>(columns.subList(1, columns.size() - 1));
+ newColumnList.add(newColumnList.size(), new ActionResultColumn<T, S>(results, idFieldName));
+
+ final SortableDataProvider<T, S> dataProvider = new SortableDataProvider<T, S>() {
+
+ private static final long serialVersionUID = 5291903859908641954L;
+
+ @Override
+ public Iterator<? extends T> iterator(final long first, final long count) {
+ return items.iterator();
+ }
+
+ @Override
+ public long size() {
+ return items.size();
+ }
+
+ @Override
+ public IModel<T> model(final T object) {
+ return new CompoundPropertyModel<T>(object);
+ }
+ };
+
+ add(new AjaxFallbackDefaultDataTable<T, S>(
+ "selectedObjects",
+ newColumnList,
+ dataProvider,
+ Integer.MAX_VALUE).setVisible(items != null && !items.isEmpty()));
+
+ final AjaxLink<Void> close = new IndicatingAjaxLink<Void>("close") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ window.close(target);
+ }
+ };
+
+ add(close);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfModalPage.java
new file mode 100644
index 0000000..0c65ac2
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfModalPage.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.Collections;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.panels.PlainAttrsPanel;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConfTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class ConfModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 3524777398688399977L;
+
+ public ConfModalPage(final PageReference pageRef, final ModalWindow window, final WebMarkupContainer parameters) {
+ super();
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ parameters, ENABLE, xmlRolesReader.getEntitlement("Configuration", "list"));
+ final ConfTO conf = confRestClient.list();
+
+ final Form<ConfTO> form = new Form<>("confForm");
+ form.setModel(new CompoundPropertyModel<>(conf));
+
+ form.add(new PlainAttrsPanel("paramAttrs", conf, form, Mode.ADMIN));
+
+ final AjaxButton submit = new IndicatingAjaxButton(SUBMIT, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final ConfTO updatedConf = (ConfTO) form.getModelObject();
+
+ try {
+ for (AttrTO attr : updatedConf.getPlainAttrs()) {
+ attr.getValues().removeAll(Collections.singleton(null));
+ if (attr.getValues().isEmpty()
+ || attr.getValues().equals(Collections.singletonList(StringUtils.EMPTY))) {
+
+ confRestClient.delete(attr.getSchema());
+ } else {
+ confRestClient.set(attr);
+ }
+ }
+
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ window.close(target);
+ } catch (Exception e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(
+ submit, ENABLE, xmlRolesReader.getEntitlement("Configuration", "set"));
+ MetaDataRoleAuthorizationStrategy.authorize(
+ submit, ENABLE, xmlRolesReader.getEntitlement("Configuration", "delete"));
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ add(form);
+ }
+}
[02/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
new file mode 100644
index 0000000..65b766b
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserSelfITCase.java
@@ -0,0 +1,344 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessControlException;
+import java.util.Map;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.mod.MembershipMod;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.rest.api.Preference;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.UserSelfService;
+import org.apache.syncope.common.rest.api.service.UserService;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class UserSelfITCase extends AbstractITCase {
+
+ @Test
+ public void selfRegistrationAllowed() {
+ assertTrue(syncopeService.info().isSelfRegAllowed());
+ }
+
+ @Test
+ public void create() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ // 1. self-registration as admin: failure
+ try {
+ userSelfService.create(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"), true);
+ fail();
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ // 2. self-registration as anonymous: works
+ SyncopeClient anonClient = clientFactory.createAnonymous();
+ UserTO self = anonClient.getService(UserSelfService.class).
+ create(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"), true).
+ readEntity(UserTO.class);
+ assertNotNull(self);
+ assertEquals("createApproval", self.getStatus());
+ }
+
+ @Test
+ public void createAndApprove() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ // self-create user with membership: goes 'createApproval' with resources and membership but no propagation
+ UserTO userTO = UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org");
+ MembershipTO membership = new MembershipTO();
+ membership.setRoleId(3L);
+ userTO.getMemberships().add(membership);
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ SyncopeClient anonClient = clientFactory.createAnonymous();
+ userTO = anonClient.getService(UserSelfService.class).
+ create(userTO, true).
+ readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("createApproval", userTO.getStatus());
+ assertFalse(userTO.getMemberships().isEmpty());
+ assertFalse(userTO.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+
+ // now approve and verify that propagation has happened
+ WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
+ form = userWorkflowService.claimForm(form.getTaskId());
+ Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
+ props.get("approve").setValue(Boolean.TRUE.toString());
+ form.getProperties().clear();
+ form.getProperties().addAll(props.values());
+ userTO = userWorkflowService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey()));
+ }
+
+ @Test
+ public void read() {
+ UserService userService2 = clientFactory.create("rossini", ADMIN_PWD).getService(UserService.class);
+
+ try {
+ userService2.read(1L);
+ fail();
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ UserSelfService userSelfService2 = clientFactory.create("rossini", ADMIN_PWD).getService(UserSelfService.class);
+ UserTO userTO = userSelfService2.read();
+ assertEquals("rossini", userTO.getUsername());
+ }
+
+ @Test
+ public void updateWithoutApproval() {
+ // 1. create user as admin
+ UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
+ assertNotNull(created);
+ assertFalse(created.getUsername().endsWith("XX"));
+
+ // 2. self-update (username) - works
+ UserMod userMod = new UserMod();
+ userMod.setUsername(created.getUsername() + "XX");
+
+ SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
+ UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(), userMod).
+ readEntity(UserTO.class);
+ assertNotNull(updated);
+ assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+ ? "active" : "created", updated.getStatus());
+ assertTrue(updated.getUsername().endsWith("XX"));
+ }
+
+ @Test
+ public void updateWithApproval() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ // 1. create user as admin
+ UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
+ assertNotNull(created);
+ assertFalse(created.getUsername().endsWith("XX"));
+
+ // 2. self-update (username + memberships + resource) - works but needs approval
+ MembershipMod membershipMod = new MembershipMod();
+ membershipMod.setRole(7L);
+ AttrMod testAttrMod = new AttrMod();
+ testAttrMod.setSchema("testAttribute");
+ testAttrMod.getValuesToBeAdded().add("a value");
+ membershipMod.getPlainAttrsToUpdate().add(testAttrMod);
+
+ UserMod userMod = new UserMod();
+ userMod.setUsername(created.getUsername() + "XX");
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
+ userMod.setPassword("newPassword123");
+ StatusMod statusMod = new StatusMod();
+ statusMod.setOnSyncope(false);
+ statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
+ userMod.setPwdPropRequest(statusMod);
+
+ SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
+ UserTO updated = authClient.getService(UserSelfService.class).update(created.getKey(), userMod).
+ readEntity(UserTO.class);
+ assertNotNull(updated);
+ assertEquals("updateApproval", updated.getStatus());
+ assertFalse(updated.getUsername().endsWith("XX"));
+ assertTrue(updated.getMemberships().isEmpty());
+
+ // no propagation happened
+ assertTrue(updated.getResources().isEmpty());
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+
+ // 3. approve self-update as admin
+ WorkflowFormTO form = userWorkflowService.getFormForUser(updated.getKey());
+ form = userWorkflowService.claimForm(form.getTaskId());
+ Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
+ props.get("approve").setValue(Boolean.TRUE.toString());
+ form.getProperties().clear();
+ form.getProperties().addAll(props.values());
+ updated = userWorkflowService.submitForm(form);
+ assertNotNull(updated);
+ assertEquals("active", updated.getStatus());
+ assertTrue(updated.getUsername().endsWith("XX"));
+ assertEquals(1, updated.getMemberships().size());
+
+ // check that propagation also happened
+ assertTrue(updated.getResources().contains(RESOURCE_NAME_TESTDB));
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, updated.getKey()));
+ }
+
+ @Test
+ public void delete() {
+ UserTO created = createUser(UserITCase.getUniqueSampleTO("anonymous@syncope.apache.org"));
+ assertNotNull(created);
+
+ SyncopeClient authClient = clientFactory.create(created.getUsername(), "password123");
+ UserTO deleted = authClient.getService(UserSelfService.class).delete().readEntity(UserTO.class);
+ assertNotNull(deleted);
+ assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+ ? "deleteApproval" : null, deleted.getStatus());
+ }
+
+ @Test
+ public void issueSYNCOPE373() {
+ UserTO userTO = userSelfService.read();
+ assertEquals(ADMIN_UNAME, userTO.getUsername());
+ }
+
+ @Test
+ public void noContent() throws IOException {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ SyncopeClient anonClient = clientFactory.createAnonymous();
+ UserSelfService noContentService = anonClient.prefer(UserSelfService.class, Preference.RETURN_NO_CONTENT);
+
+ UserTO user = UserITCase.getUniqueSampleTO("nocontent-anonymous@syncope.apache.org");
+
+ Response response = noContentService.create(user, true);
+ assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+ }
+
+ @Test
+ public void passwordReset() {
+ // 1. create an user with security question and answer
+ UserTO user = UserITCase.getUniqueSampleTO("pwdReset@syncope.apache.org");
+ user.setSecurityQuestion(1L);
+ user.setSecurityAnswer("Rossi");
+ createUser(user);
+
+ // 2. verify that new user is able to authenticate
+ SyncopeClient authClient = clientFactory.create(user.getUsername(), "password123");
+ UserTO read = authClient.getService(UserSelfService.class).read();
+ assertNotNull(read);
+
+ // 3. request password reset (as anonymous) providing the expected security answer
+ SyncopeClient anonClient = clientFactory.createAnonymous();
+ try {
+ anonClient.getService(UserSelfService.class).requestPasswordReset(user.getUsername(), "WRONG");
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidSecurityAnswer, e.getType());
+ }
+ anonClient.getService(UserSelfService.class).requestPasswordReset(user.getUsername(), "Rossi");
+
+ // 4. get token (normally sent via e-mail, now reading as admin)
+ String token = userService.read(read.getKey()).getToken();
+ assertNotNull(token);
+
+ // 5. confirm password reset
+ try {
+ anonClient.getService(UserSelfService.class).confirmPasswordReset("WRONG TOKEN", "newPassword");
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ assertTrue(e.getMessage().contains("WRONG TOKEN"));
+ }
+ anonClient.getService(UserSelfService.class).confirmPasswordReset(token, "newPassword");
+
+ // 6. verify that password was reset and token removed
+ authClient = clientFactory.create(user.getUsername(), "newPassword");
+ read = authClient.getService(UserSelfService.class).read();
+ assertNotNull(read);
+ assertNull(read.getToken());
+ }
+
+ @Test
+ public void passwordResetWithoutSecurityQuestion() {
+ // 0. disable security question for password reset
+ configurationService.set("passwordReset.securityQuestion",
+ attrTO("passwordReset.securityQuestion", "false"));
+
+ // 1. create an user with security question and answer
+ UserTO user = UserITCase.getUniqueSampleTO("pwdResetNoSecurityQuestion@syncope.apache.org");
+ createUser(user);
+
+ // 2. verify that new user is able to authenticate
+ SyncopeClient authClient = clientFactory.create(user.getUsername(), "password123");
+ UserTO read = authClient.getService(UserSelfService.class).read();
+ assertNotNull(read);
+
+ // 3. request password reset (as anonymous) with no security answer
+ SyncopeClient anonClient = clientFactory.createAnonymous();
+ anonClient.getService(UserSelfService.class).requestPasswordReset(user.getUsername(), null);
+
+ // 4. get token (normally sent via e-mail, now reading as admin)
+ String token = userService.read(read.getKey()).getToken();
+ assertNotNull(token);
+
+ // 5. confirm password reset
+ try {
+ anonClient.getService(UserSelfService.class).confirmPasswordReset("WRONG TOKEN", "newPassword");
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ assertTrue(e.getMessage().contains("WRONG TOKEN"));
+ }
+ anonClient.getService(UserSelfService.class).confirmPasswordReset(token, "newPassword");
+
+ // 6. verify that password was reset and token removed
+ authClient = clientFactory.create(user.getUsername(), "newPassword");
+ read = authClient.getService(UserSelfService.class).read();
+ assertNotNull(read);
+ assertNull(read.getToken());
+
+ // 7. re-enable security question for password reset
+ configurationService.set("passwordReset.securityQuestion",
+ attrTO("passwordReset.securityQuestion", "true"));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
new file mode 100644
index 0000000..c7354dd
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserWorkflowITCase.java
@@ -0,0 +1,299 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.rest.api.service.UserWorkflowService;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class UserWorkflowITCase extends AbstractITCase {
+
+ @Test
+ public void createWithReject() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithReject@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ // User with role 9 are defined in workflow as subject to approval
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(9L);
+ userTO.getMemberships().add(membershipTO);
+
+ // 1. create user with role 9
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals(9, userTO.getMemberships().get(0).getRoleId());
+ assertEquals("createApproval", userTO.getStatus());
+
+ // 2. request if there is any pending task for user just created
+ WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
+ assertNotNull(form);
+ assertNotNull(form.getUserKey());
+ assertEquals(userTO.getKey(), form.getUserKey());
+ assertNotNull(form.getTaskId());
+ assertNull(form.getOwner());
+
+ // 3. claim task from rossini, not in role 7 (designated for approval in workflow definition): fail
+ UserWorkflowService userService2 = clientFactory.create(
+ "rossini", ADMIN_PWD).getService(UserWorkflowService.class);
+
+ try {
+ userService2.claimForm(form.getTaskId());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.Workflow, e.getType());
+ }
+
+ // 4. claim task from bellini, in role 7
+ UserWorkflowService userService3 = clientFactory.create(
+ "bellini", ADMIN_PWD).getService(UserWorkflowService.class);
+
+ form = userService3.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 5. reject user
+ Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
+ props.get("approve").setValue(Boolean.FALSE.toString());
+ props.get("rejectReason").setValue("I don't like him.");
+ form.getProperties().clear();
+ form.getProperties().addAll(props.values());
+ userTO = userService3.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals("rejected", userTO.getStatus());
+
+ // 6. check that rejected user was not propagated to external resource (SYNCOPE-364)
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ Exception exception = null;
+ try {
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
+ new String[] { userTO.getUsername() }, Integer.class);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ }
+
+ @Test
+ public void createWithApproval() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ // read forms *before* any operation
+ List<WorkflowFormTO> forms = userWorkflowService.getForms();
+ assertNotNull(forms);
+ int preForms = forms.size();
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("createWithApproval@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ // User with role 9 are defined in workflow as subject to approval
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(9L);
+ userTO.getMemberships().add(membershipTO);
+
+ // 1. create user with role 9 (and verify that no propagation occurred)
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals(9, userTO.getMemberships().get(0).getRoleId());
+ assertEquals("createApproval", userTO.getStatus());
+ assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
+
+ assertTrue(userTO.getPropagationStatusTOs().isEmpty());
+
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ Exception exception = null;
+ try {
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?",
+ new String[] { userTO.getUsername() }, Integer.class);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+
+ // 2. request if there is any pending form for user just created
+ forms = userWorkflowService.getForms();
+ assertNotNull(forms);
+ assertEquals(preForms + 1, forms.size());
+
+ WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNull(form.getOwner());
+
+ // 4. claim task (from admin)
+ form = userWorkflowService.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 5. approve user (and verify that propagation occurred)
+ Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
+ props.get("approve").setValue(Boolean.TRUE.toString());
+ form.getProperties().clear();
+ form.getProperties().addAll(props.values());
+ userTO = userWorkflowService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+ assertEquals(Collections.singleton(RESOURCE_NAME_TESTDB), userTO.getResources());
+
+ exception = null;
+ try {
+ final String username = jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class,
+ userTO.getUsername());
+ assertEquals(userTO.getUsername(), username);
+ } catch (EmptyResultDataAccessException e) {
+ exception = e;
+ }
+ assertNull(exception);
+
+ // 6. update user
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("anotherPassword123");
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void issueSYNCOPE15() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ // read forms *before* any operation
+ List<WorkflowFormTO> forms = userWorkflowService.getForms();
+ assertNotNull(forms);
+ int preForms = forms.size();
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("issueSYNCOPE15@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getMemberships().clear();
+
+ // User with role 9 are defined in workflow as subject to approval
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(9L);
+ userTO.getMemberships().add(membershipTO);
+
+ // 1. create user with role 9 (and verify that no propagation occurred)
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertNotEquals(0L, userTO.getKey());
+ assertNotNull(userTO.getCreationDate());
+ assertNotNull(userTO.getCreator());
+ assertNotNull(userTO.getLastChangeDate());
+ assertNotNull(userTO.getLastModifier());
+ assertEquals(userTO.getCreationDate(), userTO.getLastChangeDate());
+
+ // 2. request if there is any pending form for user just created
+ forms = userWorkflowService.getForms();
+ assertEquals(preForms + 1, forms.size());
+
+ WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
+ assertNotNull(form);
+
+ // 3. first claim ny bellini ....
+ UserWorkflowService userService3 = clientFactory.create(
+ "bellini", ADMIN_PWD).getService(UserWorkflowService.class);
+
+ form = userService3.claimForm(form.getTaskId());
+ assertNotNull(form);
+ assertNotNull(form.getTaskId());
+ assertNotNull(form.getOwner());
+
+ // 4. second claim task by admin
+ form = userWorkflowService.claimForm(form.getTaskId());
+ assertNotNull(form);
+
+ // 5. approve user
+ final Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();
+ props.get("approve").setValue(Boolean.TRUE.toString());
+ form.getProperties().clear();
+ form.getProperties().addAll(props.values());
+
+ // 6. submit approve
+ userTO = userWorkflowService.submitForm(form);
+ assertNotNull(userTO);
+ assertEquals(preForms, userWorkflowService.getForms().size());
+ assertNull(userWorkflowService.getFormForUser(userTO.getKey()));
+
+ // 7. search approval into the history as well
+ forms = userWorkflowService.getFormsByName(userTO.getKey(), "Create approval");
+ assertFalse(forms.isEmpty());
+
+ int count = 0;
+ for (WorkflowFormTO hform : forms) {
+ if (form.getTaskId().equals(hform.getTaskId())) {
+ count++;
+
+ assertEquals("createApproval", hform.getKey());
+ assertNotNull(hform.getCreateTime());
+ assertNotNull(hform.getDueDate());
+ assertTrue(Boolean.parseBoolean(hform.getPropertyMap().get("approve").getValue()));
+ assertNull(hform.getPropertyMap().get("rejectReason").getValue());
+ }
+ }
+ assertEquals(1, count);
+
+ userService.delete(userTO.getKey());
+
+ try {
+ userService.read(userTO.getKey());
+ fail();
+ } catch (Exception ignore) {
+ assertNotNull(ignore);
+ }
+
+ try {
+ userWorkflowService.getFormsByName(userTO.getKey(), "Create approval");
+ fail();
+ } catch (Exception ignore) {
+ assertNotNull(ignore);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java
new file mode 100644
index 0000000..1dc6f20
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirAttrITCase.java
@@ -0,0 +1,872 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collections;
+import java.util.Map;
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.mod.MembershipMod;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.MappingTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class VirAttrITCase extends AbstractITCase {
+
+ @Test
+ public void issueSYNCOPE16() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("issue16@apache.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ userTO.getMemberships().add(membershipTO);
+
+ // 1. create user
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+
+ // 2. check for virtual attribute value
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertEquals("virtualvalue", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+ userMod.getVirAttrsToRemove().add("virtualdata");
+ userMod.getVirAttrsToUpdate().add(attrMod("virtualdata", "virtualupdated"));
+
+ // 3. update virtual attribute
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+
+ // 4. check for virtual attribute value
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertEquals("virtualupdated", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+ }
+
+ @Test
+ public void issueSYNCOPE260() {
+ // ----------------------------------
+ // create user and check virtual attribute value propagation
+ // ----------------------------------
+ UserTO userTO = UserITCase.getUniqueSampleTO("260@a.com");
+ userTO.getResources().add(RESOURCE_NAME_WS2);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
+ assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+ assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
+ // ----------------------------------
+
+ // ----------------------------------
+ // update user virtual attribute and check virtual attribute value update propagation
+ // ----------------------------------
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+
+ AttrMod attrMod = new AttrMod();
+ attrMod.setSchema("virtualdata");
+ attrMod.getValuesToBeRemoved().add("virtualvalue");
+ attrMod.getValuesToBeAdded().add("virtualvalue2");
+
+ userMod.getVirAttrsToUpdate().add(attrMod);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertEquals("ws-target-resource-2", userTO.getPropagationStatusTOs().get(0).getResource());
+ assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+ assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
+ // ----------------------------------
+
+ // ----------------------------------
+ // suspend/reactivate user and check virtual attribute value (unchanged)
+ // ----------------------------------
+ StatusMod statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.SUSPEND);
+ userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
+ assertEquals("suspended", userTO.getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+ assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
+ assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
+
+ statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.REACTIVATE);
+ userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
+ assertEquals("active", userTO.getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+ assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
+ assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
+ // ----------------------------------
+
+ // ----------------------------------
+ // update user attribute and check virtual attribute value (unchanged)
+ // ----------------------------------
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+
+ attrMod = new AttrMod();
+ attrMod.setSchema("surname");
+ attrMod.getValuesToBeRemoved().add("Surname");
+ attrMod.getValuesToBeAdded().add("Surname2");
+
+ userMod.getPlainAttrsToUpdate().add(attrMod);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
+ assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+ assertEquals("Surname2", connObjectTO.getPlainAttrMap().get("SURNAME").getValues().get(0));
+
+ // attribute "name" mapped on virtual attribute "virtualdata" shouldn't be changed
+ assertFalse(connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
+ assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("NAME").getValues().get(0));
+ // ----------------------------------
+
+ // ----------------------------------
+ // remove user virtual attribute and check virtual attribute value (reset)
+ // ----------------------------------
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getVirAttrsToRemove().add("virtualdata");
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ assertTrue(userTO.getVirAttrs().isEmpty());
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertEquals(RESOURCE_NAME_WS2, userTO.getPropagationStatusTOs().get(0).getResource());
+ assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_WS2, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+
+ // attribute "name" mapped on virtual attribute "virtualdata" should be reset
+ assertTrue(connObjectTO.getPlainAttrMap().get("NAME").getValues() == null
+ || connObjectTO.getPlainAttrMap().get("NAME").getValues().isEmpty());
+ // ----------------------------------
+ }
+
+ @Test
+ public void virAttrCache() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("virattrcache@apache.org");
+ userTO.getVirAttrs().clear();
+
+ AttrTO virAttrTO = new AttrTO();
+ virAttrTO.setSchema("virtualdata");
+ virAttrTO.getValues().add("virattrcache");
+ userTO.getVirAttrs().add(virAttrTO);
+
+ userTO.getMemberships().clear();
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
+
+ // 1. create user
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+
+ // 2. check for virtual attribute value
+ actual = userService.read(actual.getKey());
+ assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // 3. update virtual attribute directly
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ String value = jdbcTemplate.queryForObject(
+ "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
+ assertEquals("virattrcache", value);
+
+ jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getKey());
+
+ value = jdbcTemplate.queryForObject(
+ "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
+ assertEquals("virattrcache2", value);
+
+ // 4. check for cached attribute value
+ actual = userService.read(actual.getKey());
+ assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+
+ AttrMod virtualdata = new AttrMod();
+ virtualdata.setSchema("virtualdata");
+ virtualdata.getValuesToBeAdded().add("virtualupdated");
+
+ userMod.getVirAttrsToRemove().add("virtualdata");
+ userMod.getVirAttrsToUpdate().add(virtualdata);
+
+ // 5. update virtual attribute
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+
+ // 6. check for virtual attribute value
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertEquals("virtualupdated", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+ }
+
+ @Test
+ public void issueSYNCOPE397() {
+ ResourceTO csv = resourceService.read(RESOURCE_NAME_CSV);
+ final MappingTO origMapping = SerializationUtils.clone(csv.getUmapping());
+ try {
+ // change mapping of resource-csv
+ assertNotNull(origMapping);
+ for (MappingItemTO item : csv.getUmapping().getItems()) {
+ if ("email".equals(item.getIntAttrName())) {
+ // unset internal attribute mail and set virtual attribute virtualdata as mapped to external email
+ item.setIntMappingType(IntMappingType.UserVirtualSchema);
+ item.setIntAttrName("virtualdata");
+ item.setPurpose(MappingPurpose.BOTH);
+ item.setExtAttrName("email");
+ }
+ }
+
+ resourceService.update(csv.getKey(), csv);
+ csv = resourceService.read(RESOURCE_NAME_CSV);
+ assertNotNull(csv.getUmapping());
+
+ boolean found = false;
+ for (MappingItemTO item : csv.getUmapping().getItems()) {
+ if ("email".equals(item.getExtAttrName()) && "virtualdata".equals(item.getIntAttrName())) {
+ found = true;
+ }
+ }
+
+ assertTrue(found);
+
+ // create a new user
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope397@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+ userTO.getDerAttrs().add(attrTO("cn", null));
+ userTO.getVirAttrs().add(attrTO("virtualdata", "test@testone.org"));
+ // assign resource-csv to user
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+ // save user
+ UserTO created = createUser(userTO);
+ // make std controls about user
+ assertNotNull(created);
+ assertTrue(RESOURCE_NAME_CSV.equals(created.getResources().iterator().next()));
+ // update user
+ UserTO toBeUpdated = userService.read(created.getKey());
+ UserMod userMod = new UserMod();
+ userMod.setKey(toBeUpdated.getKey());
+ userMod.setPassword("password2");
+ // assign new resource to user
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_WS2);
+ //modify virtual attribute
+ userMod.getVirAttrsToRemove().add("virtualdata");
+ userMod.getVirAttrsToUpdate().add(attrMod("virtualdata", "test@testoneone.com"));
+
+ // check Syncope change password
+ StatusMod pwdPropRequest = new StatusMod();
+ pwdPropRequest.setOnSyncope(true);
+ pwdPropRequest.getResourceNames().add(RESOURCE_NAME_WS2);
+ userMod.setPwdPropRequest(pwdPropRequest);
+
+ toBeUpdated = updateUser(userMod);
+ assertNotNull(toBeUpdated);
+ assertEquals("test@testoneone.com", toBeUpdated.getVirAttrs().get(0).getValues().get(0));
+ // check if propagates correctly with assertEquals on size of tasks list
+ assertEquals(2, toBeUpdated.getPropagationStatusTOs().size());
+ } finally {
+ // restore mapping of resource-csv
+ csv.setUmapping(origMapping);
+ resourceService.update(csv.getKey(), csv);
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE442() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope442@apache.org");
+ userTO.getVirAttrs().clear();
+
+ AttrTO virAttrTO = new AttrTO();
+ virAttrTO.setSchema("virtualdata");
+ virAttrTO.getValues().add("virattrcache");
+ userTO.getVirAttrs().add(virAttrTO);
+
+ userTO.getMemberships().clear();
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
+
+ // 1. create user
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+
+ // 2. check for virtual attribute value
+ actual = userService.read(actual.getKey());
+ assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // ----------------------------------------
+ // 3. force cache expiring without any modification
+ // ----------------------------------------
+ String jdbcURL = null;
+ ConnInstanceTO connInstanceBean = connectorService.readByResource(RESOURCE_NAME_DBVIRATTR);
+ for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
+ if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
+ jdbcURL = prop.getValues().iterator().next().toString();
+ prop.getValues().clear();
+ prop.getValues().add("jdbc:h2:tcp://localhost:9092/xxx");
+ }
+ }
+
+ connectorService.update(connInstanceBean.getKey(), connInstanceBean);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+
+ AttrMod virtualdata = new AttrMod();
+ virtualdata.setSchema("virtualdata");
+ virtualdata.getValuesToBeAdded().add("virtualupdated");
+
+ userMod.getVirAttrsToRemove().add("virtualdata");
+ userMod.getVirAttrsToUpdate().add(virtualdata);
+
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+ // ----------------------------------------
+
+ // ----------------------------------------
+ // 4. update virtual attribute
+ // ----------------------------------------
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ String value = jdbcTemplate.queryForObject(
+ "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
+ assertEquals("virattrcache", value);
+
+ jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getKey());
+
+ value = jdbcTemplate.queryForObject(
+ "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getKey());
+ assertEquals("virattrcache2", value);
+ // ----------------------------------------
+
+ actual = userService.read(actual.getKey());
+ assertEquals("virattrcache", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // ----------------------------------------
+ // 5. restore connector
+ // ----------------------------------------
+ for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
+ if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
+ prop.getValues().clear();
+ prop.getValues().add(jdbcURL);
+ }
+ }
+
+ connectorService.update(connInstanceBean.getKey(), connInstanceBean);
+ // ----------------------------------------
+
+ actual = userService.read(actual.getKey());
+ assertEquals("virattrcache2", actual.getVirAttrMap().get("virtualdata").getValues().get(0));
+ }
+
+ @Test
+ public void issueSYNCOPE436() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope436@syncope.apache.org");
+ userTO.getMemberships().clear();
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_LDAP);
+ userTO.getVirAttrs().add(attrTO("virtualReadOnly", "readOnly"));
+ userTO = createUser(userTO);
+ //Finding no values because the virtual attribute is readonly
+ assertTrue(userTO.getVirAttrMap().get("virtualReadOnly").getValues().isEmpty());
+ }
+
+ @Test
+ public void issueSYNCOPE453() {
+ final String resourceName = "issueSYNCOPE453-Res-" + getUUIDString();
+ final String roleName = "issueSYNCOPE453-Role-" + getUUIDString();
+
+ // -------------------------------------------
+ // Create a resource ad-hoc
+ // -------------------------------------------
+ final ResourceTO resourceTO = new ResourceTO();
+
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(107L);
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntAttrName("aLong");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setExtAttrName(roleName);
+ item.setPurpose(MappingPurpose.PROPAGATION);
+ item.setAccountid(true);
+ mapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setExtAttrName("USERNAME");
+ item.setIntAttrName("username");
+ item.setIntMappingType(IntMappingType.Username);
+ item.setPurpose(MappingPurpose.PROPAGATION);
+ mapping.getItems().add(item);
+
+ item = new MappingItemTO();
+ item.setExtAttrName("EMAIL");
+ item.setIntAttrName("rvirtualdata");
+ item.setIntMappingType(IntMappingType.RoleVirtualSchema);
+ item.setPurpose(MappingPurpose.PROPAGATION);
+ mapping.getItems().add(item);
+
+ resourceTO.setUmapping(mapping);
+ assertNotNull(getObject(
+ resourceService.create(resourceTO).getLocation(), ResourceService.class, ResourceTO.class));
+ // -------------------------------------------
+
+ // -------------------------------------------
+ // Create a role ad-hoc
+ // -------------------------------------------
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName(roleName);
+ roleTO.setParent(8L);
+ roleTO.getRVirAttrTemplates().add("rvirtualdata");
+ roleTO.getVirAttrs().add(attrTO("rvirtualdata", "ml@role.it"));
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
+ roleTO = createRole(roleTO);
+ assertEquals(1, roleTO.getVirAttrs().size());
+ assertEquals("ml@role.it", roleTO.getVirAttrs().get(0).getValues().get(0));
+ // -------------------------------------------
+
+ // -------------------------------------------
+ // Create new user
+ // -------------------------------------------
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope453@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO("aLong", "123"));
+ userTO.getResources().clear();
+ userTO.getResources().add(resourceName);
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getMemberships().clear();
+
+ final MembershipTO membership = new MembershipTO();
+ membership.setRoleId(roleTO.getKey());
+ membership.getVirAttrs().add(attrTO("mvirtualdata", "mvirtualvalue"));
+ userTO.getMemberships().add(membership);
+
+ userTO = createUser(userTO);
+ assertEquals(2, userTO.getPropagationStatusTOs().size());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+ assertTrue(userTO.getPropagationStatusTOs().get(1).getStatus().isSuccessful());
+
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ final Map<String, Object> actuals = jdbcTemplate.queryForMap(
+ "SELECT id, surname, email FROM testsync WHERE id=?",
+ new Object[] { Integer.parseInt(userTO.getPlainAttrMap().get("aLong").getValues().get(0)) });
+
+ assertEquals(userTO.getPlainAttrMap().get("aLong").getValues().get(0), actuals.get("id").toString());
+ assertEquals("ml@role.it", actuals.get("email"));
+ // -------------------------------------------
+
+ // -------------------------------------------
+ // Delete resource and role ad-hoc
+ // -------------------------------------------
+ resourceService.delete(resourceName);
+ roleService.delete(roleTO.getKey());
+ // -------------------------------------------
+ }
+
+ @Test
+ public void issueSYNCOPE459() {
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope459@apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getVirAttrs().clear();
+
+ final AttrTO virtualReadOnly = attrTO("virtualReadOnly", "");
+ virtualReadOnly.getValues().clear();
+
+ userTO.getVirAttrs().add(virtualReadOnly);
+
+ userTO = createUser(userTO);
+
+ assertNotNull(userTO.getVirAttrMap().get("virtualReadOnly"));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+
+ AttrMod virtualdata = new AttrMod();
+ virtualdata.setSchema("virtualdata");
+
+ userMod.getVirAttrsToUpdate().add(virtualdata);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO.getVirAttrMap().get("virtualdata"));
+ }
+
+ @Test
+ public void issueSYNCOPE458() {
+ // -------------------------------------------
+ // Create a role ad-hoc
+ // -------------------------------------------
+ final String roleName = "issueSYNCOPE458-Role-" + getUUIDString();
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName(roleName);
+ roleTO.setParent(2L);
+ roleTO.setInheritTemplates(true);
+ roleTO = createRole(roleTO);
+ // -------------------------------------------
+
+ // -------------------------------------------
+ // Update resource-db-virattr mapping adding new membership virtual schema mapping
+ // -------------------------------------------
+ ResourceTO resourceDBVirAttr = resourceService.read(RESOURCE_NAME_DBVIRATTR);
+ assertNotNull(resourceDBVirAttr);
+
+ final MappingTO resourceUMapping = resourceDBVirAttr.getUmapping();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntAttrName("mvirtualdata");
+ item.setIntMappingType(IntMappingType.MembershipVirtualSchema);
+ item.setExtAttrName("EMAIL");
+ item.setPurpose(MappingPurpose.BOTH);
+
+ resourceUMapping.addItem(item);
+
+ resourceDBVirAttr.setUmapping(resourceUMapping);
+
+ resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
+ // -------------------------------------------
+
+ // -------------------------------------------
+ // Create new user
+ // -------------------------------------------
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope458@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getMemberships().clear();
+
+ // add membership, with virtual attribute populated, to user
+ MembershipTO membership = new MembershipTO();
+ membership.setRoleId(roleTO.getKey());
+ membership.getVirAttrs().add(attrTO("mvirtualdata", "syncope458@syncope.apache.org"));
+ userTO.getMemberships().add(membership);
+
+ //propagate user
+ userTO = createUser(userTO);
+ assertEquals(1, userTO.getPropagationStatusTOs().size());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+ // -------------------------------------------
+
+ // 1. check if membership has virtual attribute populated
+ assertNotNull(userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata"));
+ assertEquals("syncope458@syncope.apache.org",
+ userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata").getValues().get(0));
+ // -------------------------------------------
+
+ // 2. update membership virtual attribute
+ MembershipMod membershipMod = new MembershipMod();
+ membershipMod.setRole(roleTO.getKey());
+ membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope458_NEW@syncope.apache.org"));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ // 3. check again after update if membership has virtual attribute populated with new value
+ assertNotNull(userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata"));
+ assertEquals("syncope458_NEW@syncope.apache.org", userTO.getMemberships().get(0).getVirAttrMap().get(
+ "mvirtualdata").getValues().get(0));
+
+ // ----------------------------------------
+ // force cache expiring without any modification
+ // ----------------------------------------
+ String jdbcURL = null;
+ ConnInstanceTO connInstanceBean = connectorService.readByResource(RESOURCE_NAME_DBVIRATTR);
+ for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
+ if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
+ jdbcURL = prop.getValues().iterator().next().toString();
+ prop.getValues().clear();
+ prop.getValues().add("jdbc:h2:tcp://localhost:9092/xxx");
+ }
+ }
+
+ connectorService.update(connInstanceBean.getKey(), connInstanceBean);
+
+ membershipMod = new MembershipMod();
+ membershipMod.setRole(roleTO.getKey());
+ membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope458_updated@syncope.apache.org"));
+
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ // ----------------------------------
+
+ // change attribute value directly on resource
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ String value = jdbcTemplate.queryForObject(
+ "SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
+ assertEquals("syncope458_NEW@syncope.apache.org", value);
+
+ jdbcTemplate.update("UPDATE testsync set EMAIL='syncope458_NEW_TWO@syncope.apache.org' WHERE ID=?", userTO.
+ getKey());
+
+ value = jdbcTemplate.queryForObject("SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
+ assertEquals("syncope458_NEW_TWO@syncope.apache.org", value);
+ // ----------------------------------------
+
+ // ----------------------------------------
+ // restore connector
+ // ----------------------------------------
+ for (ConnConfProperty prop : connInstanceBean.getConfiguration()) {
+ if ("jdbcUrlTemplate".equals(prop.getSchema().getName())) {
+ prop.getValues().clear();
+ prop.getValues().add(jdbcURL);
+ }
+ }
+ connectorService.update(connInstanceBean.getKey(), connInstanceBean);
+ // ----------------------------------------
+
+ userTO = userService.read(userTO.getKey());
+ assertNotNull(userTO);
+ // 4. check virtual attribute synchronization after direct update on resource
+ assertEquals("syncope458_NEW_TWO@syncope.apache.org", userTO.getMemberships().get(0).getVirAttrMap().get(
+ "mvirtualdata").getValues().get(0));
+
+ // 5. remove membership virtual attribute
+ membershipMod = new MembershipMod();
+ membershipMod.setRole(roleTO.getKey());
+ membershipMod.getVirAttrsToRemove().add("mvirtualdata");
+
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ // check again after update if membership hasn't any virtual attribute
+ assertTrue(userTO.getMemberships().get(0).getVirAttrMap().isEmpty());
+
+ // -------------------------------------------
+ // Delete role ad-hoc and restore resource mapping
+ // -------------------------------------------
+ roleService.delete(roleTO.getKey());
+
+ resourceUMapping.removeItem(item);
+ resourceDBVirAttr.setUmapping(resourceUMapping);
+ resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
+ // -------------------------------------------
+ }
+
+ @Test
+ public void issueSYNCOPE501() {
+ // PHASE 1: update only user virtual attributes
+
+ // 1. create user and propagate him on resource-db-virattr
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope501@apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getVirAttrs().clear();
+
+ userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
+
+ // virtualdata is mapped with username
+ final AttrTO virtualData = attrTO("virtualdata", "syncope501@apache.org");
+ userTO.getVirAttrs().add(virtualData);
+
+ userTO = createUser(userTO);
+
+ assertNotNull(userTO.getVirAttrMap().get("virtualdata"));
+ assertEquals("syncope501@apache.org", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // 2. update virtual attribute
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+
+ final StatusMod statusMod = new StatusMod();
+ statusMod.getResourceNames().addAll(Collections.<String>emptySet());
+ statusMod.setOnSyncope(false);
+
+ userMod.setPwdPropRequest(statusMod);
+ // change virtual attribute value
+ final AttrMod virtualDataMod = new AttrMod();
+ virtualDataMod.setSchema("virtualdata");
+ virtualDataMod.getValuesToBeAdded().add("syncope501_updated@apache.org");
+ virtualDataMod.getValuesToBeRemoved().add("syncope501@apache.org");
+ userMod.getVirAttrsToUpdate().add(virtualDataMod);
+ userMod.getVirAttrsToRemove().add("virtualdata");
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ // 3. check that user virtual attribute has really been updated
+ assertFalse(userTO.getVirAttrMap().get("virtualdata").getValues().isEmpty());
+ assertEquals("syncope501_updated@apache.org", userTO.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // ----------------------------------------------------------
+ // PHASE 2: update only membership virtual attributes
+ // -------------------------------------------
+ // Update resource-db-virattr mapping adding new membership virtual schema mapping
+ // -------------------------------------------
+ ResourceTO resourceDBVirAttr = resourceService.read(RESOURCE_NAME_DBVIRATTR);
+ assertNotNull(resourceDBVirAttr);
+
+ final MappingTO resourceUMapping = resourceDBVirAttr.getUmapping();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntAttrName("mvirtualdata");
+ item.setIntMappingType(IntMappingType.MembershipVirtualSchema);
+ item.setExtAttrName("EMAIL");
+ item.setPurpose(MappingPurpose.BOTH);
+
+ resourceUMapping.addItem(item);
+
+ resourceDBVirAttr.setUmapping(resourceUMapping);
+
+ resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
+ // -------------------------------------------
+
+ // -------------------------------------------
+ // Create a role ad-hoc
+ // -------------------------------------------
+ final String roleName = "issueSYNCOPE501-Role-" + getUUIDString();
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName(roleName);
+ roleTO.setParent(2L);
+ roleTO.setInheritTemplates(true);
+ roleTO = createRole(roleTO);
+ // -------------------------------------------
+
+ // 1. add membership, with virtual attribute populated, to user
+ MembershipMod membershipMod = new MembershipMod();
+ membershipMod.setRole(roleTO.getKey());
+ membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata", "syncope501membership@test.org"));
+
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.setPwdPropRequest(statusMod);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ assertEquals("syncope501membership@test.org",
+ userTO.getMemberships().get(0).getVirAttrMap().get("mvirtualdata").getValues().get(0));
+
+ // 2. update only membership virtual attribute and propagate user
+ membershipMod = new MembershipMod();
+ membershipMod.setRole(roleTO.getKey());
+ membershipMod.getVirAttrsToUpdate().add(attrMod("mvirtualdata",
+ "syncope501membership_updated@test.org"));
+ membershipMod.getVirAttrsToRemove().add("syncope501membership@test.org");
+
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
+ userMod.setPwdPropRequest(statusMod);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ // 3. check if change has been propagated
+ assertEquals("syncope501membership_updated@test.org", userTO.getMemberships().get(0).getVirAttrMap().
+ get("mvirtualdata").getValues().get(0));
+
+ // 4. delete membership and check on resource attribute deletion
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().get(0).getKey());
+ userMod.setPwdPropRequest(statusMod);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ assertTrue(userTO.getMemberships().isEmpty());
+
+ // read attribute value directly on resource
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ final String emailValue = jdbcTemplate.queryForObject(
+ "SELECT EMAIL FROM testsync WHERE ID=?", String.class, userTO.getKey());
+ assertTrue(StringUtils.isBlank(emailValue));
+ // ----------------------------------------
+
+ // -------------------------------------------
+ // Delete role ad-hoc and restore resource mapping
+ // -------------------------------------------
+ roleService.delete(roleTO.getKey());
+
+ resourceUMapping.removeItem(item);
+ resourceDBVirAttr.setUmapping(resourceUMapping);
+ resourceService.update(RESOURCE_NAME_DBVIRATTR, resourceDBVirAttr);
+ // -------------------------------------------
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java
new file mode 100644
index 0000000..884b5cb
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/VirSchemaITCase.java
@@ -0,0 +1,122 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.VirSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class VirSchemaITCase extends AbstractITCase {
+
+ @Test
+ public void list() {
+ List<VirSchemaTO> vSchemas = schemaService.list(AttributableType.USER, SchemaType.VIRTUAL);
+ assertFalse(vSchemas.isEmpty());
+ for (VirSchemaTO vSchemaTO : vSchemas) {
+ assertNotNull(vSchemaTO);
+ }
+ }
+
+ @Test
+ public void read() {
+ VirSchemaTO vSchemaTO = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL,
+ "mvirtualdata");
+ assertNotNull(vSchemaTO);
+ }
+
+ @Test
+ public void create() {
+ VirSchemaTO schema = new VirSchemaTO();
+ schema.setKey("virtual");
+
+ VirSchemaTO actual = createSchema(AttributableType.USER, SchemaType.VIRTUAL, schema);
+ assertNotNull(actual);
+
+ actual = schemaService.read(AttributableType.USER, SchemaType.VIRTUAL, actual.getKey());
+ assertNotNull(actual);
+ }
+
+ @Test
+ public void delete() {
+ VirSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaType.VIRTUAL, "rvirtualdata");
+ assertNotNull(schema);
+
+ schemaService.delete(AttributableType.ROLE, SchemaType.VIRTUAL, schema.getKey());
+
+ try {
+ schemaService.read(AttributableType.ROLE, SchemaType.VIRTUAL, "rvirtualdata");
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE323() {
+ VirSchemaTO actual = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, "mvirtualdata");
+ assertNotNull(actual);
+
+ try {
+ createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.EntityExists, e.getType());
+ }
+
+ actual.setKey(null);
+ try {
+ createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE418() {
+ VirSchemaTO schema = new VirSchemaTO();
+ schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
+
+ try {
+ createSchema(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL, schema);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidVirSchema, e.getType());
+
+ assertTrue(e.getElements().iterator().next().toString().contains(EntityViolationType.InvalidName.name()));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
new file mode 100644
index 0000000..2f203e6
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/WorkflowITCase.java
@@ -0,0 +1,77 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import java.io.IOException;
+import java.io.InputStream;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.junit.Assume;
+import org.junit.Test;
+
+public class WorkflowITCase extends AbstractITCase {
+
+ private void exportDefinition(final SubjectType type) throws IOException {
+ Response response = workflowService.exportDefinition(type);
+ assertTrue(response.getMediaType().toString().
+ startsWith(clientFactory.getContentType().getMediaType().toString()));
+ assertTrue(response.getEntity() instanceof InputStream);
+ String definition = IOUtils.toString((InputStream) response.getEntity());
+ assertNotNull(definition);
+ assertFalse(definition.isEmpty());
+ }
+
+ @Test
+ public void exportUserDefinition() throws IOException {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+ exportDefinition(SubjectType.USER);
+ }
+
+ @Test
+ public void getRoleDefinition() throws IOException {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles(syncopeService));
+ exportDefinition(SubjectType.ROLE);
+ }
+
+ private void importDefinition(final SubjectType type) throws IOException {
+ Response response = workflowService.exportDefinition(type);
+ String definition = IOUtils.toString((InputStream) response.getEntity());
+
+ workflowService.importDefinition(type, definition);
+ }
+
+ @Test
+ public void updateUserDefinition() throws IOException {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ importDefinition(SubjectType.USER);
+ }
+
+ @Test
+ public void updateRoleDefinition() throws IOException {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForRoles(syncopeService));
+
+ importDefinition(SubjectType.ROLE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/resources/addActivitiToContent.xsl
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/resources/addActivitiToContent.xsl b/syncope620/fit/server-reference/src/test/resources/addActivitiToContent.xsl
new file mode 100644
index 0000000..44fd18e
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/resources/addActivitiToContent.xsl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:template match="/dataset">
+ <dataset>
+ <xsl:apply-templates/>
+
+ <ACT_RU_EXECUTION ID_="4" REV_="2" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_TASK ID_="5" REV_="2" EXECUTION_ID_="4" PROC_INST_ID_="4" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+ <ACT_RU_EXECUTION ID_="6" REV_="2" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_TASK ID_="7" REV_="2" EXECUTION_ID_="6" PROC_INST_ID_="6" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+ <ACT_RU_EXECUTION ID_="8" REV_="2" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_TASK ID_="9" REV_="2" EXECUTION_ID_="8" PROC_INST_ID_="8" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+ <ACT_RU_EXECUTION ID_="10" REV_="2" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_TASK ID_="11" REV_="2" EXECUTION_ID_="10" PROC_INST_ID_="10" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+
+ <ACT_RU_EXECUTION ID_="12" REV_="2" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" ACT_ID_="active" IS_ACTIVE_="1" IS_CONCURRENT_="0" IS_SCOPE_="1" IS_EVENT_SCOPE_="0" SUSPENSION_STATE_="1"/>
+ <ACT_RU_TASK ID_="13" REV_="2" EXECUTION_ID_="12" PROC_INST_ID_="12" PROC_DEF_ID_="userWorkflow:1:4" NAME_="Active" TASK_DEF_KEY_="active" PRIORITY_="50" CREATE_TIME_="2013-02-25T17:19:03+0100"/>
+ </dataset>
+ </xsl:template>
+
+ <xsl:template match="node()|@*|comment()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/resources/favicon.jpg
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/resources/favicon.jpg b/syncope620/fit/server-reference/src/test/resources/favicon.jpg
new file mode 100644
index 0000000..cf212be
Binary files /dev/null and b/syncope620/fit/server-reference/src/test/resources/favicon.jpg differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/resources/test.csv
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/resources/test.csv b/syncope620/fit/server-reference/src/test/resources/test.csv
new file mode 100644
index 0000000..f227366
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/resources/test.csv
@@ -0,0 +1,10 @@
+test0,nome0,cognome0,test0@syncope.apache.org,password0,role1,membership1,true,false
+test1,nome1,cognome1,test1@syncope.apache.org,password1,role1,membership1,false,false
+test2,nome2,cognome2,test2@syncope.apache.org,notpermitted1,role1,membership1,true,false
+test3,nome3,cognome3,test3@syncope.apache.org,password3,role1,membership1,true,false
+test4,nome4,cognome4,test4@syncope.apache.org,password4,role1,membership1,true,false
+test5,nome5,cognome5,test5@syncope.apache.org,password5,role1,membership1,true,false
+test6,nome6,cognome6,test6@syncope.apache.org,password6,role1,membership1,true,false
+test7,nome7,cognome7,test7@syncope.apache.org,password7,role1,membership1,true,false
+test8,nome8,cognome8,test8@syncope.apache.org,password8,role1,membership1,true,false
+test9,nome9,cognome9,test9@syncope.apache.org,password999,role1,membership1,true,false
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/resources/testJDBCContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/resources/testJDBCContext.xml b/syncope620/fit/server-reference/src/test/resources/testJDBCContext.xml
new file mode 100644
index 0000000..d89e067
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/resources/testJDBCContext.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="testDataSource"
+ class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="${testdb.driver}"/>
+ <property name="url" value="${testdb.url}"/>
+ <property name="username" value="${testdb.username}"/>
+ <property name="password" value="${testdb.password}"/>
+ </bean>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/pom.xml b/syncope620/pom.xml
index 73c067f..3463a48 100644
--- a/syncope620/pom.xml
+++ b/syncope620/pom.xml
@@ -367,6 +367,8 @@ under the License.
<highlightjs.version>8.0</highlightjs.version>
<codemirror.version>3.23</codemirror.version>
+ <wicket.version>6.19.0</wicket.version>
+
<testds.port>1389</testds.port>
<testdb.webport>9082</testdb.webport>
@@ -771,6 +773,7 @@ under the License.
<version>2.11.0</version>
</dependency>
+ <!-- Activiti -->
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
@@ -813,6 +816,36 @@ under the License.
<version>${activiti.version}</version>
<type>war</type>
</dependency>
+ <!-- /Activiti -->
+
+ <!-- Wicket -->
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>${wicket.version}</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-extensions</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-datetime</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-spring</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-auth-roles</artifactId>
+ <version>${wicket.version}</version>
+ </dependency>
+ <!-- /Wicket -->
<dependency>
<groupId>org.slf4j</groupId>
[35/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
new file mode 100644
index 0000000..ed8419e
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Users.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel.EventDataWrapper;
+import org.apache.syncope.client.console.panels.UserSearchPanel;
+import org.apache.syncope.client.console.panels.UserSearchResultPanel;
+import org.apache.syncope.client.console.rest.UserRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.Session;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class Users extends BasePage {
+
+ private static final long serialVersionUID = 134681165644474568L;
+
+ private final static int EDIT_MODAL_WIN_HEIGHT = 550;
+
+ private final static int EDIT_MODAL_WIN_WIDTH = 800;
+
+ @SpringBean
+ private UserRestClient restClient;
+
+ public Users(final PageParameters parameters) {
+ super(parameters);
+
+ // Modal window for editing user attributes
+ final ModalWindow editModalWin = new ModalWindow("editModal");
+ editModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editModalWin.setInitialHeight(EDIT_MODAL_WIN_HEIGHT);
+ editModalWin.setInitialWidth(EDIT_MODAL_WIN_WIDTH);
+ editModalWin.setCookieName("edit-modal");
+ add(editModalWin);
+
+ final AbstractSearchResultPanel searchResult =
+ new UserSearchResultPanel("searchResult", true, null, getPageReference(), restClient);
+ add(searchResult);
+
+ final AbstractSearchResultPanel listResult =
+ new UserSearchResultPanel("listResult", false, null, getPageReference(), restClient);
+ add(listResult);
+
+ // create new user
+ final AjaxLink<Void> createLink = new ClearIndicatingAjaxLink<Void>("createLink", getPageReference()) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ editModalWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new EditUserModalPage(Users.this.getPageReference(), editModalWin, new UserTO());
+ }
+ });
+
+ editModalWin.show(target);
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(
+ createLink, ENABLE, xmlRolesReader.getEntitlement("Users", "create"));
+ add(createLink);
+
+ setWindowClosedReloadCallback(editModalWin);
+
+ final Form searchForm = new Form("searchForm");
+ add(searchForm);
+
+ final UserSearchPanel searchPanel = new UserSearchPanel.Builder("searchPanel").build();
+ searchForm.add(searchPanel);
+
+ final ClearIndicatingAjaxButton searchButton =
+ new ClearIndicatingAjaxButton("search", new ResourceModel("search"), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ final String fiql = searchPanel.buildFIQL();
+ LOG.debug("FIQL: " + fiql);
+
+ doSearch(target, fiql, searchResult);
+
+ Session.get().getFeedbackMessages().clear();
+ searchPanel.getSearchFeedback().refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+
+ searchPanel.getSearchFeedback().refresh(target);
+ }
+ };
+
+ searchForm.add(searchButton);
+ searchForm.setDefaultButton(searchButton);
+ }
+
+ private void doSearch(final AjaxRequestTarget target, final String fiql,
+ final AbstractSearchResultPanel resultsetPanel) {
+
+ if (fiql == null) {
+ error(getString(Constants.SEARCH_ERROR));
+ return;
+ }
+
+ resultsetPanel.search(fiql, target);
+ }
+
+ private void setWindowClosedReloadCallback(final ModalWindow window) {
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ final EventDataWrapper data = new EventDataWrapper();
+ data.setTarget(target);
+ data.setCreate(true);
+
+ send(getPage(), Broadcast.BREADTH, data);
+
+ if (isModalResult()) {
+ // reset modal result
+ setModalResult(false);
+ // set operation succeeded
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ // refresh feedback panel
+ feedbackPanel.refresh(target);
+ }
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ViewUserModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ViewUserModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ViewUserModalPage.java
new file mode 100644
index 0000000..d47e07f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ViewUserModalPage.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+
+public class ViewUserModalPage extends EditUserModalPage {
+
+ private static final long serialVersionUID = -8715255026876951611L;
+
+ public ViewUserModalPage(final PageReference callerPageRef, final ModalWindow window, final UserTO userTO) {
+ super(callerPageRef, window, userTO);
+ form.setEnabled(false);
+ form.get(CANCEL).setVisible(false);
+ }
+
+ @Override
+ protected AjaxButton getOnSubmit() {
+ AjaxButton submit = super.getOnSubmit();
+ submit.setVisible(false);
+ return submit;
+ }
+
+ @Override
+ protected void submitAction(final AjaxRequestTarget target, final Form form) {
+ // No submit allowed, read-only form
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
new file mode 100644
index 0000000..daa65d6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/VirSchemaModalPage.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.VirSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Modal window with Schema form.
+ */
+public class VirSchemaModalPage extends AbstractSchemaModalPage<VirSchemaTO> {
+
+ private static final long serialVersionUID = 5979623248182851337L;
+
+ public VirSchemaModalPage(final AttributableType kind) {
+ super(kind);
+ }
+
+ @Override
+ public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
+ VirSchemaTO schema, final boolean createFlag) {
+
+ if (schema == null) {
+ schema = new VirSchemaTO();
+ }
+
+ final Form<VirSchemaTO> schemaForm = new Form<VirSchemaTO>(FORM);
+
+ schemaForm.setModel(new CompoundPropertyModel<VirSchemaTO>(schema));
+
+ final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
+ schema, "name"));
+ name.addRequiredLabel();
+
+ name.setEnabled(createFlag);
+
+ final AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", getString("readonly"),
+ new PropertyModel<Boolean>(schema, "readonly"));
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ VirSchemaTO schemaTO = (VirSchemaTO) form.getDefaultModelObject();
+ try {
+ if (createFlag) {
+ schemaRestClient.createVirSchema(kind, schemaTO);
+ } else {
+ schemaRestClient.updateVirSchema(kind, schemaTO);
+ }
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+
+ String allowedRoles = createFlag
+ ? xmlRolesReader.getEntitlement("Schema", "create")
+ : xmlRolesReader.getEntitlement("Schema", "update");
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
+
+ schemaForm.add(name);
+ schemaForm.add(readonly);
+
+ schemaForm.add(submit);
+ schemaForm.add(cancel);
+
+ add(schemaForm);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/WelcomePage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/WelcomePage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/WelcomePage.java
new file mode 100644
index 0000000..d9f884d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/WelcomePage.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.SyncopeApplication;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.rest.UserSelfRestClient;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Welcome page to display after successful login.
+ */
+public class WelcomePage extends WebPage {
+
+ private static final long serialVersionUID = 8851399358753120581L;
+
+ @SpringBean
+ private XMLRolesReader xmlRolesReader;
+
+ @SpringBean
+ private UserSelfRestClient userSelfRestClient;
+
+ public WelcomePage(final PageParameters parameters) {
+ super(parameters);
+ setupNavigationPanel();
+ setupEditProfileModal();
+ }
+
+ //To prevent warning: "leaking this in constructor java"
+ private void setupNavigationPanel() {
+ ((SyncopeApplication) getApplication()).setupNavigationPanel(this, xmlRolesReader, false);
+ }
+
+ private void setupEditProfileModal() {
+ ((SyncopeApplication) getApplication()).setupEditProfileModal(this, userSelfRestClient);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
new file mode 100644
index 0000000..b5a8d10
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.util.io.IOUtils;
+
+public class XMLEditorPopupPage extends BasePopupPage {
+
+ private static final long serialVersionUID = 5816041644635271734L;
+
+ @SpringBean
+ private WorkflowRestClient wfRestClient;
+
+ public XMLEditorPopupPage() {
+ Form wfForm = new Form("workflowDefForm");
+
+ String definition;
+ try {
+ definition = IOUtils.toString(wfRestClient.getDefinition(MediaType.APPLICATION_XML_TYPE));
+ } catch (IOException e) {
+ LOG.error("Could not get workflow definition", e);
+ definition = StringUtils.EMPTY;
+ }
+ final TextArea<String> workflowDefArea = new TextArea<String>("workflowDefArea", new Model<String>(definition));
+ wfForm.add(workflowDefArea);
+
+ AjaxButton submit =
+ new ClearIndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT)), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ wfRestClient.updateDefinition(
+ MediaType.APPLICATION_XML_TYPE, workflowDefArea.getModelObject());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scee) {
+ error(getString(Constants.ERROR) + ": " + scee.getMessage());
+ }
+ feedbackPanel.refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final Button close = new Button("closePage", new Model<String>(getString(CANCEL)));
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ submit, ENABLE, xmlRolesReader.getEntitlement("Configuration", "workflowDefUpdate"));
+ wfForm.add(submit);
+ wfForm.add(close);
+ this.add(wfForm);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.java
new file mode 100644
index 0000000..e066aac
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.PushTaskModalPage;
+import org.apache.syncope.client.console.pages.SyncTaskModalPage;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Tasks.TasksProvider;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.common.lib.to.AbstractProvisioningTaskTO;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.http.WebResponse;
+
+public abstract class AbstractProvisioningTasksPanel<T extends AbstractProvisioningTaskTO> extends AbstractTasks {
+
+ private static final long serialVersionUID = -8674781241465369244L;
+
+ private final int paginatorRows;
+
+ protected WebMarkupContainer container;
+
+ protected ModalWindow window;
+
+ protected AjaxDataTablePanel<AbstractTaskTO, String> table;
+
+ private final Class<T> reference;
+
+ public AbstractProvisioningTasksPanel(final String id, final PageReference pageRef, final Class<T> reference) {
+ super(id, pageRef);
+
+ this.reference = reference;
+
+ container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ window = new ModalWindow("taskWin");
+ window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ window.setInitialHeight(WIN_HEIGHT);
+ window.setInitialWidth(WIN_WIDTH);
+ window.setCookieName(VIEW_TASK_WIN_COOKIE_NAME);
+ add(window);
+
+ ((Tasks) pageRef.getPage()).setWindowClosedCallback(window, container);
+
+ paginatorRows = prefMan.getPaginatorRows(getWebRequest(), Constants.PREF_SYNC_TASKS_PAGINATOR_ROWS);
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof AbstractSearchResultPanel.EventDataWrapper) {
+ ((AbstractSearchResultPanel.EventDataWrapper) event.getPayload()).getTarget().add(container);
+ }
+ }
+
+ protected void initTasksTable() {
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<T>(restClient, paginatorRows, getId(), this.reference),
+ container,
+ 0,
+ this.pageRef,
+ restClient);
+
+ Form paginatorForm = new Form("PaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
+ prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getWebRequest(), (WebResponse) getResponse(), Constants.PREF_SYNC_TASKS_PAGINATOR_ROWS,
+ String.valueOf(paginatorRows));
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<T>(restClient, paginatorRows, getId(), reference),
+ container,
+ table == null ? 0 : (int) table.getCurrentPage(),
+ pageRef,
+ restClient);
+
+ target.add(container);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ container.add(paginatorForm);
+
+ // create new task
+ AjaxLink<Void> createLink = new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return reference.equals(SyncTaskTO.class)
+ ? new SyncTaskModalPage(window, new SyncTaskTO(), pageRef)
+ : new PushTaskModalPage(window, new PushTaskTO(), pageRef);
+ }
+ });
+
+ window.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ createLink, RENDER, xmlRolesReader.getEntitlement(TASKS, "create"));
+
+ add(createLink);
+
+ }
+
+ protected abstract List<IColumn<AbstractTaskTO, String>> getColumns();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
new file mode 100644
index 0000000..aa30fae
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchPanel.java
@@ -0,0 +1,401 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.cxf.jaxrs.ext.search.ConditionType;
+import org.apache.cxf.jaxrs.ext.search.SearchBean;
+import org.apache.cxf.jaxrs.ext.search.SearchCondition;
+import org.apache.cxf.jaxrs.ext.search.client.CompleteCondition;
+import org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser;
+import org.apache.syncope.client.console.rest.AuthRestClient;
+import org.apache.syncope.client.console.rest.ResourceRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.common.lib.search.RoleFiqlSearchConditionBuilder;
+import org.apache.syncope.common.lib.search.SearchableFields;
+import org.apache.syncope.common.lib.search.SpecialAttr;
+import org.apache.syncope.common.lib.search.SyncopeFiqlSearchConditionBuilder;
+import org.apache.syncope.common.lib.search.SyncopeProperty;
+import org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.wicket.feedback.FeedbackMessage;
+import org.apache.wicket.feedback.IFeedbackMessageFilter;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractSearchPanel extends Panel {
+
+ private static final long serialVersionUID = 5922413053568696414L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractSearchPanel.class);
+
+ @SpringBean
+ protected SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ protected ResourceRestClient resourceRestClient;
+
+ @SpringBean
+ protected AuthRestClient authRestClient;
+
+ protected IModel<List<String>> dnames;
+
+ protected IModel<List<String>> anames;
+
+ protected IModel<List<String>> resourceNames;
+
+ protected IModel<List<String>> entitlements;
+
+ protected IModel<List<SearchClause.Type>> types;
+
+ protected IModel<List<String>> roleNames;
+
+ protected NotificationPanel searchFeedback;
+
+ protected List<SearchClause> searchClauses;
+
+ protected WebMarkupContainer searchFormContainer;
+
+ protected AttributableType attributableType;
+
+ protected boolean required;
+
+ protected AbstractSearchPanel(final String id, final AttributableType attributableType) {
+ this(id, attributableType, null, true);
+ }
+
+ protected AbstractSearchPanel(final String id, final AttributableType attributableType,
+ final String fiql, final boolean required) {
+
+ super(id);
+ populate();
+
+ this.attributableType = attributableType;
+ this.required = required;
+
+ setOutputMarkupId(true);
+
+ searchFormContainer = new WebMarkupContainer("searchFormContainer");
+ searchFormContainer.setOutputMarkupId(true);
+
+ searchFeedback = new NotificationPanel("searchFeedback", "notificationpanel_top_right",
+ new IFeedbackMessageFilter() {
+
+ private static final long serialVersionUID = 6895024863321391672L;
+
+ @Override
+ public boolean accept(final FeedbackMessage message) {
+ boolean result;
+
+ // messages reported on the session have a null reporter
+ if (message.getReporter() == null) {
+ result = false;
+ } else {
+ // only accept messages coming from the children of the search form container
+ result = searchFormContainer.contains(message.getReporter(), true);
+ }
+
+ return result;
+ }
+ });
+ searchFeedback.setOutputMarkupId(true);
+ add(searchFeedback);
+
+ this.searchClauses = new ArrayList<SearchClause>();
+ this.searchClauses.add(new SearchClause());
+ if (StringUtils.isNotBlank(fiql)) {
+ try {
+ FiqlParser<SearchBean> fiqlParser = new FiqlParser<SearchBean>(
+ SearchBean.class, SyncopeFiqlSearchConditionBuilder.CONTEXTUAL_PROPERTIES);
+ List<SearchClause> parsed = getSearchClauses(fiqlParser.parse(fiql));
+
+ this.searchClauses.clear();
+ this.searchClauses.addAll(parsed);
+ } catch (Exception e) {
+ LOG.error("Unparseable FIQL expression '{}'", fiql, e);
+ }
+ }
+
+ searchFormContainer.add(new SearchView("searchView", searchClauses, searchFormContainer, required,
+ types, anames, dnames, roleNames, resourceNames, entitlements));
+ add(searchFormContainer);
+ }
+
+ protected void populate() {
+ dnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return SearchableFields.get(attributableType == AttributableType.USER
+ ? SubjectType.USER : SubjectType.ROLE);
+ }
+ };
+
+ anames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return schemaRestClient.getSchemaNames(attributableType);
+ }
+ };
+
+ resourceNames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ List<ResourceTO> resourceTOs = resourceRestClient.getAll();
+
+ List<String> result = new ArrayList<>(resourceTOs.size());
+
+ for (ResourceTO resource : resourceTOs) {
+ result.add(resource.getKey());
+ }
+
+ return result;
+ }
+ };
+
+ entitlements = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ List<String> result = authRestClient.getOwnedEntitlements();
+ Collections.sort(result);
+ return result;
+ }
+ };
+ }
+
+ public NotificationPanel getSearchFeedback() {
+ return searchFeedback;
+ }
+
+ private SearchClause getPrimitiveSearchClause(final SearchCondition<SearchBean> sc) {
+ SearchClause searchClause = new SearchClause();
+
+ String property = sc.getCondition().getKeySet().iterator().next();
+ searchClause.setProperty(property);
+ String value = sc.getCondition().get(property);
+ searchClause.setValue(value);
+
+ if (SpecialAttr.ROLES.toString().equals(property)) {
+ searchClause.setType(SearchClause.Type.MEMBERSHIP);
+ for (String label : roleNames.getObject()) {
+ if (value.equals(label.substring(0, label.indexOf(' ')))) {
+ searchClause.setProperty(label);
+ }
+ }
+ } else if (SpecialAttr.RESOURCES.toString().equals(property)) {
+ searchClause.setType(SearchClause.Type.RESOURCE);
+ } else if (SpecialAttr.ENTITLEMENTS.toString().equals(property)) {
+ searchClause.setType(SearchClause.Type.ENTITLEMENT);
+ } else {
+ searchClause.setType(SearchClause.Type.ATTRIBUTE);
+ }
+
+ switch (sc.getConditionType()) {
+ case EQUALS:
+ searchClause.setComparator(SpecialAttr.NULL.toString().equals(value)
+ ? SearchClause.Comparator.IS_NULL : SearchClause.Comparator.EQUALS);
+ break;
+
+ case NOT_EQUALS:
+ searchClause.setComparator(SpecialAttr.NULL.toString().equals(value)
+ ? SearchClause.Comparator.IS_NOT_NULL : SearchClause.Comparator.NOT_EQUALS);
+ break;
+
+ case GREATER_OR_EQUALS:
+ searchClause.setComparator(SearchClause.Comparator.GREATER_OR_EQUALS);
+ break;
+
+ case GREATER_THAN:
+ searchClause.setComparator(SearchClause.Comparator.GREATER_THAN);
+ break;
+
+ case LESS_OR_EQUALS:
+ searchClause.setComparator(SearchClause.Comparator.LESS_OR_EQUALS);
+ break;
+
+ case LESS_THAN:
+ searchClause.setComparator(SearchClause.Comparator.LESS_THAN);
+ break;
+
+ default:
+ break;
+ }
+
+ return searchClause;
+ }
+
+ private List<SearchClause> getCompoundSearchClause(final SearchCondition<SearchBean> sc) {
+ List<SearchClause> clauses = new ArrayList<SearchClause>();
+
+ for (SearchCondition<SearchBean> searchCondition : sc.getSearchConditions()) {
+ if (searchCondition.getStatement() == null) {
+ clauses.addAll(getCompoundSearchClause(searchCondition));
+ } else {
+ SearchClause clause = getPrimitiveSearchClause(searchCondition);
+ if (sc.getConditionType() == ConditionType.AND) {
+ clause.setOperator(SearchClause.Operator.AND);
+ }
+ if (sc.getConditionType() == ConditionType.OR) {
+ clause.setOperator(SearchClause.Operator.OR);
+ }
+ clauses.add(clause);
+ }
+ }
+
+ return clauses;
+ }
+
+ private List<SearchClause> getSearchClauses(final SearchCondition<SearchBean> sc) {
+ List<SearchClause> clauses = new ArrayList<SearchClause>();
+
+ if (sc.getStatement() == null) {
+ clauses.addAll(getCompoundSearchClause(sc));
+ } else {
+ clauses.add(getPrimitiveSearchClause(sc));
+ }
+
+ return clauses;
+ }
+
+ protected abstract SyncopeFiqlSearchConditionBuilder getSearchConditionBuilder();
+
+ public String buildFIQL() {
+ LOG.debug("Generating FIQL from List<SearchClause>: {}", searchClauses);
+
+ if (searchClauses.isEmpty() || searchClauses.get(0).getType() == null) {
+ return StringUtils.EMPTY;
+ }
+
+ SyncopeFiqlSearchConditionBuilder builder = getSearchConditionBuilder();
+
+ CompleteCondition prevCondition;
+ CompleteCondition condition = null;
+ for (int i = 0; i < searchClauses.size(); i++) {
+ prevCondition = condition;
+
+ switch (searchClauses.get(i).getType()) {
+ case ENTITLEMENT:
+ condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS
+ ? ((RoleFiqlSearchConditionBuilder) builder).
+ hasEntitlements(searchClauses.get(i).getProperty())
+ : ((RoleFiqlSearchConditionBuilder) builder).
+ hasNotEntitlements(searchClauses.get(i).getProperty());
+ break;
+
+ case MEMBERSHIP:
+ Long roleId = NumberUtils.toLong(searchClauses.get(i).getProperty().split(" ")[0]);
+ condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS
+ ? ((UserFiqlSearchConditionBuilder) builder).hasRoles(roleId)
+ : ((UserFiqlSearchConditionBuilder) builder).hasNotRoles(roleId);
+ break;
+
+ case RESOURCE:
+ condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS
+ ? builder.hasResources(searchClauses.get(i).getProperty())
+ : builder.hasNotResources(searchClauses.get(i).getProperty());
+ break;
+
+ case ATTRIBUTE:
+ SyncopeProperty property = builder.is(searchClauses.get(i).getProperty());
+ switch (searchClauses.get(i).getComparator()) {
+ case IS_NULL:
+ condition = builder.isNull(searchClauses.get(i).getProperty());
+ break;
+
+ case IS_NOT_NULL:
+ condition = builder.isNotNull(searchClauses.get(i).getProperty());
+ break;
+
+ case LESS_THAN:
+ condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
+ ? property.lessThan(NumberUtils.toDouble(searchClauses.get(i).getValue()))
+ : property.lexicalBefore(searchClauses.get(i).getValue());
+ break;
+
+ case LESS_OR_EQUALS:
+ condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
+ ? property.lessOrEqualTo(NumberUtils.toDouble(searchClauses.get(i).getValue()))
+ : property.lexicalNotAfter(searchClauses.get(i).getValue());
+ break;
+
+ case GREATER_THAN:
+ condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
+ ? property.greaterThan(NumberUtils.toDouble(searchClauses.get(i).getValue()))
+ : property.lexicalAfter(searchClauses.get(i).getValue());
+ break;
+
+ case GREATER_OR_EQUALS:
+ condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
+ ? property.greaterOrEqualTo(NumberUtils.toDouble(searchClauses.get(i).getValue()))
+ : property.lexicalNotBefore(searchClauses.get(i).getValue());
+ break;
+
+ case NOT_EQUALS:
+ condition = property.notEqualTo(searchClauses.get(i).getValue());
+ break;
+
+ case EQUALS:
+ default:
+ condition = property.equalTo(searchClauses.get(i).getValue());
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (i > 0) {
+ if (searchClauses.get(i).getOperator() == SearchClause.Operator.AND) {
+ condition = builder.and(prevCondition, condition);
+ }
+ if (searchClauses.get(i).getOperator() == SearchClause.Operator.OR) {
+ condition = builder.or(prevCondition, condition);
+ }
+ }
+ }
+
+ String fiql = condition == null ? StringUtils.EMPTY : condition.query();
+ LOG.debug("Generated FIQL: {}", fiql);
+ return fiql;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
new file mode 100644
index 0000000..386392c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
@@ -0,0 +1,353 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.client.console.commons.AttributableDataProvider;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.pages.AbstractBasePage;
+import org.apache.syncope.client.console.rest.AbstractSubjectRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.event.IEventSource;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractSearchResultPanel extends Panel implements IEventSource {
+
+ private static final long serialVersionUID = -9170191461250434024L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractSearchResultPanel.class);
+
+ /**
+ * Edit modal window height.
+ */
+ private final static int EDIT_MODAL_WIN_HEIGHT = 550;
+
+ /**
+ * Edit modal window width.
+ */
+ private final static int EDIT_MODAL_WIN_WIDTH = 800;
+
+ /**
+ * Schemas to be shown modal window height.
+ */
+ private final static int DISPLAYATTRS_MODAL_WIN_HEIGHT = 550;
+
+ /**
+ * Schemas to be shown modal window width.
+ */
+ private final static int DISPLAYATTRS_MODAL_WIN_WIDTH = 550;
+
+ /**
+ * Schemas to be shown modal window height.
+ */
+ private final static int STATUS_MODAL_WIN_HEIGHT = 500;
+
+ /**
+ * Schemas to be shown modal window width.
+ */
+ private final static int STATUS_MODAL_WIN_WIDTH = 700;
+
+ /**
+ * Application preferences.
+ */
+ @SpringBean
+ protected PreferenceManager prefMan;
+
+ /**
+ * Role reader for authorizations management.
+ */
+ @SpringBean
+ protected XMLRolesReader xmlRolesReader;
+
+ protected final AbstractSubjectRestClient restClient;
+
+ /**
+ * Number of rows per page.
+ */
+ private final int rows;
+
+ /**
+ * Container used to refresh table.
+ */
+ protected final WebMarkupContainer container;
+
+ /**
+ * Feedback panel specified by the caller.
+ */
+ protected final NotificationPanel feedbackPanel;
+
+ /**
+ * Specify if results are about a filtered search or not. Using this attribute it is possible to use this panel to
+ * show results about user list and user search.
+ */
+ private final boolean filtered;
+
+ /**
+ * Filter used in case of filtered search.
+ */
+ private String fiql;
+
+ /**
+ * Result table.
+ */
+ private AjaxDataTablePanel<AbstractAttributableTO, String> resultTable;
+
+ /**
+ * Data provider used to search for users.
+ */
+ private AttributableDataProvider dataProvider;
+
+ /**
+ * Modal window to be used for user profile editing. Global visibility is required ...
+ */
+ protected final ModalWindow editmodal = new ModalWindow("editModal");
+
+ /**
+ * Modal window to be used for attributes choosing to display in tables.
+ */
+ protected final ModalWindow displaymodal = new ModalWindow("displayModal");
+
+ /**
+ * Modal window to be used for user status management.
+ */
+ protected final ModalWindow statusmodal = new ModalWindow("statusModal");
+
+ /**
+ * Owner page.
+ */
+ protected final AbstractBasePage page;
+
+ protected <T extends AbstractAttributableTO> AbstractSearchResultPanel(final String id, final boolean filtered,
+ final String fiql, final PageReference pageRef, final AbstractSubjectRestClient restClient) {
+
+ super(id);
+
+ setOutputMarkupId(true);
+
+ this.page = (AbstractBasePage) pageRef.getPage();
+
+ this.filtered = filtered;
+ this.fiql = fiql;
+ this.feedbackPanel = page.getFeedbackPanel();
+
+ this.restClient = restClient;
+
+ editmodal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editmodal.setInitialHeight(EDIT_MODAL_WIN_HEIGHT);
+ editmodal.setInitialWidth(EDIT_MODAL_WIN_WIDTH);
+ editmodal.setCookieName("edit-modal");
+ add(editmodal);
+
+ displaymodal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ displaymodal.setInitialHeight(DISPLAYATTRS_MODAL_WIN_HEIGHT);
+ displaymodal.setInitialWidth(DISPLAYATTRS_MODAL_WIN_WIDTH);
+ displaymodal.setCookieName("display-modal");
+ add(displaymodal);
+
+ statusmodal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ statusmodal.setInitialHeight(STATUS_MODAL_WIN_HEIGHT);
+ statusmodal.setInitialWidth(STATUS_MODAL_WIN_WIDTH);
+ statusmodal.setCookieName("status-modal");
+ add(statusmodal);
+
+ // Container for user search result
+ container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ rows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_USERS_PAGINATOR_ROWS);
+ }
+
+ protected void initResultTable() {
+ // ---------------------------
+ // Result table initialization
+ // ---------------------------
+ updateResultTable(false);
+ // ---------------------------
+
+ // ---------------------------
+ // Rows-per-page selector
+ // ---------------------------
+ final Form paginatorForm = new Form("paginator");
+ container.add(paginatorForm);
+
+ final DropDownChoice<Integer> rowsChooser = new DropDownChoice<Integer>(
+ "rowsChooser", new PropertyModel<Integer>(this, "rows"), prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_USERS_PAGINATOR_ROWS, String.valueOf(rows));
+
+ final EventDataWrapper data = new EventDataWrapper();
+ data.setTarget(target);
+ data.setRows(rows);
+
+ send(getParent(), Broadcast.BREADTH, data);
+ }
+ });
+ paginatorForm.add(rowsChooser);
+ // ---------------------------
+
+ setWindowClosedReloadCallback(statusmodal);
+ setWindowClosedReloadCallback(editmodal);
+ setWindowClosedReloadCallback(displaymodal);
+ }
+
+ public void search(final String fiql, final AjaxRequestTarget target) {
+ this.fiql = fiql;
+ dataProvider.setFIQL(fiql);
+ target.add(container);
+ }
+
+ private void updateResultTable(final boolean create) {
+ updateResultTable(create, rows);
+ }
+
+ private void updateResultTable(final boolean create, final int rows) {
+ dataProvider = new AttributableDataProvider(restClient, rows, filtered);
+ dataProvider.setFIQL(fiql);
+
+ final int currentPage = resultTable != null
+ ? (create
+ ? (int) resultTable.getPageCount() - 1
+ : (int) resultTable.getCurrentPage())
+ : 0;
+
+ resultTable = new AjaxDataTablePanel<AbstractAttributableTO, String>(
+ "resultTable",
+ getColumns(),
+ dataProvider,
+ rows,
+ getBulkActions(),
+ restClient,
+ "id",
+ getPageId(),
+ page.getPageReference());
+
+ resultTable.setCurrentPage(currentPage);
+
+ resultTable.setOutputMarkupId(true);
+
+ container.addOrReplace(resultTable);
+ }
+
+ protected abstract List<IColumn<AbstractAttributableTO, String>> getColumns();
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof EventDataWrapper) {
+ final EventDataWrapper data = (EventDataWrapper) event.getPayload();
+
+ if (data.getRows() < 1) {
+ updateResultTable(data.isCreate());
+ } else {
+ updateResultTable(data.isCreate(), data.getRows());
+ }
+
+ data.getTarget().add(container);
+ }
+ }
+
+ private void setWindowClosedReloadCallback(final ModalWindow window) {
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ final EventDataWrapper data = new EventDataWrapper();
+ data.setTarget(target);
+ data.setRows(rows);
+
+ send(getParent(), Broadcast.BREADTH, data);
+
+ if (page.isModalResult()) {
+ // reset modal result
+ page.setModalResult(false);
+ // set operation succeeded
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ // refresh feedback panel
+ feedbackPanel.refresh(target);
+ }
+ }
+ });
+ }
+
+ public static class EventDataWrapper {
+
+ private AjaxRequestTarget target;
+
+ private boolean create;
+
+ private int rows;
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public void setTarget(final AjaxRequestTarget target) {
+ this.target = target;
+ }
+
+ public boolean isCreate() {
+ return create;
+ }
+
+ public void setCreate(boolean create) {
+ this.create = create;
+ }
+
+ public int getRows() {
+ return rows;
+ }
+
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+ }
+
+ protected abstract <T extends AbstractAttributableTO> Collection<ActionLink.ActionType> getBulkActions();
+
+ protected abstract String getPageId();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractTasks.java
new file mode 100644
index 0000000..381f878
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractTasks.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.rest.TaskRestClient;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public abstract class AbstractTasks extends Panel {
+
+ private static final long serialVersionUID = -1190836516156843561L;
+
+ protected static final String VIEW_TASK_WIN_COOKIE_NAME = "view-task-win";
+
+ protected static final int WIN_HEIGHT = 500;
+
+ protected static final int WIN_WIDTH = 700;
+
+ protected static final String TASKS = "Tasks";
+
+ protected PageReference pageRef;
+
+ @SpringBean
+ protected TaskRestClient restClient;
+
+ @SpringBean
+ protected PreferenceManager prefMan;
+
+ @SpringBean
+ protected XMLRolesReader xmlRolesReader;
+
+ public AbstractTasks(final String id, final PageReference pageRef) {
+ super(id);
+ this.pageRef = pageRef;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AccountInformationPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AccountInformationPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AccountInformationPanel.java
new file mode 100644
index 0000000..3bc7dd8
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AccountInformationPanel.java
@@ -0,0 +1,73 @@
+/*
+ * 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.SyncopeSession;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.Model;
+
+public class AccountInformationPanel extends AnnotatedBeanPanel {
+
+ private static final long serialVersionUID = 4228064224811390808L;
+
+ public <T extends AbstractAttributableTO> AccountInformationPanel(final String id, final UserTO userTO) {
+ super(id, userTO);
+
+ // ------------------------
+ // Change password date
+ // ------------------------
+ add(new Label("changePwdDate", new Model<String>(userTO.getChangePwdDate() == null
+ ? StringUtils.EMPTY
+ : SyncopeSession.get().getDateFormat().format(userTO.getChangePwdDate()))));
+ // ------------------------
+
+ // ------------------------
+ // Last login date
+ // ------------------------
+ add(new Label("lastLoginDate", new Model<String>(userTO.getLastLoginDate() == null
+ ? StringUtils.EMPTY
+ : SyncopeSession.get().getDateFormat().format(userTO.getLastLoginDate()))));
+ // ------------------------
+
+ // ------------------------
+ // Failed logins
+ // ------------------------
+ add(new Label("failedLogins", new Model<Integer>(userTO.getFailedLogins())));
+ // ------------------------
+
+ // ------------------------
+ // Token
+ // ------------------------
+ add(new Label("token", new Model<String>(userTO.getToken() == null
+ ? StringUtils.EMPTY
+ : userTO.getToken())));
+ // ------------------------
+
+ // ------------------------
+ // Token expire time
+ // ------------------------
+ add(new Label("tokenExpireTime", new Model<String>(userTO.getTokenExpireTime() == null
+ ? StringUtils.EMPTY
+ : SyncopeSession.get().getDateFormat().format(userTO.getTokenExpireTime()))));
+ // ------------------------
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ActionDataTablePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ActionDataTablePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ActionDataTablePanel.java
new file mode 100644
index 0000000..bfade98
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ActionDataTablePanel.java
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.client.console.commons.ActionTableCheckGroup;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.CheckGroupColumn;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+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.ResourceModel;
+
+public class ActionDataTablePanel<T, S> extends DataTablePanel<T, S> {
+
+ private static final long serialVersionUID = -8826989026203543957L;
+
+ private static final String CANCEL = "cancel";
+
+ private final Form<T> bulkActionForm;
+
+ private final ActionLinksPanel actionPanel;
+
+ private final PageReference pageRef;
+
+ public ActionDataTablePanel(
+ final String id,
+ final List<IColumn<T, S>> columns,
+ final ISortableDataProvider<T, S> dataProvider,
+ final int rowsPerPage,
+ final PageReference pageRef) {
+
+ super(id);
+
+ this.pageRef = pageRef;
+
+ bulkActionForm = new Form<T>("groupForm");
+ add(bulkActionForm);
+
+ group = new ActionTableCheckGroup<T>("checkgroup", model) {
+
+ private static final long serialVersionUID = -8667764190925075389L;
+
+ @Override
+ public boolean isCheckable(final T element) {
+ return isElementEnabled(element);
+ }
+ };
+ group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+
+ private static final long serialVersionUID = -151291731388673682L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // triggers AJAX form submit
+ }
+ });
+ bulkActionForm.add(group);
+
+ columns.add(0, new CheckGroupColumn<T, S>(group));
+ dataTable = new AjaxFallbackDefaultDataTable<T, S>("dataTable", columns, dataProvider, rowsPerPage);
+ group.add(dataTable);
+
+ final WebMarkupContainer actionPanelContainer = new WebMarkupContainer("actionPanelContainer");
+ bulkActionForm.add(actionPanelContainer);
+
+ actionPanel = new ActionLinksPanel("actions", new Model(), pageRef);
+ actionPanelContainer.add(actionPanel);
+
+ if (dataTable.getRowCount() == 0) {
+ actionPanelContainer.add(new AttributeModifier("style", "display: none"));
+ }
+
+ bulkActionForm.add(new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), pageRef) {
+
+ private static final long serialVersionUID = -2341391430136818025L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ // ignore
+ }
+ }.setVisible(false).setEnabled(false));
+ }
+
+ public void addAction(final ActionLink action, final ActionType type, final String pageId) {
+ actionPanel.add(action, type, pageId);
+ }
+
+ public void addAction(final ActionLink action, final ActionType type, final String pageId, final String actionId) {
+ actionPanel.add(action, type, pageId, actionId);
+ }
+
+ public void addAction(final ActionLink action, final ActionType type, final String pageId, final boolean enabled) {
+ actionPanel.add(action, type, pageId, enabled);
+ }
+
+ public void addCancelButton(final ModalWindow window) {
+
+ final AjaxButton cancel = new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), pageRef) {
+
+ private static final long serialVersionUID = -2341391430136818025L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ }.feedbackPanelAutomaticReload(false);
+
+ cancel.setDefaultFormProcessing(false);
+ bulkActionForm.addOrReplace(cancel);
+ }
+
+ public Collection<T> getModelObject() {
+ return group.getModelObject();
+ }
+
+ public boolean isElementEnabled(final T element) {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
new file mode 100644
index 0000000..563bd17
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.client.console.rest.BaseRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel.EventDataWrapper;
+import org.apache.syncope.client.console.pages.AbstractBasePage;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.CheckGroupColumn;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.client.console.pages.BulkActionModalPage;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Fragment;
+
+public class AjaxDataTablePanel<T, S> extends DataTablePanel<T, S> {
+
+ private static final long serialVersionUID = -7264400471578272966L;
+
+ public AjaxDataTablePanel(
+ final String id,
+ final List<IColumn<T, S>> columns,
+ final ISortableDataProvider<T, S> dataProvider,
+ final int rowsPerPage,
+ final Collection<ActionLink.ActionType> actions,
+ final BaseRestClient bulkActionExecutor,
+ final String itemIdField,
+ final String pageId,
+ final PageReference pageRef) {
+
+ super(id);
+
+ final ModalWindow bulkModalWin = new ModalWindow("bulkModal");
+ bulkModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ bulkModalWin.setInitialHeight(600);
+ bulkModalWin.setInitialWidth(900);
+ bulkModalWin.setCookieName("bulk-modal");
+ add(bulkModalWin);
+
+ bulkModalWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487149L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ final EventDataWrapper data = new EventDataWrapper();
+ data.setTarget(target);
+ data.setRows(rowsPerPage);
+
+ send(pageRef.getPage(), Broadcast.BREADTH, data);
+
+ final AbstractBasePage page = (AbstractBasePage) pageRef.getPage();
+
+ if (page.isModalResult()) {
+ // reset modal result
+ page.setModalResult(false);
+ // set operation succeeded
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ // refresh feedback panel
+ target.add(page.getFeedbackPanel());
+ }
+ }
+ });
+
+ Fragment fragment = new Fragment("tablePanel", "bulkAvailable", this);
+ add(fragment);
+
+ Form<T> bulkActionForm = new Form<>("groupForm");
+ fragment.add(bulkActionForm);
+
+ group = new CheckGroup<>("checkgroup", model);
+ group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+
+ private static final long serialVersionUID = -151291731388673682L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // triggers AJAX form submit
+ }
+ });
+ bulkActionForm.add(group);
+
+ columns.add(0, new CheckGroupColumn<T, S>(group));
+ dataTable = new AjaxFallbackDefaultDataTable<>("dataTable", columns, dataProvider, rowsPerPage);
+ group.add(dataTable);
+
+ fragment.add(new ClearIndicatingAjaxButton("bulkActionLink", bulkActionForm, pageRef) {
+
+ private static final long serialVersionUID = 382302811235019988L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ bulkModalWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690941L;
+
+ @Override
+ public Page createPage() {
+ return new BulkActionModalPage<>(
+ bulkModalWin,
+ group.getModelObject(),
+ columns,
+ actions,
+ bulkActionExecutor,
+ itemIdField,
+ pageId);
+ }
+ });
+
+ bulkModalWin.show(target);
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.java
new file mode 100644
index 0000000..714cb5f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AnnotatedBeanPanel.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.syncope.common.lib.to.AbstractAnnotatedBean;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+
+public class AnnotatedBeanPanel extends Panel {
+
+ private static final long serialVersionUID = 4228064224811390809L;
+
+ public <T extends AbstractAttributableTO> AnnotatedBeanPanel(
+ final String id, final AbstractAnnotatedBean sysInfoTO) {
+
+ super(id);
+
+ // ------------------------
+ // Creation date
+ // ------------------------
+ add(new Label("creationDate", new Model<String>(sysInfoTO.getCreationDate() != null
+ ? SyncopeSession.get().getDateFormat().format(sysInfoTO.getCreationDate()) : "")));
+ // ------------------------
+
+ // ------------------------
+ // Last change date
+ // ------------------------
+ add(new Label("lastChangeDate", new Model<String>(sysInfoTO.getLastChangeDate() != null
+ ? SyncopeSession.get().getDateFormat().format(sysInfoTO.getCreationDate()) : "")));
+ // ------------------------
+
+ // ------------------------
+ // Creator
+ // ------------------------
+ add(new Label("creator", new Model<String>(sysInfoTO.getCreator() != null
+ ? sysInfoTO.getCreator() : "")));
+ // ------------------------
+
+ // ------------------------
+ // Last modifier
+ // ------------------------
+ add(new Label("lastModifier", new Model<String>(sysInfoTO.getLastModifier() != null
+ ? sysInfoTO.getLastModifier() : "")));
+ // ------------------------
+
+ }
+}
[17/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.html
new file mode 100644
index 0000000..61b609e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.html
@@ -0,0 +1,66 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="formtable" wicket:id="security">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="inheritPasswordPolicy"><wicket:message key="inheritPasswordPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritPasswordPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="passwordPolicy"><wicket:message key="passwordPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="passwordPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="inheritAccountPolicy"><wicket:message key="inheritAccountPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritAccountPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="accountPolicy"><wicket:message key="accountPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="accountPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.properties
new file mode 100644
index 0000000..167673d
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel.properties
@@ -0,0 +1,20 @@
+# 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.
+inheritPasswordPolicy = Inherit password policy
+inheritAccountPolicy = Inherit account policy
+passwordPolicy = Password Policy
+accountPolicy = Account Policy
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_it.properties
new file mode 100644
index 0000000..6e7c6ed
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_it.properties
@@ -0,0 +1,20 @@
+# 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.
+inheritPasswordPolicy = Eredita password policy
+inheritAccountPolicy = Eredita account policy
+passwordPolicy = Password Policy
+accountPolicy = Account Policy
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_pt_BR.properties
new file mode 100644
index 0000000..5c77adc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSecurityPanel_pt_BR.properties
@@ -0,0 +1,20 @@
+# 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.
+inheritPasswordPolicy = Pol\u00EDtica de Senha Herdada
+inheritAccountPolicy = Pol\u00EDtica de Conta Herdada
+passwordPolicy = Pol\u00EDtica de Senha
+accountPolicy = Pol\u00EDtica de Conta
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSummaryPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSummaryPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSummaryPanel.html
new file mode 100644
index 0000000..3d5e7b9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleSummaryPanel.html
@@ -0,0 +1,39 @@
+<!--
+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>
+
+ <span wicket:id="roleSummaryPanel">[Role panel]</span>
+
+ <wicket:fragment wicket:id="roleViewPanel">
+ <span wicket:id="nodeViewPanel"></span>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="rootPanel">
+ <div style="float:left; width:70%;">
+ <p style="height:15px; margin-top: 0px;" class="ui-widget ui-corner-all ui-widget-header">
+ <span style="float:right;" wicket:id="actionLinks"/>
+ </p>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fakerootFrag">
+ </wicket:fragment>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
new file mode 100644
index 0000000..113fc12
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.html
@@ -0,0 +1,64 @@
+<!--
+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 style="float:left; width:70%;">
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("div form #tabs").tabs();
+ });
+ $(document).ready(function() {
+ $("div form #tabs #templates").tabs();
+ });
+ </script>
+ <p style="height:15px; margin-top: 0px;" class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/>
+ <span wicket:id="displayName"/>
+ <span style="float:right;" wicket:id="actionLinks"/>
+ </p>
+
+ <form wicket:id="roleForm">
+ <div id="tabs" style="margin: 0px;">
+ <ul>
+ <li><a href="#details"><span><wicket:message key="details"/></span></a></li>
+ <li><a href="#templates"><span><wicket:message key="templates"/></span></a></li>
+ <li><a href="#attrs"><span><wicket:message key="attrs"/></span></a></li>
+ <li><a href="#derAttrs"><span><wicket:message key="derAttrs"/></span></a></li>
+ <li><a href="#virAttrs"><span><wicket:message key="virAttrs"/></span></a></li>
+ <li><a href="#resources"><span><wicket:message key="resources"/></span></a></li>
+ <li><a href="#entitlements"><span><wicket:message key="entitlements"/></span></a></li>
+ <li><a href="#security"><span><wicket:message key="security"/></span></a></li>
+ <li><a href="#users"><span><wicket:message key="users"/></span></a></li>
+ </ul>
+ <div wicket:id="rolePanel">
+ </div>
+ <div id="users">
+ <div wicket:id="userListContainer">
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="search"/>
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="userList"> [userList] </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
new file mode 100644
index 0000000..605c289
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel.properties
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Role
+details=Details
+attrs=Attributes
+derAttrs=Derived attributes
+virAttrs=Virtual attributes
+resources=Resources
+entitlements=Entitlements
+security=Security
+users=Users
+search=Get Users
+templates=Templates
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
new file mode 100644
index 0000000..26ef8a5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_it.properties
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Ruolo
+details=Dettagli
+attrs=Attributi
+derAttrs=Attributi derivati
+virAttrs=Attributi virtuali
+resources=Risorse
+entitlements=Entitlement
+security=Sicurezza
+users=Utenti
+search=Lista Utenti
+templates=Modelli
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
new file mode 100644
index 0000000..2ecc202
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleTabPanel_pt_BR.properties
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Fun\u00e7\u00e3o
+details=Detalhes
+attrs=Atributos
+derAttrs=Atributos Derivados
+virAttrs=Atributos Virtuais
+resources=Recursos
+entitlements=Direitos
+security=Seguran\u00e7a
+users=Usu\u00e1rios
+search=Obter Usu\u00e1rios
+templates=Modelo
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.html
new file mode 100644
index 0000000..7ac78ad
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.html
@@ -0,0 +1,42 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="container">
+ <span wicket:id="datatable">[datatable]</span>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="PaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+ <div wicket:id="taskWin">
+ [Show modal window for viewing task]
+ </div>
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createLink">
+ <wicket:message key="create"/>
+ </a>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.properties
new file mode 100644
index 0000000..98b50fe
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks.properties
@@ -0,0 +1,28 @@
+# 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.
+id=Id
+name=Name
+description=Description
+class=Class
+lastExec=Last Execution
+nextExec=Next Execution
+detail=Detail
+delete=Delete
+edit=Edit
+execute=Execute
+executeDryRun=Dry run
+latestExecStatus=Last status
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_it.properties
new file mode 100644
index 0000000..f023310
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_it.properties
@@ -0,0 +1,28 @@
+# 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.
+id=Id
+name=Nome
+description=Descrizione
+class=Classs
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+detail=Dettagli
+delete=Rimuovi
+edit=Modifica
+execute=Esegui
+executeDryRun=Esecuzione simulata
+latestExecStatus=Ultimo stato
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_pt_BR.properties
new file mode 100644
index 0000000..0bca81c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchedTasks_pt_BR.properties
@@ -0,0 +1,28 @@
+# 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.
+id=Identificador
+name=Nome
+description=Descri\u00e7\u00e3o
+class=Classe
+lastExec=\u00daltima Execu\u00e7\u00e3o
+nextExec=Pr\u00f3xima Execu\u00e7\u00e3o
+detail=Detalhe
+delete=Remover
+edit=Editar
+execute=Executar
+executeDryRun=Executar (Ensaio)
+latestExecStatus=\u00daltimo Estatus
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.html
new file mode 100644
index 0000000..d9668a0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.html
@@ -0,0 +1,41 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="securityQuestion"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="securityQuestion"/>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="securityAnswer"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="securityAnswer"/>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.properties
new file mode 100644
index 0000000..672fc21
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel.properties
@@ -0,0 +1,18 @@
+# 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.
+securityQuestion=Security question
+securityAnswer=Security answer
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_it.properties
new file mode 100644
index 0000000..014f3aa
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_it.properties
@@ -0,0 +1,18 @@
+# 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.
+securityQuestion=Domanda di sicurezza
+securityAnswer=Risposta di sicurezza
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_pt_BR.properties
new file mode 100644
index 0000000..0afcb73
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionPanel_pt_BR.properties
@@ -0,0 +1,18 @@
+# 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.
+securityQuestion=Pergunta de seguran\u00e7a
+securityAnswer=Resposta de seguran\u00e7a
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SelectedEventsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SelectedEventsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SelectedEventsPanel.html
new file mode 100644
index 0000000..3ef0354
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SelectedEventsPanel.html
@@ -0,0 +1,33 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ div#selectionContainer select{
+ width: 585px;
+ min-width: 585px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <div id="selectionContainer" wicket:id="selectionContainer">
+ <select wicket:id="selectedEvents" ></select>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.html
new file mode 100644
index 0000000..e558a61
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.html
@@ -0,0 +1,130 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ div.group{
+ width:100%;
+ }
+
+ div#check{
+ height: 25px;
+ float:left;
+ }
+
+ div#resource{
+ margin-top: 3px;
+ margin-left: 5px;
+ width: 35%;
+ height: 25px;
+ float:left;
+ }
+
+ div#accountLink{
+ margin-top: 3px;
+ width:45%;
+ height: 25px;
+ float:left
+ }
+
+ div#status{
+ margin-top: 3px;
+ height: 25px;
+ width: 5%;
+ float: left;
+ text-align: center;
+ }
+
+ div#connObject{
+ margin-top: 3px;
+ height: 25px;
+ width: 5%;
+ float: left;
+ text-align: center;
+ }
+
+ div.assignment {
+ display: inline-table;
+ width: 100%
+ }
+
+ div.assignments {
+ margin-top: 5px;
+ display: inline-table;
+ width: 100%;
+ border: 1px solid #DDDDDD;
+ color: #555555;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <div class="assignments">
+ <div class="group">
+ <div>
+ <div id="check">
+ <input type="checkbox" wicket:id="groupselector" />
+ </div>
+
+ <div id="resource">
+ <span style="font: Verdana,Arial,sans-serif; font-weight: bold">
+ <wicket:message key="resourceheader"/>
+ </span>
+ </div>
+ <div id="accountLink">
+ <span style="font: Verdana,Arial,sans-serif; font-weight: bold">
+ <wicket:message key="accountlinkheader"/>
+ </span>
+ </div>
+ <div id="status">
+ <span style="font: Verdana,Arial,sans-serif; font-weight: bold">
+ <wicket:message key="statusheader"/>
+ </span>
+ </div>
+ <div id="connObject">
+ </div>
+ </div>
+
+ <span wicket:id="group">
+
+ <div wicket:id="resources" class="assignment">
+ <div id="check">
+ <input type="checkbox" wicket:id="check"/>
+ </div>
+
+ <div id="resource">
+ <span wicket:id="resource">[resource name]</span>
+ </div>
+ <div id="accountLink">
+ <span wicket:id="accountLink">[accountLink]</span>
+ </div>
+ <div id="status">
+ <img wicket:id="icon"/>
+ </div>
+ <div id="connObject">
+ <span wicket:id="connObject">[connObject]</span>
+ </div>
+ </div>
+ </span>
+ </div>
+
+ </div>
+
+ <div wicket:id="connObjectWin">[Show modal window for showing connector object]</div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.properties
new file mode 100644
index 0000000..e50c7d7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+resourceheader = Resource
+accountlinkheader = AccountLink
+statusheader = Status
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_it.properties
new file mode 100644
index 0000000..6e3e2c4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+resourceheader = Risorsa
+accountlinkheader = AccountLink
+statusheader = Stato
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_pt_BR.properties
new file mode 100644
index 0000000..55ab218
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/StatusPanel_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+resourceheader = Recurso
+accountlinkheader = Link da Conta
+statusheader = Estatus
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel.properties
new file mode 100644
index 0000000..497da5a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel.properties
@@ -0,0 +1,29 @@
+# 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.
+id=Id
+name=Name
+description=Description
+resourceName=Resource Name
+lastExec=Last Execution
+nextExec=Next Execution
+detail=Detail
+delete=Delete
+edit=Edit
+execute=Execute
+executeDryRun=Dry run
+userTemplate=User template
+latestExecStatus=Last status
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_it.properties
new file mode 100644
index 0000000..abb82a4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_it.properties
@@ -0,0 +1,29 @@
+# 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.
+id=Id
+name=Nome
+description=Descrizione
+resourceName=Nome Risorsa
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+detail=Dettagli
+delete=Rimuovi
+edit=Modifica
+execute=Esegui
+executeDryRun=Esecuzione simulata
+userTemplate=Modello utente
+latestExecStatus=Ultimo stato
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_pt_BR.properties
new file mode 100644
index 0000000..054af39
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/SyncTasksPanel_pt_BR.properties
@@ -0,0 +1,29 @@
+# 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.
+id=Identificador
+name=Nome
+description=Descri\u00e7\u00e3o
+resourceName=Nome do Recurso
+lastExec=\u00daltima Execu\u00e7\u00e3o
+nextExec=Pr\u00f3xima Execu\u00e7\u00e3o
+detail=Detalhe
+delete=Remove
+edit=Alterar
+execute=Executar
+executeDryRun=Executar (Ensaio)
+userTemplate=Usar Template
+latestExecStatus=\u00daltimo Estatus
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.html
new file mode 100644
index 0000000..3f54a1a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.html
@@ -0,0 +1,71 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="username"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="username"/>
+ <a class="tooltips" wicket:id="usernameQuestionMarkJexlHelp" href="#" alt="Click to help" title="Click to help"><img src="img/help.png"/>
+ <span wicket:id="usernameJexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="password"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="password"/>
+ <span wicket:id="mandatory_pwd"></span>
+ <a class="tooltips" wicket:id="pwdQuestionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
+ <img src="img/help.png"/>
+ <span wicket:id="pwdJexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="confirmPasswordLabel"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="confirmPassword"/>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.properties
new file mode 100644
index 0000000..f07fe03
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+username=Username
+password=Password
+confirmPassword=Password (confirm)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_it.properties
new file mode 100644
index 0000000..741d7dd
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+username=Username
+password=Password
+confirmPassword=Password (conferma)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_pt_BR.properties
new file mode 100644
index 0000000..9debd26
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/UserDetailsPanel_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+username=Nome do Usu\u00E1rio
+password=Senha
+confirmPassword=Senha (confirmar)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.html
new file mode 100644
index 0000000..5b3454e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.html
@@ -0,0 +1,60 @@
+<!--
+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>
+ <table class="ui-widget ui-widget-content ui-corner-all"
+ style="font-size: 1em;margin-top:2px;"
+ width="100%" cellpadding="2px" cellspacing="1px">
+ <thead>
+ <tr class="ui-widget-header">
+ <th><wicket:message key="virAttrToRemove"/></th>
+ <th><wicket:message key="virAttrName"/></th>
+ <th><wicket:message key="virAttrValue"/></th>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <td>
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="addAttributeBtn" />
+ </td>
+ </tr>
+ </tfoot>
+
+ <tbody wicket:id="virAttrContainer">
+ <tr wicket:id="attrs">
+ <td align="center" valign="top">
+ <input type="checkbox" class="text ui-widget-content ui-corner-all" wicket:id="toRemove"/>
+ </td>
+
+ <td align="center" valign="top">
+ <select class="text ui-widget-content ui-corner-all"
+ style="width:100%" wicket:id="schema"/>
+ </td>
+
+ <td align="center " valign="top">
+ <span wicket:id="values" style="text-align:left;display:block;width:95%">[values]</span>
+ </td>
+
+ </tr>
+ </tbody>
+ </table>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.properties
new file mode 100644
index 0000000..4f686f7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+addAttributeBtn=Add
+add=+
+drop=-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_it.properties
new file mode 100644
index 0000000..f639bf5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_it.properties
@@ -0,0 +1,20 @@
+# 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.
+addAttributeBtn=Aggiungi
+add=+
+drop=-
+
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_pt_BR.properties
new file mode 100644
index 0000000..bde1908
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/VirAttrsPanel_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+addAttributeBtn=Adicionar
+add=+
+drop=-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
new file mode 100644
index 0000000..fde1840
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
@@ -0,0 +1,21 @@
+<!--
+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.
+-->
+<wicket:panel>
+ <input wicket:id="groupselector" type="checkbox"/>
+</wicket:panel>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html
new file mode 100644
index 0000000..23156a2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.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>
+ <input wicket:id="check" type="checkbox"/>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.html
new file mode 100644
index 0000000..56220a9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.html
@@ -0,0 +1,25 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="collection" wicket:id="collection">
+ <span id="item" wicket:id="item"/>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.properties
new file mode 100644
index 0000000..d41c779
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.properties
@@ -0,0 +1,22 @@
+# 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.
+selOpt1=Unschedule
+selOpt2=Every 5 minutes
+selOpt3=Fire at 12pm (noon) every day
+selOpt4=Fire at 12am (midnight) every first day of the month
+selOpt5=Fire at 12am (midnight) every last day of the month
+selOpt6=Fire at 12am (midnight) every Monday
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_it.properties
new file mode 100644
index 0000000..5514ce9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_it.properties
@@ -0,0 +1,22 @@
+# 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.
+selOpt1=Non schedulato
+selOpt2=Ogni 5 minuti
+selOpt3=Lanciato ogni giorno a mezzanotte
+selOpt4=Lanciato ogni primo giorno del mese a mezzogiorno
+selOpt5=Lanciato ogni ultimo giorno del mese a mezzogiorno
+selOpt6=Lanciato ogni Luned\u00ec a mezzogiorno
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_pt_BR.properties
new file mode 100644
index 0000000..f621f92
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+selOpt1=N\u00E3o Agendado
+selOpt2=A cada 5 minutos
+selOpt3=Acionar \u00E0s 12\:00 todos os dias
+selOpt4=Acionar \u00E0s 24\:00 sempre no primeiro dia de cada m\u00EAs
+selOpt5=Acionar \u00E0s 24\:00 sempre no \u00FAltimo dia de cada m\u00EAs
+selOpt6=Acionar \u00E0s 24\:00 de toda Segunda Feira
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
new file mode 100644
index 0000000..7630854
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
@@ -0,0 +1,163 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ span#actionLink{
+ margin-left: 1px;
+ margin-right: 1px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <span wicket:id="panelClaim">[plus]</span>
+ <span wicket:id="panelManageResources">[plus]</span>
+ <span wicket:id="panelManageUsers">[plus]</span>
+ <span wicket:id="panelManageRoles">[plus]</span>
+ <span wicket:id="panelDryRun">[plus]</span>
+ <span wicket:id="panelExecute">[plus]</span>
+ <span wicket:id="panelEnable">[plus]</span>
+ <span wicket:id="panelSearch">[plus]</span>
+ <span wicket:id="panelCreate">[plus]</span>
+ <span wicket:id="panelUserTemplate">[plus]</span>
+ <span wicket:id="panelRoleTemplate">[plus]</span>
+ <span wicket:id="panelReset">[plus]</span>
+ <span wicket:id="panelEdit">[plus]</span>
+ <span wicket:id="panelExport">[plus]</span>
+ <span wicket:id="panelDelete">[plus]</span>
+ <span wicket:id="panelSelect">[plus]</span>
+ <span wicket:id="panelSuspend">[plus]</span>
+ <span wicket:id="panelReactivate">[plus]</span>
+ <span wicket:id="panelReload">[plus]</span>
+ <span wicket:id="panelChangeView">[plus]</span>
+ <span wicket:id="panelUnlink">[plus]</span>
+ <span wicket:id="panelLink">[plus]</span>
+ <span wicket:id="panelUnassign">[plus]</span>
+ <span wicket:id="panelAssign">[plus]</span>
+ <span wicket:id="panelDeprovision">[plus]</span>
+ <span wicket:id="panelProvision">[plus]</span>
+
+ <wicket:fragment wicket:id="fragmentClaim">
+ <a href="#" wicket:id="claimLink"><img id="actionLink" src="img/actions/claim.png" alt="claim icon" title="Claim"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentManageResources">
+ <a href="#" wicket:id="manageResourcesLink"><img id="actionLink" src="img/actions/resources-icon.png" alt="manage resources icon" title="Manage resources"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentManageUsers">
+ <a href="#" wicket:id="manageUsersLink"><img id="actionLink" src="img/actions/users-icon.png" alt="manage users icon" title="Manage users"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentManageRoles">
+ <a href="#" wicket:id="manageRolesLink"><img id="actionLink" src="img/actions/roles-icon.png" alt="manage roles icon" title="Manage roles"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentCreate">
+ <a href="#" wicket:id="createLink"><img id="actionLink" src="img/actions/create.png" alt="create icon" title="Create"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentSearch">
+ <a href="#" wicket:id="searchLink"><img id="actionLink" src="img/actions/search.png" alt="search icon" title="Search and modify"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentEnable">
+ <a href="#" wicket:id="enableLink"><img id="actionLink" src="img/actions/enable.png" alt="enable icon" title="Enable / Disable"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentEdit">
+ <a href="#" wicket:id="editLink"><img id="actionLink" src="img/actions/edit.png" alt="edit icon" title="Edit"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentReset">
+ <a href="#" wicket:id="resetLink"><img id="actionLink" src="img/actions/reset.png" alt="reset icon" title="Reset sync token"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentUserTemplate">
+ <a href="#" wicket:id="userTemplateLink"><img id="actionLink" src="img/actions/user_template.png" alt="user template icon" title="Specify user template"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentRoleTemplate">
+ <a href="#" wicket:id="roleTemplateLink"><img id="actionLink" src="img/actions/roles-icon.png" alt="role template icon" title="Specify role template"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentDelete">
+ <a href="#" wicket:id="deleteLink"><img id="actionLink" src="img/actions/delete.png" alt="delete icon" title="Delete"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentDryRun">
+ <a href="#" wicket:id="dryRunLink"><img id="actionLink" src="img/actions/dryrun.png" alt="dryrun icon" title="DryRun"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentExecute">
+ <a href="#" wicket:id="executeLink"><img id="actionLink" src="img/actions/execute.png" alt="execute icon" title="Execute"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentSelect">
+ <a href="#" wicket:id="selectLink"><img id="actionLink" src="img/actions/select.png" alt="select icon" title="Select"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentExport">
+ <a href="#" wicket:id="exportLink"><img id="actionLink" src="img/actions/export.png" alt="export icon" title="Export"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentSuspend">
+ <a href="#" wicket:id="suspendLink"><img id="actionLink" src="img/actions/suspend.png" alt="suspend icon" title="Suspend"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentReactivate">
+ <a href="#" wicket:id="reactivateLink"><img id="actionLink" src="img/actions/reactivate.png" alt="reactivate icon" title="Reactivate"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentReload">
+ <a href="#" wicket:id="reloadLink"><img id="actionLink" src="img/actions/reload.png" alt="reload icon" title="Reload"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentChangeView">
+ <a href="#" wicket:id="changeViewLink"><img id="actionLink" src="img/actions/settings-icon.png" alt="Change view icon" title="Change view"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentUnlink">
+ <a href="#" wicket:id="unlinkLink"><img id="actionLink" src="img/actions/unlink-icon.png" alt="Unlink icon" title="Unlink"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentLink">
+ <a href="#" wicket:id="linkLink"><img id="actionLink" src="img/actions/link-icon.png" alt="Link icon" title="Link"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentUnassign">
+ <a href="#" wicket:id="unassignLink"><img id="actionLink" src="img/actions/unassign-icon.png" alt="Unassign icon" title="Unassign"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentAssign">
+ <a href="#" wicket:id="assignLink"><img id="actionLink" src="img/actions/assign-icon.png" alt="Assign icon" title="Assign"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentDeprovision">
+ <a href="#" wicket:id="deprovisionLink"><img id="actionLink" src="img/actions/deprovision-icon.png" alt="De-provision icon" title="De-provision"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentProvision">
+ <a href="#" wicket:id="provisionLink"><img id="actionLink" src="img/actions/provision-icon.png" alt="Provision icon" title="Provision"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.html
new file mode 100644
index 0000000..fc7596f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.html
@@ -0,0 +1,21 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <input type="checkbox" class="checkbox" wicket:id="checkboxField"/>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.html
new file mode 100644
index 0000000..12d5bf2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxDropDownChoicePanel.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">
+ <wicket:extend>
+ <select class="ui-widget-content ui-corner-all medium_dynamicsize"
+ wicket:id="dropDownChoiceField" />
+ </wicket:extend>
+</html>
[18/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LoggerCategoryPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LoggerCategoryPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LoggerCategoryPanel.html
new file mode 100644
index 0000000..c98dcb5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/LoggerCategoryPanel.html
@@ -0,0 +1,106 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+
+ .events{
+ display: table-row;
+ width: 990px;
+ }
+
+ .selectedEvents{
+ display: inline-block;
+ height: 100px;
+ margin: 10px 10px 0 10px;
+ overflow-y: auto;
+ }
+
+ .eventSelection{
+ display: inline-table;
+ float: right;
+ width: 380px;
+ min-width: 380px;
+ }
+
+ .eventSelection div#eventElement{
+ display: table-row;
+ width:100%;
+ }
+ .eventSelection div#eventElement div#label{
+ display: table-cell;
+ }
+
+ .eventSelection div#eventElement div#value{
+ display: table-cell;
+ padding: 0 0 0 10px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+
+ <div class="events">
+ <div class="selectedEvents">
+ <span wicket:id="selectedEventsPanel">[selected events panel]</span>
+ </div>
+
+ <div class="eventSelection">
+ <div wicket:id="categoryContainer" style="display: block; margin: 10px 0px 20px 0px">
+ <div id="eventElement">
+ <div id="label">
+ <label wicket:id="typeLabel"/>
+ </div>
+ <div id="value">
+ <span wicket:id="type">[type]</span>
+ </div>
+ </div>
+ <div id="eventElement">
+ <div id="label">
+ <label wicket:id="categoryLabel"/>
+ </div>
+ <div id="value">
+ <span wicket:id="category">[category]</span>
+ </div>
+ </div>
+ <div id="eventElement">
+ <div id="label">
+ <label wicket:id="subcategoryLabel"/>
+ </div>
+ <div id="value">
+ <span wicket:id="subcategory">[sub-category]</span>
+ </div>
+ </div>
+ <div id="eventElement">
+ <div id="label">
+ <label wicket:id="customLabel"/>
+ </div>
+ <div id="value">
+ <span wicket:id="custom">[custom]</span>
+ <span wicket:id="customActions">[actions]</span>
+ </div>
+ </div>
+ </div>
+ <div wicket:id="eventsContainer" style="display: block">
+ <span wicket:id="eventsPanel">[events panel]</span>
+ </div>
+ </div>
+ </div>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.html
new file mode 100644
index 0000000..684225b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.html
@@ -0,0 +1,66 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="membership_availability"/>
+ </p>
+
+ <div wicket:id="treeTable" style="float: left; width: 100%; margin:auto;" class="role-tree roleTable"/>
+
+ <div style="float: left; width: 100%;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="membership_text"/></p>
+
+ <table id="users" class="membershipTable"
+ style="font-size:1.1em" wicket:id="membershipsContainer"
+ cellpadding="5px" cellspacing="2px">
+ <thead>
+ <tr class="ui-widget-header">
+ <th><wicket:message key="id"/></th>
+ <th><wicket:message key="name"/></th>
+ <th><wicket:message key="edit"/></th>
+ <th><wicket:message key="delete"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="memberships">
+ <td>
+ <span wicket:id="roleId"/>
+ </td>
+ <td>
+ <span wicket:id="roleName"/>
+ </td>
+ <td>
+ <a href="#" wicket:id="editLink">
+ <wicket:message key="edit"/>
+ </a>
+ </td>
+ <td>
+ <a href="#" wicket:id="deleteLink">
+ <wicket:message key="delete"/>
+ </a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+ <div wicket:id="membershipWin"/>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.properties
new file mode 100644
index 0000000..11b0de6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel.properties
@@ -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.
+id=Role Id
+name=Role Name
+edit=Edit
+delete=Delete
+
+membership_availability=Available roles
+membership_text=Selected roles
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_it.properties
new file mode 100644
index 0000000..e5751ae
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_it.properties
@@ -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.
+id=Id Ruolo
+edit=Modifica
+delete=Rimuovi
+name=Nome Ruolo
+
+membership_availability=Ruoli disponibili
+membership_text=Ruoli selezionati
+
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_pt_BR.properties
new file mode 100644
index 0000000..b9ed029
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/MembershipsPanel_pt_BR.properties
@@ -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.
+id=Identificador da Fun\u00E7\u00E3o
+name=Nome da Fun\u00E7\u00E3o
+edit=Alterar
+delete=Excluir
+
+membership_availability=Fun\u00E7\u00F5es dispon\u00EDveis
+membership_text=Fun\u00E7\u00F5es selecionadas
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.html
new file mode 100644
index 0000000..68cec92
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.html
@@ -0,0 +1,38 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="container">
+ <span wicket:id="datatable">[datatable]</span>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="PaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+ <div wicket:id="taskWin">
+ [Show modal window for viewing task]
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.properties
new file mode 100644
index 0000000..d6bbd36
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks.properties
@@ -0,0 +1,26 @@
+# 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.
+id=Id
+execute=Execute
+detail=Detail
+delete=Delete
+edit=Edit
+sender=Sender
+recipients=Recipients
+traceLevel=Trace level
+subject=Subject
+latestExecStatus=Last status
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_it.properties
new file mode 100644
index 0000000..da12f15
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_it.properties
@@ -0,0 +1,26 @@
+# 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.
+id=Id
+execute=Esegui
+detail=Dettagli
+delete=Rimuovi
+edit=Modifica
+sender=Mittente
+recipients=Destinatari
+traceLevel=Livello di tracciamento
+subject=Oggetto
+latestExecStatus=Ultimo stato
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_pt_BR.properties
new file mode 100644
index 0000000..abed229
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/NotificationTasks_pt_BR.properties
@@ -0,0 +1,26 @@
+# 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.
+id=Identificador
+execute=Executar
+detail=Detalhe
+delete=Excluir
+edit=Alterar
+sender=Enviar
+recipients=Destinat\u00E1rios
+traceLevel=N\u00EDvel do Trace
+subject=Assunto
+latestExecStatus=\u00DAltimo Estatus
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PlainAttrsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PlainAttrsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PlainAttrsPanel.html
new file mode 100644
index 0000000..61f699d
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PlainAttrsPanel.html
@@ -0,0 +1,44 @@
+<!--
+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 class="tablerow" wicket:id="schemas">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="name"/>
+ </div>
+
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="panel">
+ [panel for dynamic input type markup]
+ </span>
+ <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
+ <img src="img/help.png"/>
+ <span wicket:id="jexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.html
new file mode 100644
index 0000000..8bae2f9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.html
@@ -0,0 +1,42 @@
+<!--
+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>
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="container">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="datatable"/>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="PaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="editModalWin">[Show modal window for creating/editing password policy]</div>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="createLink">
+ <wicket:message key="create"/>
+ </a>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.properties
new file mode 100644
index 0000000..afab11d
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel.properties
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+id=Id
+description=Description
+type=Type
+title=Account Policies
+delete=Delete
+edit=Edit
+displayRows=Rows per page
+
+#-----------------------------
+# Policy Type
+#-----------------------------
+ACCOUNT=Account Policy
+GLOBAL_ACCOUNT=Global Account Policy
+PASSWORD=Password Policy
+GLOBAL_PASSWORD=Password Global Policy
+SYNC=Synchronization Policy
+GLOBAL_SYNC=Global Synchronization Policy
+#-----------------------------
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_it.properties
new file mode 100644
index 0000000..fcbd7c2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_it.properties
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+id=Id
+description=Descrizione
+type=Tipo
+title=Account Policy
+delete=Rimuovi
+edit=Modifica
+displayRows=Righe per pagina
+
+#-----------------------------
+# Policy Type
+#-----------------------------
+ACCOUNT=Account Policy
+GLOBAL_ACCOUNT=Account Policy globale
+PASSWORD=Password policy
+GLOBAL_PASSWORD=Password policy globale
+SYNC=Policy di sincronizzazione
+GLOBAL_SYNC=Policy di sincronizzazione globale
+#-----------------------------
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_pt_BR.properties
new file mode 100644
index 0000000..caa7ae2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PoliciesPanel_pt_BR.properties
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+id=Identificador
+description=Descri\u00e7\u00e3o
+type=Tipo
+title=Pol\u00edticas de Conta
+delete=Excluir
+edit=Modificar
+displayRows=Linhas por p\u00e1gina
+
+#-----------------------------
+# Policy Type
+#-----------------------------
+ACCOUNT=Pol\u00edtica de Conta
+GLOBAL_ACCOUNT=Pol\u00edtica Global de Conta
+PASSWORD=Pol\u00edtica de Senha
+GLOBAL_PASSWORD=Pol\u00edtica Global de Senha
+SYNC=Pol\u00edtica de Sincroniza\u00e7\u00e3o
+GLOBAL_SYNC=Pol\u00edtica Global de Sincroniza\u00e7\u00e3o
+#-----------------------------
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PolicyBeanPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PolicyBeanPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PolicyBeanPanel.html
new file mode 100644
index 0000000..b9df63e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PolicyBeanPanel.html
@@ -0,0 +1,39 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+
+ <div id="policyBeanTable">
+ <div class="tablerow" wicket:id="policies">
+ <div class="tablecolumn_check">
+ <span wicket:id="check">[check]</span>
+ </div>
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="label">
+ <span wicket:id="label">[label]</span>
+ </label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="field">[field]</span>
+ </div>
+ </div>
+ </div>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.html
new file mode 100644
index 0000000..cb8a564
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.html
@@ -0,0 +1,37 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="container">
+ <span wicket:id="datatable">[datatable]</span>
+ </span>
+ <span style="float:right">
+ <form wicket:id="PaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+ <div wicket:id="taskWin">
+ [Show modal window for viewing task]
+ </div>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.properties
new file mode 100644
index 0000000..e800242
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks.properties
@@ -0,0 +1,28 @@
+# 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.
+id=Id
+accountId=Account Id
+resource=Resource
+execute=Execute
+detail=Detail
+delete=Delete
+edit=Edit
+propagationMode=Propagation Mode
+propagationOperation=Propagation Operation
+latestExecStatus=Last status
+startDate=Start date
+endDate=End date
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_it.properties
new file mode 100644
index 0000000..62f0177
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_it.properties
@@ -0,0 +1,28 @@
+# 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.
+id=Id
+accountId=Account Id
+resource=Risorsa
+execute=Esegui
+detail=Dettagli
+delete=Rimuovi
+edit=Modifica
+propagationMode=Propagazione
+propagationOperation=Operazione
+latestExecStatus=Ultimo stato
+startDate=Data di avvio
+endDate=Data di conclusione
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_pt_BR.properties
new file mode 100644
index 0000000..709dc9c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PropagationTasks_pt_BR.properties
@@ -0,0 +1,28 @@
+# 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.
+id=Identificador
+accountId=Identificador da Conta
+resource=Recurso
+execute=Executar
+detail=Detalhe
+delete=Excluir
+edit=Alterar
+propagationMode=Mode de Propaga\u00E7\u00E3o
+propagationOperation=Opera\u00E7\u00E3o de Propaga\u00E7\u00E3o
+latestExecStatus=\u00DAltimo Estatus
+startDate=Data inicial
+endDate=Data Final
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel.properties
new file mode 100644
index 0000000..497da5a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel.properties
@@ -0,0 +1,29 @@
+# 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.
+id=Id
+name=Name
+description=Description
+resourceName=Resource Name
+lastExec=Last Execution
+nextExec=Next Execution
+detail=Detail
+delete=Delete
+edit=Edit
+execute=Execute
+executeDryRun=Dry run
+userTemplate=User template
+latestExecStatus=Last status
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_it.properties
new file mode 100644
index 0000000..abb82a4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_it.properties
@@ -0,0 +1,29 @@
+# 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.
+id=Id
+name=Nome
+description=Descrizione
+resourceName=Nome Risorsa
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+detail=Dettagli
+delete=Rimuovi
+edit=Modifica
+execute=Esegui
+executeDryRun=Esecuzione simulata
+userTemplate=Modello utente
+latestExecStatus=Ultimo stato
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_pt_BR.properties
new file mode 100644
index 0000000..054af39
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/PushTasksPanel_pt_BR.properties
@@ -0,0 +1,29 @@
+# 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.
+id=Identificador
+name=Nome
+description=Descri\u00e7\u00e3o
+resourceName=Nome do Recurso
+lastExec=\u00daltima Execu\u00e7\u00e3o
+nextExec=Pr\u00f3xima Execu\u00e7\u00e3o
+detail=Detalhe
+delete=Remove
+edit=Alterar
+execute=Executar
+executeDryRun=Executar (Ensaio)
+userTemplate=Usar Template
+latestExecStatus=\u00daltimo Estatus
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceConnConfPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceConnConfPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceConnConfPanel.html
new file mode 100644
index 0000000..d4b0e16
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceConnConfPanel.html
@@ -0,0 +1,41 @@
+<!--
+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>
+ <span wicket:id="connectorPropertiesContainer">
+ <div id="formtable">
+ <div class="tablerow" wicket:id="connectorProperties">
+ <div class="tablecolumn_label medium_fixedsize">
+ <span wicket:id="connPropAttrSchema">[connPropAttrSchema]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="panel">[connPropAttrValue]</span>
+ </div>
+ </div>
+ </div>
+
+ <div>
+ <a style="position: absolute; top: 2px; right:20px;" wicket:id="check">
+ <img src="img/ping.png"width="30" height="30"
+ alt="ping" title="title" wicket:message="title:check"/>
+ </a>
+ </div>
+ </span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
new file mode 100644
index 0000000..cd8c4ea
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
@@ -0,0 +1,137 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="connector"><wicket:message key="connector"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="connector">[connector]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="enforceMandatoryCondition"><wicket:message key="enforceMandatoryCondition"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="enforceMandatoryCondition">[enforceMandatoryCondition]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="propagationPrimary"><wicket:message key="propagationPrimary"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="propagationPrimary">[propagationPrimary]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="propagationPriority"><wicket:message key="propagationPriority"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="propagationPriority">[propagationPriority]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="propagationMode"><wicket:message key="propagationMode"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="propagationMode">[propagationMode]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="randomPwdIfNotProvided"><wicket:message key="randomPwdIfNotProvided"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="randomPwdIfNotProvided">[randomPwdIfNotProvided]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="propagationActionsClassNames"><wicket:message key="actionsClasses"/></label>
+ </div>
+ <span wicket:id="propagationActionsClassNames">
+ <span wicket:id="actionsClasses">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="actionsClass"/>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button"/></a>
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ <br/>
+ </span>
+ <a wicket:id="first"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ </span>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="createTraceLevel"><wicket:message key="createTraceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="createTraceLevel">[createTraceLevel]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="updateTraceLevel"><wicket:message key="updateTraceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="updateTraceLevel">[updateTraceLevel]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="deleteTraceLevel"><wicket:message key="deleteTraceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="deleteTraceLevel">[deleteTraceLevel]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="syncTraceLevel"><wicket:message key="syncTraceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="syncTraceLevel">[syncTraceLevel]</span>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html
new file mode 100644
index 0000000..8338fd4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceMappingPanel.html
@@ -0,0 +1,125 @@
+<!--
+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>
+ <table id="mappings"
+ class="ui-widget ui-widget-content ui-corner-all"
+ style="font-size: 1em;margin-top:2px;"
+ width="100%" cellpadding="2px" cellspacing="1px"
+ wicket:id="mappingContainer">
+ <thead>
+ <tr class="ui-widget-header">
+ <th><wicket:message key="delete"/></th>
+ <th><wicket:message key="entity"/></th>
+ <th><wicket:message key="intMappingTypes"/></th>
+ <th><wicket:message key="intAttrNames"/></th>
+ <th><wicket:message key="extAttrNames"/></th>
+ <th><wicket:message key="mandatoryCondition"/>
+ <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help"><img src="img/help.png"/>
+ <span wicket:id="jexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </th>
+ <th><wicket:message key="accountId"/></th>
+ <th><label wicket:id="passwordLabel"/></th>
+ <th><wicket:message key="purpose"/></th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td colspan="7" style="padding: 5px">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="addMappingBtn" />
+ </td>
+ </tr>
+ </tfoot>
+ <tbody>
+ <tr wicket:id="mappings" class="tablerow">
+ <td align="center" valign="middle">
+ <input type="checkbox" class="text ui-widget-content ui-corner-all" wicket:id="toRemove"/>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="entities">[entities]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="intMappingTypes">[intMappingTypes]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="intAttrNames">[intAttrNames]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="extAttrName">[extAttrName]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="mandatoryCondition">[mandatoryCondition]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="accountId">[accountId]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="password">[password]</span>
+ </td>
+ <td align="center" valign="middle">
+ <span wicket:id="purpose">
+ <span wicket:id="purposeActions">[purpose]</span>
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <script type="text/javascript">
+ $(function() {
+ $('table#mappings tbody tr.tablerow:even').addClass("alt");
+ });
+ </script>
+
+ <table id="accountLinkTable"
+ class="ui-widget ui-widget-content ui-corner-all"
+ style="font-size: 1em;margin-top:2px;"
+ border-width="1px;" border-color="#cccccc;" border-style="solid;"
+ width="100%" cellpadding="2px" cellspacing="1px"
+ wicket:id="accountLinkContainer">
+ <thead>
+ <tr class="ui-widget-header">
+ <th width="10%" align="left"><wicket:message key="enable"/></th>
+ <th align="left"><wicket:message key="accountLink"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td width="10%" align="left" valign="middle">
+ <span wicket:id="accountLinkCheckbox">[accountLinkCheckbox]</span>
+ </td>
+ <td align="left" valign="middle">
+ <span wicket:id="accountLink">[accountLink]</span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.html
new file mode 100644
index 0000000..ddabe05
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.html
@@ -0,0 +1,56 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="formtable" wicket:id="security">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="passwordPolicy"><wicket:message key="passwordPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="passwordPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="accountPolicy"><wicket:message key="accountPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="accountPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="syncPolicy"><wicket:message key="syncPolicy"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="syncPolicy">
+ [panel for dynamic input type markup]
+ </span>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.properties
new file mode 100644
index 0000000..a38237e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+passwordPolicy = Password Policy
+accountPolicy = Account Policy
+syncPolicy = Sync Policy
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_it.properties
new file mode 100644
index 0000000..f7fd440
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+passwordPolicy = Password Policy
+accountPolicy = Account Policy
+syncPolicy = Sync Policy
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_pt_BR.properties
new file mode 100644
index 0000000..3933167
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceSecurityPanel_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+passwordPolicy = Pol\u00EDtica de Senha
+accountPolicy = Pol\u00EDtica de Conta
+syncPolicy = Pol\u00EDtica de Sincroniza\u00E7\u00E3o
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourcesPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourcesPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourcesPanel.html
new file mode 100644
index 0000000..d5d155a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourcesPanel.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>
+ <span wicket:id="resourcesPalette">[palette]</span>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.html
new file mode 100644
index 0000000..bd04c97
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.html
@@ -0,0 +1,107 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="formtable">
+ <span wicket:id="parent">[parent]</span>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="name"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name"/>
+ <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
+ <img src="img/help.png"/>
+ <span wicket:id="jexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="inheritOwner"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritOwner"/>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="inheritTemplates"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritTemplates"/>
+ </div>
+ </div>
+
+ <div wicket:id="ownerContainer">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="userOwner"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="userOwner"/>
+ <a href="#" wicket:id="userOwnerSelect"><img src="img/actions/search.png" alt="select user owner" title="Search"/></a>
+ <a href="#" wicket:id="userOwnerReset"><img src="img/actions/delete.png" alt="reset user owner" title="Delete"/></a>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="roleOwner"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="roleOwner"/>
+ <a href="#" wicket:id="roleOwnerSelect"><img src="img/actions/search.png" alt="select role owner" title="Search"/></a>
+ <a href="#" wicket:id="roleOwnerReset"><img src="img/actions/delete.png" alt="reset role owner" title="Delete"/></a>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <span wicket:id="parentSelectWin"/>
+ <span wicket:id="userOwnerSelectWin"/>
+ <span wicket:id="roleOwnerSelectWin"/>
+
+ <wicket:fragment wicket:id="parentFragment">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="parent"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="parent"/>
+ <a href="#" wicket:id="parentSelect"><img src="img/actions/search.png" alt="select role parent" title="Search"/></a>
+ <a href="#" wicket:id="parentReset"><img src="img/actions/delete.png" alt="reset role parent" title="Delete"/></a>
+ </div>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.properties
new file mode 100644
index 0000000..b729c65
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel.properties
@@ -0,0 +1,22 @@
+# 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.
+name=Name
+userOwner=Owner (user)
+roleOwner=Owner (role)
+inheritOwner=Inherit owner
+parent=Parent
+inheritTemplates=Inherit templates
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_it.properties
new file mode 100644
index 0000000..7938bae
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_it.properties
@@ -0,0 +1,22 @@
+# 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.
+name=Nome
+userOwner=Proprietario (utente)
+roleOwner=Proprietario (ruolo)
+inheritOwner=Eredita proprietario
+parent=Padre
+inheritTemplates=Eredita modelli
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_pt_BR.properties
new file mode 100644
index 0000000..eadc335
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RoleDetailsPanel_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+name=Nome
+userOwner=Dono (usu\u00e1rio)
+roleOwner=Dono (fun\u00e7\u00e3o)
+inheritOwner=Dono herdado
+parent=Parente
+inheritTemplates=Modelo herdado
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
new file mode 100644
index 0000000..a308eef
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.html
@@ -0,0 +1,88 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+
+ <div id="details">
+ <span wicket:id="details">[role details]</span>
+ <span wicket:id="statuspanel">[Status Panel]</span>
+ <span wicket:id="systeminformation">[System Information]</span>
+ </div>
+
+ <div id="templates">
+ <span wicket:id="templates">[templates]</span>
+ </div>
+
+ <div id="attrs">
+ <div id="formtable">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="inheritAttrs"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritAttrs" />
+ </div>
+ </div>
+
+ <span wicket:id="attrs">[role attributes]</span>
+ </div>
+ </div>
+
+ <div id="derAttrs">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="inheritDerAttrs"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritDerAttrs" />
+ </div>
+ </div>
+
+ <span wicket:id="derAttrs">[role derived attributes]</span>
+ </div>
+ </div>
+
+ <div id="virAttrs">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <wicket:message key="inheritVirAttrs"/>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="inheritVirAttrs" />
+ </div>
+ </div>
+
+ <span wicket:id="virAttrs">[role virtual attributes]</span>
+ </div>
+ </div>
+
+ <div id="resources">
+ <span wicket:id="resources">[resources]</span>
+ </div>
+ <div id="entitlements">
+ <span wicket:id="entitlements">[entitlements]</span>
+ </div>
+ <div id="security">
+ <span wicket:id="security">[security]</span>
+ </div>
+
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
new file mode 100644
index 0000000..38b4584
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel.properties
@@ -0,0 +1,51 @@
+# 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.
+required_alert=All form fields are required.
+add=+
+drop=-
+error=Generic error occurred during the operation
+name=Name
+firstResourcesList=Role's resources
+secondResourcesList=Available resources
+firstEntitlementsList=Role's entitlements
+secondEntitlementsList=Available entitlements
+
+addAttributeBtn=Add
+required_alert=All form fields are required.
+add=+
+drop=-
+error=Generic error occurred during the operation
+name=Name
+firstResourcesList=Role's resources
+secondResourcesList=Available resources
+firstEntitlementsList=Role's entitlements
+secondEntitlementsList=Available entitlements
+derAttrs=Derived Attributes
+derAttrToRemove=Delete
+derAttrName=Name
+derAttrValue=Derived value
+
+virAttrs=Virtual Attributes
+virAttrToRemove=Delete
+virAttrName=Name
+virAttrValue=Virtual value
+
+addAttributeBtn=Add
+
+inheritAttrs=Inherit attributes
+inheritDerAttrs=Inherit derived attributes
+inheritVirAttrs=Inherit virtual attributes
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
new file mode 100644
index 0000000..8fc1ccf
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_it.properties
@@ -0,0 +1,53 @@
+# 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.
+required_alert=All form fields are required.
+add=+
+drop=-
+name=Nome
+error=Errore generico durante l'operazione
+firstResourcesList=Risorse ruolo
+secondResourcesList=Risorse disponibili
+firstResourcesList=Entitlement ruolo
+secondResourcesList=Entitlement disponibili
+
+addAttributeBtn=Aggiungi
+required_alert=Tutti i valori sono richiesti.
+add=+
+drop=-
+name=Nome
+error=Errore generico durante l'operazione
+firstResourcesList=Risorse ruolo
+secondResourcesList=Risorse disponibili
+firstResourcesList=Risorse ruolo
+secondResourcesList=Risorse disponibili
+derAttrs=Attributi derivati
+derAttrToRemove=Rimuovi
+derAttrName=Nome
+derAttrValue=Valore derivato
+
+virAttrs=Attributi virtuali
+virAttrToRemove=Rimuovi
+virAttrName=Nome
+virAttrValue=Valore virtuale
+
+addAttributeBtn=Aggiungi
+
+inheritAttrs=Eredita attributi
+inheritDerAttrs=Eredita attributi derivati
+inheritVirAttrs=Eredita attributi virtuali
+firstEntitlementsList=Entitlement ruolo
+secondEntitlementsList=Entitlement disponibili
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
new file mode 100644
index 0000000..bf48ab6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/RolePanel_pt_BR.properties
@@ -0,0 +1,40 @@
+# 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.
+required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
+add=+
+drop=-
+error=Um erro gen\u00e9rico ocorreu durante a opera\u00e7\u00e3o
+name=Nome
+firstResourcesList=Recursos de Fun\u00e7\u00f5es
+secondResourcesList=Recursos Dipon\u00edveis
+firstEntitlementsList=Direitos de Fun\u00e7\u00f5es
+secondEntitlementsList=Direitos Dispon\u00edveis
+derAttrs=Atributos Derivados
+derAttrToRemove=Remover
+derAttrName=Nome
+derAttrValue=Valor Derivado
+
+virAttrs=Atributos Virtuais
+virAttrToRemove=Remover
+virAttrName=Nome
+virAttrValue=Valor Virtual
+
+addAttributeBtn=Adicionar
+
+inheritAttrs=Atributos Herdados
+inheritDerAttrs=Atributos Herdados Derivados
+inheritVirAttrs=Atributos Virtuais Herdados
[25/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/configuration.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/configuration.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/configuration.png
new file mode 100644
index 0000000..7d4bb91
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/configuration.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/connectors.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/connectors.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/connectors.png
new file mode 100644
index 0000000..8ae8705
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/connectors.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/logout.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/logout.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/logout.png
new file mode 100644
index 0000000..e8ad795
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/logout.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/configuration.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/configuration.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/configuration.png
new file mode 100644
index 0000000..2c3bb8e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/configuration.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/connectors.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/connectors.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/connectors.png
new file mode 100644
index 0000000..98394a9
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/connectors.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/logout.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/logout.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/logout.png
new file mode 100644
index 0000000..ffe0729
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/logout.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/reports.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/reports.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/reports.png
new file mode 100644
index 0000000..596ff39
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/reports.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/resources.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/resources.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/resources.png
new file mode 100644
index 0000000..98394a9
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/resources.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/roles.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/roles.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/roles.png
new file mode 100644
index 0000000..9b64b4b
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/roles.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/schema.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/schema.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/schema.png
new file mode 100644
index 0000000..ee1ad4c
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/schema.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/sf_body.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/sf_body.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/sf_body.png
new file mode 100644
index 0000000..0e3bc4c
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/sf_body.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/tasks.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/tasks.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/tasks.png
new file mode 100644
index 0000000..08cde6d
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/tasks.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/todo.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/todo.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/todo.png
new file mode 100644
index 0000000..26a10e3
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/todo.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/users.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/users.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/users.png
new file mode 100644
index 0000000..97bf71b
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/notsel/users.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/reports.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/reports.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/reports.png
new file mode 100644
index 0000000..847fd2b
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/reports.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/resources.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/resources.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/resources.png
new file mode 100644
index 0000000..8ae8705
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/resources.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/roles.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/roles.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/roles.png
new file mode 100644
index 0000000..fba8be7
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/roles.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/schema.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/schema.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/schema.png
new file mode 100644
index 0000000..378a83c
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/schema.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/tasks.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/tasks.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/tasks.png
new file mode 100644
index 0000000..05bdc11
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/tasks.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/todo.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/todo.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/todo.png
new file mode 100644
index 0000000..2fb374b
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/todo.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/users.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/users.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/users.png
new file mode 100644
index 0000000..64264fa
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/menu/users.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/minus-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/minus-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/minus-icon.png
new file mode 100644
index 0000000..4bc2f4e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/minus-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/modeler.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/modeler.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/modeler.png
new file mode 100644
index 0000000..d33c4ef
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/modeler.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/moveDown.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/moveDown.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/moveDown.png
new file mode 100644
index 0000000..d6ce523
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/moveDown.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/moveUp.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/moveUp.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/moveUp.png
new file mode 100644
index 0000000..d9b2790
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/moveUp.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/ok.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/ok.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/ok.png
new file mode 100644
index 0000000..bc9d2f5
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/ok.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/ping.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/ping.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/ping.png
new file mode 100644
index 0000000..8ad053d
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/ping.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/plus-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/plus-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/plus-icon.png
new file mode 100644
index 0000000..3f8faf1
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/plus-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/reload_30.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/reload_30.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/reload_30.png
new file mode 100644
index 0000000..f9b1e98
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/reload_30.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/remove.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/remove.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/remove.png
new file mode 100644
index 0000000..de5a5cf
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/remove.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/removeAll.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/removeAll.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/removeAll.png
new file mode 100644
index 0000000..f293962
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/removeAll.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/right-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/right-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/right-icon.png
new file mode 100644
index 0000000..2cf0882
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/right-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/search.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/search.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/search.png
new file mode 100644
index 0000000..640c7e8
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/search.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/sf_testa.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/sf_testa.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/sf_testa.png
new file mode 100644
index 0000000..6539dbd
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/sf_testa.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/success.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/success.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/success.png
new file mode 100644
index 0000000..e4b1df7
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/success.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab ok.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/tab ok.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab ok.png
new file mode 100644
index 0000000..8b6d0ee
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab ok.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab old.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/tab old.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab old.png
new file mode 100644
index 0000000..3d5f156
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab old.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/tab.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab.png
new file mode 100644
index 0000000..2ee49dd
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/tab.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/up-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/up-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/up-icon.png
new file mode 100644
index 0000000..1a4dbdf
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/up-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/warning.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/warning.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/warning.png
new file mode 100644
index 0000000..c98c1fd
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/warning.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/xml.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/xml.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/xml.png
new file mode 100644
index 0000000..110fdc4
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/xml.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml b/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
new file mode 100644
index 0000000..d8e31be
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/META-INF/web-fragment.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<web-fragment xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
+ http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
+ id="${pom.artifactId}" version="3.1">
+
+ <display-name>Apache Syncope ${syncope.version} Console</display-name>
+
+ <context-param>
+ <param-name>configuration</param-name>
+ <param-value>deployment</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath:consoleContext.xml</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>SyncopeConsole</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationFactoryClassName</param-name>
+ <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>SyncopeConsole</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <!-- SESSION TIMEOUT (MINUTES)-->
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+</web-fragment>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/MIMETypes
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/MIMETypes b/syncope620/client/console/src/main/resources/MIMETypes
new file mode 100644
index 0000000..9571823
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/MIMETypes
@@ -0,0 +1,671 @@
+# 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.
+
+x-world/x-3dmf
+x-world/x-3dmf
+application/octet-stream
+application/x-authorware-bin
+application/x-authorware-map
+application/x-authorware-seg
+text/vnd.abc
+text/html
+video/animaflex
+application/postscript
+audio/aiff
+audio/x-aiff
+audio/aiff
+audio/x-aiff
+audio/aiff
+audio/x-aiff
+application/x-aim
+text/x-audiosoft-intra
+application/x-navi-animation
+application/x-nokia-9000-communicator-add-on-software
+application/mime
+application/octet-stream
+application/arj
+application/octet-stream
+image/x-jg
+video/x-ms-asf
+text/x-asm
+text/asp
+application/x-mplayer2
+video/x-ms-asf
+video/x-ms-asf-plugin
+audio/basic
+audio/x-au
+application/x-troff-msvideo
+video/avi
+video/msvideo
+video/x-msvideo
+video/avs-video
+application/x-bcpio
+application/mac-binary
+application/macbinary
+application/octet-stream
+application/x-binary
+application/x-macbinary
+image/bmp
+image/bmp
+image/x-windows-bmp
+application/book
+application/book
+application/x-bzip2
+application/x-bsh
+application/x-bzip
+application/x-bzip2
+text/plain
+text/x-c
+text/plain
+application/vnd.ms-pki.seccat
+text/plain
+text/x-c
+application/clariscad
+application/x-cocoa
+application/cdf
+application/x-cdf
+application/x-netcdf
+application/pkix-cert
+application/x-x509-ca-cert
+application/x-chat
+application/x-chat
+application/java
+application/java-byte-code
+application/x-java-class
+application/octet-stream
+text/plain
+text/plain
+application/x-cpio
+text/x-c
+application/mac-compactpro
+application/x-compactpro
+application/x-cpt
+application/pkcs-crl
+application/pkix-crl
+application/pkix-cert
+application/x-x509-ca-cert
+application/x-x509-user-cert
+application/x-csh
+text/x-script.csh
+application/x-pointplus
+text/css
+text/plain
+application/x-director
+application/x-deepv
+text/plain
+application/x-x509-ca-cert
+video/x-dv
+application/x-director
+video/dl
+video/x-dl
+application/msword
+application/msword
+application/commonground
+application/drafting
+application/octet-stream
+video/x-dv
+application/x-dvi
+drawing/x-dwf (old)
+model/vnd.dwf
+application/acad
+image/vnd.dwg
+image/x-dwg
+application/dxf
+image/vnd.dwg
+image/x-dwg
+application/x-director
+text/x-script.elisp
+application/x-bytecode.elisp (compiled elisp)
+application/x-elc
+application/x-envoy
+application/postscript
+application/x-esrehber
+text/x-setext
+application/envoy
+application/x-envoy
+application/octet-stream
+text/plain
+text/x-fortran
+text/x-fortran
+text/plain
+text/x-fortran
+application/vnd.fdf
+application/fractals
+image/fif
+video/fli
+video/x-fli
+image/florian
+text/vnd.fmi.flexstor
+video/x-atomic3d-feature
+text/plain
+text/x-fortran
+image/vnd.fpx
+image/vnd.net-fpx
+application/freeloader
+audio/make
+text/plain
+image/g3fax
+image/gif
+video/gl
+video/x-gl
+audio/x-gsm
+audio/x-gsm
+application/x-gsp
+application/x-gss
+application/x-gtar
+application/x-compressed
+application/x-gzip
+application/x-gzip
+multipart/x-gzip
+text/plain
+text/x-h
+application/x-hdf
+application/x-helpfile
+application/vnd.hp-hpgl
+text/plain
+text/x-h
+text/x-script
+application/hlp
+application/x-helpfile
+application/x-winhelp
+application/vnd.hp-hpgl
+application/vnd.hp-hpgl
+application/binhex
+application/binhex4
+application/mac-binhex
+application/mac-binhex40
+application/x-binhex40
+application/x-mac-binhex40
+application/hta
+text/x-component
+text/html
+text/html
+text/html
+text/webviewhtml
+text/html
+x-conference/x-cooltalk
+image/x-icon
+text/plain
+image/ief
+image/ief
+application/iges
+model/iges
+application/iges
+model/iges
+application/x-ima
+application/x-httpd-imap
+application/inf
+application/x-internett-signup
+application/x-ip2
+video/x-isvideo
+audio/it
+application/x-inventor
+i-world/i-vrml
+application/x-livescreen
+audio/x-jam
+text/plain
+text/x-java-source
+text/plain
+text/x-java-source
+application/x-java-commerce
+image/jpeg
+image/pjpeg
+image/jpeg
+image/jpeg
+image/pjpeg
+image/jpeg
+image/pjpeg
+image/jpeg
+image/pjpeg
+image/x-jps
+application/x-javascript
+application/javascript
+application/ecmascript
+text/javascript
+text/ecmascript
+image/jutvision
+audio/midi
+music/x-karaoke
+application/x-ksh
+text/x-script.ksh
+audio/nspaudio
+audio/x-nspaudio
+audio/x-liveaudio
+application/x-latex
+application/lha
+application/octet-stream
+application/x-lha
+application/octet-stream
+text/plain
+audio/nspaudio
+audio/x-nspaudio
+text/plain
+application/x-lisp
+text/x-script.lisp
+text/plain
+text/x-la-asf
+application/x-latex
+application/octet-stream
+application/x-lzh
+application/lzx
+application/octet-stream
+application/x-lzx
+text/plain
+text/x-m
+video/mpeg
+audio/mpeg
+video/mpeg
+audio/x-mpequrl
+application/x-troff-man
+application/x-navimap
+text/plain
+application/mbedlet
+application/x-magic-cap-package-1.0
+application/mcad
+application/x-mathcad
+image/vasa
+text/mcf
+application/netmc
+application/x-troff-me
+message/rfc822
+message/rfc822
+application/x-midi
+audio/midi
+audio/x-mid
+audio/x-midi
+music/crescendo
+x-music/x-midi
+application/x-midi
+audio/midi
+audio/x-mid
+audio/x-midi
+music/crescendo
+x-music/x-midi
+application/x-frame
+application/x-mif
+message/rfc822
+www/mime
+audio/x-vnd.audioexplosion.mjuicemediafile
+video/x-motion-jpeg
+application/base64
+application/x-meme
+application/base64
+audio/mod
+audio/x-mod
+video/quicktime
+video/quicktime
+video/x-sgi-movie
+audio/mpeg
+audio/x-mpeg
+video/mpeg
+video/x-mpeg
+video/x-mpeq2a
+audio/mpeg3
+audio/x-mpeg-3
+video/mpeg
+video/x-mpeg
+audio/mpeg
+video/mpeg
+application/x-project
+video/mpeg
+video/mpeg
+audio/mpeg
+video/mpeg
+audio/mpeg
+application/vnd.ms-project
+application/x-project
+application/x-project
+application/x-project
+application/marc
+application/x-troff-ms
+video/x-sgi-movie
+audio/make
+application/x-vnd.audioexplosion.mzz
+image/naplps
+image/naplps
+application/x-netcdf
+application/vnd.nokia.configuration-message
+image/x-niff
+image/x-niff
+application/x-mix-transfer
+application/x-conference
+application/x-navidoc
+application/octet-stream
+application/oda
+application/x-omc
+application/x-omcdatamaker
+application/x-omcregerator
+text/x-pascal
+application/pkcs10
+application/x-pkcs10
+application/pkcs-12
+application/x-pkcs12
+application/x-pkcs7-signature
+application/pkcs7-mime
+application/x-pkcs7-mime
+application/pkcs7-mime
+application/x-pkcs7-mime
+application/x-pkcs7-certreqresp
+application/pkcs7-signature
+application/pro_eng
+text/pascal
+image/x-portable-bitmap
+application/vnd.hp-pcl
+application/x-pcl
+image/x-pict
+image/x-pcx
+chemical/x-pdb
+application/pdf
+audio/make
+audio/make.my.funk
+image/x-portable-graymap
+image/x-portable-greymap
+image/pict
+image/pict
+application/x-newton-compatible-pkg
+application/vnd.ms-pki.pko
+text/plain
+text/x-script.perl
+application/x-pixclscript
+image/x-xpixmap
+text/x-script.perl-module
+application/x-pagemaker
+application/x-pagemaker
+image/png
+application/x-portable-anymap
+image/x-portable-anymap
+application/mspowerpoint
+application/vnd.ms-powerpoint
+model/x-pov
+application/vnd.ms-powerpoint
+image/x-portable-pixmap
+application/mspowerpoint
+application/vnd.ms-powerpoint
+application/mspowerpoint
+application/powerpoint
+application/vnd.ms-powerpoint
+application/x-mspowerpoint
+application/mspowerpoint
+application/x-freelance
+application/pro_eng
+application/postscript
+application/octet-stream
+paleovu/x-pv
+application/vnd.ms-powerpoint
+text/x-script.phyton
+application/x-bytecode.python
+audio/vnd.qcelp
+x-world/x-3dmf
+x-world/x-3dmf
+image/x-quicktime
+video/quicktime
+video/x-qtc
+image/x-quicktime
+image/x-quicktime
+audio/x-pn-realaudio
+audio/x-pn-realaudio-plugin
+audio/x-realaudio
+audio/x-pn-realaudio
+application/x-cmu-raster
+image/cmu-raster
+image/x-cmu-raster
+image/cmu-raster
+text/x-script.rexx
+image/vnd.rn-realflash
+image/x-rgb
+application/vnd.rn-realmedia
+audio/x-pn-realaudio
+audio/mid
+audio/x-pn-realaudio
+audio/x-pn-realaudio
+audio/x-pn-realaudio-plugin
+application/ringing-tones
+application/vnd.nokia.ringing-tone
+application/vnd.rn-realplayer
+application/x-troff
+image/vnd.rn-realpix
+audio/x-pn-realaudio-plugin
+text/richtext
+text/vnd.rn-realtext
+application/rtf
+application/x-rtf
+text/richtext
+application/rtf
+text/richtext
+video/vnd.rn-realvideo
+text/x-asm
+audio/s3m
+application/octet-stream
+application/x-tbook
+application/x-lotusscreencam
+text/x-script.guile
+text/x-script.scheme
+video/x-scm
+text/plain
+application/sdp
+application/x-sdp
+application/sounder
+application/sea
+application/x-sea
+application/set
+text/sgml
+text/x-sgml
+text/sgml
+text/x-sgml
+application/x-bsh
+application/x-sh
+application/x-shar
+text/x-script.sh
+application/x-bsh
+application/x-shar
+text/html
+text/x-server-parsed-html
+audio/x-psid
+application/x-sit
+application/x-stuffit
+application/x-koan
+application/x-koan
+application/x-koan
+application/x-koan
+application/x-seelogo
+application/smil
+application/smil
+audio/basic
+audio/x-adpcm
+application/solids
+application/x-pkcs7-certificates
+text/x-speech
+application/futuresplash
+application/x-sprite
+application/x-sprite
+application/x-wais-source
+text/x-server-parsed-html
+application/streamingmedia
+application/vnd.ms-pki.certstore
+application/step
+application/sla
+application/vnd.ms-pki.stl
+application/x-navistyle
+application/step
+application/x-sv4cpio
+application/x-sv4crc
+image/vnd.dwg
+image/x-dwg
+application/x-world
+x-world/x-svr
+application/x-shockwave-flash
+application/x-troff
+text/x-speech
+application/x-tar
+application/toolbook
+application/x-tbook
+application/x-tcl
+text/x-script.tcl
+text/x-script.tcsh
+application/x-tex
+application/x-texinfo
+application/x-texinfo
+application/plain
+text/plain
+application/gnutar
+application/x-compressed
+image/tiff
+image/x-tiff
+image/tiff
+image/x-tiff
+application/x-troff
+audio/tsp-audio
+application/dsptype
+audio/tsplayer
+text/tab-separated-values
+image/florian
+text/plain
+text/x-uil
+text/uri-list
+text/uri-list
+application/i-deas
+text/uri-list
+text/uri-list
+application/x-ustar
+multipart/x-ustar
+application/octet-stream
+text/x-uuencode
+text/x-uuencode
+application/x-cdlink
+text/x-vcalendar
+application/vda
+video/vdo
+application/groupwise
+video/vivo
+video/vnd.vivo
+video/vivo
+video/vnd.vivo
+application/vocaltec-media-desc
+application/vocaltec-media-file
+audio/voc
+audio/x-voc
+video/vosaic
+audio/voxware
+audio/x-twinvq-plugin
+audio/x-twinvq
+audio/x-twinvq-plugin
+application/x-vrml
+model/vrml
+x-world/x-vrml
+x-world/x-vrt
+application/x-visio
+application/x-visio
+application/x-visio
+application/wordperfect6.0
+application/wordperfect6.1
+application/msword
+audio/wav
+audio/x-wav
+application/x-qpro
+image/vnd.wap.wbmp
+application/vnd.xara
+application/msword
+application/x-123
+windows/metafile
+text/vnd.wap.wml
+application/vnd.wap.wmlc
+text/vnd.wap.wmlscript
+application/vnd.wap.wmlscriptc
+application/msword
+application/wordperfect
+application/wordperfect
+application/wordperfect6.0
+application/wordperfect
+application/wordperfect
+application/x-wpwin
+application/x-lotus
+application/mswrite
+application/x-wri
+application/x-world
+model/vrml
+x-world/x-vrml
+model/vrml
+x-world/x-vrml
+text/scriplet
+application/x-wais-source
+application/x-wintalk
+image/x-xbitmap
+image/x-xbm
+image/xbm
+video/x-amt-demorun
+xgl/drawing
+image/vnd.xiff
+application/excel
+application/excel
+application/x-excel
+application/x-msexcel
+application/excel
+application/vnd.ms-excel
+application/x-excel
+application/excel
+application/vnd.ms-excel
+application/x-excel
+application/excel
+application/x-excel
+application/excel
+application/x-excel
+application/excel
+application/vnd.ms-excel
+application/x-excel
+application/excel
+application/vnd.ms-excel
+application/x-excel
+application/excel
+application/vnd.ms-excel
+application/x-excel
+application/x-msexcel
+application/excel
+application/x-excel
+application/excel
+application/x-excel
+application/excel
+application/vnd.ms-excel
+application/x-excel
+application/x-msexcel
+audio/xm
+application/xml
+text/xml
+xgl/movie
+application/x-vnd.ls-xpix
+image/x-xpixmap
+image/xpm
+image/png
+video/x-amt-showrun
+image/x-xwd
+image/x-xwindowdump
+chemical/x-pdb
+application/x-compress
+application/x-compressed
+application/x-compressed
+application/x-zip-compressed
+application/zip
+multipart/x-zip
+application/octet-stream
+text/x-script.zsh
+application/vnd.oasis.opendocument.text
+application/vnd.oasis.opendocument.graphics
+application/vnd.oasis.opendocument.presentation
+application/vnd.oasis.opendocument.spreadsheet
+application/vnd.oasis.opendocument.chart
+application/vnd.oasis.opendocument.formula
+application/vnd.oasis.opendocument.database
+application/vnd.oasis.opendocument.image
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/authorizations.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/authorizations.xml b/syncope620/client/console/src/main/resources/authorizations.xml
new file mode 100644
index 0000000..d5914f8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/authorizations.xml
@@ -0,0 +1,333 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<auth>
+ <page id="Schema">
+ <action id="list">
+ <entitlement>SCHEMA_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>SCHEMA_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>SCHEMA_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>SCHEMA_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>SCHEMA_DELETE</entitlement>
+ </action>
+ </page>
+
+ <page id="Users">
+ <action id="list">
+ <entitlement>USER_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>USER_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>USER_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>USER_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>USER_DELETE</entitlement>
+ </action>
+
+ <action id="changeView">
+ <entitlement>USER_VIEW</entitlement>
+ </action>
+ </page>
+
+ <page id="Roles">
+ <action id="list">
+ <entitlement>ROLE_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>ROLE_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>ROLE_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>ROLE_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>ROLE_DELETE</entitlement>
+ </action>
+ </page>
+
+ <page id="Resources">
+ <action id="list">
+ <entitlement>RESOURCE_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>RESOURCE_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>RESOURCE_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>RESOURCE_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>RESOURCE_DELETE</entitlement>
+ </action>
+
+ <action id="getConnectorObject">
+ <entitlement>RESOURCE_GETCONNECTOROBJECT</entitlement>
+ </action>
+ </page>
+
+ <page id="Reports">
+ <action id="list">
+ <entitlement>REPORT_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>REPORT_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>REPORT_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>REPORT_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>REPORT_DELETE</entitlement>
+ </action>
+
+ <action id="execute">
+ <entitlement>REPORT_EXECUTE</entitlement>
+ </action>
+ </page>
+
+ <page id="Audit">
+ <action id="list">
+ <entitlement>AUDIT_LIST</entitlement>
+ </action>
+
+ <action id="enable">
+ <entitlement>AUDIT_ENABLE</entitlement>
+ </action>
+
+ <action id="disable">
+ <entitlement>AUDIT_DISABLE</entitlement>
+ </action>
+ </page>
+
+ <page id="Connectors">
+ <action id="list">
+ <entitlement>CONNECTOR_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>CONNECTOR_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>CONNECTOR_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>CONNECTOR_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>CONNECTOR_DELETE</entitlement>
+ </action>
+
+ <action id="reload">
+ <entitlement>CONNECTOR_RELOAD</entitlement>
+ </action>
+
+ </page>
+
+ <page id="Approval">
+ <action id="list">
+ <entitlement>WORKFLOW_FORM_LIST</entitlement>
+ </action>
+ <action id="read">
+ <entitlement>WORKFLOW_FORM_READ</entitlement>
+ </action>
+ <action id="claim">
+ <entitlement>WORKFLOW_FORM_CLAIM</entitlement>
+ </action>
+ <action id="submit">
+ <entitlement>WORKFLOW_FORM_SUBMIT</entitlement>
+ </action>
+ </page>
+
+ <page id="Configuration">
+ <action id="list">
+ <entitlement>CONFIGURATION_LIST</entitlement>
+ </action>
+
+ <action id="export">
+ <entitlement>CONFIGURATION_EXPORT</entitlement>
+ </action>
+
+ <action id="set">
+ <entitlement>CONFIGURATION_SET</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>CONFIGURATION_DELETE</entitlement>
+ </action>
+
+ <action id="logList">
+ <entitlement>LOG_LIST</entitlement>
+ </action>
+
+ <action id="logSetLevel">
+ <entitlement>LOG_SET_LEVEL</entitlement>
+ </action>
+
+ <action id="logDelete">
+ <entitlement>LOG_DELETE</entitlement>
+ </action>
+
+ <action id="workflowDefRead">
+ <entitlement>WORKFLOW_DEF_READ</entitlement>
+ </action>
+
+ <action id="workflowDefUpdate">
+ <entitlement>WORKFLOW_DEF_UPDATE</entitlement>
+ </action>
+ </page>
+
+ <page id="Notification">
+ <action id="list">
+ <entitlement>NOTIFICATION_LIST</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>NOTIFICATION_CREATE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>NOTIFICATION_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>NOTIFICATION_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>NOTIFICATION_DELETE</entitlement>
+ </action>
+ </page>
+
+ <page id="SecurityQuestion">
+ <action id="create">
+ <entitlement>SECURITY_QUESTION_CREATE</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>SECURITY_QUESTION_UPDATE</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>SECURITY_QUESTION_DELETE</entitlement>
+ </action>
+ </page>
+
+ <page id="Tasks">
+ <action id="list">
+ <entitlement>TASK_LIST</entitlement>
+ </action>
+
+ <action id="execute">
+ <entitlement>TASK_EXECUTE</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>TASK_READ</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>TASK_DELETE</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>TASK_CREATE</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>TASK_UPDATE</entitlement>
+ </action>
+ </page>
+
+ <page id="Policies">
+ <action id="list">
+ <entitlement>POLICY_LIST</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>POLICY_READ</entitlement>
+ </action>
+
+ <action id="delete">
+ <entitlement>POLICY_DELETE</entitlement>
+ </action>
+
+ <action id="create">
+ <entitlement>POLICY_CREATE</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>POLICY_UPDATE</entitlement>
+ </action>
+ </page>
+ <page id="Routes">
+ <action id="list">
+ <entitlement>ROUTE_LIST</entitlement>
+ </action>
+
+ <action id="read">
+ <entitlement>ROUTE_READ</entitlement>
+ </action>
+
+ <action id="update">
+ <entitlement>ROUTE_UPDATE</entitlement>
+ </action>
+ </page>
+</auth>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/console.properties b/syncope620/client/console/src/main/resources/console.properties
new file mode 100644
index 0000000..75c88de
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/console.properties
@@ -0,0 +1,21 @@
+# 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.
+scheme=http
+host=localhost
+port=8080
+rootPath=/syncope/rest/
+activitiModelerDirectory=${activiti-modeler.directory}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/consoleContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/consoleContext.xml b/syncope620/client/console/src/main/resources/consoleContext.xml
new file mode 100644
index 0000000..b451ef1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/consoleContext.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <context:component-scan base-package="org.apache.syncope.client.console.rest"/>
+ <context:component-scan base-package="org.apache.syncope.client.console.init"/>
+ <context:component-scan base-package="org.apache.syncope.client.console.preview"/>
+
+ <bean id="confDirectoryPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="order" value="1"/>
+ <property name="location" value="file:${conf.directory}/console.properties"/>
+ <property name="ignoreResourceNotFound" value="true"/>
+ <property name="ignoreUnresolvablePlaceholders" value="true"/>
+ </bean>
+ <bean id="classpathPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="location" value="classpath:console.properties"/>
+ </bean>
+
+ <bean id="version" class="java.lang.String">
+ <constructor-arg value="${syncope.version}"/>
+ </bean>
+
+ <bean id="site" class="java.lang.String">
+ <constructor-arg value="${project.parent.url}"/>
+ </bean>
+
+ <bean id="license" class="java.lang.String">
+ <constructor-arg value="${licenseUrl}"/>
+ </bean>
+
+ <bean id="anonymousUser" class="java.lang.String">
+ <constructor-arg value="${anonymousUser}"/>
+ </bean>
+ <bean id="anonymousKey" class="java.lang.String">
+ <constructor-arg value="${anonymousKey}"/>
+ </bean>
+
+ <bean id="activitiModelerDirectory" class="java.lang.String">
+ <constructor-arg value="${activitiModelerDirectory}"/>
+ </bean>
+
+ <bean id="syncopeApplication" class="org.apache.syncope.client.console.SyncopeApplication"/>
+
+ <bean id="preferenceManager" class="org.apache.syncope.client.console.commons.PreferenceManager"/>
+
+ <bean id="xmlRolesReader" class="org.apache.syncope.client.console.commons.XMLRolesReader" scope="singleton">
+ <property name="authorizations" value="authorizations.xml"/>
+ </bean>
+
+ <bean id="roleTreeBuilder" class="org.apache.syncope.client.console.commons.RoleTreeBuilder"/>
+
+ <bean id="syncopeClientFactory" class="org.apache.syncope.client.lib.SyncopeClientFactoryBean">
+ <property name="address" value="${scheme}://${host}:${port}/${rootPath}"/>
+ </bean>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
new file mode 100644
index 0000000..223b27a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication.properties
@@ -0,0 +1,54 @@
+# 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.
+users=Users
+roles=Roles
+configuration=Configuration
+resources=Resources
+connectors=Connectors
+reports=Reports
+tasks=Tasks
+logout=Logout
+schema=Schema
+operation_succeeded=Operation executed successfully
+operation_error=Error occurred during the requested operation
+alert=Alert:
+confirmDelete=Do you really want to delete the selected item(s)?
+confirmUnlink=Do you really want to remove the link between the selected item(s) and the resource?
+confirmUnassign=Do you really want to remove the assignment between the selected item(s) and the resource?
+confirmDeprovision=Do you really want to de-provision the selected item(s)?
+confirmProvision=Do you really want to provision the selected item(s)?
+
+
+unauthorizedInstantiationException=Missing authorization.
+accessControlException=Missing authorization while contacting Syncope core.
+restClientException=Error while contacting Syncope core.
+pageExpiredException=Session expired: please login again.
+
+dropDownChoiceField.nullValid=Choose one
+todo=TODO
+DateTimeField$HoursValidator=Hour value must be in range (1, 12)
+error=Error
+generic_error=An error occurred during the operation
+id=Id
+name=Name
+palette.available=Available
+palette.selected=Selected
+jexl_info=This field expects a JEXL expression, for example:
+jexl_ex1=surname + ',' + firstname
+jexl_ex2='new.' + surname
+jexl_syntax_url=Full JEXL reference
+create=Create
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
new file mode 100644
index 0000000..3a54be5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_it.properties
@@ -0,0 +1,53 @@
+# 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.
+users=Utenti
+roles=Ruoli
+configuration=Configurazione
+resources=Risorse
+connectors=Connettori
+reports=Rapporti
+logout=Logout
+schema=Schema
+tasks=Task
+operation_succeeded=Operazione eseguita con successo
+operation_error=Attenzione si \u00e8 verificato un errore durante l'esecuzione dell'operazione richiesta
+alert=Attenzione:
+confirmDelete=Vuoi davvero procedere con la cancellazione?
+confirmUnlink=Vuoi davvero procedere rimuovendo il link con la risorsa?
+confirmUnassign=Vuoi davvero procedere rimuovendo l'assegnamento sulla risorsa?
+confirmDeprovision=Vuoi davvero procedere con il de-provisioning?
+confirmProvision=Vuoi davvero procedere con il provisioning?
+
+unauthorizedInstantiationException=Autorizzazione mancante.
+accessControlException=Autorizzazione mancante durante la comunicazione con Syncope core.
+restClientException=Errore durante la comunicazione con Syncope core.
+pageExpiredException=Sessione scaduta: eseguire di nuovo l'accesso.
+
+dropDownChoiceField.nullValid=Seleziona
+todo=TODO
+DateTimeField$HoursValidator=L'ora deve essere nell'intervallo (1,12)
+error=Errore
+generic_error=Si \u00e8 verificato un errore durante l'operazione
+id=Id
+name=Nome
+palette.available=Opzioni
+palette.selected=Selezione
+jexl_info=In questo campo possono essere inserite espressioni di tipo JEXL, per esempio:
+jexl_ex1=surname + ',' + firstname
+jexl_ex2='new.' + surname
+jexl_syntax_url=Sintassi JEXL completa
+create=Crea
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
new file mode 100644
index 0000000..dd9ecd7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/SyncopeApplication_pt_BR.properties
@@ -0,0 +1,53 @@
+# 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.
+users=Usu\u00e1rios
+roles=Fun\u00e7\u00f5es
+configuration=Configura\u00e7\u00f5es
+resources=Recursos
+connectors=Conectores
+reports=Relat\u00f3rios
+tasks=Tarefas
+logout=Sair
+schema=Esquemas
+operation_succeeded=Opera\u00e7\u00e3o executada com sucesso
+operation_error=Um erro ocorreu ao executar esta opera\u00e7\u00e3o
+alert=Alerta:
+confirmDelete=Voc\u00ea realmente deseja apagar este item(s) selecionado?
+confirmUnlink=Voc\u00ea realmente deseja apagar o v\u00ednculo entre o item e de recursos?
+confirmUnassign=Voc\u00ea realmente deseja apagar a atribui\u00e7\u00e3o entre o item e de recursos?
+confirmDeprovision=Voc\u00ea realmente de-provision item?
+confirmProvision=Voc\u00ea realmente provision item?
+
+unauthorizedInstantiationException=Falta de autoriza\u00e7\u00e3o para concluir.
+accessControlException=Falta de autoriza\u00e7\u00e3o ao comunicar-se com o Syncope core.
+restClientException=Erro ao comunicar-se com o Syncope core.
+pageExpiredException=Sess\u00e3o encerrada, favor logar-se novamente.
+
+dropDownChoiceField.nullValid=Escolha um
+todo=A fazer
+DateTimeField$HoursValidator=O seu valor precisa estar entre (1, 12)
+error=Erro
+generic_error=Um erro ocorreu durante a opera\u00e7\u00e3o
+id=Id
+name=Nome
+palette.available=Dispon\u00ed\u00advel
+palette.selected=Selecionado
+jexl_info=Este campo \u00e9 designado a uma express\u00e3o do tipo JEXL, por exemplo\:
+jexl_ex1=sobrenome + ',' + nome
+jexl_ex2='novo.' + sobrenome
+jexl_syntax_url=Refer\u00eancia JEXL completa
+create=Criar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
new file mode 100644
index 0000000..ef013ce
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.html
@@ -0,0 +1,120 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
+ <style>
+ #dataTableSpan{
+ display: block;
+ clear: both;
+ float: none;
+ margin: 10px;
+ padding-top: 10px;
+ }
+
+ #dataTableSpan table{
+ width: 100%;
+ }
+
+ form#pwdMgtForm {
+ border: 1px solid #AAAAAA;
+ margin:10px;
+ }
+
+ div#changepwd {
+ display: inline-row;
+ margin-top: 5px;
+ }
+
+ div#changepwd div{
+ display: table-cell;
+ }
+
+ div#changepwd div#label{
+ padding-left: 5px;
+ vertical-align: middle;
+ font-family: Verdana,Arial,sans-serif;
+ }
+
+ div#password {
+ display: inline-row;
+ margin: 5px;
+ }
+
+ div#continue {
+ display: inline-row;
+ margin: 5px;
+ }
+
+ div#continue div{
+ display: table-cell;
+ }
+
+ div#cancelBtmForm {
+ padding-left: 5px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <span wicket:id="resourceDatatable" id="dataTableSpan">[resources]</span>
+
+ <span wicket:id="pwdMgtFields">[password management]</span>
+
+ <wicket:fragment wicket:id="pwdMgtFragment">
+ <div wicket:id="pwdMgt">
+ <form wicket:id="pwdMgtForm" id="pwdMgtForm">
+ <div id="changepwd">
+ <div id="value">
+ <span wicket:id="changepwd">[changepwd]</span>
+ </div>
+ <div id="label">
+ <label wicket:id="changePwdLabel">[Change password]</label>
+ </div>
+ </div>
+
+ <div id="password">
+ <input type="password" wicket:id="password" id="password" size="25" style="width: 180px" title="password"/>
+ </div>
+
+ <div id="password">
+ <input type="password" wicket:id="confirm" id="confirm" size="25" style="width: 180px" title="confirm"/>
+ </div>
+
+ <div id="continue">
+ <div id="continueBtmForm">
+ <input type="button" wicket:id="continue" id="continue"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"/>
+ </div>
+
+ <div id="cancelBtmForm">
+ <input type="button" wicket:id="cancel" id="cancel"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"/>
+ </div>
+ </div>
+ </form>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+
+ <wicket:child />
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.properties
new file mode 100644
index 0000000..0f1fcdc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Global Status
+changePwdLabel=Password propagation
+passwordMismatch=Password mismatch
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_it.properties
new file mode 100644
index 0000000..e5619e2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Stato Globale
+changePwdLabel=Propagazione password
+passwordMismatch=Password non corrispondenti
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_pt_BR.properties
new file mode 100644
index 0000000..36d86e8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/AbstractStatusModalPage_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Estatus Global
+changePwdLabel=Password propagation
+passwordMismatch=Password mismatch
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
new file mode 100644
index 0000000..789538f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:b3mn="http://b3mn.org/2007/b3mn"
+ xmlns:ext="http://b3mn.org/2007/ext"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:atom="http://b3mn.org/2007/atom+xhtml">
+ <head profile="http://purl.org/NET/erdf/profile">
+ <title>Apache Syncope / Activiti Modeler</title>
+ <!-- libraries -->
+ <script src="activiti-modeler/libs/prototype-1.5.1.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/path_parser.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/ext-2.0.2/adapter/ext/ext-base.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/ext-2.0.2/ext-all-debug.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/ext-2.0.2/color-field.js" type="text/javascript"></script>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/libs/ext-2.0.2/resources/css/ext-all.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/libs/ext-2.0.2/resources/css/xtheme-darkgray.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/editor/css/theme_norm.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/editor/css/theme_norm_signavio.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/explorer/src/css/xtheme-smoky.css" type="text/css"></link>
+ <link rel="Stylesheet" media="screen" href="activiti-modeler/explorer/src/css/custom-style.css" type="text/css"></link>
+ <!-- oryx editor -->
+ <!-- language files -->
+ <script src="activiti-modeler/editor/i18n/translation_en_us.js" type="text/javascript"></script>
+ <script src="activiti-modeler/editor/i18n/translation_signavio_en_us.js" type="text/javascript"></script>
+ <script src="activiti-modeler/libs/utils.js" type="text/javascript"></script>
+ <script src="activiti-modeler/editor/oryx.debug.js" type="text/javascript"></script>
+ <!-- erdf schemas -->
+ <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/"></link>
+ <link rel="schema.dcTerms" href="http://purl.org/dc/terms/"></link>
+ <link rel="schema.b3mn" href="http://b3mn.org"></link>
+ <link rel="schema.oryx" href="http://oryx-editor.org/"></link>
+ <link rel="schema.raziel" href="http://raziel.org/"></link>
+
+ <script type="text/javascript">
+ window.onunload = refreshParent;
+ function refreshParent() {
+ if (window.opener.location.toString().indexOf('#workflow') === -1) {
+ window.opener.location = window.opener.location + "#workflow";
+ }
+ window.opener.location.reload();
+ }
+ </script>
+ </head>
+ <body style="overflow:hidden;">
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.html
new file mode 100644
index 0000000..be1a4b0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.html
@@ -0,0 +1,52 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow" wicket:id="propView">
+ <div class="tablecolumn_label medium_dynamicsize">
+ <span wicket:id="key">[key]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="value">[value]</span>
+
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 0">
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="userDetails"/>
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ accept=""class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+
+ </form>
+ <div wicket:id="editUserWin">[Show modal window for editing user under approval]</div>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.properties
new file mode 100644
index 0000000..547f13f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Approval form
+userDetails=User details
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_it.properties
new file mode 100644
index 0000000..a2a7134
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_it.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Form di approvazione
+userDetails=Dettagli utente
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_pt_BR.properties
new file mode 100644
index 0000000..954d365
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ApprovalModalPage_pt_BR.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Formul\u00E1rio de Aprova\u00E7\u00E3o
+userDetails=Detalhes do Usu\u00E1rio
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.html
new file mode 100644
index 0000000..57fc8d3
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.html
@@ -0,0 +1,56 @@
+<!--
+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>
+
+ <link rel="stylesheet" type="text/css" href="webjars/jquery-ui/${jquery-ui.version}/themes/base/minified/jquery-ui.min.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/style.css" media="all"/>
+ <link rel="stylesheet" type="text/css" href="css/fieldstyle.css" media="all"/>
+
+ <script type="text/javascript" src="webjars/jquery-ui/${jquery-ui.version}/ui/minified/jquery-ui.min.js"></script>
+
+ <script type="text/javascript">
+ $(function() {
+ $("#tabs").tabs();
+ });
+
+ var notificationShownTimes = 0;
+
+ function showNotification(componentId, messagecount) {
+ notificationShownTimes++;
+ timeout = 1700 + (messagecount * 500) + notificationShownTimes * 200;
+ $('div#' + componentId).fadeTo('normal', 1.0);
+ setTimeout("$('div#" + componentId + "').fadeOut('normal')", timeout);
+ }
+ </script>
+
+ <style type="text/css">
+ table.palette td.header {
+ background:url("images/ui-bg_glass_75_e6e6e6_1x400.png")
+ repeat-x scroll 50% 50% #E6E6E6 !important;
+ }
+ </style>
+ </head>
+ <body onload="setTimeout('window.focus();', 0);">
+ <div wicket:id="feedback"/>
+
+ <wicket:child />
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.properties
new file mode 100644
index 0000000..bf07514
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/BaseModalPage.properties
@@ -0,0 +1,20 @@
+# 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.
+submit=Save
+add=Add
+remove=Delete
+cancel=Cancel
\ No newline at end of file
[34/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
new file mode 100644
index 0000000..b9162da
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/AttrTemplatesPanel.java
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.NonI18nPalette;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.markup.html.form.palette.component.Recorder;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class AttrTemplatesPanel extends Panel {
+
+ public enum Type {
+
+ rAttrTemplates,
+ rDerAttrTemplates,
+ rVirAttrTemplates,
+ mPlainAttrTemplates,
+ mDerAttrTemplates,
+ mVirAttrTemplates;
+
+ }
+
+ private static final long serialVersionUID = 1016028222120619000L;
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ private final RoleTO roleTO;
+
+ private final NonI18nPalette<String> rPlainAttrTemplates;
+
+ private final NonI18nPalette<String> rDerAttrTemplates;
+
+ private final NonI18nPalette<String> rVirAttrTemplates;
+
+ public AttrTemplatesPanel(final String id, final RoleTO roleTO) {
+ super(id);
+ this.roleTO = roleTO;
+
+ rPlainAttrTemplates = buildPalette(Type.rAttrTemplates,
+ schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.PLAIN));
+ this.add(rPlainAttrTemplates);
+ rDerAttrTemplates = buildPalette(Type.rDerAttrTemplates,
+ schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.DERIVED));
+ this.add(rDerAttrTemplates);
+ rVirAttrTemplates = buildPalette(Type.rVirAttrTemplates,
+ schemaRestClient.getSchemaNames(AttributableType.ROLE, SchemaType.VIRTUAL));
+ this.add(rVirAttrTemplates);
+
+ this.add(buildPalette(Type.mPlainAttrTemplates,
+ schemaRestClient.getSchemaNames(AttributableType.MEMBERSHIP, SchemaType.PLAIN)));
+ this.add(buildPalette(Type.mDerAttrTemplates,
+ schemaRestClient.getSchemaNames(AttributableType.MEMBERSHIP, SchemaType.DERIVED)));
+ this.add(buildPalette(Type.mVirAttrTemplates,
+ schemaRestClient.getSchemaNames(AttributableType.MEMBERSHIP, SchemaType.VIRTUAL)));
+ }
+
+ private NonI18nPalette<String> buildPalette(final Type type, final List<String> allSchemas) {
+ if (allSchemas != null && !allSchemas.isEmpty()) {
+ Collections.sort(allSchemas);
+ }
+ ListModel<String> availableSchemas = new ListModel<String>(allSchemas);
+
+ return new NonI18nPalette<String>(type.name(), new PropertyModel<List<String>>(roleTO, type.name()),
+ availableSchemas, new SelectChoiceRenderer<String>(), 8, false, true) {
+
+ private static final long serialVersionUID = 2295567122085510330L;
+
+ @Override
+ protected Recorder<String> newRecorderComponent() {
+ final Recorder<String> recorder = super.newRecorderComponent();
+
+ switch (type) {
+ case rAttrTemplates:
+ case rDerAttrTemplates:
+ case rVirAttrTemplates:
+ recorder.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(getPage(), Broadcast.BREADTH, new RoleAttrTemplatesChange(type, target));
+ }
+ });
+ break;
+
+ default:
+ }
+
+ return recorder;
+ }
+ };
+ }
+
+ public Collection<String> getSelected(final Type type) {
+ Collection<String> selected;
+ switch (type) {
+ case rAttrTemplates:
+ selected = this.rPlainAttrTemplates.getModelCollection();
+ break;
+
+ case rDerAttrTemplates:
+ selected = this.rDerAttrTemplates.getModelCollection();
+ break;
+
+ case rVirAttrTemplates:
+ selected = this.rVirAttrTemplates.getModelCollection();
+ break;
+
+ default:
+ selected = Collections.emptyList();
+ }
+
+ return selected;
+ }
+
+ public static class RoleAttrTemplatesChange {
+
+ private final Type type;
+
+ private final AjaxRequestTarget target;
+
+ public RoleAttrTemplatesChange(final Type type, final AjaxRequestTarget target) {
+ this.type = type;
+ this.target = target;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DataTablePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DataTablePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DataTablePanel.java
new file mode 100644
index 0000000..a5f6588
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DataTablePanel.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.DataGridView;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class DataTablePanel<T, S> extends Panel {
+
+ private static final long serialVersionUID = -7264400471578272966L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(DataTablePanel.class);
+
+ protected CheckGroup<T> group;
+
+ protected AjaxFallbackDefaultDataTable<T, S> dataTable;
+
+ protected IModel<Collection<T>> model;
+
+ public DataTablePanel(final String id) {
+ super(id);
+
+ model = new IModel<Collection<T>>() {
+
+ private static final long serialVersionUID = 4886729136344643465L;
+
+ private Collection<T> values = new HashSet<T>();
+
+ @Override
+ public Collection<T> getObject() {
+ // Someone or something call this method to change the model: this is not the right behavior.
+ // Return a copy of the model object in order to avoid SYNCOPE-465
+ return new HashSet<T>(values);
+ }
+
+ @Override
+ public void setObject(final Collection<T> selected) {
+ final Collection<T> all = getGroupModelObjects();
+ values.removeAll(all);
+ values.addAll(selected);
+ }
+
+ @Override
+ public void detach() {
+ }
+ };
+ }
+
+ public final void setCurrentPage(final long page) {
+ dataTable.setCurrentPage(page);
+ }
+
+ public final long getRowCount() {
+ return dataTable.getRowCount();
+ }
+
+ public final long getCurrentPage() {
+ return dataTable.getCurrentPage();
+ }
+
+ public final long getPageCount() {
+ return dataTable.getPageCount();
+ }
+
+ public void setItemsPerPage(final int resourcePaginatorRows) {
+ dataTable.setItemsPerPage(resourcePaginatorRows);
+ }
+
+ protected Collection<T> getGroupModelObjects() {
+ final Set<T> res = new HashSet<T>();
+
+ final Component rows = group.get("dataTable:body:rows");
+ if (rows instanceof DataGridView) {
+ @SuppressWarnings("unchecked")
+ final Iterator<Item<T>> iter = ((DataGridView<T>) rows).getItems();
+
+ while (iter.hasNext()) {
+ res.add(iter.next().getModelObject());
+ }
+ }
+ return res;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java
new file mode 100644
index 0000000..d68038f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/DerAttrsPanel.java
@@ -0,0 +1,206 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AttrTemplatesPanel.RoleAttrTemplatesChange;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDecoratedCheckbox;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.attributes.IAjaxCallListener;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class DerAttrsPanel extends Panel {
+
+ private static final long serialVersionUID = -5387344116983102292L;
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ private final AttrTemplatesPanel attrTemplates;
+
+ public <T extends AbstractAttributableTO> DerAttrsPanel(final String id, final T entityTO) {
+ this(id, entityTO, null);
+ }
+
+ public <T extends AbstractAttributableTO> DerAttrsPanel(final String id, final T entityTO,
+ final AttrTemplatesPanel attrTemplates) {
+
+ super(id);
+ this.attrTemplates = attrTemplates;
+ setOutputMarkupId(true);
+
+ final IModel<List<String>> derSchemas = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ List<String> derSchemaNames;
+
+ if (entityTO instanceof RoleTO) {
+ final RoleTO roleTO = (RoleTO) entityTO;
+
+ if (attrTemplates == null) {
+ derSchemaNames = roleTO.getRDerAttrTemplates();
+ } else {
+ derSchemaNames = new ArrayList<>(
+ attrTemplates.getSelected(AttrTemplatesPanel.Type.rDerAttrTemplates));
+ if (roleTO.isInheritTemplates() && roleTO.getParent() != 0) {
+ derSchemaNames.addAll(roleRestClient.read(roleTO.getParent()).getRDerAttrTemplates());
+ }
+ }
+ } else if (entityTO instanceof UserTO) {
+ derSchemaNames = schemaRestClient.getDerSchemaNames(AttributableType.USER);
+ } else {
+ derSchemaNames = roleRestClient.read(((MembershipTO) entityTO).getRoleId()).getMDerAttrTemplates();
+ }
+
+ return derSchemaNames;
+ }
+ };
+
+ final WebMarkupContainer attributesContainer = new WebMarkupContainer("derAttrContainer");
+
+ attributesContainer.setOutputMarkupId(true);
+ add(attributesContainer);
+
+ AjaxButton addAttributeBtn = new IndicatingAjaxButton("addAttributeBtn", new ResourceModel("addAttributeBtn")) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ entityTO.getDerAttrs().add(new AttrTO());
+ target.add(attributesContainer);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ target.add(attributesContainer);
+ }
+ };
+ add(addAttributeBtn.setDefaultFormProcessing(false));
+
+ ListView<AttrTO> attributes = new ListView<AttrTO>("attrs",
+ new PropertyModel<List<? extends AttrTO>>(entityTO, "derAttrs")) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(final ListItem<AttrTO> item) {
+ final AttrTO attributeTO = item.getModelObject();
+
+ item.add(new AjaxDecoratedCheckbox("toRemove", new Model<>(Boolean.FALSE)) {
+
+ private static final long serialVersionUID = 7170946748485726506L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ entityTO.getDerAttrs().remove(attributeTO);
+ target.add(attributesContainer);
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+
+ IAjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component component) {
+ return "if (!confirm('" + getString("confirmDelete") + "')) return false;";
+ }
+ };
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
+ }
+ });
+
+ final DropDownChoice<String> schemaChoice = new DropDownChoice<String>("schema",
+ new PropertyModel<String>(attributeTO, "schema"), derSchemas);
+ schemaChoice.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ attributeTO.setSchema(schemaChoice.getModelObject());
+ }
+ });
+ schemaChoice.setRequired(true);
+ schemaChoice.setOutputMarkupId(true);
+ schemaChoice.setRequired(true);
+ item.add(schemaChoice);
+
+ final List<String> values = attributeTO.getValues();
+ if (values == null || values.isEmpty()) {
+ item.add(new TextField<String>("value",
+ new Model<String>(null)).setVisible(false));
+ } else {
+ item.add(new TextField<String>("value",
+ new Model<String>(values.get(0))).setEnabled(false));
+ }
+ }
+ };
+ attributesContainer.add(attributes);
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if ((event.getPayload() instanceof RoleAttrTemplatesChange)) {
+ final RoleAttrTemplatesChange update = (RoleAttrTemplatesChange) event.getPayload();
+ if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.rDerAttrTemplates) {
+ update.getTarget().add(this);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/EventSelectionPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/EventSelectionPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/EventSelectionPanel.java
new file mode 100644
index 0000000..5332cb5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/EventSelectionPanel.java
@@ -0,0 +1,243 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.wicket.markup.html.list.AltListView;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.types.AuditElements;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.CheckGroupSelector;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class EventSelectionPanel extends Panel {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(EventSelectionPanel.class);
+
+ private static final long serialVersionUID = 752233163798301002L;
+
+ private final Set<String> selected = new HashSet<String>();
+
+ public EventSelectionPanel(
+ final String id, final EventCategoryTO eventCategoryTO, final IModel<List<String>> model) {
+ super(id);
+ setOutputMarkupId(true);
+
+ final List<String> events = getEvents(eventCategoryTO);
+
+ // needed to avoid model reset: model have to be managed into SelectedEventsPanel
+ selected.addAll(model.getObject());
+
+ final CheckGroup<String> successGroup = new CheckGroup<String>(
+ "successGroup",
+ selected);
+
+ successGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+
+ private static final long serialVersionUID = -151291731388673682L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+
+ final Set<String> toBeRemoved = new HashSet<>();
+ final Set<String> toBeAdded = new HashSet<>();
+
+ for (String event : getEvents(eventCategoryTO)) {
+ final String eventString = AuditLoggerName.buildEvent(
+ eventCategoryTO.getType(),
+ eventCategoryTO.getCategory(),
+ eventCategoryTO.getSubcategory(),
+ event,
+ AuditElements.Result.SUCCESS);
+
+ if (successGroup.getModelObject().contains(eventString)) {
+ toBeAdded.add(eventString);
+ } else {
+ toBeRemoved.add(eventString);
+ }
+ }
+
+ send(EventSelectionPanel.this.getPage(), Broadcast.BREADTH,
+ new SelectedEventsPanel.EventSelectionChanged(target, toBeAdded, toBeRemoved));
+ }
+ });
+
+ successGroup.setVisible(!events.isEmpty());
+ add(successGroup);
+
+ add(new Label("successLabel", new ResourceModel("Success", "Success"))).setVisible(!events.isEmpty());
+
+ final CheckGroupSelector successSelector = new CheckGroupSelector("successSelector", successGroup);
+ successSelector.setVisible(!events.isEmpty());
+ add(successSelector);
+
+ final ListView<String> categoryView = new AltListView<String>("categoryView", events) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ final String subcategory = item.getModelObject();
+
+ item.add(new Label("subcategory", new ResourceModel(subcategory, subcategory)));
+ }
+ };
+ add(categoryView);
+
+ final ListView<String> successView = new AltListView<String>("successView", events) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ final String event = item.getModelObject();
+
+ final Check<String> successCheck = new Check<>("successCheck",
+ new Model<String>(AuditLoggerName.buildEvent(
+ eventCategoryTO.getType(),
+ eventCategoryTO.getCategory(),
+ eventCategoryTO.getSubcategory(),
+ event,
+ AuditElements.Result.SUCCESS)),
+ successGroup);
+ item.add(successCheck);
+ }
+ };
+ successGroup.add(successView);
+
+ final CheckGroup<String> failureGroup = new CheckGroup<String>(
+ "failureGroup",
+ selected);
+
+ failureGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+
+ private static final long serialVersionUID = -151291731388673682L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+
+ final Set<String> toBeRemoved = new HashSet<>();
+ final Set<String> toBeAdded = new HashSet<>();
+
+ for (String event : getEvents(eventCategoryTO)) {
+ final String eventString = AuditLoggerName.buildEvent(
+ eventCategoryTO.getType(),
+ eventCategoryTO.getCategory(),
+ eventCategoryTO.getSubcategory(),
+ event,
+ AuditElements.Result.FAILURE);
+
+ if (failureGroup.getModelObject().contains(eventString)) {
+ toBeAdded.add(eventString);
+ } else {
+ toBeRemoved.add(eventString);
+ }
+ }
+
+ send(EventSelectionPanel.this.getPage(), Broadcast.BREADTH,
+ new SelectedEventsPanel.EventSelectionChanged(target, toBeAdded, toBeRemoved));
+ }
+ });
+
+ failureGroup.setVisible(!events.isEmpty());
+ add(failureGroup);
+
+ add(new Label("failureLabel", new ResourceModel("Failure", "Failure"))).setVisible(!events.isEmpty());
+
+ final CheckGroupSelector failureSelector = new CheckGroupSelector("failureSelector", failureGroup);
+ failureSelector.setVisible(!events.isEmpty());
+ add(failureSelector);
+
+ final ListView<String> failureView = new AltListView<String>("failureView", events) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ final String event = item.getModelObject();
+
+ final Check<String> failureCheck = new Check<>("failureCheck",
+ new Model<String>(AuditLoggerName.buildEvent(
+ eventCategoryTO.getType(),
+ eventCategoryTO.getCategory(),
+ eventCategoryTO.getSubcategory(),
+ event,
+ AuditElements.Result.FAILURE)),
+ failureGroup);
+ item.add(failureCheck);
+ }
+ };
+ failureGroup.add(failureView);
+ }
+
+ private List<String> getEvents(final EventCategoryTO eventCategoryTO) {
+ final List<String> res;
+
+ res = eventCategoryTO.getEvents();
+
+ if (res.isEmpty()) {
+ if ((AuditElements.EventCategoryType.PROPAGATION == eventCategoryTO.getType()
+ || AuditElements.EventCategoryType.SYNCHRONIZATION == eventCategoryTO.getType()
+ || AuditElements.EventCategoryType.PUSH == eventCategoryTO.getType())
+ && StringUtils.isEmpty(eventCategoryTO.getCategory())) {
+ res.add(eventCategoryTO.getType().toString());
+ } else if (AuditElements.EventCategoryType.TASK == eventCategoryTO.getType()
+ && StringUtils.isNotEmpty(eventCategoryTO.getCategory())) {
+ res.add(eventCategoryTO.getCategory());
+ }
+ } else {
+ Collections.sort(res);
+ }
+
+ return res;
+ }
+
+ /**
+ * To be extended in order to add actions on events.
+ *
+ * @param event event.
+ */
+ protected abstract void onEventAction(final IEvent<?> event);
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ onEventAction(event);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
new file mode 100644
index 0000000..b0b3d9a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ImagePanel.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.panel.Panel;
+
+public class ImagePanel extends Panel {
+
+ private static final long serialVersionUID = 5564818820574092960L;
+
+ final Image img;
+
+ public ImagePanel(final String id, final String img) {
+ super(id);
+ this.img = new Image("img", img);
+ add(this.img);
+ }
+
+ @Override
+ public Component add(final Behavior... behaviors) {
+ this.img.add(behaviors);
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.java
new file mode 100644
index 0000000..d898ba6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/JQueryUITabbedPanel.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.List;
+import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
+import org.apache.wicket.extensions.markup.html.tabs.ITab;
+
+/**
+ * AjaxTabbedPanel with JQueryUI styling.
+ */
+public class JQueryUITabbedPanel<T extends ITab> extends AjaxTabbedPanel<T> {
+
+ private static final long serialVersionUID = -5059184710433341333L;
+
+ public JQueryUITabbedPanel(final String id, final List<T> tabs) {
+ super(id, tabs);
+ }
+
+ @Override
+ protected String getTabContainerCssClass() {
+ return "";
+ }
+
+ @Override
+ protected String getSelectedTabCssClass() {
+ return "ui-state-active selected";
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
new file mode 100644
index 0000000..a68d8cd
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LayoutsPanel.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.List;
+import org.apache.syncope.client.console.commons.AttrLayoutType;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.rest.ConfigurationRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LayoutsPanel extends Panel {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(LayoutsPanel.class);
+
+ private static final long serialVersionUID = -6804066913177804275L;
+
+ private static final String CANCEL = "cancel";
+
+ private static final String APPLY = "apply";
+
+ @SpringBean
+ protected XMLRolesReader xmlRolesReader;
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ private ConfigurationRestClient confRestClient;
+
+ @SuppressWarnings("unchecked")
+ public LayoutsPanel(final String id, final AttrLayoutType attrLayoutType, final NotificationPanel feedbackPanel) {
+ super(id);
+
+ final WebMarkupContainer container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+
+ final Form<String> form = new Form<String>("form");
+ form.setOutputMarkupId(true);
+
+ final AttrTO attrLayout = confRestClient.readAttrLayout(attrLayoutType);
+ form.setModel(new CompoundPropertyModel(attrLayout.getValues()));
+
+ final List<String> fields = schemaRestClient.getSchemaNames(attrLayoutType.getAttrType());
+ final ListModel<String> selectedFields =
+ new ListModel<String>(attrLayout.getValues().isEmpty() ? fields : attrLayout.getValues());
+ final ListModel<String> availableFields = new ListModel<String>(fields);
+
+ form.add(new AjaxPalettePanel<String>("fields", selectedFields, availableFields,
+ new SelectChoiceRenderer<String>(), true, true));
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(APPLY)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ confRestClient.set(attrLayout);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (Exception e) {
+ LOG.error("While saving layout configuration", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ }
+ feedbackPanel.refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ error(getString(Constants.ERROR) + ": While saving layout configuration");
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ form.add(submit);
+
+ final IndicatingAjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ target.add(container);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+ container.add(form);
+ add(container);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LoggerCategoryPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LoggerCategoryPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LoggerCategoryPanel.java
new file mode 100644
index 0000000..aa3c3eb
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/LoggerCategoryPanel.java
@@ -0,0 +1,468 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.SelectedEventsPanel.EventSelectionChanged;
+import org.apache.syncope.client.console.panels.SelectedEventsPanel.InspectSelectedEvent;
+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.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.types.AuditElements;
+import org.apache.syncope.common.lib.types.AuditElements.EventCategoryType;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+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.basic.Label;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class LoggerCategoryPanel extends Panel {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(LoggerCategoryPanel.class);
+
+ private static final long serialVersionUID = 6429053774964787734L;
+
+ private final List<EventCategoryTO> eventCategoryTOs;
+
+ private final EventCategoryTO eventCategoryTO = new EventCategoryTO();
+
+ private final WebMarkupContainer categoryContainer;
+
+ private final WebMarkupContainer eventsContainer;
+
+ private final SelectedEventsPanel selectedEventsPanel;
+
+ private final AjaxDropDownChoicePanel<EventCategoryType> type;
+
+ private final AjaxDropDownChoicePanel<String> category;
+
+ private final AjaxDropDownChoicePanel<String> subcategory;
+
+ private final AjaxTextFieldPanel custom;
+
+ private final ActionLinksPanel actionPanel;
+
+ private final IModel<List<String>> model;
+
+ public LoggerCategoryPanel(
+ final String id,
+ final List<EventCategoryTO> eventCategoryTOs,
+ final IModel<List<String>> model,
+ final PageReference pageReference,
+ final String pageId) {
+ super(id);
+
+ this.model = model;
+ selectedEventsPanel = new SelectedEventsPanel("selectedEventsPanel", model);
+ add(selectedEventsPanel);
+
+ this.eventCategoryTOs = eventCategoryTOs;
+
+ categoryContainer = new WebMarkupContainer("categoryContainer");
+ categoryContainer.setOutputMarkupId(true);
+ add(categoryContainer);
+
+ eventsContainer = new WebMarkupContainer("eventsContainer");
+ eventsContainer.setOutputMarkupId(true);
+ add(eventsContainer);
+
+ authorizeList();
+ authorizeChanges();
+
+ categoryContainer.add(new Label("typeLabel", new ResourceModel("type", "type")));
+
+ type = new AjaxDropDownChoicePanel<EventCategoryType>(
+ "type",
+ "type",
+ new PropertyModel<EventCategoryType>(eventCategoryTO, "type"),
+ false);
+ type.setChoices(Arrays.asList(EventCategoryType.values()));
+ type.setStyleSheet("ui-widget-content ui-corner-all");
+ type.setChoiceRenderer(new IChoiceRenderer<EventCategoryType>() {
+
+ private static final long serialVersionUID = 2317134950949778735L;
+
+ @Override
+ public String getDisplayValue(final EventCategoryType eventCategoryType) {
+ return eventCategoryType.name();
+ }
+
+ @Override
+ public String getIdValue(final EventCategoryType eventCategoryType, final int i) {
+ return eventCategoryType.name();
+ }
+ });
+ categoryContainer.add(type);
+
+ type.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(LoggerCategoryPanel.this, Broadcast.EXACT, new ChangeCategoryEvent(target, type));
+ }
+ });
+
+ categoryContainer.add(new Label("categoryLabel", new ResourceModel("category", "category")));
+
+ category = new AjaxDropDownChoicePanel<String>(
+ "category",
+ "category",
+ new PropertyModel<String>(eventCategoryTO, "category"),
+ false);
+ category.setChoices(filter(eventCategoryTOs, type.getModelObject()));
+ category.setStyleSheet("ui-widget-content ui-corner-all");
+ categoryContainer.add(category);
+
+ category.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306811L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(LoggerCategoryPanel.this, Broadcast.EXACT, new ChangeCategoryEvent(target, category));
+ }
+ });
+
+ categoryContainer.add(new Label("subcategoryLabel", new ResourceModel("subcategory", "subcategory")));
+
+ subcategory = new AjaxDropDownChoicePanel<String>(
+ "subcategory",
+ "subcategory",
+ new PropertyModel<String>(eventCategoryTO, "subcategory"),
+ false);
+ subcategory.setChoices(filter(eventCategoryTOs, type.getModelObject(), category.getModelObject()));
+ subcategory.setStyleSheet("ui-widget-content ui-corner-all");
+ categoryContainer.add(subcategory);
+
+ subcategory.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306812L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(LoggerCategoryPanel.this, Broadcast.EXACT, new ChangeCategoryEvent(target, subcategory));
+ }
+ });
+
+ categoryContainer.add(new Label("customLabel", new ResourceModel("custom", "custom")).setVisible(false));
+
+ custom = new AjaxTextFieldPanel("custom", "custom", new Model<String>(null));
+ custom.setStyleSheet("ui-widget-content ui-corner-all short_fixedsize");
+ custom.setVisible(false);
+ custom.setEnabled(false);
+
+ categoryContainer.add(custom);
+
+ actionPanel = new ActionLinksPanel("customActions", new Model(), pageReference);
+ categoryContainer.add(actionPanel);
+
+ actionPanel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (StringUtils.isNotBlank(custom.getModelObject())) {
+ final Map.Entry<EventCategoryTO, AuditElements.Result> parsed =
+ AuditLoggerName.parseEventCategory(custom.getModelObject());
+
+ final String eventString = AuditLoggerName.buildEvent(
+ parsed.getKey().getType(),
+ null,
+ null,
+ parsed.getKey().getEvents().isEmpty()
+ ? StringUtils.EMPTY : parsed.getKey().getEvents().iterator().next(),
+ parsed.getValue());
+
+ custom.setModelObject(StringUtils.EMPTY);
+ send(LoggerCategoryPanel.this.getPage(), Broadcast.BREADTH, new EventSelectionChanged(
+ target,
+ Collections.<String>singleton(eventString),
+ Collections.<String>emptySet()));
+ target.add(categoryContainer);
+ }
+ }
+ }, ActionLink.ActionType.CREATE, pageId, true);
+
+ actionPanel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435502L;
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ if (StringUtils.isNotBlank(custom.getModelObject())) {
+ final Map.Entry<EventCategoryTO, AuditElements.Result> parsed =
+ AuditLoggerName.parseEventCategory(custom.getModelObject());
+
+ final String eventString = AuditLoggerName.buildEvent(
+ parsed.getKey().getType(),
+ null,
+ null,
+ parsed.getKey().getEvents().isEmpty()
+ ? StringUtils.EMPTY : parsed.getKey().getEvents().iterator().next(),
+ parsed.getValue());
+
+ custom.setModelObject(StringUtils.EMPTY);
+ send(LoggerCategoryPanel.this.getPage(), Broadcast.BREADTH, new EventSelectionChanged(
+ target,
+ Collections.<String>emptySet(),
+ Collections.<String>singleton(eventString)));
+ target.add(categoryContainer);
+ }
+ }
+ }, ActionLink.ActionType.DELETE, pageId, true);
+
+ actionPanel.setVisible(false);
+ actionPanel.setEnabled(false);
+
+ eventsContainer.add(new EventSelectionPanel("eventsPanel", eventCategoryTO, model) {
+
+ private static final long serialVersionUID = 3513194801190026082L;
+
+ @Override
+ protected void onEventAction(final IEvent<?> event) {
+ LoggerCategoryPanel.this.onEventAction(event);
+ }
+ });
+ }
+
+ private List<String> filter(
+ final List<EventCategoryTO> eventCategoryTOs, final EventCategoryType type) {
+ final Set<String> res = new HashSet<String>();
+
+ for (EventCategoryTO eventCategory : eventCategoryTOs) {
+ if (type == eventCategory.getType() && StringUtils.isNotEmpty(eventCategory.getCategory())) {
+ res.add(eventCategory.getCategory());
+ }
+ }
+
+ final List<String> filtered = new ArrayList<String>(res);
+ Collections.sort(filtered);
+ return filtered;
+ }
+
+ private List<String> filter(
+ final List<EventCategoryTO> eventCategoryTOs, final EventCategoryType type, final String category) {
+ final Set<String> res = new HashSet<String>();
+
+ for (EventCategoryTO eventCategory : eventCategoryTOs) {
+ if (type == eventCategory.getType() && StringUtils.equals(category, eventCategory.getCategory())
+ && StringUtils.isNotEmpty(eventCategory.getSubcategory())) {
+ res.add(eventCategory.getSubcategory());
+ }
+ }
+
+ final List<String> filtered = new ArrayList<String>(res);
+ Collections.sort(filtered);
+ return filtered;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof ChangeCategoryEvent) {
+ // update objects ....
+ eventCategoryTO.getEvents().clear();
+
+ final ChangeCategoryEvent change = (ChangeCategoryEvent) event.getPayload();
+
+ final Panel changedPanel = change.getChangedPanel();
+ if ("type".equals(changedPanel.getId())) {
+ eventCategoryTO.setType(type.getModelObject());
+ eventCategoryTO.setCategory(null);
+ eventCategoryTO.setSubcategory(null);
+
+ if (type.getModelObject() == EventCategoryType.CUSTOM) {
+ category.setChoices(Collections.<String>emptyList());
+ subcategory.setChoices(Collections.<String>emptyList());
+ category.setEnabled(false);
+ subcategory.setEnabled(false);
+ custom.setVisible(true);
+ custom.setEnabled(true);
+ actionPanel.setVisible(true);
+ actionPanel.setEnabled(true);
+
+ } else {
+ category.setChoices(filter(eventCategoryTOs, type.getModelObject()));
+ subcategory.setChoices(Collections.<String>emptyList());
+ category.setEnabled(true);
+ subcategory.setEnabled(true);
+ custom.setVisible(false);
+ custom.setEnabled(false);
+ actionPanel.setVisible(false);
+ actionPanel.setEnabled(false);
+ }
+ change.getTarget().add(categoryContainer);
+ } else if ("category".equals(changedPanel.getId())) {
+ subcategory.setChoices(filter(eventCategoryTOs, type.getModelObject(), category.getModelObject()));
+ eventCategoryTO.setCategory(category.getModelObject());
+ eventCategoryTO.setSubcategory(null);
+ change.getTarget().add(categoryContainer);
+ } else {
+ eventCategoryTO.setSubcategory(subcategory.getModelObject());
+ }
+
+ updateEventsContainer(change.getTarget());
+ } else if (event.getPayload() instanceof InspectSelectedEvent) {
+ // update objects ....
+ eventCategoryTO.getEvents().clear();
+
+ final InspectSelectedEvent inspectSelectedEvent = (InspectSelectedEvent) event.getPayload();
+
+ final Map.Entry<EventCategoryTO, AuditElements.Result> categoryEvent =
+ AuditLoggerName.parseEventCategory(inspectSelectedEvent.getEvent());
+
+ eventCategoryTO.setType(categoryEvent.getKey().getType());
+ category.setChoices(filter(eventCategoryTOs, type.getModelObject()));
+
+ eventCategoryTO.setCategory(categoryEvent.getKey().getCategory());
+ subcategory.setChoices(filter(eventCategoryTOs, type.getModelObject(), category.getModelObject()));
+
+ eventCategoryTO.setSubcategory(categoryEvent.getKey().getSubcategory());
+
+ if (categoryEvent.getKey().getType() == EventCategoryType.CUSTOM) {
+ custom.setModelObject(AuditLoggerName.buildEvent(
+ categoryEvent.getKey().getType(),
+ categoryEvent.getKey().getCategory(),
+ categoryEvent.getKey().getSubcategory(),
+ categoryEvent.getKey().getEvents().isEmpty()
+ ? StringUtils.EMPTY : categoryEvent.getKey().getEvents().iterator().next(),
+ categoryEvent.getValue()));
+
+ category.setEnabled(false);
+ subcategory.setEnabled(false);
+ custom.setVisible(true);
+ custom.setEnabled(true);
+ actionPanel.setVisible(true);
+ actionPanel.setEnabled(true);
+ } else {
+ category.setEnabled(true);
+ subcategory.setEnabled(true);
+ custom.setVisible(false);
+ custom.setEnabled(false);
+ actionPanel.setVisible(false);
+ actionPanel.setEnabled(false);
+ }
+
+ inspectSelectedEvent.getTarget().add(categoryContainer);
+ updateEventsContainer(inspectSelectedEvent.getTarget());
+ }
+ }
+
+ private void setEvents() {
+ final Iterator<EventCategoryTO> itor = eventCategoryTOs.iterator();
+ while (itor.hasNext() && eventCategoryTO.getEvents().isEmpty()) {
+ final EventCategoryTO eventCategory = itor.next();
+ if (eventCategory.getType() == eventCategoryTO.getType()
+ && StringUtils.equals(eventCategory.getCategory(), eventCategoryTO.getCategory())
+ && StringUtils.equals(eventCategory.getSubcategory(), eventCategoryTO.getSubcategory())) {
+ eventCategoryTO.getEvents().addAll(eventCategory.getEvents());
+ }
+ }
+ }
+
+ private class ChangeCategoryEvent {
+
+ private final AjaxRequestTarget target;
+
+ private final Panel changedPanel;
+
+ public ChangeCategoryEvent(final AjaxRequestTarget target, final Panel changedPanel) {
+ this.target = target;
+ this.changedPanel = changedPanel;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public Panel getChangedPanel() {
+ return changedPanel;
+ }
+ }
+
+ /**
+ * To be extended in order to add actions on events.
+ *
+ * @param event event.
+ */
+ protected void onEventAction(final IEvent<?> event) {
+ // nothing by default
+ }
+
+ private void authorizeList() {
+ for (String role : getListRoles()) {
+ MetaDataRoleAuthorizationStrategy.authorize(selectedEventsPanel, RENDER, role);
+ }
+ }
+
+ private void authorizeChanges() {
+ for (String role : getChangeRoles()) {
+ MetaDataRoleAuthorizationStrategy.authorize(categoryContainer, RENDER, role);
+ MetaDataRoleAuthorizationStrategy.authorize(eventsContainer, RENDER, role);
+ }
+ }
+
+ private void updateEventsContainer(final AjaxRequestTarget target) {
+ setEvents();
+
+ eventsContainer.addOrReplace(new EventSelectionPanel("eventsPanel", eventCategoryTO, model) {
+
+ private static final long serialVersionUID = 3513194801190026082L;
+
+ @Override
+ public void onEventAction(final IEvent<?> event) {
+ LoggerCategoryPanel.this.onEventAction(event);
+ }
+ });
+ target.add(eventsContainer);
+ }
+
+ protected abstract String[] getListRoles();
+
+ protected abstract String[] getChangeRoles();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/MembershipsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/MembershipsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/MembershipsPanel.java
new file mode 100644
index 0000000..fb00dcf
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/MembershipsPanel.java
@@ -0,0 +1,256 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.commons.RoleTreeBuilder;
+import org.apache.syncope.client.console.commons.RoleUtils;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
+import org.apache.syncope.client.console.pages.MembershipModalPage;
+import org.apache.syncope.client.console.pages.UserModalPage;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.IndicatingOnConfirmAjaxLink;
+import org.apache.syncope.client.console.wicket.markup.html.tree.DefaultMutableTreeNodeExpansion;
+import org.apache.syncope.client.console.wicket.markup.html.tree.DefaultMutableTreeNodeExpansionModel;
+import org.apache.syncope.client.console.wicket.markup.html.tree.TreeRoleProvider;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.tree.DefaultNestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.ITreeProvider;
+import org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder;
+import org.apache.wicket.extensions.markup.html.repeater.tree.theme.WindowsTheme;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class MembershipsPanel extends Panel {
+
+ private static final long serialVersionUID = -2559791301973107191L;
+
+ @SpringBean
+ private RoleTreeBuilder roleTreeBuilder;
+
+ private final ListView<MembershipTO> membView;
+
+ private final UserTO userTO;
+
+ private final StatusPanel statusPanel;
+
+ private final NestedTree<DefaultMutableTreeNode> tree;
+
+ public MembershipsPanel(final String id, final UserTO userTO, final Mode mode,
+ final StatusPanel statusPanel, final PageReference pageRef) {
+
+ super(id);
+ this.userTO = userTO;
+ this.statusPanel = statusPanel;
+
+ final WebMarkupContainer membershipsContainer = new WebMarkupContainer("membershipsContainer");
+ membershipsContainer.setOutputMarkupId(true);
+ add(membershipsContainer);
+
+ final ModalWindow membWin = new ModalWindow("membershipWin");
+ membWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ membWin.setCookieName("create-membership-modal");
+ add(membWin);
+
+ final ITreeProvider<DefaultMutableTreeNode> treeProvider = new TreeRoleProvider(roleTreeBuilder, true);
+ final DefaultMutableTreeNodeExpansionModel treeModel = new DefaultMutableTreeNodeExpansionModel();
+
+ tree = new DefaultNestedTree<DefaultMutableTreeNode>("treeTable", treeProvider, treeModel) {
+
+ private static final long serialVersionUID = 7137658050662575546L;
+
+ @Override
+ protected Component newContentComponent(final String id, final IModel<DefaultMutableTreeNode> node) {
+ final DefaultMutableTreeNode treeNode = node.getObject();
+ final RoleTO roleTO = (RoleTO) treeNode.getUserObject();
+
+ return new Folder<DefaultMutableTreeNode>(id, MembershipsPanel.this.tree, node) {
+
+ private static final long serialVersionUID = 9046323319920426493L;
+
+ @Override
+ protected boolean isClickable() {
+ return true;
+ }
+
+ @Override
+ protected IModel<?> newLabelModel(final IModel<DefaultMutableTreeNode> model) {
+ return new Model<String>(roleTO.getDisplayName());
+ }
+
+ @Override
+ protected void onClick(final AjaxRequestTarget target) {
+ if (roleTO.getKey() > 0) {
+ membWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = 7661763358801821185L;
+
+ @Override
+ public Page createPage() {
+ PageReference pageRef = getPage().getPageReference();
+
+ for (MembershipTO membTO : membView.getList()) {
+ if (membTO.getRoleId() == roleTO.getKey()) {
+ return new MembershipModalPage(pageRef, membWin, membTO, mode);
+ }
+ }
+ MembershipTO membTO = new MembershipTO();
+ membTO.setRoleId(roleTO.getKey());
+ membTO.setRoleName(roleTO.getName());
+
+ return new MembershipModalPage(pageRef, membWin, membTO, mode);
+ }
+ });
+ membWin.show(target);
+ }
+ }
+ };
+ }
+ };
+ tree.add(new WindowsTheme());
+ tree.setOutputMarkupId(true);
+
+ DefaultMutableTreeNodeExpansion.get().expandAll();
+
+ this.add(tree);
+
+ membView = new ListView<MembershipTO>("memberships",
+ new PropertyModel<List<? extends MembershipTO>>(userTO, "memberships")) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(final ListItem<MembershipTO> item) {
+ final MembershipTO membershipTO = (MembershipTO) item.getDefaultModelObject();
+
+ item.add(new Label("roleId", new Model<Long>(membershipTO.getRoleId())));
+ item.add(new Label("roleName", new Model<String>(membershipTO.getRoleName())));
+
+ AjaxLink editLink = new ClearIndicatingAjaxLink("editLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ membWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new MembershipModalPage(getPage().getPageReference(), membWin,
+ membershipTO, mode);
+
+ }
+ });
+ membWin.show(target);
+ }
+ };
+ item.add(editLink);
+
+ AjaxLink deleteLink = new IndicatingOnConfirmAjaxLink("deleteLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ userTO.getMemberships().remove(membershipTO);
+ ((UserModalPage) getPage()).getUserTO().getMemberships().remove(membershipTO);
+ target.add(membershipsContainer);
+
+ RoleTO roleTO = RoleUtils.findRole(roleTreeBuilder, membershipTO.getRoleId());
+ Set<String> resourcesToRemove = roleTO == null
+ ? Collections.<String>emptySet() : roleTO.getResources();
+ if (!resourcesToRemove.isEmpty()) {
+ Set<String> resourcesAssignedViaMembership = new HashSet<String>();
+ for (MembershipTO membTO : userTO.getMemberships()) {
+ roleTO = RoleUtils.findRole(roleTreeBuilder, membTO.getRoleId());
+ if (roleTO != null) {
+ resourcesAssignedViaMembership.addAll(roleTO.getResources());
+ }
+ }
+ resourcesToRemove.removeAll(resourcesAssignedViaMembership);
+ resourcesToRemove.removeAll(userTO.getResources());
+ }
+
+ StatusUtils.update(
+ userTO, statusPanel, target, Collections.<String>emptySet(), resourcesToRemove);
+ }
+ };
+ item.add(deleteLink);
+ }
+ };
+
+ membershipsContainer.add(membView);
+
+ setWindowClosedCallback(membWin, membershipsContainer);
+ }
+
+ private void setWindowClosedCallback(final ModalWindow window, final WebMarkupContainer container) {
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ final UserTO updatedUserTO = ((UserModalPage) getPage()).getUserTO();
+ if (!userTO.equals(updatedUserTO)) {
+ if (updatedUserTO.getMemberships().size() > userTO.getMemberships().size()) {
+ Set<Long> diff = new HashSet<Long>(updatedUserTO.getMembershipMap().keySet());
+ diff.removeAll(userTO.getMembershipMap().keySet());
+
+ Set<String> resourcesToAdd = new HashSet<String>();
+ for (Long diffMembId : diff) {
+ long roleId = updatedUserTO.getMembershipMap().get(diffMembId).getRoleId();
+ RoleTO roleTO = RoleUtils.findRole(roleTreeBuilder, roleId);
+ resourcesToAdd.addAll(roleTO.getResources());
+ StatusUtils.update(
+ userTO, statusPanel, target, resourcesToAdd, Collections.<String>emptySet());
+ }
+ }
+
+ MembershipsPanel.this.userTO.getMemberships().clear();
+ MembershipsPanel.this.userTO.getMemberships().addAll(updatedUserTO.getMemberships());
+ target.add(container);
+ }
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationPanel.java
new file mode 100644
index 0000000..8624d26
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationPanel.java
@@ -0,0 +1,119 @@
+/*
+ * 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.commons.Constants;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.feedback.FeedbackMessage;
+import org.apache.wicket.feedback.IFeedbackMessageFilter;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.Model;
+
+public class NotificationPanel extends FeedbackPanel {
+
+ private static final long serialVersionUID = 5895940553202128621L;
+
+ private static final String CSS_CLASS = "notificationpanel";
+
+ private static final String DEFAULT_ADDITIONAL_CSS_CLASS = "notificationpanel_top_right";
+
+ private final String additionalCSSClass;
+
+ public NotificationPanel(final String id) {
+ this(id, null, null);
+ }
+
+ public NotificationPanel(final String id, final String additionalCSSClass,
+ final IFeedbackMessageFilter feedbackMessageFilter) {
+
+ super(id, feedbackMessageFilter);
+
+ this.add(new AjaxEventBehavior(Constants.ON_CLICK) {
+
+ private static final long serialVersionUID = -7133385027739964990L;
+
+ @Override
+ protected void onEvent(final AjaxRequestTarget target) {
+ target.appendJavaScript(
+ "setTimeout(\"$('div#" + getMarkupId() + "').fadeOut('normal')\", 0);");
+ }
+ });
+
+ this.additionalCSSClass = StringUtils.isBlank(additionalCSSClass)
+ ? DEFAULT_ADDITIONAL_CSS_CLASS
+ : additionalCSSClass;
+
+ // set custom markup id and ouput it, to find the component later on in the js function
+ setMarkupId(id);
+ setOutputMarkupId(true);
+
+ // Add the additional cssClass and hide the element by default
+ add(new AttributeModifier("class", new Model<String>(CSS_CLASS + " " + this.additionalCSSClass)));
+ add(new AttributeModifier("style", new Model<String>("opacity: 0;")));
+ }
+
+ /**
+ * Method to refresh the notification panel.
+ *
+ * If there are any feedback messages for the user, find the gravest level, format the notification panel
+ * accordingly and show it.
+ *
+ * @param target AjaxRequestTarget to add panel and the calling javascript function
+ */
+ public void refresh(final AjaxRequestTarget target) {
+ // any feedback at all in the current form?
+ if (anyMessage()) {
+ int highestFeedbackLevel = FeedbackMessage.INFO;
+
+ // any feedback with the given level?
+ if (anyMessage(FeedbackMessage.WARNING)) {
+ highestFeedbackLevel = FeedbackMessage.WARNING;
+ }
+ if (anyMessage(FeedbackMessage.ERROR)) {
+ highestFeedbackLevel = FeedbackMessage.ERROR;
+ }
+
+ // add the css classes to the notification panel,
+ // including the border css which represents the highest level of feedback
+ add(new AttributeModifier("class",
+ new Model<String>(CSS_CLASS
+ + " " + additionalCSSClass
+ + " notificationpanel_border_" + highestFeedbackLevel)));
+
+ // refresh the panel and call the js function with the panel markup id
+ // and the total count of messages
+ target.add(this);
+ if (anyMessage(FeedbackMessage.ERROR)) {
+ target.appendJavaScript(
+ "$('div#" + getMarkupId() + "').fadeTo('normal', 1.0);");
+ } else {
+ target.appendJavaScript(
+ "showNotification('" + getMarkupId() + "', " + getCurrentMessages().size() + ");");
+ }
+ }
+ }
+
+ @Override
+ protected String getCSSClass(final FeedbackMessage message) {
+ return "notificationpanel_row_" + message.getLevelAsString();
+ }
+}
[15/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/log4j2.xml b/syncope620/fit/reference/src/main/resources/log4j2.xml
deleted file mode 100644
index 0ed8903..0000000
--- a/syncope620/fit/reference/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<configuration status="WARN">
-
- <appenders>
-
- <RollingRandomAccessFile name="main" fileName="${log.directory}/server.log"
- filePattern="${log.directory}/server-%d{yyyy-MM-dd}.log.gz"
- immediateFlush="false" append="true">
- <PatternLayout>
- <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
- </PatternLayout>
- <Policies>
- <TimeBasedTriggeringPolicy/>
- <SizeBasedTriggeringPolicy size="250 MB"/>
- </Policies>
- </RollingRandomAccessFile>
-
- <RollingRandomAccessFile name="persistence" fileName="${log.directory}/server-persistence.log"
- filePattern="${log.directory}/server-persistence-%d{yyyy-MM-dd}.log.gz"
- immediateFlush="false" append="true">
- <PatternLayout>
- <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
- </PatternLayout>
- <Policies>
- <TimeBasedTriggeringPolicy/>
- <SizeBasedTriggeringPolicy size="250 MB"/>
- </Policies>
- </RollingRandomAccessFile>
-
- <RollingRandomAccessFile name="rest" fileName="${log.directory}/server-rest.log"
- filePattern="${log.directory}/server-rest-%d{yyyy-MM-dd}.log.gz"
- immediateFlush="false" append="true">
- <PatternLayout>
- <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
- </PatternLayout>
- <Policies>
- <TimeBasedTriggeringPolicy/>
- <SizeBasedTriggeringPolicy size="250 MB"/>
- </Policies>
- </RollingRandomAccessFile>
-
- <RollingRandomAccessFile name="connid" fileName="${log.directory}/server-connid.log"
- filePattern="${log.directory}/server-connid-%d{yyyy-MM-dd}.log.gz"
- immediateFlush="false" append="true">
- <PatternLayout>
- <pattern>%d{HH:mm:ss.SSS} %-5level %msg%n</pattern>
- </PatternLayout>
- <Policies>
- <TimeBasedTriggeringPolicy/>
- <SizeBasedTriggeringPolicy size="250 MB"/>
- </Policies>
- </RollingRandomAccessFile>
-
- <!-- Audit -->
- <Jdbc name="audit" tableName="SYNCOPEAUDIT">
- <ConnectionFactory class="org.apache.syncope.server.logic.audit.AuditConnectionFactory" method="getConnection"/>
- <Column name="EVENT_DATE" isEventTimestamp="true"/>
- <Column name="LOGGER_LEVEL" pattern="%level" isUnicode="false"/>
- <Column name="LOGGER" pattern="%logger" isUnicode="false"/>
- <Column name="MESSAGE" pattern="%message" isUnicode="false"/>
- <Column name="THROWABLE" pattern="%ex{full}" isUnicode="false"/>
- </Jdbc>
-
- </appenders>
-
- <loggers>
-
- <asyncLogger name="org.apache.syncope.server.persistence" additivity="false" level="INFO">
- <appender-ref ref="persistence"/>
- </asyncLogger>
- <asyncLogger name="org.springframework.orm" additivity="false" level="INFO">
- <appender-ref ref="persistence"/>
- </asyncLogger>
-
- <asyncLogger name="org.apache.syncope.server.rest" additivity="false" level="INFO">
- <appender-ref ref="rest"/>
- </asyncLogger>
- <asyncLogger name="org.springframework.web" additivity="false" level="INFO">
- <appender-ref ref="rest"/>
- </asyncLogger>
- <asyncLogger name="org.apache.http" additivity="false" level="INFO">
- <appender-ref ref="rest"/>
- </asyncLogger>
- <asyncLogger name="org.apache.cxf" additivity="false" level="ERROR">
- <appender-ref ref="rest"/>
- </asyncLogger>
-
- <asyncLogger name="org.identityconnectors" additivity="false" level="DEBUG">
- <appender-ref ref="connid"/>
- </asyncLogger>
- <asyncLogger name="net.tirasa.connid" additivity="false" level="DEBUG">
- <appender-ref ref="connid"/>
- </asyncLogger>
- <asyncLogger name="org.apache.syncope.server.provisioning.api.ConnIdBundleManager" additivity="false" level="INFO">
- <appender-ref ref="connid"/>
- </asyncLogger>
-
- <asyncLogger name="org.apache.syncope.server.provisioning" additivity="false" level="INFO">
- <appender-ref ref="main"/>
- </asyncLogger>
- <asyncLogger name="org.springframework" additivity="false" level="INFO">
- <appender-ref ref="main"/>
- </asyncLogger>
- <asyncLogger name="org.apache.camel" additivity="false" level="ERROR">
- <appender-ref ref="main"/>
- </asyncLogger>
-
- <logger name="syncope.audit" additivity="false" level="DEBUG">
- <appender-ref ref="audit"/>
- </logger>
-
- <root level="INFO">
- <appender-ref ref="main"/>
- </root>
-
- </loggers>
-</configuration>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/logic.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/logic.properties b/syncope620/fit/reference/src/main/resources/logic.properties
deleted file mode 100644
index 2477c4b..0000000
--- a/syncope620/fit/reference/src/main/resources/logic.properties
+++ /dev/null
@@ -1,18 +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.
-attributableTransformer=org.apache.syncope.fit.server.reference.DoubleValueAttributableTransformer
-logicInvocationHandler=org.apache.syncope.server.logic.LogicInvocationHandler
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/provisioning.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/provisioning.properties b/syncope620/fit/reference/src/main/resources/provisioning.properties
deleted file mode 100644
index b0c8917..0000000
--- a/syncope620/fit/reference/src/main/resources/provisioning.properties
+++ /dev/null
@@ -1,19 +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.
-camel.directory=${conf.directory}
-userProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelUserProvisioningManager
-roleProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelRoleProvisioningManager
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/serverContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/serverContext.xml b/syncope620/fit/reference/src/main/resources/serverContext.xml
deleted file mode 100644
index 7bf75a1..0000000
--- a/syncope620/fit/reference/src/main/resources/serverContext.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="confDirectoryPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="order" value="1"/>
- <property name="ignoreResourceNotFound" value="true"/>
- <property name="ignoreUnresolvablePlaceholders" value="true"/>
- <property name="locations">
- <list>
- <value>file:${conf.directory}/persistence.properties</value>
- <value>file:${conf.directory}/security.properties</value>
- <value>file:${conf.directory}/connid.properties</value>
- <value>file:${conf.directory}/mail.properties</value>
- <value>file:${conf.directory}/logic.properties</value>
- <value>file:${conf.directory}/workflow.properties</value>
- <value>file:${conf.directory}/provisioning.properties</value>
- </list>
- </property>
- </bean>
- <bean id="classpathPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>classpath:persistence.properties</value>
- <value>classpath:security.properties</value>
- <value>classpath:connid.properties</value>
- <value>classpath:mail.properties</value>
- <value>classpath:logic.properties</value>
- <value>classpath:workflow.properties</value>
- <value>classpath:provisioning.properties</value>
- </list>
- </property>
- </bean>
-
- <bean class="org.apache.syncope.server.misc.spring.ApplicationContextProvider"/>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/userWorkflow.bpmn20.xml
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/userWorkflow.bpmn20.xml b/syncope620/fit/reference/src/main/resources/userWorkflow.bpmn20.xml
deleted file mode 100644
index d26dbe3..0000000
--- a/syncope620/fit/reference/src/main/resources/userWorkflow.bpmn20.xml
+++ /dev/null
@@ -1,577 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:activiti="http://activiti.org/bpmn"
- xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
- xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
- xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
- typeLanguage="http://www.w3.org/2001/XMLSchema"
- expressionLanguage="http://www.w3.org/1999/XPath"
- targetNamespace="http://activiti.org/bpmn20">
-
- <process id="userWorkflow" name="User Workflow" isExecutable="true">
- <startEvent id="theStart"/>
- <sequenceFlow id="flow1" sourceRef="theStart" targetRef="create"/>
- <serviceTask id="create" name="Create" activiti:expression="#{create.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow2" sourceRef="create" targetRef="createGW"/>
- <exclusiveGateway id="createGW"/>
- <sequenceFlow id="createAsAnonymous2Approval" sourceRef="createGW" targetRef="createApproval">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == 'anonymous' || user.getRoleKeys().contains(9)}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.getRoleKeys().contains(9)}]]></conditionExpression>
- </sequenceFlow>
- <userTask id="createApproval" name="Create approval" activiti:candidateGroups="7" activiti:formKey="createApproval">
- <extensionElements>
- <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
- <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
- </extensionElements>
- </userTask>
- <sequenceFlow id="flow3" sourceRef="createApproval" targetRef="createApprovalGW"/>
- <exclusiveGateway id="createApprovalGW"/>
- <sequenceFlow id="createApprovalGW2EnableGW" sourceRef="createApprovalGW" targetRef="enableGW">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="createApproval2Reject" sourceRef="createApprovalGW" targetRef="reject">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
- </sequenceFlow>
- <exclusiveGateway id="enableGW"/>
- <sequenceFlow id="createApprovalGW2OptIn" sourceRef="enableGW" targetRef="generateToken">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.getRoleKeys().contains(11)}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="createApprovalGW2Activate" sourceRef="enableGW" targetRef="activate">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled == null}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="createApprovalGW2Active" sourceRef="enableGW" targetRef="active">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="createApprovalGW2Suspended" sourceRef="enableGW" targetRef="suspend">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!enabled}]]></conditionExpression>
- </sequenceFlow>
- <serviceTask id="activate" name="Activate" activiti:expression="#{autoActivate.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow4" sourceRef="activate" targetRef="active"/>
- <serviceTask id="generateToken" name="Generate token" activiti:expression="#{generateToken.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow5" sourceRef="generateToken" targetRef="created"/>
- <userTask id="created" name="Created"/>
- <sequenceFlow id="flow6" sourceRef="created" targetRef="optinGW"/>
- <exclusiveGateway id="optinGW"/>
- <sequenceFlow id="created2Activate" sourceRef="optinGW" targetRef="removeToken">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.checkToken(token)}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="created2Created" sourceRef="optinGW" targetRef="created">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.checkToken(token)}]]></conditionExpression>
- </sequenceFlow>
- <scriptTask id="removeToken" name="Remove Token and Activate" scriptFormat="groovy" activiti:autoStoreVariables="false">
- <script>
- user.removeToken()
- </script>
- </scriptTask>
- <sequenceFlow id="flow7" sourceRef="removeToken" targetRef="active"/>
- <userTask id="active" name="Active"/>
- <sequenceFlow id="flow8" sourceRef="active" targetRef="activeGw"/>
- <exclusiveGateway id="activeGw"/>
- <sequenceFlow id="active2UpdateApproval" sourceRef="activeGw" targetRef="updateApproval">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == user.getUsername() and task == 'update'
- and (!userMod.getMembershipsToAdd().isEmpty() or !userMod.getMembershipsToRemove().isEmpty())}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="active2DeleteApproval" sourceRef="activeGw" targetRef="deleteApproval">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == user.getUsername() and task == 'delete'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="active2Update" sourceRef="activeGw" targetRef="update">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'update'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="active2Suspend" sourceRef="activeGw" targetRef="suspend">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'suspend'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="active2Delete" sourceRef="activeGw" targetRef="delete">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="active2RequestPasswordReset" sourceRef="activeGw" targetRef="generateToken4PasswordReset">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'requestPasswordReset'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="active2ConfirmPasswordReset" sourceRef="activeGw" targetRef="checkToken4ConfirmPasswordReset">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'confirmPasswordReset'}]]></conditionExpression>
- </sequenceFlow>
- <userTask id="updateApproval" name="Update approval" activiti:candidateGroups="7" activiti:formKey="updateApproval">
- <extensionElements>
- <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
- <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
- </extensionElements>
- </userTask>
- <sequenceFlow id="flow8bis" sourceRef="updateApproval" targetRef="updateApprovalGW"/>
- <exclusiveGateway id="updateApprovalGW"/>
- <sequenceFlow id="updateApprovalGW2Update" sourceRef="updateApprovalGW" targetRef="update">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="updateApprovalGW2Reject" sourceRef="updateApprovalGW" targetRef="rejectUpdate">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
- </sequenceFlow>
- <scriptTask id="rejectUpdate" name="Reject update" scriptFormat="groovy" activiti:autoStoreVariables="false">
- <script>
- execution.setVariable("propByResource", null);
- </script>
- </scriptTask>
- <sequenceFlow id="flow8ter" sourceRef="rejectUpdate" targetRef="active"/>
- <serviceTask id="update" name="Update" activiti:expression="#{update.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow9" sourceRef="update" targetRef="active"/>
- <serviceTask id="suspend" name="Suspend" activiti:expression="#{suspend.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow10" sourceRef="suspend" targetRef="suspended"/>
- <userTask id="suspended" name="Suspended"/>
- <sequenceFlow id="flow11" sourceRef="suspended" targetRef="suspendedGw"/>
- <exclusiveGateway id="suspendedGw"/>
- <sequenceFlow id="suspended2Reactivate" sourceRef="suspendedGw" targetRef="reactivate">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'reactivate'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="suspended2Delete" sourceRef="suspendedGw" targetRef="delete">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
- </sequenceFlow>
- <serviceTask id="reactivate" name="Reactivate" activiti:expression="#{reactivate.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow12" sourceRef="reactivate" targetRef="active"/>
- <scriptTask id="reject" name="Reject" scriptFormat="groovy" activiti:autoStoreVariables="false">
- <script>
- def scriptVar = rejectReason
- execution.setVariable("propByResource", null);
- </script>
- </scriptTask>
- <sequenceFlow id="flow13" sourceRef="reject" targetRef="rejected"/>
- <userTask id="rejected" name="Rejected"/>
- <sequenceFlow id="flow14" sourceRef="rejected" targetRef="rejectedGw"/>
- <exclusiveGateway id="rejectedGw"/>
- <sequenceFlow id="rejected2Delete" sourceRef="rejectedGw" targetRef="delete">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${task == 'delete'}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="rejected2Rejected" sourceRef="rejectedGw" targetRef="rejected">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${empty task}]]></conditionExpression>
- </sequenceFlow>
- <userTask id="deleteApproval" name="Delete approval" activiti:candidateGroups="7" activiti:formKey="deleteApproval">
- <extensionElements>
- <activiti:formProperty id="username" name="Username" type="string" expression="${user.username}" writable="false"/>
- <activiti:formProperty id="approve" name="Approve?" type="boolean" variable="approve" required="true"/>
- <activiti:formProperty id="rejectReason" name="Reason for rejecting" type="string" variable="rejectReason"/>
- </extensionElements>
- </userTask>
- <sequenceFlow id="flow14bis" sourceRef="deleteApproval" targetRef="deleteApprovalGW"/>
- <exclusiveGateway id="deleteApprovalGW"/>
- <sequenceFlow id="deleteApprovalGW2Delete" sourceRef="deleteApprovalGW" targetRef="delete">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve}]]></conditionExpression>
- </sequenceFlow>
- <sequenceFlow id="deleteApprovalGW2Reject" sourceRef="deleteApprovalGW" targetRef="rejectDelete">
- <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approve}]]></conditionExpression>
- </sequenceFlow>
- <scriptTask id="rejectDelete" name="Reject delete" scriptFormat="groovy" activiti:autoStoreVariables="false">
- <script>
- execution.setVariable("propByResource", null);
- </script>
- </scriptTask>
- <sequenceFlow id="flow14ter" sourceRef="rejectDelete" targetRef="active"/>
-
- <serviceTask id="generateToken4PasswordReset" name="Generate token" activiti:expression="#{generateToken.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow15" sourceRef="generateToken4PasswordReset" targetRef="notify4RequestPasswordReset"/>
- <serviceTask id="notify4RequestPasswordReset" name="Notification" activiti:expression="#{notify.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow16" sourceRef="notify4RequestPasswordReset" targetRef="active"/>
-
- <serviceTask id="checkToken4ConfirmPasswordReset" name="Check token, remove and update password" activiti:expression="#{passwordReset.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow17" sourceRef="checkToken4ConfirmPasswordReset" targetRef="notify4ConfirmPasswordReset"/>
- <serviceTask id="notify4ConfirmPasswordReset" name="Notification" activiti:expression="#{notify.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow18" sourceRef="notify4ConfirmPasswordReset" targetRef="active"/>
-
- <serviceTask id="delete" name="Delete" activiti:expression="#{delete.execute(execution.processInstanceId)}"/>
- <sequenceFlow id="flow99" sourceRef="delete" targetRef="theEnd"/>
- <endEvent id="theEnd"/>
- </process>
-
- <bpmndi:BPMNDiagram id="BPMNDiagram_userWorkflow">
- <bpmndi:BPMNPlane bpmnElement="userWorkflow" id="BPMNPlane_userWorkflow">
- <bpmndi:BPMNShape bpmnElement="theStart" id="BPMNShape_theStart">
- <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="512.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="create" id="BPMNShape_create">
- <omgdc:Bounds height="60.0" width="100.0" x="80.0" y="497.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="createGW" id="BPMNShape_createGW">
- <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="506.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="createApproval" id="BPMNShape_createApproval">
- <omgdc:Bounds height="60.0" width="100.0" x="320.0" y="560.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="createApprovalGW" id="BPMNShape_createApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="556.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="enableGW" id="BPMNShape_enableGW">
- <omgdc:Bounds height="40.0" width="40.0" x="590.0" y="429.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="activate" id="BPMNShape_activate">
- <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="610.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="generateToken" id="BPMNShape_generateToken">
- <omgdc:Bounds height="60.0" width="100.0" x="702.0" y="188.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="created" id="BPMNShape_created">
- <omgdc:Bounds height="60.0" width="100.0" x="852.0" y="213.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="optinGW" id="BPMNShape_optinGW">
- <omgdc:Bounds height="40.0" width="40.0" x="1002.0" y="240.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="removeToken" id="BPMNShape_removeToken">
- <omgdc:Bounds height="60.0" width="100.0" x="1092.0" y="248.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="active" id="BPMNShape_active">
- <omgdc:Bounds height="60.0" width="100.0" x="1030.0" y="511.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="activeGw" id="BPMNShape_activeGw">
- <omgdc:Bounds height="40.0" width="40.0" x="1400.0" y="520.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="updateApproval" id="BPMNShape_updateApproval">
- <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="740.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="updateApprovalGW" id="BPMNShape_updateApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="740.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="rejectUpdate" id="BPMNShape_rejectUpdate">
- <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="840.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="update" id="BPMNShape_update">
- <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="700.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspend" id="BPMNShape_suspend">
- <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="100.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspended" id="BPMNShape_suspended">
- <omgdc:Bounds height="60.0" width="100.0" x="1640.0" y="120.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="suspendedGw" id="BPMNShape_suspendedGw">
- <omgdc:Bounds height="40.0" width="40.0" x="1820.0" y="180.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="reactivate" id="BPMNShape_reactivate">
- <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="110.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="reject" id="BPMNShape_reject">
- <omgdc:Bounds height="60.0" width="100.0" x="560.0" y="659.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected">
- <omgdc:Bounds height="60.0" width="100.0" x="710.0" y="770.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="rejectedGw" id="BPMNShape_rejectedGw">
- <omgdc:Bounds height="40.0" width="40.0" x="890.0" y="775.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="deleteApproval" id="BPMNShape_deleteApproval">
- <omgdc:Bounds height="60.0" width="100.0" x="1490.0" y="280.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="deleteApprovalGW" id="BPMNShape_deleteApprovalGW">
- <omgdc:Bounds height="40.0" width="40.0" x="1670.0" y="300.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="rejectDelete" id="BPMNShape_rejectDelete">
- <omgdc:Bounds height="60.0" width="100.0" x="1790.0" y="240.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="delete" id="BPMNShape_delete">
- <omgdc:Bounds height="60.0" width="100.0" x="1940.0" y="358.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
- <omgdc:Bounds height="28.0" width="28.0" x="2078.1893792531678" y="374.0"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="generateToken4PasswordReset" id="BPMNShape_generateToken4PasswordReset">
- <omgdc:Bounds height="59.99999999999994" width="100.0" x="1543.209935088986" y="452.6749142927693"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="notify4RequestPasswordReset" id="BPMNShape_notify4RequestPasswordReset">
- <omgdc:Bounds height="60.00000000000006" width="100.0" x="1748.9712597675173" y="452.6749142927692"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="checkToken4ConfirmPasswordReset" id="BPMNShape_checkToken4ConfirmPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1558.797798366986" y="561.167207412115"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape bpmnElement="notify4ConfirmPasswordReset" id="BPMNShape_notify4ConfirmPasswordReset">
- <omgdc:Bounds height="60.0" width="100.0" x="1748.971259767517" y="561.167207412115"/>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
- <omgdi:waypoint x="1658.797798366986" y="591.167207412115"/>
- <omgdi:waypoint x="1748.971259767517" y="591.167207412115"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
- <omgdi:waypoint x="1940.0" y="129.51612903225805"/>
- <omgdi:waypoint x="1928.0" y="127.0"/>
- <omgdi:waypoint x="1378.0" y="40.0"/>
- <omgdi:waypoint x="1097.8443113772455" y="511.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
- <omgdi:waypoint x="1740.0" y="150.0"/>
- <omgdi:waypoint x="1752.0" y="150.0"/>
- <omgdi:waypoint x="1752.0" y="200.0"/>
- <omgdi:waypoint x="1820.0" y="200.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2DeleteApproval" id="BPMNEdge_active2DeleteApproval">
- <omgdi:waypoint x="1440.0" y="540.0"/>
- <omgdi:waypoint x="1454.0" y="540.0"/>
- <omgdi:waypoint x="1454.0" y="310.0"/>
- <omgdi:waypoint x="1490.0" y="310.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow14bis" id="BPMNEdge_flow14bis">
- <omgdi:waypoint x="1590.0" y="310.0"/>
- <omgdi:waypoint x="1602.0" y="310.0"/>
- <omgdi:waypoint x="1602.0" y="320.0"/>
- <omgdi:waypoint x="1670.0" y="320.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
- <omgdi:waypoint x="1590.0" y="130.0"/>
- <omgdi:waypoint x="1602.0" y="130.0"/>
- <omgdi:waypoint x="1602.0" y="150.0"/>
- <omgdi:waypoint x="1640.0" y="150.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2RequestPasswordReset" id="BPMNEdge_active2RequestPasswordReset">
- <omgdi:waypoint x="1439.5" y="540.5"/>
- <omgdi:waypoint x="1593.209935088986" y="540.5"/>
- <omgdi:waypoint x="1593.209935088986" y="512.6749142927692"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2ConfirmPasswordReset" id="BPMNEdge_active2ConfirmPasswordReset">
- <omgdi:waypoint x="1439.5" y="540.5"/>
- <omgdi:waypoint x="1608.797798366986" y="540.5"/>
- <omgdi:waypoint x="1608.797798366986" y="561.167207412115"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Delete" id="BPMNEdge_deleteApprovalGW2Delete">
- <omgdi:waypoint x="1710.0" y="320.0"/>
- <omgdi:waypoint x="1752.0" y="320.0"/>
- <omgdi:waypoint x="1752.0" y="388.0"/>
- <omgdi:waypoint x="1940.0" y="388.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApproval2Reject" id="BPMNEdge_createApproval2Reject">
- <omgdi:waypoint x="510.0" y="576.0"/>
- <omgdi:waypoint x="522.0" y="576.0"/>
- <omgdi:waypoint x="522.0" y="689.0"/>
- <omgdi:waypoint x="560.0" y="689.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Delete" id="BPMNEdge_active2Delete">
- <omgdi:waypoint x="1440.0" y="540.0"/>
- <omgdi:waypoint x="1452.0" y="540.0"/>
- <omgdi:waypoint x="1452.0" y="680.6812757582483"/>
- <omgdi:waypoint x="1955.9214707261015" y="680.6812757582483"/>
- <omgdi:waypoint x="1986.506931044467" y="418.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Update" id="BPMNEdge_updateApprovalGW2Update">
- <omgdi:waypoint x="1710.0" y="760.0"/>
- <omgdi:waypoint x="1752.0" y="760.0"/>
- <omgdi:waypoint x="1752.0" y="730.0"/>
- <omgdi:waypoint x="1790.0" y="730.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2UpdateApproval" id="BPMNEdge_active2UpdateApproval">
- <omgdi:waypoint x="1440.0" y="540.0"/>
- <omgdi:waypoint x="1454.0" y="540.0"/>
- <omgdi:waypoint x="1454.0" y="770.0"/>
- <omgdi:waypoint x="1490.0" y="770.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="rejected2Delete" id="BPMNEdge_rejected2Delete">
- <omgdi:waypoint x="930.0" y="795.0"/>
- <omgdi:waypoint x="972.0" y="795.0"/>
- <omgdi:waypoint x="1470.0" y="911.0"/>
- <omgdi:waypoint x="1990.0" y="911.0"/>
- <omgdi:waypoint x="1990.0" y="418.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Active" id="BPMNEdge_createApprovalGW2Active">
- <omgdi:waypoint x="630.0" y="449.0"/>
- <omgdi:waypoint x="674.0" y="449.0"/>
- <omgdi:waypoint x="674.0" y="540.0"/>
- <omgdi:waypoint x="1030.0" y="540.8768472906404"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="updateApprovalGW2Reject" id="BPMNEdge_updateApprovalGW2Reject">
- <omgdi:waypoint x="1710.0" y="760.0"/>
- <omgdi:waypoint x="1752.0" y="760.0"/>
- <omgdi:waypoint x="1752.0" y="870.0"/>
- <omgdi:waypoint x="1790.0" y="870.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8ter" id="BPMNEdge_flow8ter">
- <omgdi:waypoint x="1790.0" y="879.6774193548387"/>
- <omgdi:waypoint x="1778.0" y="882.0"/>
- <omgdi:waypoint x="1225.0" y="787.0"/>
- <omgdi:waypoint x="1080.0" y="726.0"/>
- <omgdi:waypoint x="1080.0" y="571.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
- <omgdi:waypoint x="1643.209935088986" y="482.6749142927693"/>
- <omgdi:waypoint x="1748.9712597675173" y="482.67491429276924"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Reactivate" id="BPMNEdge_suspended2Reactivate">
- <omgdi:waypoint x="1860.0" y="200.0"/>
- <omgdi:waypoint x="1902.0" y="200.0"/>
- <omgdi:waypoint x="1902.0" y="140.0"/>
- <omgdi:waypoint x="1940.0" y="140.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
- <omgdi:waypoint x="660.0" y="689.0"/>
- <omgdi:waypoint x="672.0" y="689.0"/>
- <omgdi:waypoint x="672.0" y="800.0"/>
- <omgdi:waypoint x="710.0" y="800.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
- <omgdi:waypoint x="760.0" y="770.0"/>
- <omgdi:waypoint x="760.0" y="732.8074937730017"/>
- <omgdi:waypoint x="910.0" y="732.8074937730017"/>
- <omgdi:waypoint x="910.0" y="775.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2EnableGW" id="BPMNEdge_createApprovalGW2EnableGW">
- <omgdi:waypoint x="510.0" y="576.0"/>
- <omgdi:waypoint x="522.0" y="576.0"/>
- <omgdi:waypoint x="522.0" y="449.0"/>
- <omgdi:waypoint x="590.0" y="449.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Update" id="BPMNEdge_active2Update">
- <omgdi:waypoint x="1440.0" y="540.0"/>
- <omgdi:waypoint x="1456.0" y="540.0"/>
- <omgdi:waypoint x="1456.0" y="730.0"/>
- <omgdi:waypoint x="1790.0" y="730.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="create2Activate" id="BPMNEdge_create2Activate">
- <omgdi:waypoint x="270.0" y="526.0"/>
- <omgdi:waypoint x="282.0" y="526.0"/>
- <omgdi:waypoint x="282.0" y="449.0"/>
- <omgdi:waypoint x="590.0" y="449.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="active2Suspend" id="BPMNEdge_active2Suspend">
- <omgdi:waypoint x="1440.0" y="540.0"/>
- <omgdi:waypoint x="1452.0" y="540.0"/>
- <omgdi:waypoint x="1452.0" y="130.0"/>
- <omgdi:waypoint x="1490.0" y="130.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="suspended2Delete" id="BPMNEdge_suspended2Delete">
- <omgdi:waypoint x="1860.0" y="200.0"/>
- <omgdi:waypoint x="1990.0" y="200.0"/>
- <omgdi:waypoint x="1990.0" y="358.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="created2Activate" id="BPMNEdge_created2Activate">
- <omgdi:waypoint x="1042.0" y="260.0"/>
- <omgdi:waypoint x="1054.0" y="260.0"/>
- <omgdi:waypoint x="1054.0" y="278.0"/>
- <omgdi:waypoint x="1092.0" y="278.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createAsAnonymous2Approval" id="BPMNEdge_createAsAnonymous2Approval">
- <omgdi:waypoint x="270.0" y="526.0"/>
- <omgdi:waypoint x="282.0" y="526.0"/>
- <omgdi:waypoint x="282.0" y="590.0"/>
- <omgdi:waypoint x="320.0" y="590.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
- <omgdi:waypoint x="420.0" y="590.0"/>
- <omgdi:waypoint x="432.0" y="590.0"/>
- <omgdi:waypoint x="432.0" y="576.0"/>
- <omgdi:waypoint x="470.0" y="576.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
- <omgdi:waypoint x="180.0" y="527.0"/>
- <omgdi:waypoint x="192.0" y="527.0"/>
- <omgdi:waypoint x="192.0" y="526.0"/>
- <omgdi:waypoint x="230.0" y="526.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="rejected2Rejected" id="BPMNEdge_rejected2Rejected">
- <omgdi:waypoint x="890.6451612903226" y="795.6451612903226"/>
- <omgdi:waypoint x="810.0" y="798.3333333333334"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
- <omgdi:waypoint x="802.0" y="218.0"/>
- <omgdi:waypoint x="814.0" y="218.0"/>
- <omgdi:waypoint x="814.0" y="243.0"/>
- <omgdi:waypoint x="852.0" y="243.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
- <omgdi:waypoint x="810.0" y="640.0"/>
- <omgdi:waypoint x="822.0" y="640.0"/>
- <omgdi:waypoint x="959.0" y="640.0"/>
- <omgdi:waypoint x="1043.3333333333333" y="571.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Suspended" id="BPMNEdge_createApprovalGW2Suspended">
- <omgdi:waypoint x="630.0" y="449.0"/>
- <omgdi:waypoint x="672.0" y="449.0"/>
- <omgdi:waypoint x="672.0" y="130.0"/>
- <omgdi:waypoint x="1490.0" y="130.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow14ter" id="BPMNEdge_flow14ter">
- <omgdi:waypoint x="1790.0" y="260.7608891486752"/>
- <omgdi:waypoint x="1424.117736926915" y="193.1523534073587"/>
- <omgdi:waypoint x="1109.678315230625" y="511.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2OptIn" id="BPMNEdge_createApprovalGW2OptIn">
- <omgdi:waypoint x="630.0" y="449.0"/>
- <omgdi:waypoint x="674.0" y="449.0"/>
- <omgdi:waypoint x="700.0" y="449.0"/>
- <omgdi:waypoint x="745.2467532467532" y="248.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
- <omgdi:waypoint x="30.0" y="527.0"/>
- <omgdi:waypoint x="80.0" y="527.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
- <omgdi:waypoint x="1748.9712597675173" y="459.5470829510475"/>
- <omgdi:waypoint x="1592.4096593525787" y="387.128477171313"/>
- <omgdi:waypoint x="1130.0" y="525.9854974413342"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="created2Created" id="BPMNEdge_created2Created">
- <omgdi:waypoint x="1002.0" y="260.0"/>
- <omgdi:waypoint x="990.0" y="260.0"/>
- <omgdi:waypoint x="990.0" y="243.0"/>
- <omgdi:waypoint x="952.0" y="243.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
- <omgdi:waypoint x="1748.971259767517" y="619.7464352880323"/>
- <omgdi:waypoint x="1673.525420205687" y="662.8701121105813"/>
- <omgdi:waypoint x="1130.0" y="551.266629529393"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="createApprovalGW2Activate" id="BPMNEdge_createApprovalGW2Activate">
- <omgdi:waypoint x="630.0" y="449.0"/>
- <omgdi:waypoint x="672.0" y="449.0"/>
- <omgdi:waypoint x="672.0" y="640.0"/>
- <omgdi:waypoint x="710.0" y="640.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
- <omgdi:waypoint x="1134.9277566539924" y="308.0"/>
- <omgdi:waypoint x="1087.0722433460076" y="511.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
- <omgdi:waypoint x="952.0" y="252.67741935483872"/>
- <omgdi:waypoint x="964.0" y="255.0"/>
- <omgdi:waypoint x="964.0" y="260.0"/>
- <omgdi:waypoint x="1002.0" y="260.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
- <omgdi:waypoint x="1828.6246202240113" y="760.0"/>
- <omgdi:waypoint x="1811.88836468294" y="804.1381014189917"/>
- <omgdi:waypoint x="1474.4398193359375" y="804.1381014189917"/>
- <omgdi:waypoint x="1124.969521769241" y="571.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="deleteApprovalGW2Reject" id="BPMNEdge_deleteApprovalGW2Reject">
- <omgdi:waypoint x="1710.0" y="320.0"/>
- <omgdi:waypoint x="1752.0" y="320.0"/>
- <omgdi:waypoint x="1752.0" y="270.0"/>
- <omgdi:waypoint x="1790.0" y="270.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8bis" id="BPMNEdge_flow8bis">
- <omgdi:waypoint x="1590.0" y="770.0"/>
- <omgdi:waypoint x="1602.0" y="770.0"/>
- <omgdi:waypoint x="1602.0" y="760.0"/>
- <omgdi:waypoint x="1670.0" y="760.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow99" id="BPMNEdge_flow99">
- <omgdi:waypoint x="2040.0" y="388.0"/>
- <omgdi:waypoint x="2078.1893792531678" y="388.0"/>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
- <omgdi:waypoint x="1130.0" y="540.8529411764706"/>
- <omgdi:waypoint x="1400.058651026393" y="540.0586510263929"/>
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
-</definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/resources/workflow.properties
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/resources/workflow.properties b/syncope620/fit/reference/src/main/resources/workflow.properties
deleted file mode 100644
index 0cad37e..0000000
--- a/syncope620/fit/reference/src/main/resources/workflow.properties
+++ /dev/null
@@ -1,20 +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.
-wf.directory=${conf.directory}
-jobExecutorActivate=true
-uwfAdapter=org.apache.syncope.server.workflow.activiti.ActivitiUserWorkflowAdapter
-rwfAdapter=org.apache.syncope.server.workflow.java.DefaultRoleWorkflowAdapter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/webapp/cacheStats.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/webapp/cacheStats.jsp b/syncope620/fit/reference/src/main/webapp/cacheStats.jsp
deleted file mode 100644
index 5ff8a6b..0000000
--- a/syncope620/fit/reference/src/main/webapp/cacheStats.jsp
+++ /dev/null
@@ -1,190 +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.
---%>
-<%@page import="org.apache.syncope.common.lib.SyncopeConstants"%>
-<%@page import="org.apache.syncope.server.misc.spring.ApplicationContextProvider"%>
-<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
-<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
-<%@page import="java.text.SimpleDateFormat"%>
-<%@page import="java.util.Date"%>
-<%@page import="org.apache.openjpa.datacache.CacheStatisticsImpl"%>
-<%@page import="javax.persistence.EntityManagerFactory"%>
-<%@page import="org.apache.openjpa.persistence.OpenJPAPersistence"%>
-<%@page import="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"%>
-<%@page import="org.springframework.context.ConfigurableApplicationContext"%>
-<%@page import="org.apache.openjpa.datacache.QueryKey"%>
-<%@page import="org.apache.openjpa.kernel.QueryStatistics"%>
-<%@page import="org.apache.openjpa.persistence.QueryResultCacheImpl"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Cache Statistics</title>
- <style type="text/css">
- .c{
- text-align: center;
- }
- .r{
- text-align: right;
- }
- .l{
- text-align: left;
- }
- .t{
- vertical-align: top;
- }
- .b{
- vertical-align: bottom;
- }
- .odd{
- background-color: #D4D4D4;
- }
- .even{
- background-color: #EEEEEE;
- }
- .bd1{
- border: solid #888888 1px;
- }
- .bg1{
- background-color: #CCCCCC;
- }
- .bg2{
- background-color: #DDDDDD;
- }
- </style>
- </head>
- <body>
- <p/>
- <%
- ConfigurableApplicationContext context = ApplicationContextProvider.getApplicationContext();
-
- EntityManagerFactory emf = context.getBean(EntityManagerFactory.class);
- OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
-
- QueryStatistics<QueryKey> queryStatistics =
- ((QueryResultCacheImpl) oemf.getQueryResultCache()).getDelegate().getStatistics();
-
- CacheStatisticsImpl statistics = (CacheStatisticsImpl) oemf.getStoreCache().getStatistics();
-
- String action = request.getParameter("do");
- StringBuilder info = new StringBuilder(512);
-
- if ("activate".equals(action) && !statistics.isEnabled()) {
- statistics.enable();
- info.append("Statistics enabled\n");
- } else if ("deactivate".equals(action) && !statistics.isEnabled()) {
- statistics.disable();
- info.append("Statistics disabled\n");
- } else if ("clear".equals(action)) {
- queryStatistics.reset();
- statistics.reset();
- info.append("Statistics cleared\n");
- }
-
- SimpleDateFormat sdf = new SimpleDateFormat(SyncopeConstants.DEFAULT_DATE_PATTERN);
- if (info.length() > 0) {
- %>
- <p/><div class="success">
- <c:out value="${fn:escapeXml(info)}"/>
- </div>
- <% }%>
- <p/>
- <a href="?">Reload</a>
- <p/>
- <a href="?do=<%=(statistics.isEnabled() ? "deactivate" : "activate")%>">
- <%=(statistics.isEnabled() ? "DEACTIVATE" : "ACTIVATE")%></a>
- <a href="?do=clear">CLEAR</a>
- <p/>
- Last update: <%=sdf.format(statistics.since())%><br/>
- Activation: <%=sdf.format(statistics.start())%><br/>
- <p/>
- <table>
- <tr>
- <th class="c bd1 bg1">Hits</th>
- <td><%=statistics.getHitCount()%></td>
- </tr>
- <tr>
- <th class="c bd1 bg1">Reads</th>
- <td><%=statistics.getReadCount()%></td>
- </tr>
- <tr>
- <th class="c bd1 bg1">Writes</th>
- <td><%=statistics.getWriteCount()%></td>
- </tr>
- <tr>
- <th class="c bd1 bg1">Query Hits</th>
- <td><%=queryStatistics.getHitCount()%></td>
- </tr>
- <tr>
- <th class="c bd1 bg1">Query Executions</th>
- <td><%=queryStatistics.getExecutionCount()%></td>
- </tr>
- <tr>
- <th class="c bd1 bg1">Query Evictions</th>
- <td><%=queryStatistics.getEvictionCount()%></td>
- </tr>
- </table>
- <p/>
- <table width="100%">
- <tr><th colspan="3" class="c bd1 bg2">Query statistics</th></tr>
- <tr>
- <th class="c bd1 bg1">Query</th>
- <th class="c bd1 bg1">Hits</th>
- <th class="c bd1 bg1">Executions</th>
- </tr>
- <%
- boolean odd = true;
- for (QueryKey key : queryStatistics.keys()) {
- %>
- <tr class="<%=(odd ? "odd" : "even")%>">
- <td><%=key%></td>
- <td><%=queryStatistics.getHitCount(key)%></td>
- <td><%=queryStatistics.getExecutionCount(key)%></td>
- </tr>
- <%
- odd = !odd;
- }
- %>
- </table>
- <p/>
- <table width="100%">
- <tr><th colspan="4" class="c bd1 bg2">2nd level cache statistics</th></tr>
- <tr>
- <th class="c bd1 bg1">Region</th>
- <th class="c bd1 bg1">Hits</th>
- <th class="c bd1 bg1">Reads</th>
- <th class="c bd1 bg1">Writes</th>
- </tr>
- <%
- odd = true;
- for (String className : statistics.classNames()) {
- %>
- <tr class="<%=(odd ? "odd" : "even")%>">
- <td><%=className%></td>
- <td><%=statistics.getHitCount(className)%></td>
- <td><%=statistics.getReadCount(className)%></td>
- <td><%=statistics.getWriteCount(className)%></td>
- </tr>
- <%
- odd = !odd;
- }
- %>
- </table>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/main/webapp/db.jsp
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/main/webapp/db.jsp b/syncope620/fit/reference/src/main/webapp/db.jsp
deleted file mode 100644
index 2a4c6ac..0000000
--- a/syncope620/fit/reference/src/main/webapp/db.jsp
+++ /dev/null
@@ -1,36 +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.
---%>
-<%@page import="java.sql.SQLException"%>
-<%@page import="org.h2.tools.Server"%>
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%
- Server h2Datastore = (Server) getServletConfig().getServletContext().getAttribute("H2_DATASTORE");
- if (h2Datastore == null || !h2Datastore.isRunning(true)) {
- try {
- h2Datastore = Server.createWebServer("-webPort", "8082");
- h2Datastore.start();
-
- getServletConfig().getServletContext().setAttribute("H2_DATASTORE", h2Datastore);
- } catch (SQLException e) {
- getServletConfig().getServletContext().log("Could not start H2 web console (datastore)", e);
- }
-
- response.sendRedirect("http://localhost:8082");
- }
-%>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java
deleted file mode 100644
index cf545a7..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractITCase.java
+++ /dev/null
@@ -1,388 +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.fit.server.reference;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.InputStream;
-import java.net.URI;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Properties;
-import java.util.UUID;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.directory.InitialDirContext;
-import javax.sql.DataSource;
-import javax.ws.rs.core.Response;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.RoleMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AbstractPolicyTO;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
-import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.CamelRouteService;
-import org.apache.syncope.common.rest.api.service.ConfigurationService;
-import org.apache.syncope.common.rest.api.service.ConnectorService;
-import org.apache.syncope.common.rest.api.service.EntitlementService;
-import org.apache.syncope.common.rest.api.service.LoggerService;
-import org.apache.syncope.common.rest.api.service.NotificationService;
-import org.apache.syncope.common.rest.api.service.PolicyService;
-import org.apache.syncope.common.rest.api.service.ReportService;
-import org.apache.syncope.common.rest.api.service.ResourceService;
-import org.apache.syncope.common.rest.api.service.RoleService;
-import org.apache.syncope.common.rest.api.service.SchemaService;
-import org.apache.syncope.common.rest.api.service.SecurityQuestionService;
-import org.apache.syncope.common.rest.api.service.SyncopeService;
-import org.apache.syncope.common.rest.api.service.TaskService;
-import org.apache.syncope.common.rest.api.service.UserSelfService;
-import org.apache.syncope.common.rest.api.service.UserService;
-import org.apache.syncope.common.rest.api.service.UserWorkflowService;
-import org.apache.syncope.common.rest.api.service.WorkflowService;
-import org.identityconnectors.common.security.Encryptor;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:testJDBCContext.xml" })
-public abstract class AbstractITCase {
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractITCase.class);
-
- protected static final String ADMIN_UNAME = "admin";
-
- protected static final String ADMIN_PWD = "password";
-
- private static final String ADDRESS = "http://localhost:9080/syncope/rest";
-
- private static final String ENV_KEY_CONTENT_TYPE = "jaxrsContentType";
-
- protected static final SyncopeClientFactoryBean clientFactory = new SyncopeClientFactoryBean().setAddress(ADDRESS);
-
- protected static final String RESOURCE_NAME_WS1 = "ws-target-resource-1";
-
- protected static final String RESOURCE_NAME_WS2 = "ws-target-resource-2";
-
- protected static final String RESOURCE_NAME_LDAP = "resource-ldap";
-
- protected static final String RESOURCE_NAME_TESTDB = "resource-testdb";
-
- protected static final String RESOURCE_NAME_TESTDB2 = "resource-testdb2";
-
- protected static final String RESOURCE_NAME_CSV = "resource-csv";
-
- protected static final String RESOURCE_NAME_DBSYNC = "resource-db-sync";
-
- protected static final String RESOURCE_NAME_DBVIRATTR = "resource-db-virattr";
-
- protected static final String RESOURCE_NAME_NOPROPAGATION = "ws-target-resource-nopropagation";
-
- protected static final String RESOURCE_NAME_NOPROPAGATION2 = "ws-target-resource-nopropagation2";
-
- protected static final String RESOURCE_NAME_NOPROPAGATION3 = "ws-target-resource-nopropagation3";
-
- protected static final String RESOURCE_NAME_NOPROPAGATION4 = "ws-target-resource-nopropagation4";
-
- protected static final String RESOURCE_NAME_RESETSYNCTOKEN = "ws-target-resource-update-resetsynctoken";
-
- protected static final String RESOURCE_NAME_TIMEOUT = "ws-target-resource-timeout";
-
- protected static final String RESOURCE_NAME_MAPPINGS1 = "ws-target-resource-list-mappings-1";
-
- protected static final String RESOURCE_NAME_MAPPINGS2 = "ws-target-resource-list-mappings-2";
-
- protected static final String RESOURCE_NAME_CREATE = "ws-target-resource-create";
-
- protected static final String RESOURCE_NAME_CREATE_SINGLE = "ws-target-resource-create-single";
-
- protected static final String RESOURCE_NAME_CREATE_WRONG = "ws-target-resource-create-wrong";
-
- protected static final String RESOURCE_NAME_DELETE = "ws-target-resource-delete";
-
- protected static final String RESOURCE_NAME_UPDATE = "ws-target-resource-update";
-
- protected static final String RESOURCE_NAME_CREATE_NONE = "ws-target-resource-create-none";
-
- protected static String ANONYMOUS_UNAME;
-
- protected static String ANONYMOUS_KEY;
-
- protected static SyncopeClient adminClient;
-
- protected static SyncopeService syncopeService;
-
- protected static UserService userService;
-
- protected static UserSelfService userSelfService;
-
- protected static UserWorkflowService userWorkflowService;
-
- protected static RoleService roleService;
-
- protected static ResourceService resourceService;
-
- protected static EntitlementService entitlementService;
-
- protected static ConfigurationService configurationService;
-
- protected static ConnectorService connectorService;
-
- protected static LoggerService loggerService;
-
- protected static ReportService reportService;
-
- protected static TaskService taskService;
-
- protected static WorkflowService workflowService;
-
- protected static NotificationService notificationService;
-
- protected static SchemaService schemaService;
-
- protected static PolicyService policyService;
-
- protected static SecurityQuestionService securityQuestionService;
-
- protected static CamelRouteService camelRouteService;
-
- @Autowired
- protected DataSource testDataSource;
-
- @BeforeClass
- public static void securitySetup() {
- InputStream propStream = null;
- try {
- propStream = Encryptor.class.getResourceAsStream("/security.properties");
- Properties props = new Properties();
- props.load(propStream);
-
- ANONYMOUS_UNAME = props.getProperty("anonymousUser");
- ANONYMOUS_KEY = props.getProperty("anonymousKey");
- } catch (Exception e) {
- LOG.error("Could not read secretKey", e);
- } finally {
- IOUtils.closeQuietly(propStream);
- }
-
- assertNotNull(ANONYMOUS_UNAME);
- assertNotNull(ANONYMOUS_KEY);
- }
-
- @BeforeClass
- public static void restSetup() {
- final String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE);
- if (StringUtils.isNotBlank(envContentType)) {
- clientFactory.setContentType(envContentType);
- }
- LOG.info("Performing IT with content type {}", clientFactory.getContentType().getMediaType());
-
- adminClient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
-
- syncopeService = adminClient.getService(SyncopeService.class);
- userService = adminClient.getService(UserService.class);
- userSelfService = adminClient.getService(UserSelfService.class);
- userWorkflowService = adminClient.getService(UserWorkflowService.class);
- roleService = adminClient.getService(RoleService.class);
- resourceService = adminClient.getService(ResourceService.class);
- entitlementService = adminClient.getService(EntitlementService.class);
- configurationService = adminClient.getService(ConfigurationService.class);
- connectorService = adminClient.getService(ConnectorService.class);
- loggerService = adminClient.getService(LoggerService.class);
- reportService = adminClient.getService(ReportService.class);
- taskService = adminClient.getService(TaskService.class);
- policyService = adminClient.getService(PolicyService.class);
- workflowService = adminClient.getService(WorkflowService.class);
- notificationService = adminClient.getService(NotificationService.class);
- schemaService = adminClient.getService(SchemaService.class);
- securityQuestionService = adminClient.getService(SecurityQuestionService.class);
- camelRouteService = adminClient.getService(CamelRouteService.class);
- }
-
- protected static String getUUIDString() {
- return UUID.randomUUID().toString().substring(0, 8);
- }
-
- protected static AttrTO attrTO(final String schema, final String value) {
- AttrTO attr = new AttrTO();
- attr.setSchema(schema);
- attr.getValues().add(value);
- return attr;
- }
-
- protected static AttrMod attrMod(final String schema, final String valueToBeAdded) {
- AttrMod attr = new AttrMod();
- attr.setSchema(schema);
- attr.getValuesToBeAdded().add(valueToBeAdded);
- return attr;
- }
-
- protected UserTO createUser(final UserTO userTO) {
- return createUser(userTO, true);
- }
-
- protected UserTO createUser(final UserTO userTO, final boolean storePassword) {
- Response response = userService.create(userTO, storePassword);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
- if (ex != null) {
- throw (RuntimeException) ex;
- }
- }
- return response.readEntity(UserTO.class);
- }
-
- protected UserTO readUser(final String username) {
- return userService.read(Long.valueOf(
- userService.getUserId(username).getHeaderString(RESTHeaders.USER_ID)));
- }
-
- protected UserTO updateUser(final UserMod userMod) {
- return userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
- }
-
- protected UserTO deleteUser(final Long id) {
- return userService.delete(id).readEntity(UserTO.class);
- }
-
- public <T> T getObject(final URI location, final Class<?> serviceClass, final Class<T> resultClass) {
- WebClient webClient = WebClient.fromClient(WebClient.client(adminClient.getService(serviceClass)));
- webClient.accept(clientFactory.getContentType().getMediaType()).to(location.toASCIIString(), false);
-
- return webClient.get(resultClass);
- }
-
- @SuppressWarnings("unchecked")
- protected <T extends AbstractSchemaTO> T createSchema(final AttributableType kind,
- final SchemaType type, final T schemaTO) {
-
- Response response = schemaService.create(kind, type, schemaTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
- if (ex != null) {
- throw (RuntimeException) ex;
- }
- }
-
- return (T) getObject(response.getLocation(), SchemaService.class, schemaTO.getClass());
- }
-
- protected RoleTO createRole(final RoleTO newRoleTO) {
- Response response = roleService.create(newRoleTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
- if (ex != null) {
- throw (RuntimeException) ex;
- }
- }
- return getObject(response.getLocation(), RoleService.class, RoleTO.class);
- }
-
- protected RoleTO updateRole(final RoleMod roleMod) {
- return roleService.update(roleMod.getKey(), roleMod).readEntity(RoleTO.class);
- }
-
- protected RoleTO deleteRole(final Long id) {
- return roleService.delete(id).readEntity(RoleTO.class);
- }
-
- @SuppressWarnings("unchecked")
- protected <T extends AbstractPolicyTO> T createPolicy(final T policy) {
- Response response = policyService.create(policy);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
- if (ex != null) {
- throw (RuntimeException) ex;
- }
- }
- return (T) getObject(response.getLocation(), PolicyService.class, policy.getClass());
- }
-
- protected ResourceTO createResource(final ResourceTO resourceTO) {
- Response response = resourceService.create(resourceTO);
- if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
- Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
- if (ex != null) {
- throw (RuntimeException) ex;
- }
- }
- return getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes", "UseOfObsoleteCollectionType" })
- protected InitialDirContext getLdapResourceDirContext(final String bindDn, final String bindPwd)
- throws NamingException {
- ResourceTO ldapRes = resourceService.read(RESOURCE_NAME_LDAP);
- final Map<String, ConnConfProperty> ldapConnConf =
- connectorService.read(ldapRes.getConnectorId()).getConfigurationMap();
-
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, "ldap://" + ldapConnConf.get("host").getValues().get(0)
- + ":" + ldapConnConf.get("port").getValues().get(0) + "/");
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL,
- bindDn == null ? ldapConnConf.get("principal").getValues().get(0) : bindDn);
- env.put(Context.SECURITY_CREDENTIALS,
- bindPwd == null ? ldapConnConf.get("credentials").getValues().get(0) : bindPwd);
-
- return new InitialDirContext(env);
- }
-
- protected Object getLdapRemoteObject(final String bindDn, final String bindPwd, final String objectDn) {
- InitialDirContext ctx = null;
- try {
- ctx = getLdapResourceDirContext(bindDn, bindPwd);
- return ctx.lookup(objectDn);
- } catch (Exception e) {
- return null;
- } finally {
- if (ctx != null) {
- try {
- ctx.close();
- } catch (NamingException e) {
- // ignore
- }
- }
- }
- }
-
- protected Object getLdapRemoteObject(final String objectDn) {
- return getLdapRemoteObject(null, null, objectDn);
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java
deleted file mode 100644
index afc9752..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/AbstractTaskITCase.java
+++ /dev/null
@@ -1,138 +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.fit.server.reference;
-
-import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
-import org.apache.syncope.common.lib.to.TaskExecTO;
-import org.apache.syncope.common.lib.to.UserTO;
-
-public abstract class AbstractTaskITCase extends AbstractITCase {
-
- protected static final Long SYNC_TASK_ID = 4L;
-
- protected static final Long SCHED_TASK_ID = 5L;
-
- protected static class ThreadExec implements Callable<TaskExecTO> {
-
- private final AbstractTaskITCase test;
-
- private final Long taskKey;
-
- private final int maxWaitSeconds;
-
- private final boolean dryRun;
-
- public ThreadExec(AbstractTaskITCase test, Long taskKey, int maxWaitSeconds, boolean dryRun) {
- this.test = test;
- this.taskKey = taskKey;
- this.maxWaitSeconds = maxWaitSeconds;
- this.dryRun = dryRun;
- }
-
- @Override
- public TaskExecTO call() throws Exception {
- return test.execSyncTask(taskKey, maxWaitSeconds, dryRun);
- }
- }
-
- /**
- * Remove initial and synchronized users to make test re-runnable.
- */
- protected void removeTestUsers() {
- for (int i = 0; i < 10; i++) {
- String cUserName = "test" + i;
- try {
- UserTO cUserTO = readUser(cUserName);
- userService.delete(cUserTO.getKey());
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-
- protected TaskExecTO execSyncTask(final Long taskKey, final int maxWaitSeconds, final boolean dryRun) {
- AbstractTaskTO taskTO = taskService.read(taskKey);
- assertNotNull(taskTO);
- assertNotNull(taskTO.getExecutions());
-
- int preSyncSize = taskTO.getExecutions().size();
- TaskExecTO execution = taskService.execute(taskTO.getKey(), dryRun);
- assertEquals("JOB_FIRED", execution.getStatus());
-
- int i = 0;
- int maxit = maxWaitSeconds;
-
- // wait for sync completion (executions incremented)
- do {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- }
-
- taskTO = taskService.read(taskTO.getKey());
-
- assertNotNull(taskTO);
- assertNotNull(taskTO.getExecutions());
-
- i++;
- } while (preSyncSize == taskTO.getExecutions().size() && i < maxit);
- if (i == maxit) {
- fail("Timeout when executing task " + taskKey);
- }
- return taskTO.getExecutions().get(taskTO.getExecutions().size() - 1);
- }
-
- protected Map<Long, TaskExecTO> execSyncTasks(
- final Set<Long> taskKeys, final int maxWaitSeconds, final boolean dryRun) throws Exception {
-
- final ExecutorService service = Executors.newFixedThreadPool(taskKeys.size());
- final List<Future<TaskExecTO>> futures = new ArrayList<>();
-
- for (Long key : taskKeys) {
- futures.add(service.submit(new ThreadExec(this, key, maxWaitSeconds, dryRun)));
- }
-
- final Map<Long, TaskExecTO> res = new HashMap<>();
-
- for (Future<TaskExecTO> future : futures) {
- TaskExecTO taskExecTO = future.get(100, TimeUnit.SECONDS);
- res.put(taskExecTO.getTask(), taskExecTO);
- }
-
- service.shutdownNow();
-
- return res;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java b/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java
deleted file mode 100644
index f16dbe6..0000000
--- a/syncope620/fit/reference/src/test/java/org/apache/syncope/fit/server/reference/ActivitiDetector.java
+++ /dev/null
@@ -1,32 +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.fit.server.reference;
-
-import org.apache.syncope.common.rest.api.service.SyncopeService;
-
-public class ActivitiDetector {
-
- public static boolean isActivitiEnabledForUsers(final SyncopeService syncopeService) {
- return syncopeService.info().getUserWorkflowAdapter().indexOf("Activiti") != -1;
- }
-
- public static boolean isActivitiEnabledForRoles(final SyncopeService syncopeService) {
- return syncopeService.info().getRoleWorkflowAdapter().indexOf("Activiti") != -1;
- }
-}
[33/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
new file mode 100644
index 0000000..41ac64e
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/NotificationTasks.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.NotificationTaskModalPage;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Tasks.TasksProvider;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.request.http.WebResponse;
+
+public class NotificationTasks extends AbstractTasks {
+
+ private static final long serialVersionUID = 4984337552918213290L;
+
+ private int paginatorRows;
+
+ private WebMarkupContainer container;
+
+ private boolean operationResult = false;
+
+ private ModalWindow window;
+
+ private AjaxDataTablePanel<AbstractTaskTO, String> table;
+
+ public NotificationTasks(final String id, final PageReference pageRef) {
+ super(id, pageRef);
+
+ container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ add(window = new ModalWindow("taskWin"));
+
+ paginatorRows = prefMan.getPaginatorRows(getWebRequest(), Constants.PREF_NOTIFICATION_TASKS_PAGINATOR_ROWS);
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<NotificationTaskTO>(restClient, paginatorRows, getId(), NotificationTaskTO.class),
+ container,
+ 0,
+ pageRef,
+ restClient);
+
+ container.add(table);
+
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ target.add(container);
+ if (operationResult) {
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ target.add(getPage().get(Constants.FEEDBACK));
+ operationResult = false;
+ }
+ }
+ });
+
+ window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ window.setInitialHeight(WIN_HEIGHT);
+ window.setInitialWidth(WIN_WIDTH);
+ window.setCookieName(VIEW_TASK_WIN_COOKIE_NAME);
+
+ @SuppressWarnings("rawtypes")
+ final Form paginatorForm = new Form("PaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
+ prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getWebRequest(), (WebResponse) getResponse(),
+ Constants.PREF_NOTIFICATION_TASKS_PAGINATOR_ROWS, String.valueOf(paginatorRows));
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<NotificationTaskTO>(restClient, paginatorRows, getId(),
+ NotificationTaskTO.class),
+ container,
+ table == null ? 0 : (int) table.getCurrentPage(),
+ pageRef,
+ restClient);
+
+ target.add(container);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+ }
+
+ private List<IColumn<AbstractTaskTO, String>> getColumns() {
+ final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("id", this, null), "id", "id"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("sender", this, null), "sender", "sender"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("recipients", this, null), "recipients", "recipients"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("subject", this, null), "subject", "subject"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("traceLevel", this, null), "traceLevel", "traceLevel"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
+
+ columns.add(new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {
+
+ final AbstractTaskTO taskTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new NotificationTaskModalPage(taskTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), false);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.EXECUTE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.delete(taskTO.getKey(), NotificationTaskTO.class);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, TASKS);
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(table);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof AbstractSearchResultPanel.EventDataWrapper) {
+ ((AbstractSearchResultPanel.EventDataWrapper) event.getPayload()).getTarget().add(container);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
new file mode 100644
index 0000000..34d4f81
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainAttrsPanel.java
@@ -0,0 +1,395 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.AttrLayoutType;
+import org.apache.syncope.client.console.commons.JexlHelpUtil;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.panels.AttrTemplatesPanel.RoleAttrTemplatesChange;
+import org.apache.syncope.client.console.rest.ConfigurationRestClient;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.BinaryFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.DateTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.DateTimeFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.list.AltListView;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConfTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class PlainAttrsPanel extends Panel {
+
+ private static final long serialVersionUID = 552437609667518888L;
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ private ConfigurationRestClient confRestClient;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ private final AbstractAttributableTO entityTO;
+
+ private final Mode mode;
+
+ private final AttrTemplatesPanel attrTemplates;
+
+ private Map<String, PlainSchemaTO> schemas = new LinkedHashMap<>();
+
+ public <T extends AbstractAttributableTO> PlainAttrsPanel(final String id, final T entityTO,
+ final Form<?> form, final Mode mode) {
+
+ this(id, entityTO, form, mode, null);
+ }
+
+ public <T extends AbstractAttributableTO> PlainAttrsPanel(final String id, final T entityTO,
+ final Form<?> form, final Mode mode, final AttrTemplatesPanel attrTemplates) {
+
+ super(id);
+ this.entityTO = entityTO;
+ this.mode = mode;
+ this.attrTemplates = attrTemplates;
+ this.setOutputMarkupId(true);
+
+ setSchemas();
+ setAttrs();
+
+ add(new AltListView<AttrTO>("schemas", new PropertyModel<List<? extends AttrTO>>(entityTO, "attrs")) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected void populateItem(final ListItem<AttrTO> item) {
+ final AttrTO attributeTO = (AttrTO) item.getDefaultModelObject();
+
+ final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
+
+ final AjaxLink<Void> questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
+ item.add(questionMarkJexlHelp);
+ questionMarkJexlHelp.add(jexlHelp);
+
+ if (mode != Mode.TEMPLATE) {
+ questionMarkJexlHelp.setVisible(false);
+ }
+
+ item.add(new Label("name", attributeTO.getSchema()));
+
+ final FieldPanel panel = getFieldPanel(schemas.get(attributeTO.getSchema()), form, attributeTO);
+
+ if (mode == Mode.TEMPLATE || !schemas.get(attributeTO.getSchema()).isMultivalue()) {
+ item.add(panel);
+ } else {
+ item.add(new MultiFieldPanel<String>(
+ "panel", new PropertyModel<List<String>>(attributeTO, "values"), panel));
+ }
+ }
+ }
+ );
+ }
+
+ private void setSchemas() {
+ AttrTO attrLayout = null;
+ List<PlainSchemaTO> schemaTOs;
+
+ if (entityTO instanceof RoleTO) {
+ final RoleTO roleTO = (RoleTO) entityTO;
+
+ attrLayout = confRestClient.readAttrLayout(AttrLayoutType.valueOf(mode, AttributableType.ROLE));
+ schemaTOs = schemaRestClient.getSchemas(AttributableType.ROLE);
+ Set<String> allowed;
+ if (attrTemplates == null) {
+ allowed = new HashSet<>(roleTO.getRAttrTemplates());
+ } else {
+ allowed = new HashSet<>(attrTemplates.getSelected(AttrTemplatesPanel.Type.rAttrTemplates));
+ if (roleTO.isInheritTemplates() && roleTO.getParent() != 0) {
+ allowed.addAll(roleRestClient.read(roleTO.getParent()).getRAttrTemplates());
+ }
+ }
+ schemaRestClient.filter(schemaTOs, allowed, true);
+ } else if (entityTO instanceof UserTO) {
+ attrLayout = confRestClient.readAttrLayout(AttrLayoutType.valueOf(mode, AttributableType.USER));
+ schemaTOs = schemaRestClient.getSchemas(AttributableType.USER);
+ } else if (entityTO instanceof MembershipTO) {
+ attrLayout = confRestClient.readAttrLayout(AttrLayoutType.valueOf(mode, AttributableType.MEMBERSHIP));
+ schemaTOs = schemaRestClient.getSchemas(AttributableType.MEMBERSHIP);
+ Set<String> allowed = new HashSet<>(
+ roleRestClient.read(((MembershipTO) entityTO).getRoleId()).getMAttrTemplates());
+ schemaRestClient.filter(schemaTOs, allowed, true);
+ } else {
+ schemas = new TreeMap<>();
+ schemaTOs = schemaRestClient.getSchemas(AttributableType.CONFIGURATION);
+ for (Iterator<PlainSchemaTO> it = schemaTOs.iterator(); it.hasNext();) {
+ PlainSchemaTO schemaTO = it.next();
+ for (AttrLayoutType type : AttrLayoutType.values()) {
+ if (type.getConfKey().equals(schemaTO.getKey())) {
+ it.remove();
+ }
+ }
+ }
+ }
+
+ schemas.clear();
+
+ if (attrLayout != null && mode != Mode.TEMPLATE && !(entityTO instanceof ConfTO)) {
+ // 1. remove attributes not selected for display
+ schemaRestClient.filter(schemaTOs, attrLayout.getValues(), true);
+ // 2. sort remainig attributes according to configuration, e.g. attrLayout
+ final Map<String, Integer> attrLayoutMap = new HashMap<>(attrLayout.getValues().size());
+ for (int i = 0; i < attrLayout.getValues().size(); i++) {
+ attrLayoutMap.put(attrLayout.getValues().get(i), i);
+ }
+ Collections.sort(schemaTOs, new Comparator<PlainSchemaTO>() {
+
+ @Override
+ public int compare(final PlainSchemaTO schema1, final PlainSchemaTO schema2) {
+ int value = 0;
+
+ if (attrLayoutMap.get(schema1.getKey()) > attrLayoutMap.get(schema2.getKey())) {
+ value = 1;
+ } else if (attrLayoutMap.get(schema1.getKey()) < attrLayoutMap.get(schema2.getKey())) {
+ value = -1;
+ }
+
+ return value;
+ }
+ });
+ }
+ for (PlainSchemaTO schemaTO : schemaTOs) {
+ schemas.put(schemaTO.getKey(), schemaTO);
+ }
+ }
+
+ private void setAttrs() {
+ final List<AttrTO> entityData = new ArrayList<>();
+
+ final Map<String, AttrTO> attrMap = entityTO.getPlainAttrMap();
+
+ for (PlainSchemaTO schema : schemas.values()) {
+ final AttrTO attributeTO = new AttrTO();
+ attributeTO.setSchema(schema.getKey());
+
+ if (attrMap.get(schema.getKey()) == null || attrMap.get(schema.getKey()).getValues().isEmpty()) {
+ attributeTO.getValues().add("");
+
+ // is important to set readonly only after values setting
+ attributeTO.setReadonly(schema.isReadonly());
+ } else {
+ attributeTO.getValues().addAll(attrMap.get(schema.getKey()).getValues());
+ }
+ entityData.add(attributeTO);
+ }
+
+ entityTO.getPlainAttrs().clear();
+ entityTO.getPlainAttrs().addAll(entityData);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ private FieldPanel getFieldPanel(final PlainSchemaTO schemaTO, final Form form, final AttrTO attributeTO) {
+ final boolean required = mode == Mode.TEMPLATE
+ ? false
+ : schemaTO.getMandatoryCondition().equalsIgnoreCase("true");
+
+ final boolean readOnly = mode == Mode.TEMPLATE ? false : schemaTO.isReadonly();
+
+ final AttrSchemaType type = mode == Mode.TEMPLATE ? AttrSchemaType.String : schemaTO.getType();
+
+ final FieldPanel panel;
+ switch (type) {
+ case Boolean:
+ panel = new AjaxCheckBoxPanel("panel", schemaTO.getKey(), new Model<Boolean>());
+ panel.setRequired(required);
+ break;
+
+ case Date:
+ final String dataPattern = schemaTO.getConversionPattern() == null
+ ? SyncopeConstants.DEFAULT_DATE_PATTERN
+ : schemaTO.getConversionPattern();
+
+ if (dataPattern.contains("H")) {
+ panel = new DateTimeFieldPanel("panel", schemaTO.getKey(), new Model<Date>(), dataPattern);
+
+ if (required) {
+ panel.addRequiredLabel();
+ ((DateTimeFieldPanel) panel).setFormValidator(form);
+ }
+ panel.setStyleSheet("ui-widget-content ui-corner-all");
+ } else {
+ panel = new DateTextFieldPanel("panel", schemaTO.getKey(), new Model<Date>(), dataPattern);
+
+ if (required) {
+ panel.addRequiredLabel();
+ }
+ }
+ break;
+
+ case Enum:
+ panel = new AjaxDropDownChoicePanel<String>("panel", schemaTO.getKey(), new Model<String>());
+ ((AjaxDropDownChoicePanel<String>) panel).setChoices(getEnumeratedValues(schemaTO));
+
+ if (StringUtils.isNotBlank(schemaTO.getEnumerationKeys())) {
+ ((AjaxDropDownChoicePanel) panel).setChoiceRenderer(new IChoiceRenderer<String>() {
+
+ private static final long serialVersionUID = -3724971416312135885L;
+
+ private final Map<String, String> valueMap = getEnumeratedKeyValues(schemaTO);
+
+ @Override
+ public String getDisplayValue(final String value) {
+ return valueMap.get(value) == null ? value : valueMap.get(value);
+ }
+
+ @Override
+ public String getIdValue(final String value, final int i) {
+ return value;
+ }
+ });
+ }
+
+ if (required) {
+ panel.addRequiredLabel();
+ }
+ break;
+
+ case Long:
+ panel = new SpinnerFieldPanel<Long>("panel", schemaTO.getKey(),
+ Long.class, new Model<Long>(), null, null);
+
+ if (required) {
+ panel.addRequiredLabel();
+ }
+ break;
+
+ case Double:
+ panel = new SpinnerFieldPanel<Double>("panel", schemaTO.getKey(),
+ Double.class, new Model<Double>(), null, null);
+
+ if (required) {
+ panel.addRequiredLabel();
+ }
+ break;
+
+ case Binary:
+ panel = new BinaryFieldPanel("panel", schemaTO.getKey(), new Model<String>(),
+ schemas.containsKey(schemaTO.getKey())
+ ? schemas.get(schemaTO.getKey()).getMimeType()
+ : null);
+
+ if (required) {
+ panel.addRequiredLabel();
+ }
+ break;
+
+ default:
+ panel = new AjaxTextFieldPanel("panel", schemaTO.getKey(), new Model<String>());
+
+ if (required) {
+ panel.addRequiredLabel();
+ }
+ }
+
+ panel.setReadOnly(readOnly);
+ panel.setNewModel(attributeTO.getValues());
+
+ return panel;
+ }
+
+ private Map<String, String> getEnumeratedKeyValues(final PlainSchemaTO schemaTO) {
+ final Map<String, String> res = new HashMap<>();
+
+ final String[] values = StringUtils.isBlank(schemaTO.getEnumerationValues())
+ ? new String[0]
+ : schemaTO.getEnumerationValues().split(SyncopeConstants.ENUM_VALUES_SEPARATOR);
+
+ final String[] keys = StringUtils.isBlank(schemaTO.getEnumerationKeys())
+ ? new String[0]
+ : schemaTO.getEnumerationKeys().split(SyncopeConstants.ENUM_VALUES_SEPARATOR);
+
+ for (int i = 0; i < values.length; i++) {
+ res.put(values[i].trim(), keys.length > i ? keys[i].trim() : null);
+ }
+
+ return res;
+ }
+
+ private List<String> getEnumeratedValues(final PlainSchemaTO schemaTO) {
+ final List<String> res = new ArrayList<>();
+
+ final String[] values = StringUtils.isBlank(schemaTO.getEnumerationValues())
+ ? new String[0]
+ : schemaTO.getEnumerationValues().split(SyncopeConstants.ENUM_VALUES_SEPARATOR);
+
+ for (String value : values) {
+ res.add(value.trim());
+ }
+
+ return res;
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if ((event.getPayload() instanceof RoleAttrTemplatesChange)) {
+ final RoleAttrTemplatesChange update = (RoleAttrTemplatesChange) event.getPayload();
+ if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.rAttrTemplates) {
+ setSchemas();
+ setAttrs();
+ update.getTarget().add(this);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
new file mode 100644
index 0000000..9979ee0
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PoliciesPanel.java
@@ -0,0 +1,343 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.pages.PolicyModalPage;
+import org.apache.syncope.client.console.rest.PolicyRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractPolicyTO;
+import org.apache.syncope.common.lib.to.AccountPolicyTO;
+import org.apache.syncope.common.lib.to.PasswordPolicyTO;
+import org.apache.syncope.common.lib.to.SyncPolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.http.WebResponse;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PoliciesPanel extends Panel {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(PoliciesPanel.class);
+
+ private static final int MODAL_WIN_HEIGHT = 400;
+
+ private static final int MODAL_WIN_WIDTH = 1000;
+
+ private static final long serialVersionUID = -6804066913177804275L;
+
+ @SpringBean
+ private PolicyRestClient policyRestClient;
+
+ @SpringBean
+ protected XMLRolesReader xmlRolesReader;
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private final PageReference pageRef;
+
+ private final int paginatorRows = prefMan.getPaginatorRows(getWebRequest(), Constants.PREF_POLICY_PAGINATOR_ROWS);
+
+ protected boolean modalResult = false;
+
+ private final PolicyType policyType;
+
+ public PoliciesPanel(final String id, final PageReference pageRef, final PolicyType policyType) {
+ super(id);
+ this.pageRef = pageRef;
+ this.policyType = policyType;
+
+ // Modal window for editing user attributes
+ final ModalWindow mwindow = new ModalWindow("editModalWin");
+ mwindow.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ mwindow.setInitialHeight(MODAL_WIN_HEIGHT);
+ mwindow.setInitialWidth(MODAL_WIN_WIDTH);
+ mwindow.setCookieName("policy-modal");
+ add(mwindow);
+
+ // Container for user list
+ final WebMarkupContainer container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ setWindowClosedCallback(mwindow, container);
+
+ final List<IColumn<AbstractPolicyTO, String>> columns = new ArrayList<IColumn<AbstractPolicyTO, String>>();
+
+ columns.add(new PropertyColumn<AbstractPolicyTO, String>(new ResourceModel("id"), "id", "id"));
+
+ columns.add(new PropertyColumn<AbstractPolicyTO, String>(
+ new ResourceModel("description"), "description", "description"));
+
+ columns.add(new AbstractColumn<AbstractPolicyTO, String>(new ResourceModel("type")) {
+
+ private static final long serialVersionUID = 8263694778917279290L;
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractPolicyTO>> cellItem, final String componentId,
+ final IModel<AbstractPolicyTO> model) {
+
+ cellItem.add(new Label(componentId, getString(model.getObject().getType().name())));
+ }
+ });
+
+ columns.add(new AbstractColumn<AbstractPolicyTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractPolicyTO>> cellItem, final String componentId,
+ final IModel<AbstractPolicyTO> model) {
+
+ final AbstractPolicyTO policyTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ mwindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public Page createPage() {
+ return new PolicyModalPage(pageRef, mwindow, policyTO);
+ }
+ });
+
+ mwindow.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Policies");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ policyRestClient.delete(policyTO.getKey(), policyTO.getClass());
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.OPERATION_ERROR));
+
+ LOG.error("While deleting policy {}({})",
+ policyTO.getKey(), policyTO.getDescription(), e);
+ }
+
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, "Policies");
+
+ cellItem.add(panel);
+ }
+ });
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final AjaxFallbackDefaultDataTable table = new AjaxFallbackDefaultDataTable("datatable", columns,
+ new PolicyDataProvider(), paginatorRows);
+
+ container.add(table);
+
+ final AjaxLink<Void> createButton = new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ mwindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public Page createPage() {
+ return new PolicyModalPage(pageRef, mwindow, getPolicyTOInstance(policyType));
+ }
+ });
+
+ mwindow.show(target);
+ }
+ };
+
+ add(createButton);
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ createButton, ENABLE, xmlRolesReader.getEntitlement("Policies", "create"));
+
+ @SuppressWarnings("rawtypes")
+ final Form paginatorForm = new Form("PaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
+ prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getWebRequest(), (WebResponse) getResponse(), Constants.PREF_POLICY_PAGINATOR_ROWS, String
+ .valueOf(paginatorRows));
+ table.setItemsPerPage(paginatorRows);
+
+ target.add(container);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+ }
+
+ private void setWindowClosedCallback(final ModalWindow window, final WebMarkupContainer container) {
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ target.add(container);
+ BasePage configuration = ((BasePage) pageRef.getPage());
+ if (configuration.isModalResult()) {
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ configuration.getFeedbackPanel().refresh(target);
+ configuration.setModalResult(false);
+ }
+ }
+ });
+ }
+
+ private class PolicyDataProvider extends SortableDataProvider<AbstractPolicyTO, String> {
+
+ private static final long serialVersionUID = -6976327453925166730L;
+
+ private final SortableDataProviderComparator<AbstractPolicyTO> comparator;
+
+ public PolicyDataProvider() {
+ super();
+
+ //Default sorting
+ setSort("description", SortOrder.ASCENDING);
+
+ comparator = new SortableDataProviderComparator<AbstractPolicyTO>(this);
+ }
+
+ @Override
+ public long size() {
+ return policyRestClient.getPolicies(policyType, true).size();
+ }
+
+ @Override
+ public Iterator<AbstractPolicyTO> iterator(final long first, final long count) {
+ final List<AbstractPolicyTO> policies = policyRestClient.getPolicies(policyType, true);
+
+ Collections.sort(policies, comparator);
+
+ return policies.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public IModel<AbstractPolicyTO> model(final AbstractPolicyTO object) {
+ return new CompoundPropertyModel<AbstractPolicyTO>(object);
+ }
+ }
+
+ private AbstractPolicyTO getPolicyTOInstance(final PolicyType policyType) {
+ AbstractPolicyTO policyTO;
+ switch (policyType) {
+ case GLOBAL_ACCOUNT:
+ policyTO = new AccountPolicyTO(true);
+ break;
+
+ case ACCOUNT:
+ policyTO = new AccountPolicyTO();
+ break;
+
+ case GLOBAL_PASSWORD:
+ policyTO = new PasswordPolicyTO(true);
+ break;
+
+ case PASSWORD:
+ policyTO = new PasswordPolicyTO();
+ break;
+
+ case GLOBAL_SYNC:
+ policyTO = new SyncPolicyTO(true);
+ break;
+
+ case SYNC:
+ default:
+ policyTO = new SyncPolicyTO();
+ }
+
+ return policyTO;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
new file mode 100644
index 0000000..a46bcd1
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PolicyBeanPanel.java
@@ -0,0 +1,328 @@
+/*
+ * 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.beans.PropertyDescriptor;
+import java.io.Serializable;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.PolicyRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AbstractFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+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.MultiFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.list.AltListView;
+import org.apache.syncope.common.lib.annotation.ClassList;
+import org.apache.syncope.common.lib.annotation.SchemaList;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.PolicySpec;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.util.ClassUtils;
+
+public class PolicyBeanPanel extends Panel {
+
+ private static final long serialVersionUID = -3035998190456928143L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(PolicyBeanPanel.class);
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ private PolicyRestClient policyRestClient;
+
+ final IModel<List<String>> userSchemas = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = -2012833443695917883L;
+
+ @Override
+ protected List<String> load() {
+ return schemaRestClient.getSchemaNames(AttributableType.USER);
+ }
+ };
+
+ final IModel<List<String>> roleSchemas = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return schemaRestClient.getSchemaNames(AttributableType.ROLE);
+ }
+ };
+
+ final IModel<List<String>> correlationRules = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return policyRestClient.getCorrelationRuleClasses();
+ }
+ };
+
+ public PolicyBeanPanel(final String id, final PolicySpec policy) {
+ super(id);
+
+ final List<FieldWrapper> items = new ArrayList<>();
+
+ for (Field field : policy.getClass().getDeclaredFields()) {
+ if (!"serialVersionUID".equals(field.getName())) {
+ FieldWrapper fieldWrapper = new FieldWrapper();
+ fieldWrapper.setName(field.getName());
+ fieldWrapper.setType(field.getType());
+
+ final SchemaList schemaList = field.getAnnotation(SchemaList.class);
+ fieldWrapper.setSchemaList(schemaList);
+
+ final ClassList classList = field.getAnnotation(ClassList.class);
+ fieldWrapper.setClassList(classList);
+
+ items.add(fieldWrapper);
+ }
+ }
+
+ final ListView<FieldWrapper> policies = new AltListView<FieldWrapper>("policies", items) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected void populateItem(final ListItem<FieldWrapper> item) {
+ final FieldWrapper field = item.getModelObject();
+
+ final PropertyDescriptor propDesc = BeanUtils.getPropertyDescriptor(policy.getClass(), field.getName());
+
+ item.add(new Label("label", new ResourceModel(field.getName())));
+
+ AbstractFieldPanel component;
+ try {
+ if (field.getClassList() != null) {
+ component = new AjaxDropDownChoicePanel("field", field.getName(), new PropertyModel(policy,
+ field.getName()));
+
+ final List<String> rules = correlationRules.getObject();
+
+ if (rules != null && !rules.isEmpty()) {
+ ((AjaxDropDownChoicePanel) component).setChoices(correlationRules.getObject());
+ }
+
+ item.add(component);
+
+ item.add(getActivationControl(
+ component,
+ propDesc.getReadMethod().invoke(policy, new Object[] {}) != null,
+ null,
+ null));
+
+ } else if (field.getType().isEnum()) {
+ component = new AjaxDropDownChoicePanel("field", field.getName(), new PropertyModel(policy,
+ field.getName()));
+
+ final Serializable[] values = (Serializable[]) field.getType().getEnumConstants();
+
+ if (values != null && values.length > 0) {
+ ((AjaxDropDownChoicePanel) component).setChoices(Arrays.asList(values));
+ }
+
+ item.add(component);
+
+ item.add(getActivationControl(
+ component,
+ (Enum<?>) propDesc.getReadMethod().invoke(policy, new Object[] {}) != null,
+ values[0],
+ values[0]));
+
+ } else if (ClassUtils.isAssignable(Boolean.class, field.getType())) {
+ item.add(new AjaxCheckBoxPanel("check", field.getName(),
+ new PropertyModel<Boolean>(policy, field.getName())));
+
+ item.add(new Label("field", new Model(null)));
+ } else if (Collection.class.isAssignableFrom(field.getType())) {
+ if (field.getSchemaList() != null) {
+ final List<String> values = new ArrayList<String>();
+ if (field.getName().charAt(0) == 'r') {
+ values.addAll(roleSchemas.getObject());
+
+ if (field.getSchemaList().extended()) {
+ values.add("name");
+ }
+ } else {
+ values.addAll(userSchemas.getObject());
+
+ if (field.getSchemaList().extended()) {
+ values.add("id");
+ values.add("username");
+ }
+ }
+
+ component = new AjaxPalettePanel("field", new PropertyModel(policy, field.getName()),
+ new ListModel<String>(values));
+ item.add(component);
+
+ Collection<?> collection = (Collection) propDesc.getReadMethod().invoke(policy);
+ item.add(getActivationControl(component,
+ !collection.isEmpty(), new ArrayList<String>(), new ArrayList<String>()));
+ } else {
+ final FieldPanel panel = new AjaxTextFieldPanel("panel", field.getName(),
+ new Model<String>(null));
+ panel.setRequired(true);
+
+ component = new MultiFieldPanel<String>("field",
+ new PropertyModel(policy, field.getName()), panel);
+
+ item.add(component);
+
+ final List<String> reinitializedValue = new ArrayList<String>();
+
+ reinitializedValue.add("");
+
+ item.add(getActivationControl(component,
+ !((Collection) propDesc.getReadMethod().invoke(policy, new Object[] {})).isEmpty(),
+ new ArrayList<String>(), (Serializable) reinitializedValue));
+ }
+ } else if (ClassUtils.isAssignable(Number.class, field.getType())) {
+ component = new SpinnerFieldPanel<Number>("field", field.getName(),
+ (Class<Number>) field.getType(), new PropertyModel<Number>(policy, field.getName()),
+ null, null);
+ item.add(component);
+
+ item.add(getActivationControl(component,
+ (Integer) propDesc.getReadMethod().invoke(policy, new Object[] {}) > 0, 0, 0));
+ } else if (field.getType().equals(String.class)) {
+ component = new AjaxTextFieldPanel("field", field.getName(),
+ new PropertyModel(policy, field.getName()));
+
+ item.add(component);
+
+ item.add(getActivationControl(component,
+ propDesc.getReadMethod().invoke(policy, new Object[] {}) != null, null, null));
+ } else {
+ item.add(new AjaxCheckBoxPanel("check", field.getName(), new Model()));
+ item.add(new Label("field", new Model(null)));
+ }
+ } catch (Exception e) {
+ LOG.error("Error retrieving policy fields", e);
+ }
+ }
+ };
+
+ add(policies);
+ }
+
+ private <T extends Serializable> AjaxCheckBoxPanel getActivationControl(final AbstractFieldPanel<T> panel,
+ final Boolean checked, final T defaultModelObject, final T reinitializedValue) {
+
+ final AjaxCheckBoxPanel check = new AjaxCheckBoxPanel("check", "check", new Model<Boolean>(checked));
+
+ panel.setEnabled(checked);
+
+ check.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (check.getModelObject()) {
+ panel.setEnabled(true);
+ panel.setModelObject(reinitializedValue);
+ } else {
+ panel.setModelObject(defaultModelObject);
+ panel.setEnabled(false);
+ }
+
+ target.add(panel);
+ }
+ });
+
+ return check;
+ }
+
+ private static class FieldWrapper implements Serializable {
+
+ private static final long serialVersionUID = -6770429509752964215L;
+
+ private Class<?> type;
+
+ private String name;
+
+ private transient SchemaList schemaList;
+
+ private transient ClassList classList;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public Class<?> getType() {
+ return type;
+ }
+
+ public void setType(final Class<?> type) {
+ this.type = type;
+ }
+
+ public SchemaList getSchemaList() {
+ return schemaList;
+ }
+
+ public void setSchemaList(final SchemaList schemaList) {
+ this.schemaList = schemaList;
+ }
+
+ public ClassList getClassList() {
+ return classList;
+ }
+
+ public void setClassList(ClassList classList) {
+ this.classList = classList;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
new file mode 100644
index 0000000..5a942fd
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PropagationTasks.java
@@ -0,0 +1,273 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.PropagationTaskModalPage;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Tasks.TasksProvider;
+import org.apache.syncope.client.console.panels.AbstractSearchResultPanel.EventDataWrapper;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.request.http.WebResponse;
+
+/**
+ * Tasks page.
+ */
+public class PropagationTasks extends AbstractTasks {
+
+ private static final long serialVersionUID = 4984337552918213290L;
+
+ private int paginatorRows;
+
+ private WebMarkupContainer container;
+
+ private boolean operationResult = false;
+
+ private ModalWindow window;
+
+ private AjaxDataTablePanel<AbstractTaskTO, String> table;
+
+ public PropagationTasks(final String id, final PageReference pageRef) {
+ super(id, pageRef);
+
+ container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ add(window = new ModalWindow("taskWin"));
+
+ paginatorRows = prefMan.getPaginatorRows(getWebRequest(), Constants.PREF_PROPAGATION_TASKS_PAGINATOR_ROWS);
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<PropagationTaskTO>(restClient, paginatorRows, getId(), PropagationTaskTO.class),
+ container,
+ 0,
+ pageRef,
+ restClient);
+
+ window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ target.add(container);
+ if (operationResult) {
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ target.add(getPage().get(Constants.FEEDBACK));
+ operationResult = false;
+ }
+ }
+ });
+
+ window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ window.setInitialHeight(WIN_HEIGHT);
+ window.setInitialWidth(WIN_WIDTH);
+ window.setCookieName(VIEW_TASK_WIN_COOKIE_NAME);
+
+ @SuppressWarnings("rawtypes")
+ Form paginatorForm = new Form("PaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice(
+ "rowsChooser", new PropertyModel(this, "paginatorRows"), prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getWebRequest(), (WebResponse) getResponse(),
+ Constants.PREF_PROPAGATION_TASKS_PAGINATOR_ROWS, String.valueOf(paginatorRows));
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<PropagationTaskTO>(restClient, paginatorRows,
+ getId(), PropagationTaskTO.class),
+ container,
+ table == null ? 0 : (int) table.getCurrentPage(),
+ pageRef,
+ restClient);
+
+ target.add(container);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+ }
+
+ private List<IColumn<AbstractTaskTO, String>> getColumns() {
+ final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("id", this, null), "id", "id"));
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("resource", this, null), "resource", "resource"));
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("accountId", this, null), "accountId", "accountId"));
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("propagationMode", this, null), "propagationMode", "propagationMode"));
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(new StringResourceModel(
+ "propagationOperation", this, null), "propagationOperation", "propagationOperation"));
+
+ columns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("startDate", this, null), "startDate", "startDate"));
+
+ columns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("endDate", this, null), "endDate", "endDate"));
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
+
+ columns.add(new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {
+
+ final AbstractTaskTO taskTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new PropagationTaskModalPage(taskTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), false);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.EXECUTE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.delete(taskTO.getKey(), PropagationTaskTO.class);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, TASKS);
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(table);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof EventDataWrapper) {
+ ((EventDataWrapper) event.getPayload()).getTarget().add(container);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
new file mode 100644
index 0000000..2d25a83
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/PushTasksPanel.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.PushTaskModalPage;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.StringResourceModel;
+
+public class PushTasksPanel extends AbstractProvisioningTasksPanel<PushTaskTO> {
+
+ private static final long serialVersionUID = -2492299671757861889L;
+
+ public PushTasksPanel(final String id, final PageReference pageRef) {
+ super(id, pageRef, PushTaskTO.class);
+ initTasksTable();
+ }
+
+ @Override
+ protected List<IColumn<AbstractTaskTO, String>> getColumns() {
+ final List<IColumn<AbstractTaskTO, String>> pushTasksColumns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+
+ pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("id", this, null), "id", "id"));
+ pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("name", this, null), "name", "name"));
+ pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("description", this, null), "description", "description"));
+ pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("resourceName", this, null), "resource", "resource"));
+ pushTasksColumns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("lastExec", this, null), "lastExec", "lastExec"));
+ pushTasksColumns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("nextExec", this, null), "nextExec", "nextExec"));
+ pushTasksColumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
+
+ pushTasksColumns.add(
+ new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {
+
+ final PushTaskTO taskTO = (PushTaskTO) model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new PushTaskModalPage(window, taskTO, pageRef);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), false);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.EXECUTE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), true);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DRYRUN, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.delete(taskTO.getKey(), SyncTaskTO.class);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, TASKS);
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(table);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ return pushTasksColumns;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
new file mode 100644
index 0000000..b3e63c5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.client.console.pages.BaseModalPage;
+import org.apache.syncope.client.console.pages.ResourceModalPage.ResourceEvent;
+import org.apache.syncope.client.console.panels.ResourceDetailsPanel.DetailsModEvent;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel.MultiValueSelectorEvent;
+import org.apache.syncope.client.console.wicket.markup.html.list.ConnConfPropertyListView;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class ResourceConnConfPanel extends Panel {
+
+ private static final long serialVersionUID = -7982691107029848579L;
+
+ @SpringBean
+ private ConnectorRestClient restClient;
+
+ private final ResourceTO resourceTO;
+
+ private final boolean createFlag;
+
+ private List<ConnConfProperty> connConfProperties;
+
+ private WebMarkupContainer connConfPropContainer;
+
+ private AjaxButton check;
+
+ public ResourceConnConfPanel(final String id, final ResourceTO resourceTO, final boolean createFlag) {
+ super(id);
+ setOutputMarkupId(true);
+
+ this.createFlag = createFlag;
+ this.resourceTO = resourceTO;
+
+ connConfProperties = getConnConfProperties();
+
+ connConfPropContainer = new WebMarkupContainer("connectorPropertiesContainer");
+ connConfPropContainer.setOutputMarkupId(true);
+ add(connConfPropContainer);
+
+ /*
+ * the list of overridable connector properties
+ */
+ final ListView<ConnConfProperty> connPropView = new ConnConfPropertyListView("connectorProperties",
+ new PropertyModel<List<ConnConfProperty>>(this, "connConfProperties"),
+ false, resourceTO.getConnConfProperties());
+ connPropView.setOutputMarkupId(true);
+ connConfPropContainer.add(connPropView);
+
+ check = new IndicatingAjaxButton("check", new ResourceModel("check")) {
+
+ private static final long serialVersionUID = -4199438518229098169L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final ResourceTO resourceTO = (ResourceTO) form.getModelObject();
+
+ if (restClient.check(resourceTO)) {
+ info(getString("success_connection"));
+ } else {
+ error(getString("error_connection"));
+ }
+
+ ((BaseModalPage) getPage()).getFeedbackPanel().refresh(target);
+ }
+ };
+
+ check.setEnabled(!connConfProperties.isEmpty());
+ connConfPropContainer.add(check);
+ }
+
+ /**
+ * Get overridable properties.
+ *
+ * @return overridable properties.
+ */
+ private List<ConnConfProperty> getConnConfProperties() {
+ final List<ConnConfProperty> props = new ArrayList<ConnConfProperty>();
+ final Long connectorId = resourceTO.getConnectorId();
+ if (connectorId != null && connectorId > 0) {
+ for (ConnConfProperty property : restClient.getConnectorProperties(connectorId)) {
+ if (property.isOverridable()) {
+ props.add(property);
+ }
+ }
+ }
+ if (createFlag || resourceTO.getConnConfProperties().isEmpty()) {
+ resourceTO.getConnConfProperties().clear();
+ } else {
+ Map<String, ConnConfProperty> valuedProps = new HashMap<String, ConnConfProperty>();
+ for (ConnConfProperty prop : resourceTO.getConnConfProperties()) {
+ valuedProps.put(prop.getSchema().getName(), prop);
+ }
+
+ for (int i = 0; i < props.size(); i++) {
+ if (valuedProps.containsKey(props.get(i).getSchema().getName())) {
+ props.set(i, valuedProps.get(props.get(i).getSchema().getName()));
+ }
+ }
+ }
+
+ // re-order properties
+ Collections.sort(props);
+
+ return props;
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ AjaxRequestTarget target = null;
+ if (event.getPayload() instanceof DetailsModEvent) {
+ // connector change: update properties and forward event
+ target = ((ResourceEvent) event.getPayload()).getTarget();
+
+ connConfProperties = getConnConfProperties();
+ check.setEnabled(!connConfProperties.isEmpty());
+
+ target.add(connConfPropContainer);
+ } else if (event.getPayload() instanceof MultiValueSelectorEvent) {
+ // multi value connector property change: forward event
+ target = ((MultiValueSelectorEvent) event.getPayload()).getTarget();
+ }
+
+ if (target != null) {
+ send(getPage(), Broadcast.BREADTH, new ConnConfModEvent(target, connConfProperties));
+ }
+ }
+
+ /**
+ * Connector configuration properties modification event.
+ */
+ public static class ConnConfModEvent extends ResourceEvent {
+
+ private List<ConnConfProperty> configuration;
+
+ /**
+ * Constructor.
+ *
+ * @param target request target.
+ * @param configuration connector configuration properties.
+ */
+ public ConnConfModEvent(final AjaxRequestTarget target, final List<ConnConfProperty> configuration) {
+ super(target);
+ this.configuration = configuration;
+ }
+
+ public List<ConnConfProperty> getConfiguration() {
+ return configuration;
+ }
+ }
+}
[21/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.properties
new file mode 100644
index 0000000..06ebaca
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.properties
@@ -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.
+audit=Audit
+lastExec=Last Execution
+nextExec=Next Execution
+latestExecStatus=Last status
+category=Category
+subcategory=Subcategory
+startDate=Start date
+endDate=End date
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_it.properties
new file mode 100644
index 0000000..24b62ba
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_it.properties
@@ -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.
+audit=Audit
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+latestExecStatus=Ultimo stato
+category=Categoria
+subcategory=Sottocategoria
+startDate=Data di avvio
+endDate=Data di conclusione
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_pt_BR.properties
new file mode 100644
index 0000000..c688a06
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports_pt_BR.properties
@@ -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.
+audit=Auditar
+lastExec=\u00daltima Execu\u00e7\u00e3o
+nextExec=Pr\u00f3xima Execu\u00e7\u00e3o
+latestExecStatus=\u00daltimo Estatus
+category=Categoria
+subcategory=Subcategoria
+startDate=Data de in\u00edcio
+endDate=Data Final
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.html
new file mode 100644
index 0000000..90b4da8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.html
@@ -0,0 +1,64 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="username"><wicket:message key="username"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="username">[username]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="securityQuestion"><span wicket:id="securityQuestionLabel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="securityQuestion">[securityQuestion]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="securityAnswer"><span wicket:id="securityAnswerLabel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="securityAnswer">[securityAnswer]</span>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.properties
new file mode 100644
index 0000000..4cc999a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage.properties
@@ -0,0 +1,21 @@
+# 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.
+securityQuestion=Security question
+title=Password reset
+username=User
+securityAnswer=Security answer
+submit=Submit
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_it.properties
new file mode 100644
index 0000000..77c1dd4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_it.properties
@@ -0,0 +1,21 @@
+# 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.
+securityQuestion=Domanda di sicurezza
+title=Password smarrita
+username=Utente
+securityAnswer=Risposta di sicurezza
+submit=Invia
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_pt_BR.properties
new file mode 100644
index 0000000..27728db
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RequestPasswordResetModalPage_pt_BR.properties
@@ -0,0 +1,21 @@
+# 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.
+securityQuestion=Pergunta de seguran\u00e7a
+title=Redefini\u00e7\u00e3o de senha
+username=Usu\u00e1rio
+securityAnswer=Resposta de seguran\u00e7a
+submit=Apresentar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.html
new file mode 100644
index 0000000..2316adc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.html
@@ -0,0 +1,64 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <span wicket:id="new"/> <wicket:message key="title"/> <span wicket:id="name"/>
+ </p>
+
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#resource"><span><wicket:message key="resource"/></span></a></li>
+ <li><a href="#umapping"><span><wicket:message key="umapping"/></span></a></li>
+ <li><a href="#rmapping"><span><wicket:message key="rmapping"/></span></a></li>
+ <li><a href="#connectorProperties"><span><wicket:message key="connectorProperties"/></span></a></li>
+ <li><a href="#security"><span><wicket:message key="security"/></span></a></li>
+ </ul>
+ <div id="resource">
+ <span wicket:id="details">[details]</span>
+ <span wicket:id="systeminformation">[System Information]</span>
+ </div>
+ <div id="umapping">
+ <span wicket:id="umapping">[umapping]</span>
+ </div>
+ <div id="rmapping">
+ <span wicket:id="rmapping">[rmapping]</span>
+ </div>
+ <div id="connectorProperties">
+ <span wicket:id="connconf">[connconf]</span>
+ </div>
+ <div id="security">
+ <span wicket:id="security">[security]</span>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties
new file mode 100644
index 0000000..561fe2e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage.properties
@@ -0,0 +1,60 @@
+# 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.
+resource=Resource details
+umapping=User mapping
+connectorProperties=Connector properties
+security=Security
+required_alert=All form fields are required
+connector=Connector
+existing_resources=Existing resources
+action=Action
+edit_attribute=Edit resource
+title=Resource
+extAttrNames=External attributes
+intMappingTypes=Internal mapping types
+entity=Entity
+roleSchema=Role Schema
+accountId=AccountId
+mandatoryCondition=Mandatory
+password=Password
+purpose=Purpose
+mappingUserSchema=Mapping User Schema
+mappingRoleSchema=Mapping Role Schema
+delete=Delete
+intAttrNames=Internal attributes
+enforceMandatoryCondition=Enforce mandatory condition
+fieldName=Field name
+
+accountIdValidation=There must be exactly one AccountId
+propagationMode=Propagation mode
+accountLink=Account link
+enable=Enable
+
+createTraceLevel=Create trace level
+updateTraceLevel=Update trace level
+deleteTraceLevel=Delete trace level
+syncTraceLevel=Synchronization trace level
+propagationPriority=Propagation priority
+propagationPrimary=Propagation primary
+
+success_connection=Successful connection
+error_connection=Connection failure
+check=Check connection
+actionsClasses=Actions classes
+rmapping=Role mapping
+new=New
+randomPwdIfNotProvided=Generate random passwords when missing
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties
new file mode 100644
index 0000000..2223b99
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_it.properties
@@ -0,0 +1,60 @@
+# 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.
+resource=Dettagli Risorsa
+umapping=Mapping utenti
+connectorProperties=Propriet\u00e0\u00a0 Connettore
+security=Sicurezza
+required_alert=Tutti i campi sono richiesti
+connector=Connettore
+existing_resources=Risorse esistenti
+action=Azione
+edit_attribute=Modifica risorsa
+title=Risorsa
+extAttrNames=Attributi esterni
+intMappingTypes=Tipo mapping interno
+entity=Entità
+roleSchema=Schema Ruolo
+accountId=AccountId
+mandatoryCondition=Obbligatorio
+password=Password
+purpose=Scopo
+mappingUserSchema=Mapping User Schema
+mappingRoleSchema=Mapping Role Schema
+delete=Rimuovi
+intAttrNames=Attributi interni
+enforceMandatoryCondition=Abilita mandatory condition
+fieldName=Nome campo
+
+accountIdValidation=Deve essere definito esattamente un AccountId
+propagationMode=Modalit\u00e0 di propagazione
+accountLink=Account link
+enable=Abilita
+
+createTraceLevel=Livello di tracciamento delle creazioni
+updateTraceLevel=Livello di tracciamento degli aggiornamenti
+deleteTraceLevel=Livello di tracciamento delle cancellazioni
+syncTraceLevel=Livello di tracciamento delle sincronizzazioni
+propagationPriority=Priorit\u00e0 in propagazione
+propagationPrimary=Primaria in propagazione
+
+success_connection=Connessione avvenuta con successo
+error_connection=Connessione non riuscita
+check=Verifica connessione
+actionsClasses=Classi azioni
+rmapping=Mapping ruoli
+new=Nuova
+randomPwdIfNotProvided=Genera password casuali se mancanti
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
new file mode 100644
index 0000000..4804deb
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
@@ -0,0 +1,60 @@
+# 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.
+resource=Detalhes de Recursos
+umapping=Mapeamento de usu\u00e1rios
+connectorProperties=Propriedades de Conectores
+security=Seguran\u00e7a
+required_alert=Todos os campos deste formul\u00e1rio s\u00e3o obrigat\u00f3rios
+connector=Conector
+existing_resources=Recursos Existentes
+action=A\u00e7\u00e3o
+edit_attribute=Alterar Recurso
+title=Recurso
+extAttrNames=Atributos Externos
+intMappingTypes=Tipos internos de mapeamentos
+entity=Entidade
+roleSchema=Esquema de Fun\u00e7\u00e3o
+accountId=Identificador da Conta
+mandatoryCondition=Obrigat\u00f3rio
+password=Senha
+purpose=Prop\u00f3sito
+mappingUserSchema=Esquema de mapeamento de usu\u00e1rio
+mappingRoleSchema=Esquema de mapeamento de fun\u00e7\u00e3o
+delete=Excluir
+intAttrNames=Atributos internos
+enforceMandatoryCondition=Aplicar condi\u00e7\u00e3o obrigat\u00f3ria
+fieldName=Nome do Campo
+
+accountIdValidation=Precisa ser exatamente um Identificador de Conta
+propagationMode=Modo de propaga\u00e7\u00e3o
+accountLink=Link de Conta
+enable=Habilitado
+
+createTraceLevel=Criar n\u00edvel de trace
+updateTraceLevel=Atualizar n\u00edvel de trace
+deleteTraceLevel=Excluir n\u00edvel de trace
+syncTraceLevel=N\u00edvel de trace de sincroniza\u00e7\u00e3o
+propagationPriority=Prioridade de propaga\u00e7\u00e3o
+propagationPrimary=Propaga\u00e7\u00e3o prim\u00e1ria
+
+success_connection=Conex\u00e3o com sucesso
+error_connection=Conex\u00e3o sem sucesso
+check=Verificar a conex\u00e3o
+actionsClasses=Classes de a\u00e7\u00f5es
+rmapping=Regra de Mapeamento
+new=novo
+randomPwdIfNotProvided=Gerar senhas aleat\u00f3rias quando n\u00e3o houver
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.html
new file mode 100644
index 0000000..6486a0e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.html
@@ -0,0 +1,99 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style type="text/css">
+ .true {
+ background-image: url(../../img/ok.png);
+ background-position: center center;
+ background-repeat: no-repeat;
+ height: 18px;
+ width: 65px;
+ }
+ .false {
+ width: 65px;
+ }
+ .narrowcolumn {
+ width: 120px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#tabs-1"><span><wicket:message key="tab1"/></span></a>
+ </li>
+ <li><a href="#tabs-2"><span><wicket:message key="tab2"/></span></a></li>
+ </ul>
+ <div id="tabs-1">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="resourceContainer">
+ <span wicket:id="resourceDatatable">[resources]</span>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="resourcePaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="statusModal">[Show modal window for provisioning status]</div>
+ <div wicket:id="createResourceWin">[Show modal window for creating resource]</div>
+ <div wicket:id="editResourceWin">[Show modal window for editing resource]</div>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="createResourceLink">
+ <wicket:message key="create-resource"/>
+ </a>
+ </div>
+ <div id="tabs-2">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="connectorContainer">
+ <span wicket:id="connectorDatatable">[connectors]</span>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="connectorPaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="createConnectorWin">[Show modal window for creating connector]</div>
+ <div wicket:id="editConnectorWin">[Show modal window for editing connector]</div>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="createConnectorLink">
+ <wicket:message key="create-connector"/>
+ </a>
+ </div>
+
+ <div>
+ <a href="#" style="position: absolute; top: 4px; right:20px;" wicket:id="reloadLink">
+ <img src="img/reload_30.png" width="25" height="25"
+ alt="Reload connectors" title="title" wicket:message="title:reloadConnectors"/>
+ </a>
+ </div>
+ </div>
+
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.properties
new file mode 100644
index 0000000..fb6b8a1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources.properties
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Resources
+edit=Edit
+delete=Delete
+create-resource=Create
+propagationPriority=Propagation priority
+propagationPrimary=Propagation primary
+
+tab2=Connectors
+displayName=Display name
+version=Version
+bundleName=Bundle name
+edit=Edit
+delete=Delete
+create-connector=Create
+delete_error=Operation forbidden:the connector you're trying to delete is connected to a Resource
+connector=Connector
+reloadConnectors=Reload connectors
+confirmReloadConnectors=This request is potentially dangerous for running operations, continue?
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_it.properties
new file mode 100644
index 0000000..80a5185
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_it.properties
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Risorse
+edit=Modifica
+delete=Rimuovi
+create-resource=Crea
+propagationPriority=Priorit\u00e0 in propagazione
+propagationPrimary=Primaria in propagazione
+
+tab2=Connettori
+create-connector=Crea
+version=Versione
+bundleName=Bundle name
+edit=Modifica
+delete=Elimina
+delete_error=Operazione vietata: il connettore che si desidera rimuovere \u00e8 correlato ad una risorsa
+displayName=Nome visualizzato
+connector=Connettore
+reloadConnectors=Ricarica connettori
+confirmReloadConnectors=Questa richiesta \u00e8 potenzialmente dannosa per le operazioni in corso, proseguire?
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_pt_BR.properties
new file mode 100644
index 0000000..a631352
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Resources_pt_BR.properties
@@ -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.
+tab1=Recursos
+edit=Alterar
+delete=Excluir
+create-resource=Criar
+propagationPriority=Prioridade de propaga\u00e7\u00e3o
+propagationPrimary=Propaga\u00e7\u00e3o prim\u00e1ria
+
+tab2=Conectores
+displayName=Mostar
+version=Vers\u00e3o
+bundleName=Nome do Pacote
+create-connector=Criar
+delete_error=Opera\u00e7\u00e3o n\u00e3o permitida\: o conector que voc\u00ea est\u00e1 tentando excluir est\u00e1 conectado a um recurso
+connector=Conector
+reloadConnectors=Carregar Conector
+confirmReloadConnectors=Esta requis\u00e7\u00e3o \u00e9 potencialmente perigosa para opera\u00e7\u00f5es em execu\u00e7\u00e3o, prosseguir?
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.html
new file mode 100644
index 0000000..647a311
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.html
@@ -0,0 +1,226 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ div#propagation {
+ font-size: 8px;
+ height: auto;
+ margin-top: 3px;
+ text-align: left;
+ }
+
+ div#status {
+ float: left;
+ height: 25px;
+ margin-top: 3px;
+ text-align: center;
+ width: 8%;
+ }
+
+ div.assignment {
+ border: 1px solid #DDDDDD;
+ display: inline-table;
+ margin-bottom: 20px;
+ width: 100%;
+ }
+
+ div.assignments {
+ color: #555555;
+ display: inline-table;
+ margin-top: 20px;
+ width: 100%;
+ }
+
+ div.header {
+ display: inline-table;
+ margin: 5px;
+ width: 98%;
+ }
+
+ div.profile div#row{
+ display: inline-table;
+ width:100%;
+ vertical-align: middle;
+ }
+
+ div.profile {
+ background-color: #EEEEEE;
+ color: #555555;
+ display: inline-table;
+ margin: 0px 5px 5px 5px;
+ width: 98%;
+ }
+
+ div#name {
+ border-bottom: 1px solid #DDDDDD;
+ display: table-cell;
+ height: 15px;
+ width: 220px;
+ padding: 0px 5px 0px 5px;
+ vertical-align: middle;
+ }
+
+ div#value {
+ border-bottom: 1px solid #DDDDDD;
+ border-left: 1px solid #DDDDDD;
+ display: table-cell;
+ height: 15px;
+ width: 38%;
+ padding: 0px 5px 0px 5px;
+ overflow: hidden;
+ vertical-align: middle;
+ }
+
+ div#resource {
+ display: table-cell;
+ width: 220px;
+ height: 30px;
+ padding: 10px 0px 5px 0px;
+ }
+
+ div#resource img{
+ width: 12px;
+ height: 12px;
+ position: relative;
+ left: 3px;
+ top: 1px;
+ opacity: 1;
+ }
+
+ div#attrhead {
+ display: table-cell;
+ border-left: 1px solid #DDDDDD;
+ width: 38%;
+ height: 30px;
+ padding: 3px 0px 5px 0px;
+ text-align: center;
+ vertical-align: middle;
+ font-size: 11px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+
+ <wicket:fragment wicket:id="propagationResultFrag">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="operationResult"/> <span wicket:id="info"/>
+ </p>
+
+ <div class="assignments">
+ <div wicket:id="resources" class="assignment">
+
+ <span wicket:id="attrhead">[Attributes head]</span>
+
+ <div class="profile">
+ <span wicket:id="attrs">
+ <div id="row">
+ <div id="name">
+ <span wicket:id="attrName">[Attribute name]</span>
+ </div>
+ <div id="value">
+ <span wicket:id="beforeValue">[Before value]</span>
+ </div>
+ <div id="value">
+ <span wicket:id="afterValue">[After value]</span>
+ </div>
+ </div>
+ </span>
+ </div>
+ </div>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="userSelfResultFrag">
+ <p><wicket:message key="selfResult"/></p>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="remoteStatusFrag">
+ <img wicket:id="status"/>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="attrValueFrag">
+ <span wicket:id="value">[After value]</span>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="attrHeadFrag">
+ <div class="header alt">
+ <div id="resource">
+ <div>
+ <span wicket:id="resource">[resource name]</span>
+ <a wicket:id="showFailureWindow" href="#">
+ <img wicket:id="icon"/>
+ </a>
+
+ <div id="propagation">
+ <wicket:message key="propresult">[propagation result message]</wicket:message>
+
+ <span wicket:id="propagation">[propagation result]</span>
+ </div>
+
+ <div wicket:id="failureWindow"></div>
+
+ </div>
+ </div>
+
+ <div id="attrhead">
+ <wicket:message key="before">[before]</wicket:message>
+ </div>
+
+ <div id="attrhead">
+ <wicket:message key="after">[after]</wicket:message>
+ </div>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="emptyAttrHeadFrag">
+ <div class="header alt">
+ <div id="resource">
+ <div>
+ <span wicket:id="resource">[resource name]</span>
+ <a wicket:id="showFailureWindow" href="#">
+ <img wicket:id="icon"/>
+ </a>
+
+ <div id="propagation">
+ <wicket:message key="propresult">[propagation result message]</wicket:message>
+
+ <span wicket:id="propagation">[propagation result]</span>
+ <div wicket:id="failureWindow"></div>
+
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="emptyFrag">
+ </wicket:fragment>
+
+ <div wicket:id="container" id="users-contain" class="ui-widget" style="margin:30px; width:inherit">
+
+ <span wicket:id="resultFrag"/>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="close">
+ <wicket:message key="close"/>
+ </a>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.properties
new file mode 100644
index 0000000..3ee25f8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage.properties
@@ -0,0 +1,26 @@
+# 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.
+operationResult=Operation result for
+close=Close
+selfResult=Your request has been registered: depending on configuration, approval might be required.
+__NAME__=Account Link
+__UID__=Account Id
+__PASSWORD__=Password
+__ENABLE__=Enabled
+propresult=Propagation:
+before=Before propagation
+after=After propagation
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_it.properties
new file mode 100644
index 0000000..92ee70e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_it.properties
@@ -0,0 +1,26 @@
+# 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.
+operationResult=Risultato dell'operazione per
+close=Chiudi
+selfResult=La sua richiesta \u00e8 stata presa in carico: se la configurazione lo prevede, sar\u00e0 necessaria l'approvazione.
+__NAME__=Account Link
+__UID__=Account Id
+__PASSWORD__=Password
+__ENABLE__=Abilitato
+propresult=Propagazione:
+before=Prima della propagazione
+after=Dopo la propagazione
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_pt_BR.properties
new file mode 100644
index 0000000..319d1c9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResultStatusModalPage_pt_BR.properties
@@ -0,0 +1,26 @@
+# 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.
+operationResult=Resultado de opera\u00E7\u00E3o para\:
+close=Fechar
+selfResult=Sua requis\u00E7\u00E3o foi registrada e ser\u00E1 encaminhada ao administrador respons\u00E1vel. Obrigado
+__NAME__=Link de conta
+__UID__=Identificador de Conta
+__PASSWORD__=Senha
+__ENABLE__=Habilitado
+propresult=Propaga\u00E7\u00E3o
+before=Antes da Propaga\u00E7\u00E3o
+after=Depois da Propaga\u00E7\u00E3o
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
new file mode 100644
index 0000000..3f54815
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
@@ -0,0 +1,52 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/> <span wicket:id="displayName"/>
+ </p>
+ <form wicket:id="roleForm">
+ <div id="tabs">
+ <div style="display: block; clear: both">
+ <ul>
+ <li><a href="#details"><span><wicket:message key="details"/></span></a></li>
+ <li><a href="#templates"><span><wicket:message key="templates"/></span></a></li>
+ <li><a href="#attrs"><span><wicket:message key="attrs"/></span></a></li>
+ <li><a href="#derAttrs"><span><wicket:message key="derAttrs"/></span></a></li>
+ <li><a href="#virAttrs"><span><wicket:message key="virAttrs"/></span></a></li>
+ <li><a href="#resources"><span><wicket:message key="resources"/></span></a></li>
+ <li><a href="#entitlements"><span><wicket:message key="entitlements"/></span></a></li>
+ <li><a href="#security"><span><wicket:message key="security"/></span></a></li>
+ </ul>
+ </div>
+ <div wicket:id="rolePanel"></div>
+ </div>
+ <div style="bottom:0;margin:10px">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="submit"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
new file mode 100644
index 0000000..37091a0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+required_alert=All form fields are required.
+title=Role
+details=Details
+attrs=Attributes
+tab3=Derived attributes
+tab4=Virtual attributes
+resources=Resources
+entitlements=Entitlements
+security=Security
+add=+
+drop=-
+error=Generic error occurred during the operation
+firstResourcesList=Role's resources
+secondResourcesList=Available resources
+firstEntitlementsList=Role's entitlements
+secondEntitlementsList=Available entitlements
+derAttrs=Derived Attributes
+derAttrToRemove=Delete
+derAttrName=Name
+derAttrValue=Derived value
+
+virAttrs=Virtual Attributes
+virAttrToRemove=Delete
+virAttrName=Name
+virAttrValue=Virtual value
+
+addAttributeBtn=Add
+
+inheritAttrs=Inherit attributes
+inheritDerAttrs=Inherit derived attributes
+inheritVirAttrs=Inherit virtual attributes
+templates=Templates
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
new file mode 100644
index 0000000..cf2017e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+required_alert=All form fields are required.
+title=Ruolo
+details=Dettagli
+attrs=Attributi
+tab3=Attributi derivati
+tab4=Attributi virtuali
+resources=Risorse
+entitlements=Entitlement
+security=Sicurezza
+add=+
+drop=-
+error=Errore generico durante l'operazione
+firstResourcesList=Risorse ruolo
+secondResourcesList=Risorse disponibili
+firstResourcesList=Entitlement ruolo
+secondResourcesList=Entitlement disponibili
+derAttrs=Attributi derivati
+derAttrToRemove=Elimina
+derAttrName=Nome
+derAttrValue=Valore derivato
+
+virAttrs=Attributi virtuali
+virAttrToRemove=Elimina
+virAttrName=Nome
+virAttrValue=Valore virtuale
+
+addAttributeBtn=Aggiungi
+
+inheritAttrs=Eredita attributi
+inheritDerAttrs=Eredita attributi derivati
+inheritVirAttrs=Eredita attributi virtuali
+templates=Modelo
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
new file mode 100644
index 0000000..f588e75
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
+title=Fun\u00e7\u00e3o
+details=Detalhes
+attrs=Atributos
+tab3=Atributos Derivados
+tab4=Atributos Virtuais
+resources=Recursos
+entitlements=Direitos
+security=Seguran\u00e7a
+add=+
+drop=-
+error=Um erro gen\u00e9rico ocorreu durante a opera\u00e7\u00e3o
+firstResourcesList=Recursos de fun\u00e7\u00f5es
+secondResourcesList=Recursos dispon\u00edveis
+firstEntitlementsList=Direitos de fun\u00e7\u00f5es
+secondEntitlementsList=Direitos dispon\u00edveis
+derAttrs=Atributos derivados
+derAttrToRemove=Exluir
+derAttrName=Nome
+derAttrValue=Valor Derivado
+
+virAttrs=Atributos Virtuais
+virAttrToRemove=Excluir
+virAttrName=Nome
+virAttrValue=Valor Virtual
+
+addAttributeBtn=Adicionar
+
+inheritAttrs=Atributos Herdados
+inheritDerAttrs=Atributos Derivados Herdados
+inheritVirAttrs=Atributos Virtuais Herdados
+templates=Modelli
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleSelectModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleSelectModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleSelectModalPage.html
new file mode 100644
index 0000000..9e9ef59
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleSelectModalPage.html
@@ -0,0 +1,22 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <div wicket:id="treeTable"
+ style="width: 100%;display:block;margin:auto;" class="roleTable role-tree"/>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.html
new file mode 100644
index 0000000..f8981a9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ div.role-tree div.wicket-tree-table a {
+ color:black;
+ }
+ </style>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#roletabs").tabs();
+ });
+ </script>
+ </wicket:head>
+ <wicket:extend>
+ <div id="roletabs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#tabs-tree">
+ <span><wicket:message key="tabs-tree"/>
+ </span>
+ </a>
+ </li>
+ <li>
+ <a href="#tabs-search">
+ <span><wicket:message key="tabs-search"/>
+ </span>
+ </a>
+ </li>
+ </ul>
+
+ <div id="tabs-tree" >
+ <div wicket:id="roleTabsContainer">
+ <span wicket:id="treePanel"></span>
+ <span wicket:id="summaryPanel"></span>
+ </div>
+ <div wicket:id="editRoleWin">[Show modal window for create/editing role]</div>
+ </div>
+
+ <div id="tabs-search">
+ <div>
+ <form wicket:id="searchForm">
+ <span wicket:id="searchPanel">searchPanel</span>
+
+ <br/>
+ <a wicket:id="search"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <img src="img/search.png" alt="search"/>
+ <wicket:message key="search"/>
+ </a>
+ </form>
+ </div>
+
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="searchResult">[search result]</span>
+ </div>
+ </div>
+
+ </div>
+
+ <wicket:child/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.properties
new file mode 100644
index 0000000..bfe9385
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles.properties
@@ -0,0 +1,26 @@
+# 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.
+tabs-tree=Tree
+tabs-search=Search
+search=Search
+create_user=Create new user
+search_results_title=Search results
+search_noResults=No matches found.
+reset=Reset
+showingFrom=Showing
+showingTo=to
+showingOf=of
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_it.properties
new file mode 100644
index 0000000..76e69f7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_it.properties
@@ -0,0 +1,26 @@
+# 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.
+tabs-tree=Albero
+tabs-search=Ricerca
+search=Cerca
+create_user=Crea nuovo utente
+search_results_title=Risultati ricerca:
+search_noResults=Nessuna corrispondenza trovata.
+reset=Reset
+showingFrom=Risultati da
+showingTo=a
+showingOf=di
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_pt_BR.properties
new file mode 100644
index 0000000..8d80401
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Roles_pt_BR.properties
@@ -0,0 +1,26 @@
+# 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.
+tabs-tree=\u00C1rvore
+tabs-search=Buscar
+search=Buscar
+create_user=Criar novo usu\u00E1rio
+search_results_title=Resultados da busca
+search_noResults=N\u00E3o foram encontrados resultados
+reset=Resetar
+showingFrom=Mostrando
+showingTo=para
+showingOf=de
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.html
new file mode 100644
index 0000000..a237c27
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.html
@@ -0,0 +1,49 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link rel="stylesheet" type="text/css" href="webjars/codemirror/${codemirror.version}/lib/codemirror.css"/>
+
+ <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/lib/codemirror.js"></script>
+ <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/mode/xml/xml.js"></script>
+ <script type="text/javascript">
+ function updateTextArea(editor) {
+ document.getElementById("routeDefForm").elements["routeContent"].value = editor.getValue();
+ }
+ </script>
+ </wicket:head>
+ <wicket:extend>
+ <form wicket:id="routeDefForm" id="routeDefForm">
+ <textarea wicket:id="routeContent" id="routeContent" name="routeContent" style="width: 100%; height: 350px;">
+ </textarea>
+ <div style="margin: 10px;">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"
+ onclick=""/>
+ </div>
+ </form>
+ <script>
+ window.onload = function(){
+ var editor = CodeMirror.fromTextArea(document.getElementById("routeContent"),{lineNumbers: true});
+ editor.on("change", updateTextArea);
+ }
+ </script>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.properties
new file mode 100644
index 0000000..8ac2655
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Edit route
+id=id
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_it.properties
new file mode 100644
index 0000000..44663f7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_it.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Modifica le rotte
+id=id
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_pt_BR.properties
new file mode 100644
index 0000000..a6395a0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RouteModalPage_pt_BR.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Editar rotas
+id=id
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
new file mode 100644
index 0000000..42be774
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
@@ -0,0 +1,136 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#crontab"><span><wicket:message key="crontab"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="description"><wicket:message key="description"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="description">[description]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="jobClassName"><wicket:message key="class"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="jobClassName">[jobClassName]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="lastExec"><wicket:message key="lastExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="lastExec">[lastExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="nextExec"><wicket:message key="nextExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="nextExec">[nextExec]</span>
+ </div>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ $(function() {
+ $('#formtable div.tablerow:even').addClass("alt");
+ });
+ </script>
+ </span>
+ </div>
+ </div>
+ <div id="crontab">
+ <span wicket:id="crontab">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <label for="cron"><wicket:message key="cron"/></label>
+ </div>
+ <div class="tablerow">
+ <input type="text" id="seconds" class="text ui-widget-content ui-corner-all" wicket:id="seconds" style="width: 50px;float: left" />
+ <input type="text" id="minutes" class="text ui-widget-content ui-corner-all" wicket:id="minutes" style="width: 50px;float: left" />
+ <input type="text" id="hours" class="text ui-widget-content ui-corner-all" wicket:id="hours" style="width: 50px;float: left" />
+ <input type="text" id="daysOfMonth" class="text ui-widget-content ui-corner-all" wicket:id="daysOfMonth" style="width: 50px;float: left" />
+ <input type="text" id="months" class="text ui-widget-content ui-corner-all" wicket:id="months" style="width: 50px;float: left" />
+ <input type="text" id="daysOfWeek" class="text ui-widget-content ui-corner-all" wicket:id="daysOfWeek" style="width: 50px" />
+ </div>
+ <div class="tablerow alt">
+ <label for="cronExpression"><wicket:message key="templates"/></label>
+ </div>
+ <div class="tablerow">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="cronTemplateChooser" style="width: 250px"/>
+ </div>
+ </div>
+ </span>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
+ </span>
+ </div>
+ </div>
+ <div style="margin: 20px 10px 0">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="apply"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.properties
new file mode 100644
index 0000000..3e0f41c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.properties
@@ -0,0 +1,36 @@
+# 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.
+profile=Profile
+crontab=Schedule
+executions=Executions
+title=Task
+class=Class
+name=Name
+description=Description
+lastExec=Last Execution
+nextExec=Next Execution
+cron=Schedule (seconds, minutes, hours, days of month, months, days of week)
+templates=Remove task from scheduler / Use a template to schedule
+apply=Save
+startDate=Start date
+endDate=End date
+status=Status
+message=Message
+taskExecutions=Task executions
+delete=Delete
+showMessage=Show
+chooseForTemplate=Use A Template
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_it.properties
new file mode 100644
index 0000000..fefc847
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_it.properties
@@ -0,0 +1,36 @@
+# 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.
+profile=Profilo
+crontab=Schedule
+executions=Esecuzioni
+title=Task
+class=Classe
+name=Nome
+description=Descrizione
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+cron=Schedule (secondi, minuti, ore, giorni del mese, mesi, giorni della settimana)
+templates=Rimuovi task dallo scheduler / Utilizza un template per schedulare
+apply=Salva
+startDate=Data di avvio
+endDate=Data di conclusione
+status=Stato
+message=Messaggio
+taskExecutions=Esecuzione del task
+delete=Rimozione
+showMessage=Mostra
+chooseForTemplate=Usa Un Template
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_pt_BR.properties
new file mode 100644
index 0000000..36738b8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage_pt_BR.properties
@@ -0,0 +1,36 @@
+# 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.
+profile=Perfil
+crontab=Agenda
+executions=Execu\u00E7\u00F5es
+title=Tarefa
+class=Classe
+name=Nome
+description=Descri\u00E7\u00E3o
+lastExec=\u00DAltima execu\u00E7\u00E3o
+nextExec=Pr\u00F3xima Execu\u00E7\u00E3o
+cron=Agendar (segundos, minutos, horas, dias do m\u00EAs, meses, dias da semana)
+templates=Remover tarefa do agendamento / Usar template para agendar
+apply=Salvar
+startDate=Data de In\u00EDcio
+endDate=Data de Conclus\u00E3o
+status=Estatus
+message=Mensagem
+taskExecutions=Execu\u00E7\u00E3o de Tarefas
+delete=Excluir
+showMessage=Mostrar
+chooseForTemplate=Usar um template
[41/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
new file mode 100644
index 0000000..b52864d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/Configuration.java
@@ -0,0 +1,756 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.io.File;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.apache.syncope.client.console.commons.AttrLayoutType;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.HttpResourceStream;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.panels.LayoutsPanel;
+import org.apache.syncope.client.console.panels.PoliciesPanel;
+import org.apache.syncope.client.console.rest.LoggerRestClient;
+import org.apache.syncope.client.console.rest.NotificationRestClient;
+import org.apache.syncope.client.console.rest.SecurityQuestionRestClient;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.CollectionPropertyColumn;
+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.wicket.markup.html.link.VeilPopupSettings;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.to.LoggerTO;
+import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.syncope.common.lib.types.LoggerLevel;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.wicket.Page;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.PropertyListView;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
+import org.apache.wicket.request.resource.ContentDisposition;
+import org.apache.wicket.request.resource.DynamicImageResource;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Configurations WebPage.
+ */
+public class Configuration extends BasePage {
+
+ private static final long serialVersionUID = -2838270869037702214L;
+
+ private static final int SYNCOPECONF_WIN_HEIGHT = 300;
+
+ private static final int SYNCOPECONF_WIN_WIDTH = 900;
+
+ private static final int NOTIFICATION_WIN_HEIGHT = 500;
+
+ private static final int NOTIFICATION_WIN_WIDTH = 1100;
+
+ private static final int SECURITY_QUESTION_WIN_HEIGHT = 300;
+
+ private static final int SECURITY_QUESTION_WIN_WIDTH = 900;
+
+ @SpringBean
+ private LoggerRestClient loggerRestClient;
+
+ @SpringBean
+ private NotificationRestClient notificationRestClient;
+
+ @SpringBean
+ private SecurityQuestionRestClient securityQuestionRestClient;
+
+ @SpringBean
+ private WorkflowRestClient wfRestClient;
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private final ModalWindow syncopeConfWin;
+
+ private final ModalWindow createNotificationWin;
+
+ private final ModalWindow editNotificationWin;
+
+ private final ModalWindow createSecurityQuestionWin;
+
+ private final ModalWindow editSecurityQuestionWin;
+
+ private WebMarkupContainer notificationContainer;
+
+ private WebMarkupContainer securityQuestionContainer;
+
+ private int notificationPaginatorRows;
+
+ public Configuration() {
+ super();
+
+ add(syncopeConfWin = new ModalWindow("syncopeConfWin"));
+ syncopeConfWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ syncopeConfWin.setInitialHeight(SYNCOPECONF_WIN_HEIGHT);
+ syncopeConfWin.setInitialWidth(SYNCOPECONF_WIN_WIDTH);
+ syncopeConfWin.setCookieName("syncopeconf-modal");
+ setupSyncopeConf();
+
+ add(new PoliciesPanel("passwordPoliciesPanel", getPageReference(), PolicyType.PASSWORD));
+ add(new PoliciesPanel("accountPoliciesPanel", getPageReference(), PolicyType.ACCOUNT));
+ add(new PoliciesPanel("syncPoliciesPanel", getPageReference(), PolicyType.SYNC));
+
+ add(createNotificationWin = new ModalWindow("createNotificationWin"));
+ createNotificationWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ createNotificationWin.setInitialHeight(NOTIFICATION_WIN_HEIGHT);
+ createNotificationWin.setInitialWidth(NOTIFICATION_WIN_WIDTH);
+ createNotificationWin.setCookieName("create-notification-modal");
+ add(editNotificationWin = new ModalWindow("editNotificationWin"));
+ editNotificationWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editNotificationWin.setInitialHeight(NOTIFICATION_WIN_HEIGHT);
+ editNotificationWin.setInitialWidth(NOTIFICATION_WIN_WIDTH);
+ editNotificationWin.setCookieName("edit-notification-modal");
+ setupNotification();
+
+ add(createSecurityQuestionWin = new ModalWindow("createSecurityQuestionWin"));
+ createSecurityQuestionWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ createSecurityQuestionWin.setInitialHeight(SECURITY_QUESTION_WIN_HEIGHT);
+ createSecurityQuestionWin.setInitialWidth(SECURITY_QUESTION_WIN_WIDTH);
+ createSecurityQuestionWin.setCookieName("create-security-question-modal");
+ add(editSecurityQuestionWin = new ModalWindow("editSecurityQuestionWin"));
+ editSecurityQuestionWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ editSecurityQuestionWin.setInitialHeight(SECURITY_QUESTION_WIN_HEIGHT);
+ editSecurityQuestionWin.setInitialWidth(SECURITY_QUESTION_WIN_WIDTH);
+ editSecurityQuestionWin.setCookieName("edit-security-question-modal");
+ setupSecurityQuestion();
+
+ // Workflow definition stuff
+ WebMarkupContainer noActivitiEnabledForUsers = new WebMarkupContainer("noActivitiEnabledForUsers");
+ noActivitiEnabledForUsers.setOutputMarkupPlaceholderTag(true);
+ add(noActivitiEnabledForUsers);
+
+ WebMarkupContainer workflowDefContainer = new WebMarkupContainer("workflowDefContainer");
+ workflowDefContainer.setOutputMarkupPlaceholderTag(true);
+
+ if (wfRestClient.isActivitiEnabledForUsers()) {
+ noActivitiEnabledForUsers.setVisible(false);
+ } else {
+ workflowDefContainer.setVisible(false);
+ }
+
+ BookmarkablePageLink<Void> activitiModeler =
+ new BookmarkablePageLink<Void>("activitiModeler", ActivitiModelerPopupPage.class);
+ activitiModeler.setPopupSettings(new VeilPopupSettings().setHeight(600).setWidth(800));
+ MetaDataRoleAuthorizationStrategy.authorize(activitiModeler, ENABLE,
+ xmlRolesReader.getEntitlement("Configuration", "workflowDefRead"));
+ workflowDefContainer.add(activitiModeler);
+ // Check if Activiti Modeler directory is found
+ boolean activitiModelerEnabled = false;
+ try {
+ String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
+ WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
+ File baseDir = new File(activitiModelerDirectory);
+ activitiModelerEnabled = baseDir.exists() && baseDir.canRead() && baseDir.isDirectory();
+ } catch (Exception e) {
+ LOG.error("Could not check for Activiti Modeler directory", e);
+ }
+ activitiModeler.setEnabled(activitiModelerEnabled);
+
+ BookmarkablePageLink<Void> xmlEditor = new BookmarkablePageLink<>("xmlEditor", XMLEditorPopupPage.class);
+ xmlEditor.setPopupSettings(new VeilPopupSettings().setHeight(480).setWidth(800));
+ MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE,
+ xmlRolesReader.getEntitlement("Configuration", "workflowDefRead"));
+ workflowDefContainer.add(xmlEditor);
+
+ Image workflowDefDiagram = new Image("workflowDefDiagram", new Model()) {
+
+ private static final long serialVersionUID = -8457850449086490660L;
+
+ @Override
+ protected IResource getImageResource() {
+ return new DynamicImageResource() {
+
+ private static final long serialVersionUID = 923201517955737928L;
+
+ @Override
+ protected byte[] getImageData(final IResource.Attributes attributes) {
+ return wfRestClient.isActivitiEnabledForUsers()
+ ? wfRestClient.getDiagram()
+ : new byte[0];
+ }
+ };
+ }
+ };
+ workflowDefContainer.add(workflowDefDiagram);
+
+ MetaDataRoleAuthorizationStrategy.authorize(workflowDefContainer, ENABLE,
+ xmlRolesReader.getEntitlement("Configuration", "workflowDefRead"));
+ add(workflowDefContainer);
+
+ // Logger stuff
+ PropertyListView<LoggerTO> coreLoggerList =
+ new LoggerPropertyList(null, "corelogger", loggerRestClient.listLogs());
+ WebMarkupContainer coreLoggerContainer = new WebMarkupContainer("coreLoggerContainer");
+ coreLoggerContainer.add(coreLoggerList);
+ coreLoggerContainer.setOutputMarkupId(true);
+
+ MetaDataRoleAuthorizationStrategy.authorize(coreLoggerContainer, ENABLE, xmlRolesReader.getEntitlement(
+ "Configuration", "logList"));
+ add(coreLoggerContainer);
+
+ ConsoleLoggerController consoleLoggerController = new ConsoleLoggerController();
+ PropertyListView<LoggerTO> consoleLoggerList =
+ new LoggerPropertyList(consoleLoggerController, "consolelogger", consoleLoggerController.getLoggers());
+ WebMarkupContainer consoleLoggerContainer = new WebMarkupContainer("consoleLoggerContainer");
+ consoleLoggerContainer.add(consoleLoggerList);
+ consoleLoggerContainer.setOutputMarkupId(true);
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ consoleLoggerContainer, ENABLE, xmlRolesReader.getEntitlement("Configuration", "logList"));
+ add(consoleLoggerContainer);
+
+ add(new LayoutsPanel("adminUserLayoutPanel", AttrLayoutType.ADMIN_USER, feedbackPanel));
+ add(new LayoutsPanel("selfUserLayoutPanel", AttrLayoutType.SELF_USER, feedbackPanel));
+ add(new LayoutsPanel("adminRoleLayoutPanel", AttrLayoutType.ADMIN_ROLE, feedbackPanel));
+ add(new LayoutsPanel("selfRoleLayoutPanel", AttrLayoutType.SELF_ROLE, feedbackPanel));
+ add(new LayoutsPanel("adminMembershipLayoutPanel", AttrLayoutType.ADMIN_MEMBERSHIP, feedbackPanel));
+ add(new LayoutsPanel("selfMembershipLayoutPanel", AttrLayoutType.SELF_MEMBERSHIP, feedbackPanel));
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private void setupSyncopeConf() {
+ final WebMarkupContainer parameters = new WebMarkupContainer("parameters");
+ parameters.setOutputMarkupId(true);
+ add(parameters);
+
+ setWindowClosedCallback(syncopeConfWin, parameters);
+
+ AjaxLink<Void> confLink = new IndicatingAjaxLink<Void>("confLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ syncopeConfWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ConfModalPage(getPageReference(), editNotificationWin, parameters);
+ }
+ });
+
+ syncopeConfWin.show(target);
+ }
+ };
+ parameters.add(confLink);
+
+ Link<Void> dbExportLink = new Link<Void>("dbExportLink") {
+
+ private static final long serialVersionUID = -4331619903296515985L;
+
+ @Override
+ public void onClick() {
+ try {
+ HttpResourceStream stream = new HttpResourceStream(confRestClient.dbExport());
+
+ ResourceStreamRequestHandler rsrh = new ResourceStreamRequestHandler(stream);
+ rsrh.setFileName(stream.getFilename() == null ? "content.xml" : stream.getFilename());
+ rsrh.setContentDisposition(ContentDisposition.ATTACHMENT);
+
+ getRequestCycle().scheduleRequestHandlerAfterCurrent(rsrh);
+ } catch (Exception e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ }
+ }
+ };
+ MetaDataRoleAuthorizationStrategy.authorize(
+ dbExportLink, ENABLE, xmlRolesReader.getEntitlement("Configuration", "export"));
+ add(dbExportLink);
+ }
+
+ private void setupNotification() {
+ notificationPaginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_NOTIFICATION_PAGINATOR_ROWS);
+
+ final List<IColumn<NotificationTO, String>> notificationCols = new ArrayList<IColumn<NotificationTO, String>>();
+ notificationCols.add(new PropertyColumn<NotificationTO, String>(
+ new ResourceModel("id"), "id", "id"));
+ notificationCols.add(new CollectionPropertyColumn<NotificationTO>(
+ new ResourceModel("events"), "events", "events"));
+ notificationCols.add(new PropertyColumn<NotificationTO, String>(
+ new ResourceModel("subject"), "subject", "subject"));
+ notificationCols.add(new PropertyColumn<NotificationTO, String>(
+ new ResourceModel("template"), "template", "template"));
+ notificationCols.add(new PropertyColumn<NotificationTO, String>(
+ new ResourceModel("traceLevel"), "traceLevel", "traceLevel"));
+ notificationCols.add(new PropertyColumn<NotificationTO, String>(
+ new ResourceModel("active"), "active", "active"));
+
+ notificationCols.add(new AbstractColumn<NotificationTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<NotificationTO>> cellItem, final String componentId,
+ final IModel<NotificationTO> model) {
+
+ final NotificationTO notificationTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ editNotificationWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new NotificationModalPage(Configuration.this.getPageReference(),
+ editNotificationWin, notificationTO, false);
+ }
+ });
+
+ editNotificationWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Notification");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ notificationRestClient.delete(notificationTO.getKey());
+ } catch (SyncopeClientException e) {
+ LOG.error("While deleting a notification", e);
+ error(e.getMessage());
+ return;
+ }
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ feedbackPanel.refresh(target);
+ target.add(notificationContainer);
+ }
+ }, ActionLink.ActionType.DELETE, "Notification");
+
+ cellItem.add(panel);
+ }
+ });
+
+ final AjaxFallbackDefaultDataTable<NotificationTO, String> notificationTable =
+ new AjaxFallbackDefaultDataTable<NotificationTO, String>(
+ "notificationTable", notificationCols, new NotificationProvider(), notificationPaginatorRows);
+
+ notificationContainer = new WebMarkupContainer("notificationContainer");
+ notificationContainer.add(notificationTable);
+ notificationContainer.setOutputMarkupId(true);
+
+ add(notificationContainer);
+
+ setWindowClosedCallback(createNotificationWin, notificationContainer);
+ setWindowClosedCallback(editNotificationWin, notificationContainer);
+
+ AjaxLink<Void> createNotificationLink = new AjaxLink<Void>("createNotificationLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ createNotificationWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new NotificationModalPage(Configuration.this.getPageReference(), createNotificationWin,
+ new NotificationTO(), true);
+ }
+ });
+
+ createNotificationWin.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(createNotificationLink, ENABLE, xmlRolesReader.getEntitlement(
+ "Notification", "create"));
+ add(createNotificationLink);
+
+ @SuppressWarnings("rawtypes")
+ Form notificationPaginatorForm = new Form("notificationPaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this,
+ "notificationPaginatorRows"), prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_NOTIFICATION_PAGINATOR_ROWS, String.valueOf(
+ notificationPaginatorRows));
+ notificationTable.setItemsPerPage(notificationPaginatorRows);
+
+ target.add(notificationContainer);
+ }
+ });
+
+ notificationPaginatorForm.add(rowsChooser);
+ add(notificationPaginatorForm);
+ }
+
+ private void setupSecurityQuestion() {
+ final List<IColumn<SecurityQuestionTO, String>> securityQuestionCols =
+ new ArrayList<IColumn<SecurityQuestionTO, String>>();
+ securityQuestionCols.add(new PropertyColumn<SecurityQuestionTO, String>(
+ new ResourceModel("id"), "id", "id"));
+ securityQuestionCols.add(new PropertyColumn<SecurityQuestionTO, String>(
+ new ResourceModel("content"), "content", "content"));
+
+ securityQuestionCols.add(new AbstractColumn<SecurityQuestionTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<SecurityQuestionTO>> cellItem, final String componentId,
+ final IModel<SecurityQuestionTO> model) {
+
+ final SecurityQuestionTO securityQuestionTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ editSecurityQuestionWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new SecurityQuestionModalPage(Configuration.this.getPageReference(),
+ editSecurityQuestionWin, securityQuestionTO, false);
+ }
+ });
+
+ editSecurityQuestionWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "SecurityQuestion");
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ securityQuestionRestClient.delete(securityQuestionTO.getKey());
+ } catch (SyncopeClientException e) {
+ LOG.error("While deleting a security question", e);
+ error(e.getMessage());
+ return;
+ }
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ feedbackPanel.refresh(target);
+ target.add(securityQuestionContainer);
+ }
+ }, ActionLink.ActionType.DELETE, "SecurityQuestion");
+
+ cellItem.add(panel);
+ }
+ });
+
+ final AjaxFallbackDefaultDataTable<SecurityQuestionTO, String> securityQuestionTable =
+ new AjaxFallbackDefaultDataTable<SecurityQuestionTO, String>("securityQuestionTable",
+ securityQuestionCols, new SecurityQuestionProvider(), 50);
+
+ securityQuestionContainer = new WebMarkupContainer("securityQuestionContainer");
+ securityQuestionContainer.add(securityQuestionTable);
+ securityQuestionContainer.setOutputMarkupId(true);
+
+ add(securityQuestionContainer);
+
+ setWindowClosedCallback(createSecurityQuestionWin, securityQuestionContainer);
+ setWindowClosedCallback(editSecurityQuestionWin, securityQuestionContainer);
+
+ AjaxLink<Void> createSecurityQuestionLink = new AjaxLink<Void>("createSecurityQuestionLink") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ createSecurityQuestionWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new SecurityQuestionModalPage(Configuration.this.getPageReference(),
+ createSecurityQuestionWin, new SecurityQuestionTO(), true);
+ }
+ });
+
+ createSecurityQuestionWin.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ createSecurityQuestionLink, ENABLE, xmlRolesReader.getEntitlement("SecurityQuestion", "create"));
+ add(createSecurityQuestionLink);
+ }
+
+ private class NotificationProvider extends SortableDataProvider<NotificationTO, String> {
+
+ private static final long serialVersionUID = -276043813563988590L;
+
+ private final SortableDataProviderComparator<NotificationTO> comparator;
+
+ public NotificationProvider() {
+ //Default sorting
+ setSort("id", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<NotificationTO>(this);
+ }
+
+ @Override
+ public Iterator<NotificationTO> iterator(final long first, final long count) {
+ List<NotificationTO> list = notificationRestClient.getAllNotifications();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return notificationRestClient.getAllNotifications().size();
+ }
+
+ @Override
+ public IModel<NotificationTO> model(final NotificationTO notification) {
+ return new AbstractReadOnlyModel<NotificationTO>() {
+
+ private static final long serialVersionUID = 774694801558497248L;
+
+ @Override
+ public NotificationTO getObject() {
+ return notification;
+ }
+ };
+ }
+ }
+
+ private class SecurityQuestionProvider extends SortableDataProvider<SecurityQuestionTO, String> {
+
+ private static final long serialVersionUID = -1458398823626281188L;
+
+ private final SortableDataProviderComparator<SecurityQuestionTO> comparator;
+
+ public SecurityQuestionProvider() {
+ //Default sorting
+ setSort("id", SortOrder.ASCENDING);
+ comparator = new SortableDataProviderComparator<SecurityQuestionTO>(this);
+ }
+
+ @Override
+ public Iterator<SecurityQuestionTO> iterator(final long first, final long count) {
+ List<SecurityQuestionTO> list = securityQuestionRestClient.list();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return securityQuestionRestClient.list().size();
+ }
+
+ @Override
+ public IModel<SecurityQuestionTO> model(final SecurityQuestionTO securityQuestionTO) {
+ return new AbstractReadOnlyModel<SecurityQuestionTO>() {
+
+ private static final long serialVersionUID = 5079291243768775704L;
+
+ @Override
+ public SecurityQuestionTO getObject() {
+ return securityQuestionTO;
+ }
+ };
+ }
+ }
+
+ private class LoggerPropertyList extends PropertyListView<LoggerTO> {
+
+ private static final long serialVersionUID = 5911412425994616111L;
+
+ private final ConsoleLoggerController consoleLoggerController;
+
+ public LoggerPropertyList(final ConsoleLoggerController consoleLoggerController, final String id,
+ final List<? extends LoggerTO> list) {
+
+ super(id, list);
+ this.consoleLoggerController = consoleLoggerController;
+ }
+
+ @Override
+ protected void populateItem(final ListItem<LoggerTO> item) {
+ item.add(new Label("name"));
+
+ DropDownChoice<LoggerLevel> level = new DropDownChoice<LoggerLevel>("level");
+ level.setModel(new IModel<LoggerLevel>() {
+
+ private static final long serialVersionUID = -2350428186089596562L;
+
+ @Override
+ public LoggerLevel getObject() {
+ return item.getModelObject().getLevel();
+ }
+
+ @Override
+ public void setObject(final LoggerLevel object) {
+ item.getModelObject().setLevel(object);
+ }
+
+ @Override
+ public void detach() {
+ }
+ });
+ level.setChoices(Arrays.asList(LoggerLevel.values()));
+ level.setOutputMarkupId(true);
+ level.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ try {
+ if (getId().equals("corelogger")) {
+ loggerRestClient.setLogLevel(item.getModelObject().getKey(),
+ item.getModelObject().getLevel());
+ } else {
+ consoleLoggerController.setLogLevel(item.getModelObject().getKey(),
+ item.getModelObject().getLevel());
+ }
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException e) {
+ info(getString(Constants.OPERATION_ERROR));
+ }
+
+ feedbackPanel.refresh(target);
+ }
+ });
+
+ MetaDataRoleAuthorizationStrategy.authorize(level, ENABLE, xmlRolesReader.getEntitlement(
+ "Configuration", "logSetLevel"));
+
+ item.add(level);
+ }
+ }
+
+ private static class ConsoleLoggerController implements Serializable {
+
+ private static final long serialVersionUID = -1550459341476431714L;
+
+ public List<LoggerTO> getLoggers() {
+ LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+
+ List<LoggerTO> result = new ArrayList<>();
+ for (LoggerConfig logger : ctx.getConfiguration().getLoggers().values()) {
+ final String loggerName = LogManager.ROOT_LOGGER_NAME.equals(logger.getName())
+ ? SyncopeConstants.ROOT_LOGGER : logger.getName();
+ if (logger.getLevel() != null) {
+ LoggerTO loggerTO = new LoggerTO();
+ loggerTO.setKey(loggerName);
+ loggerTO.setLevel(LoggerLevel.fromLevel(logger.getLevel()));
+ result.add(loggerTO);
+ }
+ }
+
+ return result;
+ }
+
+ public void setLogLevel(final String name, final LoggerLevel level) {
+ LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+ LoggerConfig logConf = SyncopeConstants.ROOT_LOGGER.equals(name)
+ ? ctx.getConfiguration().getLoggerConfig(LogManager.ROOT_LOGGER_NAME)
+ : ctx.getConfiguration().getLoggerConfig(name);
+ logConf.setLevel(level.getLevel());
+ ctx.updateLoggers();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.java
new file mode 100644
index 0000000..ebc041d
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConfirmPasswordResetModalPage.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPasswordFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+
+public class ConfirmPasswordResetModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -8419445804421211904L;
+
+ public ConfirmPasswordResetModalPage(final ModalWindow window, final String token) {
+ super();
+ setOutputMarkupId(true);
+
+ final StatelessForm<?> form = new StatelessForm<Object>(FORM);
+ form.setOutputMarkupId(true);
+
+ final FieldPanel<String> password =
+ new AjaxPasswordFieldPanel("password", "password", new Model<String>()).setRequired(true);
+ ((PasswordTextField) password.getField()).setResetPassword(true);
+ form.add(password);
+
+ final FieldPanel<String> confirmPassword =
+ new AjaxPasswordFieldPanel("confirmPassword", "confirmPassword", new Model<String>());
+ ((PasswordTextField) confirmPassword.getField()).setResetPassword(true);
+ form.add(confirmPassword);
+
+ form.add(new EqualPasswordInputValidator(password.getField(), confirmPassword.getField()));
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT, SUBMIT)) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ userSelfRestClient.confirmPasswordReset(token, password.getModelObject());
+
+ setResponsePage(new ResultStatusModalPage.Builder(window, new UserTO()).mode(Mode.SELF).build());
+ } catch (Exception e) {
+ LOG.error("While confirming password reset for {}", token, e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ form.add(submit);
+ form.setDefaultButton(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ add(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnObjectModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnObjectModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnObjectModalPage.java
new file mode 100644
index 0000000..cf1c405
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnObjectModalPage.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.list.AltListView;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.util.ListModel;
+
+public class ConnObjectModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -6469290753080058487L;
+
+ public ConnObjectModalPage(final ConnObjectTO connObjectTO) {
+ super();
+
+ final Form<Void> form = new Form<Void>(FORM);
+ form.setEnabled(false);
+ add(form);
+
+ IModel<List<AttrTO>> formProps = new LoadableDetachableModel<List<AttrTO>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<AttrTO> load() {
+ List<AttrTO> attrs = connObjectTO.getPlainAttrs();
+ Collections.sort(attrs, new Comparator<AttrTO>() {
+
+ @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());
+ }
+ });
+
+ return attrs;
+ }
+ };
+ final ListView<AttrTO> propView = new AltListView<AttrTO>("propView", formProps) {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ protected void populateItem(final ListItem<AttrTO> item) {
+ final AttrTO prop = item.getModelObject();
+
+ Label label = new Label("key", prop.getSchema());
+ item.add(label);
+
+ Panel field;
+ if (prop.getValues().isEmpty()) {
+ field = new AjaxTextFieldPanel("value",
+ prop.getSchema(), new Model<String>());
+ } else if (prop.getValues().size() == 1) {
+ field = new AjaxTextFieldPanel("value",
+ prop.getSchema(), new Model<String>(prop.getValues().get(0)));
+ } else {
+ field = new MultiFieldPanel<String>("value", new ListModel<String>(prop.getValues()),
+ new AjaxTextFieldPanel("panel", prop.getSchema(), new Model<String>()));
+ }
+ item.add(field);
+ }
+ };
+ form.add(propView);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
new file mode 100644
index 0000000..529a55a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ConnectorModalPage.java
@@ -0,0 +1,471 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.list.ConnConfPropertyListView;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.ConnPoolConfTO;
+import org.apache.syncope.common.lib.types.ConnConfPropSchema;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.ConnectorCapability;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.CheckBoxMultipleChoice;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.validation.validator.RangeValidator;
+
+/**
+ * Modal window with Connector form.
+ */
+public class ConnectorModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -2025535531121434050L;
+
+ @SpringBean
+ private ConnectorRestClient restClient;
+
+ private final Map<String, Map<String, Map<String, ConnBundleTO>>> mapConnBundleTOs;
+
+ private final List<ConnectorCapability> selectedCapabilities;
+
+ private ConnBundleTO bundleTO;
+
+ private List<ConnConfProperty> properties;
+
+ private final WebMarkupContainer propertiesContainer;
+
+ public ConnectorModalPage(final PageReference pageRef, final ModalWindow window,
+ final ConnInstanceTO connInstanceTO) {
+
+ super();
+
+ // general data setup
+ selectedCapabilities = new ArrayList<ConnectorCapability>(connInstanceTO.getKey() == 0
+ ? EnumSet.noneOf(ConnectorCapability.class)
+ : connInstanceTO.getCapabilities());
+
+ mapConnBundleTOs = new HashMap<String, Map<String, Map<String, ConnBundleTO>>>();
+ for (ConnBundleTO connBundleTO : restClient.getAllBundles()) {
+ // by location
+ if (!mapConnBundleTOs.containsKey(connBundleTO.getLocation())) {
+ mapConnBundleTOs.put(connBundleTO.getLocation(), new HashMap<String, Map<String, ConnBundleTO>>());
+ }
+ final Map<String, Map<String, ConnBundleTO>> byLocation = mapConnBundleTOs.get(connBundleTO.getLocation());
+
+ // by name
+ if (!byLocation.containsKey(connBundleTO.getBundleName())) {
+ byLocation.put(connBundleTO.getBundleName(), new HashMap<String, ConnBundleTO>());
+ }
+ final Map<String, ConnBundleTO> byName = byLocation.get(connBundleTO.getBundleName());
+
+ // by version
+ if (!byName.containsKey(connBundleTO.getVersion())) {
+ byName.put(connBundleTO.getVersion(), connBundleTO);
+ }
+ }
+
+ bundleTO = getSelectedBundleTO(connInstanceTO);
+ properties = fillProperties(bundleTO, connInstanceTO);
+
+ // form - first tab
+ final Form<ConnInstanceTO> connectorForm = new Form<ConnInstanceTO>(FORM);
+ connectorForm.setModel(new CompoundPropertyModel<ConnInstanceTO>(connInstanceTO));
+ connectorForm.setOutputMarkupId(true);
+ add(connectorForm);
+
+ propertiesContainer = new WebMarkupContainer("container");
+ propertiesContainer.setOutputMarkupId(true);
+ connectorForm.add(propertiesContainer);
+
+ final Form<ConnInstanceTO> connectorPropForm = new Form<ConnInstanceTO>("connectorPropForm");
+ connectorPropForm.setModel(new CompoundPropertyModel<ConnInstanceTO>(connInstanceTO));
+ connectorPropForm.setOutputMarkupId(true);
+ propertiesContainer.add(connectorPropForm);
+
+ final AjaxTextFieldPanel displayName = new AjaxTextFieldPanel(
+ "displayName", "display name", new PropertyModel<String>(connInstanceTO, "displayName"));
+ displayName.setOutputMarkupId(true);
+ displayName.addRequiredLabel();
+ connectorForm.add(displayName);
+
+ final AjaxDropDownChoicePanel<String> location =
+ new AjaxDropDownChoicePanel<>("location", "location",
+ new Model<>(bundleTO == null ? null : bundleTO.getLocation()));
+ ((DropDownChoice<String>) location.getField()).setNullValid(true);
+ location.setStyleSheet("long_dynamicsize");
+ location.setChoices(new ArrayList<>(mapConnBundleTOs.keySet()));
+ location.setRequired(true);
+ location.addRequiredLabel();
+ location.setOutputMarkupId(true);
+ location.setEnabled(connInstanceTO.getKey() == 0);
+ location.getField().setOutputMarkupId(true);
+ connectorForm.add(location);
+
+ final AjaxDropDownChoicePanel<String> connectorName =
+ new AjaxDropDownChoicePanel<>("connectorName", "connectorName",
+ new Model<>(bundleTO == null ? null : bundleTO.getBundleName()));
+ ((DropDownChoice<String>) connectorName.getField()).setNullValid(true);
+ connectorName.setStyleSheet("long_dynamicsize");
+ connectorName.setChoices(bundleTO == null
+ ? new ArrayList<String>()
+ : new ArrayList<>(mapConnBundleTOs.get(connInstanceTO.getLocation()).keySet()));
+ connectorName.setRequired(true);
+ connectorName.addRequiredLabel();
+ connectorName.setEnabled(connInstanceTO.getLocation() != null);
+ connectorName.setOutputMarkupId(true);
+ connectorName.setEnabled(connInstanceTO.getKey() == 0);
+ connectorName.getField().setOutputMarkupId(true);
+ connectorForm.add(connectorName);
+
+ final AjaxDropDownChoicePanel<String> version =
+ new AjaxDropDownChoicePanel<String>("version", "version",
+ new Model<>(bundleTO == null ? null : bundleTO.getVersion()));
+ version.setStyleSheet("long_dynamicsize");
+ version.setChoices(bundleTO == null
+ ? new ArrayList<String>()
+ : new ArrayList<>(mapConnBundleTOs.get(connInstanceTO.getLocation()).
+ get(connInstanceTO.getBundleName()).keySet()));
+ version.setRequired(true);
+ version.addRequiredLabel();
+ version.setEnabled(connInstanceTO.getBundleName() != null);
+ version.setOutputMarkupId(true);
+ version.addRequiredLabel();
+ version.getField().setOutputMarkupId(true);
+ connectorForm.add(version);
+
+ final SpinnerFieldPanel<Integer> connRequestTimeout =
+ new SpinnerFieldPanel<Integer>("connRequestTimeout", "connRequestTimeout", Integer.class,
+ new PropertyModel<Integer>(connInstanceTO, "connRequestTimeout"), 0, null);
+ connRequestTimeout.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ connectorForm.add(connRequestTimeout);
+
+ if (connInstanceTO.getPoolConf() == null) {
+ connInstanceTO.setPoolConf(new ConnPoolConfTO());
+ }
+ final SpinnerFieldPanel<Integer> poolMaxObjects =
+ new SpinnerFieldPanel<Integer>("poolMaxObjects", "poolMaxObjects", Integer.class,
+ new PropertyModel<Integer>(connInstanceTO.getPoolConf(), "maxObjects"), 0, null);
+ poolMaxObjects.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ connectorForm.add(poolMaxObjects);
+ final SpinnerFieldPanel<Integer> poolMinIdle =
+ new SpinnerFieldPanel<Integer>("poolMinIdle", "poolMinIdle", Integer.class,
+ new PropertyModel<Integer>(connInstanceTO.getPoolConf(), "minIdle"), 0, null);
+ poolMinIdle.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ connectorForm.add(poolMinIdle);
+ final SpinnerFieldPanel<Integer> poolMaxIdle =
+ new SpinnerFieldPanel<Integer>("poolMaxIdle", "poolMaxIdle", Integer.class,
+ new PropertyModel<Integer>(connInstanceTO.getPoolConf(), "maxIdle"), 0, null);
+ poolMaxIdle.getField().add(new RangeValidator<Integer>(0, Integer.MAX_VALUE));
+ connectorForm.add(poolMaxIdle);
+ final SpinnerFieldPanel<Long> poolMaxWait =
+ new SpinnerFieldPanel<Long>("poolMaxWait", "poolMaxWait", Long.class,
+ new PropertyModel<Long>(connInstanceTO.getPoolConf(), "maxWait"), 0L, null);
+ poolMaxWait.getField().add(new RangeValidator<Long>(0L, Long.MAX_VALUE));
+ connectorForm.add(poolMaxWait);
+ final SpinnerFieldPanel<Long> poolMinEvictableIdleTime =
+ new SpinnerFieldPanel<Long>("poolMinEvictableIdleTime", "poolMinEvictableIdleTime", Long.class,
+ new PropertyModel<Long>(connInstanceTO.getPoolConf(), "minEvictableIdleTimeMillis"),
+ 0L, null);
+ poolMinEvictableIdleTime.getField().add(new RangeValidator<Long>(0L, Long.MAX_VALUE));
+ connectorForm.add(poolMinEvictableIdleTime);
+
+ // form - first tab - onchange()
+ location.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ ((DropDownChoice<String>) location.getField()).setNullValid(false);
+ connInstanceTO.setLocation(location.getModelObject());
+ target.add(location);
+
+ connectorName.setChoices(new ArrayList<String>(
+ mapConnBundleTOs.get(location.getModelObject()).keySet()));
+ connectorName.setEnabled(true);
+ connectorName.getField().setModelValue(null);
+ target.add(connectorName);
+
+ version.setChoices(new ArrayList<String>());
+ version.getField().setModelValue(null);
+ version.setEnabled(false);
+ target.add(version);
+
+ properties.clear();
+ target.add(propertiesContainer);
+ }
+ });
+ connectorName.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ ((DropDownChoice<String>) connectorName.getField()).setNullValid(false);
+ connInstanceTO.setBundleName(connectorName.getModelObject());
+ target.add(connectorName);
+
+ List<String> versions = new ArrayList<String>(
+ mapConnBundleTOs.get(location.getModelObject()).get(connectorName.getModelObject()).keySet());
+ version.setChoices(versions);
+ version.setEnabled(true);
+ if (versions.size() == 1) {
+ selectVersion(target, connInstanceTO, version, versions.get(0));
+ version.getField().setModelObject(versions.get(0));
+ } else {
+ version.getField().setModelValue(null);
+ properties.clear();
+ target.add(propertiesContainer);
+ }
+ target.add(version);
+ }
+ });
+ version.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ selectVersion(target, connInstanceTO, version, version.getModelObject());
+ }
+ });
+
+ // form - second tab (properties)
+ final ListView<ConnConfProperty> connPropView = new ConnConfPropertyListView("connectorProperties",
+ new PropertyModel<List<ConnConfProperty>>(this, "properties"),
+ true, connInstanceTO.getConfiguration());
+ connPropView.setOutputMarkupId(true);
+ connectorPropForm.add(connPropView);
+
+ final AjaxButton check = new IndicatingAjaxButton("check", new ResourceModel("check")) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final ConnInstanceTO conn = (ConnInstanceTO) form.getModelObject();
+
+ // ensure that connector bundle information is in sync
+ conn.setBundleName(bundleTO.getBundleName());
+ conn.setVersion(bundleTO.getVersion());
+ conn.setConnectorName(bundleTO.getConnectorName());
+
+ if (restClient.check(conn)) {
+ info(getString("success_connection"));
+ } else {
+ error(getString("error_connection"));
+ }
+
+ feedbackPanel.refresh(target);
+ }
+ };
+ connectorPropForm.add(check);
+
+ // form - third tab (capabilities)
+ final IModel<List<ConnectorCapability>> capabilities =
+ new LoadableDetachableModel<List<ConnectorCapability>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<ConnectorCapability> load() {
+ return Arrays.asList(ConnectorCapability.values());
+ }
+ };
+ CheckBoxMultipleChoice<ConnectorCapability> capabilitiesPalette =
+ new CheckBoxMultipleChoice<ConnectorCapability>("capabilitiesPalette",
+ new PropertyModel<List<ConnectorCapability>>(this, "selectedCapabilities"), capabilities);
+
+ capabilitiesPalette.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ }
+ });
+
+ connectorForm.add(capabilitiesPalette);
+
+ // form - submit / cancel buttons
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT))) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ final ConnInstanceTO conn = (ConnInstanceTO) form.getModelObject();
+
+ conn.setConnectorName(bundleTO.getConnectorName());
+ conn.setBundleName(bundleTO.getBundleName());
+ conn.setVersion(bundleTO.getVersion());
+ conn.getConfiguration().clear();
+ conn.getConfiguration().addAll(connPropView.getModelObject());
+
+ // Set the model object's capabilities to capabilitiesPalette's converted Set
+ conn.getCapabilities().clear();
+ conn.getCapabilities().addAll(selectedCapabilities.isEmpty()
+ ? EnumSet.noneOf(ConnectorCapability.class)
+ : EnumSet.copyOf(selectedCapabilities));
+
+ // Reset pool configuration if all fields are null
+ if (conn.getPoolConf() != null
+ && conn.getPoolConf().getMaxIdle() == null
+ && conn.getPoolConf().getMaxObjects() == null
+ && conn.getPoolConf().getMaxWait() == null
+ && conn.getPoolConf().getMinEvictableIdleTimeMillis() == null
+ && conn.getPoolConf().getMinIdle() == null) {
+
+ conn.setPoolConf(null);
+ }
+
+ try {
+ if (connInstanceTO.getKey() == 0) {
+ restClient.create(conn);
+ } else {
+ restClient.update(conn);
+ }
+
+ ((Resources) pageRef.getPage()).setModalResult(true);
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ ((Resources) pageRef.getPage()).setModalResult(false);
+ LOG.error("While creating or updating connector {}", conn, e);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+ String roles = connInstanceTO.getKey() == 0
+ ? xmlRolesReader.getEntitlement("Connectors", "create")
+ : xmlRolesReader.getEntitlement("Connectors", "update");
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, roles);
+ connectorForm.add(submit);
+
+ final IndicatingAjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ connectorForm.add(cancel);
+ }
+
+ private ConnBundleTO getSelectedBundleTO(final ConnInstanceTO connInstanceTO) {
+ ConnBundleTO result = null;
+ if (connInstanceTO != null
+ && StringUtils.isNotBlank(connInstanceTO.getLocation())
+ && StringUtils.isNotBlank(connInstanceTO.getBundleName())
+ && StringUtils.isNotBlank(connInstanceTO.getVersion())
+ && mapConnBundleTOs.containsKey(connInstanceTO.getLocation())) {
+
+ Map<String, Map<String, ConnBundleTO>> byLocation = mapConnBundleTOs.get(connInstanceTO.getLocation());
+ if (byLocation.containsKey(connInstanceTO.getBundleName())) {
+ Map<String, ConnBundleTO> byName = byLocation.get(connInstanceTO.getBundleName());
+ if (byName.containsKey(connInstanceTO.getVersion())) {
+ result = byName.get(connInstanceTO.getVersion());
+ }
+ }
+ }
+ return result;
+ }
+
+ private List<ConnConfProperty> fillProperties(final ConnBundleTO bundleTO, final ConnInstanceTO connInstanceTO) {
+ final List<ConnConfProperty> props = new ArrayList<>();
+
+ if (bundleTO != null) {
+ for (ConnConfPropSchema key : bundleTO.getProperties()) {
+ final ConnConfProperty property = new ConnConfProperty();
+ property.setSchema(key);
+ if (connInstanceTO.getKey() != 0
+ && connInstanceTO.getConfigurationMap().containsKey(key.getName())
+ && connInstanceTO.getConfigurationMap().get(key.getName()).getValues() != null) {
+
+ property.getValues().addAll(connInstanceTO.getConfigurationMap().get(key.getName()).getValues());
+ property.setOverridable(connInstanceTO.getConfigurationMap().get(key.getName()).isOverridable());
+ }
+
+ if (property.getValues().isEmpty() && !key.getDefaultValues().isEmpty()) {
+ property.getValues().addAll(key.getDefaultValues());
+ }
+
+ props.add(property);
+ }
+ }
+
+ // re-order properties (implements Comparable)
+ Collections.sort(props);
+ return props;
+ }
+
+ private void selectVersion(final AjaxRequestTarget target, final ConnInstanceTO connInstanceTO,
+ final AjaxDropDownChoicePanel<String> version, final String versionValue) {
+
+ connInstanceTO.setVersion(versionValue);
+ target.add(version);
+
+ bundleTO = getSelectedBundleTO(connInstanceTO);
+ properties = fillProperties(bundleTO, connInstanceTO);
+ target.add(propertiesContainer);
+ }
+
+ public List<ConnConfProperty> getProperties() {
+ return properties;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
new file mode 100644
index 0000000..fd948b1
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DerSchemaModalPage.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.JexlHelpUtil;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.DerSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+/**
+ * Modal window with Schema form.
+ */
+public class DerSchemaModalPage extends AbstractSchemaModalPage<DerSchemaTO> {
+
+ private static final long serialVersionUID = 6668789770131753386L;
+
+ public DerSchemaModalPage(final AttributableType kind) {
+ super(kind);
+ }
+
+ @Override
+ public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
+ DerSchemaTO schema, final boolean createFlag) {
+
+ if (schema == null) {
+ schema = new DerSchemaTO();
+ }
+
+ final Form<DerSchemaTO> schemaForm = new Form<DerSchemaTO>(FORM);
+
+ schemaForm.setModel(new CompoundPropertyModel<DerSchemaTO>(schema));
+
+ final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
+ schema, "name"));
+ name.addRequiredLabel();
+
+ final AjaxTextFieldPanel expression = new AjaxTextFieldPanel("expression", getString("expression"),
+ new PropertyModel<String>(schema, "expression"));
+ expression.addRequiredLabel();
+
+ final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
+
+ final AjaxLink<Void> questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
+ schemaForm.add(questionMarkJexlHelp);
+ questionMarkJexlHelp.add(jexlHelp);
+
+ name.setEnabled(createFlag);
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
+ DerSchemaTO schemaTO = (DerSchemaTO) form.getDefaultModelObject();
+
+ try {
+ if (createFlag) {
+ schemaRestClient.createDerSchema(kind, schemaTO);
+ } else {
+ schemaRestClient.updateDerSchema(kind, schemaTO);
+ }
+
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+ }
+
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(
+ false);
+
+ String allowedRoles = createFlag
+ ? xmlRolesReader.getEntitlement("Schema", "create")
+ : xmlRolesReader.getEntitlement("Schema", "update");
+
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
+
+ schemaForm.add(name);
+
+ schemaForm.add(expression);
+
+ schemaForm.add(submit);
+
+ schemaForm.add(cancel);
+
+ add(schemaForm);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
new file mode 100644
index 0000000..3de8efe
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
@@ -0,0 +1,273 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.PreferenceManager;
+import org.apache.syncope.common.lib.search.SearchableFields;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Modal window with Display attributes form.
+ */
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class DisplayAttributesModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -4274117450918385110L;
+
+ /**
+ * Max allowed selections.
+ */
+ private static final int MAX_SELECTIONS = 9;
+
+ public static final String[] DEFAULT_SELECTION = { "id", "username", "status" };
+
+ @SpringBean
+ private PreferenceManager prefMan;
+
+ private final List<String> selectedDetails;
+
+ private final List<String> selectedSchemas;
+
+ private final List<String> selectedDerSchemas;
+
+ private final List<String> selectedVirSchemas;
+
+ public DisplayAttributesModalPage(final PageReference pageRef, final ModalWindow window,
+ final List<String> schemaNames, final List<String> dSchemaNames, final List<String> vSchemaNames) {
+
+ super();
+
+ final IModel<List<String>> fnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return SearchableFields.get(UserTO.class);
+ }
+ };
+
+ final IModel<List<String>> names = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return schemaNames;
+ }
+ };
+
+ final IModel<List<String>> dsnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return dSchemaNames;
+ }
+ };
+
+ final IModel<List<String>> vsnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return vSchemaNames;
+ }
+ };
+
+ final Form form = new Form(FORM);
+ form.setModel(new CompoundPropertyModel(this));
+
+ selectedDetails = prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW);
+
+ selectedSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW);
+
+ selectedDerSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW);
+
+ selectedVirSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW);
+
+ final CheckGroup dgroup = new CheckGroup("dCheckGroup", new PropertyModel(this, "selectedDetails"));
+ form.add(dgroup);
+
+ final ListView<String> details = new ListView<String>("details", fnames) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(final ListItem<String> item) {
+ item.add(new Check("dcheck", item.getModel()));
+ item.add(new Label("dname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
+ dgroup.add(details);
+
+ if (names.getObject() == null || names.getObject().isEmpty()) {
+ final Fragment fragment = new Fragment("schemas", "emptyFragment", form);
+ form.add(fragment);
+
+ selectedSchemas.clear();
+ } else {
+ final Fragment fragment = new Fragment("schemas", "sfragment", form);
+ form.add(fragment);
+
+ final CheckGroup sgroup = new CheckGroup("sCheckGroup", new PropertyModel(this, "selectedSchemas"));
+ fragment.add(sgroup);
+
+ final ListView<String> schemas = new ListView<String>("schemas", names) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("scheck", item.getModel()));
+ item.add(new Label("sname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
+ sgroup.add(schemas);
+ }
+
+ if (dsnames.getObject() == null || dsnames.getObject().isEmpty()) {
+ final Fragment fragment = new Fragment("dschemas", "emptyFragment", form);
+ form.add(fragment);
+
+ selectedDerSchemas.clear();
+ } else {
+ final Fragment fragment = new Fragment("dschemas", "dsfragment", form);
+ form.add(fragment);
+
+ final CheckGroup dsgroup = new CheckGroup("dsCheckGroup", new PropertyModel(this, "selectedDerSchemas"));
+ fragment.add(dsgroup);
+
+ final ListView<String> derSchemas = new ListView<String>("derSchemas", dsnames) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("dscheck", item.getModel()));
+ item.add(new Label("dsname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
+ dsgroup.add(derSchemas);
+ }
+
+ if (vsnames.getObject() == null || vsnames.getObject().isEmpty()) {
+ final Fragment fragment = new Fragment("vschemas", "emptyFragment", form);
+ form.add(fragment);
+
+ selectedVirSchemas.clear();
+ } else {
+ final Fragment fragment = new Fragment("vschemas", "vsfragment", form);
+ form.add(fragment);
+
+ final CheckGroup vsgroup = new CheckGroup("vsCheckGroup", new PropertyModel(this, "selectedVirSchemas"));
+ fragment.add(vsgroup);
+
+ final ListView<String> virSchemas = new ListView<String>("virSchemas", vsnames) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("vscheck", item.getModel()));
+ item.add(new Label("vsname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
+ vsgroup.add(virSchemas);
+ }
+
+ final AjaxButton submit = new IndicatingAjaxButton(SUBMIT, new ResourceModel(SUBMIT)) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ if (selectedDetails.size() + selectedSchemas.size() + selectedVirSchemas.size() + selectedDerSchemas.
+ size()
+ > MAX_SELECTIONS) {
+
+ error(getString("tooManySelections"));
+ onError(target, form);
+ } else {
+ final Map<String, List<String>> prefs = new HashMap<String, List<String>>();
+
+ prefs.put(Constants.PREF_USERS_DETAILS_VIEW, selectedDetails);
+
+ prefs.put(Constants.PREF_USERS_ATTRIBUTES_VIEW, selectedSchemas);
+
+ prefs.put(Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW, selectedDerSchemas);
+
+ prefs.put(Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW, selectedVirSchemas);
+
+ prefMan.setList(getRequest(), getResponse(), prefs);
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+
+ window.close(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ form.add(submit);
+
+ final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+
+ add(form);
+ }
+}
[06/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java
new file mode 100644
index 0000000..83e0832
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ConnectorITCase.java
@@ -0,0 +1,730 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.ConnPoolConfTO;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.MappingTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.ConnConfPropSchema;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.ConnectorCapability;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.rest.api.service.ConnectorService;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.identityconnectors.common.security.GuardedString;
+import org.junit.BeforeClass;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class ConnectorITCase extends AbstractITCase {
+
+ private static String connectorServerLocation;
+
+ private static String connidSoapVersion;
+
+ private static String connidDbTableVersion;
+
+ private static String testJDBCURL;
+
+ @BeforeClass
+ public static void setUpConnIdBundles() throws IOException {
+ InputStream propStream = null;
+ try {
+ Properties props = new Properties();
+ propStream = ConnectorITCase.class.getResourceAsStream("/connid.properties");
+ props.load(propStream);
+
+ for (String location : props.getProperty("connid.locations").split(",")) {
+ if (!location.startsWith("file")) {
+ connectorServerLocation = location;
+ }
+ }
+
+ connidSoapVersion = props.getProperty("connid.soap.version");
+ connidDbTableVersion = props.getProperty("connid.db.table.version");
+
+ testJDBCURL = props.getProperty("testdb.url");
+ } catch (Exception e) {
+ LOG.error("Could not load /connid.properties", e);
+ } finally {
+ IOUtils.closeQuietly(propStream);
+ }
+ assertNotNull(connectorServerLocation);
+ assertNotNull(connidSoapVersion);
+ assertNotNull(connidDbTableVersion);
+ assertNotNull(testJDBCURL);
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithException() {
+ ConnInstanceTO connectorTO = new ConnInstanceTO();
+
+ Response response = connectorService.create(connectorTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
+ }
+ }
+
+ @Test
+ public void create() {
+ ConnInstanceTO connectorTO = new ConnInstanceTO();
+ connectorTO.setLocation(connectorService.read(100L).getLocation());
+ connectorTO.setVersion(connidSoapVersion);
+ connectorTO.setConnectorName("net.tirasa.connid.bundles.soap.WebServiceConnector");
+ connectorTO.setBundleName("net.tirasa.connid.bundles.soap");
+ connectorTO.setDisplayName("Display name");
+ connectorTO.setConnRequestTimeout(15);
+
+ // set the connector configuration using PropertyTO
+ Set<ConnConfProperty> conf = new HashSet<>();
+
+ ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
+ endpointSchema.setName("endpoint");
+ endpointSchema.setType(String.class.getName());
+ endpointSchema.setRequired(true);
+ ConnConfProperty endpoint = new ConnConfProperty();
+ endpoint.setSchema(endpointSchema);
+ endpoint.getValues().add("http://localhost:8888/wssample/services");
+ endpoint.getValues().add("Provisioning");
+ conf.add(endpoint);
+
+ ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
+ servicenameSchema.setName("servicename");
+ servicenameSchema.setType(String.class.getName());
+ servicenameSchema.setRequired(true);
+ ConnConfProperty servicename = new ConnConfProperty();
+ servicename.setSchema(servicenameSchema);
+ conf.add(servicename);
+
+ // set connector configuration
+ connectorTO.getConfiguration().addAll(conf);
+
+ // set connector capabilities
+ connectorTO.getCapabilities().add(ConnectorCapability.TWO_PHASES_CREATE);
+ connectorTO.getCapabilities().add(ConnectorCapability.ONE_PHASE_CREATE);
+ connectorTO.getCapabilities().add(ConnectorCapability.TWO_PHASES_UPDATE);
+
+ // set connector pool conf
+ ConnPoolConfTO cpc = new ConnPoolConfTO();
+ cpc.setMaxObjects(1534);
+ connectorTO.setPoolConf(cpc);
+
+ Response response = connectorService.create(connectorTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
+ }
+
+ ConnInstanceTO actual = getObject(
+ response.getLocation(), ConnectorService.class, ConnInstanceTO.class);
+ assertNotNull(actual);
+
+ assertEquals(actual.getBundleName(), connectorTO.getBundleName());
+ assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
+ assertEquals(actual.getVersion(), connectorTO.getVersion());
+ assertEquals("Display name", actual.getDisplayName());
+ assertEquals(Integer.valueOf(15), actual.getConnRequestTimeout());
+ assertEquals(connectorTO.getCapabilities(), actual.getCapabilities());
+ assertNotNull(actual.getPoolConf());
+ assertEquals(1534, actual.getPoolConf().getMaxObjects().intValue());
+ assertEquals(10, actual.getPoolConf().getMaxIdle().intValue());
+
+ Throwable t = null;
+
+ // check update
+ actual.getCapabilities().remove(ConnectorCapability.TWO_PHASES_UPDATE);
+ actual.getPoolConf().setMaxObjects(null);
+
+ try {
+ connectorService.update(actual.getKey(), actual);
+ actual = connectorService.read(actual.getKey());
+ } catch (SyncopeClientException e) {
+ LOG.error("update failed", e);
+ t = e;
+ }
+
+ assertNull(t);
+ assertNotNull(actual);
+ assertEquals(EnumSet.of(ConnectorCapability.ONE_PHASE_CREATE, ConnectorCapability.TWO_PHASES_CREATE),
+ actual.getCapabilities());
+ assertEquals(10, actual.getPoolConf().getMaxObjects().intValue());
+
+ // check also for the deletion of the created object
+ try {
+ connectorService.delete(actual.getKey());
+ } catch (SyncopeClientException e) {
+ LOG.error("delete failed", e);
+ t = e;
+ }
+
+ assertNull(t);
+
+ // check the non existence
+ try {
+ connectorService.read(actual.getKey());
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void update() {
+ ConnInstanceTO connectorTO = new ConnInstanceTO();
+
+ // set connector instance id
+ connectorTO.setKey(103L);
+
+ // set connector version
+ connectorTO.setVersion(connidSoapVersion);
+
+ // set connector name
+ connectorTO.setConnectorName("net.tirasa.connid.bundles.soap.WebServiceConnector");
+
+ // set bundle name
+ connectorTO.setBundleName("net.tirasa.connid.bundles.soap");
+
+ connectorTO.setConnRequestTimeout(20);
+
+ // set the connector configuration using PropertyTO
+ Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
+
+ ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
+ endpointSchema.setName("endpoint");
+ endpointSchema.setType(String.class.getName());
+ endpointSchema.setRequired(true);
+ ConnConfProperty endpoint = new ConnConfProperty();
+ endpoint.setSchema(endpointSchema);
+ endpoint.getValues().add("http://localhost:8888/wssample/services");
+ conf.add(endpoint);
+
+ ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
+ servicenameSchema.setName("servicename");
+ servicenameSchema.setType(String.class.getName());
+ servicenameSchema.setRequired(true);
+ ConnConfProperty servicename = new ConnConfProperty();
+ servicename.setSchema(servicenameSchema);
+ servicename.getValues().add("Provisioning");
+ conf.add(servicename);
+
+ // set connector configuration
+ connectorTO.getConfiguration().addAll(conf);
+
+ connectorService.update(connectorTO.getKey(), connectorTO);
+ ConnInstanceTO actual = connectorService.read(connectorTO.getKey());
+
+ assertNotNull(actual);
+
+ actual = connectorService.read(actual.getKey());
+
+ assertNotNull(actual);
+ assertEquals(actual.getBundleName(), connectorTO.getBundleName());
+ assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
+ assertEquals(actual.getVersion(), connectorTO.getVersion());
+ assertEquals(Integer.valueOf(20), actual.getConnRequestTimeout());
+ }
+
+ private List<ResourceTO> filter(final List<ResourceTO> input, final Long connectorKey) {
+ List<ResourceTO> result = new ArrayList<>();
+
+ for (ResourceTO resource : input) {
+ if (connectorKey.equals(resource.getConnectorId())) {
+ result.add(resource);
+ }
+ }
+
+ return result;
+ }
+
+ @Test
+ public void issueSYNCOPE10() {
+ // ----------------------------------
+ // Copy resource and connector in order to create new objects.
+ // ----------------------------------
+ // Retrieve a connector instance template.
+ ConnInstanceTO connInstanceTO = connectorService.read(103L);
+ assertNotNull(connInstanceTO);
+
+ // check for resource
+ List<ResourceTO> resources = filter(resourceService.list(), 103L);
+ assertEquals(4, resources.size());
+
+ // Retrieve a resource TO template.
+ ResourceTO resourceTO = resources.get(0);
+
+ // Make it new.
+ resourceTO.setKey("newAbout103");
+
+ // Make it new.
+ connInstanceTO.setKey(0);
+ connInstanceTO.setDisplayName("newDisplayName" + getUUIDString());
+ // ----------------------------------
+
+ // ----------------------------------
+ // Create a new connector instance.
+ // ----------------------------------
+ Response response = connectorService.create(connInstanceTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
+ }
+
+ connInstanceTO = getObject(response.getLocation(), ConnectorService.class, ConnInstanceTO.class);
+ assertNotNull(connInstanceTO);
+ assertFalse(connInstanceTO.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
+
+ long connId = connInstanceTO.getKey();
+
+ // Link resourceTO to the new connector instance.
+ resourceTO.setConnectorId(connId);
+ // ----------------------------------
+
+ // ----------------------------------
+ // Check for connector instance update after resource creation.
+ // ----------------------------------
+ response = resourceService.create(resourceTO);
+ resourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+
+ assertNotNull(resourceTO);
+
+ resources = filter(resourceService.list(), connId);
+ assertEquals(1, resources.size());
+ // ----------------------------------
+
+ // ----------------------------------
+ // Check for spring bean.
+ // ----------------------------------
+ ConnInstanceTO connInstanceBean = connectorService.readByResource(resourceTO.getKey());
+ assertNotNull(connInstanceBean);
+ assertFalse(connInstanceBean.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
+ // ----------------------------------
+
+ // ----------------------------------
+ // Check for spring bean update after connector instance update.
+ // ----------------------------------
+ connInstanceTO.getCapabilities().add(ConnectorCapability.AUTHENTICATE);
+
+ connectorService.update(connInstanceTO.getKey(), connInstanceTO);
+ ConnInstanceTO actual = connectorService.read(connInstanceTO.getKey());
+ assertNotNull(actual);
+ assertTrue(connInstanceTO.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
+
+ // check for spring bean update
+ connInstanceBean = connectorService.readByResource(resourceTO.getKey());
+ assertTrue(connInstanceBean.getCapabilities().contains(ConnectorCapability.AUTHENTICATE));
+ // ----------------------------------
+ }
+
+ @Test
+ public void deleteWithException() {
+ try {
+ connectorService.delete(0L);
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void list() {
+ List<ConnInstanceTO> connectorInstanceTOs = connectorService.list(null);
+ assertNotNull(connectorInstanceTOs);
+ assertFalse(connectorInstanceTOs.isEmpty());
+ for (ConnInstanceTO instance : connectorInstanceTOs) {
+ assertNotNull(instance);
+ }
+ }
+
+ @Test
+ public void read() {
+ ConnInstanceTO connectorInstanceTO = connectorService.read(100L);
+ assertNotNull(connectorInstanceTO);
+ }
+
+ @Test
+ public void getBundles() {
+ List<ConnBundleTO> bundles = connectorService.getBundles(null);
+ assertNotNull(bundles);
+ assertFalse(bundles.isEmpty());
+ for (ConnBundleTO bundle : bundles) {
+ assertNotNull(bundle);
+ }
+ }
+
+ @Test
+ public void getConnectorConfiguration() {
+ List<ConnConfProperty> props = connectorService.getConfigurationProperties(104L);
+ assertNotNull(props);
+ assertFalse(props.isEmpty());
+ }
+
+ @Test
+ public void checkHiddenProperty() {
+ ConnInstanceTO connInstanceTO = connectorService.read(100L);
+
+ boolean check = false;
+
+ for (ConnConfProperty prop : connInstanceTO.getConfiguration()) {
+ if ("receiveTimeout".equals(prop.getSchema().getName())) {
+ check = true;
+ }
+ }
+ assertTrue(check);
+ }
+
+ @Test
+ public void checkSelectedLanguage() {
+ // 1. Check Italian
+ List<ConnInstanceTO> connectorInstanceTOs = connectorService.list("it");
+
+ Map<String, ConnConfProperty> instanceConfMap;
+ for (ConnInstanceTO instance : connectorInstanceTOs) {
+ if ("net.tirasa.connid.bundles.db.table".equals(instance.getBundleName())) {
+ instanceConfMap = instance.getConfigurationMap();
+ assertEquals("Utente", instanceConfMap.get("user").getSchema().getDisplayName());
+ }
+ }
+
+ // 2. Check English (default)
+ connectorInstanceTOs = connectorService.list(null);
+
+ for (ConnInstanceTO instance : connectorInstanceTOs) {
+ if ("net.tirasa.connid.bundles.db.table".equals(instance.getBundleName())) {
+ instanceConfMap = instance.getConfigurationMap();
+ assertEquals("User", instanceConfMap.get("user").getSchema().getDisplayName());
+ }
+ }
+ }
+
+ @Test
+ public void validate() {
+ ConnInstanceTO connectorTO = new ConnInstanceTO();
+ connectorTO.setLocation(connectorServerLocation);
+ connectorTO.setVersion(connidDbTableVersion);
+ connectorTO.setConnectorName("net.tirasa.connid.bundles.db.table.DatabaseTableConnector");
+ connectorTO.setBundleName("net.tirasa.connid.bundles.db.table");
+ connectorTO.setDisplayName("H2Test");
+
+ // set the connector configuration using PropertyTO
+ Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
+
+ ConnConfPropSchema jdbcDriverSchema = new ConnConfPropSchema();
+ jdbcDriverSchema.setName("jdbcDriver");
+ jdbcDriverSchema.setType(String.class.getName());
+ jdbcDriverSchema.setRequired(true);
+ ConnConfProperty jdbcDriver = new ConnConfProperty();
+ jdbcDriver.setSchema(jdbcDriverSchema);
+ jdbcDriver.getValues().add("org.h2.Driver");
+ conf.add(jdbcDriver);
+
+ ConnConfPropSchema jdbcUrlTemplateSchema = new ConnConfPropSchema();
+ jdbcUrlTemplateSchema.setName("jdbcUrlTemplate");
+ jdbcUrlTemplateSchema.setType(String.class.getName());
+ jdbcUrlTemplateSchema.setRequired(true);
+ ConnConfProperty jdbcUrlTemplate = new ConnConfProperty();
+ jdbcUrlTemplate.setSchema(jdbcUrlTemplateSchema);
+ jdbcUrlTemplate.getValues().add(testJDBCURL);
+ conf.add(jdbcUrlTemplate);
+
+ ConnConfPropSchema userSchema = new ConnConfPropSchema();
+ userSchema.setName("user");
+ userSchema.setType(String.class.getName());
+ userSchema.setRequired(false);
+ ConnConfProperty user = new ConnConfProperty();
+ user.setSchema(userSchema);
+ user.getValues().add("sa");
+ conf.add(user);
+
+ ConnConfPropSchema passwordSchema = new ConnConfPropSchema();
+ passwordSchema.setName("password");
+ passwordSchema.setType(GuardedString.class.getName());
+ passwordSchema.setRequired(true);
+ ConnConfProperty password = new ConnConfProperty();
+ password.setSchema(passwordSchema);
+ password.getValues().add("sa");
+ conf.add(password);
+
+ ConnConfPropSchema tableSchema = new ConnConfPropSchema();
+ tableSchema.setName("table");
+ tableSchema.setType(String.class.getName());
+ tableSchema.setRequired(true);
+ ConnConfProperty table = new ConnConfProperty();
+ table.setSchema(tableSchema);
+ table.getValues().add("test");
+ conf.add(table);
+
+ ConnConfPropSchema keyColumnSchema = new ConnConfPropSchema();
+ keyColumnSchema.setName("keyColumn");
+ keyColumnSchema.setType(String.class.getName());
+ keyColumnSchema.setRequired(true);
+ ConnConfProperty keyColumn = new ConnConfProperty();
+ keyColumn.setSchema(keyColumnSchema);
+ keyColumn.getValues().add("id");
+ conf.add(keyColumn);
+
+ ConnConfPropSchema passwordColumnSchema = new ConnConfPropSchema();
+ passwordColumnSchema.setName("passwordColumn");
+ passwordColumnSchema.setType(String.class.getName());
+ passwordColumnSchema.setRequired(true);
+ ConnConfProperty passwordColumn = new ConnConfProperty();
+ passwordColumn.setSchema(passwordColumnSchema);
+ passwordColumn.getValues().add("password");
+ conf.add(passwordColumn);
+
+ // set connector configuration
+ connectorTO.getConfiguration().addAll(conf);
+
+ assertTrue(connectorService.check(connectorTO));
+
+ conf.remove(password);
+ password.getValues().clear();
+ password.getValues().add("password");
+ conf.add(password);
+
+ assertFalse(connectorService.check(connectorTO));
+ }
+
+ @Test
+ public void getSchemaNames() {
+ ConnInstanceTO conn = connectorService.read(101L);
+
+ List<PlainSchemaTO> schemaNames = connectorService.getSchemaNames(conn.getKey(), conn, true);
+ assertNotNull(schemaNames);
+ assertFalse(schemaNames.isEmpty());
+ assertNotNull(schemaNames.get(0).getKey());
+ assertNull(schemaNames.get(0).getEnumerationValues());
+
+ schemaNames = connectorService.getSchemaNames(conn.getKey(), conn, false);
+
+ assertNotNull(schemaNames);
+ assertEquals(0, schemaNames.size());
+
+ conn = connectorService.read(104L);
+
+ // to be used with overridden properties
+ conn.getConfiguration().clear();
+
+ schemaNames = connectorService.getSchemaNames(conn.getKey(), conn, true);
+ assertNotNull(schemaNames);
+ assertFalse(schemaNames.isEmpty());
+ }
+
+ @Test
+ public void getSupportedObjectClasses() {
+ ConnInstanceTO ldap = connectorService.read(105L);
+ assertNotNull(ldap);
+
+ List<ConnIdObjectClassTO> objectClasses = connectorService.getSupportedObjectClasses(ldap.getKey(), ldap);
+ assertNotNull(objectClasses);
+ assertEquals(2, objectClasses.size());
+ assertTrue(objectClasses.contains(ConnIdObjectClassTO.ACCOUNT));
+ assertTrue(objectClasses.contains(ConnIdObjectClassTO.GROUP));
+
+ ConnInstanceTO csv = connectorService.read(104L);
+ assertNotNull(csv);
+
+ objectClasses = connectorService.getSupportedObjectClasses(csv.getKey(), csv);
+ assertNotNull(objectClasses);
+ assertEquals(1, objectClasses.size());
+ assertTrue(objectClasses.contains(ConnIdObjectClassTO.ACCOUNT));
+ }
+
+ @Test
+ public void issueSYNCOPE112() {
+ // ----------------------------------------
+ // Create a new connector
+ // ----------------------------------------
+ ConnInstanceTO connectorTO = new ConnInstanceTO();
+
+ connectorTO.setLocation(connectorService.read(100L).getLocation());
+
+ // set connector version
+ connectorTO.setVersion(connidSoapVersion);
+
+ // set connector name
+ connectorTO.setConnectorName("net.tirasa.connid.bundles.soap.WebServiceConnector");
+
+ // set bundle name
+ connectorTO.setBundleName("net.tirasa.connid.bundles.soap");
+
+ // set display name
+ connectorTO.setDisplayName("WSSoap");
+
+ // set the connector configuration using PropertyTO
+ Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
+
+ ConnConfPropSchema userSchema = new ConnConfPropSchema();
+ userSchema.setName("endpoint");
+ userSchema.setType(String.class.getName());
+ userSchema.setRequired(true);
+ ConnConfProperty endpoint = new ConnConfProperty();
+ endpoint.setSchema(userSchema);
+ endpoint.getValues().add("http://localhost:9080/does_not_work");
+ endpoint.setOverridable(true);
+
+ ConnConfPropSchema keyColumnSchema = new ConnConfPropSchema();
+ keyColumnSchema.setName("servicename");
+ keyColumnSchema.setType(String.class.getName());
+ keyColumnSchema.setRequired(true);
+ ConnConfProperty servicename = new ConnConfProperty();
+ servicename.setSchema(keyColumnSchema);
+ servicename.getValues().add("net.tirasa.connid.bundles.soap.provisioning.interfaces.Provisioning");
+ servicename.setOverridable(false);
+
+ conf.add(endpoint);
+ conf.add(servicename);
+
+ // set connector configuration
+ connectorTO.getConfiguration().addAll(conf);
+
+ try {
+ assertFalse(connectorService.check(connectorTO));
+
+ Response response = connectorService.create(connectorTO);
+ if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
+ throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
+ }
+
+ connectorTO = getObject(response.getLocation(), ConnectorService.class, ConnInstanceTO.class);
+ assertNotNull(connectorTO);
+ // ----------------------------------------
+
+ // ----------------------------------------
+ // create a resourceTO
+ // ----------------------------------------
+ String resourceName = "checkForPropOverriding";
+ ResourceTO resourceTO = new ResourceTO();
+
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(connectorTO.getKey());
+
+ conf = new HashSet<ConnConfProperty>();
+ endpoint.getValues().clear();
+ endpoint.getValues().add("http://localhost:9080/wssample/services/provisioning");
+ conf.add(endpoint);
+
+ resourceTO.getConnConfProperties().addAll(conf);
+
+ MappingTO mapping = new MappingTO();
+ resourceTO.setUmapping(mapping);
+
+ MappingItemTO mapItem = new MappingItemTO();
+ mapItem.setExtAttrName("uid");
+ mapItem.setIntAttrName("userId");
+ mapItem.setIntMappingType(IntMappingType.UserPlainSchema);
+ mapItem.setAccountid(true);
+ mapping.setAccountIdItem(mapItem);
+ // ----------------------------------------
+
+ // ----------------------------------------
+ // Check connection without saving the resource ....
+ // ----------------------------------------
+ assertTrue(resourceService.check(resourceTO));
+ // ----------------------------------------
+ } finally {
+ // Remove connector from db to make test re-runnable
+ connectorService.delete(connectorTO.getKey());
+ }
+ }
+
+ @Test
+ public void reload() {
+ connectorService.reload();
+ }
+
+ @Test
+ public void bulkAction() {
+ final BulkAction bulkAction = new BulkAction();
+ bulkAction.setOperation(BulkAction.Type.DELETE);
+
+ ConnInstanceTO conn = connectorService.read(101L);
+
+ conn.setKey(0);
+ conn.setDisplayName("forBulk1");
+
+ bulkAction.getTargets().add(String.valueOf(getObject(
+ connectorService.create(conn).getLocation(), ConnectorService.class, ConnInstanceTO.class).getKey()));
+
+ conn.setDisplayName("forBulk2");
+
+ bulkAction.getTargets().add(String.valueOf(getObject(
+ connectorService.create(conn).getLocation(), ConnectorService.class, ConnInstanceTO.class).getKey()));
+
+ Iterator<String> iter = bulkAction.getTargets().iterator();
+
+ assertNotNull(connectorService.read(Long.valueOf(iter.next())));
+ assertNotNull(connectorService.read(Long.valueOf(iter.next())));
+
+ connectorService.bulk(bulkAction);
+
+ iter = bulkAction.getTargets().iterator();
+
+ try {
+ connectorService.read(Long.valueOf(iter.next()));
+ fail();
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ }
+
+ try {
+ connectorService.read(Long.valueOf(iter.next()));
+ fail();
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE605() {
+
+ ConnInstanceTO connectorInstanceTO = connectorService.read(103L);
+ assertTrue(connectorInstanceTO.getCapabilities().isEmpty());
+
+ connectorInstanceTO.getCapabilities().add(ConnectorCapability.SEARCH);
+ connectorService.update(connectorInstanceTO.getKey(), connectorInstanceTO);
+
+ ConnInstanceTO updatedCapabilities = connectorService.read(connectorInstanceTO.getKey());
+ assertNotNull(updatedCapabilities.getCapabilities());
+ assertTrue(updatedCapabilities.getCapabilities().size() == 1);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java
new file mode 100644
index 0000000..9ac24ea
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/DerSchemaITCase.java
@@ -0,0 +1,151 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.DerSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class DerSchemaITCase extends AbstractITCase {
+
+ @Test
+ public void list() {
+ List<DerSchemaTO> derivedSchemas = schemaService.list(AttributableType.USER, SchemaType.DERIVED);
+ assertFalse(derivedSchemas.isEmpty());
+ for (DerSchemaTO derivedSchemaTO : derivedSchemas) {
+ assertNotNull(derivedSchemaTO);
+ }
+ }
+
+ @Test
+ public void read() {
+ DerSchemaTO derivedSchemaTO = schemaService.read(AttributableType.USER, SchemaType.DERIVED,
+ "cn");
+ assertNotNull(derivedSchemaTO);
+ }
+
+ @Test
+ public void create() {
+ DerSchemaTO schema = new DerSchemaTO();
+ schema.setKey("derived");
+ schema.setExpression("derived_sx + '_' + derived_dx");
+
+ DerSchemaTO actual = createSchema(AttributableType.USER, SchemaType.DERIVED, schema);
+ assertNotNull(actual);
+
+ actual = schemaService.read(AttributableType.USER, SchemaType.DERIVED, actual.getKey());
+ assertNotNull(actual);
+ assertEquals(actual.getExpression(), "derived_sx + '_' + derived_dx");
+ }
+
+ @Test
+ public void delete() {
+ DerSchemaTO schema = schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
+ assertNotNull(schema);
+
+ schemaService.delete(AttributableType.ROLE, SchemaType.DERIVED, schema.getKey());
+
+ try {
+ schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ } finally {
+ // Recreate schema to make test re-runnable
+ schema = createSchema(AttributableType.ROLE, SchemaType.DERIVED, schema);
+ assertNotNull(schema);
+ }
+ }
+
+ @Test
+ public void update() {
+ DerSchemaTO schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
+ "mderiveddata");
+ assertNotNull(schema);
+ assertEquals("mderived_sx + '-' + mderived_dx", schema.getExpression());
+ try {
+ schema.setExpression("mderived_sx + '.' + mderived_dx");
+
+ schemaService.update(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
+ schema.getKey(), schema);
+
+ schema = schemaService.read(AttributableType.MEMBERSHIP, SchemaType.DERIVED, "mderiveddata");
+ assertNotNull(schema);
+ assertEquals("mderived_sx + '.' + mderived_dx", schema.getExpression());
+ } finally {
+ // Set updated back to make test re-runnable
+ schema.setExpression("mderived_sx + '-' + mderived_dx");
+ schemaService.update(AttributableType.MEMBERSHIP, SchemaType.DERIVED,
+ schema.getKey(), schema);
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE323() {
+ DerSchemaTO actual = schemaService.read(AttributableType.ROLE, SchemaType.DERIVED, "rderiveddata");
+ assertNotNull(actual);
+
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.DERIVED, actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.EntityExists, e.getType());
+ }
+
+ actual.setKey(null);
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.DERIVED, actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE418() {
+ DerSchemaTO schema = new DerSchemaTO();
+ schema.setKey("http://schemas.examples.org/security/authorization/organizationUnit");
+ schema.setExpression("derived_sx + '_' + derived_dx");
+
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.DERIVED, schema);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidDerSchema, e.getType());
+ assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java
new file mode 100644
index 0000000..68510bf
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/LoggerITCase.java
@@ -0,0 +1,215 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import java.text.ParseException;
+import java.util.List;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.to.LoggerTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.AuditElements;
+import org.apache.syncope.common.lib.types.AuditElements.EventCategoryType;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+import org.apache.syncope.common.lib.types.LoggerLevel;
+import org.apache.syncope.common.lib.types.LoggerType;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.server.logic.ReportLogic;
+import org.apache.syncope.server.logic.ResourceLogic;
+import org.apache.syncope.server.logic.RoleLogic;
+import org.apache.syncope.server.logic.UserLogic;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class LoggerITCase extends AbstractITCase {
+
+ @Test
+ public void listLogs() {
+ List<LoggerTO> loggers = loggerService.list(LoggerType.LOG);
+ assertNotNull(loggers);
+ assertFalse(loggers.isEmpty());
+ for (LoggerTO logger : loggers) {
+ assertNotNull(logger);
+ }
+ }
+
+ @Test
+ public void listAudits() throws ParseException {
+ List<LoggerTO> audits = loggerService.list(LoggerType.AUDIT);
+
+ assertNotNull(audits);
+ assertFalse(audits.isEmpty());
+ for (LoggerTO audit : audits) {
+ assertNotNull(AuditLoggerName.fromLoggerName(audit.getKey()));
+ }
+ }
+
+ @Test
+ public void setLevel() {
+ List<LoggerTO> loggers = loggerService.list(LoggerType.LOG);
+ assertNotNull(loggers);
+ int startSize = loggers.size();
+
+ LoggerTO logger = new LoggerTO();
+ logger.setKey("TEST");
+ logger.setLevel(LoggerLevel.INFO);
+ loggerService.update(LoggerType.LOG, logger.getKey(), logger);
+ logger = loggerService.read(LoggerType.LOG, logger.getKey());
+ assertNotNull(logger);
+ assertEquals(LoggerLevel.INFO, logger.getLevel());
+
+ loggers = loggerService.list(LoggerType.LOG);
+ assertNotNull(loggers);
+ assertEquals(startSize + 1, loggers.size());
+
+ // TEST Delete
+ loggerService.delete(LoggerType.LOG, "TEST");
+ loggers = loggerService.list(LoggerType.LOG);
+ assertNotNull(loggers);
+ assertEquals(startSize, loggers.size());
+ }
+
+ @Test
+ public void enableDisableAudit() {
+ AuditLoggerName auditLoggerName = new AuditLoggerName(
+ EventCategoryType.REST,
+ ReportLogic.class.getSimpleName(),
+ null,
+ "deleteExecution",
+ AuditElements.Result.FAILURE);
+
+ List<AuditLoggerName> audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
+ assertNotNull(audits);
+ assertFalse(audits.contains(auditLoggerName));
+
+ LoggerTO loggerTO = new LoggerTO();
+ String name = auditLoggerName.toLoggerName();
+ loggerTO.setKey(name);
+ loggerTO.setLevel(LoggerLevel.DEBUG);
+ loggerService.update(LoggerType.AUDIT, name, loggerTO);
+
+ audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
+ assertNotNull(audits);
+ assertTrue(audits.contains(auditLoggerName));
+
+ loggerService.delete(LoggerType.AUDIT, auditLoggerName.toLoggerName());
+
+ audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
+ assertNotNull(audits);
+ assertFalse(audits.contains(auditLoggerName));
+ }
+
+ @Test
+ public void listAuditEvents() {
+ final List<EventCategoryTO> events = loggerService.events();
+
+ boolean found = false;
+
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (UserLogic.class.getSimpleName().equals(eventCategoryTO.getCategory())) {
+ assertEquals(EventCategoryType.REST, eventCategoryTO.getType());
+ assertTrue(eventCategoryTO.getEvents().contains("create"));
+ assertTrue(eventCategoryTO.getEvents().contains("list"));
+ assertFalse(eventCategoryTO.getEvents().contains("doCreate"));
+ assertFalse(eventCategoryTO.getEvents().contains("setStatusOnWfAdapter"));
+ assertFalse(eventCategoryTO.getEvents().contains("resolveReference"));
+ found = true;
+ }
+ }
+ assertTrue(found);
+
+ found = false;
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (RoleLogic.class.getSimpleName().equals(eventCategoryTO.getCategory())) {
+ assertEquals(EventCategoryType.REST, eventCategoryTO.getType());
+ assertTrue(eventCategoryTO.getEvents().contains("create"));
+ assertTrue(eventCategoryTO.getEvents().contains("list"));
+ assertFalse(eventCategoryTO.getEvents().contains("resolveReference"));
+ found = true;
+ }
+ }
+ assertTrue(found);
+
+ found = false;
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (ResourceLogic.class.getSimpleName().equals(eventCategoryTO.getCategory())) {
+ assertEquals(EventCategoryType.REST, eventCategoryTO.getType());
+ assertTrue(eventCategoryTO.getEvents().contains("create"));
+ assertTrue(eventCategoryTO.getEvents().contains("read"));
+ assertTrue(eventCategoryTO.getEvents().contains("delete"));
+ assertFalse(eventCategoryTO.getEvents().contains("resolveReference"));
+ found = true;
+ }
+ }
+ assertTrue(found);
+
+ found = false;
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (AttributableType.USER.name().toLowerCase().equals(eventCategoryTO.getCategory())) {
+ if (RESOURCE_NAME_LDAP.equals(eventCategoryTO.getSubcategory())
+ && EventCategoryType.SYNCHRONIZATION == eventCategoryTO.getType()) {
+ assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.CREATE.name().toLowerCase()));
+ assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.UPDATE.name().toLowerCase()));
+ assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.DELETE.name().toLowerCase()));
+ found = true;
+ }
+ }
+ }
+ assertTrue(found);
+
+ found = false;
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (AttributableType.USER.name().toLowerCase().equals(eventCategoryTO.getCategory())) {
+ if (RESOURCE_NAME_CSV.equals(eventCategoryTO.getSubcategory())
+ && EventCategoryType.PROPAGATION == eventCategoryTO.getType()) {
+ assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.CREATE.name().toLowerCase()));
+ assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.UPDATE.name().toLowerCase()));
+ assertTrue(eventCategoryTO.getEvents().contains(ResourceOperation.DELETE.name().toLowerCase()));
+ found = true;
+ }
+ }
+ }
+ assertTrue(found);
+
+ found = false;
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (EventCategoryType.TASK == eventCategoryTO.getType()
+ && "SampleJob".equals(eventCategoryTO.getCategory())) {
+ found = true;
+ }
+ }
+ assertTrue(found);
+
+ found = false;
+ for (EventCategoryTO eventCategoryTO : events) {
+ if (EventCategoryType.TASK == eventCategoryTO.getType()
+ && "SyncJob".equals(eventCategoryTO.getCategory())) {
+ found = true;
+ }
+ }
+ assertTrue(found);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java
new file mode 100644
index 0000000..cb09ea8
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationITCase.java
@@ -0,0 +1,172 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.TraceLevel;
+import org.apache.syncope.common.rest.api.service.NotificationService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class NotificationITCase extends AbstractITCase {
+
+ private NotificationTO buildNotificationTO() {
+ NotificationTO notificationTO = new NotificationTO();
+ notificationTO.setTraceLevel(TraceLevel.SUMMARY);
+ notificationTO.getEvents().add("create");
+
+ notificationTO.setUserAbout(SyncopeClient.getUserSearchConditionBuilder().
+ is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query());
+
+ notificationTO.setRecipientAttrName("email");
+ notificationTO.setRecipientAttrType(IntMappingType.UserPlainSchema);
+
+ notificationTO.setSender("syncope@syncope.apache.org");
+ notificationTO.setSubject("Test notification");
+ notificationTO.setTemplate("test");
+ return notificationTO;
+ }
+
+ @Test
+ public void read() {
+ NotificationTO notificationTO = notificationService.read(10L);
+ assertNotNull(notificationTO);
+ }
+
+ @Test
+ public void list() {
+ List<NotificationTO> notificationTOs = notificationService.list();
+ assertNotNull(notificationTOs);
+ assertFalse(notificationTOs.isEmpty());
+ for (NotificationTO instance : notificationTOs) {
+ assertNotNull(instance);
+ }
+ }
+
+ @Test
+ public void create() {
+ NotificationTO notificationTO = buildNotificationTO();
+ notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
+
+ Response response = notificationService.create(notificationTO);
+ NotificationTO actual = getObject(response.getLocation(), NotificationService.class,
+ NotificationTO.class);
+
+ assertNotNull(actual);
+ assertNotNull(actual.getKey());
+ notificationTO.setKey(actual.getKey());
+ assertEquals(actual, notificationTO);
+ }
+
+ @Test
+ public void update() {
+ NotificationTO notificationTO = notificationService.read(10L);
+ notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
+
+ notificationService.update(notificationTO.getKey(), notificationTO);
+ NotificationTO actual = notificationService.read(notificationTO.getKey());
+ assertNotNull(actual);
+ assertEquals(actual, notificationTO);
+ }
+
+ @Test
+ public void delete() {
+ NotificationTO notification = buildNotificationTO();
+ notification.setSelfAsRecipient(true);
+ Response response = notificationService.create(notification);
+ notification = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
+
+ notificationService.delete(notification.getKey());
+
+ try {
+ notificationService.read(notification.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE83() {
+ NotificationTO notificationTO = buildNotificationTO();
+ notificationTO.setSelfAsRecipient(true);
+
+ NotificationTO actual = null;
+ try {
+ Response response = notificationService.create(notificationTO);
+ actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ }
+ assertNotNull(actual);
+ assertNotNull(actual.getKey());
+ notificationTO.setKey(actual.getKey());
+ assertEquals(actual, notificationTO);
+ }
+
+ @Test
+ public void issueSYNCOPE445() {
+ NotificationTO notificationTO = buildNotificationTO();
+ notificationTO.getStaticRecipients().add("syncope445@syncope.apache.org");
+
+ NotificationTO actual = null;
+ try {
+ Response response = notificationService.create(notificationTO);
+ actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ }
+ assertNotNull(actual);
+ assertNotNull(actual.getKey());
+ notificationTO.setKey(actual.getKey());
+ assertEquals(actual, notificationTO);
+ }
+
+ @Test
+ public void issueSYNCOPE446() {
+ NotificationTO notificationTO = buildNotificationTO();
+ notificationTO.getStaticRecipients().add("syncope446@syncope.apache.org");
+ notificationTO.setRoleAbout(SyncopeClient.getRoleSearchConditionBuilder().hasEntitlements("ROLE_READ").query());
+
+ NotificationTO actual = null;
+ try {
+ Response response = notificationService.create(notificationTO);
+ actual = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ }
+ assertNotNull(actual);
+ assertNotNull(actual.getKey());
+ notificationTO.setKey(actual.getKey());
+ assertEquals(actual, notificationTO);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java
new file mode 100644
index 0000000..4cd302b
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/NotificationTaskITCase.java
@@ -0,0 +1,156 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.to.NotificationTaskTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.lib.types.TraceLevel;
+import org.apache.syncope.common.rest.api.service.NotificationService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class NotificationTaskITCase extends AbstractTaskITCase {
+
+ @Test
+ public void issueSYNCOPE81() {
+ String sender = "syncope81@syncope.apache.org";
+ createNotificationTask(sender);
+ NotificationTaskTO taskTO = findNotificationTaskBySender(sender);
+ assertNotNull(taskTO);
+
+ assertTrue(taskTO.getExecutions().isEmpty());
+
+ // generate an execution in order to verify the deletion of a notification task with one or more executions
+ TaskExecTO execution = taskService.execute(taskTO.getKey(), false);
+ assertEquals("NOT_SENT", execution.getStatus());
+
+ int i = 0;
+ int maxit = 50;
+ int executions = 0;
+
+ // wait for task exec completion (executions incremented)
+ do {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+
+ taskTO = taskService.read(taskTO.getKey());
+
+ assertNotNull(taskTO);
+ assertNotNull(taskTO.getExecutions());
+
+ i++;
+ } while (executions == taskTO.getExecutions().size() && i < maxit);
+
+ assertFalse(taskTO.getExecutions().isEmpty());
+
+ taskService.delete(taskTO.getKey());
+ }
+
+ @Test
+ public void issueSYNCOPE86() {
+ // 1. create notification task
+ String sender = "syncope86@syncope.apache.org";
+ createNotificationTask(sender);
+
+ // 2. get NotificationTaskTO for user just created
+ NotificationTaskTO taskTO = findNotificationTaskBySender(sender);
+ assertNotNull(taskTO);
+ assertTrue(taskTO.getExecutions().isEmpty());
+
+ try {
+ // 3. execute the generated NotificationTask
+ TaskExecTO execution = taskService.execute(taskTO.getKey(), false);
+ assertNotNull(execution);
+
+ // 4. verify
+ taskTO = taskService.read(taskTO.getKey());
+ assertNotNull(taskTO);
+ assertEquals(1, taskTO.getExecutions().size());
+ } finally {
+ // Remove execution to make test re-runnable
+ taskService.deleteExecution(taskTO.getExecutions().get(0).getKey());
+ }
+ }
+
+ private NotificationTaskTO findNotificationTaskBySender(final String sender) {
+ PagedResult<NotificationTaskTO> tasks = taskService.list(TaskType.NOTIFICATION);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+ NotificationTaskTO taskTO = null;
+ for (NotificationTaskTO task : tasks.getResult()) {
+ if (sender.equals(task.getSender())) {
+ taskTO = task;
+ }
+ }
+ return taskTO;
+ }
+
+ private void createNotificationTask(final String sender) {
+ // 1. Create notification
+ NotificationTO notification = new NotificationTO();
+ notification.setTraceLevel(TraceLevel.FAILURES);
+ notification.getEvents().add("[REST]:[UserLogic]:[]:[create]:[SUCCESS]");
+
+ notification.setUserAbout(SyncopeClient.getUserSearchConditionBuilder().hasRoles(7L).query());
+
+ notification.setRecipients(SyncopeClient.getUserSearchConditionBuilder().hasRoles(8L).query());
+ notification.setSelfAsRecipient(true);
+
+ notification.setRecipientAttrName("email");
+ notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
+
+ notification.setSender(sender);
+ String subject = "Test notification";
+ notification.setSubject(subject);
+ notification.setTemplate("optin");
+ notification.setActive(true);
+
+ Response response = notificationService.create(notification);
+ notification = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
+ assertNotNull(notification);
+
+ // 2. create user
+ UserTO userTO = UserITCase.getUniqueSampleTO("syncope@syncope.apache.org");
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java
new file mode 100644
index 0000000..448d1fa
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PlainSchemaITCase.java
@@ -0,0 +1,317 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.security.AccessControlException;
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.syncope.common.lib.AttributableOperations;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.rest.api.service.SchemaService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class PlainSchemaITCase extends AbstractITCase {
+
+ private PlainSchemaTO buildPlainSchemaTO(final String name, final AttrSchemaType type) {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey(name + getUUIDString());
+ schemaTO.setType(type);
+ return schemaTO;
+ }
+
+ @Test
+ public void create() {
+ PlainSchemaTO schemaTO = buildPlainSchemaTO("testAttribute", AttrSchemaType.String);
+ schemaTO.setMandatoryCondition("false");
+
+ PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ assertEquals(schemaTO, newPlainSchemaTO);
+
+ newPlainSchemaTO = createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, schemaTO);
+ assertEquals(schemaTO, newPlainSchemaTO);
+ }
+
+ @Test
+ public void createWithNotPermittedName() {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("failedLogins");
+ schemaTO.setType(AttrSchemaType.String);
+
+ try {
+ createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ fail("This should not be reacheable");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+
+ assertTrue(e.getElements().iterator().next().toString().
+ contains(EntityViolationType.InvalidName.name()));
+ }
+ }
+
+ @Test
+ public void createREnumWithoutEnumeration() {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("enumcheck");
+ schemaTO.setType(AttrSchemaType.Enum);
+
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.PLAIN, schemaTO);
+ fail("This should not be reacheable");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+
+ assertTrue(e.getElements().iterator().next().toString().
+ contains(EntityViolationType.InvalidSchemaEnum.name()));
+ }
+ }
+
+ @Test
+ public void createUEnumWithoutEnumeration() {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("enumcheck");
+ schemaTO.setType(AttrSchemaType.Enum);
+
+ try {
+ createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ fail("This should not be reacheable");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+
+ assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidSchemaEnum.name()));
+ }
+ }
+
+ @Test
+ public void createEncrypted() {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("encrypted");
+ schemaTO.setType(AttrSchemaType.Encrypted);
+ schemaTO.setCipherAlgorithm(CipherAlgorithm.AES);
+ schemaTO.setSecretKey("huhadfhsjfsfsdkj!####");
+
+ createSchema(AttributableType.MEMBERSHIP, SchemaType.PLAIN, schemaTO);
+ }
+
+ @Test
+ public void createBinary() {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("x509certificate");
+ schemaTO.setType(AttrSchemaType.Binary);
+ schemaTO.setMimeType("application/x-x509-ca-cert");
+
+ createSchema(AttributableType.ROLE, SchemaType.PLAIN, schemaTO);
+ }
+
+ @Test
+ public void delete() {
+ PlainSchemaTO schemaTO = buildPlainSchemaTO("todelete", AttrSchemaType.String);
+ schemaTO.setMandatoryCondition("false");
+ createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+
+ schemaService.delete(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey());
+ PlainSchemaTO firstname = null;
+ try {
+ firstname = schemaService.read(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey());
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ assertNull(firstname);
+ }
+
+ @Test
+ public void list() {
+ List<PlainSchemaTO> userSchemas = schemaService.list(AttributableType.USER, SchemaType.PLAIN);
+ assertFalse(userSchemas.isEmpty());
+ for (PlainSchemaTO schemaTO : userSchemas) {
+ assertNotNull(schemaTO);
+ }
+
+ List<PlainSchemaTO> roleSchemas = schemaService.list(AttributableType.ROLE, SchemaType.PLAIN);
+ assertFalse(roleSchemas.isEmpty());
+ for (PlainSchemaTO schemaTO : roleSchemas) {
+ assertNotNull(schemaTO);
+ }
+
+ List<PlainSchemaTO> membershipSchemas = schemaService.list(AttributableType.MEMBERSHIP, SchemaType.PLAIN);
+ assertFalse(membershipSchemas.isEmpty());
+ for (PlainSchemaTO schemaTO : membershipSchemas) {
+ assertNotNull(schemaTO);
+ }
+ }
+
+ @Test
+ public void update() {
+ PlainSchemaTO schemaTO = schemaService.read(AttributableType.ROLE, SchemaType.PLAIN, "icon");
+ assertNotNull(schemaTO);
+
+ schemaService.update(AttributableType.ROLE, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+ PlainSchemaTO updatedTO = schemaService.read(AttributableType.ROLE, SchemaType.PLAIN, "icon");
+ assertEquals(schemaTO, updatedTO);
+
+ updatedTO.setType(AttrSchemaType.Date);
+ try {
+ schemaService.update(AttributableType.ROLE, SchemaType.PLAIN, schemaTO.getKey(), updatedTO);
+ fail("This should not be reacheable");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+ }
+ }
+
+ @Test
+ public void issue258() {
+ PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("schema_issue258");
+ schemaTO.setType(AttrSchemaType.Double);
+
+ schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ assertNotNull(schemaTO);
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("issue258@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO(schemaTO.getKey(), "1.2"));
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ schemaTO.setType(AttrSchemaType.Long);
+ try {
+ schemaService.update(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+ fail("This should not be reacheable");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+ }
+ }
+
+ @Test
+ public void issue259() {
+ PlainSchemaTO schemaTO = buildPlainSchemaTO("schema_issue259", AttrSchemaType.Double);
+ schemaTO.setUniqueConstraint(true);
+
+ schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ assertNotNull(schemaTO);
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("issue259@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO(schemaTO.getKey(), "1"));
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserTO newUserTO = SerializationUtils.clone(userTO);
+ MembershipTO membership = new MembershipTO();
+ membership.setRoleId(2L);
+ newUserTO.getMemberships().add(membership);
+
+ UserMod userMod = AttributableOperations.diff(newUserTO, userTO);
+
+ userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void issue260() {
+ PlainSchemaTO schemaTO = buildPlainSchemaTO("schema_issue260", AttrSchemaType.Double);
+ schemaTO.setUniqueConstraint(true);
+
+ schemaTO = createSchema(AttributableType.USER, SchemaType.PLAIN, schemaTO);
+ assertNotNull(schemaTO);
+
+ UserTO userTO = UserITCase.getUniqueSampleTO("issue260@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO(schemaTO.getKey(), "1.2"));
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ schemaTO.setUniqueConstraint(false);
+ try {
+ schemaService.update(AttributableType.USER, SchemaType.PLAIN, schemaTO.getKey(), schemaTO);
+ fail("This should not be reacheable");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE323() {
+ PlainSchemaTO actual = schemaService.read(AttributableType.ROLE, SchemaType.PLAIN, "icon");
+ assertNotNull(actual);
+
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.PLAIN, actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.EntityExists, e.getType());
+ }
+
+ actual.setKey(null);
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.PLAIN, actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE418() {
+ PlainSchemaTO schema = buildPlainSchemaTO("http://schemas.examples.org/security/authorization/organizationUnit",
+ AttrSchemaType.Double);
+
+ try {
+ createSchema(AttributableType.ROLE, SchemaType.PLAIN, schema);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPlainSchema, e.getType());
+ assertTrue(e.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
+ }
+ }
+
+ @Test
+ public void anonymous() {
+ SchemaService unauthenticated = clientFactory.createAnonymous().getService(SchemaService.class);
+ try {
+ unauthenticated.list(AttributableType.USER, SchemaType.VIRTUAL);
+ fail();
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ SchemaService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).getService(SchemaService.class);
+ assertFalse(anonymous.list(AttributableType.USER, SchemaType.VIRTUAL).isEmpty());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java
new file mode 100644
index 0000000..c25dc7f
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PolicyITCase.java
@@ -0,0 +1,238 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Arrays;
+import java.util.List;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AccountPolicyTO;
+import org.apache.syncope.common.lib.to.PasswordPolicyTO;
+import org.apache.syncope.common.lib.to.SyncPolicyTO;
+import org.apache.syncope.common.lib.types.AccountPolicySpec;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.PasswordPolicySpec;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.lib.types.SyncPolicySpec;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class PolicyITCase extends AbstractITCase {
+
+ private SyncPolicyTO buildSyncPolicyTO() {
+ SyncPolicyTO policy = new SyncPolicyTO();
+
+ SyncPolicySpec spec = new SyncPolicySpec();
+ spec.setUserJavaRule(TestSyncRule.class.getName());
+
+ policy.setSpecification(spec);
+ policy.setDescription("Sync policy");
+
+ return policy;
+ }
+
+ @Test
+ public void listByType() {
+ List<SyncPolicyTO> policyTOs = policyService.list(PolicyType.SYNC);
+
+ assertNotNull(policyTOs);
+ assertFalse(policyTOs.isEmpty());
+ }
+
+ @Test
+ public void getAccountPolicy() {
+ AccountPolicyTO policyTO = policyService.read(6L);
+
+ assertNotNull(policyTO);
+ assertTrue(policyTO.getUsedByResources().isEmpty());
+ assertEquals(Arrays.asList(6L, 7L, 10L, 14L), policyTO.getUsedByRoles());
+ }
+
+ @Test
+ public void getPasswordPolicy() {
+ PasswordPolicyTO policyTO = policyService.read(4L);
+
+ assertNotNull(policyTO);
+ assertTrue(policyTO.getUsedByResources().contains(RESOURCE_NAME_NOPROPAGATION));
+ assertEquals(Arrays.asList(6L, 7L, 10L, 8L), policyTO.getUsedByRoles());
+ }
+
+ @Test
+ public void getSyncPolicy() {
+ SyncPolicyTO policyTO = policyService.read(1L);
+
+ assertNotNull(policyTO);
+ assertTrue(policyTO.getUsedByRoles().isEmpty());
+ }
+
+ @Test
+ public void getGlobalAccountPolicy() {
+ AccountPolicyTO policyTO = policyService.readGlobal(PolicyType.ACCOUNT);
+
+ assertNotNull(policyTO);
+ assertEquals(PolicyType.GLOBAL_ACCOUNT, policyTO.getType());
+ }
+
+ @Test
+ public void getGlobalPasswordPolicy() {
+ PasswordPolicyTO policyTO = policyService.readGlobal(PolicyType.PASSWORD);
+
+ assertNotNull(policyTO);
+ assertEquals(PolicyType.GLOBAL_PASSWORD, policyTO.getType());
+ assertEquals(8, policyTO.getSpecification().getMinLength());
+ assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_NOPROPAGATION));
+ }
+
+ @Test
+ public void getGlobalSyncPolicy() {
+ SyncPolicyTO policyTO = policyService.readGlobal(PolicyType.SYNC);
+
+ assertNotNull(policyTO);
+ assertEquals(PolicyType.GLOBAL_SYNC, policyTO.getType());
+ assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_CSV));
+ assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_WS2));
+ assertTrue(policyTO.getUsedByRoles().isEmpty());
+ }
+
+ @Test
+ public void createWithException() {
+ PasswordPolicyTO policy = new PasswordPolicyTO(true);
+ policy.setSpecification(new PasswordPolicySpec());
+ policy.setDescription("global password policy");
+
+ try {
+ createPolicy(policy);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
+ }
+ }
+
+ @Test
+ public void createMissingDescription() {
+ SyncPolicyTO policy = new SyncPolicyTO();
+ policy.setSpecification(new SyncPolicySpec());
+
+ try {
+ createPolicy(policy);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
+ }
+ }
+
+ @Test
+ public void create() {
+ SyncPolicyTO policy = buildSyncPolicyTO();
+
+ SyncPolicyTO policyTO = createPolicy(policy);
+
+ assertNotNull(policyTO);
+ assertEquals(PolicyType.SYNC, policyTO.getType());
+ assertEquals(TestSyncRule.class.getName(), policyTO.getSpecification().getUserJavaRule());
+ }
+
+ @Test
+ public void update() {
+ // get global password
+ PasswordPolicyTO globalPolicy = policyService.read(2L);
+
+ PasswordPolicyTO policy = new PasswordPolicyTO();
+ policy.setDescription("A simple password policy");
+ policy.setSpecification(globalPolicy.getSpecification());
+
+ // create a new password policy using global password as a template
+ policy = createPolicy(policy);
+
+ // read new password policy
+ policy = policyService.read(policy.getKey());
+
+ assertNotNull("find to update did not work", policy);
+
+ PasswordPolicySpec policySpec = policy.getSpecification();
+ policySpec.setMaxLength(22);
+ policy.setSpecification(policySpec);
+
+ // update new password policy
+ policyService.update(policy.getKey(), policy);
+ policy = policyService.read(policy.getKey());
+
+ assertNotNull(policy);
+ assertEquals(PolicyType.PASSWORD, policy.getType());
+ assertEquals(22, policy.getSpecification().getMaxLength());
+ assertEquals(8, policy.getSpecification().getMinLength());
+ }
+
+ @Test
+ public void delete() {
+ SyncPolicyTO policy = buildSyncPolicyTO();
+
+ SyncPolicyTO policyTO = createPolicy(policy);
+ assertNotNull(policyTO);
+
+ policyService.delete(policyTO.getKey());
+
+ try {
+ policyService.read(policyTO.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void getCorrelationRules() {
+ assertEquals(1, syncopeService.info().getSyncCorrelationRules().size());
+ }
+
+ @Test
+ public void issueSYNCOPE466() {
+ PasswordPolicyTO policy = policyService.read(4L);
+ assertEquals(PolicyType.PASSWORD, policy.getType());
+
+ policy.setType(PolicyType.GLOBAL_PASSWORD);
+ try {
+ policyService.update(policy.getKey(), policy);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE553() {
+ AccountPolicyTO policy = new AccountPolicyTO(false);
+ policy.setDescription("SYNCOPE553");
+
+ final AccountPolicySpec accountPolicySpec = new AccountPolicySpec();
+ accountPolicySpec.setMinLength(3);
+ accountPolicySpec.setMaxLength(8);
+ policy.setSpecification(accountPolicySpec);
+
+ policy = createPolicy(policy);
+ assertNotNull(policy);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java
new file mode 100644
index 0000000..a79e1d8
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PropagationTaskITCase.java
@@ -0,0 +1,150 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.ReportExecTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class PropagationTaskITCase extends AbstractTaskITCase {
+
+ @Test
+ public void paginatedList() {
+ PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 2);
+
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+ assertEquals(2, tasks.getResult().size());
+
+ for (AbstractTaskTO task : tasks.getResult()) {
+ assertNotNull(task);
+ }
+
+ tasks = taskService.list(TaskType.PROPAGATION, 2, 2);
+
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ for (AbstractTaskTO task : tasks.getResult()) {
+ assertNotNull(task);
+ }
+
+ tasks = taskService.list(TaskType.PROPAGATION, 1000, 2);
+
+ assertNotNull(tasks);
+ assertTrue(tasks.getResult().isEmpty());
+ }
+
+ @Test
+ public void read() {
+ final PropagationTaskTO taskTO = taskService.read(3L);
+ assertNotNull(taskTO);
+ assertNotNull(taskTO.getExecutions());
+ assertTrue(taskTO.getExecutions().isEmpty());
+ }
+
+ @Test
+ public void readExecution() {
+ TaskExecTO taskTO = taskService.readExecution(6L);
+ assertNotNull(taskTO);
+ }
+
+ @Test
+ public void deal() {
+ // Currently test is not re-runnable.
+ // To successfully run test second time it is necessary to restart cargo
+ try {
+ taskService.delete(0L);
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ TaskExecTO exec = taskService.execute(1L, false);
+ assertEquals(PropagationTaskExecStatus.SUBMITTED.name(), exec.getStatus());
+
+ ReportExecTO report = new ReportExecTO();
+ report.setStatus(PropagationTaskExecStatus.SUCCESS.name());
+ report.setMessage("OK");
+ taskService.report(exec.getKey(), report);
+ exec = taskService.readExecution(exec.getKey());
+ assertEquals(PropagationTaskExecStatus.SUCCESS.name(), exec.getStatus());
+ assertEquals("OK", exec.getMessage());
+
+ taskService.delete(1L);
+ try {
+ taskService.readExecution(exec.getKey());
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void issue196() {
+ TaskExecTO exec = taskService.execute(6L, false);
+ assertNotNull(exec);
+ assertEquals(0, exec.getKey());
+ assertNotNull(exec.getTask());
+ }
+
+ @Test
+ public void bulkAction() {
+ final PagedResult<PropagationTaskTO> before = taskService.list(TaskType.PROPAGATION);
+
+ // create user with testdb resource
+ final UserTO userTO = UserITCase.getUniqueSampleTO("taskBulk@apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+ createUser(userTO);
+
+ final List<PropagationTaskTO> after = new ArrayList<>(
+ taskService.<PropagationTaskTO>list(TaskType.PROPAGATION).getResult());
+
+ after.removeAll(before.getResult());
+
+ assertFalse(after.isEmpty());
+
+ final BulkAction bulkAction = new BulkAction();
+ bulkAction.setOperation(BulkAction.Type.DELETE);
+
+ for (AbstractTaskTO taskTO : after) {
+ bulkAction.getTargets().add(String.valueOf(taskTO.getKey()));
+ }
+
+ taskService.bulk(bulkAction);
+
+ assertFalse(taskService.list(TaskType.PROPAGATION).getResult().containsAll(after));
+ }
+}
[31/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
new file mode 100644
index 0000000..3762dee
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSearchResultPanel.java
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.ResultStatusModalPage;
+import org.apache.syncope.client.console.pages.RoleModalPage;
+import org.apache.syncope.client.console.pages.StatusModalPage;
+import org.apache.syncope.client.console.rest.AbstractSubjectRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class RoleSearchResultPanel extends AbstractSearchResultPanel {
+
+ private static final long serialVersionUID = -1180593361914008764L;
+
+ private final static String PAGEID = "Roles";
+
+ public <T extends AbstractAttributableTO> RoleSearchResultPanel(final String id, final boolean filtered,
+ final String fiql, final PageReference callerRef, final AbstractSubjectRestClient restClient) {
+
+ super(id, filtered, fiql, callerRef, restClient);
+ initResultTable();
+ }
+
+ @Override
+ protected List<IColumn<AbstractAttributableTO, String>> getColumns() {
+ final List<IColumn<AbstractAttributableTO, String>> columns =
+ new ArrayList<IColumn<AbstractAttributableTO, String>>();
+
+ final String[] colnames = { "id", "name", "entitlements" };
+ for (String name : colnames) {
+ columns.add(
+ new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(name, name), name, name));
+ }
+
+ columns.add(new AbstractColumn<AbstractAttributableTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractAttributableTO>> cellItem,
+ final String componentId, final IModel<AbstractAttributableTO> model) {
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ statusmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new StatusModalPage<RoleTO>(
+ page.getPageReference(), statusmodal, (RoleTO) model.getObject());
+ }
+ });
+
+ statusmodal.show(target);
+ }
+ }, ActionLink.ActionType.MANAGE_RESOURCES, PAGEID);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ editmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new RoleModalPage(
+ page.getPageReference(), editmodal, (RoleTO) model.getObject());
+ }
+ });
+
+ editmodal.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, PAGEID);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ final RoleTO roleTO = (RoleTO) restClient.
+ delete(model.getObject().getETagValue(), model.getObject().getKey());
+
+ page.setModalResult(true);
+
+ editmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ResultStatusModalPage.Builder(editmodal, roleTO).build();
+ }
+ });
+
+ editmodal.show(target);
+ } catch (SyncopeClientException scce) {
+ error(getString(Constants.OPERATION_ERROR) + ": " + scce.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.DELETE, PAGEID);
+
+ cellItem.add(panel);
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ protected Collection<ActionType> getBulkActions() {
+ return Collections.<ActionLink.ActionType>singletonList(ActionLink.ActionType.DELETE);
+ }
+
+ @Override
+ protected String getPageId() {
+ return PAGEID;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSecurityPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSecurityPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSecurityPanel.java
new file mode 100644
index 0000000..b60d1e4
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSecurityPanel.java
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.PolicyRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AbstractPolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RoleSecurityPanel extends Panel {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(RoleSecurityPanel.class);
+
+ private static final long serialVersionUID = -7982691107029848579L;
+
+ @SpringBean
+ private PolicyRestClient policyRestClient;
+
+ private IModel<Map<Long, String>> passwordPolicies = null;
+
+ private IModel<Map<Long, String>> accountPolicies = null;
+
+ public <T extends AbstractAttributableTO> RoleSecurityPanel(final String id, final T entityTO) {
+ super(id);
+
+ setOutputMarkupId(true);
+
+ passwordPolicies = new LoadableDetachableModel<Map<Long, String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected Map<Long, String> load() {
+ Map<Long, String> res = new HashMap<>();
+ for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PASSWORD, false)) {
+ res.put(policyTO.getKey(), policyTO.getDescription());
+ }
+ return res;
+ }
+ };
+
+ accountPolicies = new LoadableDetachableModel<Map<Long, String>>() {
+
+ private static final long serialVersionUID = -2012833443695917883L;
+
+ @Override
+ protected Map<Long, String> load() {
+ Map<Long, String> res = new HashMap<>();
+ for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.ACCOUNT, false)) {
+ res.put(policyTO.getKey(), policyTO.getDescription());
+ }
+ return res;
+ }
+ };
+
+ final WebMarkupContainer securityContainer = new WebMarkupContainer("security");
+
+ securityContainer.setOutputMarkupId(true);
+ add(securityContainer);
+
+ // -------------------------------
+ // Password policy specification
+ // -------------------------------
+ final AjaxDropDownChoicePanel<Long> passwordPolicy = new AjaxDropDownChoicePanel<Long>("passwordPolicy",
+ "passwordPolicy", new PropertyModel<Long>(entityTO, "passwordPolicy"));
+
+ passwordPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.PASSWORD));
+
+ passwordPolicy.setChoices(new ArrayList<Long>(passwordPolicies.getObject().keySet()));
+
+ ((DropDownChoice<?>) passwordPolicy.getField()).setNullValid(true);
+
+ securityContainer.add(passwordPolicy);
+
+ final AjaxCheckBoxPanel inhPasswordPolicy = new AjaxCheckBoxPanel("inheritPasswordPolicy",
+ "inheritPasswordPolicy", new PropertyModel<Boolean>(entityTO, "inheritPasswordPolicy"));
+
+ passwordPolicy.setReadOnly(inhPasswordPolicy.getModelObject());
+
+ inhPasswordPolicy.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ passwordPolicy.setReadOnly(inhPasswordPolicy.getModelObject());
+ target.add(passwordPolicy);
+ }
+ });
+
+ securityContainer.add(inhPasswordPolicy);
+ // -------------------------------
+
+ // -------------------------------
+ // Account policy specification
+ // -------------------------------
+ final AjaxDropDownChoicePanel<Long> accountPolicy = new AjaxDropDownChoicePanel<Long>("accountPolicy",
+ "accountPolicy", new PropertyModel<Long>(entityTO, "accountPolicy"));
+
+ accountPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.ACCOUNT));
+
+ accountPolicy.setChoices(new ArrayList<Long>(accountPolicies.getObject().keySet()));
+
+ ((DropDownChoice<?>) accountPolicy.getField()).setNullValid(true);
+
+ securityContainer.add(accountPolicy);
+
+ final AjaxCheckBoxPanel inhAccountPolicy = new AjaxCheckBoxPanel("inheritAccountPolicy",
+ "inheritAccountPolicy", new PropertyModel<Boolean>(entityTO, "inheritAccountPolicy"));
+ accountPolicy.setReadOnly(inhAccountPolicy.getModelObject());
+
+ inhAccountPolicy.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ accountPolicy.setReadOnly(inhAccountPolicy.getModelObject());
+ target.add(accountPolicy);
+ }
+ });
+
+ securityContainer.add(inhAccountPolicy);
+ // -------------------------------
+ }
+
+ private class PolicyRenderer extends ChoiceRenderer<Long> {
+
+ private static final long serialVersionUID = 8060500161321947000L;
+
+ private PolicyType type;
+
+ public PolicyRenderer(final PolicyType type) {
+ super();
+ this.type = type;
+ }
+
+ @Override
+ public Object getDisplayValue(final Long object) {
+ Object displayValue;
+ switch (type) {
+ case ACCOUNT:
+ displayValue = accountPolicies.getObject().get(object);
+ break;
+ case PASSWORD:
+ displayValue = passwordPolicies.getObject().get(object);
+ break;
+ default:
+ displayValue = "";
+ }
+ return displayValue;
+ }
+
+ @Override
+ public String getIdValue(Long object, int index) {
+ return String.valueOf(object != null
+ ? object
+ : 0L);
+ }
+ };
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSummaryPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSummaryPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSummaryPanel.java
new file mode 100644
index 0000000..d7663be
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleSummaryPanel.java
@@ -0,0 +1,153 @@
+/*
+ * 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.commons.XMLRolesReader;
+import org.apache.syncope.client.console.pages.RoleModalPage;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RoleSummaryPanel extends Panel {
+
+ private static final long serialVersionUID = 643769814985593156L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(RoleSummaryPanel.class);
+
+ @SpringBean
+ private XMLRolesReader xmlRolesReader;
+
+ @SpringBean
+ private RoleRestClient restClient;
+
+ private RoleTO selectedNode;
+
+ public static class Builder implements Serializable {
+
+ private static final long serialVersionUID = 4164563358509351832L;
+
+ private String id;
+
+ private ModalWindow window;
+
+ private PageReference callerPageRef;
+
+ private Long selectedNodeId = null;
+
+ public Builder(final String id) {
+ this.id = id;
+ }
+
+ public RoleSummaryPanel.Builder window(final ModalWindow window) {
+ this.window = window;
+ return this;
+ }
+
+ public RoleSummaryPanel.Builder callerPageRef(final PageReference callerPageRef) {
+ this.callerPageRef = callerPageRef;
+ return this;
+ }
+
+ public RoleSummaryPanel.Builder selectedNodeId(final Long selectedNodeId) {
+ this.selectedNodeId = selectedNodeId;
+ return this;
+ }
+
+ public RoleSummaryPanel build() {
+ return new RoleSummaryPanel(this);
+ }
+ }
+
+ private RoleSummaryPanel(final Builder builder) {
+ super(builder.id);
+
+ if (builder.selectedNodeId == null || builder.selectedNodeId == 0) {
+ selectedNode = null;
+ } else {
+ try {
+ selectedNode = restClient.read(builder.selectedNodeId);
+ } catch (SyncopeClientException e) {
+ LOG.error("Could not read {}", builder.selectedNodeId, e);
+ selectedNode = null;
+ builder.selectedNodeId = null;
+ }
+ }
+
+ Fragment fragment = new Fragment("roleSummaryPanel",
+ builder.selectedNodeId == null
+ ? "fakerootFrag"
+ : (builder.selectedNodeId == 0 ? "rootPanel" : "roleViewPanel"),
+ this);
+
+ if (builder.selectedNodeId != null) {
+ if (builder.selectedNodeId == 0) {
+ @SuppressWarnings("rawtypes")
+ final ActionLinksPanel links = new ActionLinksPanel("actionLinks", new Model(), builder.callerPageRef);
+ links.setOutputMarkupId(true);
+ fragment.add(links);
+
+ links.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ builder.window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new RoleModalPage(builder.callerPageRef, builder.window, new RoleTO());
+ }
+ });
+
+ builder.window.show(target);
+ }
+ }, ActionLink.ActionType.CREATE, xmlRolesReader.getEntitlement("Roles", "create"));
+ } else {
+ RoleTabPanel roleTabPanel =
+ new RoleTabPanel("nodeViewPanel", selectedNode, builder.window, builder.callerPageRef);
+ roleTabPanel.setOutputMarkupId(true);
+ fragment.add(roleTabPanel);
+ }
+ }
+ add(fragment);
+ }
+
+ public RoleTO getSelectedNode() {
+ return selectedNode;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleTabPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleTabPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleTabPanel.java
new file mode 100644
index 0000000..7c483b5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleTabPanel.java
@@ -0,0 +1,195 @@
+/*
+ * 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.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.pages.ResultStatusModalPage;
+import org.apache.syncope.client.console.pages.RoleModalPage;
+import org.apache.syncope.client.console.pages.Roles;
+import org.apache.syncope.client.console.pages.StatusModalPage;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+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.lib.SyncopeClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class RoleTabPanel extends Panel {
+
+ private static final long serialVersionUID = 859236186975983959L;
+
+ @SpringBean
+ private XMLRolesReader xmlRolesReader;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ @SpringBean
+ private UserRestClient userRestClient;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public RoleTabPanel(final String id, final RoleTO selectedNode, final ModalWindow window,
+ final PageReference pageRef) {
+
+ super(id);
+
+ this.add(new Label("displayName", selectedNode.getDisplayName()));
+
+ final ActionLinksPanel links = new ActionLinksPanel("actionLinks", new Model(), pageRef);
+ links.setOutputMarkupId(true);
+ this.add(links);
+ links.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ RoleTO roleTO = new RoleTO();
+ roleTO.setParent(selectedNode.getKey());
+ return new RoleModalPage(pageRef, window, roleTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.CREATE, xmlRolesReader.getEntitlement("Roles", "create"));
+ links.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new StatusModalPage<RoleTO>(pageRef, window, roleRestClient.read(selectedNode.getKey()));
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.MANAGE_RESOURCES, xmlRolesReader.getEntitlement("Roles", "update"));
+ links.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ RoleTO roleTO = roleRestClient.read(selectedNode.getKey());
+ return new RoleModalPage(pageRef, window, roleTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, xmlRolesReader.getEntitlement("Roles", "update"));
+ links.addWithRoles(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ final RoleTO roleTO = roleRestClient.delete(selectedNode.getETagValue(), selectedNode.getKey());
+
+ ((Roles) pageRef.getPage()).setModalResult(true);
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ResultStatusModalPage.Builder(window, roleTO).build();
+ }
+ });
+
+ window.show(target);
+ } catch (SyncopeClientException e) {
+ error(getString(Constants.OPERATION_ERROR) + ": " + e.getMessage());
+ ((Roles) pageRef.getPage()).getFeedbackPanel().refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.DELETE, xmlRolesReader.getEntitlement("Roles", "delete"));
+
+ final Form form = new Form("roleForm");
+ form.setModel(new CompoundPropertyModel(selectedNode));
+ form.setOutputMarkupId(true);
+
+ final RolePanel rolePanel = new RolePanel.Builder("rolePanel").form(form).roleTO(selectedNode).
+ roleModalPageMode(Mode.ADMIN).build();
+ rolePanel.setEnabled(false);
+ form.add(rolePanel);
+
+ final WebMarkupContainer userListContainer = new WebMarkupContainer("userListContainer");
+
+ userListContainer.setOutputMarkupId(true);
+ userListContainer.setEnabled(true);
+ userListContainer.add(new UserSearchResultPanel("userList", true, null, pageRef, userRestClient));
+ userListContainer.add(new ClearIndicatingAjaxButton("search", new ResourceModel("search"), pageRef) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ userListContainer.replace(new UserSearchResultPanel("userList",
+ true,
+ SyncopeClient.getUserSearchConditionBuilder().hasRoles(selectedNode.getKey()).query(),
+ pageRef,
+ userRestClient));
+
+ target.add(userListContainer);
+ }
+ });
+
+ form.add(userListContainer);
+ add(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
new file mode 100644
index 0000000..bbc10b7
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SchedTasks.java
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.SchedTaskModalPage;
+import org.apache.syncope.client.console.pages.Tasks;
+import org.apache.syncope.client.console.pages.Tasks.TasksProvider;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.request.http.WebResponse;
+
+public class SchedTasks extends AbstractTasks {
+
+ private static final long serialVersionUID = 525486152284253354L;
+
+ private int paginatorRows;
+
+ private WebMarkupContainer container;
+
+ private ModalWindow window;
+
+ private AjaxDataTablePanel<AbstractTaskTO, String> table;
+
+ public SchedTasks(final String id, final PageReference pageRef) {
+ super(id, pageRef);
+
+ container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ window = new ModalWindow("taskWin");
+ window.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ window.setInitialHeight(WIN_HEIGHT);
+ window.setInitialWidth(WIN_WIDTH);
+ window.setCookieName(VIEW_TASK_WIN_COOKIE_NAME);
+ add(window);
+
+ ((Tasks) pageRef.getPage()).setWindowClosedCallback(window, container);
+
+ paginatorRows = prefMan.getPaginatorRows(getWebRequest(), Constants.PREF_SCHED_TASKS_PAGINATOR_ROWS);
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<SchedTaskTO>(restClient, paginatorRows, getId(), SchedTaskTO.class),
+ container,
+ 0,
+ pageRef,
+ restClient);
+
+ container.add(table);
+
+ @SuppressWarnings("rawtypes")
+ Form paginatorForm = new Form("PaginatorForm");
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
+ prefMan.getPaginatorChoices());
+
+ rowsChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ prefMan.set(getWebRequest(), (WebResponse) getResponse(), Constants.PREF_SCHED_TASKS_PAGINATOR_ROWS,
+ String.valueOf(paginatorRows));
+
+ table = Tasks.updateTaskTable(
+ getColumns(),
+ new TasksProvider<SchedTaskTO>(restClient, paginatorRows, getId(), SchedTaskTO.class),
+ container,
+ table == null ? 0 : (int) table.getCurrentPage(),
+ pageRef,
+ restClient);
+
+ target.add(container);
+ }
+ });
+
+ paginatorForm.add(rowsChooser);
+ add(paginatorForm);
+
+ AjaxLink createLink = new ClearIndicatingAjaxLink("createLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new SchedTaskModalPage(window, new SchedTaskTO(), pageRef);
+ }
+ });
+
+ window.show(target);
+ }
+ };
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ createLink, RENDER, xmlRolesReader.getEntitlement(TASKS, "create"));
+
+ add(createLink);
+ }
+
+ private List<IColumn<AbstractTaskTO, String>> getColumns() {
+ final List<IColumn<AbstractTaskTO, String>> columns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("id", this, null), "id", "id"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("name", this, null), "name", "name"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("description", this, null), "description", "description"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("class", this, null), "jobClassName", "jobClassName"));
+ columns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("lastExec", this, null), "lastExec", "lastExec"));
+ columns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("nextExec", this, null), "nextExec", "nextExec"));
+ columns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
+
+ columns.add(new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {
+
+ final SchedTaskTO taskTO = (SchedTaskTO) model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new SchedTaskModalPage(window, taskTO, pageRef);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), false);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.EXECUTE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), true);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ target.add(container);
+ }
+ }, ActionLink.ActionType.DRYRUN, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.delete(taskTO.getKey(), SchedTaskTO.class);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, TASKS);
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ @SuppressWarnings("rawtypes")
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(table);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+ return columns;
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof AbstractSearchResultPanel.EventDataWrapper) {
+ ((AbstractSearchResultPanel.EventDataWrapper) event.getPayload()).getTarget().add(container);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchClause.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchClause.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchClause.java
new file mode 100644
index 0000000..488a2cf
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchClause.java
@@ -0,0 +1,129 @@
+/*
+ * 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.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+public class SearchClause implements Serializable {
+
+ private static final long serialVersionUID = 2010794463096110104L;
+
+ public enum Operator {
+
+ AND,
+ OR;
+
+ }
+
+ public enum Type {
+
+ ATTRIBUTE,
+ MEMBERSHIP,
+ RESOURCE,
+ ENTITLEMENT;
+
+ }
+
+ public enum Comparator {
+
+ IS_NULL,
+ IS_NOT_NULL,
+ EQUALS,
+ NOT_EQUALS,
+ GREATER_OR_EQUALS,
+ GREATER_THAN,
+ LESS_OR_EQUALS,
+ LESS_THAN;
+
+ }
+
+ private Operator operator;
+
+ private Type type;
+
+ private String property;
+
+ private Comparator comparator;
+
+ private String value;
+
+ public SearchClause() {
+ setOperator(SearchClause.Operator.AND);
+ setComparator(SearchClause.Comparator.EQUALS);
+ }
+
+ public Operator getOperator() {
+ return operator;
+ }
+
+ public void setOperator(final Operator operator) {
+ this.operator = operator;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(final String property) {
+ this.property = property;
+ }
+
+ public Comparator getComparator() {
+ return comparator;
+ }
+
+ public void setComparator(final Comparator comparator) {
+ this.comparator = comparator;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchView.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchView.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchView.java
new file mode 100644
index 0000000..b432d82
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SearchView.java
@@ -0,0 +1,461 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+
+public class SearchView extends ListView<SearchClause> {
+
+ private static final long serialVersionUID = -527351923968737757L;
+
+ private final WebMarkupContainer searchFormContainer;
+
+ private final boolean required;
+
+ private final IModel<List<SearchClause.Type>> types;
+
+ private final IModel<List<String>> anames;
+
+ private final IModel<List<String>> dnames;
+
+ private final IModel<List<String>> roleNames;
+
+ private final IModel<List<String>> resourceNames;
+
+ private final IModel<List<String>> entitlements;
+
+ public SearchView(final String id, final List<? extends SearchClause> list,
+ final WebMarkupContainer searchFormContainer,
+ final boolean required,
+ final IModel<List<SearchClause.Type>> types,
+ final IModel<List<String>> anames,
+ final IModel<List<String>> dnames,
+ final IModel<List<String>> roleNames,
+ final IModel<List<String>> resourceNames,
+ final IModel<List<String>> entitlements) {
+
+ super(id, list);
+
+ this.searchFormContainer = searchFormContainer;
+ this.required = required;
+ this.types = types;
+ this.anames = anames;
+ this.dnames = dnames;
+ this.roleNames = roleNames;
+ this.resourceNames = resourceNames;
+ this.entitlements = entitlements;
+ }
+
+ @Override
+ protected void populateItem(final ListItem<SearchClause> item) {
+ final SearchClause searchClause = item.getModelObject();
+
+ final DropDownChoice<SearchClause.Operator> operator = new DropDownChoice<SearchClause.Operator>("operator",
+ new PropertyModel<SearchClause.Operator>(searchClause, "operator"),
+ Arrays.asList(SearchClause.Operator.values()));
+ operator.setOutputMarkupPlaceholderTag(true);
+ operator.setNullValid(false);
+ operator.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+ item.add(operator);
+ if (item.getIndex() == 0) {
+ operator.setVisible(false);
+ }
+
+ final DropDownChoice<SearchClause.Type> type = new DropDownChoice<SearchClause.Type>("type",
+ new PropertyModel<SearchClause.Type>(searchClause, "type"), types);
+ type.setOutputMarkupId(true);
+ type.setRequired(required);
+ type.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ target.add(searchFormContainer);
+ }
+ });
+ item.add(type);
+
+ @SuppressWarnings("unchecked")
+ final DropDownChoice<String> property = new DropDownChoice<String>("property",
+ new PropertyModel<String>(searchClause, "property"), (IModel) null);
+ property.setOutputMarkupId(true);
+ property.setRequired(required);
+ property.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+ item.add(property);
+
+ final TextField<String> value = new TextField<String>("value",
+ new PropertyModel<String>(searchClause, "value"));
+ value.setOutputMarkupId(true);
+ value.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ }
+ });
+ item.add(value);
+
+ final DropDownChoice<SearchClause.Comparator> comparator =
+ new DropDownChoice<SearchClause.Comparator>("comparator",
+ new PropertyModel<SearchClause.Comparator>(searchClause, "comparator"),
+ Collections.<SearchClause.Comparator>emptyList());
+ comparator.setOutputMarkupId(true);
+ comparator.setNullValid(false);
+ comparator.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (type.getModelObject() == SearchClause.Type.ATTRIBUTE) {
+ if (comparator.getModelObject() == SearchClause.Comparator.IS_NULL
+ || comparator.getModelObject() == SearchClause.Comparator.IS_NOT_NULL) {
+
+ value.setModelObject(null);
+ value.setEnabled(false);
+ } else {
+ value.setEnabled(true);
+ }
+ target.add(value);
+ }
+ }
+ });
+ comparator.setRequired(required);
+ item.add(comparator);
+
+ AjaxLink<Void> drop = new IndicatingAjaxLink<Void>("drop") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ SearchView.this.getModel().getObject().remove(item.getModelObject());
+ target.add(searchFormContainer);
+ }
+ };
+ item.add(drop);
+ if (item.getIndex() == 0) {
+ drop.setVisible(false);
+ drop.setEnabled(false);
+ } else {
+ drop.setVisible(true);
+ drop.setEnabled(true);
+ }
+
+ final AjaxLink<Void> add = new IndicatingAjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ SearchClause clause = new SearchClause();
+ SearchView.this.getModel().getObject().add(clause);
+ target.add(searchFormContainer);
+ }
+ };
+ item.add(add);
+
+ if (searchClause == null || searchClause.getType() == null) {
+ property.setChoices(Collections.<String>emptyList());
+ } else {
+ switch (searchClause.getType()) {
+ case ATTRIBUTE:
+ final List<String> names = new ArrayList<String>(dnames.getObject());
+ if (anames.getObject() != null && !anames.getObject().isEmpty()) {
+ names.addAll(anames.getObject());
+ }
+ Collections.sort(names);
+ property.setChoices(names);
+
+ comparator.setChoices(new LoadableDetachableModel<List<SearchClause.Comparator>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<SearchClause.Comparator> load() {
+ return Arrays.asList(SearchClause.Comparator.values());
+ }
+ });
+ comparator.setChoiceRenderer(new IChoiceRenderer<SearchClause.Comparator>() {
+
+ private static final long serialVersionUID = -9086043750227867686L;
+
+ @Override
+ public Object getDisplayValue(final SearchClause.Comparator object) {
+ String display;
+
+ switch (object) {
+ case IS_NULL:
+ display = "NULL";
+ break;
+
+ case IS_NOT_NULL:
+ display = "NOT NULL";
+ break;
+
+ case EQUALS:
+ display = "==";
+ break;
+
+ case NOT_EQUALS:
+ display = "!=";
+ break;
+
+ case LESS_THAN:
+ display = "<";
+ break;
+
+ case LESS_OR_EQUALS:
+ display = "<=";
+ break;
+
+ case GREATER_THAN:
+ display = ">";
+ break;
+
+ case GREATER_OR_EQUALS:
+ display = ">=";
+ break;
+
+ default:
+ display = StringUtils.EMPTY;
+ }
+
+ return display;
+ }
+
+ @Override
+ public String getIdValue(final SearchClause.Comparator object, int index) {
+ return getDisplayValue(object).toString();
+ }
+ });
+ if (!comparator.isEnabled()) {
+ comparator.setEnabled(true);
+ comparator.setRequired(true);
+ }
+
+ if (!value.isEnabled()) {
+ value.setEnabled(true);
+ }
+ break;
+
+ case MEMBERSHIP:
+ property.setChoices(roleNames);
+ property.setChoiceRenderer(new IChoiceRenderer<String>() {
+
+ private static final long serialVersionUID = -4288397951948436434L;
+
+ @Override
+ public Object getDisplayValue(final String object) {
+ return object;
+ }
+
+ @Override
+ public String getIdValue(final String object, final int index) {
+ return object;
+ }
+ });
+
+ comparator.setChoices(new LoadableDetachableModel<List<SearchClause.Comparator>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<SearchClause.Comparator> load() {
+ List<SearchClause.Comparator> comparators = new ArrayList<SearchClause.Comparator>();
+ comparators.add(SearchClause.Comparator.EQUALS);
+ comparators.add(SearchClause.Comparator.NOT_EQUALS);
+ return comparators;
+ }
+ });
+ comparator.setChoiceRenderer(new IChoiceRenderer<SearchClause.Comparator>() {
+
+ private static final long serialVersionUID = -9086043750227867686L;
+
+ @Override
+ public Object getDisplayValue(final SearchClause.Comparator object) {
+ String display;
+
+ switch (object) {
+ case EQUALS:
+ display = "IN";
+ break;
+
+ case NOT_EQUALS:
+ display = "NOT IN";
+ break;
+
+ default:
+ display = StringUtils.EMPTY;
+ }
+
+ return display;
+ }
+
+ @Override
+ public String getIdValue(final SearchClause.Comparator object, final int index) {
+ return getDisplayValue(object).toString();
+ }
+ });
+
+ value.setEnabled(false);
+ value.setModelObject("");
+
+ break;
+
+ case RESOURCE:
+ property.setChoices(resourceNames);
+
+ comparator.setChoices(new LoadableDetachableModel<List<SearchClause.Comparator>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<SearchClause.Comparator> load() {
+ List<SearchClause.Comparator> comparators = new ArrayList<SearchClause.Comparator>();
+ comparators.add(SearchClause.Comparator.EQUALS);
+ comparators.add(SearchClause.Comparator.NOT_EQUALS);
+ return comparators;
+ }
+ });
+ comparator.setChoiceRenderer(new IChoiceRenderer<SearchClause.Comparator>() {
+
+ private static final long serialVersionUID = -9086043750227867686L;
+
+ @Override
+ public Object getDisplayValue(final SearchClause.Comparator object) {
+ String display;
+
+ switch (object) {
+ case EQUALS:
+ display = "HAS";
+ break;
+
+ case NOT_EQUALS:
+ display = "HAS NOT";
+ break;
+
+ default:
+ display = StringUtils.EMPTY;
+ }
+
+ return display;
+ }
+
+ @Override
+ public String getIdValue(final SearchClause.Comparator object, final int index) {
+ return getDisplayValue(object).toString();
+ }
+ });
+
+ value.setEnabled(false);
+ value.setModelObject("");
+
+ break;
+
+ case ENTITLEMENT:
+ property.setChoices(entitlements);
+
+ comparator.setChoices(new LoadableDetachableModel<List<SearchClause.Comparator>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<SearchClause.Comparator> load() {
+ List<SearchClause.Comparator> comparators = new ArrayList<SearchClause.Comparator>();
+ comparators.add(SearchClause.Comparator.EQUALS);
+ comparators.add(SearchClause.Comparator.NOT_EQUALS);
+ return comparators;
+ }
+ });
+ comparator.setChoiceRenderer(new IChoiceRenderer<SearchClause.Comparator>() {
+
+ private static final long serialVersionUID = -9086043750227867686L;
+
+ @Override
+ public Object getDisplayValue(final SearchClause.Comparator object) {
+ String display;
+
+ switch (object) {
+ case EQUALS:
+ display = "HAS";
+ break;
+
+ case NOT_EQUALS:
+ display = "HAS NOT";
+ break;
+
+ default:
+ display = StringUtils.EMPTY;
+ }
+
+ return display;
+ }
+
+ @Override
+ public String getIdValue(final SearchClause.Comparator object, final int index) {
+ return getDisplayValue(object).toString();
+ }
+ });
+
+ value.setEnabled(false);
+ value.setModelObject("");
+
+ break;
+
+ default:
+ property.setChoices(Collections.<String>emptyList());
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionPanel.java
new file mode 100644
index 0000000..8658cf6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SecurityQuestionPanel.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.SecurityQuestionRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class SecurityQuestionPanel extends Panel {
+
+ private static final long serialVersionUID = -790642213865180146L;
+
+ private final Map<Long, String> questions = new TreeMap<Long, String>();
+
+ @SpringBean
+ private SecurityQuestionRestClient restClient;
+
+ public SecurityQuestionPanel(final String id, final UserTO userTO) {
+ super(id);
+ setOutputMarkupId(true);
+
+ for (SecurityQuestionTO secQues : restClient.list()) {
+ questions.put(secQues.getKey(), secQues.getContent());
+ }
+
+ final AjaxTextFieldPanel securityAnswer = new AjaxTextFieldPanel("securityAnswer", "securityAnswer",
+ new PropertyModel<String>(userTO, "securityAnswer"));
+ securityAnswer.getField().setOutputMarkupId(true);
+ securityAnswer.setEnabled(false);
+ add(securityAnswer);
+
+ final AjaxDropDownChoicePanel<Long> securityQuestion =
+ new AjaxDropDownChoicePanel<>("securityQuestion", "securityQuestion",
+ new PropertyModel<Long>(userTO, "securityQuestion"));
+ ((DropDownChoice) securityQuestion.getField()).setNullValid(true);
+ securityQuestion.setChoices(new ArrayList<>(questions.keySet()));
+ securityQuestion.setStyleSheet("ui-widget-content ui-corner-all long_dynamicsize");
+ securityQuestion.getField().setOutputMarkupId(true);
+ securityQuestion.setChoiceRenderer(new IChoiceRenderer<Long>() {
+
+ private static final long serialVersionUID = 2693996850376268294L;
+
+ @Override
+ public Object getDisplayValue(final Long object) {
+ return questions.get(object);
+ }
+
+ @Override
+ public String getIdValue(final Long object, final int index) {
+ return questions.get(object);
+ }
+ });
+ securityQuestion.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (securityQuestion.getModelObject() == null) {
+ securityAnswer.setModelObject(null);
+ } else {
+ securityAnswer.setEnabled(true);
+ }
+ target.add(SecurityQuestionPanel.this);
+ }
+ });
+ add(securityQuestion);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectOnlyUserSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectOnlyUserSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectOnlyUserSearchResultPanel.java
new file mode 100644
index 0000000..a55db53
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectOnlyUserSearchResultPanel.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.pages.DisplayAttributesModalPage;
+import org.apache.syncope.client.console.rest.UserRestClient;
+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.common.lib.to.AbstractAttributableTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class SelectOnlyUserSearchResultPanel extends UserSearchResultPanel {
+
+ private static final long serialVersionUID = 2146781496050131930L;
+
+ private final PageReference pageRef;
+
+ private final ModalWindow window;
+
+ public <T extends AbstractAttributableTO> SelectOnlyUserSearchResultPanel(final String id, final boolean filtered,
+ final String fiql, final PageReference pageRef, final ModalWindow window, final UserRestClient restClient) {
+
+ super(id, filtered, fiql, pageRef, restClient);
+
+ this.pageRef = pageRef;
+ this.window = window;
+ }
+
+ @Override
+ protected List<IColumn<AbstractAttributableTO, String>> getColumns() {
+ final List<IColumn<AbstractAttributableTO, String>> columns =
+ new ArrayList<IColumn<AbstractAttributableTO, String>>();
+ for (String name : DisplayAttributesModalPage.DEFAULT_SELECTION) {
+ columns.add(new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(name, name), name, name));
+ }
+
+ columns.add(new AbstractColumn<AbstractAttributableTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 8263694778917279290L;
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractAttributableTO>> cellItem,
+ final String componentId, final IModel<AbstractAttributableTO> rowModel) {
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, rowModel, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ send(pageRef.getPage(), Broadcast.BREADTH,
+ new RoleDetailsPanel.UserOwnerSelectPayload(rowModel.getObject().getKey()));
+ window.close(target);
+ }
+ }, ActionLink.ActionType.SELECT, "Users");
+
+ cellItem.add(panel);
+ }
+ });
+
+ return columns;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectedEventsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectedEventsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectedEventsPanel.java
new file mode 100644
index 0000000..96c8d77
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SelectedEventsPanel.java
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.ListMultipleChoice;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.util.ListModel;
+
+public class SelectedEventsPanel extends Panel {
+
+ private static final long serialVersionUID = -4832450230348213500L;
+
+ private final WebMarkupContainer selectionContainer;
+
+ private ListMultipleChoice<String> selectedEvents;
+
+ private final IModel<List<String>> model;
+
+ public SelectedEventsPanel(final String id, final IModel<List<String>> model) {
+ super(id);
+
+ this.model = model;
+
+ selectionContainer = new WebMarkupContainer("selectionContainer");
+ selectionContainer.setOutputMarkupId(true);
+ add(selectionContainer);
+
+ selectedEvents = new ListMultipleChoice<String>("selectedEvents", new ListModel<String>(), model) {
+
+ private static final long serialVersionUID = 1226677544225737338L;
+
+ @Override
+ protected void onComponentTag(final ComponentTag tag) {
+ super.onComponentTag(tag);
+ tag.remove("size");
+ tag.remove("multiple");
+ tag.put("size", 5);
+ }
+ };
+
+ selectedEvents.setMaxRows(5);
+ selectedEvents.setChoiceRenderer(new IChoiceRenderer<String>() {
+
+ private static final long serialVersionUID = -4288397951948436434L;
+
+ @Override
+ public Object getDisplayValue(final String object) {
+ return object;
+ }
+
+ @Override
+ public String getIdValue(final String object, final int index) {
+ return object;
+ }
+ });
+
+ selectedEvents.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -151291731388673682L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ send(SelectedEventsPanel.this.getPage(),
+ Broadcast.BREADTH,
+ new InspectSelectedEvent(target, selectedEvents.getModelValue()));
+ }
+ });
+
+ selectionContainer.add(selectedEvents);
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof EventSelectionChanged) {
+ final EventSelectionChanged eventSelectionChanged = (EventSelectionChanged) event.getPayload();
+
+ for (String toBeRemoved : eventSelectionChanged.getToBeRemoved()) {
+ model.getObject().remove(toBeRemoved);
+ }
+
+ for (String toBeAdded : eventSelectionChanged.getToBeAdded()) {
+ if (!model.getObject().contains(toBeAdded)) {
+ model.getObject().add(toBeAdded);
+ }
+ }
+
+ eventSelectionChanged.getTarget().add(selectionContainer);
+ }
+ }
+
+ public static class InspectSelectedEvent {
+
+ private final AjaxRequestTarget target;
+
+ private final String event;
+
+ public InspectSelectedEvent(final AjaxRequestTarget target, final String event) {
+ this.target = target;
+ this.event = event;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public String getEvent() {
+ return event;
+ }
+ }
+
+ public static class EventSelectionChanged {
+
+ private final AjaxRequestTarget target;
+
+ private final Set<String> toBeRemoved;
+
+ private final Set<String> toBeAdded;
+
+ public EventSelectionChanged(
+ final AjaxRequestTarget target,
+ final Set<String> toBeAdded,
+ final Set<String> toBeRemoved) {
+ this.target = target;
+ this.toBeAdded = toBeAdded;
+ this.toBeRemoved = toBeRemoved;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public Set<String> getToBeRemoved() {
+ return toBeRemoved;
+ }
+
+ public Set<String> getToBeAdded() {
+ return toBeAdded;
+ }
+ }
+}
[28/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxButton.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxButton.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxButton.java
new file mode 100644
index 0000000..314f66c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxButton.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.wicket.ajax.markup.html;
+
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.IModel;
+
+public abstract class ClearIndicatingAjaxButton extends IndicatingAjaxButton {
+
+ private static final long serialVersionUID = 7206379812788748287L;
+
+ private final PageReference pageRef;
+
+ private boolean reloadFeebackPanel = true;
+
+ public ClearIndicatingAjaxButton(final String id, final PageReference pageRef) {
+ super(id);
+ this.pageRef = pageRef;
+ }
+
+ public ClearIndicatingAjaxButton(final String id, Form<?> form, final PageReference pageRef) {
+ super(id, form);
+ this.pageRef = pageRef;
+ }
+
+ public ClearIndicatingAjaxButton(final String id, IModel<String> model, final PageReference pageRef) {
+ super(id, model);
+ this.pageRef = pageRef;
+ }
+
+ public ClearIndicatingAjaxButton(final String id, final IModel<String> model, final Form<?> form,
+ final PageReference pageRef) {
+
+ super(id, model, form);
+ this.pageRef = pageRef;
+ }
+
+ protected abstract void onSubmitInternal(AjaxRequestTarget target, Form<?> form);
+
+ public ClearIndicatingAjaxButton feedbackPanelAutomaticReload(boolean reloadFeedbackPanel) {
+ this.reloadFeebackPanel = reloadFeedbackPanel;
+ return this;
+ }
+
+ @Override
+ protected final void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ super.onSubmit(target, form);
+
+ Page page = pageRef.getPage();
+ if (reloadFeebackPanel && page instanceof BasePage) {
+ target.add(((BasePage) page).getFeedbackPanel());
+ }
+ onSubmitInternal(target, form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java
new file mode 100644
index 0000000..5bb5642
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java
@@ -0,0 +1,61 @@
+/*
+ * 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.wicket.ajax.markup.html;
+
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.model.IModel;
+
+public abstract class ClearIndicatingAjaxLink<T> extends IndicatingAjaxLink<T> {
+
+ private static final long serialVersionUID = 7913625094362339643L;
+
+ private final PageReference pageRef;
+
+ private boolean reloadFeedbackPanel = true;
+
+ public ClearIndicatingAjaxLink(final String id, final PageReference pageRef) {
+ super(id);
+ this.pageRef = pageRef;
+ }
+
+ public ClearIndicatingAjaxLink(final String id, final IModel<T> model, final PageReference pageRef) {
+ super(id, model);
+ this.pageRef = pageRef;
+ }
+
+ public ClearIndicatingAjaxLink<T> feedbackPanelAutomaticReload(boolean reloadFeedbackPanel) {
+ this.reloadFeedbackPanel = reloadFeedbackPanel;
+ return this;
+ }
+
+ protected abstract void onClickInternal(AjaxRequestTarget target);
+
+ @Override
+ public final void onClick(final AjaxRequestTarget target) {
+ Page page = pageRef.getPage();
+ if (reloadFeedbackPanel && page instanceof BasePage) {
+ target.add(((BasePage) page).getFeedbackPanel());
+ }
+ onClickInternal(target);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/IndicatingOnConfirmAjaxLink.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/IndicatingOnConfirmAjaxLink.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/IndicatingOnConfirmAjaxLink.java
new file mode 100644
index 0000000..86db915
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/IndicatingOnConfirmAjaxLink.java
@@ -0,0 +1,58 @@
+/*
+ * 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.wicket.ajax.markup.html;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+
+public abstract class IndicatingOnConfirmAjaxLink<T> extends ClearIndicatingAjaxLink<T> {
+
+ private static final long serialVersionUID = 2228670850922265663L;
+
+ private final String msg;
+
+ public IndicatingOnConfirmAjaxLink(final String id, final PageReference pageRef) {
+ this(id, pageRef, "confirmDelete");
+ }
+
+ public IndicatingOnConfirmAjaxLink(final String id, final PageReference pageRef, final String msg) {
+ super(id, pageRef);
+ this.msg = msg;
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+
+ final AjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component component) {
+ return "if (!confirm('"
+ + getString(IndicatingOnConfirmAjaxLink.this.msg)
+ + "')) {return false;} else {return true;}";
+ }
+ };
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionColumn.java
new file mode 100644
index 0000000..b9dfa62
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionColumn.java
@@ -0,0 +1,59 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class ActionColumn<T, S> extends AbstractColumn<T, S> {
+
+ private static final long serialVersionUID = 7955560320949560725L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(ActionColumn.class);
+
+ public ActionColumn(final IModel<String> displayModel) {
+ super(displayModel);
+ }
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ return super.getHeader(componentId);
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) {
+ item.add(getActions(componentId, rowModel));
+ }
+
+ public abstract ActionLinksPanel getActions(final String componentId, final IModel<T> rowModel);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
new file mode 100644
index 0000000..a2c40ff
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
@@ -0,0 +1,77 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import java.beans.PropertyDescriptor;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.BulkActionResult.Status;
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+
+public class ActionResultColumn<T, S> extends AbstractColumn<T, S> {
+
+ private static final long serialVersionUID = 7955560320949560716L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(ActionResultColumn.class);
+
+ private final BulkActionResult results;
+
+ private final String idFieldName;
+
+ public ActionResultColumn(final BulkActionResult results, final String idFieldName) {
+ super(new Model<String>());
+ this.results = results;
+ this.idFieldName = idFieldName;
+ }
+
+ @Override
+ public String getCssClass() {
+ return "bulkResultColumn";
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ return new Label(componentId, new ResourceModel("bulkActionResultLabel", "Result"));
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) {
+ try {
+ final PropertyDescriptor propDesc =
+ BeanUtils.getPropertyDescriptor(rowModel.getObject().getClass(), idFieldName);
+ final Object id = propDesc.getReadMethod().invoke(rowModel.getObject(), new Object[0]);
+ final Status status = id == null ? null : results.getResultMap().get(id.toString());
+ item.add(new Label(componentId, status == null ? Status.SUCCESS : status.toString()));
+ } catch (Exception e) {
+ LOG.error("Errore retrieving target id value", e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AttrColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AttrColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AttrColumn.java
new file mode 100644
index 0000000..b40d7c8
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AttrColumn.java
@@ -0,0 +1,85 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class AttrColumn extends AbstractColumn<AbstractAttributableTO, String> {
+
+ private static final long serialVersionUID = 2624734332447371372L;
+
+ private final String name;
+
+ private final SchemaType schemaType;
+
+ public AttrColumn(final String name, final SchemaType schemaType) {
+ // set sortProperty to schematype#name (e.g. derivedSchema#cn,
+ // for use with SortableUserProviderComparator.AttrModel#getObject)
+ super(new ResourceModel(name, name), schemaType.name() + "#" + name);
+ this.name = name;
+ this.schemaType = schemaType;
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractAttributableTO>> cellItem, final String componentId,
+ final IModel<AbstractAttributableTO> rowModel) {
+
+ List<String> values = null;
+
+ switch (schemaType) {
+ case PLAIN:
+ if (rowModel.getObject().getPlainAttrMap().containsKey(name)) {
+ values = rowModel.getObject().getPlainAttrMap().get(name).getValues();
+ }
+ break;
+
+ case VIRTUAL:
+ if (rowModel.getObject().getVirAttrMap().containsKey(name)) {
+ values = rowModel.getObject().getVirAttrMap().get(name).getValues();
+ }
+ break;
+
+ case DERIVED:
+ if (rowModel.getObject().getDerAttrMap().containsKey(name)) {
+ values = rowModel.getObject().getDerAttrMap().get(name).getValues();
+ }
+ break;
+
+ default:
+ }
+
+ if (values == null || values.isEmpty()) {
+ cellItem.add(new Label(componentId, ""));
+ } else {
+ if (values.size() == 1) {
+ cellItem.add(new Label(componentId, values.get(0)));
+ } else {
+ cellItem.add(new Label(componentId, values.toString()));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
new file mode 100644
index 0000000..8f880b7
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.CheckGroupSelector;
+import org.apache.wicket.markup.html.panel.Panel;
+
+public class CheckBoxGroupSelectorPanel<T> extends Panel {
+
+ private static final long serialVersionUID = 4062106303929176865L;
+
+ public CheckBoxGroupSelectorPanel(final String componentId, final CheckGroup<T> group) {
+
+ super(componentId);
+ add(new CheckGroupSelector("groupselector", group));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
new file mode 100644
index 0000000..db87192
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
@@ -0,0 +1,43 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.syncope.client.console.commons.ActionTableCheckGroup;
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+
+public class CheckBoxPanel<T> extends Panel {
+
+ private static final long serialVersionUID = 4062106303929176865L;
+
+ private final Check<T> check;
+
+ public CheckBoxPanel(final String componentId, final IModel<T> model, final CheckGroup<T> checkGroup) {
+ super(componentId, model);
+ this.check = new Check<T>("check", model, checkGroup);
+ if (checkGroup instanceof ActionTableCheckGroup) {
+ boolean checkable = ((ActionTableCheckGroup<T>) checkGroup).isCheckable(model.getObject());
+ this.check.setEnabled(checkable);
+ this.check.setVisible(checkable);
+ }
+ add(this.check);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
new file mode 100644
index 0000000..cf13f3c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
@@ -0,0 +1,54 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class CheckGroupColumn<T, S> extends AbstractColumn<T, S> {
+
+ private static final long serialVersionUID = 7955560320949560715L;
+
+ private final CheckGroup<T> group;
+
+ public CheckGroupColumn(final CheckGroup<T> checkGroup) {
+ super(new Model<String>());
+ this.group = checkGroup;
+ }
+
+ @Override
+ public String getCssClass() {
+ return "checkGroupColumn";
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ return new CheckBoxGroupSelectorPanel<T>(componentId, group);
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) {
+ item.add(new CheckBoxPanel<T>(componentId, rowModel, group));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.java
new file mode 100644
index 0000000..f04fa5a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPanel.java
@@ -0,0 +1,47 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import java.util.List;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.ResourceModel;
+
+public class CollectionPanel extends Panel {
+
+ private static final long serialVersionUID = -4042497356836230377L;
+
+ @SuppressWarnings("unchecked")
+ public CollectionPanel(final String id, final List values) {
+ super(id);
+
+ add(new ListView("collection", values) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem item) {
+ final String value = item.getModelObject() == null ? null : item.getModelObject().toString();
+ item.add(new Label("item", new ResourceModel(value, value)));
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPropertyColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPropertyColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPropertyColumn.java
new file mode 100644
index 0000000..a5fd774
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/CollectionPropertyColumn.java
@@ -0,0 +1,54 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+
+public class CollectionPropertyColumn<T> extends PropertyColumn<T, String> {
+
+ private static final long serialVersionUID = 8077865338230121496L;
+
+ public CollectionPropertyColumn(
+ final IModel<String> displayModel,
+ final String sortProperty,
+ final String propertyExpression) {
+ super(displayModel, sortProperty, propertyExpression);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void populateItem(
+ final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel) {
+
+ final Object value = getDataModel(rowModel).getObject();
+
+ if (value instanceof Collection) {
+ final List values = new ArrayList((Collection) value);
+ Collections.sort(values);
+ cellItem.add(new CollectionPanel(componentId, values));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/DatePropertyColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/DatePropertyColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/DatePropertyColumn.java
new file mode 100644
index 0000000..f767aa2
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/DatePropertyColumn.java
@@ -0,0 +1,53 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import java.util.Date;
+import org.apache.syncope.client.console.SyncopeSession;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+
+/**
+ * Format column's value as date string.
+ */
+public class DatePropertyColumn<T> extends PropertyColumn<T, String> {
+
+ private static final long serialVersionUID = 3527840552172947705L;
+
+ public DatePropertyColumn(final IModel<String> displayModel, final String sortProperty,
+ final String propertyExpression) {
+
+ super(displayModel, sortProperty, propertyExpression);
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) {
+
+ IModel<Object> date = getDataModel(rowModel);
+
+ String convertedDate = "";
+ if (date.getObject() instanceof Date) {
+ convertedDate = SyncopeSession.get().getDateFormat().format(date.getObject());
+ }
+ item.add(new Label(componentId, convertedDate));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/TokenColumn.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/TokenColumn.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/TokenColumn.java
new file mode 100644
index 0000000..094e450
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/TokenColumn.java
@@ -0,0 +1,51 @@
+/*
+ * 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.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+import org.springframework.util.StringUtils;
+
+public class TokenColumn extends AbstractColumn<AbstractAttributableTO, String> {
+
+ private static final long serialVersionUID = 8077865338230121496L;
+
+ public TokenColumn(final String name) {
+ super(new ResourceModel(name, name), name);
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<AbstractAttributableTO>> cellItem, final String componentId,
+ final IModel<AbstractAttributableTO> rowModel) {
+
+ if (rowModel.getObject() instanceof UserTO) {
+ if (StringUtils.hasText(((UserTO) rowModel.getObject()).getToken())) {
+ cellItem.add(new Label(componentId, new ResourceModel("tokenValued", "tokenValued")));
+ } else {
+ cellItem.add(new Label(componentId, new ResourceModel("tokenNotValued", "tokenNotValued")));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/head/MetaHeaderItem.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/head/MetaHeaderItem.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/head/MetaHeaderItem.java
new file mode 100644
index 0000000..2c5150e
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/head/MetaHeaderItem.java
@@ -0,0 +1,49 @@
+/*
+ * 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.wicket.markup.head;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import org.apache.wicket.markup.head.HeaderItem;
+import org.apache.wicket.request.Response;
+
+public class MetaHeaderItem extends HeaderItem implements Serializable {
+
+ private static final long serialVersionUID = 7578609827530302053L;
+
+ private final String key;
+
+ private final String value;
+
+ public MetaHeaderItem(final String key, final String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ @Override
+ public Iterable<?> getRenderTokens() {
+ return Arrays.asList("meta-" + key + "-" + value);
+ }
+
+ @Override
+ public void render(final Response response) {
+ response.write("<meta http-equiv=\"" + key + "\" content=\"" + value + "\"/>");
+ response.write("\n");
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.java
new file mode 100644
index 0000000..5555616
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/CrontabContainer.java
@@ -0,0 +1,184 @@
+/*
+ * 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.wicket.markup.html;
+
+import java.util.Arrays;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.client.console.commons.SelectOption;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+public class CrontabContainer extends WebMarkupContainer {
+
+ private static final long serialVersionUID = 7879593326085337650L;
+
+ private final TextField seconds;
+
+ private final TextField minutes;
+
+ private final TextField hours;
+
+ private final TextField daysOfMonth;
+
+ private final TextField months;
+
+ private final TextField daysOfWeek;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public CrontabContainer(final String id, final PropertyModel<String> cronExpressionModel,
+ final String cronExpression) {
+
+ super(id);
+ setOutputMarkupId(true);
+
+ final SelectOption[] CRON_TEMPLATES = {
+ new SelectOption(getString("selOpt1"), "UNSCHEDULE"),
+ new SelectOption(getString("selOpt2"), "0 0/5 * * * ?"),
+ new SelectOption(getString("selOpt3"), "0 0 12 * * ?"),
+ new SelectOption(getString("selOpt4"), "0 0 0 1 * ?"),
+ new SelectOption(getString("selOpt5"), "0 0 0 L * ?"),
+ new SelectOption(getString("selOpt6"), "0 0 0 ? * 2")
+ };
+
+ final DropDownChoice<SelectOption> cronTemplateChooser =
+ new DropDownChoice<SelectOption>("cronTemplateChooser") {
+
+ private static final long serialVersionUID = -5843424545478691442L;
+
+ @Override
+ protected CharSequence getDefaultChoice(final String selected) {
+ return "<option value=\"\">" + getString("chooseForTemplate") + "</option>";
+ }
+ };
+
+ cronTemplateChooser.setModel(new IModel<SelectOption>() {
+
+ private static final long serialVersionUID = 6762568283146531315L;
+
+ @Override
+ public SelectOption getObject() {
+ SelectOption result = null;
+ for (SelectOption so : CRON_TEMPLATES) {
+ if (so.getKeyValue().equals(cronExpressionModel.getObject())) {
+
+ result = so;
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public void setObject(final SelectOption object) {
+ cronExpressionModel.setObject(object == null || object.equals(CRON_TEMPLATES[0])
+ ? null
+ : object.toString());
+ }
+
+ @Override
+ public void detach() {
+ // no detach
+ }
+ });
+ cronTemplateChooser.setChoices(Arrays.asList(CRON_TEMPLATES));
+ cronTemplateChooser.setChoiceRenderer(new SelectChoiceRenderer());
+ add(cronTemplateChooser);
+
+ seconds = new TextField("seconds", new Model(getCronField(cronExpression, 0)));
+ add(seconds);
+
+ minutes = new TextField("minutes", new Model(getCronField(cronExpression, 1)));
+ add(minutes);
+
+ hours = new TextField("hours", new Model(getCronField(cronExpression, 2)));
+ add(hours);
+
+ daysOfMonth = new TextField("daysOfMonth", new Model(getCronField(cronExpression, 3)));
+ add(daysOfMonth);
+
+ months = new TextField("months", new Model(getCronField(cronExpression, 4)));
+ add(months);
+
+ daysOfWeek = new TextField("daysOfWeek", new Model(getCronField(cronExpression, 5)));
+ add(daysOfWeek);
+
+ cronTemplateChooser.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ seconds.setModelObject(getCronField(cronTemplateChooser, 0));
+ minutes.setModelObject(getCronField(cronTemplateChooser, 1));
+ hours.setModelObject(getCronField(cronTemplateChooser, 2));
+ daysOfMonth.setModelObject(getCronField(cronTemplateChooser, 3));
+ months.setModelObject(getCronField(cronTemplateChooser, 4));
+ daysOfWeek.setModelObject(getCronField(cronTemplateChooser, 5));
+ target.add(CrontabContainer.this);
+ }
+ });
+ }
+
+ private String getCronField(final FormComponent formComponent, final int field) {
+ String cronField = null;
+
+ if (formComponent != null) {
+ cronField = getCronField(formComponent.getInput(), field);
+ }
+
+ return cronField;
+ }
+
+ private String getCronField(final String cron, final int field) {
+ String cronField = null;
+
+ if (cron != null && !cron.isEmpty() && !"UNSCHEDULE".equals(cron)) {
+ cronField = cron.split(" ")[field].trim();
+ }
+
+ return cronField;
+ }
+
+ public String getCronExpression() {
+ String cronExpression = null;
+
+ if (seconds != null && seconds.getInput() != null && minutes != null && minutes.getInput() != null
+ && hours != null && hours.getInput() != null && daysOfMonth != null && daysOfMonth.getInput() != null
+ && months != null && months.getInput() != null && daysOfWeek != null && daysOfWeek.getInput() != null) {
+
+ cronExpression = new StringBuilder().
+ append(seconds.getInput().trim()).append(" ").
+ append(minutes.getInput().trim()).append(" ").
+ append(hours.getInput().trim()).append(" ").
+ append(daysOfMonth.getInput().trim()).append(" ").
+ append(months.getInput().trim()).append(" ").
+ append(daysOfWeek.getInput().trim()).toString();
+ }
+
+ return cronExpression;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AbstractFieldPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AbstractFieldPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AbstractFieldPanel.java
new file mode 100644
index 0000000..30bb47c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AbstractFieldPanel.java
@@ -0,0 +1,40 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractFieldPanel<T> extends Panel {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractFieldPanel.class);
+
+ private static final long serialVersionUID = 5958017546318855690L;
+
+ public AbstractFieldPanel(final String id, final IModel<T> model) {
+ super(id, model);
+ }
+
+ public abstract AbstractFieldPanel setModelObject(T object);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
new file mode 100644
index 0000000..159e5d9
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
@@ -0,0 +1,83 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.Serializable;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+
+public abstract class ActionLink implements Serializable {
+
+ private static final long serialVersionUID = 7031329706998320639L;
+
+ private boolean reloadFeedbackPanel = true;
+
+ public enum ActionType {
+
+ CREATE("create"),
+ EDIT("read"),
+ USER_TEMPLATE("read"),
+ ROLE_TEMPLATE("read"),
+ RESET("update"),
+ ENABLE("update"),
+ SEARCH("read"),
+ DELETE("delete"),
+ EXECUTE("execute"),
+ DRYRUN("execute"),
+ CLAIM("claim"),
+ SELECT("read"),
+ EXPORT("read"),
+ SUSPEND("update"),
+ REACTIVATE("update"),
+ RELOAD("reload"),
+ CHANGE_VIEW("changeView"),
+ UNLINK("update"),
+ LINK("update"),
+ UNASSIGN("update"),
+ ASSIGN("update"),
+ DEPROVISION("update"),
+ PROVISION("update"),
+ MANAGE_RESOURCES("update"),
+ MANAGE_USERS("update"),
+ MANAGE_ROLES("update");
+
+ private final String actionId;
+
+ private ActionType(final String actionId) {
+ this.actionId = actionId;
+ }
+
+ public String getActionId() {
+ return actionId;
+ }
+ }
+
+ public abstract void onClick(final AjaxRequestTarget target);
+
+ public void postClick() {
+ }
+
+ public boolean feedbackPanelAutomaticReload() {
+ return reloadFeedbackPanel;
+ }
+
+ public ActionLink feedbackPanelAutomaticReload(final boolean reloadFeedbackPanel) {
+ this.reloadFeedbackPanel = reloadFeedbackPanel;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
new file mode 100644
index 0000000..8582741
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
@@ -0,0 +1,586 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.IndicatingOnConfirmAjaxLink;
+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.markup.html.panel.Fragment;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * This empty class must exist because there not seems to be alternative to provide specialized HTML for edit links.
+ */
+public class ActionLinksPanel extends Panel {
+
+ private static final long serialVersionUID = 322966537010107771L;
+
+ /**
+ * Role reader for authorizations management.
+ */
+ @SpringBean
+ protected XMLRolesReader xmlRolesReader;
+
+ private final PageReference pageRef;
+
+ public ActionLinksPanel(final String componentId, final IModel<?> model, final PageReference pageRef) {
+ super(componentId, model);
+ this.pageRef = pageRef;
+
+ super.add(new Fragment("panelClaim", "emptyFragment", this));
+ super.add(new Fragment("panelManageResources", "emptyFragment", this));
+ super.add(new Fragment("panelManageUsers", "emptyFragment", this));
+ super.add(new Fragment("panelManageRoles", "emptyFragment", this));
+ super.add(new Fragment("panelCreate", "emptyFragment", this));
+ super.add(new Fragment("panelEdit", "emptyFragment", this));
+ super.add(new Fragment("panelReset", "emptyFragment", this));
+ super.add(new Fragment("panelUserTemplate", "emptyFragment", this));
+ super.add(new Fragment("panelRoleTemplate", "emptyFragment", this));
+ super.add(new Fragment("panelEnable", "emptyFragment", this));
+ super.add(new Fragment("panelSearch", "emptyFragment", this));
+ super.add(new Fragment("panelDelete", "emptyFragment", this));
+ super.add(new Fragment("panelExecute", "emptyFragment", this));
+ super.add(new Fragment("panelDryRun", "emptyFragment", this));
+ super.add(new Fragment("panelSelect", "emptyFragment", this));
+ super.add(new Fragment("panelExport", "emptyFragment", this));
+ super.add(new Fragment("panelSuspend", "emptyFragment", this));
+ super.add(new Fragment("panelReactivate", "emptyFragment", this));
+ super.add(new Fragment("panelReload", "emptyFragment", this));
+ super.add(new Fragment("panelChangeView", "emptyFragment", this));
+ super.add(new Fragment("panelUnlink", "emptyFragment", this));
+ super.add(new Fragment("panelLink", "emptyFragment", this));
+ super.add(new Fragment("panelUnassign", "emptyFragment", this));
+ super.add(new Fragment("panelAssign", "emptyFragment", this));
+ super.add(new Fragment("panelDeprovision", "emptyFragment", this));
+ super.add(new Fragment("panelProvision", "emptyFragment", this));
+ }
+
+ public void add(
+ final ActionLink link, final ActionLink.ActionType type, final String pageId, final String actionId) {
+
+ addWithRoles(link, type, xmlRolesReader.getEntitlement(pageId, actionId), true);
+ }
+
+ public void add(
+ final ActionLink link, final ActionLink.ActionType type, final String pageId) {
+
+ add(link, type, pageId, true);
+ }
+
+ public void add(
+ final ActionLink link, final ActionLink.ActionType type, final String pageId, final boolean enabled) {
+
+ addWithRoles(link, type, xmlRolesReader.getEntitlement(pageId, type.getActionId()), enabled);
+ }
+
+ public void addWithRoles(
+ final ActionLink link, final ActionLink.ActionType type, final String roles) {
+
+ addWithRoles(link, type, roles, true);
+ }
+
+ public void addWithRoles(
+ final ActionLink link, final ActionLink.ActionType type, final String roles, final boolean enabled) {
+
+ Fragment fragment = null;
+
+ switch (type) {
+
+ case CLAIM:
+ fragment = new Fragment("panelClaim", "fragmentClaim", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("claimLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case MANAGE_RESOURCES:
+ fragment = new Fragment("panelManageResources", "fragmentManageResources", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("manageResourcesLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610291L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case MANAGE_USERS:
+ fragment = new Fragment("panelManageUsers", "fragmentManageUsers", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("manageUsersLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610292L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case MANAGE_ROLES:
+ fragment = new Fragment("panelManageRoles", "fragmentManageRoles", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("manageRolesLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610293L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case CREATE:
+ fragment = new Fragment("panelCreate", "fragmentCreate", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case RESET:
+ fragment = new Fragment("panelReset", "fragmentReset", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("resetLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610290L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ });
+ break;
+
+ case EDIT:
+ fragment = new Fragment("panelEdit", "fragmentEdit", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("editLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case USER_TEMPLATE:
+ fragment = new Fragment("panelUserTemplate", "fragmentUserTemplate", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("userTemplateLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case ROLE_TEMPLATE:
+ fragment = new Fragment("panelRoleTemplate", "fragmentRoleTemplate", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("roleTemplateLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case ENABLE:
+ fragment = new Fragment("panelEnable", "fragmentEnable", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("enableLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case SEARCH:
+ fragment = new Fragment("panelSearch", "fragmentSearch", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("searchLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case EXECUTE:
+ fragment = new Fragment("panelExecute", "fragmentExecute", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("executeLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case DRYRUN:
+ fragment = new Fragment("panelDryRun", "fragmentDryRun", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("dryRunLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case DELETE:
+ fragment = new Fragment("panelDelete", "fragmentDelete", this);
+
+ fragment.addOrReplace(new IndicatingOnConfirmAjaxLink<Void>("deleteLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+
+ break;
+
+ case SELECT:
+ fragment = new Fragment("panelSelect", "fragmentSelect", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("selectLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+
+ break;
+
+ case EXPORT:
+ fragment = new Fragment("panelExport", "fragmentExport", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("exportLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case SUSPEND:
+ fragment = new Fragment("panelSuspend", "fragmentSuspend", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("suspendLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610291L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case REACTIVATE:
+ fragment = new Fragment("panelReactivate", "fragmentReactivate", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("reactivateLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610292L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case RELOAD:
+ fragment = new Fragment("panelReload", "fragmentReload", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("reloadLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610293L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case CHANGE_VIEW:
+ fragment = new Fragment("panelChangeView", "fragmentChangeView", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("changeViewLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610292L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case UNLINK:
+ fragment = new Fragment("panelUnlink", "fragmentUnlink", this);
+
+ fragment.addOrReplace(
+ new IndicatingOnConfirmAjaxLink<Void>("unlinkLink", pageRef, "confirmUnlink") {
+
+ private static final long serialVersionUID = -6957616042924610293L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case LINK:
+ fragment = new Fragment("panelLink", "fragmentLink", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("linkLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610303L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case UNASSIGN:
+ fragment = new Fragment("panelUnassign", "fragmentUnassign", this);
+
+ fragment.addOrReplace(
+ new IndicatingOnConfirmAjaxLink<Void>("unassignLink", pageRef, "confirmUnassign") {
+
+ private static final long serialVersionUID = -6957616042924610294L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case ASSIGN:
+ fragment = new Fragment("panelAssign", "fragmentAssign", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("assignLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610304L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case DEPROVISION:
+ fragment = new Fragment("panelDeprovision", "fragmentDeprovision", this);
+
+ fragment.addOrReplace(
+ new IndicatingOnConfirmAjaxLink<Void>("deprovisionLink", pageRef, "confirmDeprovision") {
+
+ private static final long serialVersionUID = -6957616042924610295L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+
+ case PROVISION:
+ fragment = new Fragment("panelProvision", "fragmentProvision", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("provisionLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610305L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()));
+ break;
+ default:
+ // do nothing
+ }
+
+ if (fragment != null) {
+ fragment.setEnabled(enabled);
+ MetaDataRoleAuthorizationStrategy.authorize(fragment, ENABLE, roles);
+ super.addOrReplace(fragment);
+ }
+ }
+
+ public void remove(final ActionLink.ActionType type) {
+ switch (type) {
+ case CLAIM:
+ super.addOrReplace(new Fragment("panelClaim", "emptyFragment", this));
+ break;
+
+ case MANAGE_RESOURCES:
+ super.addOrReplace(new Fragment("panelManageResources", "emptyFragment", this));
+ break;
+
+ case MANAGE_USERS:
+ super.addOrReplace(new Fragment("panelManageUsers", "emptyFragment", this));
+ break;
+
+ case MANAGE_ROLES:
+ super.addOrReplace(new Fragment("panelManageRoles", "emptyFragment", this));
+ break;
+
+ case CREATE:
+ super.addOrReplace(new Fragment("panelCreate", "emptyFragment", this));
+ break;
+
+ case EDIT:
+ super.addOrReplace(new Fragment("panelEdit", "emptyFragment", this));
+ break;
+
+ case USER_TEMPLATE:
+ super.addOrReplace(new Fragment("panelUserTemplate", "emptyFragment", this));
+ break;
+
+ case SEARCH:
+ super.addOrReplace(new Fragment("panelSearch", "emptyFragment", this));
+ break;
+
+ case EXECUTE:
+ super.addOrReplace(new Fragment("panelExecute", "emptyFragment", this));
+ break;
+
+ case DRYRUN:
+ super.addOrReplace(new Fragment("panelDryRun", "emptyFragment", this));
+ break;
+
+ case DELETE:
+ super.addOrReplace(new Fragment("panelDelete", "emptyFragment", this));
+ break;
+
+ case SELECT:
+ super.addOrReplace(new Fragment("panelSelect", "emptyFragment", this));
+ break;
+
+ case EXPORT:
+ super.addOrReplace(new Fragment("panelExport", "emptyFragment", this));
+ break;
+
+ case SUSPEND:
+ super.addOrReplace(new Fragment("panelSuspend", "emptyFragment", this));
+ break;
+
+ case REACTIVATE:
+ super.addOrReplace(new Fragment("panelReactivate", "emptyFragment", this));
+ break;
+
+ case RELOAD:
+ super.addOrReplace(new Fragment("panelReload", "emptyFragment", this));
+ break;
+
+ case CHANGE_VIEW:
+ super.addOrReplace(new Fragment("panelChangeView", "emptyFragment", this));
+ break;
+
+ case UNLINK:
+ super.addOrReplace(new Fragment("panelUnlink", "emptyFragment", this));
+ break;
+
+ case LINK:
+ super.addOrReplace(new Fragment("panelLink", "emptyFragment", this));
+ break;
+
+ case UNASSIGN:
+ super.addOrReplace(new Fragment("panelUnassign", "emptyFragment", this));
+ break;
+
+ case ASSIGN:
+ super.addOrReplace(new Fragment("panelAssign", "emptyFragment", this));
+ break;
+
+ case DEPROVISION:
+ super.addOrReplace(new Fragment("panelDeprovision", "emptyFragment", this));
+ break;
+
+ case PROVISION:
+ super.addOrReplace(new Fragment("panelProvision", "emptyFragment", this));
+ break;
+ default:
+ // do nothing
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.java
new file mode 100644
index 0000000..3702aa2
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxCheckBoxPanel.java
@@ -0,0 +1,130 @@
+/*
+ * 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.wicket.markup.html.form;
+
+import java.io.Serializable;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class AjaxCheckBoxPanel extends FieldPanel<Boolean> {
+
+ private static final long serialVersionUID = 5664138233103884310L;
+
+ public AjaxCheckBoxPanel(final String id, final String name, final IModel<Boolean> model) {
+ super(id, model);
+
+ field = new CheckBox("checkboxField", model);
+ add(field.setLabel(new Model<String>(name)).setOutputMarkupId(true));
+
+ if (!isReadOnly()) {
+ field.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // nothing to do
+ }
+ });
+ }
+ }
+
+ @Override
+ public FieldPanel<Boolean> addRequiredLabel() {
+ if (!isRequired()) {
+ setRequired(true);
+ }
+
+ this.isRequiredLabelAdded = true;
+
+ return this;
+ }
+
+ @Override
+ public FieldPanel<Boolean> setNewModel(final List<Serializable> list) {
+ setNewModel(new Model<Boolean>() {
+
+ private static final long serialVersionUID = 527651414610325237L;
+
+ @Override
+ public Boolean getObject() {
+ Boolean value = null;
+
+ if (list != null && !list.isEmpty()) {
+ value = Boolean.TRUE.toString().equalsIgnoreCase(list.get(0).toString());
+ }
+
+ return value;
+ }
+
+ @Override
+ public void setObject(final Boolean object) {
+ list.clear();
+ if (object != null) {
+ list.add(object.toString());
+ }
+ }
+ });
+
+ return this;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public FieldPanel<Boolean> setNewModel(final ListItem item) {
+ IModel<Boolean> model = new Model<Boolean>() {
+
+ private static final long serialVersionUID = 6799404673615637845L;
+
+ @Override
+ public Boolean getObject() {
+ Boolean bool = null;
+
+ final Object obj = item.getModelObject();
+
+ if (obj != null && !obj.toString().isEmpty()) {
+ if (obj instanceof String) {
+ bool = Boolean.TRUE.toString().equalsIgnoreCase(obj.toString());
+ } else if (obj instanceof Boolean) {
+ // Don't parse anything
+ bool = (Boolean) obj;
+ }
+ }
+
+ return bool;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void setObject(final Boolean object) {
+ item.setModelObject(object == null ? Boolean.FALSE.toString() : object.toString());
+ }
+ };
+
+ field.setModel(model);
+ return this;
+ }
+
+}
[20/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema$SchemaTypePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema$SchemaTypePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema$SchemaTypePanel.html
new file mode 100644
index 0000000..acc761e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema$SchemaTypePanel.html
@@ -0,0 +1,41 @@
+<!--
+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="schemaWrapContainer" id="users-contain" class="ui-widget">
+ <span wicket:id="schemaContainer">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="datatable"/>
+ </span>
+
+ <span style="float:right">
+ <form wicket:id="paginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="editSchemaWin">[Show modal window for editing schema]</div>
+
+ <a wicket:id="createSchemaLink"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <wicket:message key="create"/>
+ </a>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.html
new file mode 100644
index 0000000..de6d1e2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.html
@@ -0,0 +1,59 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style type="text/css">
+ .true {
+ background-image: url(../../img/ok.png);
+ background-position: center center;
+ background-repeat: no-repeat;
+ height: 18px;
+ width: 65px;
+ }
+ .false {
+ width: 65px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#cschema"><wicket:message key="configuration"/></a></li>
+ <li><a href="#uschema"><wicket:message key="user"/></a></li>
+ <li><a href="#mschema"><wicket:message key="membership"/></a></li>
+ <li><a href="#rschema"><wicket:message key="role"/></a></li>
+ </ul>
+
+ <div id="cschema">
+ <div wicket:id="configurationTabs"/>
+ </div>
+ <div id="uschema">
+ <div wicket:id="userTabs"/>
+ </div>
+ <div id="mschema">
+ <div wicket:id="membershipTabs"/>
+ </div>
+ <div id="rschema">
+ <div wicket:id="roleTabs"/>
+ </div>
+ </div>
+
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
new file mode 100644
index 0000000..b5d81f9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
@@ -0,0 +1,35 @@
+# 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.
+user=User
+role=Role
+membership=Membership
+required_alert=All fields are required
+mandatory=Mandatory
+multivalue=Multivalue
+type=Type
+validatorClass=Validator class
+conversionPattern=Conversion pattern
+edit=Edit
+delete=Delete
+attributes=Attributes
+expression=Expression
+normal=Normal
+derived=Derived
+virtual=Virtual
+mandatoryCondition=Mandatory
+uniqueConstraint=Unique
+readonly=Read-only
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
new file mode 100644
index 0000000..611ed9c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
@@ -0,0 +1,35 @@
+# 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.
+user=Utente
+role=Ruolo
+membership=Membership
+required_alert=Tutti i campi sono richiesti.
+mandatory=Obbligatorio
+multivalue=Multivalore
+type=Tipo
+validatorClass=Validator class
+conversionPattern=Pattern di conversione
+edit=Modifica
+delete=Rimuovi
+attributes=Attributi
+expression=Expression
+normal=Normali
+derived=Derivati
+virtual=Virtuali
+mandatoryCondition=Obbligatorio
+uniqueConstraint=Univoco
+readonly=Sola lettura
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
new file mode 100644
index 0000000..8d76c3b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
@@ -0,0 +1,35 @@
+# 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.
+user=Usu\u00e1rio
+role=Fun\u00e7\u00e3o
+membership=Membro
+required_alert=Todos os campos s\u00e3o requeridos
+mandatory=Obrigat\u00f3rio
+multivalue=Multivalorado
+type=Tipo
+validatorClass=classe de Valida\u00e7\u00e3o
+conversionPattern=Padr\u00e3o de Convers\u00e3o
+edit=Editar
+delete=Remover
+attributes=Atributos
+expression=Express\u00e3o
+normal=Normal
+derived=Derivado
+virtual=Virtual
+mandatoryCondition=Mandat\u00f3rio
+uniqueConstraint=\u00danico
+readonly=Apenas leitura
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.html
new file mode 100644
index 0000000..fe4fad4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.html
@@ -0,0 +1,46 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="content"><wicket:message key="content"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="content">[content]</span>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.properties
new file mode 100644
index 0000000..3f7ab40
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Security question
+content=Text
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_it.properties
new file mode 100644
index 0000000..6324e64
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_it.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Domanda di sicurezza
+content=Testo
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_pt_BR.properties
new file mode 100644
index 0000000..511b4ad
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SecurityQuestionModalPage_pt_BR.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Pergunta de seguran\u00e7a
+content=Texto
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
new file mode 100644
index 0000000..47a73c5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
@@ -0,0 +1,205 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+
+ <form wicket:id="form">
+
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#crontab"><span><wicket:message key="crontab"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="description"><wicket:message key="description"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="description">[description]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="resource"><wicket:message key="resourceName"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="resource">[resource]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="lastExec"><wicket:message key="lastExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="lastExec">[lastExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="nextExec"><wicket:message key="nextExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="nextExec">[nextExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="actionsClassNames"><wicket:message key="actionsClasses"/></label>
+ </div>
+ <span wicket:id="syncActionsClassNames">
+ <span wicket:id="actionsClasses">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="actionsClass"/>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button"/></a>
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ <br/>
+ </span>
+ <a wicket:id="first"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ </span>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="performCreate"><wicket:message key="creates"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="performCreate">[performCreate]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="performUpdate"><wicket:message key="updates"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="performUpdate">[performUpdate]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="performDelete"><wicket:message key="deletes"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="performDelete">[performDelete]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="syncStatus"><wicket:message key="syncStatus"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="syncStatus">[syncStatus]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="fullReconciliation"><wicket:message key="fullReconciliation"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="fullReconciliation">[fullReconciliation]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="matchingRule"><wicket:message key="matchingRule"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="matchingRule">[matchingRule]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="unmatchingRule"><wicket:message key="unmatchingRule"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="unmatchingRule">[unmatchingRule]</span>
+ </div>
+ </div>
+ <wicket:child/>
+ </div>
+ </span>
+ </div>
+ </div>
+ <div id="crontab">
+ <span wicket:id="crontab">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <label for="cron"><wicket:message key="cron"/></label>
+ </div>
+ <div class="tablerow">
+ <input type="text" id="seconds" class="text ui-widget-content ui-corner-all" wicket:id="seconds" style="width: 50px;float: left" />
+ <input type="text" id="minutes" class="text ui-widget-content ui-corner-all" wicket:id="minutes" style="width: 50px;float: left" />
+ <input type="text" id="hours" class="text ui-widget-content ui-corner-all" wicket:id="hours" style="width: 50px;float: left" />
+ <input type="text" id="daysOfMonth" class="text ui-widget-content ui-corner-all" wicket:id="daysOfMonth" style="width: 50px;float: left" />
+ <input type="text" id="months" class="text ui-widget-content ui-corner-all" wicket:id="months" style="width: 50px;float: left" />
+ <input type="text" id="daysOfWeek" class="text ui-widget-content ui-corner-all" wicket:id="daysOfWeek" style="width: 50px" />
+ </div>
+ <div class="tablerow alt">
+ <label for="cronExpression"><wicket:message key="templates"/></label>
+ </div>
+ <div class="tablerow">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="cronTemplateChooser" style="width: 250px"/>
+ </div>
+ </div>
+ </span>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
+ </span>
+ </div>
+ </div>
+ <div style="margin: 20px 10px 0">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="apply"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.properties
new file mode 100644
index 0000000..4fa0321
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.properties
@@ -0,0 +1,43 @@
+# 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.
+profile=Profile
+crontab=Schedule
+executions=Executions
+title=Task
+resourceName=Resource Name
+name=Name
+description=Description
+lastExec=Last Execution
+nextExec=Next Execution
+cron=Schedule (seconds, minutes, hours, days of month, months, days of week)
+templates=Remove task from scheduler / Use a template to schedule
+apply=Save
+startDate=Start date
+endDate=End date
+status=Status
+message=Message
+delete=Delete
+showMessage=Show
+chooseForTemplate=Use A Template
+creates=Allow create operations
+deletes=Allow delete operations
+updates=Allow update operations
+syncStatus=Allow status synchronization
+fullReconciliation=Full reconciliation
+actionsClasses=Actions classes
+matchingRule=Matching Rule
+unmatchingRule=Unmatching Rule
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_it.properties
new file mode 100644
index 0000000..0ec6d67
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_it.properties
@@ -0,0 +1,44 @@
+# 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.
+profile=Profilo
+crontab=Schedule
+executions=Esecuzioni
+title=Task
+resourceName=Nome Risorsa
+name=Nome
+description=Descrizione
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+cron=Schedule (secondi, minuti, ore, giorni del mese, mesi, giorni della settimana)
+templates=Rimuovi task dallo scheduler / Utilizza un template per schedulare
+apply=Salva
+startDate=Data di avvio
+endDate=Data di conclusione
+status=Stato
+message=Messaggio
+delete=Rimozione
+showMessage=Mostra
+chooseForTemplate=Usa Un Template
+creates=Consenti operazioni di creazione
+deletes=Consenti operazioni di rimozione
+updates=Consenti operazioni di modifica
+syncStatus=Consenti sincronizzazione di stato
+fullReconciliation=Riconciliazione totale
+actionsClasses=Classi azioni
+syncStatus=Sincronizza stato utente
+matchingRule=Regola di corrispondenza
+unmatchingRule=Regola di non corrispondenza
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_pt_BR.properties
new file mode 100644
index 0000000..b790e58
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage_pt_BR.properties
@@ -0,0 +1,43 @@
+# 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.
+profile=Perfil
+crontab=Agenda
+executions=Execu\u00e7\u00f5es
+title=Tarefas
+resourceName=Nome de Recursos
+name=Nome
+description=Descri\u00e7\u00e3o
+lastExec=\u00daltima Execu\u00e7\u00e3o
+nextExec=Pr\u00f3xima Execu\u00e7\u00e3o
+cron=Agenda (segundos, minutos, horas, dias do m\u00eas, meses, dias da semana)
+templates=Remover tarefa agendada / usar template para agendar
+apply=Salvar
+startDate=Data de In\u00edcio
+endDate=Data Final
+status=Estatus
+message=Mensagem
+delete=Excluir
+showMessage=Mostrar
+chooseForTemplate=Usar um template
+creates=Permitir opera\u00e7\u00f5es de cria\u00e7\u00e3o
+deletes=Permitir opera\u00e7\u00f5es de remo\u00e7\u00e3o
+updates=Permitir a edi\u00e7\u00e3o
+syncStatus=Permitir a sincroniza\u00e7\u00e3o de status
+fullReconciliation=Reconcilia\u00e7\u00e3o completa
+actionsClasses=Classes de a\u00e7\u00f5es
+matchingRule=Regra de correspond\u00eancia
+unmatchingRule=Regra de non correspond\u00eancia
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.html
new file mode 100644
index 0000000..7df418a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.html
@@ -0,0 +1,46 @@
+<!--
+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.
+-->
+<wicket:extend>
+
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#tabs-1"><span><wicket:message key="tab1"/></span></a></li>
+ <li><a href="#tabs-2"><span><wicket:message key="tab2"/></span></a></li>
+ <li><a href="#tabs-3"><span><wicket:message key="tab3"/></span></a></li>
+ <li><a href="#tabs-4"><span><wicket:message key="tab4"/></span></a></li>
+ <li><a href="#tabs-5"><span><wicket:message key="tab5"/></span></a></li>
+ </ul>
+ <div id="tabs-1">
+ <span wicket:id="propagation">[propagation tasks]</span>
+ </div>
+ <div id="tabs-2">
+ <span wicket:id="notification">[notification tasks]</span>
+ </div>
+ <div id="tabs-3">
+ <span wicket:id="sched">[scheduled tasks]</span>
+ </div>
+ <div id="tabs-4">
+ <span wicket:id="sync">[synchronization tasks]</span>
+ </div>
+ <div id="tabs-5">
+ <span wicket:id="push">[push tasks]</span>
+ </div>
+ </div>
+
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.properties
new file mode 100644
index 0000000..6dcc9f7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks.properties
@@ -0,0 +1,21 @@
+# 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.
+tab1=Propagation Tasks
+tab2=Notification tasks
+tab3=Scheduled Tasks
+tab4=Synchronization Tasks
+tab5=Push Tasks
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_it.properties
new file mode 100644
index 0000000..2c050e1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_it.properties
@@ -0,0 +1,21 @@
+# 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.
+tab1=Task di propagazione
+tab2=Task di notifica
+tab3=Task programmabili
+tab4=Task di sincronizzazione
+tab5=Task di push
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_pt_BR.properties
new file mode 100644
index 0000000..638934a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Tasks_pt_BR.properties
@@ -0,0 +1,21 @@
+# 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.
+tab1=Propaga\u00e7\u00e3o de Tarefas
+tab2=Tarefas de Notifica\u00e7\u00e3o
+tab3=Tarefas Agendadas
+tab4=Sincroniza\u00e7\u00e3o de Tarefas
+tab5=Push de Tarefas
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.html
new file mode 100644
index 0000000..e18efa0
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.html
@@ -0,0 +1,45 @@
+<!--
+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 id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#tabs-1"><span><wicket:message key="approvals"/></span></a></li>
+ </ul>
+ <div id="tabs-1">
+
+ <div id="users-contain" class="ui-widget" style="width:inherit;">
+ <span wicket:id="approvalContainer">
+ <table class="ui-widget ui-widget-content table-hover"
+ wicket:id="approvalTable"/>
+ </span>
+ <span style="float:right">
+ <form wicket:id="paginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="editApprovalWin">[Show modal window for editing approval]</div>
+ </div>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.properties
new file mode 100644
index 0000000..2e4442a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo.properties
@@ -0,0 +1,31 @@
+# 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.
+taskId=Task
+key=Key
+description=Description
+createTime=Create time
+dueDate=Due date
+owner=Owner
+claim=Claim
+manage=Manage
+approvals=Approvals
+delete=Delete
+type=Type
+username=User
+new_user=New user
+creationDate = Creation date
+claimDate = Claim date
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_it.properties
new file mode 100644
index 0000000..df4fba8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_it.properties
@@ -0,0 +1,31 @@
+# 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.
+taskId=Task
+key=Chiave
+description=Descrizione
+createTime=Data di creazione
+dueDate=Scadenza
+owner=Esecutore
+claim=Richiedi
+manage=Gestisci
+approvals=Approvazioni
+delete=Rimuovi
+type=Tipo
+username=Utente
+new_user=Nuovo utente
+creationDate = Data creazione
+claimDate = Data rivendicazione
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_pt_BR.properties
new file mode 100644
index 0000000..fb255fb
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Todo_pt_BR.properties
@@ -0,0 +1,31 @@
+# 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.
+taskId=Tarefa
+key=Chave
+description=Descri\u00e7\u00e3o
+createTime=Tempo de Cria\u00e7\u00e3o
+dueDate=Data acordada
+owner=Propriet\u00e1rio
+claim=Requerimento
+manage=Ger\u00eancia
+approvals=Aprova\u00e7\u00e3o
+delete=Excluir
+type=Tipo
+username=Usu\u00e1rio
+new_user=Novo Usu\u00e1rio
+creationDate = Data de cria\u00e7\u00e3o
+claimDate = Data de reivindica\u00e7\u00e3o
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
new file mode 100644
index 0000000..ff39c9c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
@@ -0,0 +1,97 @@
+<!--
+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>
+
+ <span wicket:id="userModalFrag"/>
+
+ <wicket:fragment wicket:id="userModalEditFrag">
+
+ <div style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <span wicket:id="new"/> <wicket:message key="title"/> <span wicket:id="id"/>
+ </p>
+
+ <form wicket:id="UserForm">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#tabs-1"><span><wicket:message key="tab1"/></span></a></li>
+ <li><a href="#tabs-2"><span><wicket:message key="tab2"/></span></a></li>
+ <li><a href="#tabs-3"><span><wicket:message key="tab3"/></span></a></li>
+ <li><a href="#tabs-4"><span><wicket:message key="tab4"/></span></a></li>
+ <li><a href="#tabs-5"><span><wicket:message key="tab5"/></span></a></li>
+ <li><a href="#tabs-6"><span><wicket:message key="tab6"/></span></a></li>
+ </ul>
+ <div id="tabs-1">
+ <span wicket:id="details">[user details]</span>
+ <span wicket:id="storePwdFrag">[storePwdFrag]</span>
+ <wicket:fragment wicket:id="storePwdCheck">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="storePasswordLabel">[storePasswordLabel]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="storePassword">[storePassword]</span>
+ </div>
+ </div>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ <div wicket:id="securityQuestion">[Security Question]</div>
+ <div wicket:id="pwdChangeInfo" style="margin-top: 10px;">[pwdChangeInfo]</div>
+ <span wicket:id="statuspanel">[Status Panel]</span>
+ <span wicket:id="accountinformation">[Account Information]</span>
+ </div>
+ <div id="tabs-2">
+ <div id="formtable">
+ <span wicket:id="attrs">[user attributes]</span>
+ </div>
+ </div>
+
+ <div id="tabs-3">
+ <span wicket:id="derAttrs">[user derived attributes]</span>
+ </div>
+
+ <div id="tabs-4">
+ <span wicket:id="virAttrs">[user virtual attributes]</span>
+ </div>
+
+ <div id="tabs-5">
+ <span wicket:id="resources">[resources]</span>
+ </div>
+
+ <div id="tabs-6">
+ <span wicket:id="memberships">[memberships]</span>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:fragment>
+
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
new file mode 100644
index 0000000..c0614c4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
@@ -0,0 +1,52 @@
+# 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.
+required_alert=All form fields are required.
+title=User
+firstname=Firstname
+surname=Surname
+tab1=Details
+tab2=Attributes
+tab3=Derived attributes
+tab4=Virtual attributes
+tab5=Resources
+tab6=Roles
+add=+
+drop=-
+resources=Resources transfer
+firstResourcesList=User's resources
+secondResourcesList=Available resources
+updating_error=Generic error occurred during updating
+column1=Roles
+column2=Action
+
+edit=Edit
+delete=Delete
+derAttrs=Derived Attributes
+derAttrToRemove=Delete
+derAttrName=Name
+derAttrValue=Derived value
+
+virAttrs=Virtual Attributes
+virAttrToRemove=Delete
+virAttrName=Name
+virAttrValue=Virtual value
+
+addAttributeBtn=Add
+new=New
+pwdChangeInfo=If provided, the password will be changed on the following resources.
+
+storePassword=Store password internally
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
new file mode 100644
index 0000000..8a79601
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
@@ -0,0 +1,53 @@
+# 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.
+required_alert=Tutti i campi sono obbligatori.
+title=Utente
+firstname=Nome
+surname=Cognome
+tab1=Details
+tab2=Attributi
+tab3=Attributi derivati
+tab4=Attributi virtuali
+tab5=Risorse
+tab6=Ruoli
+add=+
+drop=-
+resources=Associazione risorse
+firstResourcesList=Risorse utente
+secondResourcesList=Risorse disponibili
+updating_error=Errore generico durante l'aggiornamento
+column1=Ruoli
+column2=Azioni
+edit=Modifica
+delete=Rimuovi
+
+derAttrs=Attributi derivati
+derAttrToRemove=Elimina
+derAttrName=Nome
+derAttrValue=Valore derivato
+
+virAttrs=Attributi virtual
+virAttrToRemove=Elimina
+virAttrName=Nome
+virAttrValue=Valore virtuale
+
+addAttributeBtn=Aggiungi
+
+new=Nuovo
+pwdChangeInfo=Se inserita, la password verr\u00e0 cambiata sulle seguenti risorse.
+
+storePassword=Salva la password internamente
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
new file mode 100644
index 0000000..7000c47
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
@@ -0,0 +1,52 @@
+# 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.
+required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
+title=Usu\u00e1rio
+firstname=Nome
+surname=Sobrenome
+tab1=Detalhes
+tab2=Atributos
+tab3=Atriutos Derivados
+tab4=Atributos Virtuais
+tab5=Recursos
+tab6=Fun\u00e7\u00f5es
+add=+
+drop=-
+resources=Transfer\u00eancia de Recursos
+firstResourcesList=Recursos de usu\u00e1rio
+secondResourcesList=Recursos Dispon\u00edveis
+updating_error=Um erro gern\u00e9rico ocorreu durante a atualiza\u00e7\u00e3o
+column1=Fun\u00e7\u00f5es
+column2=A\u00e7\u00e3o
+
+edit=Alterar
+delete=Excluir
+derAttrs=Atributos Derivados
+derAttrToRemove=Excluir
+derAttrName=Nome
+derAttrValue=Valor Derivado
+
+virAttrs=Atributos virtuais
+virAttrToRemove=Excluir
+virAttrName=Nome
+virAttrValue=Valor Virtual
+
+addAttributeBtn=Adicionar
+new=Novo
+pwdChangeInfo=Se provida, a senha ser\u00e1 alterada nos seguintes recursos
+
+storePassword=Salvar senha internamente
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.html
new file mode 100644
index 0000000..e62e4f3
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.html
@@ -0,0 +1,38 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<wicket:extend>
+ <div style="padding: 5px;">
+ <div>
+ <form wicket:id="searchForm">
+ <span wicket:id="searchPanel">searchPanel</span>
+
+ <br/>
+ <a wicket:id="search"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <img src="img/search.png" alt="search"/>
+ <wicket:message key="search"/>
+ </a>
+ </form>
+ </div>
+
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="searchResult"> [search result] </span>
+ </div>
+ </div>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.properties
new file mode 100644
index 0000000..6e0a6ea
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage.properties
@@ -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.
+search=Search
+search_error=Error:search's format is invalid
+search_noResults=No matches found.
+reset=Reset
+showingFrom=Showing
+showingTo=to
+showingOf=of
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_it.properties
new file mode 100644
index 0000000..1d4f230
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_it.properties
@@ -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.
+search=Cerca
+search_error=Errore:il formato di ricerca non \u00e8 valido
+search_noResults=Nessuna corrispondenza trovata.
+reset=Reset
+showingFrom=Risultati da
+showingTo=a
+showingOf=di
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_pt_BR.properties
new file mode 100644
index 0000000..28ef869
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserOwnerSelectModalPage_pt_BR.properties
@@ -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.
+search=Senha
+search_error=Erro\: formato de busca incorreto.
+search_noResults=Nenhum resultado encontrado.
+reset=Resetar
+showingFrom=Mostrando
+showingTo=para
+showingOf=de
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.html
new file mode 100644
index 0000000..e302ea1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.html
@@ -0,0 +1,72 @@
+<!--
+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 id="tabs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#tabs-1">
+ <span><wicket:message key="tab1"/>
+ </span>
+ </a>
+ </li>
+ <li>
+ <a href="#tabs-2">
+ <span><wicket:message key="tab2"/>
+ </span>
+ </a>
+ </li>
+ </ul>
+
+ <div id="tabs-1">
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="listResult"> [search result] </span>
+ <div wicket:id="editModal" ></div>
+ </div>
+
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createLink">
+ <wicket:message key="create"/>
+ </a>
+ </div>
+
+ <div id="tabs-2">
+ <div>
+ <form wicket:id="searchForm">
+ <span wicket:id="searchPanel">searchPanel</span>
+
+ <br/>
+ <a wicket:id="search"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <img src="img/search.png" alt="search"/>
+ <wicket:message key="search"/>
+ </a>
+ </form>
+ </div>
+
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="searchResult">[search result]</span>
+ </div>
+ </div>
+
+ </div>
+
+ <wicket:child/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.properties
new file mode 100644
index 0000000..8ad9ae6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users.properties
@@ -0,0 +1,26 @@
+# 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.
+tab1=List
+tab2=Search
+search=Search
+search_results_title=Search results:
+search_noResults=No matches found.
+search_error=Error:search's format is invalid
+reset=Reset
+showingFrom=Showing
+showingTo=to
+showingOf=of
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_it.properties
new file mode 100644
index 0000000..708bfed
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_it.properties
@@ -0,0 +1,26 @@
+# 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.
+tab1=Elenco
+tab2=Ricerca
+search=Cerca
+search_results_title=Risultati ricerca:
+search_noResults=Nessuna corrispondenza trovata.
+search_error=Errore:il formato di ricerca non \u00e8 valido
+reset=Reset
+showingFrom=Risultati da
+showingTo=a
+showingOf=di
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_pt_BR.properties
new file mode 100644
index 0000000..7ab1053
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Users_pt_BR.properties
@@ -0,0 +1,26 @@
+# 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.
+tab1=Lista
+tab2=Buscar
+search=Buscar
+search_results_title=Resultados de pesquisa\:
+search_noResults=Nenhum resultado encontrado
+search_error=Erro\: formato de busca incorreto.
+reset=Resetar
+showingFrom=Mostrar
+showingTo=para
+showingOf=de
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
new file mode 100644
index 0000000..695ed51
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
@@ -0,0 +1,53 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title" /></p>
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="readonly" class="onerowlabel"><wicket:message key="readonly"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="readonly">[readonly]</span>
+ </div>
+ </div>
+ </div>
+ <div style="margin: 10px 0px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.properties
new file mode 100644
index 0000000..ef0cb6a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.properties
@@ -0,0 +1,22 @@
+# 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.
+required_alert=All form fields are required.
+existing_schemas=Existing Schemas:
+edit_attribute=Edit attribute
+attributes=Virtual attributes
+title=Virtual Schema
+readonly=Read-only
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_it.properties
new file mode 100644
index 0000000..21c2d3c
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_it.properties
@@ -0,0 +1,22 @@
+# 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.
+required_alert=Tutti i campi sono richiesti.
+existing_schemas=Schemi presenti:
+edit_attribute=Modifica attributo
+attributes=Attributi virtuali
+title=Schema Virtuale
+readonly=Read-only
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_pt_BR.properties
new file mode 100644
index 0000000..1d0de8a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+required_alert=Todos os campos do formul\u00e1rio s\u00e3o obrigat\u00f3rios
+existing_schemas=Esquemas Existentes\:
+edit_attribute=Editar Atributo
+attributes=Atributos Virtuais
+title=Esquema Virtual
+readonly=Apenas Leitura
[30/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/StatusPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/StatusPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/StatusPanel.java
new file mode 100644
index 0000000..e8b3af7
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/StatusPanel.java
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
+import org.apache.syncope.client.console.commons.status.Status;
+import org.apache.syncope.client.console.commons.status.StatusBean;
+import org.apache.syncope.client.console.commons.status.StatusUtils;
+import org.apache.syncope.client.console.pages.ConnObjectModalPage;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
+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.wicket.markup.html.list.AltListView;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.IHeaderContributor;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.CheckGroupSelector;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StatusPanel extends Panel implements IHeaderContributor {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(StatusPanel.class);
+
+ private static final long serialVersionUID = -4064294905566247728L;
+
+ public static final String IMG_STATUES = "../statuses/";
+
+ private static final int CONNOBJECT_WIN_HEIGHT = 400;
+
+ private static final int CONNOBJECT_WIN_WIDTH = 600;
+
+ @SpringBean
+ private UserRestClient userRestClient;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ private final ModalWindow connObjectWin;
+
+ private final List<ConnObjectWrapper> connObjects;
+
+ private final Map<String, StatusBean> initialStatusBeanMap;
+
+ private final CheckGroup<StatusBean> checkGroup;
+
+ private final ListView<StatusBean> statusBeansListView;
+
+ private final StatusUtils statusUtils;
+
+ public <T extends AbstractAttributableTO> StatusPanel(
+ final String id,
+ final AbstractSubjectTO subject,
+ final List<StatusBean> selectedResources,
+ final PageReference pageref) {
+
+ super(id);
+
+ connObjectWin = new ModalWindow("connObjectWin");
+ connObjectWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ connObjectWin.setInitialHeight(CONNOBJECT_WIN_HEIGHT);
+ connObjectWin.setInitialWidth(CONNOBJECT_WIN_WIDTH);
+ connObjectWin.setCookieName("connobject-modal");
+ add(connObjectWin);
+
+ statusUtils = new StatusUtils(subject instanceof RoleTO ? roleRestClient : userRestClient);
+
+ connObjects = statusUtils.getConnectorObjects(subject);
+
+ final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
+ initialStatusBeanMap = new LinkedHashMap<String, StatusBean>(connObjects.size() + 1);
+
+ final StatusBean syncope = new StatusBean(subject, "syncope");
+
+ if (subject instanceof UserTO) {
+ syncope.setAccountLink(((UserTO) subject).getUsername());
+
+ Status syncopeStatus = Status.UNDEFINED;
+ if (((UserTO) subject).getStatus() != null) {
+ try {
+ syncopeStatus = Status.valueOf(((UserTO) subject).getStatus().toUpperCase());
+ } catch (IllegalArgumentException e) {
+ LOG.warn("Unexpected status found: {}", ((UserTO) subject).getStatus(), e);
+ }
+ }
+ syncope.setStatus(syncopeStatus);
+ } else if (subject instanceof RoleTO) {
+ syncope.setAccountLink(((RoleTO) subject).getDisplayName());
+ syncope.setStatus(Status.ACTIVE);
+ }
+
+ statusBeans.add(syncope);
+ initialStatusBeanMap.put(syncope.getResourceName(), syncope);
+
+ for (ConnObjectWrapper entry : connObjects) {
+ final StatusBean statusBean = statusUtils.getStatusBean(
+ entry.getAttributable(),
+ entry.getResourceName(),
+ entry.getConnObjectTO(),
+ subject instanceof RoleTO);
+
+ initialStatusBeanMap.put(entry.getResourceName(), statusBean);
+ statusBeans.add(statusBean);
+ }
+
+ checkGroup = new CheckGroup<>("group", selectedResources);
+ checkGroup.setOutputMarkupId(true);
+ checkGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+
+ private static final long serialVersionUID = -151291731388673682L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ // ignore
+ }
+ });
+ add(checkGroup);
+
+ CheckGroupSelector groupSelector = new CheckGroupSelector("groupselector", checkGroup);
+ if (subject instanceof RoleTO) {
+ groupSelector.setVisible(false);
+ }
+ add(groupSelector);
+
+ statusBeansListView = new AltListView<StatusBean>("resources", statusBeans) {
+
+ private static final long serialVersionUID = 4949588177564901031L;
+
+ @Override
+ protected void populateItem(final ListItem<StatusBean> item) {
+ item.add(statusUtils.getStatusImage("icon", item.getModelObject().getStatus()));
+
+ final Check<StatusBean> check = new Check<StatusBean>("check", item.getModel(), checkGroup);
+ if (subject instanceof RoleTO) {
+ check.setVisible(false);
+ }
+ item.add(check);
+
+ item.add(new Label("resource", new ResourceModel(item.getModelObject().getResourceName(), item
+ .getModelObject().getResourceName())));
+
+ if (StringUtils.isNotBlank(item.getModelObject().getAccountLink())) {
+ item.add(new Label("accountLink", new ResourceModel(item.getModelObject().getAccountLink(),
+ item.getModelObject().getAccountLink())));
+ } else {
+ item.add(new Label("accountLink", ""));
+ }
+
+ final ConnObjectTO connObjectTO = statusUtils.getConnObjectTO(
+ item.getModelObject().getAttributableId(),
+ item.getModelObject().getResourceName(),
+ connObjects);
+
+ if (pageref == null || connObjectTO == null) {
+ item.add(new Label("connObject", new Model<String>()));
+ } else {
+ final ActionLinksPanel connObject = new ActionLinksPanel("connObject", new Model(), pageref);
+
+ connObject.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ connObjectWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ConnObjectModalPage(connObjectTO);
+ }
+ });
+
+ connObjectWin.show(target);
+ }
+ }, ActionLink.ActionType.SEARCH, "Resources", "getConnectorObject");
+
+ item.add(connObject);
+ }
+ }
+ };
+ statusBeansListView.setReuseItems(true);
+ checkGroup.add(statusBeansListView);
+ }
+
+ public StatusMod getStatusMod() {
+ StatusMod result = new StatusMod();
+
+ Collection<StatusBean> statusBeans = checkGroup.getModel().getObject();
+ if (statusBeans != null && !statusBeans.isEmpty()) {
+ result = StatusUtils.buildStatusMod(statusBeans);
+ }
+
+ return result;
+ }
+
+ public List<StatusBean> getStatusBeans() {
+ return statusBeansListView.getModelObject();
+ }
+
+ public Map<String, StatusBean> getInitialStatusBeanMap() {
+ return initialStatusBeanMap;
+ }
+
+ public void updateStatusBeans(final List<StatusBean> statusBeans) {
+ statusBeansListView.removeAll();
+ statusBeansListView.getModelObject().clear();
+ statusBeansListView.getModelObject().addAll(statusBeans);
+
+ for (StatusBean statusBean : statusBeans) {
+ if (!checkGroup.getModelObject().contains(statusBean)
+ && statusBean.getStatus() == Status.NOT_YET_SUBMITTED) {
+
+ checkGroup.getModelObject().add(statusBean);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
new file mode 100644
index 0000000..cf75285
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/SyncTasksPanel.java
@@ -0,0 +1,226 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.RoleTemplateModalPage;
+import org.apache.syncope.client.console.pages.SyncTaskModalPage;
+import org.apache.syncope.client.console.pages.UserTemplateModalPage;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.StringResourceModel;
+
+public class SyncTasksPanel extends AbstractProvisioningTasksPanel<SyncTaskTO> {
+
+ private static final long serialVersionUID = 53189199346016099L;
+
+ public SyncTasksPanel(final String id, final PageReference pageRef) {
+ super(id, pageRef, SyncTaskTO.class);
+ initTasksTable();
+ }
+
+ @Override
+ protected List<IColumn<AbstractTaskTO, String>> getColumns() {
+ final List<IColumn<AbstractTaskTO, String>> syncTaskscolumns = new ArrayList<IColumn<AbstractTaskTO, String>>();
+
+ syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("id", this, null), "id", "id"));
+ syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("name", this, null), "name", "name"));
+ syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("description", this, null), "description", "description"));
+ syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("resourceName", this, null), "resource", "resource"));
+ syncTaskscolumns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("lastExec", this, null), "lastExec", "lastExec"));
+ syncTaskscolumns.add(new DatePropertyColumn<AbstractTaskTO>(
+ new StringResourceModel("nextExec", this, null), "nextExec", "nextExec"));
+ syncTaskscolumns.add(new PropertyColumn<AbstractTaskTO, String>(
+ new StringResourceModel("latestExecStatus", this, null), "latestExecStatus", "latestExecStatus"));
+
+ syncTaskscolumns.add(
+ new ActionColumn<AbstractTaskTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {
+
+ final SyncTaskTO taskTO = (SyncTaskTO) model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new SyncTaskModalPage(window, taskTO, pageRef);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new UserTemplateModalPage(pageRef, window, taskTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.USER_TEMPLATE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+
+ window.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new RoleTemplateModalPage(pageRef, window, taskTO);
+ }
+ });
+
+ window.show(target);
+ }
+ }, ActionLink.ActionType.ROLE_TEMPLATE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), false);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.EXECUTE, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.startExecution(taskTO.getKey(), true);
+ getSession().info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DRYRUN, TASKS);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ restClient.delete(taskTO.getKey(), SyncTaskTO.class);
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+ target.add(container);
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, TASKS);
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(table);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ return syncTaskscolumns;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDetailsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDetailsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDetailsPanel.java
new file mode 100644
index 0000000..18e2066
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDetailsPanel.java
@@ -0,0 +1,122 @@
+/*
+ * 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.syncope.client.console.commons.JexlHelpUtil;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPasswordFieldPanel;
+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.common.lib.to.UserTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.behavior.Behavior;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+
+public class UserDetailsPanel extends Panel {
+
+ private static final long serialVersionUID = 6592027822510220463L;
+
+ public UserDetailsPanel(final String id, final UserTO userTO, final Form form, final boolean resetPassword,
+ final boolean templateMode) {
+
+ super(id);
+
+ // ------------------------
+ // Username
+ // ------------------------
+ final FieldPanel<String> username = new AjaxTextFieldPanel("username", "username",
+ new PropertyModel<String>(userTO, "username"));
+
+ final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("usernameJexlHelp");
+
+ final AjaxLink<?> questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "usernameQuestionMarkJexlHelp");
+ add(questionMarkJexlHelp);
+ questionMarkJexlHelp.add(jexlHelp);
+
+ if (!templateMode) {
+ username.addRequiredLabel();
+ questionMarkJexlHelp.setVisible(false);
+ }
+ add(username);
+ // ------------------------
+
+ // ------------------------
+ // Password
+ // ------------------------
+ final WebMarkupContainer pwdJexlHelp = JexlHelpUtil.getJexlHelpWebContainer("pwdJexlHelp");
+
+ final AjaxLink<?> pwdQuestionMarkJexlHelp = JexlHelpUtil.getAjaxLink(pwdJexlHelp, "pwdQuestionMarkJexlHelp");
+ add(pwdQuestionMarkJexlHelp);
+ pwdQuestionMarkJexlHelp.add(pwdJexlHelp);
+
+ FieldPanel<String> password;
+ Label confirmPasswordLabel = new Label("confirmPasswordLabel", new ResourceModel("confirmPassword"));
+ FieldPanel<String> confirmPassword;
+ if (templateMode) {
+ password = new AjaxTextFieldPanel("password", "password", new PropertyModel<String>(userTO, "password"));
+
+ confirmPasswordLabel.setVisible(false);
+ confirmPassword = new AjaxTextFieldPanel("confirmPassword", "confirmPassword", new Model<String>());
+ confirmPassword.setEnabled(false);
+ confirmPassword.setVisible(false);
+ } else {
+ pwdQuestionMarkJexlHelp.setVisible(false);
+
+ password = new AjaxPasswordFieldPanel("password", "password",
+ new PropertyModel<String>(userTO, "password"));
+ ((PasswordTextField) password.getField()).setResetPassword(resetPassword);
+
+ confirmPassword = new AjaxPasswordFieldPanel("confirmPassword", "confirmPassword", new Model<String>());
+ if (!resetPassword) {
+ confirmPassword.getField().setModelObject(userTO.getPassword());
+ }
+ ((PasswordTextField) confirmPassword.getField()).setResetPassword(resetPassword);
+
+ form.add(new EqualPasswordInputValidator(password.getField(), confirmPassword.getField()));
+ }
+ add(password);
+ add(confirmPasswordLabel);
+ add(confirmPassword);
+
+ final WebMarkupContainer mandatoryPassword = new WebMarkupContainer("mandatory_pwd");
+ mandatoryPassword.add(new Behavior() {
+
+ private static final long serialVersionUID = 1469628524240283489L;
+
+ @Override
+ public void onComponentTag(final Component component, final ComponentTag tag) {
+ if (userTO.getKey() > 0) {
+ tag.put("style", "display:none;");
+ }
+ }
+ });
+
+ add(mandatoryPassword);
+ // ------------------------
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchPanel.java
new file mode 100644
index 0000000..2ca1b94
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchPanel.java
@@ -0,0 +1,113 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.search.SyncopeFiqlSearchConditionBuilder;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class UserSearchPanel extends AbstractSearchPanel {
+
+ private static final long serialVersionUID = -1769527800450203738L;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ public static class Builder implements Serializable {
+
+ private static final long serialVersionUID = 6308997285778809578L;
+
+ private String id;
+
+ private String fiql = null;
+
+ private boolean required = true;
+
+ public Builder(final String id) {
+ this.id = id;
+ }
+
+ public Builder fiql(final String fiql) {
+ this.fiql = fiql;
+ return this;
+ }
+
+ public Builder required(final boolean required) {
+ this.required = required;
+ return this;
+ }
+
+ public UserSearchPanel build() {
+ return new UserSearchPanel(this);
+ }
+ }
+
+ private UserSearchPanel(final Builder builder) {
+ super(builder.id, AttributableType.USER, builder.fiql, builder.required);
+ }
+
+ @Override
+ protected void populate() {
+ super.populate();
+
+ this.types = new LoadableDetachableModel<List<SearchClause.Type>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<SearchClause.Type> load() {
+ List<SearchClause.Type> result = new ArrayList<SearchClause.Type>();
+ result.add(SearchClause.Type.ATTRIBUTE);
+ result.add(SearchClause.Type.MEMBERSHIP);
+ result.add(SearchClause.Type.RESOURCE);
+ return result;
+ }
+ };
+
+ this.roleNames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ List<RoleTO> roleTOs = roleRestClient.list();
+
+ List<String> result = new ArrayList<String>(roleTOs.size());
+ for (RoleTO role : roleTOs) {
+ result.add(role.getDisplayName());
+ }
+
+ return result;
+ }
+ };
+ }
+
+ @Override
+ protected SyncopeFiqlSearchConditionBuilder getSearchConditionBuilder() {
+ return SyncopeClient.getUserSearchConditionBuilder();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
new file mode 100644
index 0000000..7e494a5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
@@ -0,0 +1,298 @@
+/*
+ * 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.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.DisplayAttributesModalPage;
+import org.apache.syncope.client.console.pages.EditUserModalPage;
+import org.apache.syncope.client.console.pages.ResultStatusModalPage;
+import org.apache.syncope.client.console.pages.StatusModalPage;
+import org.apache.syncope.client.console.rest.AbstractSubjectRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.TokenColumn;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.springframework.util.ReflectionUtils;
+
+public class UserSearchResultPanel extends AbstractSearchResultPanel {
+
+ private static final long serialVersionUID = -905187144506842332L;
+
+ private final static String PAGEID = "Users";
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ private final List<String> pSchemaNames;
+
+ private final List<String> dSchemaNames;
+
+ private final List<String> vSchemaNames;
+
+ public <T extends AbstractAttributableTO> UserSearchResultPanel(final String id, final boolean filtered,
+ final String fiql, final PageReference callerRef, final AbstractSubjectRestClient restClient) {
+
+ super(id, filtered, fiql, callerRef, restClient);
+
+ this.pSchemaNames = schemaRestClient.getSchemaNames(AttributableType.USER);
+ this.dSchemaNames = schemaRestClient.getDerSchemaNames(AttributableType.USER);
+ this.vSchemaNames = schemaRestClient.getVirSchemaNames(AttributableType.USER);
+
+ initResultTable();
+ }
+
+ @Override
+ protected List<IColumn<AbstractAttributableTO, String>> getColumns() {
+ final List<IColumn<AbstractAttributableTO, String>> columns =
+ new ArrayList<IColumn<AbstractAttributableTO, String>>();
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW)) {
+ final Field field = ReflectionUtils.findField(UserTO.class, name);
+
+ if ("token".equalsIgnoreCase(name)) {
+ columns.add(new TokenColumn("token"));
+ } else if (field != null && field.getType().equals(Date.class)) {
+ columns.add(new DatePropertyColumn<AbstractAttributableTO>(new ResourceModel(name, name), name, name));
+ } else {
+ columns.add(
+ new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(name, name), name, name));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW)) {
+ if (pSchemaNames.contains(name)) {
+ columns.add(new AttrColumn(name, SchemaType.PLAIN));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW)) {
+ if (dSchemaNames.contains(name)) {
+ columns.add(new AttrColumn(name, SchemaType.DERIVED));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW)) {
+ if (vSchemaNames.contains(name)) {
+ columns.add(new AttrColumn(name, SchemaType.VIRTUAL));
+ }
+ }
+
+ // Add defaults in case of no selection
+ if (columns.isEmpty()) {
+ for (String name : DisplayAttributesModalPage.DEFAULT_SELECTION) {
+ columns.add(
+ new PropertyColumn<AbstractAttributableTO, String>(new ResourceModel(name, name), name, name));
+ }
+
+ prefMan.setList(getRequest(), getResponse(), Constants.PREF_USERS_DETAILS_VIEW,
+ Arrays.asList(DisplayAttributesModalPage.DEFAULT_SELECTION));
+ }
+
+ columns.add(new ActionColumn<AbstractAttributableTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<AbstractAttributableTO> model) {
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ statusmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new StatusModalPage<UserTO>(
+ page.getPageReference(), statusmodal, (UserTO) model.getObject());
+ }
+ });
+
+ statusmodal.show(target);
+ }
+ }, ActionLink.ActionType.MANAGE_RESOURCES, PAGEID);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ statusmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new StatusModalPage<UserTO>(
+ page.getPageReference(), statusmodal, (UserTO) model.getObject(), true);
+ }
+ });
+
+ statusmodal.show(target);
+ }
+ }, ActionLink.ActionType.ENABLE, PAGEID);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ editmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ // SYNCOPE-294: re-read userTO before edit
+ UserTO userTO = ((UserRestClient) restClient).read(model.getObject().getKey());
+ return new EditUserModalPage(page.getPageReference(), editmodal, userTO);
+ }
+ });
+
+ editmodal.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, PAGEID);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ final UserTO userTO = (UserTO) restClient.
+ delete(model.getObject().getETagValue(), model.getObject().getKey());
+
+ page.setModalResult(true);
+
+ editmodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ResultStatusModalPage.Builder(editmodal, userTO).build();
+ }
+ });
+
+ editmodal.show(target);
+ } catch (SyncopeClientException scce) {
+ error(getString(Constants.OPERATION_ERROR) + ": " + scce.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.DELETE, PAGEID);
+
+ return panel;
+ }
+
+ @Override
+ public ActionLinksPanel getHeader(final String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), page.getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ displaymodal.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new DisplayAttributesModalPage(page.getPageReference(), displaymodal,
+ pSchemaNames, dSchemaNames, vSchemaNames);
+ }
+ });
+
+ displaymodal.show(target);
+ }
+ }, ActionLink.ActionType.CHANGE_VIEW, PAGEID);
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(container);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, PAGEID, "list");
+
+ return panel;
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ protected <T extends AbstractAttributableTO> Collection<ActionType> getBulkActions() {
+ final List<ActionType> bulkActions = new ArrayList<ActionType>();
+
+ bulkActions.add(ActionType.DELETE);
+ bulkActions.add(ActionType.SUSPEND);
+ bulkActions.add(ActionType.REACTIVATE);
+
+ return bulkActions;
+ }
+
+ @Override
+ protected String getPageId() {
+ return PAGEID;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/VirAttrsPanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/VirAttrsPanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/VirAttrsPanel.java
new file mode 100644
index 0000000..34d21d5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/panels/VirAttrsPanel.java
@@ -0,0 +1,295 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AttrTemplatesPanel.RoleAttrTemplatesChange;
+import org.apache.syncope.client.console.rest.RoleRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDecoratedCheckbox;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.to.VirSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class VirAttrsPanel extends Panel {
+
+ private static final long serialVersionUID = -7982691107029848579L;
+
+ @SpringBean
+ private SchemaRestClient schemaRestClient;
+
+ @SpringBean
+ private RoleRestClient roleRestClient;
+
+ private final AttrTemplatesPanel attrTemplates;
+
+ private final Map<String, VirSchemaTO> schemas = new TreeMap<String, VirSchemaTO>();
+
+ public <T extends AbstractAttributableTO> VirAttrsPanel(final String id, final T entityTO,
+ final boolean templateMode) {
+
+ this(id, entityTO, templateMode, null);
+ }
+
+ public <T extends AbstractAttributableTO> VirAttrsPanel(final String id, final T entityTO,
+ final boolean templateMode, final AttrTemplatesPanel attrTemplates) {
+
+ super(id);
+ this.attrTemplates = attrTemplates;
+ this.setOutputMarkupId(true);
+
+ final IModel<List<String>> virSchemas = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ private void filter(final List<VirSchemaTO> schemaTOs, final Set<String> allowed) {
+ for (ListIterator<VirSchemaTO> itor = schemaTOs.listIterator(); itor.hasNext();) {
+ VirSchemaTO schema = itor.next();
+ if (!allowed.contains(schema.getKey())) {
+ itor.remove();
+ }
+ }
+ }
+
+ @Override
+ protected List<String> load() {
+ List<VirSchemaTO> schemaTOs;
+
+ if (entityTO instanceof RoleTO) {
+ final RoleTO roleTO = (RoleTO) entityTO;
+
+ schemaTOs = schemaRestClient.getVirSchemas(AttributableType.ROLE);
+ Set<String> allowed;
+ if (attrTemplates == null) {
+ allowed = new HashSet<String>(roleTO.getRVirAttrTemplates());
+ } else {
+ allowed = new HashSet<String>(attrTemplates.getSelected(
+ AttrTemplatesPanel.Type.rVirAttrTemplates));
+ if (roleTO.isInheritTemplates() && roleTO.getParent() != 0) {
+ allowed.addAll(roleRestClient.read(roleTO.getParent()).getRVirAttrTemplates());
+ }
+ }
+ filter(schemaTOs, allowed);
+ } else if (entityTO instanceof UserTO) {
+ schemaTOs = schemaRestClient.getVirSchemas(AttributableType.USER);
+ } else {
+ schemaTOs = schemaRestClient.getVirSchemas(AttributableType.MEMBERSHIP);
+ Set<String> allowed = new HashSet<String>(
+ roleRestClient.read(((MembershipTO) entityTO).getRoleId()).getMVirAttrTemplates());
+ filter(schemaTOs, allowed);
+ }
+
+ schemas.clear();
+
+ for (VirSchemaTO schemaTO : schemaTOs) {
+ schemas.put(schemaTO.getKey(), schemaTO);
+ }
+
+ return new ArrayList<>(schemas.keySet());
+ }
+ };
+
+ final WebMarkupContainer attributesContainer = new WebMarkupContainer("virAttrContainer");
+ attributesContainer.setOutputMarkupId(true);
+ add(attributesContainer);
+
+ AjaxButton addAttributeBtn = new IndicatingAjaxButton("addAttributeBtn", new ResourceModel("addAttributeBtn")) {
+
+ private static final long serialVersionUID = -4804368561204623354L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ entityTO.getVirAttrs().add(new AttrTO());
+ target.add(attributesContainer);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ target.add(attributesContainer);
+ }
+ };
+
+ add(addAttributeBtn.setDefaultFormProcessing(Boolean.FALSE));
+
+ ListView<AttrTO> attributes = new ListView<AttrTO>("attrs",
+ new PropertyModel<List<? extends AttrTO>>(entityTO, "virAttrs")) {
+
+ private static final long serialVersionUID = 9101744072914090143L;
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected void populateItem(final ListItem<AttrTO> item) {
+ final AttrTO attributeTO = item.getModelObject();
+
+ item.add(new AjaxDecoratedCheckbox("toRemove", new Model<Boolean>(Boolean.FALSE)) {
+
+ private static final long serialVersionUID = 7170946748485726506L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ entityTO.getVirAttrs().remove(attributeTO);
+ target.add(attributesContainer);
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+
+ final AjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component component) {
+ return "if (!confirm('" + getString("confirmDelete") + "')) return false;";
+ }
+ };
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
+ }
+ });
+
+ if (attributeTO.getValues().isEmpty()) {
+ attributeTO.getValues().add("");
+ }
+
+ if (attributeTO.getSchema() != null) {
+ VirSchemaTO attributeSchema = schemas.get(attributeTO.getSchema());
+ if (attributeSchema != null) {
+ attributeTO.setReadonly(attributeSchema.isReadonly());
+ }
+ }
+
+ final AjaxTextFieldPanel panel;
+ final MultiFieldPanel multiPanel;
+ if (templateMode) {
+ panel = new AjaxTextFieldPanel("values", "values", new Model<String>());
+ panel.setReadOnly(attributeTO.isReadonly());
+ multiPanel = null;
+ } else {
+ panel = new AjaxTextFieldPanel("panel", "values", new Model<String>(null));
+ panel.setReadOnly(attributeTO.isReadonly());
+ multiPanel = new MultiFieldPanel("values",
+ new PropertyModel<List<String>>(attributeTO, "values"), panel);
+ }
+
+ final DropDownChoice<String> schemaChoice = new DropDownChoice<String>("schema",
+ new PropertyModel<String>(attributeTO, "schema"), virSchemas,
+ new ChoiceRenderer<String>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ public Object getDisplayValue(final String object) {
+ final StringBuilder text = new StringBuilder(object);
+ if (templateMode) {
+ text.append(" (JEXL)");
+ }
+ return text.toString();
+ }
+ });
+
+ schemaChoice.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_BLUR) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ attributeTO.setSchema(schemaChoice.getModelObject());
+
+ VirSchemaTO virSchema = schemas.get(attributeTO.getSchema());
+ if (virSchema != null) {
+ attributeTO.setReadonly(virSchema.isReadonly());
+ panel.setReadOnly(attributeTO.isReadonly());
+ }
+
+ if (multiPanel != null) {
+ multiPanel.getView().setEnabled(false);
+ }
+ }
+ });
+
+ schemaChoice.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ target.add(attributesContainer);
+ }
+ });
+
+ schemaChoice.setOutputMarkupId(true);
+ schemaChoice.setRequired(true);
+ item.add(schemaChoice);
+
+ if (templateMode) {
+ item.add(panel);
+ } else {
+ item.add(multiPanel);
+ }
+ }
+ };
+
+ attributesContainer.add(attributes);
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if ((event.getPayload() instanceof RoleAttrTemplatesChange)) {
+ final RoleAttrTemplatesChange update = (RoleAttrTemplatesChange) event.getPayload();
+ if (attrTemplates != null && update.getType() == AttrTemplatesPanel.Type.rVirAttrTemplates) {
+ update.getTarget().add(this);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/BinaryPreview.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/BinaryPreview.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/BinaryPreview.java
new file mode 100644
index 0000000..bc5998a
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/BinaryPreview.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.preview;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface BinaryPreview {
+
+ public String[] mimeTypes() default {};
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
new file mode 100644
index 0000000..2baff26
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewUtil.java
@@ -0,0 +1,67 @@
+/*
+ * 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.preview;
+
+import java.lang.reflect.InvocationTargetException;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.init.PreviewPanelClassInitializer;
+import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
+import org.apache.wicket.Component;
+import org.apache.wicket.util.crypt.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+@org.springframework.stereotype.Component
+public class PreviewUtil {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(PreviewUtil.class);
+
+ @Autowired
+ private PreviewPanelClassInitializer previewPanelClassInitializer;
+
+ public Component getPreviewer(final String mimeType, final String file) throws ClassNotFoundException,
+ NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
+
+ final Class<? extends AbstractBinaryPreviewer> previewer = StringUtils.isBlank(file)
+ ? null
+ : previewPanelClassInitializer.getClass(mimeType);
+
+ return previewer == null
+ ? null
+ : ((AbstractBinaryPreviewer) Class.forName(previewer.getName()).
+ getConstructor(String.class, String.class, byte[].class).newInstance(
+ new Object[] { "previewer", mimeType, Base64.decodeBase64(file) })).preview();
+ }
+
+ public Component getPreviewer(final String mimeType, final byte[] file) throws ClassNotFoundException,
+ NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
+
+ final Class<? extends AbstractBinaryPreviewer> previewer = previewPanelClassInitializer.getClass(mimeType);
+
+ return previewer == null
+ ? null
+ : ((AbstractBinaryPreviewer) Class.forName(previewer.getName()).
+ getConstructor(String.class, String.class, byte[].class).newInstance(
+ new Object[] { "previewer", mimeType, file })).preview();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
new file mode 100644
index 0000000..921d783
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/preview/PreviewerClassScanner.java
@@ -0,0 +1,50 @@
+/*
+ * 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.preview;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
+import org.springframework.core.type.filter.AnnotationTypeFilter;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ClassUtils;
+
+@Component
+public class PreviewerClassScanner extends ClassPathScanningCandidateComponentProvider {
+
+ private static final String BASE_PATH = "org.apache.syncope.console.wicket.markup.html.form";
+
+ public PreviewerClassScanner() {
+ super(false);
+ addIncludeFilter(new AnnotationTypeFilter(BinaryPreview.class));
+ }
+
+ @SuppressWarnings("unchecked")
+ public final List<Class<? extends AbstractBinaryPreviewer>> getComponentClasses() {
+ List<Class<? extends AbstractBinaryPreviewer>> classes =
+ new ArrayList<Class<? extends AbstractBinaryPreviewer>>();
+ for (BeanDefinition candidate : findCandidateComponents(BASE_PATH)) {
+ classes.add((Class<AbstractBinaryPreviewer>) ClassUtils.resolveClassName(candidate.getBeanClassName(),
+ ClassUtils.getDefaultClassLoader()));
+ }
+ return classes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
new file mode 100644
index 0000000..8a95de6
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
@@ -0,0 +1,83 @@
+/*
+ * 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.resources;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Mounts directory on local filesystem as subcontext.
+ */
+public class FilesystemResource extends AbstractResource {
+
+ private static final long serialVersionUID = -4791087117785935198L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(FilesystemResource.class);
+
+ private final String baseCtx;
+
+ private final String basePath;
+
+ public FilesystemResource(final String baseCtx, final String basePath) {
+ this.baseCtx = baseCtx;
+ this.basePath = basePath;
+ }
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ ResourceResponse response = new ResourceResponse();
+
+ final File baseDir = new File(basePath);
+ if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
+ String reqPath = attributes.getRequest().getUrl().getPath();
+ final String subPath = reqPath.substring(reqPath.indexOf(baseCtx) + baseCtx.length()).
+ replace('/', File.separatorChar);
+ LOG.debug("Request for {}", subPath);
+
+ response.setWriteCallback(new WriteCallback() {
+
+ @Override
+ public void writeData(final Attributes attributes) throws IOException {
+ FileInputStream resourceIS = null;
+ try {
+ resourceIS = new FileInputStream(new File(baseDir, subPath));
+ IOUtils.copy(resourceIS, attributes.getResponse().getOutputStream());
+ } catch (IOException e) {
+ LOG.error("Could not read from {}", baseDir.getAbsolutePath() + subPath, e);
+ } finally {
+ IOUtils.closeQuietly(resourceIS);
+ }
+ }
+ });
+ } else {
+ LOG.error("{} not found, not readable or not a directory", basePath);
+ }
+
+ return response;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
new file mode 100644
index 0000000..2104745
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
@@ -0,0 +1,58 @@
+/*
+ * 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.resources;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Mirror REST resource for obtaining user workflow definition in JSON (used by Activiti Modeler).
+ *
+ * @see org.apache.syncope.common.services.WorkflowService#exportDefinition(org.apache.syncope.common.types.SubjectType)
+ */
+public class WorkflowDefGETResource extends AbstractResource {
+
+ private static final long serialVersionUID = 4637304868056148970L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ ResourceResponse response = new ResourceResponse();
+ response.disableCaching();
+ response.setContentType(MediaType.APPLICATION_JSON);
+
+ response.setWriteCallback(new WriteCallback() {
+
+ @Override
+ public void writeData(final Attributes attributes) throws IOException {
+ IOUtils.copy(WebApplicationContextUtils.getWebApplicationContext(
+ WebApplication.get().getServletContext()).getBean(WorkflowRestClient.class).
+ getDefinition(MediaType.APPLICATION_JSON_TYPE),
+ attributes.getResponse().getOutputStream());
+ }
+ });
+
+ return response;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
new file mode 100644
index 0000000..add6485
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
@@ -0,0 +1,74 @@
+/*
+ * 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.resources;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.MediaType;
+import org.apache.cxf.common.util.UrlUtils;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Mirror REST resource for putting user workflow definition in JSON (used by Activiti Modeler).
+ *
+ * @see org.apache.syncope.common.services.WorkflowService#importDefinition(
+ * org.apache.syncope.common.types.SubjectType, java.lang.String)
+ */
+public class WorkflowDefPUTResource extends AbstractResource {
+
+ private static final long serialVersionUID = 2964542005207297944L;
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(WorkflowDefPUTResource.class);
+
+ @Override
+ protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ String definition = null;
+ try {
+ HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
+ String requestBody = IOUtils.toString(request.getInputStream());
+ String[] split = requestBody.split("&");
+ for (int i = 0; i < split.length && definition == null; i++) {
+ String keyValue = split[i];
+ if (keyValue.startsWith("json_xml=")) {
+ definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
+ }
+ }
+ } catch (IOException e) {
+ LOG.error("Could not extract workflow definition from request", e);
+ }
+
+ WebApplicationContextUtils.getWebApplicationContext(WebApplication.get().getServletContext()).
+ getBean(WorkflowRestClient.class).
+ updateDefinition(MediaType.APPLICATION_JSON_TYPE, definition);
+
+ ResourceResponse response = new ResourceResponse();
+ response.setStatusCode(204);
+ return response;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractSubjectRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractSubjectRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractSubjectRestClient.java
new file mode 100644
index 0000000..a18a0a9
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractSubjectRestClient.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+
+public abstract class AbstractSubjectRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 1962529678091410544L;
+
+ public abstract int count();
+
+ public abstract List<? extends AbstractAttributableTO> list(int page, int size, final SortParam<String> sort);
+
+ public abstract int searchCount(String fiql);
+
+ public abstract List<? extends AbstractAttributableTO> search(String fiql,
+ int page, int size, final SortParam<String> sort);
+
+ public abstract ConnObjectTO getConnectorObject(String resourceName, Long id);
+
+ public abstract AbstractAttributableTO delete(String etag, Long id);
+
+ public abstract BulkActionResult bulkAction(BulkAction action);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ApprovalRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ApprovalRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ApprovalRestClient.java
new file mode 100644
index 0000000..dc9d12f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/ApprovalRestClient.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.rest.api.service.UserWorkflowService;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Todo services.
+ */
+@Component
+public class ApprovalRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = -4785231164900813921L;
+
+ public List<WorkflowFormTO> getForms() {
+ return getService(UserWorkflowService.class).getForms();
+ }
+
+ public WorkflowFormTO claimForm(final String taskId) {
+ return getService(UserWorkflowService.class).claimForm(taskId);
+ }
+
+ public void submitForm(final WorkflowFormTO form) {
+ getService(UserWorkflowService.class).submitForm(form);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AuthRestClient.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AuthRestClient.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AuthRestClient.java
new file mode 100644
index 0000000..01e6838
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/rest/AuthRestClient.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.rest;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.service.EntitlementService;
+import org.springframework.stereotype.Component;
+
+/**
+ * Console client for invoking Rest Resources services.
+ */
+@Component
+public class AuthRestClient extends BaseRestClient {
+
+ private static final long serialVersionUID = 2999780105004742914L;
+
+ public List<String> getAllEntitlements() {
+ return new ArrayList<>(
+ CollectionWrapper.unwrap(getService(EntitlementService.class).getAllEntitlements()));
+ }
+
+ public List<String> getOwnedEntitlements() {
+ return new ArrayList<>(
+ CollectionWrapper.unwrap(getService(EntitlementService.class).getOwnEntitlements()));
+ }
+}
[22/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.properties
new file mode 100644
index 0000000..58c5708
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.properties
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Attributes
+tab2=Derived attributes
+tab3=User attributes
+tab4=User derived attributes
+required_alert=All form fields are required.
+mandatoryCondition=Mandatory
+enumerationValues= Enumeration values
+enumerationKeys= Enumeration labels
+uniqueConstraint=Unique
+multivalue=Multivalue
+multivalueAndUniqueConstr.validation='Multivalue' and 'Unique constraint' options can't be both checked
+type=Type
+validatorClass=Validator class
+conversionPattern=Conversion pattern
+existing_schemas=Existing Schemas:
+action=Action
+edit_attribute=Edit attribute
+title=Schema
+readonly=Read-only
+secretKey=Secret key
+cipherAlgorithm=Cipher algorithm
+mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_it.properties
new file mode 100644
index 0000000..74eed7d
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_it.properties
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Attributi
+tab2=Attributi derivati
+tab3=Attributi utenti
+tab4=Attributi utenti derivati
+required_alert=Tutti i campi sono richiesti
+mandatoryCondition=Obbligatorio
+enumerationValues= Valori enumeration
+enumerationKeys= Label enumeration
+multivalue=Multivalore
+type=Tipo
+validatorClass=Validatore
+conversionPattern=Conversion pattern
+existing_schemas=Schema esistenti:
+action=Azione
+edit_attribute=Modifica attributo
+title=Schema
+readonly=Read-only
+uniqueConstraint=Univoco
+multivalueAndUniqueConstr.validation=Le opzioni 'Multivalore' e 'Vincolo unique' non possono essere entrambe impostate
+secretKey=Chiave segreta
+cipherAlgorithm=Algoritmo di cifratura
+mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_pt_BR.properties
new file mode 100644
index 0000000..a026c17
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage_pt_BR.properties
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tab1=Atributos
+tab2=Atributos derivados
+tab3=Atributos de usu\u00e1rios
+tab4=Atributos derivados de usu\u00e1rios
+required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
+mandatoryCondition=obrigat\u00f3rio
+enumerationValues= Valores enumerados
+enumerationKeys= R\u00f3tulos de enumera\u00e7\u00e3o
+uniqueConstraint=\u00danico
+multivalue=Multivalorado
+multivalueAndUniqueConstr.validation=As op\u00e7\u00f5es 'Multivalorado' e 'Restri\u00e7\u00e3o \u00fanica' n\u00e3o podem serem ambas selecionadas
+type=Tipo
+validatorClass=Classe de Valida\u00e7\u00e3o
+conversionPattern=Padr\u00e3o de Convers\u00e3o
+existing_schemas=Esquemas Existentes\:
+action=A\u00e7\u00e3o
+edit_attribute=Editar Atributo
+title=Esquema
+readonly=Apenas leitura
+secretKey=Chave secreta
+cipherAlgorithm=Algoritmo de criptografia
+mimeType=MIME Type
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
new file mode 100644
index 0000000..a05658f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
@@ -0,0 +1,109 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#info"><span><wicket:message key="policyInfo"/></span></a></li>
+ <li><a href="#specification"><span><wicket:message key="policySpecification"/></span></a></li>
+ <li><a href="#resources"><span><wicket:message key="resources"/></span></a></li>
+ <li><a href="#roles"><span><wicket:message key="roles"/></span></a></li>
+ </ul>
+
+ <div id="info">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_fixedsize">
+ <label for="id"><wicket:message key="id"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_fixedsize">
+ <label for="type"><wicket:message key="type"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="type">[type]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_fixedsize">
+ <label for="description"><wicket:message key="description"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="description">[description]</span>
+ </div>
+ </div>
+
+ <span wicket:id="forAccountOnly"/>
+ </div>
+ </div>
+
+ <wicket:fragment wicket:id="authResourcesFragment">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_fixedsize">
+ <label for="authResources"><wicket:message key="authResources"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="authResources">[resources]</span>
+ </div>
+ </div>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+
+ <div id="specification">
+ <span wicket:id="panel">[password policy panel]</span>
+ </div>
+
+ <div id="resources">
+ <div id="users-contain" class="ui-widget" style="width:inherit;">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="resources"/>
+ </div>
+ </div>
+
+ <div id="roles">
+ <div id="users-contain" class="ui-widget" style="width:inherit;">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="roles"/>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+
+ <div wicket:id="metaEditModalWin">[Show modal window for meta editing (resources, roles)]</div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.properties
new file mode 100644
index 0000000..4e7722f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.properties
@@ -0,0 +1,88 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Policy management
+
+description=Description
+type=Type
+apply=Save
+
+policyInfo=Info
+policySpecification = Specification
+
+#-----------------------------
+# Password policy specification properties
+#-----------------------------
+minLength=Minimum size
+maxLength=Maximum size
+historyLength=History length
+prefixesNotPermitted=Prefixes not permitted
+suffixesNotPermitted=Suffixes not permitted
+wordsNotPermitted=Substrings not permitted
+schemasNotPermitted=Mustn't contain value of the following attributes
+digitRequired=Must contain one or more digits
+nonAlphanumericRequired=Non alphanumeric character required
+alphanumericRequired=Alphanumeric character required
+lowercaseRequired=Lowercase required
+uppercaseRequired=Uppercase required
+mustStartWithDigit=Must start with digit
+mustntStartWithDigit=Mustn't start with digit
+mustEndWithDigit=Must end with digit
+mustntEndWithDigit=Mustn't end with digit
+mustStartWithNonAlpha=Must start with non alphanumeric character
+mustStartWithAlpha=Must start with alphanumeric character
+mustntStartWithNonAlpha=Mustn't start with non alphanumeric character
+mustntStartWithAlpha=Mustn't start with alphanumeric character
+mustEndWithNonAlpha=Must end with non alphanumeric character
+mustEndWithAlpha=Must end with alphanumeric character
+mustntEndWithNonAlpha=Mustn't end with non alphanumeric character
+mustntEndWithAlpha=Mustn't end with alphanumeric character
+allowNullPassword=Password may be not stored internally
+#-----------------------------
+
+#-----------------------------
+# Account policy specification properties
+#-----------------------------
+allUpperCase=All upper case
+allLowerCase=All lower case
+pattern=Pattern (regex)
+propagateSuspension=Propagate suspension
+permittedLoginRetries=Maximum number of subsequent failed logins
+#-----------------------------
+
+#-----------------------------
+# Sync policy specification properties
+#-----------------------------
+uAltSearchSchemas=Alternative attributes for local search (users)
+rAltSearchSchemas=Alternative attributes for local search (roles)
+userJavaRule=Custom user correlation rule
+roleJavaRule=Custom role correlation rule
+conflictResolutionAction= Conflict resolution action
+#-----------------------------
+
+#-----------------------------
+# Policy Type
+#-----------------------------
+ACCOUNT=Account Policy
+GLOBAL_ACCOUNT=Global Account Policy
+PASSWORD=Password Policy
+GLOBAL_PASSWORD=Global Password Policy
+SYNC=Synchronization Policy
+GLOBAL_SYNC=Global Synchronization Policy
+#-----------------------------
+resources=Resources
+roles=Roles
+authResources=Authentication resources
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_it.properties
new file mode 100644
index 0000000..4f8bf93
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_it.properties
@@ -0,0 +1,88 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Gestione Policy
+
+description=Descrizione
+type=Tipo
+apply=Salva
+
+policyInfo=Info
+policySpecification = Specifica
+
+#-----------------------------
+# Password policy specification properties
+#-----------------------------
+minLength=Lunghezza minima
+maxLength=Lunghezza massima
+historyLength=Lunghezza storico
+prefixesNotPermitted=Prefissi non permessi
+suffixesNotPermitted=Suffissi non permessi
+wordsNotPermitted=Sottostringhe non permesse
+schemasNotPermitted=Non deve contenere i valore dei seguenti attributi
+digitRequired=Numero richiesto
+lowercaseRequired=Lettera minuscola richiesta
+uppercaseRequired=Lettera maiuscola richiesta
+mustStartWithDigit=Deve iniziare con un numero
+mustntStartWithDigit=Non deve iniziare con un numero
+mustEndWithDigit=Deve terminare con un numero
+mustntEndWithDigit=Non deve terminare con un numero
+mustStartWithNonAlpha=Deve iniziare con un carattere non alfanumerico
+mustStartWithAlpha=Deve iniziare con un carattere alfanumerico
+mustntStartWithNonAlpha=Non deve iniziare con un carattere non alfanumerico
+mustntStartWithAlpha=Non deve iniziare con un carattere alfanumerico
+mustEndWithNonAlpha=Deve terminare con un carattere non alfanumerico
+mustEndWithAlpha=Deve terminare con un carattere alfanumerico
+mustntEndWithNonAlpha=Non deve terminare con un carattere non alfanumerico
+mustntEndWithAlpha=Non deve terminare con un carattere alfanumerico
+allowNullPassword=La password pu\u00f2 non essere memorizzata internamente
+#-----------------------------
+
+#-----------------------------
+# Account policy specification properties
+#-----------------------------
+allUpperCase=Tutte maiuscole
+allLowerCase=Tutte minuscole
+pattern=Pattern (regex)
+propagateSuspension=Propagare sospensione
+permittedLoginRetries=Numero massimo di login consecutivi falliti
+#-----------------------------
+
+#-----------------------------
+# Sync policy specification properties
+#-----------------------------
+uAltSearchSchemas=Attributi alternativi per ricerca locale (utenti)
+conflictResolutionAction= Azione di risoluzione dei conflitti
+#-----------------------------
+
+#-----------------------------
+# Policy Type
+#-----------------------------
+ACCOUNT=Policy utente
+GLOBAL_ACCOUNT=Policy utente globale
+PASSWORD=Password policy
+GLOBAL_PASSWORD=Password policy globale
+SYNC=Policy di sincronizzazione
+GLOBAL_SYNC=Policy globale di sincronizzazione
+#-----------------------------
+nonAlphanumericRequired=Carattere non alfanumerico richiesto
+alphanumericRequired=Carattere alfanumerico richiesto
+rAltSearchSchemas=Attributi alternativi per ricerca locale (ruoli)
+userJavaRule=Regola di correlazione (utenti)
+roleJavaRule=Regola di correlazione (ruoli)
+resources=Risorse
+roles=Ruoli
+authResources=Risorse di autenticazione
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_pt_BR.properties
new file mode 100644
index 0000000..075756a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage_pt_BR.properties
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Gerenciamento de Pol\u00edtica
+
+description=Descri\u00e7\u00e3o
+type=Tipo
+apply=Salvar
+
+policyInfo=Info
+policySpecification = Especifica\u00e7\u00e3o
+
+#-----------------------------
+# Password policy specification properties
+#-----------------------------
+minLength=Tamanho m\u00ednimo
+maxLength=Tamanho M\u00e1ximo
+historyLength=Tamanho do Hist\u00f3rico
+prefixesNotPermitted=Prefixos n\u00e3o permitidos
+suffixesNotPermitted=sufixos n\u00e3o permitidos
+wordsNotPermitted=Substrings n\u00e3o permitidas
+schemasNotPermitted=N\u00e3o deve conter valores dos seguintes atributos
+digitRequired=Precisa possuir um ou mais d\u00edgitos
+nonAlphanumericRequired=Caractere n\u00e3o alfanum\u00e9rico requerido
+alphanumericRequired=Caractere alfanum\u00e9rico requerido
+lowercaseRequired=Requerido em letra min\u00fascula
+uppercaseRequired=Requerido em letra mai\u00fascula
+mustStartWithDigit=Precisa come\u00e7ar com um d\u00edgito
+mustntStartWithDigit=N\u00e3o deve come\u00e7\u00e3r com um d\u00edgito
+mustEndWithDigit=Precisa terminar com um d\u00edgito
+mustntEndWithDigit=N\u00e3o deve terminar com um d\u00edgito
+mustStartWithNonAlpha=Precisa come\u00e7ar com um caractere n\u00e3o alfanum\u00e9rico
+mustStartWithAlpha=Precisa come\u00e7ar com um caracter alfanum\u00e9rico
+mustntStartWithNonAlpha=N\u00e3o deve come\u00e7ar com um caractere n\u00e3o alfanum\u00e9rico
+mustntStartWithAlpha=N\u00e3o deve come\u00e7ar com um caractere alfanum\u00e9rico
+mustEndWithNonAlpha=Precisa terminar com um caractere n\u00e3o alfanum\u00e9rico
+mustEndWithAlpha=Precisa terminar com um caractere alfanum\u00e9rico
+mustntEndWithNonAlpha=N\u00e3o deve terminar com um caractere n\u00e3o alfanum\u00e9rico
+mustntEndWithAlpha=N\u00e3o precisa terminar com um caracter alfanum\u00e9rico
+allowNullPassword=A senha n\u00e3o pode ser armazenado internamente
+#-----------------------------
+
+#-----------------------------
+# Account policy specification properties
+#-----------------------------
+allUpperCase=Todos em letras mai\u00fasculas
+allLowerCase=todos em letras min\u00fasculas
+pattern=Pattern (regex)
+propagateSuspension=Suspender propaga\u00e7\u00e3o
+permittedLoginRetries=N\u00famero m\u00e1ximo de subsequentes falhas de login
+#-----------------------------
+
+#-----------------------------
+# Sync policy specification properties
+#-----------------------------
+uAltSearchSchemas=Atributos alternativos para busca local (usu\u00e1rios)
+rAltSearchSchemas=Atributos alternativos para busca local (fun\u00e7\u00f5es)
+userJavaRule=Regra customizada de correla\u00e7\u00e3o de usu\u00e1rio
+roleJavaRule=Regra de correla\u00e7\u00e3o de fun\u00e7\u00e3o customizada
+conflictResolutionAction= A\u00e7\u00e3o de resolu\u00e7\u00e3o de conflito
+#-----------------------------
+
+#-----------------------------
+# Policy Type
+#-----------------------------
+ACCOUNT=Pol\u00edtica de Conta
+GLOBAL_ACCOUNT=Pol\u00edtica Global de Conta
+PASSWORD=Plo\u00edtica de Senha
+GLOBAL_PASSWORD=Pol\u00edtica Global de Senha
+SYNC=Pol\u00edtica de Sincroniza\u00e7\u00e3o
+GLOBAL_SYNC=Pol\u00edtica Global de sincroniza\u00e7\u00e3o
+resources=Recursos
+roles=Fun\u00e7\u00f5es
+authResources=Recursos de autentica\u00e7\u00e3o
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
new file mode 100644
index 0000000..b620b89
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
@@ -0,0 +1,73 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <div id="dialog-form">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="accountId"><wicket:message key="accountId"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="accountId">[accountId]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="resource"><wicket:message key="resource"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="resource">[resource]</span>
+ </div>
+ </div>
+ </div>
+ </span>
+ </div>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
+ </span>
+ </div>
+ </div>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.properties
new file mode 100644
index 0000000..1b035f7
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.properties
@@ -0,0 +1,28 @@
+# 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.
+profile=Profile
+executions=Executions
+title=Task
+accountId=Account id
+resource=Resource
+startDate=Start date
+endDate=End date
+status=Status
+message=Message
+taskExecutions=Task executions
+delete=Delete
+showMessage=Show
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_it.properties
new file mode 100644
index 0000000..770680b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_it.properties
@@ -0,0 +1,28 @@
+# 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.
+profile=Profilo
+executions=Esecuzioni
+title=Task
+accountId=Id account
+resource=Risorsa
+startDate=Data di avvio
+endDate=Data di conclusione
+status=Stato
+message=Messaggio
+taskExecutions=Esecuzione del task
+delete=Rimozione
+showMessage=Mostra
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_pt_BR.properties
new file mode 100644
index 0000000..fd54adc
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage_pt_BR.properties
@@ -0,0 +1,28 @@
+# 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.
+profile=Perfil
+executions=Execu\u00E7\u00F5es
+title=Tarefas
+accountId=Identificador de Conta
+resource=Recurso
+startDate=Data Inicial
+endDate=Data final
+status=Estatus
+message=Mensagem
+taskExecutions=Execu\u00E7\u00E3o de Tarefas
+delete=Excluir
+showMessage=Mostrar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
new file mode 100644
index 0000000..8814e69
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
@@ -0,0 +1,228 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+
+ <form wicket:id="form">
+
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#crontab"><span><wicket:message key="crontab"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="description"><wicket:message key="description"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="description">[description]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="resource"><wicket:message key="resourceName"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="resource">[resource]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="lastExec"><wicket:message key="lastExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="lastExec">[lastExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="nextExec"><wicket:message key="nextExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="nextExec">[nextExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="actionsClassNames"><wicket:message key="actionsClasses"/></label>
+ </div>
+ <span wicket:id="syncActionsClassNames">
+ <span wicket:id="actionsClasses">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="actionsClass"/>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button"/></a>
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ <br/>
+ </span>
+ <a wicket:id="first"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ </span>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="performCreate"><wicket:message key="creates"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="performCreate">[performCreate]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="performUpdate"><wicket:message key="updates"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="performUpdate">[performUpdate]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="performDelete"><wicket:message key="deletes"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="performDelete">[performDelete]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="syncStatus"><wicket:message key="syncStatus"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="syncStatus">[syncStatus]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="matchingRule"><wicket:message key="matchingRule"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="matchingRule">[matchingRule]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="unmatchingRule"><wicket:message key="unmatchingRule"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="unmatchingRule">[unmatchingRule]</span>
+ </div>
+ </div>
+ <div id="filters">
+ <span wicket:id="filterContainer">
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="checkUserFilter">[checkUserFilter]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: auto;">
+ <label for="checkUserFilter"><wicket:message key="checkUserFilter"/></label>
+ </div>
+ </div>
+
+ <div id="userFilter" style="border: 1px solid #dddddd; padding-bottom: 2%; padding-top: 2%;">
+ <div id="condition">
+ <span wicket:id="userFilter"/>
+ </div>
+ </div>
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="checkRoleFilter">[checkRoleFilter]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: auto;">
+ <label for="checkRoleFilter"><wicket:message key="checkRoleFilter"/></label>
+ </div>
+ </div>
+ <div id="roleFilter" style="border: 1px solid #dddddd; padding-bottom: 2%; padding-top: 2%;">
+ <div id="condition">
+ <span wicket:id="roleFilter"/>
+ </div>
+ </div>
+ </span>
+ </div>
+ <wicket:child/>
+ </div>
+ </span>
+ </div>
+ </div>
+ <div id="crontab">
+ <span wicket:id="crontab">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <label for="cron"><wicket:message key="cron"/></label>
+ </div>
+ <div class="tablerow">
+ <input type="text" id="seconds" class="text ui-widget-content ui-corner-all" wicket:id="seconds" style="width: 50px;float: left" />
+ <input type="text" id="minutes" class="text ui-widget-content ui-corner-all" wicket:id="minutes" style="width: 50px;float: left" />
+ <input type="text" id="hours" class="text ui-widget-content ui-corner-all" wicket:id="hours" style="width: 50px;float: left" />
+ <input type="text" id="daysOfMonth" class="text ui-widget-content ui-corner-all" wicket:id="daysOfMonth" style="width: 50px;float: left" />
+ <input type="text" id="months" class="text ui-widget-content ui-corner-all" wicket:id="months" style="width: 50px;float: left" />
+ <input type="text" id="daysOfWeek" class="text ui-widget-content ui-corner-all" wicket:id="daysOfWeek" style="width: 50px" />
+ </div>
+ <div class="tablerow alt">
+ <label for="cronExpression"><wicket:message key="templates"/></label>
+ </div>
+ <div class="tablerow">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="cronTemplateChooser" style="width: 250px"/>
+ </div>
+ </div>
+ </span>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
+ </span>
+ </div>
+ </div>
+ <div style="margin: 20px 10px 0">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="apply"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.properties
new file mode 100644
index 0000000..4343e45
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.properties
@@ -0,0 +1,45 @@
+# 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.
+profile=Profile
+crontab=Schedule
+executions=Executions
+title=Task
+resourceName=Resource Name
+name=Name
+description=Description
+lastExec=Last Execution
+nextExec=Next Execution
+cron=Schedule (seconds, minutes, hours, days of month, months, days of week)
+templates=Remove task from scheduler / Use a template to schedule
+apply=Save
+startDate=Start date
+endDate=End date
+status=Status
+message=Message
+delete=Delete
+showMessage=Show
+chooseForTemplate=Use A Template
+creates=Allow create operations
+deletes=Allow delete operations
+updates=Allow update operations
+syncStatus=Allow status synchronization
+fullReconciliation=Full reconciliation
+actionsClasses=Actions classes
+matchingRule=Matching Rule
+unmatchingRule=Unmatching Rule
+checkUserFilter=User Filter
+checkRoleFilter=Role Filter
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_it.properties
new file mode 100644
index 0000000..33134b2
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_it.properties
@@ -0,0 +1,47 @@
+# 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.
+profile=Profilo
+crontab=Schedule
+executions=Esecuzioni
+title=Task
+resourceName=Nome Risorsa
+name=Nome
+description=Descrizione
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+cron=Schedule (secondi, minuti, ore, giorni del mese, mesi, giorni della settimana)
+templates=Rimuovi task dallo scheduler / Utilizza un template per schedulare
+apply=Salva
+startDate=Data di avvio
+endDate=Data di conclusione
+status=Stato
+message=Messaggio
+delete=Rimozione
+showMessage=Mostra
+chooseForTemplate=Usa Un Template
+creates=Consenti operazioni di creazione
+deletes=Consenti operazioni di rimozione
+updates=Consenti operazioni di modifica
+syncStatus=Consenti sincronizzazione di stato
+status=Sincronizza stato utente
+fullReconciliation=Riconciliazione totale
+actionsClasses=Classi azioni
+syncStatus=Sincronizza stato utente
+matchingRule=Regola di corrispondenza
+unmatchingRule=Regola di non corrispondenza
+checkUserFilter=Filtro Utente
+checkRoleFilter=Filtero Ruolo
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_pt_BR.properties
new file mode 100644
index 0000000..8e00512
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage_pt_BR.properties
@@ -0,0 +1,45 @@
+# 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.
+profile=Perfil
+crontab=Agenda
+executions=Execu\u00e7\u00f5es
+title=Tarefas
+resourceName=Nome de Recursos
+name=Nome
+description=Descri\u00e7\u00e3o
+lastExec=\u00daltima Execu\u00e7\u00e3o
+nextExec=Pr\u00f3xima Execu\u00e7\u00e3o
+cron=Agenda (segundos, minutos, horas, dias do m\u00eas, meses, dias da semana)
+templates=Remover tarefa agendada / usar template para agendar
+apply=Salvar
+startDate=Data de In\u00edcio
+endDate=Data Final
+status=Estatus
+message=Mensagem
+delete=Excluir
+showMessage=Mostrar
+chooseForTemplate=Usar um template
+creates=Permitir opera\u00e7\u00f5es de cria\u00e7\u00e3o
+deletes=Permitir opera\u00e7\u00f5es de remo\u00e7\u00e3o
+updates=Permitir a edi\u00e7\u00e3o
+syncStatus=Permitir a sincroniza\u00e7\u00e3o de status
+fullReconciliation=Reconcilia\u00e7\u00e3o completa
+actionsClasses=Classes de a\u00e7\u00f5es
+matchingRule=Regra de correspond\u00eancia
+unmatchingRule=Regra de non correspond\u00eancia
+checkUserFilter=Filtro Usu\u00e1rio
+checkRoleFilter=Filtro Papel
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RecursivePanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RecursivePanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RecursivePanel.html
new file mode 100644
index 0000000..63cb904
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RecursivePanel.html
@@ -0,0 +1,28 @@
+<!--
+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.
+-->
+<wicket:panel>
+ <ul>
+ <span wicket:id="rows">
+ <li wicket:id="row">
+ <span wicket:id="label">[The label]</span>
+ </li>
+ <span wicket:id="nested"/>
+ </span>
+ </ul>
+</wicket:panel>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.html
new file mode 100644
index 0000000..aa9cd0b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.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.
+-->
+<wicket:extend>
+ <div id="dialog">
+ <wicket:message key="downloadAs"/> <span wicket:id="format" class="small_dynamicsize">[format]</span>
+ </div>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.properties
new file mode 100644
index 0000000..22b990a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.properties
@@ -0,0 +1,18 @@
+# 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.
+downloadAs=Download as
+download=Download
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_it.properties
new file mode 100644
index 0000000..7841efe
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_it.properties
@@ -0,0 +1,18 @@
+# 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.
+downloadAs=Scarica come
+download=Scarica
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_pt_BR.properties
new file mode 100644
index 0000000..ba57357
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage_pt_BR.properties
@@ -0,0 +1,18 @@
+# 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.
+downloadAs=Salvar como
+download=Salvar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
new file mode 100644
index 0000000..8886b3f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
@@ -0,0 +1,146 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#crontab"><span><wicket:message key="crontab"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="nameLabel">[Name]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="lastExec"><wicket:message key="lastExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="lastExec">[lastExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="nextExec"><wicket:message key="nextExec"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="nextExec">[nextExec]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="reportlets"><wicket:message key="reportlets"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <div style="display: inline-table;">
+ <div id="selections" style="display: table-cell;">
+ <select wicket:id="reportletConfs" class="selectionSelect"></select>
+ </div>
+ <div id="orderingButtons" style="display: table-cell; width: 30px; vertical-align: middle; padding-left: 5px;">
+ <div style="padding-bottom: 5px;">
+ <a wicket:id="upButton"><img src="img/up-icon.png" alt="move up icon"/></a>
+ </div>
+ <div style="padding-top: 5px;">
+ <a wicket:id="downButton"><img src="img/down-icon.png" alt="move down icon"/></a>
+ </div>
+ </div>
+ </div>
+ <div id="actionButtons" style="padding-top: 5px;">
+ <div style="padding-left: 35px;float: left;">
+ <a wicket:id="addButton"><img src="img/plus-icon.png" alt="plus icon"/></a>
+ </div>
+ <div style="padding-left: 15px;float: left;">
+ <a wicket:id="editButton"><img src="img/actions/edit.png" alt="edit icon"/></a>
+ </div>
+ <div style="padding-left: 15px;float: left;">
+ <a wicket:id="removeButton"><img src="img/minus-icon.png" alt="minus icon"/></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </span>
+ </div>
+ </div>
+ <div id="crontab">
+ <span wicket:id="crontab">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <label for="cron"><wicket:message key="cron"/></label>
+ </div>
+ <div class="tablerow">
+ <input type="text" id="seconds" class="text ui-widget-content ui-corner-all" wicket:id="seconds" style="width: 50px;float: left" />
+ <input type="text" id="minutes" class="text ui-widget-content ui-corner-all" wicket:id="minutes" style="width: 50px;float: left" />
+ <input type="text" id="hours" class="text ui-widget-content ui-corner-all" wicket:id="hours" style="width: 50px;float: left" />
+ <input type="text" id="daysOfMonth" class="text ui-widget-content ui-corner-all" wicket:id="daysOfMonth" style="width: 50px;float: left" />
+ <input type="text" id="months" class="text ui-widget-content ui-corner-all" wicket:id="months" style="width: 50px;float: left" />
+ <input type="text" id="daysOfWeek" class="text ui-widget-content ui-corner-all" wicket:id="daysOfWeek" style="width: 50px" />
+ </div>
+ <div class="tablerow alt">
+ <label for="cronExpression"><wicket:message key="templates"/></label>
+ </div>
+ <div class="tablerow">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="cronTemplateChooser" style="width: 250px"/>
+ </div>
+ </div>
+ </span>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
+ </span>
+ </div>
+ </div>
+ <div style="margin: 20px 10px 0">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="apply"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ <div wicket:id="reportletConfWin"/>
+ <div wicket:id="reportExecMessageWin"/>
+ <div wicket:id="reportExecExportWin"/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.properties
new file mode 100644
index 0000000..115fc49
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.properties
@@ -0,0 +1,36 @@
+# 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.
+profile=Profile
+crontab=Schedule
+executions=Executions
+title=Report
+lastExec=Last Execution
+nextExec=Next Execution
+cron=Schedule (seconds, minutes, hours, days of month, months, days of week)
+templates=Remove task from scheduler / Use a template to schedule
+apply=Save
+startDate=Start date
+endDate=End date
+status=Status
+message=Message
+taskExecutions=Task executions
+delete=Delete
+showMessage=Show
+chooseForTemplate=Use A Template
+reportlets=Reportlets
+create_reportletconf=Add new Reporlet
+selectItem=Please select an item first
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_it.properties
new file mode 100644
index 0000000..fa600f6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_it.properties
@@ -0,0 +1,36 @@
+# 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.
+profile=Profilo
+crontab=Schedule
+executions=Esecuzioni
+title=Rapporto
+lastExec=Ultima Esecuzione
+nextExec=Prossima Esecuzione
+cron=Schedule (secondi, minuti, ore, giorni del mese, mesi, giorni della settimana)
+templates=Rimuovi task dallo scheduler / Utilizza un template per schedulare
+apply=Salva
+startDate=Data di avvio
+endDate=Data di conclusione
+status=Stato
+message=Messaggio
+taskExecutions=Esecuzione del task
+delete=Rimozione
+showMessage=Mostra
+chooseForTemplate=Usa Un Template
+reportlets=Reportlets
+create_reportletconf=Aggiungi Reporlet
+selectItem=Seleziona un elemento
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_pt_BR.properties
new file mode 100644
index 0000000..da48be6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage_pt_BR.properties
@@ -0,0 +1,36 @@
+# 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.
+profile=Perfil
+crontab=Agendamento
+executions=Execu\u00E7\u00F5es
+title=Relat\u00F3rios
+lastExec=\u00DAlitima Execu\u00E7\u00E3o
+nextExec=Pr\u00F3xima Execu\u00E7\u00E3o
+cron=Agendar (segundos, minutos, horar, dias do m\u00EAs, meses, dias da semana)
+templates=Remover tarefa da agenda / Use um template para agendar
+apply=Salvar
+startDate=Data de in\u00EDcio
+endDate=Data Final
+status=Estatus
+message=Mensagem
+taskExecutions=Execu\u00E7\u00E3o de Tarefas
+delete=Remover
+showMessage=Mostar
+chooseForTemplate=Usar um Template
+reportlets=Reportlets
+create_reportletconf=Adicionar novo Reporlet
+selectItem=Por favor selecionar um item primeiro
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.html
new file mode 100644
index 0000000..bc8a1f9
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.html
@@ -0,0 +1,85 @@
+<!--
+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 style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#general"><span><wicket:message key="general"/></span></a></li>
+ <li><a href="#configuration"><span><wicket:message key="configuration"/></span></a></li>
+ </ul>
+ <div id="general">
+ <div id="formtable">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field short_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="reportletClass"><wicket:message key="reportletClass"/></label>
+ </div>
+ <div class="tablecolumn_field">
+ <span wicket:id="reportletClass" style="width: 100%;">[reportletClass]</span>
+ </div>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ $(function() {
+ $('#general #formtable div.tablerow:even').addClass("alt");
+ });
+ </script>
+ </div>
+ <div id="configuration">
+ <div id="formtable">
+ <span wicket:id="container">
+ <div class="tablerow" wicket:id="propView">
+ <div class="tablecolumn_label short_fixedsize">
+ <span wicket:id="key">[key]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="value">[value]</span>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ $(function() {
+ $('#configuration #formtable div.tablerow:even').addClass("alt");
+ });
+ </script>
+ </span>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="apply"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.properties
new file mode 100644
index 0000000..52ca027
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Reportlet
+general=General
+configuration=Configuration
+apply=Save
+name=Name
+reportletClass=Reportlet class
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_it.properties
new file mode 100644
index 0000000..9245554
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_it.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Reportlet
+general=Generale
+configuration=Configurazione
+apply=Salva
+name=Nome
+reportletClass=Classe Reportlet
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_pt_BR.properties
new file mode 100644
index 0000000..dc7e422
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportletConfModalPage_pt_BR.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Reportlet
+general=Geral
+configuration=Configura\u00E7\u00E3o
+apply=Salvar
+name=Nome
+reportletClass=Classe Reportlet
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.html
new file mode 100644
index 0000000..456f7a3
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Reports.html
@@ -0,0 +1,58 @@
+<!--
+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 id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#tabs-1"><span><wicket:message key="reports"/></span></a></li>
+ <li><a href="#tabs-2"><span><wicket:message key="audit"/></span></a></li>
+ </ul>
+
+ <div id="tabs-1">
+ <div id="users-contain" class="ui-widget" style="width:inherit;">
+ <span wicket:id="reportContainer">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="reportTable"/>
+ </span>
+ <span style="float:right">
+ <form wicket:id="paginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="reportWin">[Show modal window for report editing]</div>
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="createLink">
+ <wicket:message key="create"/>
+ </a>
+
+ </div>
+
+ <div id="tabs-2">
+ <span wicket:id="auditContainer">
+ <form wicket:id="auditForm">
+ <span wicket:id="events">[event builder]</span>
+ </form>
+ </span>
+ </div>
+ </div>
+
+ </wicket:extend>
+</html>
[23/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
new file mode 100644
index 0000000..49595e1
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
@@ -0,0 +1,64 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="expression"><wicket:message key="expression"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="expression">[expression]</span>
+ <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
+ <img src="img/help.png"/>
+ <span wicket:id="jexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+ </div>
+ <div style="margin: 10px 0px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.properties
new file mode 100644
index 0000000..e39980a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.properties
@@ -0,0 +1,22 @@
+# 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.
+required_alert=All form fields are required.
+expression=Expression
+existing_schemas=Existing Schemas:
+edit_attribute=Edit attribute
+attributes=Derived attributes
+title=Derived Schema
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_it.properties
new file mode 100644
index 0000000..425e118
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_it.properties
@@ -0,0 +1,22 @@
+# 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.
+required_alert=Tutti i campi sono richiesti.
+expression=Expression
+existing_schemas=Schemi presenti:
+edit_attribute=Modifica attributo
+attributes=Attributi derivati
+title=Schema Derivato
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_pt_BR.properties
new file mode 100644
index 0000000..df3aff8
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+required_alert=Todos os campos do formaul\u00e1rio s\u00e3o obrigat\u00f3rios
+expression=Express\u00e3o
+existing_schemas=Esquemas Existentes\:
+edit_attribute=Alterar Atributo
+attributes=Atributos Derivados
+title=Esquema Derivado
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
new file mode 100644
index 0000000..9d9d233
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
@@ -0,0 +1,132 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ div.group{
+ width:450px;
+ }
+
+ div.group div{
+ width:150;
+ height: 25px;
+ float:left;
+ }
+
+ div.group div input {
+ width: 30px;
+ }
+
+ div#attributes-view {
+ display: block;
+ clear: both;
+ float: none;
+ overflow: auto;
+ margin-top: 0px;
+ margin-bottom: 20px;
+ margin-left: 10px;
+ margin-right: 10px;
+ }
+
+ .submit{
+ display: block;
+ clear: both;
+ float: none;
+ margin-left: 10px;
+ }
+
+ span.grouplabel{
+ display:block;
+ clear: both;
+ margin-left: 10px;
+ margin-bottom: 10px;
+ font-weight: bold;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+ <form wicket:id="form">
+ <div id="attributes-view">
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <wicket:message key="title"/>
+ </p>
+
+ <span class="grouplabel"><wicket:message key="schemas"/></span>
+ <span wicket:id="dCheckGroup">
+ <div class="group">
+ <div wicket:id="details">
+ <input type="checkbox" wicket:id="dcheck"/>
+ <span wicket:id="dname">[schema name]</span>
+ </div>
+ </div>
+ </span>
+
+ <span wicket:id="schemas">[schemas]</span>
+
+ <span wicket:id="dschemas">[derived schemas]</span>
+
+ <span wicket:id="vschemas">[virtual schemas]</span>
+
+ </div>
+
+ <wicket:fragment wicket:id="sfragment">
+ <span wicket:id="sCheckGroup">
+ <div class="group">
+ <div wicket:id="schemas">
+ <input type="checkbox" wicket:id="scheck"/>
+ <span wicket:id="sname">[schema name]</span>
+ </div>
+ </div>
+ </span>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="dsfragment">
+ <span class="grouplabel"><wicket:message key="derSchemas"/></span>
+ <span wicket:id="dsCheckGroup">
+ <div class="group">
+ <div wicket:id="derSchemas">
+ <input type="checkbox" wicket:id="dscheck"/>
+ <span wicket:id="dsname">[schema name]</span>
+ </div>
+ </div>
+ </span>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="vsfragment">
+ <span class="grouplabel"><wicket:message key="virSchemas"/></span>
+ <span wicket:id="vsCheckGroup">
+ <div class="group">
+ <div wicket:id="virSchemas">
+ <input type="checkbox" wicket:id="vscheck"/>
+ <span wicket:id="vsname">[schema name]</span>
+ </div>
+ </div>
+ </span>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+
+ <div class="submit">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="submit"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
new file mode 100644
index 0000000..4f64bcf
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Change display attributes
+tooManySelections=Too many columns to be shown
+schemas=User attributes
+derSchemas=User derived attributes
+virSchemas=User virtual attributes
+
+firstname=Firstname
+surname=Surname
+userId=User Id
+edit=Edit
+delete=Delete
+status=Status
+token=Token
+username=Username
+creationDate=Creation Date
+tokenValued=Valued
+tokenNotValued=Not valued
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
new file mode 100644
index 0000000..60f818f
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Scegli attributi da visualizzare
+tooManySelections=Troppe colonne da visualizzare
+schemas=Attributi utente
+derSchemas=Attributi derivati utente
+virSchemas=Attributi virtuali utente
+
+firstname=Nome
+surname=Cognome
+userId=User Id
+edit=Edit
+delete=Rimuovi
+status=Stato
+token=Token
+username=Username
+creationDate=Data Creazione
+tokenValued=Valorizzato
+tokenNotValued=Non valorizzato
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
new file mode 100644
index 0000000..7c7fa7b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Alterar atributos mostrados
+tooManySelections=Muitas colunas para exibir
+schemas=Atributo de Usu\u00E1rios
+derSchemas=Atributos Derivados de Usu\u00E1rios
+virSchemas=Atributos virtuais de Usu\u00E1rios
+
+firstname=Nome
+surname=Sobrenome
+userId=Identificador de Usu\u00E1rio
+edit=Alterar
+delete=Excluir
+status=Estatus
+token=Token
+username=Nome do Usu\u00E1rio
+creationDate=Data de Cria\u00E7\u00E3o
+tokenValued=Valorado
+tokenNotValued=N\u00E3o Valorado
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
new file mode 100644
index 0000000..c1c7407
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+<wicket:head>
+ <style type="text/css">
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
+ background:url("../../css/images/ui-bg_glass_95_fef1ec_1x400.png") repeat-x scroll 50% 50% #FEF1EC;
+ border:1px solid #CD0A0A;
+ color:#CD0A0A;
+ width: 400px;
+ padding: 0px;
+ margin-top: 200px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ body {
+ background: url("../../css/images/ui-bg_diagonals-thick_20_666666_40x40.png")
+ repeat scroll 50% 50% #666666;
+ }
+ </style>
+</wicket:head>
+<wicket:extend>
+
+ <div class="ui-widget">
+ <div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all">
+ <p><span style="float: left; margin-right: 0.3em;"
+ class="ui-icon ui-icon-alert"></span>
+ <strong><span wicket:id="errorTitle"/></strong>
+ <div><span wicket:id="errorMessage"/></div>
+ <p>
+ <a href="" wicket:id="home">
+ <wicket:message key="home"/>
+ </a>
+ </p>
+ </p>
+ </div>
+ </div>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ExecMessageModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ExecMessageModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ExecMessageModalPage.html
new file mode 100644
index 0000000..bf00ee4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ExecMessageModalPage.html
@@ -0,0 +1,25 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <div id="dialog">
+ <pre wicket:id="message">
+ [Task execution's message to show]
+ </pre>
+ </div>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/FailureMessageModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/FailureMessageModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/FailureMessageModalPage.html
new file mode 100644
index 0000000..db7c53d
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/FailureMessageModalPage.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<style>
+ .w_content_3 {
+ padding: 0;
+ color: #333333;
+ font-family: Verdana,Tahoma,sans-serif;
+ font-size: 62.5%;
+ }
+</style>
+<wicket:extend>
+ <div class="w_content_3">
+ <div>
+ <div style="margin: 1em">
+ <pre wicket:id="failureMessage"></pre>
+ </div>
+ </div>
+ </div>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/HomePage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/HomePage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/HomePage.html
new file mode 100644
index 0000000..2849c44
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/HomePage.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+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">
+
+ <body>
+
+ <wicket:extend>
+
+ <div>
+ <b>Syncope</b> Home-Page!
+ </div>
+
+ </wicket:extend>
+
+ </body>
+
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.html
new file mode 100644
index 0000000..1124735
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <div id="versionMP">
+ <div style="text-align: center;">
+ <a wicket:id="syncopeLink" target="_blank">
+ <img id="logo" src="img/logo.png" alt="syncope" title="syncope"/>
+ </a>
+ <div style="color: white;font-weight: bold;">Version: <span wicket:id="version"/></div>
+ </div>
+ <br/>
+ <div>
+Licensed 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
+ </div>
+ <a wicket:id="licenseLink" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a>
+ <div>
+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.
+ </div>
+ </div>
+</wicket:extend>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.properties
new file mode 100644
index 0000000..5f0020a
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+info=Information
+syncopeSite=Apache Syncope Site
+version=Version
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_it.properties
new file mode 100644
index 0000000..5a2beea
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_it.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+info=Informazioni
+syncopeSite=Sito di Apache Syncope
+version=Versione
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_pt_BR.properties
new file mode 100644
index 0000000..abd4055
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/InfoModalPage_pt_BR.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+info=Informa\u00E7\u00E3o
+syncopeSite=Site do Apache Syncope
+version=Vers\u00E3o
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
new file mode 100644
index 0000000..097f2e6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+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">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="Content-Style-Type" content="text/css"/>
+
+ <title>Apache Syncope - Login</title>
+
+ <link rel="shortcut icon" href="img/favicon.ico"/>
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="all"/>
+
+ <script type="text/javascript">
+
+ var notificationShownTimes = 0;
+
+ function showNotification(componentId, messagecount) {
+ notificationShownTimes++;
+ timeout = 1700 + (messagecount * 500) + notificationShownTimes * 200;
+ $('div#' + componentId).fadeTo('normal', 1.0);
+ setTimeout("$('div#" + componentId + "').fadeOut('normal')", timeout);
+ }
+ </script>
+
+ </head>
+ <body style="text-align:center">
+ <div id="splash">
+ <img src="img/logo.png" alt="syncope" title="syncope" id="logo" />
+ <p style="border: none"> </p>
+ <div id="loginFeedbackDiv">
+ <div wicket:id="feedback">feedbackmessages will be put here</div>
+ </div>
+ <form wicket:id="login">
+ <label for="userId">
+ <wicket:message key="userId"/>
+ </label>
+ <input type="text" wicket:id="userId" id="userId" size="25" style="width: 180px" />
+ <br />
+ <label for="password" class="password">
+ <wicket:message key="password"/>
+ </label>
+ <input type="password" wicket:id="password" id="password" size="25" style="width: 180px" />
+ <br />
+ <select wicket:id="language" id="language"/>
+ <br />
+ <br />
+ <input type="submit" wicket:id="submit"/>
+ </form>
+
+ <div style="display: inline-table; margin: 10px; width:380px;">
+ <div style="display: inline-table-cell; text-align: left; float: left;" wicket:id="selfRegistration"/>
+ <div style="display: inline-table-cell; text-align: left; float: right;" wicket:id="passwordReset"/>
+ </div>
+
+ <wicket:fragment wicket:id="selfRegNotAllowed"/>
+ <wicket:fragment wicket:id="selfRegAllowed">
+ <span wicket:id="selfRegistration"/>
+ </wicket:fragment>
+
+ <div wicket:id="selfRegModal"></div>
+
+ <wicket:fragment wicket:id="pwdResetNotAllowed"/>
+ <wicket:fragment wicket:id="pwdResetAllowed">
+ <span wicket:id="passwordReset"/>
+ </wicket:fragment>
+
+ <div wicket:id="pwdResetReqModal"></div>
+ <div wicket:id="pwdResetConfModal"></div>
+ </div>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.properties
new file mode 100644
index 0000000..9b31e6e
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.properties
@@ -0,0 +1,22 @@
+# 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.
+userId=Username
+password=Password
+submit=Login
+login-error=Wrong username and/or password
+selfRegistration=Self registration
+passwordReset=Password reset
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_it.properties
new file mode 100644
index 0000000..40f8c34
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_it.properties
@@ -0,0 +1,22 @@
+# 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.
+userId=Username
+password=Password
+submit=Login
+login-error=Username e/o password errati
+selfRegistration=Registrati
+passwordReset=Password smarrita
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_pt_BR.properties
new file mode 100644
index 0000000..fd312c4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login_pt_BR.properties
@@ -0,0 +1,22 @@
+# 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.
+userId=Usu\u00e1rio
+password=Senha
+submit=Login
+login-error=Usu\u00e1rio ou senha incorretos
+selfRegistration=Registrar-se
+passwordReset=Redefini\u00e7\u00e3o de senha
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
new file mode 100644
index 0000000..9af223b
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
@@ -0,0 +1,55 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="MembershipForm">
+ <div id="tabs">
+ <ul>
+ <li><a href="#tabs-1"><span><wicket:message key="tab1"/></span></a></li>
+ <li><a href="#tabs-2"><span><wicket:message key="tab2"/></span></a></li>
+ <li><a href="#tabs-3"><span><wicket:message key="tab3"/></span></a></li>
+ </ul>
+ <div id="tabs-1">
+ <div id="formtable">
+ <span wicket:id="attrs">[membership attributes]</span>
+ <span wicket:id="systeminformation">[System Information]</span>
+ </div>
+
+ <script type="text/javascript">
+ $(function() {
+ $('#formtable div.tablerow:even').addClass("alt");
+ });
+ </script>
+ </div>
+ <div id="tabs-2">
+ <span wicket:id="derAttrs">[membership derived attributes]</span>
+ </div>
+
+ <div id="tabs-3">
+ <span wicket:id="virAttrs">[membership virtual attributes]</span>
+ </div>
+ </div>
+ <div style="margin: 20px 10px 0">
+ <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="submit"/>
+ <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
+ </div>
+ </form>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
new file mode 100644
index 0000000..d767290
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
@@ -0,0 +1,35 @@
+# 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.
+tab1=Attributes
+tab2=Derived attributes
+tab3=Virtual attributes
+title=Roles
+add=+
+drop=-
+edit=Edit
+delete=Delete
+derAttrs=Derived Attributes
+derAttrToRemove=Delete
+derAttrName=Name
+derAttrValue=Derived value
+
+virAttrs=Virtual Attributes
+virAttrToRemove=Delete
+virAttrName=Name
+virAttrValue=Virtual value
+
+addAttributeBtn=Add
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
new file mode 100644
index 0000000..f442cf4
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
@@ -0,0 +1,35 @@
+# 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.
+tab1=Attributi
+tab2=Attributi derivati
+tab3=Attributi virtuali
+title=Ruoli
+add=+
+drop=-
+edit=Edit
+delete=Rimuovi
+derAttrs=Attributi derivati
+derAttrToRemove=Elimina
+derAttrName=Nome
+derAttrValue=Valore derivato
+
+virAttrs=Attributi virtuali
+virAttrToRemove=Elimina
+virAttrName=Nome
+virAttrValue=Valore virtuale
+
+addAttributeBtn=Aggiungi
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
new file mode 100644
index 0000000..66d9cc5
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
@@ -0,0 +1,35 @@
+# 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.
+tab1=Atributos
+tab2=Atributos Derivados
+tab3=Atributos Virtuais
+title=Fun\u00e7\u00f5es
+add=+
+drop=-
+edit=Alterar
+delete=Excluir
+derAttrs=Atributos Derivados
+derAttrToRemove=Excluir
+derAttrName=Nome
+derAttrValue=Valor Derivado
+
+virAttrs=Atributos Virtuais
+virAttrToRemove=Excluir
+virAttrName=Nome
+virAttrValue=Valor Virtual
+
+addAttributeBtn=Adicionar
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.html
new file mode 100644
index 0000000..2ee6802
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.html
@@ -0,0 +1,234 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style>
+ div#tabs div#events{
+ min-width: 970px;
+ overflow: hidden;
+ }
+
+ div#userFilter {
+ border: 1px solid #DDDDDD;
+ }
+
+ div#userFilter div#title {
+ margin: 10px 0px 0px 8px;
+ }
+
+ div#userFilter div#warning {
+ margin: 1px 0px 5px 8px;
+ }
+
+ div#userFilter div#title label {
+ font-weight: bold;
+ }
+
+ div#userFilter div#warning label {
+ color: #E00000;
+ font-size: 8px;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+ <div style="margin: 5px;">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#notification"><span><wicket:message key="notification"/></span></a></li>
+ <li><a href="#events"><span><wicket:message key="events"/></span></a></li>
+ <li><a href="#about"><span><wicket:message key="about"/></span></a></li>
+ <li><a href="#recipients"><span><wicket:message key="recipients"/></span></a></li>
+ </ul>
+
+ <div id="notification">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="sender"><wicket:message key="sender"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="sender">[sender]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="subject"><wicket:message key="subject"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="subject">[subject]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="recipientAttrType"><wicket:message key="recipientAttrType"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="recipientAttrType">[recipientAttrType]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="recipientAttrName"><wicket:message key="recipientAttrName"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="recipientAttrName">[recipientAttrName]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="template"><wicket:message key="template"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="template">[template]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="traceLevel"><wicket:message key="traceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="traceLevel">[traceLevel]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_fixedsize">
+ <label for="isActive"><wicket:message key="isActive"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="isActive">[isActive]</span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div id="events">
+ <span wicket:id="eventSelection"/>
+ </div>
+
+ <div id="about">
+ <span wicket:id="aboutContainer">
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="checkAbout">[checkAbout]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: 100%">
+ <label for="checkAbout"><wicket:message key="checkAbout"/></label>
+ </div>
+ </div>
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="checkUserAbout">[checkUserAbout]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: auto;">
+ <label for="checkUserAbout"><wicket:message key="checkUserAbout"/></label>
+ </div>
+ </div>
+ <div id="userFilter">
+ <div id="title">
+ <label for="userFilter"><wicket:message key="userFilter"/></label>
+ </div>
+ <div id="warning">
+ <label for="userFilter"><wicket:message key="userFilterWarning"/></label>
+ </div>
+ <div id="condition">
+ <span wicket:id="userAbout"/>
+ </div>
+ </div>
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="checkRoleAbout">[checkRoleAbout]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: auto;">
+ <label for="checkRoleAbout"><wicket:message key="checkRoleAbout"/></label>
+ </div>
+ </div>
+ <div id="userFilter">
+ <div id="title">
+ <label for="roleFilter"><wicket:message key="roleFilter"/></label>
+ </div>
+ <div id="warning">
+ <label for="roleFilter"><wicket:message key="roleFilterWarning"/></label>
+ </div>
+ <div id="condition">
+ <span wicket:id="roleAbout"/>
+ </div>
+ </div>
+ </span>
+ </div>
+
+ <div id="recipients">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label medium_dynamicsize">
+ <span wicket:id="checkStaticRecipients">[checkStaticRecipients]</span>
+ <label for="recipients"><wicket:message key="recipients"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="staticRecipients">[staticRecipients]</span>
+ </div>
+ </div>
+
+ <span wicket:id="recipientsContainer">
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="checkRecipients">[checkRecipients]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: auto;">
+ <label for="checkRecipients"><wicket:message key="checkRecipients"/></label>
+ </div>
+ </div>
+ <span wicket:id="recipients"/>
+ </span>
+ <div id="userFilter">
+ <div id="title">
+ <label for="userNotifications"><wicket:message key="userNotifications"/></label>
+ </div>
+ <div id="warning">
+ <label for="userNotificationsWarning"><wicket:message key="userNotificationsWarning"/></label>
+ </div>
+ <div class="tablerow" style="width: auto;">
+ <div class="tablecolumn_field" style="width: auto; padding-right: 5px;">
+ <span wicket:id="selfAsRecipient">[selfAsRecipient]</span>
+ </div>
+ <div class="tablecolumn_label" style="width: auto;">
+ <label for="selfAsRecipient"><wicket:message key="selfAsRecipient"/></label>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 20px 10px 0">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.properties
new file mode 100644
index 0000000..f36d754
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage.properties
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Edit notification
+submit=Save
+subject=Subject
+sender=Sender
+template=Template
+traceLevel=Trace level
+notification=Notification
+about=About
+events=Events
+recipients=Recipients
+selfAsRecipient=Include users matching About
+recipientAttrType=Recipients e-mail attribute type
+recipientAttrName=Recipients e-mail attribute schema
+checkRecipients=Search recipients
+checkAbout=All
+userFilter=User filter
+userFilterWarning=Do not use this filter unless events are not targeted at users
+userNotifications=User notifications
+userNotificationsWarning=Do not select this checkbox unless events are not targeted at users
+roleFilter=Role filter
+roleFilterWarning=Do not use this filter unless events are not targeted at roles
+isActive=Enabled
+checkUserAbout=Users
+checkRoleAbout=Roles
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_it.properties
new file mode 100644
index 0000000..6d3b2b6
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_it.properties
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Gestisci notifiche
+submit=Salva
+subject=Oggetto
+sender=Mittente
+template=Modello
+traceLevel=Livello di tracciamento
+notification=Notifica
+about=Soggetti
+events=Eventi
+recipients=Destinatari
+selfAsRecipient=Includi i soggetti
+recipientAttrType=Tipo attributo e-mail destinatari
+recipientAttrName=Schema attributo e-mail destinatari
+checkRecipients=Cerca i destinatari
+checkAbout=Tutto
+userFilter=Filtro utenti
+userFilterWarning=Non usare questo filtro se gli eventi catturati non riguardano espressamente utenti
+userNotifications=Notifiche utente
+userNotificationsWarning=Non selezionare questa checkbox se gli eventi catturati non riguardano espressamente utenti
+roleFilter=Filtro ruoli
+roleFilterWarning=Non usare questo filtro se gli eventi catturati non riguardano espressamente i ruoli
+isActive=Abilitata
+checkUserAbout=Utenti
+checkRoleAbout=Ruoli
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_pt_BR.properties
new file mode 100644
index 0000000..08879cb
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationModalPage_pt_BR.properties
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+title=Alterar Notifica\u00e7\u00e3o
+submit=Salvar
+subject=Assunto
+sender=Remetente
+template=Template
+traceLevel=N\u00edvel de Trace
+notification=Notifica\u00e7\u00e3o
+about=Sobre
+events=Eventos
+recipients=Destinat\u00e1rios
+selfAsRecipient=Incluir usu\u00e1rios relacionados Sobre
+recipientAttrType=Tipo de atributo de destinat\u00e1rio de email.
+recipientAttrName=Destinat\u00e1rios de e-mail para atributos de esquema
+checkRecipients=Buscar Destinat\u00e1rios
+checkAbout=Todos
+userFilter=User filter
+userFilterWarning=N\u00e3o use este filtro n\u00e3o ser que os eventos n\u00e3o s\u00e3o direcionados a usu\u00e1rios
+userNotifications=Notifica\u00e7\u00f5es do usu\u00e1rio
+userNotificationsWarning=N\u00e3o selecione esta op\u00e7\u00e3o a menos que os eventos n\u00e3o s\u00e3o direcionados a usu\u00e1rios
+roleNotifications=Notifica\u00e7\u00f5es do fun\u00e7\u00f5es
+roleNotificationsWarning=N\u00e3o selecione esta op\u00e7\u00e3o a menos que os eventos n\u00e3o s\u00e3o direcionados a fun\u00e7\u00f5es
+isActive=Ativada
+checkUserAbout=Usu\u00e1rio
+checkRoleAbout=Fun\u00e7\u00e3o
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
new file mode 100644
index 0000000..116ccca
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
@@ -0,0 +1,109 @@
+<!--
+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.
+-->
+<wicket:extend>
+ <div id="dialog-form">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="id">[id]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="sender"><wicket:message key="sender"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="sender">[sender]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="recipients"><wicket:message key="recipients"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="recipients">[recipients]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="subject"><wicket:message key="subject"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="subject">[subject]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="textBody"><wicket:message key="textBody"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <textarea wicket:id="textBody" cols="40" rows="10">[textBody]</textarea>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="htmlBody"><wicket:message key="htmlBody"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <textarea wicket:id="htmlBody" cols="40" rows="10">[textBody]</textarea>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="traceLevel"><wicket:message key="traceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="traceLevel">[traceLevel]</span>
+ </div>
+ </div>
+ </div>
+ </span>
+ </div>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
+ </span>
+ </div>
+ </div>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+</wicket:extend>
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.properties
new file mode 100644
index 0000000..e9a3120
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.properties
@@ -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.
+profile=Profile
+executions=Executions
+title=Title
+startDate=Start date
+endDate=End date
+status=Status
+message=Message
+taskExecutions=Task executions
+delete=Delete
+showMessage=Show message
+sender=Sender
+subject=Subject
+recipients=Recipients
+traceLevel=Trace level
+htmlBody=E-mail body (HTML)
+textBody=E-mail body (TEXT)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_it.properties
new file mode 100644
index 0000000..c0fa5bd
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_it.properties
@@ -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.
+profile=Profilo
+executions=Esecuzioni
+title=Task
+startDate=Data di avvio
+endDate=Data di conclusione
+status=Stato
+message=Messaggio
+taskExecutions=Esecuzione del task
+delete=Rimozione
+showMessage=Mostra
+sender=Mittente
+subject=Oggetto
+recipients=Destinatari
+traceLevel=Livello di tracciamento
+htmlBody=Corpo e-mail (HTML)
+textBody=Corpo e-mail (testo)
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_pt_BR.properties
new file mode 100644
index 0000000..91aa59d
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage_pt_BR.properties
@@ -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.
+profile=Perfil
+executions=Execu\u00E7\u00F5es
+title=T\u00EDtulo
+startDate=Data Inicial
+endDate=Data Final
+status=Estatus
+message=Mensagem
+taskExecutions=Execu\u00E7\u00E3o de Tarefas
+delete=Excluir
+showMessage=Exibir Mensagem
+sender=Rementente
+subject=Assunto
+recipients=Destinat\u00E1rios
+traceLevel=N\u00EDvel de Trace
+htmlBody=Corpo do e-mail (HTML)
+textBody=Corpo do E-mail (TEXT)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
new file mode 100644
index 0000000..43b95cb
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
@@ -0,0 +1,172 @@
+<!--
+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>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <div style="margin: 5px;">
+ <form wicket:id="form">
+ <div id="formtable">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="name"><wicket:message key="name"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="name">[name]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="type"><wicket:message key="type"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="type">[type]</span>
+ </div>
+ </div>
+
+ <div wicket:id="conversionParams">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="conversionPattern"><wicket:message key="conversionPattern"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="conversionPattern">[conversionPattern]</span>
+ </div>
+ </div>
+ </div>
+
+ <div wicket:id="typeParams">
+ <div wicket:id="enumParams">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="enumerationValues"><wicket:message key="enumerationValues"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="enumerationValues">[enumerationValues]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="enumerationKeys"><wicket:message key="enumerationKeys"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="enumerationKeys">[enumerationKeys]</span>
+ </div>
+ </div>
+ </div>
+ <div wicket:id="encryptedParams">
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="secretKey"><wicket:message key="secretKey"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="secretKey">[secretKey]</span>
+ </div>
+ </div>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="cipherAlgorithm"><wicket:message key="cipherAlgorithm"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="cipherAlgorithm">[cipherAlgorithm]</span>
+ </div>
+ </div>
+ </div>
+ <div wicket:id="binaryParams">
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="mimeType"><wicket:message key="mimeType"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="mimeType">[mimeType]</span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="validatorClass"><wicket:message key="validatorClass"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="validatorClass">[validatorClass]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="mandatoryCondition"><wicket:message key="mandatoryCondition"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <input type="text" class="ui-widget-content ui-corner-all"
+ id="mandatoryCondition" wicket:id="mandatoryCondition"/>
+ <a class="tooltips" wicket:id="questionMarkJexlHelp" href="#" alt="Click to help" title="Click to help">
+ <img src="img/help.png"/>
+ <span wicket:id="jexlHelp" class="tooltips">
+ <wicket:message key="jexl_info"/>
+ <ul>
+ <li><wicket:message key="jexl_ex1"/></li>
+ <li><wicket:message key="jexl_ex2"/></li>
+ </ul>
+ <a href="#" wicket:id="jexlLink" target="_blank"><wicket:message key="jexl_syntax_url"/></a>
+ </span>
+ </a>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="uniqueConstraint" class="onerowlabel"><wicket:message key="uniqueConstraint"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="uniqueConstraint">[uniqueConstraint]</span>
+ </div>
+ </div>
+
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="multivalue" class="onerowlabel"><wicket:message key="multivalue"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="multivalue">[multivalue]</span>
+ </div>
+ </div>
+
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="readonly" class="onerowlabel"><wicket:message key="readonly"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="readonly">[readonly]</span>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin: 10px 0px 0;">
+ <input type="submit"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="apply"/>
+ <input type="button"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
[03/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
new file mode 100644
index 0000000..5df855a
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/UserITCase.java
@@ -0,0 +1,2442 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessControlException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import javax.naming.NamingException;
+import javax.ws.rs.core.EntityTag;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.cxf.common.util.Base64Utility;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.AttributableOperations;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.mod.MembershipMod;
+import org.apache.syncope.common.lib.mod.ResourceAssociationMod;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.BulkActionResult.Status;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.MappingTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.PasswordPolicyTO;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.PropagationTaskTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.Preference;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.PolicyService;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.UserSelfService;
+import org.apache.syncope.common.rest.api.service.UserService;
+import org.apache.syncope.server.misc.security.Encryptor;
+import org.apache.syncope.server.provisioning.java.propagation.DBPasswordPropagationActions;
+import org.apache.syncope.server.provisioning.java.propagation.LDAPPasswordPropagationActions;
+import org.identityconnectors.framework.common.objects.Name;
+import org.identityconnectors.framework.common.objects.OperationalAttributes;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class UserITCase extends AbstractITCase {
+
+ private String getStringAttribute(final ConnObjectTO connObjectTO, final String attrName) {
+ return connObjectTO.getPlainAttrMap().get(attrName).getValues().get(0);
+ }
+
+ private boolean getBooleanAttribute(final ConnObjectTO connObjectTO, final String attrName) {
+ return Boolean.parseBoolean(getStringAttribute(connObjectTO, attrName));
+ }
+
+ public static UserTO getUniqueSampleTO(final String email) {
+ return getSampleTO(getUUIDString() + email);
+ }
+
+ public static UserTO getSampleTO(final String email) {
+ String uid = email;
+ UserTO userTO = new UserTO();
+ userTO.setPassword("password123");
+ userTO.setUsername(uid);
+
+ userTO.getPlainAttrs().add(attrTO("fullname", uid));
+ userTO.getPlainAttrs().add(attrTO("firstname", uid));
+ userTO.getPlainAttrs().add(attrTO("surname", "surname"));
+ userTO.getPlainAttrs().add(attrTO("type", "a type"));
+ userTO.getPlainAttrs().add(attrTO("userId", uid));
+ userTO.getPlainAttrs().add(attrTO("email", uid));
+ userTO.getPlainAttrs().add(attrTO("loginDate", new SimpleDateFormat("yyyy-MM-dd").format(new Date())));
+ userTO.getDerAttrs().add(attrTO("cn", null));
+ userTO.getVirAttrs().add(attrTO("virtualdata", "virtualvalue"));
+ return userTO;
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public void createUserWithNoPropagation() {
+ // get task list
+ PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ long maxKey = tasks.getResult().iterator().next().getKey();
+
+ // create a new user
+ UserTO userTO = getUniqueSampleTO("xxx@xxx.xxx");
+
+ userTO.setPassword("password123");
+ userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION);
+
+ createUser(userTO);
+
+ // get the new task list
+ tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ long newMaxId = tasks.getResult().iterator().next().getKey();
+
+ assertTrue(newMaxId > maxKey);
+
+ // get last task
+ PropagationTaskTO taskTO = taskService.read(newMaxId);
+
+ assertNotNull(taskTO);
+ assertTrue(taskTO.getExecutions().isEmpty());
+ }
+
+ @Test
+ public void issue172() {
+ List<PasswordPolicyTO> policies = policyService.list(PolicyType.GLOBAL_PASSWORD);
+ for (PasswordPolicyTO policyTO : policies) {
+ policyService.delete(policyTO.getKey());
+ }
+
+ try {
+ UserTO userTO = getUniqueSampleTO("issue172@syncope.apache.org");
+ createUser(userTO);
+ } finally {
+ for (PasswordPolicyTO policyTO : policies) {
+ Response response = policyService.create(policyTO);
+ PasswordPolicyTO cPolicyTO = getObject(
+ response.getLocation(), PolicyService.class, PasswordPolicyTO.class);
+ assertNotNull(cPolicyTO);
+ }
+ }
+ }
+
+ @Test
+ public void issue186() {
+ // 1. create an user with strict mandatory attributes only
+ UserTO userTO = new UserTO();
+ String userId = getUUIDString() + "issue186@syncope.apache.org";
+ userTO.setUsername(userId);
+ userTO.setPassword("password");
+
+ userTO.getPlainAttrs().add(attrTO("userId", userId));
+ userTO.getPlainAttrs().add(attrTO("fullname", userId));
+ userTO.getPlainAttrs().add(attrTO("surname", userId));
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertTrue(userTO.getResources().isEmpty());
+
+ // 2. update assigning a resource forcing mandatory constraints: must fail with RequiredValuesMissing
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("newPassword");
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_WS2);
+
+ try {
+ userTO = updateUser(userMod);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+
+ // 3. update assigning a resource NOT forcing mandatory constraints
+ // AND primary: must fail with PropagationException
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("newPassword");
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO.getPropagationStatusTOs().get(0).getFailureReason());
+
+ // 4. update assigning a resource NOT forcing mandatory constraints
+ // BUT not primary: must succeed
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("newPassword123456");
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_CSV);
+ updateUser(userMod);
+ }
+
+ @Test
+ public void enforceMandatoryCondition() {
+ UserTO userTO = getUniqueSampleTO("enforce@apache.org");
+ userTO.getResources().add(RESOURCE_NAME_WS2);
+ userTO.setPassword("newPassword");
+
+ AttrTO type = null;
+ for (AttrTO attr : userTO.getPlainAttrs()) {
+ if ("type".equals(attr.getSchema())) {
+ type = attr;
+ }
+ }
+ assertNotNull(type);
+ userTO.getPlainAttrs().remove(type);
+
+ try {
+ userTO = createUser(userTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+
+ userTO.getPlainAttrs().add(type);
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void enforceMandatoryConditionOnDerived() {
+ ResourceTO resourceTO = resourceService.read(RESOURCE_NAME_CSV);
+ assertNotNull(resourceTO);
+ resourceTO.setKey("resource-csv-enforcing");
+ resourceTO.setEnforceMandatoryCondition(true);
+
+ Response response = resourceService.create(resourceTO);
+ resourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+ assertNotNull(resourceTO);
+
+ UserTO userTO = getUniqueSampleTO("syncope222@apache.org");
+ userTO.getResources().add(resourceTO.getKey());
+ userTO.setPassword("newPassword");
+
+ try {
+ userTO = createUser(userTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals(Collections.singleton("resource-csv-enforcing"), userTO.getResources());
+ }
+
+ @Test
+ public void createUserWithDbPropagation() {
+ UserTO userTO = getUniqueSampleTO("yyy@yyy.yyy");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getPropagationStatusTOs().size());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithInvalidPassword() {
+ UserTO userTO = getSampleTO("invalidpasswd@syncope.apache.org");
+ userTO.setPassword("pass");
+ createUser(userTO);
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithInvalidUsername() {
+ UserTO userTO = getSampleTO("invalidusername@syncope.apache.org");
+ userTO.setUsername("us");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+
+ userTO.getMemberships().add(membershipTO);
+
+ createUser(userTO);
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithInvalidPasswordByRes() {
+ UserTO userTO = getSampleTO("invalidPwdByRes@passwd.com");
+
+ // configured to be minLength=16
+ userTO.setPassword("password1");
+ userTO.getResources().add(RESOURCE_NAME_NOPROPAGATION);
+ createUser(userTO);
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithInvalidPasswordByRole() {
+ UserTO userTO = getSampleTO("invalidPwdByRole@passwd.com");
+
+ // configured to be minLength=16
+ userTO.setPassword("password1");
+
+ final MembershipTO membership = new MembershipTO();
+ membership.setRoleId(8L);
+
+ userTO.getMemberships().add(membership);
+
+ createUser(userTO);
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithException() {
+ UserTO newUserTO = new UserTO();
+ newUserTO.getPlainAttrs().add(attrTO("userId", "userId@nowhere.org"));
+ createUser(newUserTO);
+ }
+
+ @Test
+ public void create() {
+ // get task list
+ PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ long maxKey = tasks.getResult().iterator().next().getKey();
+ PropagationTaskTO taskTO = taskService.read(maxKey);
+
+ assertNotNull(taskTO);
+ int maxTaskExecutions = taskTO.getExecutions().size();
+
+ UserTO userTO = getUniqueSampleTO("a.b@c.com");
+
+ // add a membership
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ userTO.getMemberships().add(membershipTO);
+
+ // add an attribute with no values: must be ignored
+ membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", null));
+
+ // add an attribute with a non-existing schema: must be ignored
+ AttrTO attrWithInvalidSchemaTO = attrTO("invalid schema", "a value");
+ userTO.getPlainAttrs().add(attrWithInvalidSchemaTO);
+
+ // add an attribute with null value: must be ignored
+ userTO.getPlainAttrs().add(attrTO("activationDate", null));
+
+ // 1. create user
+ UserTO newUserTO = createUser(userTO);
+
+ assertNotNull(newUserTO);
+
+ // issue SYNCOPE-15
+ assertNotNull(newUserTO.getCreationDate());
+ assertNotNull(newUserTO.getCreator());
+ assertNotNull(newUserTO.getLastChangeDate());
+ assertNotNull(newUserTO.getLastModifier());
+ assertEquals(newUserTO.getCreationDate(), newUserTO.getLastChangeDate());
+
+ assertFalse(newUserTO.getPlainAttrs().contains(attrWithInvalidSchemaTO));
+
+ // check for changePwdDate
+ assertNotNull(newUserTO.getCreationDate());
+
+ // 2. check for virtual attribute value
+ newUserTO = userService.read(newUserTO.getKey());
+ assertNotNull(newUserTO);
+
+ assertNotNull(newUserTO.getVirAttrMap());
+ assertNotNull(newUserTO.getVirAttrMap().get("virtualdata").getValues());
+ assertFalse(newUserTO.getVirAttrMap().get("virtualdata").getValues().isEmpty());
+ assertEquals("virtualvalue", newUserTO.getVirAttrMap().get("virtualdata").getValues().get(0));
+
+ // get the new task list
+ tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ long newMaxKey = tasks.getResult().iterator().next().getKey();
+
+ // default configuration for ws-target-resource2:
+ // only failed executions have to be registered
+ // --> no more tasks/executions should be added
+ assertEquals(newMaxKey, maxKey);
+
+ // get last task
+ taskTO = taskService.read(newMaxKey);
+
+ assertNotNull(taskTO);
+ assertEquals(maxTaskExecutions, taskTO.getExecutions().size());
+
+ // 3. verify password
+ UserSelfService userSelfService1 = clientFactory.create(
+ newUserTO.getUsername(), "password123").getService(UserSelfService.class);
+ try {
+ UserTO user = userSelfService1.read();
+ assertNotNull(user);
+ } catch (AccessControlException e) {
+ fail("Credentials should be valid and not cause AccessControlException");
+ }
+
+ UserSelfService userSelfService2 = clientFactory.create(
+ newUserTO.getUsername(), "passwordXX").getService(UserSelfService.class);
+ try {
+ userSelfService2.read();
+ fail("Credentials are invalid, thus request should raise AccessControlException");
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ // 4. try (and fail) to create another user with same (unique) values
+ userTO = getSampleTO(userTO.getUsername());
+ AttrTO userIdAttr = userTO.getPlainAttrMap().get("userId");
+ userIdAttr.getValues().clear();
+ userIdAttr.getValues().add("a.b@c.com");
+
+ try {
+ createUser(userTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.DataIntegrityViolation, e.getType());
+ }
+ }
+
+ @Test
+ public void createWithRequiredValueMissing() {
+ UserTO userTO = getSampleTO("a.b@c.it");
+
+ AttrTO type = userTO.getPlainAttrMap().get("type");
+ userTO.getPlainAttrs().remove(type);
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ userTO.getMemberships().add(membershipTO);
+
+ // 1. create user without type (mandatory by UserSchema)
+ try {
+ createUser(userTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+
+ userTO.getPlainAttrs().add(attrTO("type", "F"));
+
+ AttrTO surname = userTO.getPlainAttrMap().get("surname");
+ userTO.getPlainAttrs().remove(surname);
+
+ // 2. create user without surname (mandatory when type == 'F')
+ try {
+ createUser(userTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+ }
+
+ @Test
+ public void delete() {
+ try {
+ userService.delete(0L);
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+
+ UserTO userTO = getSampleTO("qqgf.z@nn.com");
+
+ // specify a propagation
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ userTO = createUser(userTO);
+
+ long id = userTO.getKey();
+
+ userTO = deleteUser(id);
+
+ assertNotNull(userTO);
+ assertEquals(id, userTO.getKey());
+ assertTrue(userTO.getPlainAttrs().isEmpty());
+
+ // check for propagation result
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+
+ try {
+ userService.delete(userTO.getKey());
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void deleteByUsername() {
+ UserTO userTO = getSampleTO("delete.by.username@apache.org");
+
+ // specify a propagation
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ userTO = createUser(userTO);
+
+ long id = userTO.getKey();
+ userTO = userService.read(id);
+ userTO = deleteUser(userTO.getKey());
+
+ assertNotNull(userTO);
+ assertEquals(id, userTO.getKey());
+ assertTrue(userTO.getPlainAttrs().isEmpty());
+
+ // check for propagation result
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+
+ try {
+ userService.read(userTO.getKey());
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void list() {
+ PagedResult<UserTO> users = userService.list();
+ assertNotNull(users);
+ assertFalse(users.getResult().isEmpty());
+
+ for (UserTO user : users.getResult()) {
+ assertNotNull(user);
+ }
+ }
+
+ @Test
+ public void paginatedList() {
+ PagedResult<UserTO> users = userService.list(1, 2);
+ assertNotNull(users);
+ assertFalse(users.getResult().isEmpty());
+ assertEquals(2, users.getResult().size());
+
+ for (UserTO user : users.getResult()) {
+ assertNotNull(user);
+ }
+
+ users = userService.list(2, 2);
+ assertNotNull(users);
+ assertFalse(users.getResult().isEmpty());
+ assertEquals(2, users.getResult().size());
+
+ users = userService.list(100, 2);
+ assertNotNull(users);
+ assertTrue(users.getResult().isEmpty());
+ }
+
+ @Test
+ public void read() {
+ UserTO userTO = userService.read(1L);
+
+ assertNotNull(userTO);
+ assertNotNull(userTO.getPlainAttrs());
+ assertFalse(userTO.getPlainAttrs().isEmpty());
+ }
+
+ @Test
+ public void readWithMailAddressAsUserName() {
+ UserTO userTO = createUser(getUniqueSampleTO("mail@domain.org"));
+ userTO = userService.read(userTO.getKey());
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void updateWithouPassword() {
+ UserTO userTO = getUniqueSampleTO("updatewithout@password.com");
+
+ userTO = createUser(userTO);
+
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getDerAttrsToRemove().add("cn");
+
+ userTO = updateUser(userMod);
+
+ assertNotNull(userTO);
+ assertNotNull(userTO.getDerAttrMap());
+ assertFalse(userTO.getDerAttrMap().containsKey("cn"));
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void updateInvalidPassword() {
+ UserTO userTO = getSampleTO("updateinvalid@password.com");
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("pass");
+
+ userService.update(userMod.getKey(), userMod);
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void updateSamePassword() {
+ UserTO userTO = getSampleTO("updatesame@password.com");
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("password123");
+
+ userService.update(userMod.getKey(), userMod);
+ }
+
+ @Test
+ public void update() {
+ UserTO userTO = getUniqueSampleTO("g.h@t.com");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", "2009-08-18T16:33:12.203+0200"));
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+
+ assertFalse(userTO.getDerAttrs().isEmpty());
+ assertEquals(1, userTO.getMemberships().size());
+
+ MembershipMod membershipMod = new MembershipMod();
+ membershipMod.setRole(8L);
+ membershipMod.getPlainAttrsToUpdate().add(attrMod("subscriptionDate", "2010-08-18T16:33:12.203+0200"));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("new2Password");
+
+ userMod.getPlainAttrsToRemove().add("userId");
+ String newUserId = getUUIDString() + "t.w@spre.net";
+ userMod.getPlainAttrsToUpdate().add(attrMod("userId", newUserId));
+
+ userMod.getPlainAttrsToRemove().add("fullname");
+ String newFullName = getUUIDString() + "g.h@t.com";
+ userMod.getPlainAttrsToUpdate().add(attrMod("fullname", newFullName));
+
+ userMod.getDerAttrsToAdd().add("cn");
+ userMod.getMembershipsToAdd().add(membershipMod);
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ // issue SYNCOPE-15
+ assertNotNull(userTO.getCreationDate());
+ assertNotNull(userTO.getCreator());
+ assertNotNull(userTO.getLastChangeDate());
+ assertNotNull(userTO.getLastModifier());
+ assertTrue(userTO.getCreationDate().before(userTO.getLastChangeDate()));
+
+ assertEquals(1, userTO.getMemberships().size());
+ assertEquals(1, userTO.getMemberships().iterator().next().getPlainAttrs().size());
+ assertFalse(userTO.getDerAttrs().isEmpty());
+
+ AttrTO userIdAttr = userTO.getPlainAttrMap().get("userId");
+ assertEquals(Collections.singletonList(newUserId), userIdAttr.getValues());
+
+ AttrTO fullNameAttr = userTO.getPlainAttrMap().get("fullname");
+ assertEquals(Collections.singletonList(newFullName), fullNameAttr.getValues());
+ }
+
+ @Test
+ public void updatePasswordOnly() {
+ int beforeTasks = taskService.list(TaskType.PROPAGATION, 1, 1).getTotalCount();
+ assertFalse(beforeTasks <= 0);
+
+ UserTO userTO = getUniqueSampleTO("pwdonly@t.com");
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ membershipTO.getPlainAttrs().add(attrTO("subscriptionDate", "2009-08-18T16:33:12.203+0200"));
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("newPassword123");
+
+ userTO = updateUser(userMod);
+
+ // check for changePwdDate
+ assertNotNull(userTO.getChangePwdDate());
+
+ int afterTasks = taskService.list(TaskType.PROPAGATION, 1, 1).getTotalCount();
+ assertFalse(beforeTasks <= 0);
+
+ assertTrue(beforeTasks < afterTasks);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void verifyTaskRegistration() {
+ // get task list
+ PagedResult<PropagationTaskTO> tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ long maxKey = tasks.getResult().iterator().next().getKey();
+
+ // --------------------------------------
+ // Create operation
+ // --------------------------------------
+ UserTO userTO = getUniqueSampleTO("t@p.mode");
+
+ // add a membership
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(8L);
+ userTO.getMemberships().add(membershipTO);
+
+ // 1. create user
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ // get the new task list
+ tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+ assertNotNull(tasks);
+ assertFalse(tasks.getResult().isEmpty());
+
+ long newMaxKey = tasks.getResult().iterator().next().getKey();
+
+ // default configuration for ws-target-resource2:
+ // only failed executions have to be registered
+ // --> no more tasks/executions should be added
+ assertEquals(newMaxKey, maxKey);
+
+ // --------------------------------------
+ // Update operation
+ // --------------------------------------
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+
+ userMod.getPlainAttrsToUpdate().add(attrMod("surname", "surname"));
+
+ userTO = updateUser(userMod);
+
+ assertNotNull(userTO);
+
+ // get the new task list
+ tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+
+ maxKey = newMaxKey;
+ newMaxKey = tasks.getResult().iterator().next().getKey();
+
+ // default configuration for ws-target-resource2:
+ // all update executions have to be registered
+ assertTrue(newMaxKey > maxKey);
+
+ final PropagationTaskTO taskTO = taskService.read(newMaxKey);
+
+ assertNotNull(taskTO);
+ assertEquals(1, taskTO.getExecutions().size());
+
+ // --------------------------------------
+ // Delete operation
+ // --------------------------------------
+ userService.delete(userTO.getKey());
+
+ // get the new task list
+ tasks = taskService.list(TaskType.PROPAGATION, 1, 1);
+
+ maxKey = newMaxKey;
+ newMaxKey = tasks.getResult().iterator().next().getKey();
+
+ // default configuration for ws-target-resource2: no delete executions have to be registered
+ // --> no more tasks/executions should be added
+ assertEquals(newMaxKey, maxKey);
+ }
+
+ @Test
+ public void createActivate() {
+ Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers(syncopeService));
+
+ UserTO userTO = getUniqueSampleTO("createActivate@syncope.apache.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(11L);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+
+ assertNotNull(userTO);
+ assertNotNull(userTO.getToken());
+ assertNotNull(userTO.getTokenExpireTime());
+
+ assertEquals("created", userTO.getStatus());
+
+ StatusMod statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.ACTIVATE);
+ statusMod.setToken(userTO.getToken());
+ userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
+
+ assertNotNull(userTO);
+ assertNull(userTO.getToken());
+ assertNull(userTO.getTokenExpireTime());
+ assertEquals("active", userTO.getStatus());
+ }
+
+ @Test
+ public void suspendReactivate() {
+ UserTO userTO = getUniqueSampleTO("suspendReactivate@syncope.apache.org");
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(7L);
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+
+ assertNotNull(userTO);
+ assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+ ? "active"
+ : "created", userTO.getStatus());
+
+ StatusMod statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.SUSPEND);
+ userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("suspended", userTO.getStatus());
+
+ statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.REACTIVATE);
+ userTO = userService.status(userTO.getKey(), statusMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+ }
+
+ @Test
+ public void suspendReactivateOnResource() {
+ // Assert resources are present
+ ResourceTO dbTable = resourceService.read(RESOURCE_NAME_TESTDB);
+ assertNotNull(dbTable);
+ ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP);
+ assertNotNull(ldap);
+
+ // Create user with reference to resources
+ UserTO userTO = getUniqueSampleTO("suspreactonresource@syncope.apache.org");
+ userTO.getMemberships().clear();
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+ userTO.getResources().add(RESOURCE_NAME_LDAP);
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals(ActivitiDetector.isActivitiEnabledForUsers(syncopeService)
+ ? "active"
+ : "created", userTO.getStatus());
+ long userId = userTO.getKey();
+
+ // Suspend with effect on syncope, ldap and db => user should be suspended in syncope and all resources
+ StatusMod statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.SUSPEND);
+ statusMod.setOnSyncope(true);
+ statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
+ statusMod.getResourceNames().add(RESOURCE_NAME_LDAP);
+ userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("suspended", userTO.getStatus());
+
+ ConnObjectTO connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
+ assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userId);
+ assertNotNull(connObjectTO);
+
+ // Suspend and reactivate only on ldap => db and syncope should still show suspended
+ statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.SUSPEND);
+ statusMod.setOnSyncope(false);
+ statusMod.getResourceNames().add(RESOURCE_NAME_LDAP);
+ userService.status(userId, statusMod);
+ statusMod.setType(StatusMod.ModType.REACTIVATE);
+ userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("suspended", userTO.getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
+ assertFalse(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
+
+ // Reactivate on syncope and db => syncope and db should show the user as active
+ statusMod = new StatusMod();
+ statusMod.setType(StatusMod.ModType.REACTIVATE);
+ statusMod.setOnSyncope(true);
+ statusMod.getResourceNames().add(RESOURCE_NAME_TESTDB);
+
+ userTO = userService.status(userId, statusMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertEquals("active", userTO.getStatus());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userId);
+ assertTrue(getBooleanAttribute(connObjectTO, OperationalAttributes.ENABLE_NAME));
+ }
+
+ public void updateMultivalueAttribute() {
+ UserTO userTO = getSampleTO("multivalue@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ AttrTO loginDate = userTO.getPlainAttrMap().get("loginDate");
+ assertNotNull(loginDate);
+ assertEquals(1, loginDate.getValues().size());
+
+ UserMod userMod = new UserMod();
+
+ AttrMod loginDateMod = new AttrMod();
+ loginDateMod.getValuesToBeAdded().add("2000-01-01");
+
+ userMod.setKey(userTO.getKey());
+ userMod.getPlainAttrsToUpdate().add(loginDateMod);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ loginDate = userTO.getPlainAttrMap().get("loginDate");
+ assertNotNull(loginDate);
+ assertEquals(2, loginDate.getValues().size());
+ }
+
+ @Test(expected = EmptyResultDataAccessException.class)
+ public void issue213() {
+ UserTO userTO = getUniqueSampleTO("issue213@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getResources().size());
+
+ JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+
+ String username = jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class,
+ userTO.getUsername());
+
+ assertEquals(userTO.getUsername(), username);
+
+ UserMod userMod = new UserMod();
+
+ userMod.setKey(userTO.getKey());
+ userMod.getResourcesToRemove().add(RESOURCE_NAME_TESTDB);
+
+ userTO = updateUser(userMod);
+ assertTrue(userTO.getResources().isEmpty());
+
+ jdbcTemplate.queryForObject("SELECT id FROM test WHERE id=?", String.class, userTO.getUsername());
+ }
+
+ @Test
+ public void issue234() {
+ UserTO inUserTO = getUniqueSampleTO("issue234@syncope.apache.org");
+ inUserTO.getResources().add(RESOURCE_NAME_LDAP);
+
+ UserTO userTO = createUser(inUserTO);
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+
+ userMod.setKey(userTO.getKey());
+ userMod.setUsername("1" + userTO.getUsername());
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ assertEquals("1" + inUserTO.getUsername(), userTO.getUsername());
+ }
+
+ @Test
+ public void issue270() {
+ // 1. create a new user without virtual attributes
+ UserTO original = getUniqueSampleTO("issue270@syncope.apache.org");
+ // be sure to remove all virtual attributes
+ original.getVirAttrs().clear();
+
+ original = createUser(original);
+
+ assertNotNull(original);
+
+ assertTrue(original.getVirAttrs().isEmpty());
+
+ UserTO toBeUpdated = userService.read(original.getKey());
+
+ AttrTO virtual = attrTO("virtualdata", "virtualvalue");
+ toBeUpdated.getVirAttrs().add(virtual);
+
+ // 2. try to update by adding a resource, but no password: must fail
+ UserMod userMod = AttributableOperations.diff(toBeUpdated, original);
+ assertNotNull(userMod);
+
+ toBeUpdated = updateUser(userMod);
+ assertNotNull(toBeUpdated);
+
+ assertFalse(toBeUpdated.getVirAttrs().isEmpty());
+ assertNotNull(toBeUpdated.getVirAttrs().get(0));
+
+ assertEquals(virtual.getSchema(), toBeUpdated.getVirAttrs().get(0).getSchema());
+ }
+
+ @Test
+ public final void issue280() {
+ UserTO userTO = getUniqueSampleTO("issue280@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("123password");
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ final List<PropagationStatus> propagations = userTO.getPropagationStatusTOs();
+
+ assertNotNull(propagations);
+ assertEquals(1, propagations.size());
+
+ final PropagationTaskExecStatus status = propagations.get(0).getStatus();
+ final String resource = propagations.get(0).getResource();
+
+ assertNotNull(status);
+ assertEquals(RESOURCE_NAME_TESTDB, resource);
+ assertTrue(status.isSuccessful());
+ }
+
+ @Test
+ public void issue281() {
+ UserTO userTO = getUniqueSampleTO("issue281@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ final List<PropagationStatus> propagations = userTO.getPropagationStatusTOs();
+
+ assertNotNull(propagations);
+ assertEquals(1, propagations.size());
+
+ final PropagationTaskExecStatus status = propagations.get(0).getStatus();
+ final String resource = propagations.get(0).getResource();
+
+ assertNotNull(status);
+ assertEquals(RESOURCE_NAME_CSV, resource);
+ assertFalse(status.isSuccessful());
+ }
+
+ @Test
+ public void issue288() {
+ UserTO userTO = getSampleTO("issue288@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO("aLong", "STRING"));
+
+ try {
+ createUser(userTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidValues, e.getType());
+ }
+ }
+
+ @Test
+ public void roleAttrPropagation() {
+ UserTO userTO = getUniqueSampleTO("checkRoleAttrPropagation@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(1L);
+
+ userTO.getMemberships().add(membershipTO);
+
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertNotNull(actual.getDerAttrMap().get("csvuserid"));
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+ assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("ROLE").getValues().get(0));
+ }
+
+ @Test
+ public void membershipAttrPropagation() {
+ UserTO userTO = getUniqueSampleTO("checkMembAttrPropagation@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(1L);
+ membershipTO.getPlainAttrs().add(attrTO("mderived_sx", "sx"));
+ membershipTO.getPlainAttrs().add(attrTO("mderived_dx", "dx"));
+ membershipTO.getDerAttrs().add(attrTO("mderToBePropagated", null));
+ userTO.getMemberships().add(membershipTO);
+
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertNotNull(actual.getDerAttrMap().get("csvuserid"));
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+ assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("MEMBERSHIP").getValues().get(0));
+ }
+
+ @Test
+ public void noContent() throws IOException {
+ SyncopeClient noContentclient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
+ UserService noContentService = noContentclient.prefer(UserService.class, Preference.RETURN_NO_CONTENT);
+
+ UserTO user = getUniqueSampleTO("nocontent@syncope.apache.org");
+
+ Response response = noContentService.create(user, true);
+ assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+
+ user = getObject(response.getLocation(), UserService.class, UserTO.class);
+ assertNotNull(user);
+
+ UserMod userMod = new UserMod();
+ userMod.setPassword("password321");
+
+ response = noContentService.update(user.getKey(), userMod);
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+
+ response = noContentService.delete(user.getKey());
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+ }
+
+ @Test
+ public void issueSYNCOPE108() {
+ UserTO userTO = getUniqueSampleTO("syncope108@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ MembershipTO memb12 = new MembershipTO();
+ memb12.setRoleId(12L);
+
+ userTO.getMemberships().add(memb12);
+
+ MembershipTO memb13 = new MembershipTO();
+ memb13.setRoleId(13L);
+
+ userTO.getMemberships().add(memb13);
+
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertEquals(2, actual.getMemberships().size());
+ assertEquals(1, actual.getResources().size());
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+
+ // -----------------------------------
+ // Remove the first membership: de-provisioning shouldn't happen
+ // -----------------------------------
+ UserMod userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+
+ userMod.getMembershipsToRemove().add(actual.getMemberships().get(0).getKey());
+
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+ assertEquals(1, actual.getMemberships().size());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+ // -----------------------------------
+
+ // -----------------------------------
+ // Remove the resource assigned directly: de-provisioning shouldn't happen
+ // -----------------------------------
+ userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+
+ userMod.getResourcesToRemove().add(actual.getResources().iterator().next());
+
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+ assertEquals(1, actual.getMemberships().size());
+ assertFalse(actual.getResources().isEmpty());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+ // -----------------------------------
+
+ // -----------------------------------
+ // Remove the first membership: de-provisioning should happen
+ // -----------------------------------
+ userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+
+ userMod.getMembershipsToRemove().add(actual.getMemberships().get(0).getKey());
+
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+ assertTrue(actual.getMemberships().isEmpty());
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail("Read should not succeeed");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE111() {
+ UserTO userTO = getUniqueSampleTO("syncope111@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ MembershipTO memb12 = new MembershipTO();
+ memb12.setRoleId(12L);
+ memb12.getPlainAttrs().add(attrTO("postalAddress", "postalAddress"));
+ userTO.getMemberships().add(memb12);
+
+ MembershipTO memb13 = new MembershipTO();
+ memb13.setRoleId(13L);
+ userTO.getMemberships().add(memb13);
+
+ userTO.getResources().add(RESOURCE_NAME_LDAP);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertEquals(2, actual.getMemberships().size());
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+
+ AttrTO postalAddress = connObjectTO.getPlainAttrMap().get("postalAddress");
+ assertNotNull(postalAddress);
+ assertEquals(1, postalAddress.getValues().size());
+ assertEquals("postalAddress", postalAddress.getValues().get(0));
+
+ AttrTO title = connObjectTO.getPlainAttrMap().get("title");
+ assertNotNull(title);
+ assertEquals(2, title.getValues().size());
+ assertTrue(title.getValues().contains("r12") && title.getValues().contains("r13"));
+
+ // -----------------------------------
+ // Remove the first membership and check for membership attr propagation and role attr propagation
+ // -----------------------------------
+ UserMod userMod = new UserMod();
+ userMod.setKey(actual.getKey());
+
+ MembershipTO membershipTO = actual.getMemberships().get(0).getRoleId() == 12L
+ ? actual.getMemberships().get(0)
+ : actual.getMemberships().get(1);
+
+ userMod.getMembershipsToRemove().add(membershipTO.getKey());
+
+ actual = updateUser(userMod);
+ assertNotNull(actual);
+ assertEquals(1, actual.getMemberships().size());
+
+ connObjectTO = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, actual.getKey());
+ assertNotNull(connObjectTO);
+
+ postalAddress = connObjectTO.getPlainAttrMap().get("postalAddress");
+ assertTrue(postalAddress == null || postalAddress.getValues().isEmpty()
+ || StringUtils.isNotBlank(postalAddress.getValues().get(0)));
+
+ title = connObjectTO.getPlainAttrMap().get("title");
+ assertNotNull(title);
+ assertEquals(1, title.getValues().size());
+ assertTrue(title.getValues().contains("r13"));
+ // -----------------------------------
+ }
+
+ @Test
+ public void issueSYNCOPE185() {
+ // 1. create user with LDAP resource, succesfully propagated
+ UserTO userTO = getSampleTO("syncope185@syncope.apache.org");
+ userTO.getVirAttrs().clear();
+ userTO.getResources().add(RESOURCE_NAME_LDAP);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertEquals(RESOURCE_NAME_LDAP, userTO.getPropagationStatusTOs().get(0).getResource());
+ assertEquals(PropagationTaskExecStatus.SUCCESS, userTO.getPropagationStatusTOs().get(0).getStatus());
+
+ // 2. delete this user
+ userService.delete(userTO.getKey());
+
+ // 3. try (and fail) to find this user on the external LDAP resource
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+ fail("This entry should not be present on this resource");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+ }
+
+ @Test()
+ public void issueSYNCOPE51() {
+ AttrTO defaultCA = configurationService.read("password.cipher.algorithm");
+ final String originalCAValue = defaultCA.getValues().get(0);
+ defaultCA.getValues().set(0, "MD5");
+ configurationService.set(defaultCA.getSchema(), defaultCA);
+
+ AttrTO newCA = configurationService.read(defaultCA.getSchema());
+ assertEquals(defaultCA, newCA);
+
+ UserTO userTO = getSampleTO("syncope51@syncope.apache.org");
+ userTO.setPassword("password");
+
+ try {
+ createUser(userTO);
+ fail("Create user should not succeed");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ assertTrue(e.getElements().iterator().next().contains("MD5"));
+ }
+
+ defaultCA.getValues().set(0, originalCAValue);
+ configurationService.set(defaultCA.getSchema(), defaultCA);
+
+ AttrTO oldCA = configurationService.read(defaultCA.getSchema());
+ assertEquals(defaultCA, oldCA);
+ }
+
+ @Test
+ public void issueSYNCOPE267() {
+ // ----------------------------------
+ // create user and check virtual attribute value propagation
+ // ----------------------------------
+ UserTO userTO = getUniqueSampleTO("syncope267@apache.org");
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_DBVIRATTR);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertFalse(userTO.getPropagationStatusTOs().isEmpty());
+ assertEquals(RESOURCE_NAME_DBVIRATTR, userTO.getPropagationStatusTOs().get(0).getResource());
+ assertEquals(PropagationTaskExecStatus.SUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_DBVIRATTR, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObjectTO);
+ assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("USERNAME").getValues().get(0));
+ // ----------------------------------
+
+ userTO = userService.read(userTO.getKey());
+
+ assertNotNull(userTO);
+ assertEquals(1, userTO.getVirAttrs().size());
+ assertEquals("virtualvalue", userTO.getVirAttrs().get(0).getValues().get(0));
+ }
+
+ @Test
+ public void issueSYNCOPE266() {
+ UserTO userTO = getUniqueSampleTO("syncope266@apache.org");
+ userTO.getResources().clear();
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+
+ // this resource has not a mapping for Password
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_UPDATE);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void issueSYNCOPE279() {
+ UserTO userTO = getUniqueSampleTO("syncope279@apache.org");
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_TIMEOUT);
+ userTO = createUser(userTO);
+ assertEquals(RESOURCE_NAME_TIMEOUT, userTO.getPropagationStatusTOs().get(0).getResource());
+ assertNotNull(userTO.getPropagationStatusTOs().get(0).getFailureReason());
+ assertEquals(PropagationTaskExecStatus.UNSUBMITTED, userTO.getPropagationStatusTOs().get(0).getStatus());
+ }
+
+ @Test
+ public void issueSYNCOPE122() {
+ // 1. create user on testdb and testdb2
+ UserTO userTO = getUniqueSampleTO("syncope122@apache.org");
+ userTO.getResources().clear();
+
+ userTO.getResources().add(RESOURCE_NAME_TESTDB);
+ userTO.getResources().add(RESOURCE_NAME_TESTDB2);
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB));
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_TESTDB2));
+
+ final String pwdOnSyncope = userTO.getPassword();
+
+ ConnObjectTO userOnDb = resourceService.getConnectorObject(
+ RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
+ final AttrTO pwdOnTestDbAttr = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+ assertNotNull(pwdOnTestDbAttr);
+ assertNotNull(pwdOnTestDbAttr.getValues());
+ assertFalse(pwdOnTestDbAttr.getValues().isEmpty());
+ final String pwdOnTestDb = pwdOnTestDbAttr.getValues().iterator().next();
+
+ ConnObjectTO userOnDb2 = resourceService.getConnectorObject(
+ RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getKey());
+ final AttrTO pwdOnTestDb2Attr = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+ assertNotNull(pwdOnTestDb2Attr);
+ assertNotNull(pwdOnTestDb2Attr.getValues());
+ assertFalse(pwdOnTestDb2Attr.getValues().isEmpty());
+ final String pwdOnTestDb2 = pwdOnTestDb2Attr.getValues().iterator().next();
+
+ // 2. request to change password only on testdb (no Syncope, no testdb2)
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword(getUUIDString());
+ StatusMod pwdPropRequest = new StatusMod();
+ pwdPropRequest.setOnSyncope(false);
+ pwdPropRequest.getResourceNames().add(RESOURCE_NAME_TESTDB);
+ userMod.setPwdPropRequest(pwdPropRequest);
+
+ userTO = updateUser(userMod);
+
+ // 3a. Chech that only a single propagation took place
+ assertNotNull(userTO.getPropagationStatusTOs());
+ assertEquals(1, userTO.getPropagationStatusTOs().size());
+ assertEquals(RESOURCE_NAME_TESTDB, userTO.getPropagationStatusTOs().iterator().next().getResource());
+
+ // 3b. verify that password hasn't changed on Syncope
+ assertEquals(pwdOnSyncope, userTO.getPassword());
+
+ // 3c. verify that password *has* changed on testdb
+ userOnDb = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB, SubjectType.USER, userTO.getKey());
+ final AttrTO pwdOnTestDbAttrAfter = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+ assertNotNull(pwdOnTestDbAttrAfter);
+ assertNotNull(pwdOnTestDbAttrAfter.getValues());
+ assertFalse(pwdOnTestDbAttrAfter.getValues().isEmpty());
+ assertNotEquals(pwdOnTestDb, pwdOnTestDbAttrAfter.getValues().iterator().next());
+
+ // 3d. verify that password hasn't changed on testdb2
+ userOnDb2 = resourceService.getConnectorObject(RESOURCE_NAME_TESTDB2, SubjectType.USER, userTO.getKey());
+ final AttrTO pwdOnTestDb2AttrAfter = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+ assertNotNull(pwdOnTestDb2AttrAfter);
+ assertNotNull(pwdOnTestDb2AttrAfter.getValues());
+ assertFalse(pwdOnTestDb2AttrAfter.getValues().isEmpty());
+ assertEquals(pwdOnTestDb2, pwdOnTestDb2AttrAfter.getValues().iterator().next());
+ }
+
+ @Test
+ public void isseSYNCOPE136AES() {
+ // 1. read configured cipher algorithm in order to be able to restore it at the end of test
+ AttrTO pwdCipherAlgo = configurationService.read("password.cipher.algorithm");
+ final String origpwdCipherAlgo = pwdCipherAlgo.getValues().get(0);
+
+ // 2. set AES password cipher algorithm
+ pwdCipherAlgo.getValues().set(0, "AES");
+ configurationService.set(pwdCipherAlgo.getSchema(), pwdCipherAlgo);
+
+ // 3. create user with no resources
+ UserTO userTO = getUniqueSampleTO("syncope136_AES@apache.org");
+ userTO.getResources().clear();
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ // 4. update user, assign a propagation primary resource but don't provide any password
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
+
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ // 5. verify that propagation was successful
+ List<PropagationStatus> props = userTO.getPropagationStatusTOs();
+ assertNotNull(props);
+ assertEquals(1, props.size());
+ PropagationStatus prop = props.iterator().next();
+ assertNotNull(prop);
+ assertEquals(RESOURCE_NAME_WS1, prop.getResource());
+ assertEquals(PropagationTaskExecStatus.SUBMITTED, prop.getStatus());
+
+ // 6. restore initial cipher algorithm
+ pwdCipherAlgo.getValues().set(0, origpwdCipherAlgo);
+ configurationService.set(pwdCipherAlgo.getSchema(), pwdCipherAlgo);
+ }
+
+ @Test
+ public void isseSYNCOPE136Random() {
+ // 1. create user with no resources
+ UserTO userTO = getUniqueSampleTO("syncope136_Random@apache.org");
+ userTO.getResources().clear();
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ // 2. update user, assign a propagation primary resource but don't provide any password
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_LDAP);
+ userTO = updateUser(userMod);
+ assertNotNull(userTO);
+
+ // 3. verify that propagation was successful
+ List<PropagationStatus> props = userTO.getPropagationStatusTOs();
+ assertNotNull(props);
+ assertEquals(1, props.size());
+ PropagationStatus prop = props.iterator().next();
+ assertNotNull(prop);
+ assertEquals(RESOURCE_NAME_LDAP, prop.getResource());
+ assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
+ }
+
+ @Test
+ public void mappingPurpose() {
+ UserTO userTO = getUniqueSampleTO("mpurpose@apache.org");
+
+ AttrTO csvuserid = new AttrTO();
+ csvuserid.setSchema("csvuserid");
+ userTO.getDerAttrs().add(csvuserid);
+
+ userTO.getResources().clear();
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ assertNull(connObjectTO.getPlainAttrMap().get("email"));
+ }
+
+ @Test
+ public void issueSYNCOPE265() {
+ for (long i = 1; i <= 5; i++) {
+ UserMod userMod = new UserMod();
+ userMod.setKey(i);
+
+ AttrMod attributeMod = new AttrMod();
+ attributeMod.setSchema("type");
+ attributeMod.getValuesToBeAdded().add("a type");
+
+ userMod.getPlainAttrsToRemove().add("type");
+ userMod.getPlainAttrsToUpdate().add(attributeMod);
+
+ UserTO userTO = updateUser(userMod);
+ assertEquals("a type", userTO.getPlainAttrMap().get("type").getValues().get(0));
+ }
+ }
+
+ @Test
+ public void bulkActions() {
+ final BulkAction bulkAction = new BulkAction();
+
+ for (int i = 0; i < 10; i++) {
+ UserTO userTO = getUniqueSampleTO("bulk_" + i + "@apache.org");
+ bulkAction.getTargets().add(String.valueOf(createUser(userTO).getKey()));
+ }
+
+ // check for a fail
+ bulkAction.getTargets().add(String.valueOf(Long.MAX_VALUE));
+
+ assertEquals(11, bulkAction.getTargets().size());
+
+ bulkAction.setOperation(BulkAction.Type.SUSPEND);
+ BulkActionResult res = userService.bulk(bulkAction);
+ assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
+ assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+ assertEquals("suspended", userService.read(
+ Long.parseLong(res.getResultByStatus(Status.SUCCESS).get(3).toString())).getStatus());
+
+ bulkAction.setOperation(BulkAction.Type.REACTIVATE);
+ res = userService.bulk(bulkAction);
+ assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
+ assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+ assertEquals("active", userService.read(
+ Long.parseLong(res.getResultByStatus(Status.SUCCESS).get(3).toString())).getStatus());
+
+ bulkAction.setOperation(BulkAction.Type.DELETE);
+ res = userService.bulk(bulkAction);
+ assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
+ assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+ }
+
+ @Test
+ public void issueSYNCOPE354() {
+ // change resource-ldap role mapping for including uniqueMember (need for assertions below)
+ ResourceTO ldap = resourceService.read(RESOURCE_NAME_LDAP);
+ for (MappingItemTO item : ldap.getRmapping().getItems()) {
+ if ("description".equals(item.getExtAttrName())) {
+ item.setExtAttrName("uniqueMember");
+ }
+ }
+ resourceService.update(ldap.getKey(), ldap);
+
+ // 1. create role with LDAP resource
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName("SYNCOPE354-" + getUUIDString());
+ roleTO.setParent(8L);
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+
+ // 2. create user with LDAP resource and membership of the above role
+ UserTO userTO = getUniqueSampleTO("syncope354@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_LDAP);
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(roleTO.getKey());
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
+
+ // 3. read role on resource, check that user DN is included in uniqueMember
+ ConnObjectTO connObj = resourceService.getConnectorObject(
+ RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getKey());
+ assertNotNull(connObj);
+ assertTrue(connObj.getPlainAttrMap().get("uniqueMember").getValues().
+ contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
+
+ // 4. remove membership
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getMembershipsToRemove().add(userTO.getMemberships().iterator().next().getKey());
+
+ userTO = updateUser(userMod);
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
+
+ // 5. read role on resource, check that user DN was removed from uniqueMember
+ connObj = resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getKey());
+ assertNotNull(connObj);
+ assertFalse(connObj.getPlainAttrMap().get("uniqueMember").getValues().
+ contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
+
+ // 6. restore original resource-ldap role mapping
+ for (MappingItemTO item : ldap.getRmapping().getItems()) {
+ if ("uniqueMember".equals(item.getExtAttrName())) {
+ item.setExtAttrName("description");
+ }
+ }
+ resourceService.update(ldap.getKey(), ldap);
+ }
+
+ @Test
+ public void issueSYNCOPE357() throws IOException {
+ // 1. create role with LDAP resource
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName("SYNCOPE357-" + getUUIDString());
+ roleTO.setParent(8L);
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+
+ // 2. create user with membership of the above role
+ UserTO userTO = getUniqueSampleTO("syncope357@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO("obscure", "valueToBeObscured"));
+ userTO.getPlainAttrs().add(attrTO("photo",
+ Base64Utility.encode(IOUtils.readBytesFromStream(getClass().getResourceAsStream("/favicon.jpg")))));
+ MembershipTO membershipTO = new MembershipTO();
+ membershipTO.setRoleId(roleTO.getKey());
+ userTO.getMemberships().add(membershipTO);
+
+ userTO = createUser(userTO);
+ assertTrue(userTO.getResources().contains(RESOURCE_NAME_LDAP));
+ assertNotNull(userTO.getPlainAttrMap().get("obscure"));
+ assertNotNull(userTO.getPlainAttrMap().get("photo"));
+
+ // 3. read user on resource
+ ConnObjectTO connObj = resourceService.getConnectorObject(
+ RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+ assertNotNull(connObj);
+ AttrTO registeredAddress = connObj.getPlainAttrMap().get("registeredAddress");
+ assertNotNull(registeredAddress);
+ assertEquals(userTO.getPlainAttrMap().get("obscure").getValues(), registeredAddress.getValues());
+ AttrTO jpegPhoto = connObj.getPlainAttrMap().get("jpegPhoto");
+ assertNotNull(jpegPhoto);
+ assertEquals(userTO.getPlainAttrMap().get("photo").getValues(), jpegPhoto.getValues());
+
+ // 4. remove role
+ roleService.delete(roleTO.getKey());
+
+ // 5. try to read user on resource: fail
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.NotFound, e.getType());
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE383() {
+ // 1. create user without resources
+ UserTO userTO = getUniqueSampleTO("syncope383@apache.org");
+ userTO.getResources().clear();
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ // 2. assign resource without specifying a new pwd and check propagation failure
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
+ userTO = updateUser(userMod);
+ assertEquals(RESOURCE_NAME_TESTDB, userTO.getResources().iterator().next());
+ assertFalse(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+ assertNotNull(userTO.getPropagationStatusTOs().get(0).getFailureReason());
+
+ // 3. request to change password only on testdb
+ userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword(getUUIDString());
+ StatusMod pwdPropRequest = new StatusMod();
+ pwdPropRequest.getResourceNames().add(RESOURCE_NAME_TESTDB);
+ userMod.setPwdPropRequest(pwdPropRequest);
+
+ userTO = updateUser(userMod);
+ assertEquals(RESOURCE_NAME_TESTDB, userTO.getResources().iterator().next());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+ }
+
+ @Test
+ public void issueSYNCOPE402() {
+ // 1. create an user with strict mandatory attributes only
+ UserTO userTO = new UserTO();
+ String userId = getUUIDString() + "syncope402@syncope.apache.org";
+ userTO.setUsername(userId);
+ userTO.setPassword("password");
+
+ userTO.getPlainAttrs().add(attrTO("userId", userId));
+ userTO.getPlainAttrs().add(attrTO("fullname", userId));
+ userTO.getPlainAttrs().add(attrTO("surname", userId));
+
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+ assertTrue(userTO.getResources().isEmpty());
+
+ //2. update assigning a resource NOT forcing mandatory constraints
+ // AND primary: must fail with PropagationException
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPassword("newPassword");
+
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
+ userTO = updateUser(userMod);
+
+ List<PropagationStatus> propagationStatuses = userTO.getPropagationStatusTOs();
+ PropagationStatus ws1PropagationStatus = null;
+ if (propagationStatuses != null) {
+ for (PropagationStatus propStatus : propagationStatuses) {
+ if (RESOURCE_NAME_WS1.equals(propStatus.getResource())) {
+ ws1PropagationStatus = propStatus;
+ break;
+ }
+ }
+ }
+ assertNotNull(ws1PropagationStatus);
+ assertEquals(RESOURCE_NAME_WS1, ws1PropagationStatus.getResource());
+ assertNotNull(ws1PropagationStatus.getFailureReason());
+ assertEquals(PropagationTaskExecStatus.UNSUBMITTED, ws1PropagationStatus.getStatus());
+ }
+
+ @Test
+ public void unlink() {
+ UserTO userTO = getUniqueSampleTO("unlink@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+
+ assertNotNull(userService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+ }
+
+ @Test
+ public void link() {
+ UserTO userTO = getUniqueSampleTO("link@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
+
+ assertNotNull(userService.bulkAssociation(
+ actual.getKey(), ResourceAssociationActionType.LINK, associationMod).readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertFalse(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void unassign() {
+ UserTO userTO = getUniqueSampleTO("unassign@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+
+ assertNotNull(userService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.UNASSIGN,
+ CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void assign() {
+ UserTO userTO = getUniqueSampleTO("assign@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
+ associationMod.setChangePwd(true);
+ associationMod.setPassword("password");
+
+ assertNotNull(userService.bulkAssociation(actual.getKey(), ResourceAssociationActionType.ASSIGN, associationMod)
+ .readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertFalse(actual.getResources().isEmpty());
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+ }
+
+ @Test
+ public void deprovision() {
+ UserTO userTO = getUniqueSampleTO("deprovision@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+ userTO.getResources().add(RESOURCE_NAME_CSV);
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+
+ assertNotNull(userService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.DEPROVISION,
+ CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertFalse(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void provision() {
+ UserTO userTO = getUniqueSampleTO("provision@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
+ associationMod.setChangePwd(true);
+ associationMod.setPassword("password");
+
+ assertNotNull(userService.bulkAssociation(actual.getKey(), ResourceAssociationActionType.PROVISION,
+ associationMod)
+ .readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+ }
+
+ @Test
+ public void deprovisionUnlinked() {
+ UserTO userTO = getUniqueSampleTO("provision@syncope.apache.org");
+ userTO.getResources().clear();
+ userTO.getMemberships().clear();
+ userTO.getDerAttrs().clear();
+ userTO.getVirAttrs().clear();
+ userTO.getDerAttrs().add(attrTO("csvuserid", null));
+
+ UserTO actual = createUser(userTO);
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ final ResourceAssociationMod associationMod = new ResourceAssociationMod();
+ associationMod.getTargetResources().addAll(CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class));
+ associationMod.setChangePwd(true);
+ associationMod.setPassword("password");
+
+ assertNotNull(userService.bulkAssociation(actual.getKey(), ResourceAssociationActionType.PROVISION,
+ associationMod)
+ .readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey()));
+
+ assertNotNull(userService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.DEPROVISION,
+ CollectionWrapper.wrap(RESOURCE_NAME_CSV, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = userService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_CSV, SubjectType.USER, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE420() {
+ UserTO userTO = getUniqueSampleTO("syncope420@syncope.apache.org");
+ userTO.getPlainAttrs().add(attrTO("makeItDouble", "3"));
+
+ userTO = createUser(userTO);
+ assertEquals("6", userTO.getPlainAttrMap().get("makeItDouble").getValues().get(0));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.getPlainAttrsToRemove().add("makeItDouble");
+ userMod.getPlainAttrsToUpdate().add(attrMod("makeItDouble", "7"));
+
+ userTO = updateUser(userMod);
+ assertEquals("14", userTO.getPlainAttrMap().get("makeItDouble").getValues().get(0));
+ }
+
+ @Test
+ public void issueSYNCOPE426() {
+ UserTO userTO = getUniqueSampleTO("syncope426@syncope.apache.org");
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ UserMod userMod = new UserMod();
+ userMod.setPassword("anotherPassword123");
+ userTO = userService.update(userTO.getKey(), userMod).readEntity(UserTO.class);
+ assertNotNull(userTO);
+ }
+
+ @Test
+ public void issueSYNCOPE435() {
+ // 1. create user without password
+ UserTO userTO = getUniqueSampleTO("syncope435@syncope.apache.org");
+ userTO.setPassword(null);
+ userTO = createUser(userTO, false);
+ assertNotNull(userTO);
+
+ // 2. try to update user by subscribing a resource - works but propagation is not even attempted
+ UserMod userMod = new UserMod();
+ userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
+
+ userTO = userService.update(userTO.getKey(), userMod).readEntity(UserTO.class);
+ assertEquals(Collections.singleton(RESOURCE_NAME_WS1), userTO.getResources());
+ assertFalse(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
+ assertTrue(userTO.getPropagationStatusTOs().get(0).getFailureReason().
+ startsWith("Not attempted because there are mandatory attributes without value(s): [__PASSWORD__]"));
+ }
+
+ @Test
+ public void ifMatch() {
+ UserTO userTO = userService.create(getUniqueSampleTO("ifmatch@syncope.apache.org"), true).
+ readEntity(UserTO.class);
+ assertNotNull(userTO);
+ assertNotNull(userTO.getKey());
+
+ EntityTag etag = adminClient.getLatestEntityTag(userService);
+ assertNotNull(etag);
+ assertTrue(StringUtils.isNotBlank(etag.getValue()));
+
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setUsername(userTO.getUsername() + "XX");
+ userTO = userService.update(userMod.getKey(), userMod).readEntity(UserTO.class);
+ assertTrue(userTO.getUsername().endsWith("XX"));
+ EntityTag etag1 = adminClient.getLatestEntityTag(userService);
+ assertFalse(etag.getValue().equals(etag1.getValue()));
+
+ UserService ifMatchService = adminClient.ifMatch(UserService.class, etag);
+ userMod.setUsername(userTO.getUsername() + "YY");
+ try {
+ ifMatchService.update(userMod.getKey(), userMod);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.ConcurrentModification, e.getType());
+ }
+
+ userTO = userService.read(userTO.getKey());
+ assertTrue(userTO.getUsername().endsWith("XX"));
+ }
+
+ @Test
+ public void issueSYNCOPE454() throws NamingException {
+ // 1. create user with LDAP resource (with 'Generate password if missing' enabled)
+ UserTO userTO = getUniqueSampleTO("syncope454@syncope.apache.org");
+ userTO.getResources().add(RESOURCE_NAME_LDAP);
+ userTO = createUser(userTO);
+ assertNotNull(userTO);
+
+ // 2. read resource configuration for LDAP binding
+ ConnObjectTO connObject =
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.USER, userTO.getKey());
+
+ // 3. try (and succeed) to perform simple LDAP binding with provided password ('password123')
+ assertNotNull(getLdapRemoteObject(
+ connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+ "password123",
+ connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+
+ // 4. update user without any password change request
+ UserMod userMod = new UserMod();
+ userMod.setKey(userTO.getKey());
+ userMod.setPwdPropRequest(new StatusMod());
+ userMod.getPlainAttrsToUpdate().add(attrMod("surname", "surname2"));
+
+ userService.update(userTO.getKey(), userMod);
+
+ // 5. try (and succeed again) to perform simple LDAP binding: password has not changed
+ assertNotNull(getLdapRemoteObject(
+ connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+ "password123",
+ connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+ }
+
+ @Test
+ public void issueSYNCOPE493() {
+ // 1. create user and check that firstname is not propagated on resource with mapping for firstname set to NONE
+ UserTO userTO = getUniqueSampleTO("issueSYNCOPE493@test.org
<TRUNCATED>
[26/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.java
new file mode 100644
index 0000000..c5b9164
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.java
@@ -0,0 +1,70 @@
+/*
+ * 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.wicket.markup.html.form.preview;
+
+import java.io.ByteArrayInputStream;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import javax.naming.ldap.LdapName;
+import javax.naming.ldap.Rdn;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.preview.BinaryPreview;
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.io.IOUtils;
+
+@BinaryPreview(mimeTypes = { "application/x-x509-ca-cert", "application/x-x509-user-cert", "application/pkix-cert" })
+public class BinaryCertPreviewer extends AbstractBinaryPreviewer {
+
+ private static final long serialVersionUID = -5843835939538055110L;
+
+ public BinaryCertPreviewer(final String id, final String mimeType, final byte[] uploadedBytes) {
+ super(id, mimeType, uploadedBytes);
+ }
+
+ @Override
+ public Component preview() {
+ final Label commonNameLabel = new Label("certCommonName", new Model<String>());
+ final ByteArrayInputStream certificateStream = new ByteArrayInputStream(uploadedBytes);
+ try {
+ final X509Certificate certificate = (X509Certificate) CertificateFactory.getInstance("X.509").
+ generateCertificate(certificateStream);
+
+ final StringBuilder commonNameBuilder = new StringBuilder("cn=");
+
+ final LdapName ldapName = new LdapName(certificate.getIssuerDN().getName());
+
+ for (Rdn rdn : ldapName.getRdns()) {
+ if ("CN".equalsIgnoreCase(rdn.getType())) {
+ commonNameBuilder.append(rdn.getValue() == null
+ ? StringUtils.EMPTY
+ : rdn.getValue().toString());
+ }
+ }
+ commonNameLabel.setDefaultModelObject(commonNameBuilder.toString());
+ } catch (Exception e) {
+ LOG.error("Error evaluating certificate file", e);
+ throw new IllegalArgumentException("Error evaluating certificate file", e);
+ } finally {
+ IOUtils.closeQuietly(certificateStream);
+ }
+ return this.add(commonNameLabel);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.java
new file mode 100644
index 0000000..6ab90a7
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryImagePreviewer.java
@@ -0,0 +1,51 @@
+/*
+ * 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.wicket.markup.html.form.preview;
+
+import org.apache.syncope.client.console.preview.BinaryPreview;
+import org.apache.wicket.Component;
+import org.apache.wicket.extensions.markup.html.image.resource.ThumbnailImageResource;
+import org.apache.wicket.markup.html.image.NonCachingImage;
+import org.apache.wicket.request.resource.DynamicImageResource;
+import org.apache.wicket.request.resource.IResource;
+
+@BinaryPreview(mimeTypes = { "image/jpeg", "image/png", "image/gif", "image/bmp", "image/x-png", "image/vnd.wap.wbmp" })
+public class BinaryImagePreviewer extends AbstractBinaryPreviewer {
+
+ private static final long serialVersionUID = 3338812359368457349L;
+
+ private static final int IMG_SIZE = 230;
+
+ public BinaryImagePreviewer(final String id, final String mimeType, final byte[] uploadedBytes) {
+ super(id, mimeType, uploadedBytes);
+ }
+
+ @Override
+ public Component preview() {
+ return this.add(new NonCachingImage("previewImage", new ThumbnailImageResource(new DynamicImageResource() {
+
+ private static final long serialVersionUID = 923201517955737928L;
+
+ @Override
+ protected byte[] getImageData(final IResource.Attributes attributes) {
+ return uploadedBytes;
+ }
+ }, IMG_SIZE)));
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java
new file mode 100644
index 0000000..51c8ec5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.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.wicket.markup.html.link;
+
+import org.apache.wicket.markup.html.link.PopupSettings;
+
+public class VeilPopupSettings extends PopupSettings {
+
+ private static final long serialVersionUID = -2727046117490858226L;
+
+ @Override
+ public String getPopupJavaScript() {
+ return "document.getElementById('veil').style.display = 'block';" + super.getPopupJavaScript();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/AltListView.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/AltListView.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/AltListView.java
new file mode 100644
index 0000000..5a491ae
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/AltListView.java
@@ -0,0 +1,59 @@
+/*
+ * 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.wicket.markup.html.list;
+
+import java.util.List;
+import org.apache.wicket.markup.ComponentTag;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.IModel;
+
+public abstract class AltListView<T> extends ListView<T> {
+
+ private static final long serialVersionUID = 251378224847354710L;
+
+ public AltListView(final String id) {
+ super(id);
+ }
+
+ public AltListView(final String id, final IModel<? extends List<? extends T>> model) {
+ super(id, model);
+ }
+
+ public AltListView(final String id, final List<? extends T> list) {
+ super(id, list);
+ }
+
+ @Override
+ protected ListItem<T> newItem(final int index, final IModel<T> itemModel) {
+ return new ListItem<T>(index, itemModel) {
+
+ private static final long serialVersionUID = 5473483270932376694L;
+
+ @Override
+ protected void onComponentTag(final ComponentTag tag) {
+ if (index % 2 == 0) {
+ tag.append("class", "alt", " ");
+ }
+
+ super.onComponentTag(tag);
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
new file mode 100644
index 0000000..30775f5
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
@@ -0,0 +1,152 @@
+/*
+ * 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.wicket.markup.html.list;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPasswordFieldPanel;
+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.MultiFieldPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.SpinnerFieldPanel;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.ClassUtils;
+
+public class ConnConfPropertyListView extends AltListView<ConnConfProperty> {
+
+ private static final long serialVersionUID = -5239334900329150316L;
+
+ private static final Logger LOG = LoggerFactory.getLogger(ConnConfPropertyListView.class);
+
+ private final boolean withOverridable;
+
+ private final Set<ConnConfProperty> configuration;
+
+ public ConnConfPropertyListView(final String id, final IModel<? extends List<? extends ConnConfProperty>> model,
+ final boolean withOverridable, final Set<ConnConfProperty> configuration) {
+
+ super(id, model);
+ this.configuration = configuration;
+ this.withOverridable = withOverridable;
+ }
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected void populateItem(final ListItem<ConnConfProperty> item) {
+ final ConnConfProperty property = item.getModelObject();
+
+ final Label label = new Label("connPropAttrSchema",
+ StringUtils.isBlank(property.getSchema().getDisplayName())
+ ? property.getSchema().getName()
+ : property.getSchema().getDisplayName());
+ item.add(label);
+
+ FieldPanel<? extends Serializable> field;
+ boolean required = false;
+ boolean isArray = false;
+
+ if (property.getSchema().isConfidential()
+ || Constants.GUARDED_STRING.equalsIgnoreCase(property.getSchema().getType())
+ || Constants.GUARDED_BYTE_ARRAY.equalsIgnoreCase(property.getSchema().getType())) {
+
+ field = new AjaxPasswordFieldPanel("panel",
+ label.getDefaultModelObjectAsString(), new Model<String>());
+ ((PasswordTextField) field.getField()).setResetPassword(false);
+
+ required = property.getSchema().isRequired();
+ } else {
+ Class<?> propertySchemaClass;
+ try {
+ propertySchemaClass =
+ ClassUtils.forName(property.getSchema().getType(), ClassUtils.getDefaultClassLoader());
+ if (ClassUtils.isPrimitiveOrWrapper(propertySchemaClass)) {
+ propertySchemaClass = org.apache.commons.lang3.ClassUtils.primitiveToWrapper(propertySchemaClass);
+ }
+ } catch (Exception e) {
+ LOG.error("Error parsing attribute type", e);
+ propertySchemaClass = String.class;
+ }
+
+ if (ClassUtils.isAssignable(Number.class, propertySchemaClass)) {
+ @SuppressWarnings("unchecked")
+ final Class<Number> numberClass = (Class<Number>) propertySchemaClass;
+ field = new SpinnerFieldPanel<Number>("panel",
+ label.getDefaultModelObjectAsString(), numberClass, new Model<Number>(), null, null);
+
+ required = property.getSchema().isRequired();
+ } else if (ClassUtils.isAssignable(Boolean.class, propertySchemaClass)) {
+ field = new AjaxCheckBoxPanel("panel",
+ label.getDefaultModelObjectAsString(), new Model<Boolean>());
+ } else {
+ field = new AjaxTextFieldPanel("panel",
+ label.getDefaultModelObjectAsString(), new Model<String>());
+
+ required = property.getSchema().isRequired();
+ }
+
+ if (propertySchemaClass.isArray()) {
+ isArray = true;
+ }
+ }
+
+ field.setTitle(property.getSchema().getHelpMessage());
+
+ if (required) {
+ field.addRequiredLabel();
+ }
+
+ if (isArray) {
+ if (property.getValues().isEmpty()) {
+ property.getValues().add(null);
+ }
+
+ final MultiFieldPanel multiFieldPanel = new MultiFieldPanel("panel",
+ new PropertyModel<List<String>>(property, "values"), field);
+ item.add(multiFieldPanel);
+ } else {
+ setNewFieldModel(field, property.getValues());
+ item.add(field);
+ }
+
+ if (withOverridable) {
+ item.add(new AjaxCheckBoxPanel("connPropAttrOverridable",
+ "connPropAttrOverridable", new PropertyModel<Boolean>(property, "overridable")));
+ }
+
+ configuration.add(property);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private void setNewFieldModel(final FieldPanel field, final List<Object> values) {
+ field.setNewModel(values);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
new file mode 100644
index 0000000..50db23c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansion.java
@@ -0,0 +1,160 @@
+/*
+ * 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.wicket.markup.html.tree;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.MetaDataKey;
+import org.apache.wicket.Session;
+
+public class DefaultMutableTreeNodeExpansion implements Set<DefaultMutableTreeNode>, Serializable {
+
+ private static final long serialVersionUID = -2864060875425661224L;
+
+ private static MetaDataKey<DefaultMutableTreeNodeExpansion> KEY =
+ new MetaDataKey<DefaultMutableTreeNodeExpansion>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ };
+
+ private Set<Long> ids = new HashSet<Long>();
+
+ private boolean inverse;
+
+ public void expandAll() {
+ ids.clear();
+
+ inverse = true;
+ }
+
+ public void collapseAll() {
+ ids.clear();
+
+ inverse = false;
+ }
+
+ @Override
+ public boolean add(final DefaultMutableTreeNode node) {
+ RoleTO roleTO = (RoleTO) node.getUserObject();
+ boolean isAdded;
+ if (inverse) {
+ isAdded = ids.remove(roleTO.getKey());
+ } else {
+ isAdded = ids.add(roleTO.getKey());
+ }
+ return isAdded;
+ }
+
+ @Override
+ public boolean remove(final Object object) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) object;
+ RoleTO roleTO = (RoleTO) node.getUserObject();
+ boolean isRemoved;
+ if (inverse) {
+ isRemoved = ids.add(roleTO.getKey());
+ } else {
+ isRemoved = ids.remove(roleTO.getKey());
+ }
+ return isRemoved;
+ }
+
+ @Override
+ public boolean contains(final Object object) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) object;
+ RoleTO roleTO = (RoleTO) node.getUserObject();
+ boolean isContained;
+ if (inverse) {
+ isContained = !ids.contains(roleTO.getKey());
+ } else {
+ isContained = ids.contains(roleTO.getKey());
+ }
+ return isContained;
+ }
+
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public int size() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public <A> A[] toArray(final A[] a) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Iterator<DefaultMutableTreeNode> iterator() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object[] toArray() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends DefaultMutableTreeNode> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Get the expansion for the session.
+ *
+ * @return expansion
+ */
+ public static DefaultMutableTreeNodeExpansion get() {
+ DefaultMutableTreeNodeExpansion expansion = Session.get().getMetaData(KEY);
+ if (expansion == null) {
+ expansion = new DefaultMutableTreeNodeExpansion();
+
+ Session.get().setMetaData(KEY, expansion);
+ }
+ return expansion;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansionModel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansionModel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansionModel.java
new file mode 100644
index 0000000..1b342bd
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/DefaultMutableTreeNodeExpansionModel.java
@@ -0,0 +1,36 @@
+/*
+ * 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.wicket.markup.html.tree;
+
+import java.util.Set;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+
+import org.apache.wicket.model.AbstractReadOnlyModel;
+
+public class DefaultMutableTreeNodeExpansionModel
+ extends AbstractReadOnlyModel<Set<DefaultMutableTreeNode>> {
+
+ private static final long serialVersionUID = -3407581132184748054L;
+
+ @Override
+ public Set<DefaultMutableTreeNode> getObject() {
+ return DefaultMutableTreeNodeExpansion.get();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.java
new file mode 100644
index 0000000..b0be4e9
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRolePanel.java
@@ -0,0 +1,121 @@
+/*
+ * 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.wicket.markup.html.tree;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.syncope.client.console.commons.RoleTreeBuilder;
+import org.apache.syncope.client.console.commons.XMLRolesReader;
+import org.apache.syncope.client.console.pages.Roles.TreeNodeClickUpdate;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
+import org.apache.wicket.extensions.markup.html.repeater.tree.DefaultNestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.ITreeProvider;
+import org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.content.Folder;
+import org.apache.wicket.extensions.markup.html.repeater.tree.theme.WindowsTheme;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+public class TreeRolePanel extends Panel {
+
+ private static final long serialVersionUID = 1762003213871836869L;
+
+ @SpringBean
+ private RoleTreeBuilder roleTreeBuilder;
+
+ @SpringBean
+ private XMLRolesReader xmlRolesReader;
+
+ private WebMarkupContainer treeContainer;
+
+ private NestedTree<DefaultMutableTreeNode> tree;
+
+ public TreeRolePanel(final String id) {
+ super(id);
+
+ treeContainer = new WebMarkupContainer("treeContainer");
+ treeContainer.setOutputMarkupId(true);
+ add(treeContainer);
+ updateTree();
+ }
+
+ private void updateTree() {
+ final ITreeProvider<DefaultMutableTreeNode> treeProvider = new TreeRoleProvider(roleTreeBuilder, true);
+ final DefaultMutableTreeNodeExpansionModel treeModel = new DefaultMutableTreeNodeExpansionModel();
+
+ tree = new DefaultNestedTree<DefaultMutableTreeNode>("treeTable", treeProvider, treeModel) {
+
+ private static final long serialVersionUID = 7137658050662575546L;
+
+ @Override
+ protected Component newContentComponent(final String id, final IModel<DefaultMutableTreeNode> node) {
+ final DefaultMutableTreeNode treeNode = node.getObject();
+ final RoleTO roleTO = (RoleTO) treeNode.getUserObject();
+
+ return new Folder<DefaultMutableTreeNode>(id, TreeRolePanel.this.tree, node) {
+
+ private static final long serialVersionUID = 9046323319920426493L;
+
+ @Override
+ protected boolean isClickable() {
+ return true;
+ }
+
+ @Override
+ protected IModel<?> newLabelModel(final IModel<DefaultMutableTreeNode> model) {
+ return new Model<>(roleTO.getDisplayName());
+ }
+
+ @Override
+ protected void onClick(final AjaxRequestTarget target) {
+ super.onClick(target);
+
+ send(getPage(), Broadcast.BREADTH, new TreeNodeClickUpdate(target, roleTO.getKey()));
+ }
+ };
+ }
+ };
+ tree.add(new WindowsTheme());
+ tree.setOutputMarkupId(true);
+
+ DefaultMutableTreeNodeExpansion.get().expandAll();
+
+ MetaDataRoleAuthorizationStrategy.authorize(tree, ENABLE, xmlRolesReader.getEntitlement("Roles", "read"));
+
+ treeContainer.addOrReplace(tree);
+ }
+
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ super.onEvent(event);
+
+ if (event.getPayload() instanceof TreeNodeClickUpdate) {
+ final TreeNodeClickUpdate update = (TreeNodeClickUpdate) event.getPayload();
+ updateTree();
+ update.getTarget().add(treeContainer);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRoleProvider.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRoleProvider.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRoleProvider.java
new file mode 100644
index 0000000..6fbe9a4
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/tree/TreeRoleProvider.java
@@ -0,0 +1,43 @@
+/*
+ * 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.wicket.markup.html.tree;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.syncope.client.console.commons.RoleTreeBuilder;
+import org.apache.wicket.extensions.markup.html.repeater.util.TreeModelProvider;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class TreeRoleProvider extends TreeModelProvider<DefaultMutableTreeNode> {
+
+ private static final long serialVersionUID = -7741964777100892335L;
+
+ public TreeRoleProvider(final RoleTreeBuilder roleTreeBuilder) {
+ this(roleTreeBuilder, false);
+ }
+
+ public TreeRoleProvider(final RoleTreeBuilder roleTreeBuilder, final boolean rootVisible) {
+ super(roleTreeBuilder.build(), rootVisible);
+ }
+
+ @Override
+ public IModel<DefaultMutableTreeNode> model(final DefaultMutableTreeNode treeNode) {
+ return new Model<DefaultMutableTreeNode>(treeNode);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/bulk.css
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/bulk.css b/syncope620/client/console/src/main/resources/META-INF/resources/css/bulk.css
new file mode 100644
index 0000000..1f0e621
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/META-INF/resources/css/bulk.css
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+th.checkGroupColumn{
+ width: 20px;
+}
+
+td.checkGroupColumn{
+ text-align: center;
+}
+
+div.bulkAction{
+ display:inline-table;
+}
+
+div.bulkActionCell{
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+ width: 40px;
+ padding-left: 7px;
+}
+
+.pageRowElement{
+ display: inline-table;
+ width: 95%;
+}
+
+div#selectedObjects{
+ text-align: center;
+ margin-top: 10px;
+}
+
+div#selectedObjects table {
+ margin: 1em 0;
+ border-collapse: collapse;
+}
+
+div#selectedObjects table td, div#selectedObjects table th {
+ border: 1px solid #eee;
+ padding: .6em 10px;
+}
+
+div#actionRow{
+ height: 30px;
+ overflow: hidden;
+ text-align: left;
+ margin-top: 10px;
+}
+
+div#actions{
+ display: inline-table;
+ height: 30px;
+ overflow: hidden;
+}
+
+div#actions div#actionPanel{
+ display: table-cell;
+ height: 30px;
+ overflow: hidden;
+ cursor: auto;
+ background: none;
+ padding: 0px 10px;
+ vertical-align: middle;
+}
+
+div#actions div#cancelBtmForm{
+ display: table-cell;
+ height: 30px;
+ overflow: hidden;
+ vertical-align: middle;
+ padding-left: 3px;
+}
+
+div#actions div#cancelBtmForm form{
+ padding: 0px;
+ margin: 0px;
+}
+
+div#actions div#cancelBtmForm form input#cancel{
+ padding: 0.6em 1em;
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css b/syncope620/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css
new file mode 100644
index 0000000..23ef109
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/META-INF/resources/css/fieldstyle.css
@@ -0,0 +1,191 @@
+/*
+ * 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.
+ */
+.drop_button{
+ vertical-align: middle;
+}
+
+.add_button{
+ vertical-align: middle;
+ margin-left: 6px;
+}
+
+.date_size{
+ width: 90px;
+}
+
+.long_dynamicsize{
+ width: 80%;
+}
+
+.medium_dynamicsize{
+ width: 45%;
+}
+
+.short_dynamicsize{
+ width: 35%;
+}
+
+.long_fixedsize{
+ width: 500px;
+}
+
+.medium_fixedsize{
+ width: 300px;
+}
+
+.short_fixedsize{
+ width: 150px;
+}
+
+.veryshort_fixedsize{
+ width: 70px;
+}
+
+.all_dynamicsize{
+ width: 100%;
+}
+
+div#formtable {
+ display: table;
+ width: 100%;
+}
+
+div#formtable > span:first-of-type {
+ display: table-row-group;
+ width: 100%;
+}
+
+div.tablerow {
+ display: inline-table;
+ padding: 5px;
+ width: 99%;
+}
+
+div.tablerow.connectorProp {
+ height:22px;
+ vertical-align: middle;
+ font-size: 12px;
+}
+
+div.tablecolumn_connPropAttr {
+ display: table-cell;
+ vertical-align: middle;
+}
+
+div.tablerow2 {
+ display: inline-table;
+ padding: 5px 0px 5px 0px;
+ width: 99%;
+}
+
+div.alt {
+ background: #eff3ea;
+}
+
+div.tablecolumn_label{
+ display: table-cell;
+ font-size: 12px;
+ vertical-align: middle;
+ font-family: Verdana,Tahoma,sans-serif;
+ width: 30%;
+}
+
+div.tablecolumn_field{
+ display: table-cell;
+ vertical-align: middle;
+ font-family: Verdana,Tahoma,sans-serif;
+ width: 70%;
+}
+
+div.tablecolumn_check{
+ display: table-cell;
+ margin-right: 5px;
+ margin-left: 2px;
+ vertical-align: middle;
+}
+
+div.tablecolumn2_label{
+ display: table-cell;
+ font-size: 12px;
+ vertical-align: middle;
+ font-family: Verdana,Tahoma,sans-serif;
+ padding-left: 5px;
+ width: 15%;
+}
+
+div.tablecolumn2_field{
+ display: table-cell;
+ vertical-align: middle;
+ font-family: Verdana,Tahoma,sans-serif;
+ width: 35%;
+}
+
+.ui-tabs .ui-tabs-panel {
+ background: none repeat scroll 0 0 #FFFFFF;
+ border-width: 0;
+ display: block;
+ overflow: auto;
+ padding: 1em 1.4em;
+}
+
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 12px;
+ padding: 2px 4px;
+}
+
+.ui-widget-header {
+ border: 1px solid #aaaaaa
+ /*{borderColorHeader}*/;
+ background: #cccccc
+ /*{bgColorHeader}*/
+ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)
+ /*{bgImgUrlHeader}*/
+ 50%/*{bgHeaderXPos}*/
+ 50%/*{bgHeaderYPos}*/
+ repeat-x/*{bgHeaderRepeat}*/;
+ color: #222222/*{fcHeader}*/;
+ font-weight: bold;
+ padding: 7px 15px;
+}
+
+.ui-button {
+ display: inline-block;
+ position: relative;
+ margin-right: .1em;
+ cursor: pointer;
+ text-align: center;
+ zoom: 1;
+ overflow: visible;
+ padding: 7px 15px;
+}
+
+.ui-spinner-button {
+ cursor: default;
+ display: block;
+ font-size: 0.5em;
+ height: 50%;
+ margin: 0;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ right: 0;
+ text-align: center;
+ width: 16px;
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_diagonals-thick_20_666666_40x40.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
new file mode 100644
index 0000000..64ece57
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_diagonals-thick_20_666666_40x40.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644
index 0000000..fc9ef06
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100_greennotused.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100_greennotused.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100_greennotused.png
new file mode 100644
index 0000000..b3d1999
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_flat_0_aaaaaa_40x100_greennotused.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_55_fbf9ee_1x400.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_55_fbf9ee_1x400.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100644
index 0000000..ad3d634
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_55_fbf9ee_1x400.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_65_ffffff_1x400.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_65_ffffff_1x400.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644
index 0000000..42ccba2
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_65_ffffff_1x400.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_dadada_1x400.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_dadada_1x400.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_dadada_1x400.png
new file mode 100644
index 0000000..5a46b47
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_dadada_1x400.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_e6e6e6_1x400.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_e6e6e6_1x400.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100644
index 0000000..86c2baa
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_75_e6e6e6_1x400.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_95_fef1ec_1x400.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_95_fef1ec_1x400.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100644
index 0000000..4443fdc
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_glass_95_fef1ec_1x400.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100644
index 0000000..5749fc4
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_greynotused.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_greynotused.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_greynotused.png
new file mode 100644
index 0000000..7c9fa6c
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_greynotused.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_red.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_red.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_red.png
new file mode 100644
index 0000000..4632529
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-bg_highlight-soft_75_cccccc_1x100_red.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_222222_256x240.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_222222_256x240.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_222222_256x240.png
new file mode 100644
index 0000000..ee039dc
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_222222_256x240.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_2e83ff_256x240.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_2e83ff_256x240.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_2e83ff_256x240.png
new file mode 100644
index 0000000..45e8928
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_2e83ff_256x240.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_454545_256x240.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_454545_256x240.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_454545_256x240.png
new file mode 100644
index 0000000..7ec70d1
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_454545_256x240.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_888888_256x240.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_888888_256x240.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_888888_256x240.png
new file mode 100644
index 0000000..5ba708c
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_888888_256x240.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_cd0a0a_256x240.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_cd0a0a_256x240.png b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_cd0a0a_256x240.png
new file mode 100644
index 0000000..7930a55
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/css/images/ui-icons_cd0a0a_256x240.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/css/style.css
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/css/style.css b/syncope620/client/console/src/main/resources/META-INF/resources/css/style.css
new file mode 100644
index 0000000..54d8f50
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/META-INF/resources/css/style.css
@@ -0,0 +1,550 @@
+/*
+ * 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.
+ */
+body {
+ margin: 0px;
+ padding: 0px;
+ font-family: Verdana, Tahoma, sans-serif;
+ color: #333;
+ font-size: 62.5%;
+}
+
+/* id */
+#tabs {
+ margin: 0px 5px;
+ margin-top: 5px;
+}
+#roletabs {
+ margin: 0px 5px;
+ margin-top: 5px;
+}
+
+#tabs div {
+ /*background-color: #FFF;*/
+}
+
+#logo {
+ margin-top: 10px;
+ margin-bottom: 6px;
+}
+
+#splash {
+ background: url(../img/sf_testa.png) top repeat-x #B9CFB3;
+ width: 400px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 100px;
+ border: 1px solid #463;
+}
+
+#splash a {
+ color: #463;
+ text-decoration: none;
+ font-size: 14px;
+}
+
+a img {
+ border: none;
+}
+
+#splash h2 {
+ color: #FFF;
+ margin: 0px;
+ margin-top: 8px;
+ margin-bottom: 20px;
+ font-size: 14px;
+ text-align: center;
+ font-weight: normal;
+}
+
+#splash form {
+ margin: 6px auto;
+ width: 300px;
+ text-align: center;
+}
+
+#splash form label {
+ margin-right: 5px;
+ display: block;
+}
+
+#splash form label.password {
+}
+
+#splash form input {
+ margin-bottom: 15px;
+}
+
+#splash p {
+ margin: 6px 16px;
+ border-top: 1px solid #463;
+ text-align: center;
+ padding-top: 8px;
+}
+
+#splash ul {
+ height: 320px;
+ margin-left: 37px;
+ padding-left: 28px;
+ margin-top: 25px;
+}
+
+#splash ul li {
+ float: left;
+ width: 90px;
+ text-align: center;
+ list-style: none;
+ margin: 0px;
+}
+
+input[disabled] {
+ background-color: #ddd;
+ background-image: none;
+}
+
+select[disabled] {
+ background-color: #ddd;
+ background-image: none;
+}
+
+#loginFeedbackDiv {
+ width: 100%;
+}
+
+#loginFeedbackDiv ul {
+ list-style:none outside none;
+ margin:0;
+ text-align:center;
+ width: 100%;
+ height: 30px;
+ margin-left: 0px;
+ padding-left: 0px;
+}
+
+#loginFeedbackDiv ul li{
+ border:0 none;
+ padding-left: 20px;
+ padding: 1%;
+ padding-top: 2%;
+ list-style:none outside none;
+ margin:0;
+ text-align:center;
+ width: 100%;
+}
+
+#feedbackDiv {
+ height: 20px;
+ margin: 0px;
+ padding: 0px;
+}
+
+#feedbackDiv ul{
+ height: 20px !important;
+ margin: 0px;
+ padding: 0px;
+}
+
+#feedbackDiv li{
+ list-style:none outside none;
+ margin:0;
+ text-align:center;
+ width: 100%;
+}
+#feedbackDiv ul li{
+ list-style:none outside none;
+ margin:0;
+ text-align:center;
+ width: 100%;
+ color: red;
+}
+
+.feedbackPanel {
+ padding-left:20pt;
+ margin-right:20pt;
+}
+
+#navigationPane {
+ background: url(../img/sf_testa.png) top repeat-x #FFF;
+}
+
+#navigationPane a img {
+ border: none;
+}
+
+#navigationPane {
+ height: 103px;
+}
+
+#navigationPane a {
+ color: #FFF;
+ text-decoration: none;
+}
+
+#navigationPane a:hover {
+ color: #CCC;
+}
+
+#navigationPane ul {
+ clear: both;
+ padding: 0px;
+ margin: 0px;
+ margin-left: 280px;
+}
+
+#navigationPane ul li {
+ float: left;
+ width: 90px;
+ text-align: center;
+ margin: 0px;
+ color: #FFF;
+ font-size: 13px;
+ list-style: none;
+ padding: 1px;
+}
+
+#navigationPane span {
+ font-size: 13px;
+}
+
+/* MODAL-FORM */
+div#dialog-form label, div#dialog-form input { display:block; }
+div#dialog-form span.radio label, div#dialog-form span.radio input { margin-top: 4px; margin-bottom: 12px; display:inline; }
+/*div#dialog-form span.checkbox label, div#dialog-form span.checkbox input { margin-top: 4px; margin-bottom: 12px; display:inline; }*/
+div#dialog-form input.text { margin-bottom:12px; width: 95%; padding: .4em; }
+div#dialog-form select.text { margin-bottom:12px; width: auto; padding: .4em; }
+div#dialog-form fieldset { padding:0; border:0; margin-top:25px; }
+div#users-contain { width: 570px; margin-bottom: 20px;}/*width: 350px*/
+div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
+div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; }
+div#executions { margin-bottom: 0px;}/*width: 350px*/
+div#executions table { margin: 1em 0; border-collapse: collapse; width: 100%; }
+div#executions table td, div#executions table th { border: 1px solid #eee; padding: .3em 10px; }
+.ui-dialog .ui-state-error { padding: .3em; }
+.validateTips { border: 1px solid transparent; padding: 0.3em; }
+
+/* classi */
+#navigationPane .schema {
+ color: #99C;
+}
+
+#navigationPane a img:hover {
+ opacity:0.5;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
+ filter:alpha(opacity=50)
+}
+
+#splash a img:hover {
+ opacity:0.5;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
+ filter:alpha(opacity=50)
+}
+
+#navigationPane .users {
+ color: #9C0;
+}
+
+#navigationPane .roles {
+ color: #F90;
+}
+
+#navigationPane .resources {
+ color: #09F;
+}
+
+#navigationPane .tasks {
+ color: #FD0;
+}
+
+#navigationPane .todo {
+ color: #F3C98E;
+}
+
+#navigationPane .connectors {
+ color: #09F;
+}
+
+#navigationPane .reports {
+ color: #F66;
+}
+
+#navigationPane .configuration {
+ color: #CCC;
+}
+
+.onerowlabel {
+ float: left;
+}
+
+.onerowcheckbox {
+ margin-left: 10em;
+}
+
+div#attributes-view label {
+ display: block;
+ clear: none;
+ width: 300px;
+ margin-left: 20px;
+}
+
+div#attributes-view input {
+ display: block;
+ float: left;
+ clear: left;
+ height: 12px;
+ padding: 0;
+ margin: 0;
+}
+
+.selectedRow {
+ background-color: #eef1f1; /* alternative: LemonChiffon */
+}
+
+/* WICKET DATATABLE HEADERS */
+.headers {
+ border: 1px solid #aaaaaa;
+ background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)
+ 50% 50% repeat-x;
+}
+
+em {
+ font-size: inherit;
+ color: gray;
+}
+
+em img {
+ opacity:0.4;
+ filter:alpha(opacity=40);
+}
+
+th.action{
+ width: 140px;
+}
+
+td.action{
+ text-align: center;
+}
+
+.navigatorLabel {
+ float: left;
+}
+
+.navigator {
+ text-align: right;
+}
+
+.role-tree {
+ width: 30%;
+ display: block;
+ float: left;
+}
+
+.roleTable {
+ line-height: 1.5em;
+}
+
+.tree-folder-other {
+ padding-top: 2px;
+ display: block;
+ height: 18px;
+}
+
+.tree-folder-open {
+ display: block;
+ height: 18px;
+}
+
+#versionMP {
+ text-align: justify;
+ color: #463;
+ background: url(../img/sf_testa.png) top repeat-x #B9CFB3;
+ border: 1px solid #463;
+ padding: 5px;
+}
+
+#versionMP a {
+ color: white;
+ text-decoration: none;
+}
+
+#versionMP a:hover {
+ color: #463;
+ text-decoration: none;
+}
+
+a.tooltips {
+ position: relative;
+ display: inline;
+ text-decoration: none;
+}
+
+a.tooltips span {
+ position: absolute;
+ width:19em;
+ color: #000000;
+ background: whitesmoke;
+ visibility: hidden;
+ border-radius: 0px;
+ padding: 3px;
+}
+
+a.tooltips span:after {
+ position: absolute;
+ top: 50%;
+ left: 100%;
+ margin-top: -8px;
+ width: 0;
+ height: 0;
+}
+
+a.tooltips span {
+ visibility: visible;
+ opacity: none;
+ right: 100%;
+ top: 50%;
+ margin-right: 4px;
+ margin-top: -11px;
+ border: 1px solid black;
+ z-index: 1000000;
+}
+
+a.tooltips span a {
+ color: #463;
+ text-decoration: none;
+}
+
+.tree-junction-expanded {
+ display: none;
+}
+
+/* Style for autocomplete field */
+div.wicket-aa {
+ font-family: "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana;
+ font-size: 12px;
+ background-color: white;
+ border-width: 1px;
+ border-color: #cccccc;
+ border-style: solid;
+ padding: 2px;
+ margin: 1px 0 0 0;
+ text-align:left;
+}
+div.wicket-aa ul {
+ list-style:none;
+ padding: 2px;
+ margin:0;
+}
+div.wicket-aa ul li.selected {
+ background-color: #FFFF00;
+ padding: 2px;
+ margin:0;
+}
+
+.notificationpanel {
+ margin: 0px;
+ padding: 0px;
+ border-radius: 5px;
+}
+
+.notificationpanel_bottom_left {
+ bottom: 100px;
+ left: 30px;
+}
+
+.notificationpanel_bottom_detail_form {
+ top: 540px;
+ right: 30px;
+}
+
+.notificationpanel_bottom_right {
+ bottom: 100px;
+ right: 30px;
+}
+
+.notificationpanel_top_right {
+ top: 15px;
+ right: 30px;
+}
+
+/* notification panel info style */
+.notificationpanel_border_200 {
+ color: green;
+ margin: 0px;
+ background:url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") repeat-x scroll 50% 50% #CCCCCC;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border: 1px solid gray;
+ box-shadow: 0px 0px 5px gray;
+}
+
+.notificationpanel_row_INFO {
+ list-style-type: none;
+ color: green;
+}
+
+.notificationpanel_row_INFO span {
+ list-style-type: none;
+ color: green;
+ background: url("../img/ok.png") no-repeat left;
+ border:0 none;
+ padding-left: 20px;
+}
+
+/* notification panel warning style */
+.notificationpanel_border_300 {
+ border: 1px solid orangered;
+ box-shadow: 0px 0px 5px gray;
+}
+
+.notificationpanel_row_WARNING {
+ color: orangered;
+ list-style-type: none;
+ border:0 none;
+ padding-left: 20px;
+}
+
+/* notification panel error style */
+.notificationpanel_border_400 {
+ color: red;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border: 1px solid gray;
+ box-shadow: 0px 0px 5px gray;
+ border-color: red;
+ background-image: -moz-linear-gradient(top, #FF8585 0%, #E60008 100%);
+ background-image: -webkit-linear-gradient(top, #FF8585 0%, #E60008 100%);
+ background-image: -o-linear-gradient(top, #FF8585 0%, #E60008 100%);
+ background-image: -ms-linear-gradient(top, #FF8585 0%, #E60008 100%);
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FF8585), color-stop(1, #E60008));
+ font-weight: bold;
+}
+
+.notificationpanel_row_ERROR {
+ list-style-type: none;
+ color: black;
+}
+
+.notificationpanel_row_ERROR span {
+ border:0 none;
+}
+pre {
+ white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
+ white-space: -pre-wrap; /* Opera */
+ white-space: -o-pre-wrap; /* Opera */
+ white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
+ word-wrap: break-word; /* IE 5.5+ */
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/assign-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/assign-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/assign-icon.png
new file mode 100644
index 0000000..f9f2a33
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/assign-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/both-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/both-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/both-icon.png
new file mode 100644
index 0000000..0f98eec
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/both-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/bulk.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/bulk.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/bulk.png
new file mode 100644
index 0000000..ea6d145
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/bulk.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/claim.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/claim.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/claim.png
new file mode 100644
index 0000000..79332c0
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/claim.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/create.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/create.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/create.png
new file mode 100644
index 0000000..3f8faf1
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/create.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/delete.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/delete.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/delete.png
new file mode 100644
index 0000000..1207d8d
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/delete.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/deprovision-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/deprovision-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/deprovision-icon.png
new file mode 100644
index 0000000..4bc2f4e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/deprovision-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/dryrun.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/dryrun.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/dryrun.png
new file mode 100644
index 0000000..910b148
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/dryrun.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/edit.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/edit.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/edit.png
new file mode 100644
index 0000000..80e00db
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/edit.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/enable.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/enable.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/enable.png
new file mode 100644
index 0000000..39ba0ca
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/enable.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/execute.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/execute.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/execute.png
new file mode 100644
index 0000000..443c719
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/execute.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/export.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/export.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/export.png
new file mode 100644
index 0000000..038583b
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/export.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/link-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/link-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/link-icon.png
new file mode 100644
index 0000000..8c166af
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/link-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/manage-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/manage-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/manage-icon.png
new file mode 100644
index 0000000..2e8e190
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/manage-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/none-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/none-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/none-icon.png
new file mode 100644
index 0000000..cc49adb
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/none-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/propagation-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/propagation-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/propagation-icon.png
new file mode 100644
index 0000000..d7fa5e9
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/propagation-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/provision-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/provision-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/provision-icon.png
new file mode 100644
index 0000000..3f8faf1
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/provision-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reactivate.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reactivate.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reactivate.png
new file mode 100644
index 0000000..50503e2
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reactivate.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reload.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reload.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reload.png
new file mode 100644
index 0000000..bbf878e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reload.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reset.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reset.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reset.png
new file mode 100644
index 0000000..bbf878e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/reset.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/resources-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/resources-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/resources-icon.png
new file mode 100644
index 0000000..6240ba9
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/resources-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/roles-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/roles-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/roles-icon.png
new file mode 100644
index 0000000..9669486
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/roles-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/search.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/search.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/search.png
new file mode 100644
index 0000000..3ac297e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/search.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/select.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/select.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/select.png
new file mode 100644
index 0000000..f2ea103
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/select.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/settings-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/settings-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/settings-icon.png
new file mode 100644
index 0000000..1da7e05
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/settings-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/suspend.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/suspend.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/suspend.png
new file mode 100644
index 0000000..bd5f0bd
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/suspend.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/synchronization-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/synchronization-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/synchronization-icon.png
new file mode 100644
index 0000000..394b907
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/synchronization-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unassign-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unassign-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unassign-icon.png
new file mode 100644
index 0000000..860dc49
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unassign-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unlink-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unlink-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unlink-icon.png
new file mode 100644
index 0000000..86700a5
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/unlink-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/user_template.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/user_template.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/user_template.png
new file mode 100644
index 0000000..6db6de8
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/user_template.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/users-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/users-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/users-icon.png
new file mode 100644
index 0000000..cfab465
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/actions/users-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/add.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/add.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/add.png
new file mode 100644
index 0000000..043aba8
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/add.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/addAll.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/addAll.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/addAll.png
new file mode 100644
index 0000000..86633fc
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/addAll.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/busy.gif
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/busy.gif b/syncope620/client/console/src/main/resources/META-INF/resources/img/busy.gif
new file mode 100644
index 0000000..e77264f
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/busy.gif differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/db_export.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/db_export.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/db_export.png
new file mode 100644
index 0000000..413cb06
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/db_export.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/disable.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/disable.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/disable.png
new file mode 100644
index 0000000..26fbe85
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/disable.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/down-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/down-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/down-icon.png
new file mode 100644
index 0000000..6f818ee
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/down-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico b/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico
new file mode 100644
index 0000000..599ec2b
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/favicon.ico differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/file-download.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/file-download.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/file-download.png
new file mode 100644
index 0000000..ceae906
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/file-download.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/file-upload.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/file-upload.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/file-upload.png
new file mode 100644
index 0000000..d4a399e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/file-upload.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/help.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/help.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/help.png
new file mode 100644
index 0000000..560064e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/help.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/info.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/info.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/info.png
new file mode 100644
index 0000000..f1a4832
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/info.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/left-icon.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/left-icon.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/left-icon.png
new file mode 100644
index 0000000..03b215c
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/left-icon.png differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/loading.gif
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/loading.gif b/syncope620/client/console/src/main/resources/META-INF/resources/img/loading.gif
new file mode 100644
index 0000000..85b99d4
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/loading.gif differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/resources/META-INF/resources/img/logo.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/META-INF/resources/img/logo.png b/syncope620/client/console/src/main/resources/META-INF/resources/img/logo.png
new file mode 100644
index 0000000..f05105e
Binary files /dev/null and b/syncope620/client/console/src/main/resources/META-INF/resources/img/logo.png differ
[49/52] syncope git commit: [SYNCOPE-620] Console working,
Selenium IT in
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
index 130c89a..1bec3b7 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.html
@@ -17,220 +17,211 @@ specific language governing permissions and limitations
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#policies").tabs();
- $("#logs").tabs();
- $("#layouts").tabs();
- });
- </script>
- </wicket:head>
+ <wicket:head>
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $("#policies").tabs();
+ $("#logs").tabs();
+ $("#layouts").tabs();
+ });
+ </script>
+ </wicket:head>
- <wicket:extend>
+ <wicket:extend>
- <div id="tabs">
- <ul>
- <li class="tabs-selected">
- <a href="#layouts"><span><wicket:message key="layouts"/></span></a>
- </li>
- <li><a href="#policies"><span><wicket:message key="policies"/></span></a></li>
- <li><a href="#notifications"><span><wicket:message key="notifications"/></span></a></li>
- <li><a href="#securityQuestions"><span><wicket:message key="securityQuestions"/></span></a></li>
- <li><a href="#workflow"><span><wicket:message key="workflow"/></span></a></li>
- <li wicket:id="routeTab"><a href="#routes"><span><wicket:message key="routes"/></span></a></li>
- <li><a href="#logs"><span><wicket:message key="logs"/></span></a></li>
- </ul>
- <div id="layouts">
- <ul>
- <li class="tabs-selected">
- <a href="#adminUser"><span><wicket:message key="adminUser"/></span></a>
- </li>
- <li><a href="#selfUser"><span><wicket:message key="selfUser"/></span></a></li>
- <li><a href="#adminRole"><span><wicket:message key="adminRole"/></span></a></li>
- <li><a href="#selfRole"><span><wicket:message key="selfRole"/></span></a></li>
- <li><a href="#adminMembership"><span><wicket:message key="adminMembership"/></span></a></li>
- <li><a href="#selfMembership"><span><wicket:message key="selfMembership"/></span></a></li>
- </ul>
- <div id="adminUser" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="adminUserLayoutPanel">[admin user layout panel]</span>
- </div>
- <div id="selfUser" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="selfUserLayoutPanel">[self user layout panel]</span>
- </div>
- <div id="adminRole" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="adminRoleLayoutPanel">[admin role layout panel]</span>
- </div>
- <div id="selfRole" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="selfRoleLayoutPanel">[self role layout panel]</span>
- </div>
- <div id="adminMembership" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="adminMembershipLayoutPanel">[admin membership layout panel]</span>
- </div>
- <div id="selfMembership" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="selfMembershipLayoutPanel">[self membership layout panel]</span>
- </div>
- </div>
- <div id="policies">
- <ul>
- <li class="tabs-selected">
- <a href="#account"><span><wicket:message key="account"/></span></a>
- </li>
- <li><a href="#password"><span><wicket:message key="password"/></span></a></li>
- <li><a href="#sync"><span><wicket:message key="sync"/></span></a></li>
- </ul>
- <div id="account" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="accountPoliciesPanel">[account policies]</span>
- </div>
- <div id="password" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="passwordPoliciesPanel">[password policies]</span>
- </div>
- <div id="sync" style="border-width: 1px;border-top-width: 0px;">
- <span wicket:id="syncPoliciesPanel">[sync policies]</span>
- </div>
- </div>
- <div id="notifications">
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="notificationContainer">
- <table class="ui-widget ui-widget-content table-hover"
- wicket:id="notificationTable"/>
- </span>
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#layouts"><span><wicket:message key="layouts"/></span></a>
+ </li>
+ <li><a href="#policies"><span><wicket:message key="policies"/></span></a></li>
+ <li><a href="#notifications"><span><wicket:message key="notifications"/></span></a></li>
+ <li><a href="#securityQuestions"><span><wicket:message key="securityQuestions"/></span></a></li>
+ <li><a href="#workflow"><span><wicket:message key="workflow"/></span></a></li>
+ <li><a href="#logs"><span><wicket:message key="logs"/></span></a></li>
+ </ul>
+ <div id="layouts">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#adminUser"><span><wicket:message key="adminUser"/></span></a>
+ </li>
+ <li><a href="#selfUser"><span><wicket:message key="selfUser"/></span></a></li>
+ <li><a href="#adminRole"><span><wicket:message key="adminRole"/></span></a></li>
+ <li><a href="#selfRole"><span><wicket:message key="selfRole"/></span></a></li>
+ <li><a href="#adminMembership"><span><wicket:message key="adminMembership"/></span></a></li>
+ <li><a href="#selfMembership"><span><wicket:message key="selfMembership"/></span></a></li>
+ </ul>
+ <div id="adminUser" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="adminUserLayoutPanel">[admin user layout panel]</span>
+ </div>
+ <div id="selfUser" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="selfUserLayoutPanel">[self user layout panel]</span>
+ </div>
+ <div id="adminRole" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="adminRoleLayoutPanel">[admin role layout panel]</span>
+ </div>
+ <div id="selfRole" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="selfRoleLayoutPanel">[self role layout panel]</span>
+ </div>
+ <div id="adminMembership" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="adminMembershipLayoutPanel">[admin membership layout panel]</span>
+ </div>
+ <div id="selfMembership" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="selfMembershipLayoutPanel">[self membership layout panel]</span>
+ </div>
+ </div>
+ <div id="policies">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#account"><span><wicket:message key="account"/></span></a>
+ </li>
+ <li><a href="#password"><span><wicket:message key="password"/></span></a></li>
+ <li><a href="#sync"><span><wicket:message key="sync"/></span></a></li>
+ </ul>
+ <div id="account" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="accountPoliciesPanel">[account policies]</span>
+ </div>
+ <div id="password" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="passwordPoliciesPanel">[password policies]</span>
+ </div>
+ <div id="sync" style="border-width: 1px;border-top-width: 0px;">
+ <span wicket:id="syncPoliciesPanel">[sync policies]</span>
+ </div>
+ </div>
+ <div id="notifications">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="notificationContainer">
+ <table class="ui-widget ui-widget-content table-hover"
+ wicket:id="notificationTable"/>
+ </span>
- <span style="float:right">
- <form wicket:id="notificationPaginatorForm" style="display:inline">
- <label><wicket:message key="displayRows"/></label>
- <select class="text ui-widget-content ui-corner-all"
- wicket:id="rowsChooser"/>
- </form>
- </span>
- </div>
+ <span style="float:right">
+ <form wicket:id="notificationPaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
- <div wicket:id="createNotificationWin">[Show modal window for creating notification]</div>
- <div wicket:id="editNotificationWin">[Show modal window for editing notification]</div>
+ <div wicket:id="createNotificationWin">[Show modal window for creating notification]</div>
+ <div wicket:id="editNotificationWin">[Show modal window for editing notification]</div>
- <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="createNotificationLink">
- <wicket:message key="create"/>
- </a>
- </div>
- <div id="securityQuestions">
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="securityQuestionContainer">
- <table class="ui-widget ui-widget-content table-hover"
- wicket:id="securityQuestionTable"/>
- </span>
- </div>
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createNotificationLink">
+ <wicket:message key="create"/>
+ </a>
+ </div>
+ <div id="securityQuestions">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="securityQuestionContainer">
+ <table class="ui-widget ui-widget-content table-hover"
+ wicket:id="securityQuestionTable"/>
+ </span>
+ </div>
- <div wicket:id="createSecurityQuestionWin">[Show modal window for creating security questions]</div>
- <div wicket:id="editSecurityQuestionWin">[Show modal window for editing security questions]</div>
+ <div wicket:id="createSecurityQuestionWin">[Show modal window for creating security questions]</div>
+ <div wicket:id="editSecurityQuestionWin">[Show modal window for editing security questions]</div>
- <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="createSecurityQuestionLink">
- <wicket:message key="create"/>
- </a>
- </div>
- <div id="workflow">
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="noActivitiEnabledForUsers"><i><wicket:message key="noActivitiEnabledForUsers"/></i></span>
- <span wicket:id="workflowDefContainer">
- <div style="float: left;">
- <button wicket:id="activitiModeler" style="width: 122px">
- <div style="display: table-row;">
- <div style="display: table-cell">
- <img src="img/modeler.png" alt="Activiti Modeler" title="Activiti Modeler"/>
- </div>
- <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
- Activiti Modeler
- </div>
- </div>
- </button>
- </div>
- <div>
- <button wicket:id="xmlEditor" style="width: 122px">
- <div style="display: table-row;">
- <div style="display: table-cell">
- <img src="img/xml.png" alt="XML editor" title="XML editor"/>
- </div>
- <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
- XML editor
- </div>
- </div>
- </button>
- </div>
- <img wicket:id="workflowDefDiagram" style="width: 100%;"/>
- </span>
- </div>
- </div>
- <div id="routes">
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="routesContainer">
- <table class="ui-widget ui-widget-content table-hover" wicket:id="routeTable"/>
- </span>
- </div>
- <div wicket:id="editRouteWin">[Show modal window for editing route]</div>
- </div>
- <div id="logs">
- <ul>
- <li class="tabs-selected">
- <a href="#core"><span>Core</span></a>
- </li>
- <li><a href="#console"><span>Console</span></a></li>
- </ul>
- <div id="core" style="border-width: 1px;border-top-width: 0px;">
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="coreLoggerContainer">
- <table class="ui-widget ui-widget-content table-hover">
- <thead class="ui-widget-header">
- <tr class="heaaders">
- <th><wicket:message key="logger"/></th>
- <th><wicket:message key="level"/></th>
- </tr>
- </thead>
- <tbody>
- <tr wicket:id="corelogger">
- <td><span wicket:id="name"/></td>
- <td id="level"><select wicket:id="level"/></td>
- </tr>
- </tbody>
- </table>
- </span>
- </div>
- </div>
- <div id="console" style="border-width: 1px;border-top-width: 0px;">
- <div id="users-contain" class="ui-widget" style="width:inherit">
- <span wicket:id="consoleLoggerContainer">
- <table class="ui-widget ui-widget-content table-hover">
- <thead class="ui-widget-header">
- <tr class="heaaders">
- <th><wicket:message key="logger"/></th>
- <th><wicket:message key="level"/></th>
- </tr>
- </thead>
- <tbody>
- <tr wicket:id="consolelogger">
- <td><span wicket:id="name"/></td>
- <td id="level"><select wicket:id="level"/></td>
- </tr>
- </tbody>
- </table>
- </span>
- </div>
- </div>
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createSecurityQuestionLink">
+ <wicket:message key="create"/>
+ </a>
+ </div>
+ <div id="workflow">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="noActivitiEnabledForUsers"><i><wicket:message key="noActivitiEnabledForUsers"/></i></span>
+ <span wicket:id="workflowDefContainer">
+ <div style="float: left;">
+ <button wicket:id="activitiModeler" style="width: 122px">
+ <div style="display: table-row;">
+ <div style="display: table-cell">
+ <img src="img/modeler.png" alt="Activiti Modeler" title="Activiti Modeler"/>
+ </div>
+ <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
+ Activiti Modeler
+ </div>
+ </div>
+ </button>
</div>
<div>
- <div wicket:id="parameters">
- <a style="position: absolute; top: 2px; right:50px;" wicket:id="confLink">
- <img src="img/actions/settings-icon.png" width="30" height="30"
- alt="Parameters" title="title" wicket:message="title:parameters"/>
- </a>
- </div>
- <div wicket:id="syncopeConfWin">[Show modal window for conf parameters]</div>
-
- <a style="position: absolute; top: 2px; right:20px;" wicket:id="dbExportLink">
- <img src="img/db_export.png" width="30" height="30"
- alt="DB export" title="title" wicket:message="title:db_export"/>
- </a>
- </div>
+ <button wicket:id="xmlEditor" style="width: 122px">
+ <div style="display: table-row;">
+ <div style="display: table-cell">
+ <img src="img/xml.png" alt="XML editor" title="XML editor"/>
+ </div>
+ <div style="display: table-cell;vertical-align:middle;font-size:62.5%;">
+ XML editor
+ </div>
+ </div>
+ </button>
+ </div>
+ <img wicket:id="workflowDefDiagram" style="width: 100%;"/>
+ </span>
</div>
- </wicket:extend>
+ </div>
+ <div id="logs">
+ <ul>
+ <li class="tabs-selected">
+ <a href="#core"><span>Core</span></a>
+ </li>
+ <li><a href="#console"><span>Console</span></a></li>
+ </ul>
+ <div id="core" style="border-width: 1px;border-top-width: 0px;">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="coreLoggerContainer">
+ <table class="ui-widget ui-widget-content table-hover">
+ <thead class="ui-widget-header">
+ <tr class="heaaders">
+ <th><wicket:message key="logger"/></th>
+ <th><wicket:message key="level"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="corelogger">
+ <td><span wicket:id="key"/></td>
+ <td id="level"><select wicket:id="level"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+ <div id="console" style="border-width: 1px;border-top-width: 0px;">
+ <div id="users-contain" class="ui-widget" style="width:inherit">
+ <span wicket:id="consoleLoggerContainer">
+ <table class="ui-widget ui-widget-content table-hover">
+ <thead class="ui-widget-header">
+ <tr class="heaaders">
+ <th><wicket:message key="logger"/></th>
+ <th><wicket:message key="level"/></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr wicket:id="consolelogger">
+ <td><span wicket:id="key"/></td>
+ <td id="level"><select wicket:id="level"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div wicket:id="parameters">
+ <a style="position: absolute; top: 2px; right:50px;" wicket:id="confLink">
+ <img src="img/actions/settings-icon.png" width="30" height="30"
+ alt="Parameters" title="title" wicket:message="title:parameters"/>
+ </a>
+ </div>
+ <div wicket:id="syncopeConfWin">[Show modal window for conf parameters]</div>
+
+ <a style="position: absolute; top: 2px; right:20px;" wicket:id="dbExportLink">
+ <img src="img/db_export.png" width="30" height="30"
+ alt="DB export" title="title" wicket:message="title:db_export"/>
+ </a>
+ </div>
+ </div>
+ </wicket:extend>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
index f59b50f..1b6bcc7 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Configuration.properties
@@ -45,4 +45,3 @@ adminRole=Administrator Role Form
selfRole=Self Role Form
adminMembership=Administrator Membership Form
selfMembership=Self Membership Form
-routes=Routes
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
index 2507acf..b85acb6 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.html
@@ -18,7 +18,9 @@ under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:extend>
- <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <p class="ui-widget ui-corner-all ui-widget-header">
+ <span wicket:id="new"/> <wicket:message key="title"/> <span wicket:id="key"/>
+ </p>
<div style="margin: 5px;">
<form wicket:id="form">
<div id="tabs">
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
index 5ded4ac..8500f1a 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage.properties
@@ -26,7 +26,7 @@ edit=Edit
edit_attribute=Edit attribute
serviceName=Service name
endpoint=Endpoint
-title=Connectors
+title=Connector
overridable=Overridable
property=Property
value=Value
@@ -40,3 +40,4 @@ poolMinIdle=Min idle objects
poolMaxIdle=Max idle objects
poolMaxWait=Max waiting time (msec)
poolMinEvictableIdleTime=Min eviction time (msec)
+new=New
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
index 4c329af..96080c3 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_it.properties
@@ -25,7 +25,7 @@ edit=Edit
edit_attribute=Edit attribute
serviceName=Nome servizio
endpoint=Endpoint
-title=Connettori
+title=Connettore
displayName=Nome visualizzato
overridable=Sovrascrivibile
property=Propriet\u00e0
@@ -40,3 +40,4 @@ poolMinIdle=Max oggetti attivi
poolMaxIdle=Max oggetti inattivi
poolMaxWait=Tempo max attesa
poolMinEvictableIdleTime=Tempo min espulsione
+new=Nuovo
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
index 30a7e4a..b688216 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ConnectorModalPage_pt_BR.properties
@@ -26,7 +26,7 @@ edit=Alterar
edit_attribute=Alterar Atributo
serviceName=Nome de Servi\u00e7o
endpoint=Endpoint
-title=Conectores
+title=Conector
overridable=Alter\u00e1vel
property=Propriedade
value=Valor
@@ -40,3 +40,4 @@ poolMinIdle=Min idle objects
poolMaxIdle=Max idle objects
poolMaxWait=Max waiting time (msec)
poolMinEvictableIdleTime=Min eviction time (msec)
+new=Novo
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
index 49595e1..5665e0e 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DerSchemaModalPage.html
@@ -24,10 +24,10 @@ under the License.
<div id="formtable">
<div class="tablerow alt">
<div class="tablecolumn_label short_dynamicsize">
- <label for="name"><wicket:message key="name"/></label>
+ <label for="key"><wicket:message key="key"/></label>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="name">[name]</span>
+ <span wicket:id="key">[name]</span>
</div>
</div>
<div class="tablerow">
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
index 9d9d233..998483d 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
@@ -67,7 +67,7 @@ under the License.
<wicket:message key="title"/>
</p>
- <span class="grouplabel"><wicket:message key="schemas"/></span>
+ <span class="grouplabel"><wicket:message key="plainSchemas"/></span>
<span wicket:id="dCheckGroup">
<div class="group">
<div wicket:id="details">
@@ -77,7 +77,7 @@ under the License.
</div>
</span>
- <span wicket:id="schemas">[schemas]</span>
+ <span wicket:id="plainSchemas">[schemas]</span>
<span wicket:id="dschemas">[derived schemas]</span>
@@ -86,9 +86,9 @@ under the License.
</div>
<wicket:fragment wicket:id="sfragment">
- <span wicket:id="sCheckGroup">
+ <span wicket:id="psCheckGroup">
<div class="group">
- <div wicket:id="schemas">
+ <div wicket:id="plainSchemas">
<input type="checkbox" wicket:id="scheck"/>
<span wicket:id="sname">[schema name]</span>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
index 4f64bcf..e7080ed 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
@@ -16,7 +16,7 @@
# under the License.
title=Change display attributes
tooManySelections=Too many columns to be shown
-schemas=User attributes
+plainSchemas=User plain attributes
derSchemas=User derived attributes
virSchemas=User virtual attributes
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
index 60f818f..6ee5963 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_it.properties
@@ -16,7 +16,7 @@
# under the License.
title=Scegli attributi da visualizzare
tooManySelections=Troppe colonne da visualizzare
-schemas=Attributi utente
+plainSchemas=Attributi normali utente
derSchemas=Attributi derivati utente
virSchemas=Attributi virtuali utente
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
index 7c7fa7b..7f2b8cb 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage_pt_BR.properties
@@ -16,18 +16,18 @@
# under the License.
title=Alterar atributos mostrados
tooManySelections=Muitas colunas para exibir
-schemas=Atributo de Usu\u00E1rios
-derSchemas=Atributos Derivados de Usu\u00E1rios
-virSchemas=Atributos virtuais de Usu\u00E1rios
+plainSchemas=Atributo Normal de Usu\u00e1rios
+derSchemas=Atributos Derivados de Usu\u00e1rios
+virSchemas=Atributos virtuais de Usu\u00e1rios
firstname=Nome
surname=Sobrenome
-userId=Identificador de Usu\u00E1rio
+userId=Identificador de Usu\u00e1rio
edit=Alterar
delete=Excluir
status=Estatus
token=Token
-username=Nome do Usu\u00E1rio
-creationDate=Data de Cria\u00E7\u00E3o
+username=Nome do Usu\u00e1rio
+creationDate=Data de Cria\u00e7\u00e3o
tokenValued=Valorado
-tokenNotValued=N\u00E3o Valorado
+tokenNotValued=N\u00e3o Valorado
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
index 097f2e6..78436de 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Login.html
@@ -25,7 +25,7 @@ under the License.
<title>Apache Syncope - Login</title>
- <link rel="shortcut icon" href="img/favicon.ico"/>
+ <link rel="shortcut icon" href="img/favicon.png" type="image/png"/>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all"/>
<script type="text/javascript">
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
index 9af223b..9bc8cb7 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.html
@@ -28,7 +28,7 @@ under the License.
</ul>
<div id="tabs-1">
<div id="formtable">
- <span wicket:id="attrs">[membership attributes]</span>
+ <span wicket:id="plainAttrs">[membership plain attributes]</span>
<span wicket:id="systeminformation">[System Information]</span>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
index d767290..28db548 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage.properties
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-tab1=Attributes
+tab1=Plain attributes
tab2=Derived attributes
tab3=Virtual attributes
title=Roles
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
index f442cf4..0776461 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_it.properties
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-tab1=Attributi
+tab1=Attributi normali
tab2=Attributi derivati
tab3=Attributi virtuali
title=Ruoli
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
index 66d9cc5..481bc0c 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/MembershipModalPage_pt_BR.properties
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-tab1=Atributos
+tab1=Atributos Normal
tab2=Atributos Derivados
tab3=Atributos Virtuais
title=Fun\u00e7\u00f5es
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
index 116ccca..c406ce9 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/NotificationTaskModalPage.html
@@ -16,94 +16,96 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<wicket:extend>
- <div id="dialog-form">
- <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
- <form wicket:id="form">
- <div id="tabs">
- <ul>
- <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
- <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
- </ul>
- <div id="profile">
- <div id="users-contain" class="ui-widget">
- <span wicket:id="profile">
- <div id="formtable">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div id="dialog-form">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <span wicket:id="idLabel">[Id]</span>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="key">[key]</span>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
- </div>
- </div>
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="sender"><wicket:message key="sender"/></label>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="sender"><wicket:message key="sender"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="sender">[sender]</span>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="sender">[sender]</span>
- </div>
- </div>
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="recipients"><wicket:message key="recipients"/></label>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="recipients"><wicket:message key="recipients"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="recipients">[recipients]</span>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="recipients">[recipients]</span>
- </div>
- </div>
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="subject"><wicket:message key="subject"/></label>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="subject"><wicket:message key="subject"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="subject">[subject]</span>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="subject">[subject]</span>
- </div>
- </div>
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="textBody"><wicket:message key="textBody"/></label>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="textBody"><wicket:message key="textBody"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <textarea wicket:id="textBody" cols="40" rows="10">[textBody]</textarea>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <textarea wicket:id="textBody" cols="40" rows="10">[textBody]</textarea>
- </div>
- </div>
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="htmlBody"><wicket:message key="htmlBody"/></label>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="htmlBody"><wicket:message key="htmlBody"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <textarea wicket:id="htmlBody" cols="40" rows="10">[textBody]</textarea>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <textarea wicket:id="htmlBody" cols="40" rows="10">[textBody]</textarea>
- </div>
- </div>
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="traceLevel"><wicket:message key="traceLevel"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="traceLevel">[traceLevel]</span>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="traceLevel"><wicket:message key="traceLevel"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="traceLevel">[traceLevel]</span>
+ </div>
</div>
</div>
- </div>
+ </span>
+ </div>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
</span>
</div>
</div>
- <div id="executions" class="ui-widget">
- <span wicket:id="executionContainer" id="executionContainer">
- <table class="ui-widget ui-widget-content"
- wicket:id="executionsTable" style="width: 100%"/>
- </span>
- </div>
- </div>
- </form>
- </div>
- <div wicket:id="taskExecMessageWin"/>
-</wicket:extend>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
index 43b95cb..154419f 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PlainSchemaModalPage.html
@@ -24,10 +24,10 @@ under the License.
<div id="formtable">
<div class="tablerow alt">
<div class="tablecolumn_label short_dynamicsize">
- <label for="name"><wicket:message key="name"/></label>
+ <label for="key"><wicket:message key="key"/></label>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="name">[name]</span>
+ <span wicket:id="key">[name]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
index a05658f..504d72c 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PolicyModalPage.html
@@ -34,10 +34,10 @@ under the License.
<div id="formtable">
<div class="tablerow alt">
<div class="tablecolumn_label short_fixedsize">
- <label for="id"><wicket:message key="id"/></label>
+ <label for="key"><wicket:message key="key"/></label>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
+ <span wicket:id="key">[key]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
index b620b89..67ac588 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PropagationTaskModalPage.html
@@ -16,58 +16,60 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<wicket:extend>
- <div id="dialog-form">
- <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
- <form wicket:id="form">
- <div id="tabs">
- <ul>
- <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
- <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
- </ul>
- <div id="profile">
- <div id="users-contain" class="ui-widget">
- <span wicket:id="profile">
- <div id="formtable">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div id="dialog-form">
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
+ <form wicket:id="form">
+ <div id="tabs">
+ <ul>
+ <li class="tabs-selected"><a href="#profile"><span><wicket:message key="profile"/></span></a></li>
+ <li><a href="#executions"><span><wicket:message key="executions"/></span></a></li>
+ </ul>
+ <div id="profile">
+ <div id="users-contain" class="ui-widget">
+ <span wicket:id="profile">
+ <div id="formtable">
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <span wicket:id="idLabel">[Id]</span>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <span wicket:id="idLabel">[Id]</span>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="key">[key]</span>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
- </div>
- </div>
- <div class="tablerow">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="accountId"><wicket:message key="accountId"/></label>
+ <div class="tablerow">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="accountId"><wicket:message key="accountId"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="accountId">[accountId]</span>
+ </div>
</div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="accountId">[accountId]</span>
- </div>
- </div>
- <div class="tablerow alt">
- <div class="tablecolumn_label short_dynamicsize">
- <label for="resource"><wicket:message key="resource"/></label>
- </div>
- <div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="resource">[resource]</span>
+ <div class="tablerow alt">
+ <div class="tablecolumn_label short_dynamicsize">
+ <label for="resource"><wicket:message key="resource"/></label>
+ </div>
+ <div class="tablecolumn_field medium_dynamicsize">
+ <span wicket:id="resource">[resource]</span>
+ </div>
</div>
</div>
- </div>
+ </span>
+ </div>
+ </div>
+ <div id="executions" class="ui-widget">
+ <span wicket:id="executionContainer" id="executionContainer">
+ <table class="ui-widget ui-widget-content"
+ wicket:id="executionsTable" style="width: 100%"/>
</span>
</div>
</div>
- <div id="executions" class="ui-widget">
- <span wicket:id="executionContainer" id="executionContainer">
- <table class="ui-widget ui-widget-content"
- wicket:id="executionsTable" style="width: 100%"/>
- </span>
- </div>
- </div>
- </form>
- </div>
- <div wicket:id="taskExecMessageWin"/>
-</wicket:extend>
+ </form>
+ </div>
+ <div wicket:id="taskExecMessageWin"/>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
index 8814e69..37047cc 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/PushTaskModalPage.html
@@ -39,7 +39,7 @@ under the License.
<span wicket:id="idLabel">[Id]</span>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
+ <span wicket:id="key">[key]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
index 8886b3f..b813b12 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ReportModalPage.html
@@ -37,7 +37,7 @@ under the License.
<span wicket:id="idLabel">[Id]</span>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
+ <span wicket:id="key">[key]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
index 4804deb..a681eb0 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/ResourceModalPage_pt_BR.properties
@@ -56,5 +56,5 @@ error_connection=Conex\u00e3o sem sucesso
check=Verificar a conex\u00e3o
actionsClasses=Classes de a\u00e7\u00f5es
rmapping=Regra de Mapeamento
-new=novo
+new=Novo
randomPwdIfNotProvided=Gerar senhas aleat\u00f3rias quando n\u00e3o houver
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
index 3f54815..6406807 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.html
@@ -28,7 +28,7 @@ under the License.
<ul>
<li><a href="#details"><span><wicket:message key="details"/></span></a></li>
<li><a href="#templates"><span><wicket:message key="templates"/></span></a></li>
- <li><a href="#attrs"><span><wicket:message key="attrs"/></span></a></li>
+ <li><a href="#plainAttrs"><span><wicket:message key="plainAttrs"/></span></a></li>
<li><a href="#derAttrs"><span><wicket:message key="derAttrs"/></span></a></li>
<li><a href="#virAttrs"><span><wicket:message key="virAttrs"/></span></a></li>
<li><a href="#resources"><span><wicket:message key="resources"/></span></a></li>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
index 37091a0..a24551c 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage.properties
@@ -17,7 +17,7 @@
required_alert=All form fields are required.
title=Role
details=Details
-attrs=Attributes
+plainAttrs=Plain attributes
tab3=Derived attributes
tab4=Virtual attributes
resources=Resources
@@ -42,7 +42,7 @@ virAttrValue=Virtual value
addAttributeBtn=Add
-inheritAttrs=Inherit attributes
+inheritPlainAttrs=Inherit plain attributes
inheritDerAttrs=Inherit derived attributes
inheritVirAttrs=Inherit virtual attributes
templates=Templates
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
index cf2017e..c97fe6f 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_it.properties
@@ -17,7 +17,7 @@
required_alert=All form fields are required.
title=Ruolo
details=Dettagli
-attrs=Attributi
+plainAttrs=Attributi normali
tab3=Attributi derivati
tab4=Attributi virtuali
resources=Risorse
@@ -28,8 +28,8 @@ drop=-
error=Errore generico durante l'operazione
firstResourcesList=Risorse ruolo
secondResourcesList=Risorse disponibili
-firstResourcesList=Entitlement ruolo
-secondResourcesList=Entitlement disponibili
+firstResourcesList=Risorse ruolo
+secondResourcesList=Risorse disponibili
derAttrs=Attributi derivati
derAttrToRemove=Elimina
derAttrName=Nome
@@ -42,7 +42,9 @@ virAttrValue=Valore virtuale
addAttributeBtn=Aggiungi
-inheritAttrs=Eredita attributi
+inheritPlainAttrs=Eredita attributi normali
inheritDerAttrs=Eredita attributi derivati
inheritVirAttrs=Eredita attributi virtuali
templates=Modelo
+secondEntitlementsList=Entitlement disponibili
+firstEntitlementsList=Entitlement ruolo
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
index f588e75..5bff4ed 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/RoleModalPage_pt_BR.properties
@@ -17,7 +17,7 @@
required_alert=Todos os campos s\u00e3o obrigat\u00f3rios
title=Fun\u00e7\u00e3o
details=Detalhes
-attrs=Atributos
+plainAttrs=Atributos Normal
tab3=Atributos Derivados
tab4=Atributos Virtuais
resources=Recursos
@@ -42,7 +42,7 @@ virAttrValue=Valor Virtual
addAttributeBtn=Adicionar
-inheritAttrs=Atributos Herdados
+inheritPlainAttrs=Atributos Herdados Normal
inheritDerAttrs=Atributos Derivados Herdados
inheritVirAttrs=Atributos Virtuais Herdados
templates=Modelli
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
index 42be774..2d25618 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SchedTaskModalPage.html
@@ -37,7 +37,7 @@ under the License.
<span wicket:id="idLabel">[Id]</span>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
+ <span wicket:id="key">[key]</span>
</div>
</div>
@@ -88,7 +88,7 @@ under the License.
</div>
<script type="text/javascript">
- $(function() {
+ $(function () {
$('#formtable div.tablerow:even').addClass("alt");
});
</script>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
index b5d81f9..e103028 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema.properties
@@ -27,7 +27,7 @@ edit=Edit
delete=Delete
attributes=Attributes
expression=Expression
-normal=Normal
+plain=Plain
derived=Derived
virtual=Virtual
mandatoryCondition=Mandatory
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
index 611ed9c..b95da78 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_it.properties
@@ -27,7 +27,7 @@ edit=Modifica
delete=Rimuovi
attributes=Attributi
expression=Expression
-normal=Normali
+plain=Normali
derived=Derivati
virtual=Virtuali
mandatoryCondition=Obbligatorio
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
index 8d76c3b..994d485 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/Schema_pt_BR.properties
@@ -27,7 +27,7 @@ edit=Editar
delete=Remover
attributes=Atributos
expression=Express\u00e3o
-normal=Normal
+plain=Normal
derived=Derivado
virtual=Virtual
mandatoryCondition=Mandat\u00f3rio
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
index 47a73c5..fc9b0a5 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/SyncTaskModalPage.html
@@ -39,7 +39,7 @@ under the License.
<span wicket:id="idLabel">[Id]</span>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="id">[id]</span>
+ <span wicket:id="key">[key]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
index ff39c9c..991f726 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.html
@@ -60,7 +60,7 @@ under the License.
</div>
<div id="tabs-2">
<div id="formtable">
- <span wicket:id="attrs">[user attributes]</span>
+ <span wicket:id="plainAttrs">[user plain attributes]</span>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
index c0614c4..7667bc5 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage.properties
@@ -19,7 +19,7 @@ title=User
firstname=Firstname
surname=Surname
tab1=Details
-tab2=Attributes
+tab2=Plain attributes
tab3=Derived attributes
tab4=Virtual attributes
tab5=Resources
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
index 8a79601..ec550c3 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_it.properties
@@ -19,7 +19,7 @@ title=Utente
firstname=Nome
surname=Cognome
tab1=Details
-tab2=Attributi
+tab2=Attributi normali
tab3=Attributi derivati
tab4=Attributi virtuali
tab5=Risorse
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
index 7000c47..d5d26a9 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/UserModalPage_pt_BR.properties
@@ -19,7 +19,7 @@ title=Usu\u00e1rio
firstname=Nome
surname=Sobrenome
tab1=Detalhes
-tab2=Atributos
+tab2=Atributos Normal
tab3=Atriutos Derivados
tab4=Atributos Virtuais
tab5=Recursos
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
index 695ed51..3adea45 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/VirSchemaModalPage.html
@@ -24,10 +24,10 @@ under the License.
<div id="formtable">
<div class="tablerow alt">
<div class="tablecolumn_label short_dynamicsize">
- <label for="name"><wicket:message key="name"/></label>
+ <label for="key"><wicket:message key="key"/></label>
</div>
<div class="tablecolumn_field medium_dynamicsize">
- <span wicket:id="name">[name]</span>
+ <span wicket:id="key">[name]</span>
</div>
</div>
<div class="tablerow">
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png
deleted file mode 100644
index 79332c0..0000000
Binary files a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/active.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png
deleted file mode 100644
index 68975bd..0000000
Binary files a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/inactive.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png
deleted file mode 100644
index a0a2933..0000000
Binary files a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/objectnotfound.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png
deleted file mode 100644
index 97188ba..0000000
Binary files a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/pages/statuses/undefined.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.html
new file mode 100644
index 0000000..cbe6296
--- /dev/null
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractProvisioningTasksPanel.html
@@ -0,0 +1,41 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="users-contain" class="ui-widget" style="width:auto">
+ <span wicket:id="container">
+ <span wicket:id="datatable">[datatable]</span>
+ <span style="float:right">
+ <form wicket:id="PaginatorForm" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all"
+ wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </span>
+ </div>
+ <div wicket:id="taskWin">
+ [Show modal window for viewing task]
+ </div>
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
+ wicket:id="createLink">
+ <wicket:message key="create"/>
+ </a>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html
deleted file mode 100644
index cbe6296..0000000
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSyncTasksPanel.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div id="users-contain" class="ui-widget" style="width:auto">
- <span wicket:id="container">
- <span wicket:id="datatable">[datatable]</span>
- <span style="float:right">
- <form wicket:id="PaginatorForm" style="display:inline">
- <label><wicket:message key="displayRows"/></label>
- <select class="text ui-widget-content ui-corner-all"
- wicket:id="rowsChooser"/>
- </form>
- </span>
- </span>
- </div>
- <div wicket:id="taskWin">
- [Show modal window for viewing task]
- </div>
- <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
- wicket:id="createLink">
- <wicket:message key="create"/>
- </a>
- </wicket:panel>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
index 000b8f5..9049435 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.html
@@ -27,16 +27,16 @@ under the License.
<wicket:panel>
<div id="attrTemplateTabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul>
- <li class="tabs-selected"><a href="#rattr"><wicket:message key="rattr"/></a></li>
+ <li class="tabs-selected"><a href="#rplainattr"><wicket:message key="rplainattr"/></a></li>
<li><a href="#rderattr"><wicket:message key="rderattr"/></a></li>
<li><a href="#rvirattr"><wicket:message key="rvirattr"/></a></li>
- <li><a href="#mattr"><wicket:message key="mattr"/></a></li>
+ <li><a href="#mplainattr"><wicket:message key="mplainattr"/></a></li>
<li><a href="#mderattr"><wicket:message key="mderattr"/></a></li>
<li><a href="#mvirattr"><wicket:message key="mvirattr"/></a></li>
</ul>
- <div id="rattr">
- <div wicket:id="rAttrTemplates"/>
+ <div id="rplainattr">
+ <div wicket:id="rPlainAttrTemplates"/>
</div>
<div id="rderattr">
<div wicket:id="rDerAttrTemplates"/>
@@ -44,8 +44,8 @@ under the License.
<div id="rvirattr">
<div wicket:id="rVirAttrTemplates"/>
</div>
- <div id="mattr">
- <div wicket:id="mAttrTemplates"/>
+ <div id="mplainattr">
+ <div wicket:id="mPlainAttrTemplates"/>
</div>
<div id="mderattr">
<div wicket:id="mDerAttrTemplates"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
index 4d8133c..94da979 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel.properties
@@ -15,9 +15,9 @@
# specific language governing permissions and limitations
# under the License.
-rattr=Normal
+rplainattr=Plain
rderattr=Derived
rvirattr=Virtual
-mattr=Normal (Membership)
+mplainattr=Plain (Membership)
mderattr=Derived (Membership)
mvirattr=Virtual (Membership)
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
index 69e4ee0..d30ff59 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_it.properties
@@ -15,9 +15,9 @@
# specific language governing permissions and limitations
# under the License.
-rattr=Normali
+rplainattr=Normali
rderattr=Derivati
rvirattr=Virtuali
-mattr=Normali (Membership)
+mplainattr=Normali (Membership)
mderattr=Derivati (Membership)
mvirattr=Virtuali (Membership)
http://git-wip-us.apache.org/repos/asf/syncope/blob/07aa4585/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
index 838a459..5fd7c3a 100644
--- a/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
+++ b/syncope620/client/console/src/main/resources/org/apache/syncope/client/console/panels/AttrTemplatesPanel_pt_BR.properties
@@ -15,9 +15,9 @@
# specific language governing permissions and limitations
# under the License.
-rattr=Normal
+rplainattr=Normal
rderattr=Derivado
rvirattr=Virtual
-mattr=Normal (Membro)
+mplainattr=Normal (Membro)
mderattr=Derivado (Membro)
mvirattr=Virtual (Membro)
[05/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
new file mode 100644
index 0000000..f845997
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/PushTaskITCase.java
@@ -0,0 +1,354 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.MappingTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.syncope.common.lib.types.MatchingRule;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.lib.types.UnmatchingRule;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.syncope.common.rest.api.service.TaskService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class PushTaskITCase extends AbstractTaskITCase {
+
+ @Test
+ public void getPushActionsClasses() {
+ List<String> actions = syncopeService.info().getPushActions();
+ assertNotNull(actions);
+ }
+
+ @Test
+ public void read() {
+ PushTaskTO pushTaskTO = taskService.<PushTaskTO>read(17L);
+ assertEquals(UnmatchingRule.ASSIGN, pushTaskTO.getUnmatchingRule());
+ assertEquals(MatchingRule.UPDATE, pushTaskTO.getMatchingRule());
+ }
+
+ @Test
+ public void list() {
+ final PagedResult<PushTaskTO> tasks = taskService.list(TaskType.PUSH);
+ assertFalse(tasks.getResult().isEmpty());
+ for (AbstractTaskTO task : tasks.getResult()) {
+ if (!(task instanceof PushTaskTO)) {
+ fail();
+ }
+ }
+ }
+
+ @Test
+ public void createPushTask() {
+ PushTaskTO task = new PushTaskTO();
+ task.setName("Test create Push");
+ task.setResource(RESOURCE_NAME_WS2);
+ task.setUserFilter(
+ SyncopeClient.getUserSearchConditionBuilder().hasNotResources(RESOURCE_NAME_TESTDB2).query());
+ task.setRoleFilter(
+ SyncopeClient.getRoleSearchConditionBuilder().isNotNull("cool").query());
+ task.setMatchingRule(MatchingRule.LINK);
+
+ final Response response = taskService.create(task);
+ final PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
+ assertNotNull(actual);
+
+ task = taskService.read(actual.getKey());
+ assertNotNull(task);
+ assertEquals(task.getKey(), actual.getKey());
+ assertEquals(task.getJobClassName(), actual.getJobClassName());
+ assertEquals(task.getUserFilter(), actual.getUserFilter());
+ assertEquals(task.getRoleFilter(), actual.getRoleFilter());
+ assertEquals(UnmatchingRule.ASSIGN, actual.getUnmatchingRule());
+ assertEquals(MatchingRule.LINK, actual.getMatchingRule());
+ }
+
+ @Test
+ public void pushMatchingUnmatchingRoles() {
+ assertFalse(roleService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
+
+ execSyncTask(23L, 50, false);
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, 3L));
+ assertTrue(roleService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
+
+ execSyncTask(23L, 50, false);
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, 3L));
+ assertFalse(roleService.read(3L).getResources().contains(RESOURCE_NAME_LDAP));
+ }
+
+ @Test
+ public void pushUnmatchingUsers() throws Exception {
+ assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertFalse(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertFalse(userService.read(4L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertTrue(userService.read(5L).getResources().contains(RESOURCE_NAME_TESTDB2));
+
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='puccini'").size());
+
+ // ------------------------------------------
+ // Unmatching --> Assign --> dryRuyn
+ // ------------------------------------------
+ execSyncTask(13L, 50, true);
+ assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
+ assertFalse(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ // ------------------------------------------
+
+ final Set<Long> pushTaskIds = new HashSet<>();
+ pushTaskIds.add(13L);
+ pushTaskIds.add(14L);
+ pushTaskIds.add(15L);
+ pushTaskIds.add(16L);
+ execSyncTasks(pushTaskIds, 50, false);
+
+ // ------------------------------------------
+ // Unatching --> Ignore
+ // ------------------------------------------
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
+ assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ // ------------------------------------------
+
+ // ------------------------------------------
+ // Unmatching --> Assign
+ // ------------------------------------------
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
+ assertTrue(userService.read(3L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ jdbcTemplate.execute("DELETE FROM test2 WHERE ID='vivaldi'");
+ // ------------------------------------------
+
+ // ------------------------------------------
+ // Unmatching --> Provision
+ // ------------------------------------------
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='bellini'").size());
+ assertFalse(userService.read(4L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ jdbcTemplate.execute("DELETE FROM test2 WHERE ID='bellini'");
+ // ------------------------------------------
+
+ // ------------------------------------------
+ // Unmatching --> Unlink
+ // ------------------------------------------
+ assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='puccini'").size());
+ assertFalse(userService.read(5L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ // ------------------------------------------
+ }
+
+ @Test
+ public void pushMatchingUser() throws Exception {
+ assertTrue(userService.read(1L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
+
+ final JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
+
+ // ------------------------------------------
+ // Matching --> Deprovision --> dryRuyn
+ // ------------------------------------------
+ execSyncTask(19L, 50, true);
+ assertTrue(userService.read(1L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
+ // ------------------------------------------
+
+ final Set<Long> pushTaskIds = new HashSet<>();
+ pushTaskIds.add(18L);
+ pushTaskIds.add(19L);
+ pushTaskIds.add(16L);
+
+ execSyncTasks(pushTaskIds, 50, false);
+
+ // ------------------------------------------
+ // Matching --> Deprovision && Ignore
+ // ------------------------------------------
+ assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ // DELETE Capability not available ....
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
+ // ------------------------------------------
+
+ // ------------------------------------------
+ // Matching --> Unassign
+ // ------------------------------------------
+ assertFalse(userService.read(1L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ // DELETE Capability not available ....
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
+ // ------------------------------------------
+
+ // ------------------------------------------
+ // Matching --> Link
+ // ------------------------------------------
+ execSyncTask(20L, 50, false);
+ assertTrue(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
+ // ------------------------------------------
+
+ pushTaskIds.clear();
+ pushTaskIds.add(21L);
+ pushTaskIds.add(22L);
+
+ execSyncTasks(pushTaskIds, 50, false);
+
+ // ------------------------------------------
+ // Matching --> Unlink && Update
+ // ------------------------------------------
+ assertFalse(userService.read(2L).getResources().contains(RESOURCE_NAME_TESTDB2));
+ assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
+ // ------------------------------------------
+ }
+
+ @Test
+ public void issueSYNCOPE598() {
+ // create a new role schema
+ final PlainSchemaTO schemaTO = new PlainSchemaTO();
+ schemaTO.setKey("LDAPGroupName" + getUUIDString());
+ schemaTO.setType(AttrSchemaType.String);
+ schemaTO.setMandatoryCondition("true");
+
+ final PlainSchemaTO newPlainSchemaTO = createSchema(AttributableType.ROLE, SchemaType.PLAIN, schemaTO);
+ assertEquals(schemaTO, newPlainSchemaTO);
+
+ // create a new sample role
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName("all" + getUUIDString());
+ roleTO.setParent(8L);
+
+ roleTO.getRAttrTemplates().add(newPlainSchemaTO.getKey());
+ roleTO.getPlainAttrs().add(attrTO(newPlainSchemaTO.getKey(), "all"));
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+
+ String resourceName = "resource-ldap-roleonly";
+ ResourceTO newResourceTO = null;
+
+ try {
+ // Create resource ad-hoc
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(105L);
+
+ final MappingTO umapping = new MappingTO();
+ MappingItemTO item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.Username);
+ item.setExtAttrName("cn");
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.PROPAGATION);
+ item.setMandatoryCondition("true");
+ umapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setExtAttrName("surname");
+ item.setIntAttrName("sn");
+ item.setPurpose(MappingPurpose.BOTH);
+ umapping.addItem(item);
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setExtAttrName("email");
+ item.setIntAttrName("mail");
+ item.setPurpose(MappingPurpose.BOTH);
+ umapping.addItem(item);
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.Password);
+ item.setPassword(true);
+ item.setPurpose(MappingPurpose.BOTH);
+ item.setMandatoryCondition("true");
+ umapping.addItem(item);
+
+ umapping.setAccountLink("'cn=' + username + ',ou=people,o=isp'");
+
+ final MappingTO rmapping = new MappingTO();
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.RolePlainSchema);
+ item.setExtAttrName("cn");
+ item.setIntAttrName(newPlainSchemaTO.getKey());
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.BOTH);
+ rmapping.setAccountIdItem(item);
+
+ rmapping.setAccountLink("'cn=' + " + newPlainSchemaTO.getKey() + " + ',ou=groups,o=isp'");
+
+ resourceTO.setRmapping(rmapping);
+
+ Response response = resourceService.create(resourceTO);
+ newResourceTO = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+
+ assertNotNull(newResourceTO);
+ assertNull(newResourceTO.getUmapping());
+ assertNotNull(newResourceTO.getRmapping());
+
+ // create push task ad-hoc
+ final PushTaskTO task = new PushTaskTO();
+ task.setName("issueSYNCOPE598");
+ task.setResource(resourceName);
+ task.setPerformCreate(true);
+ task.setPerformDelete(true);
+ task.setPerformUpdate(true);
+ task.setUnmatchingRule(UnmatchingRule.ASSIGN);
+ task.setMatchingRule(MatchingRule.UPDATE);
+
+ response = taskService.create(task);
+ final PushTaskTO push = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
+
+ assertNotNull(push);
+
+ // execute the new task
+ final TaskExecTO pushExec = execSyncTask(push.getKey(), 50, false);
+ assertTrue(PropagationTaskExecStatus.valueOf(pushExec.getStatus()).isSuccessful());
+ } finally {
+ roleService.delete(roleTO.getKey());
+ if (newResourceTO != null) {
+ resourceService.delete(resourceName);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java
new file mode 100644
index 0000000..8102fe0
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ReportITCase.java
@@ -0,0 +1,252 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.report.UserReportletConf;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.ReportExecTO;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.ReportExecExportFormat;
+import org.apache.syncope.common.lib.types.ReportExecStatus;
+import org.apache.syncope.common.lib.wrap.ReportletConfClass;
+import org.apache.syncope.common.rest.api.service.ReportService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class ReportITCase extends AbstractITCase {
+
+ private ReportTO createReport(final ReportTO report) {
+ Response response = reportService.create(report);
+ assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusInfo().getStatusCode());
+ return getObject(response.getLocation(), ReportService.class, ReportTO.class);
+ }
+
+ @Test
+ public void getReportletClasses() {
+ List<ReportletConfClass> reportletClasses = reportService.getReportletConfClasses();
+ assertNotNull(reportletClasses);
+ assertFalse(reportletClasses.isEmpty());
+ }
+
+ @Test
+ public void list() {
+ PagedResult<ReportTO> reports = reportService.list();
+ assertNotNull(reports);
+ assertFalse(reports.getResult().isEmpty());
+ for (ReportTO report : reports.getResult()) {
+ assertNotNull(report);
+ }
+ }
+
+ @Test
+ public void read() {
+ ReportTO reportTO = reportService.read(1L);
+
+ assertNotNull(reportTO);
+ assertNotNull(reportTO.getExecutions());
+ assertFalse(reportTO.getExecutions().isEmpty());
+ }
+
+ @Test
+ public void readExecution() {
+ ReportExecTO reportExecTO = reportService.readExecution(1L);
+ assertNotNull(reportExecTO);
+ }
+
+ @Test
+ public void create() {
+ ReportTO report = new ReportTO();
+ report.setName("testReportForCreate" + getUUIDString());
+ report.getReportletConfs().add(new UserReportletConf("first"));
+ report.getReportletConfs().add(new UserReportletConf("second"));
+
+ report = createReport(report);
+ assertNotNull(report);
+
+ ReportTO actual = reportService.read(report.getKey());
+ assertNotNull(actual);
+
+ assertEquals(actual, report);
+ }
+
+ @Test
+ public void update() {
+ ReportTO report = new ReportTO();
+ report.setName("testReportForUpdate" + getUUIDString());
+
+ report.getReportletConfs().add(new UserReportletConf("first"));
+ report.getReportletConfs().add(new UserReportletConf("second"));
+
+ report = createReport(report);
+ assertNotNull(report);
+ assertEquals(2, report.getReportletConfs().size());
+
+ report.getReportletConfs().add(new UserReportletConf("last"));
+
+ reportService.update(report.getKey(), report);
+ ReportTO updated = reportService.read(report.getKey());
+ assertNotNull(updated);
+ assertEquals(3, updated.getReportletConfs().size());
+ }
+
+ @Test
+ public void delete() {
+ ReportTO report = new ReportTO();
+ report.setName("testReportForDelete" + getUUIDString());
+ report.getReportletConfs().add(new UserReportletConf("first"));
+ report.getReportletConfs().add(new UserReportletConf("second"));
+
+ report = createReport(report);
+ assertNotNull(report);
+
+ reportService.delete(report.getKey());
+
+ try {
+ reportService.read(report.getKey());
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ private void checkExport(final Long execId, final ReportExecExportFormat fmt) throws IOException {
+ final Response response = reportService.exportExecutionResult(execId, fmt);
+ assertNotNull(response);
+ assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
+ assertNotNull(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION));
+ assertTrue(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION).
+ endsWith("." + fmt.name().toLowerCase()));
+
+ Object entity = response.getEntity();
+ assertTrue(entity instanceof InputStream);
+ assertFalse(IOUtils.toString((InputStream) entity, SyncopeConstants.DEFAULT_ENCODING).isEmpty());
+ }
+
+ @Test
+ public void executeAndExport() throws IOException {
+ ReportTO reportTO = reportService.read(1L);
+ reportTO.setKey(0);
+ reportTO.setName("executeAndExport" + getUUIDString());
+ reportTO.getExecutions().clear();
+ reportTO = createReport(reportTO);
+ assertNotNull(reportTO);
+
+ ReportExecTO execution = reportService.execute(reportTO.getKey());
+ assertNotNull(execution);
+
+ int i = 0;
+ int maxit = 50;
+
+ // wait for report execution completion (executions incremented)
+ do {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+
+ reportTO = reportService.read(reportTO.getKey());
+
+ assertNotNull(reportTO);
+ assertNotNull(reportTO.getExecutions());
+
+ i++;
+ } while (reportTO.getExecutions().isEmpty()
+ || (!ReportExecStatus.SUCCESS.name().equals(reportTO.getExecutions().get(0).getStatus()) && i < maxit));
+ assertEquals(ReportExecStatus.SUCCESS.name(), reportTO.getExecutions().get(0).getStatus());
+
+ long execId = reportTO.getExecutions().get(0).getKey();
+
+ checkExport(execId, ReportExecExportFormat.XML);
+ checkExport(execId, ReportExecExportFormat.HTML);
+ checkExport(execId, ReportExecExportFormat.PDF);
+ checkExport(execId, ReportExecExportFormat.RTF);
+ checkExport(execId, ReportExecExportFormat.CSV);
+ }
+
+ @Test
+ public void issueSYNCOPE43() {
+ ReportTO reportTO = new ReportTO();
+ reportTO.setName("issueSYNCOPE43" + getUUIDString());
+ reportTO = createReport(reportTO);
+ assertNotNull(reportTO);
+
+ ReportExecTO execution = reportService.execute(reportTO.getKey());
+ assertNotNull(execution);
+
+ int maxit = 50;
+ do {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+
+ reportTO = reportService.read(reportTO.getKey());
+
+ maxit--;
+ } while (reportTO.getExecutions().isEmpty() && maxit > 0);
+
+ assertEquals(1, reportTO.getExecutions().size());
+ }
+
+ @Test
+ public void issueSYNCOPE102() throws IOException {
+ // Create
+ ReportTO reportTO = reportService.read(1L);
+ reportTO.setKey(0);
+ reportTO.setName("issueSYNCOPE102" + getUUIDString());
+ reportTO = createReport(reportTO);
+ assertNotNull(reportTO);
+
+ // Execute (multiple requests)
+ for (int i = 0; i < 10; i++) {
+ ReportExecTO execution = reportService.execute(reportTO.getKey());
+ assertNotNull(execution);
+ }
+
+ // Wait for one execution
+ int maxit = 50;
+ do {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+
+ reportTO = reportService.read(reportTO.getKey());
+
+ maxit--;
+ } while (reportTO.getExecutions().isEmpty() && maxit > 0);
+ assertFalse(reportTO.getExecutions().isEmpty());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java
new file mode 100644
index 0000000..4b701c4
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/ResourceITCase.java
@@ -0,0 +1,578 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.security.AccessControlException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.MappingTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.ConnConfPropSchema;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class ResourceITCase extends AbstractITCase {
+
+ private ResourceTO buildResourceTO(final String resourceName) {
+ ResourceTO resourceTO = new ResourceTO();
+
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setExtAttrName("userId");
+ item.setIntAttrName("userId");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+
+ item = new MappingItemTO();
+ item.setExtAttrName("username");
+ item.setIntAttrName("fullname");
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setExtAttrName("fullname");
+ item.setIntAttrName("cn");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setAccountid(false);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+
+ resourceTO.setUmapping(mapping);
+ return resourceTO;
+ }
+
+ @Test
+ public void getPropagationActionsClasses() {
+ List<String> actions = syncopeService.info().getPropagationActions();
+ assertNotNull(actions);
+ assertFalse(actions.isEmpty());
+ }
+
+ @Test
+ public void create() {
+ String resourceName = RESOURCE_NAME_CREATE;
+ ResourceTO resourceTO = buildResourceTO(resourceName);
+
+ Response response = resourceService.create(resourceTO);
+ ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+ assertNotNull(actual);
+
+ // check for existence
+ actual = resourceService.read(resourceName);
+ assertNotNull(actual);
+ }
+
+ @Test
+ public void createOverridingProps() {
+ String resourceName = "overriding-conn-conf-target-resource-create";
+ ResourceTO resourceTO = new ResourceTO();
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setExtAttrName("uid");
+ item.setIntAttrName("userId");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+
+ item = new MappingItemTO();
+ item.setExtAttrName("username");
+ item.setIntAttrName("fullname");
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setExtAttrName("fullname");
+ item.setIntAttrName("cn");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setAccountid(false);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+
+ resourceTO.setUmapping(mapping);
+
+ ConnConfProperty p = new ConnConfProperty();
+ ConnConfPropSchema schema = new ConnConfPropSchema();
+ schema.setType("java.lang.String");
+ schema.setName("endpoint");
+ schema.setRequired(true);
+ p.setSchema(schema);
+ p.getValues().add("http://invalidurl/");
+
+ Set<ConnConfProperty> connectorConfigurationProperties = new HashSet<ConnConfProperty>(Arrays.asList(p));
+ resourceTO.getConnConfProperties().addAll(connectorConfigurationProperties);
+
+ Response response = resourceService.create(resourceTO);
+ ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+ assertNotNull(actual);
+
+ // check the existence
+ actual = resourceService.read(resourceName);
+ assertNotNull(actual);
+ }
+
+ @Test
+ public void createWithSingleMappingItem() {
+ String resourceName = RESOURCE_NAME_CREATE_SINGLE;
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+
+ MappingTO umapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setExtAttrName("userId");
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.PROPAGATION);
+ umapping.setAccountIdItem(item);
+
+ resourceTO.setUmapping(umapping);
+
+ MappingTO rmapping = new MappingTO();
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.RoleId);
+ item.setExtAttrName("roleId");
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.SYNCHRONIZATION);
+ rmapping.setAccountIdItem(item);
+
+ resourceTO.setRmapping(rmapping);
+
+ Response response = resourceService.create(resourceTO);
+ ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+
+ assertNotNull(actual);
+ assertNotNull(actual.getUmapping());
+ assertNotNull(actual.getUmapping().getItems());
+ assertNotNull(actual.getRmapping());
+ assertNotNull(actual.getRmapping().getItems());
+ assertEquals(MappingPurpose.SYNCHRONIZATION, actual.getRmapping().getAccountIdItem().getPurpose());
+ assertEquals(MappingPurpose.PROPAGATION, actual.getUmapping().getAccountIdItem().getPurpose());
+ }
+
+ @Test
+ public void createWithInvalidMapping() {
+ String resourceName = RESOURCE_NAME_CREATE_WRONG;
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setExtAttrName("userId");
+ item.setAccountid(true);
+ mapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setExtAttrName("email");
+ // missing intAttrName ...
+ mapping.addItem(item);
+
+ resourceTO.setUmapping(mapping);
+
+ try {
+ createResource(resourceTO);
+ fail("Create should not have worked");
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ assertEquals("intAttrName", e.getElements().iterator().next());
+ }
+ }
+
+ @Test(expected = SyncopeClientException.class)
+ public void createWithoutExtAttr() {
+ String resourceName = RESOURCE_NAME_CREATE_WRONG;
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setExtAttrName("userId");
+ item.setAccountid(true);
+ mapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setIntAttrName("usernane");
+ // missing extAttrName ...
+ mapping.addItem(item);
+
+ resourceTO.setUmapping(mapping);
+
+ createResource(resourceTO);
+ }
+
+ @Test
+ public void createWithPasswordPolicy() {
+ String resourceName = "res-with-password-policy";
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+ resourceTO.setPasswordPolicy(4L);
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setExtAttrName("userId");
+ item.setIntAttrName("userId");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.setAccountIdItem(item);
+
+ resourceTO.setUmapping(mapping);
+
+ Response response = resourceService.create(resourceTO);
+ ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+ assertNotNull(actual);
+
+ // check the existence
+ actual = resourceService.read(resourceName);
+ assertNotNull(actual);
+ assertNotNull(actual.getPasswordPolicy());
+ assertEquals(4L, (long) actual.getPasswordPolicy());
+ }
+
+ @Test
+ public void updateWithException() {
+ try {
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey("resourcenotfound");
+
+ resourceService.update(resourceTO.getKey(), resourceTO);
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void update() {
+ String resourceName = RESOURCE_NAME_UPDATE;
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(101L);
+
+ MappingTO mapping = new MappingTO();
+
+ // Update with an existing and already assigned mapping
+ MappingItemTO item = new MappingItemTO();
+ item.setKey(112L);
+ item.setExtAttrName("test3");
+ item.setIntAttrName("fullname");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+
+ // Update defining new mappings
+ for (int i = 4; i < 6; i++) {
+ item = new MappingItemTO();
+ item.setExtAttrName("test" + i);
+ item.setIntAttrName("fullname");
+ item.setIntMappingType(IntMappingType.UserPlainSchema);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+ }
+ item = new MappingItemTO();
+ item.setExtAttrName("username");
+ item.setIntAttrName("fullname");
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.setAccountIdItem(item);
+
+ resourceTO.setUmapping(mapping);
+
+ resourceService.update(resourceTO.getKey(), resourceTO);
+ ResourceTO actual = resourceService.read(resourceTO.getKey());
+ assertNotNull(actual);
+
+ // check for existence
+ Collection<MappingItemTO> mapItems = actual.getUmapping().getItems();
+ assertNotNull(mapItems);
+ assertEquals(4, mapItems.size());
+ }
+
+ @Test
+ public void deleteWithException() {
+ try {
+ resourceService.delete("resourcenotfound");
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void updateResetSyncToken() {
+ // create resource with sync token
+ String resourceName = RESOURCE_NAME_RESETSYNCTOKEN + getUUIDString();
+ ResourceTO pre = buildResourceTO(resourceName);
+ pre.setUsyncToken("test");
+ resourceService.create(pre);
+
+ pre.setUsyncToken(null);
+ resourceService.update(pre.getKey(), pre);
+ ResourceTO actual = resourceService.read(pre.getKey());
+ // check that the synctoken has been reset
+ assertNull(actual.getUsyncToken());
+ }
+
+ @Test
+ public void delete() {
+ String resourceName = "tobedeleted";
+
+ ResourceTO resource = buildResourceTO(resourceName);
+ Response response = resourceService.create(resource);
+ ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+ assertNotNull(actual);
+
+ resourceService.delete(resourceName);
+
+ try {
+ resourceService.read(resourceName);
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void list() {
+ List<ResourceTO> actuals = resourceService.list();
+ assertNotNull(actuals);
+ assertFalse(actuals.isEmpty());
+ for (ResourceTO resourceTO : actuals) {
+ assertNotNull(resourceTO);
+ }
+ }
+
+ @Test
+ public void read() {
+ ResourceTO actual = resourceService.read(RESOURCE_NAME_TESTDB);
+ assertNotNull(actual);
+ }
+
+ @Test
+ public void issueSYNCOPE323() {
+ ResourceTO actual = resourceService.read(RESOURCE_NAME_TESTDB);
+ assertNotNull(actual);
+
+ try {
+ createResource(actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.CONFLICT, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.EntityExists, e.getType());
+ }
+
+ actual.setKey(null);
+ try {
+ createResource(actual);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.BAD_REQUEST, e.getType().getResponseStatus());
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+ }
+
+ @Test
+ public void bulkAction() {
+ resourceService.create(buildResourceTO("forBulk1"));
+ resourceService.create(buildResourceTO("forBulk2"));
+
+ assertNotNull(resourceService.read("forBulk1"));
+ assertNotNull(resourceService.read("forBulk2"));
+
+ final BulkAction bulkAction = new BulkAction();
+ bulkAction.setOperation(BulkAction.Type.DELETE);
+
+ bulkAction.getTargets().add(String.valueOf("forBulk1"));
+ bulkAction.getTargets().add(String.valueOf("forBulk2"));
+
+ resourceService.bulk(bulkAction);
+
+ try {
+ resourceService.read("forBulk1");
+ fail();
+ } catch (SyncopeClientException e) {
+ }
+
+ try {
+ resourceService.read("forBulk2");
+ fail();
+ } catch (SyncopeClientException e) {
+ }
+ }
+
+ @Test
+ public void issueSYNCOPE360() {
+ final String name = "SYNCOPE360-" + getUUIDString();
+ resourceService.create(buildResourceTO(name));
+
+ ResourceTO resource = resourceService.read(name);
+ assertNotNull(resource);
+ assertNotNull(resource.getUmapping());
+
+ resource.setUmapping(new MappingTO());
+ resourceService.update(name, resource);
+
+ resource = resourceService.read(name);
+ assertNotNull(resource);
+ assertNull(resource.getUmapping());
+ }
+
+ @Test
+ public void issueSYNCOPE368() {
+ final String name = "SYNCOPE368-" + getUUIDString();
+
+ ResourceTO resourceTO = new ResourceTO();
+
+ resourceTO.setKey(name);
+ resourceTO.setConnectorId(105L);
+
+ MappingTO mapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.RoleName);
+ item.setExtAttrName("cn");
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.setAccountIdItem(item);
+
+ item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.RoleOwnerSchema);
+ item.setExtAttrName("owner");
+ item.setPurpose(MappingPurpose.BOTH);
+ mapping.addItem(item);
+
+ resourceTO.setRmapping(mapping);
+
+ resourceTO = createResource(resourceTO);
+ assertNotNull(resourceTO);
+ assertEquals(2, resourceTO.getRmapping().getItems().size());
+ }
+
+ @Test
+ public void issueSYNCOPE418() {
+ try {
+ resourceService.create(
+ buildResourceTO("http://schemas.examples.org/security/authorization/organizationUnit"));
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidExternalResource, e.getType());
+
+ assertTrue(e.getElements().iterator().next().toString().contains(EntityViolationType.InvalidName.name()));
+ }
+ }
+
+ @Test
+ public void anonymous() {
+ ResourceService unauthenticated = clientFactory.createAnonymous().getService(ResourceService.class);
+ try {
+ unauthenticated.list();
+ fail();
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ ResourceService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).
+ getService(ResourceService.class);
+ assertFalse(anonymous.list().isEmpty());
+ }
+
+ @Test
+ public void issueSYNCOPE493() {
+ // create resource with attribute mapping set to NONE and check its propagation
+ String resourceName = RESOURCE_NAME_CREATE_NONE;
+ ResourceTO resourceTO = new ResourceTO();
+ resourceTO.setKey(resourceName);
+ resourceTO.setConnectorId(102L);
+
+ MappingTO umapping = new MappingTO();
+
+ MappingItemTO item = new MappingItemTO();
+ item.setIntMappingType(IntMappingType.UserId);
+ item.setExtAttrName("userId");
+ item.setAccountid(true);
+ item.setPurpose(MappingPurpose.PROPAGATION);
+ umapping.setAccountIdItem(item);
+
+ MappingItemTO item2 = new MappingItemTO();
+ item2.setIntMappingType(IntMappingType.UserPlainSchema);
+ item2.setAccountid(false);
+ item2.setIntAttrName("gender");
+ item2.setExtAttrName("gender");
+ item2.setPurpose(MappingPurpose.NONE);
+ umapping.addItem(item2);
+
+ resourceTO.setUmapping(umapping);
+
+ Response response = resourceService.create(resourceTO);
+ ResourceTO actual = getObject(response.getLocation(), ResourceService.class, ResourceTO.class);
+
+ assertNotNull(actual);
+ assertNotNull(actual.getUmapping());
+ assertNotNull(actual.getUmapping().getItems());
+ assertEquals(MappingPurpose.PROPAGATION, actual.getUmapping().getAccountIdItem().getPurpose());
+ for (MappingItemTO itemTO : actual.getUmapping().getItems()) {
+ if ("gender".equals(itemTO.getIntAttrName())) {
+ assertEquals(MappingPurpose.NONE, itemTO.getPurpose());
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
new file mode 100644
index 0000000..18646f5
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/RoleITCase.java
@@ -0,0 +1,889 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessControlException;
+import java.util.List;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.mod.ReferenceMod;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.Preference;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.RoleService;
+import org.identityconnectors.framework.common.objects.Name;
+import org.junit.FixMethodOrder;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class RoleITCase extends AbstractITCase {
+
+ private RoleTO buildBasicRoleTO(final String name) {
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName(name + getUUIDString());
+ roleTO.setParent(8L);
+ return roleTO;
+ }
+
+ private RoleTO buildRoleTO(final String name) {
+ RoleTO roleTO = buildBasicRoleTO(name);
+
+ // verify inheritance password and account policies
+ roleTO.setInheritAccountPolicy(false);
+ // not inherited so setter execution shouldn't be ignored
+ roleTO.setAccountPolicy(6L);
+
+ roleTO.setInheritPasswordPolicy(true);
+ // inherited so setter execution should be ignored
+ roleTO.setPasswordPolicy(2L);
+
+ roleTO.getRAttrTemplates().add("icon");
+ roleTO.getPlainAttrs().add(attrTO("icon", "anIcon"));
+
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
+ return roleTO;
+ }
+
+ @Test
+ public void createWithException() {
+ RoleTO newRoleTO = new RoleTO();
+ newRoleTO.getPlainAttrs().add(attrTO("attr1", "value1"));
+
+ try {
+ createRole(newRoleTO);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.InvalidRole, e.getType());
+ }
+ }
+
+ @Test
+ @Ignore
+ public void create() {
+ RoleTO roleTO = buildRoleTO("lastRole");
+ roleTO.getRVirAttrTemplates().add("rvirtualdata");
+ roleTO.getVirAttrs().add(attrTO("rvirtualdata", "rvirtualvalue"));
+ roleTO.setRoleOwner(8L);
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+
+ assertNotNull(roleTO.getVirAttrMap());
+ assertNotNull(roleTO.getVirAttrMap().get("rvirtualdata").getValues());
+ assertFalse(roleTO.getVirAttrMap().get("rvirtualdata").getValues().isEmpty());
+ assertEquals("rvirtualvalue", roleTO.getVirAttrMap().get("rvirtualdata").getValues().get(0));
+
+ assertNotNull(roleTO.getAccountPolicy());
+ assertEquals(6L, (long) roleTO.getAccountPolicy());
+
+ assertNotNull(roleTO.getPasswordPolicy());
+ assertEquals(4L, (long) roleTO.getPasswordPolicy());
+
+ assertTrue(roleTO.getResources().contains(RESOURCE_NAME_LDAP));
+
+ ConnObjectTO connObjectTO =
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, roleTO.getKey());
+ assertNotNull(connObjectTO);
+ assertNotNull(connObjectTO.getPlainAttrMap().get("owner"));
+
+ // SYNCOPE-515: remove ownership
+ final RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.setRoleOwner(new ReferenceMod());
+
+ assertNull(updateRole(roleMod).getRoleOwner());
+ }
+
+ @Test
+ public void createWithPasswordPolicy() {
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName("roleWithPassword" + getUUIDString());
+ roleTO.setParent(8L);
+ roleTO.setPasswordPolicy(4L);
+
+ RoleTO actual = createRole(roleTO);
+ assertNotNull(actual);
+
+ actual = roleService.read(actual.getKey());
+ assertNotNull(actual);
+ assertNotNull(actual.getPasswordPolicy());
+ assertEquals(4L, (long) actual.getPasswordPolicy());
+ }
+
+ @Test
+ public void delete() {
+ try {
+ roleService.delete(0L);
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+
+ RoleTO roleTO = new RoleTO();
+ roleTO.setName("toBeDeleted" + getUUIDString());
+ roleTO.setParent(8L);
+
+ roleTO.getResources().add(RESOURCE_NAME_LDAP);
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+
+ RoleTO deletedRole = deleteRole(roleTO.getKey());
+ assertNotNull(deletedRole);
+
+ try {
+ roleService.read(deletedRole.getKey());
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus());
+ }
+ }
+
+ @Test
+ public void list() {
+ PagedResult<RoleTO> roleTOs = roleService.list();
+ assertNotNull(roleTOs);
+ assertTrue(roleTOs.getResult().size() >= 8);
+ for (RoleTO roleTO : roleTOs.getResult()) {
+ assertNotNull(roleTO);
+ }
+ }
+
+ @Test
+ public void parent() {
+ RoleTO roleTO = roleService.parent(7L);
+
+ assertNotNull(roleTO);
+ assertEquals(roleTO.getKey(), 6L);
+ }
+
+ @Test
+ public void read() {
+ RoleTO roleTO = roleService.read(1L);
+
+ assertNotNull(roleTO);
+ assertNotNull(roleTO.getPlainAttrs());
+ assertFalse(roleTO.getPlainAttrs().isEmpty());
+ }
+
+ @Test
+ public void selfRead() {
+ UserTO userTO = userService.read(1L);
+ assertNotNull(userTO);
+
+ assertTrue(userTO.getMembershipMap().containsKey(1L));
+ assertFalse(userTO.getMembershipMap().containsKey(3L));
+
+ RoleService roleService2 = clientFactory.create("rossini", ADMIN_PWD).getService(RoleService.class);
+
+ try {
+ roleService2.readSelf(3L);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.UnauthorizedRole, e.getType());
+ }
+
+ RoleTO roleTO = roleService2.readSelf(1L);
+ assertNotNull(roleTO);
+ assertNotNull(roleTO.getPlainAttrs());
+ assertFalse(roleTO.getPlainAttrs().isEmpty());
+ }
+
+ @Test
+ public void update() {
+ RoleTO roleTO = buildRoleTO("latestRole" + getUUIDString());
+ roleTO.getRAttrTemplates().add("show");
+ roleTO = createRole(roleTO);
+
+ assertEquals(1, roleTO.getPlainAttrs().size());
+
+ assertNotNull(roleTO.getAccountPolicy());
+ assertEquals(6L, (long) roleTO.getAccountPolicy());
+
+ assertNotNull(roleTO.getPasswordPolicy());
+ assertEquals(4L, (long) roleTO.getPasswordPolicy());
+
+ RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ String modName = "finalRole" + getUUIDString();
+ roleMod.setName(modName);
+ roleMod.getPlainAttrsToUpdate().add(attrMod("show", "FALSE"));
+
+ // change password policy inheritance
+ roleMod.setInheritPasswordPolicy(Boolean.FALSE);
+
+ roleTO = updateRole(roleMod);
+
+ assertEquals(modName, roleTO.getName());
+ assertEquals(2, roleTO.getPlainAttrs().size());
+
+ // changes ignored because not requested (null ReferenceMod)
+ assertNotNull(roleTO.getAccountPolicy());
+ assertEquals(6L, (long) roleTO.getAccountPolicy());
+
+ // password policy null because not inherited
+ assertNull(roleTO.getPasswordPolicy());
+ }
+
+ @Test
+ public void updateRemovingVirAttribute() {
+ RoleTO roleTO = buildBasicRoleTO("withvirtual" + getUUIDString());
+ roleTO.getRVirAttrTemplates().add("rvirtualdata");
+ roleTO.getVirAttrs().add(attrTO("rvirtualdata", null));
+
+ roleTO = createRole(roleTO);
+
+ assertNotNull(roleTO);
+ assertEquals(1, roleTO.getVirAttrs().size());
+
+ final RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.getVirAttrsToRemove().add("rvirtualdata");
+
+ roleTO = updateRole(roleMod);
+ assertNotNull(roleTO);
+ assertTrue(roleTO.getVirAttrs().isEmpty());
+ }
+
+ @Test
+ public void updateRemovingDerAttribute() {
+ RoleTO roleTO = buildBasicRoleTO("withderived" + getUUIDString());
+ roleTO.getRDerAttrTemplates().add("rderivedschema");
+ roleTO.getDerAttrs().add(attrTO("rderivedschema", null));
+
+ roleTO = createRole(roleTO);
+
+ assertNotNull(roleTO);
+ assertEquals(1, roleTO.getDerAttrs().size());
+
+ final RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.getDerAttrsToRemove().add("rderivedschema");
+
+ roleTO = updateRole(roleMod);
+ assertNotNull(roleTO);
+ assertTrue(roleTO.getDerAttrs().isEmpty());
+ }
+
+ @Test
+ public void updateAsRoleOwner() {
+ // 1. read role as admin
+ RoleTO roleTO = roleService.read(7L);
+
+ // issue SYNCOPE-15
+ assertNotNull(roleTO.getCreationDate());
+ assertNotNull(roleTO.getLastChangeDate());
+ assertEquals("admin", roleTO.getCreator());
+ assertEquals("admin", roleTO.getLastModifier());
+
+ // 2. prepare update
+ RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.setName("Managing Director");
+
+ // 3. try to update as verdi, not owner of role 7 - fail
+ RoleService roleService2 = clientFactory.create("verdi", ADMIN_PWD).getService(RoleService.class);
+
+ try {
+ roleService2.update(roleMod.getKey(), roleMod);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(Response.Status.UNAUTHORIZED, e.getType().getResponseStatus());
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ // 4. update as puccini, owner of role 7 because owner of role 6 with inheritance - success
+ RoleService roleService3 = clientFactory.create("puccini", ADMIN_PWD).getService(RoleService.class);
+
+ roleTO = roleService3.update(roleMod.getKey(), roleMod).readEntity(RoleTO.class);
+ assertEquals("Managing Director", roleTO.getName());
+
+ // issue SYNCOPE-15
+ assertNotNull(roleTO.getCreationDate());
+ assertNotNull(roleTO.getLastChangeDate());
+ assertEquals("admin", roleTO.getCreator());
+ assertEquals("puccini", roleTO.getLastModifier());
+ assertTrue(roleTO.getCreationDate().before(roleTO.getLastChangeDate()));
+ }
+
+ /**
+ * Role rename used to fail in case of parent null.
+ *
+ * http://code.google.com/p/syncope/issues/detail?id=178
+ */
+ @Test
+ public void issue178() {
+ RoleTO roleTO = new RoleTO();
+ String roleName = "torename" + getUUIDString();
+ roleTO.setName(roleName);
+
+ RoleTO actual = createRole(roleTO);
+
+ assertNotNull(actual);
+ assertEquals(roleName, actual.getName());
+ assertEquals(0L, actual.getParent());
+
+ RoleMod roleMod = new RoleMod();
+ roleMod.setKey(actual.getKey());
+ String renamedRole = "renamed" + getUUIDString();
+ roleMod.setName(renamedRole);
+
+ actual = updateRole(roleMod);
+ assertNotNull(actual);
+ assertEquals(renamedRole, actual.getName());
+ assertEquals(0L, actual.getParent());
+ }
+
+ @Test
+ public void issueSYNCOPE228() {
+ RoleTO roleTO = buildRoleTO("issueSYNCOPE228");
+ roleTO.getEntitlements().add("USER_READ");
+ roleTO.getEntitlements().add("SCHEMA_READ");
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+ assertNotNull(roleTO.getEntitlements());
+ assertFalse(roleTO.getEntitlements().isEmpty());
+
+ List<String> entitlements = roleTO.getEntitlements();
+
+ RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.setInheritDerAttrs(Boolean.TRUE);
+
+ roleTO = updateRole(roleMod);
+ assertNotNull(roleTO);
+ assertEquals(entitlements, roleTO.getEntitlements());
+
+ roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.setModEntitlements(true);
+ roleMod.getEntitlements().clear();
+
+ roleTO = updateRole(roleMod);
+ assertNotNull(roleTO);
+ assertTrue(roleTO.getEntitlements().isEmpty());
+ }
+
+ @Test
+ public void unlink() {
+ RoleTO actual = createRole(buildRoleTO("unlink"));
+ assertNotNull(actual);
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+
+ assertNotNull(roleService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.UNLINK,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+ }
+
+ @Test
+ public void link() {
+ RoleTO roleTO = buildRoleTO("link");
+ roleTO.getResources().clear();
+
+ RoleTO actual = createRole(roleTO);
+ assertNotNull(actual);
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ assertNotNull(roleService.bulkAssociation(actual.getKey(),
+ ResourceAssociationActionType.LINK,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertFalse(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void unassign() {
+ RoleTO actual = createRole(buildRoleTO("unassign"));
+ assertNotNull(actual);
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+
+ assertNotNull(roleService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.UNASSIGN,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void assign() {
+ RoleTO roleTO = buildRoleTO("assign");
+ roleTO.getResources().clear();
+
+ RoleTO actual = createRole(roleTO);
+ assertNotNull(actual);
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ assertNotNull(roleService.bulkAssociation(actual.getKey(),
+ ResourceAssociationActionType.ASSIGN,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertFalse(actual.getResources().isEmpty());
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+ }
+
+ @Test
+ public void deprovision() {
+ RoleTO actual = createRole(buildRoleTO("deprovision"));
+ assertNotNull(actual);
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+
+ assertNotNull(roleService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.DEPROVISION,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertNotNull(actual);
+ assertFalse(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void provision() {
+ RoleTO roleTO = buildRoleTO("assign");
+ roleTO.getResources().clear();
+
+ RoleTO actual = createRole(roleTO);
+ assertNotNull(actual);
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ assertNotNull(roleService.bulkAssociation(actual.getKey(),
+ ResourceAssociationActionType.PROVISION,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertTrue(actual.getResources().isEmpty());
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+ }
+
+ @Test
+ public void deprovisionUnlinked() {
+ RoleTO roleTO = buildRoleTO("assign");
+ roleTO.getResources().clear();
+
+ RoleTO actual = createRole(roleTO);
+ assertNotNull(actual);
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+
+ assertNotNull(roleService.bulkAssociation(actual.getKey(),
+ ResourceAssociationActionType.PROVISION,
+ CollectionWrapper.wrap("resource-ldap", ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertTrue(actual.getResources().isEmpty());
+
+ assertNotNull(resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey()));
+
+ assertNotNull(roleService.bulkDeassociation(actual.getKey(),
+ ResourceDeassociationActionType.DEPROVISION,
+ CollectionWrapper.wrap(RESOURCE_NAME_LDAP, ResourceName.class)).
+ readEntity(BulkActionResult.class));
+
+ actual = roleService.read(actual.getKey());
+ assertNotNull(actual);
+ assertTrue(actual.getResources().isEmpty());
+
+ try {
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, actual.getKey());
+ fail();
+ } catch (Exception e) {
+ assertNotNull(e);
+ }
+ }
+
+ @Test
+ public void createWithMandatorySchemaNotTemplate() {
+ // 1. create a role mandatory schema
+ PlainSchemaTO badge = new PlainSchemaTO();
+ badge.setKey("badge");
+ badge.setMandatoryCondition("true");
+ schemaService.create(AttributableType.ROLE, SchemaType.PLAIN, badge);
+
+ // 2. create a role *without* an attribute for that schema: it works
+ RoleTO roleTO = buildRoleTO("lastRole");
+ assertFalse(roleTO.getPlainAttrMap().containsKey(badge.getKey()));
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+ assertFalse(roleTO.getPlainAttrMap().containsKey(badge.getKey()));
+
+ // 3. add a template for badge to the role just created -
+ // failure since no values are provided and it is mandatory
+ RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.setModRAttrTemplates(true);
+ roleMod.getRPlainAttrTemplates().add("badge");
+
+ try {
+ updateRole(roleMod);
+ fail();
+ } catch (SyncopeClientException e) {
+ assertEquals(ClientExceptionType.RequiredValuesMissing, e.getType());
+ }
+
+ // 4. also add an actual attribute for badge - it will work
+ roleMod.getPlainAttrsToUpdate().add(attrMod(badge.getKey(), "xxxxxxxxxx"));
+
+ roleTO = updateRole(roleMod);
+ assertNotNull(roleTO);
+ assertTrue(roleTO.getPlainAttrMap().containsKey(badge.getKey()));
+ }
+
+ @Test
+ public void anonymous() {
+ RoleService unauthenticated = clientFactory.createAnonymous().getService(RoleService.class);
+ try {
+ unauthenticated.list();
+ fail();
+ } catch (AccessControlException e) {
+ assertNotNull(e);
+ }
+
+ RoleService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).getService(RoleService.class);
+ assertFalse(anonymous.list().getResult().isEmpty());
+ }
+
+ @Test
+ public void noContent() throws IOException {
+ SyncopeClient noContentclient = clientFactory.create(ADMIN_UNAME, ADMIN_PWD);
+ RoleService noContentService = noContentclient.prefer(RoleService.class, Preference.RETURN_NO_CONTENT);
+
+ RoleTO role = buildRoleTO("noContent");
+
+ Response response = noContentService.create(role);
+ assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+
+ role = getObject(response.getLocation(), RoleService.class, RoleTO.class);
+ assertNotNull(role);
+
+ RoleMod roleMod = new RoleMod();
+ roleMod.getPlainAttrsToUpdate().add(attrMod("badge", "xxxxxxxxxx"));
+
+ response = noContentService.update(role.getKey(), roleMod);
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+
+ response = noContentService.delete(role.getKey());
+ assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
+ assertEquals(Preference.RETURN_NO_CONTENT.toString(), response.getHeaderString(RESTHeaders.PREFERENCE_APPLIED));
+ assertEquals(StringUtils.EMPTY, IOUtils.toString((InputStream) response.getEntity()));
+ }
+
+ @Test
+ public void issueSYNCOPE455() {
+ final String parentName = "issueSYNCOPE455-PRole";
+ final String childName = "issueSYNCOPE455-CRole";
+
+ // 1. create parent role
+ RoleTO parent = buildBasicRoleTO(parentName);
+ parent.getResources().add(RESOURCE_NAME_LDAP);
+
+ parent = createRole(parent);
+ assertTrue(parent.getResources().contains(RESOURCE_NAME_LDAP));
+
+ final ConnObjectTO parentRemoteObject =
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, parent.getKey());
+ assertNotNull(parentRemoteObject);
+ assertNotNull(getLdapRemoteObject(parentRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+
+ // 2. create child role
+ RoleTO child = buildBasicRoleTO(childName);
+ child.getResources().add(RESOURCE_NAME_LDAP);
+ child.setParent(parent.getKey());
+
+ child = createRole(child);
+ assertTrue(child.getResources().contains(RESOURCE_NAME_LDAP));
+
+ final ConnObjectTO childRemoteObject =
+ resourceService.getConnectorObject(RESOURCE_NAME_LDAP, SubjectType.ROLE, child.getKey());
+ assertNotNull(childRemoteObject);
+ assertNotNull(getLdapRemoteObject(childRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+
+ // 3. remove parent role
+ roleService.delete(parent.getKey());
+
+ // 4. asserts for issue 455
+ try {
+ roleService.read(parent.getKey());
+ fail();
+ } catch (SyncopeClientException scce) {
+ assertNotNull(scce);
+ }
+
+ try {
+ roleService.read(child.getKey());
+ fail();
+ } catch (SyncopeClientException scce) {
+ assertNotNull(scce);
+ }
+
+ assertNull(getLdapRemoteObject(parentRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+ assertNull(getLdapRemoteObject(childRemoteObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+ }
+
+ @Test
+ public void issueSYNCOPE543() {
+ final String ancestorName = "issueSYNCOPE543-ARole";
+ final String parentName = "issueSYNCOPE543-PRole";
+ final String childName = "issueSYNCOPE543-CRole";
+
+ // 1. create ancestor role
+ RoleTO ancestor = buildBasicRoleTO(ancestorName);
+ ancestor.setParent(0L);
+ ancestor.getRAttrTemplates().add("icon");
+ ancestor.getPlainAttrs().add(attrTO("icon", "ancestorIcon"));
+ ancestor = createRole(ancestor);
+ assertEquals("ancestorIcon", ancestor.getPlainAttrMap().get("icon").getValues().get(0));
+
+ // 2. create parent role
+ RoleTO parent = buildBasicRoleTO(parentName);
+ parent.setParent(ancestor.getKey());
+ parent.getRAttrTemplates().add("icon");
+ parent.getPlainAttrs().add(attrTO("icon", "parentIcon"));
+ parent = createRole(parent);
+ assertEquals("parentIcon", parent.getPlainAttrMap().get("icon").getValues().get(0));
+
+ // 3. create child role
+ RoleTO child = buildBasicRoleTO(childName);
+ child.setParent(parent.getKey());
+ child.getRAttrTemplates().add("icon");
+ child.getPlainAttrs().add(attrTO("icon", "childIcon"));
+ child = createRole(child);
+ assertEquals("childIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
+
+ final RoleMod roleChildMod = new RoleMod();
+ roleChildMod.setKey(child.getKey());
+ roleChildMod.setInheritPlainAttrs(Boolean.TRUE);
+ updateRole(roleChildMod);
+
+ child = roleService.read(child.getKey());
+ assertNotNull(child);
+ assertNotNull(child.getPlainAttrMap().get("icon").getValues());
+ assertEquals("parentIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
+
+ final RoleMod roleParentMod = new RoleMod();
+ roleParentMod.setKey(parent.getKey());
+ roleParentMod.setInheritPlainAttrs(Boolean.TRUE);
+ updateRole(roleParentMod);
+
+ child = roleService.read(child.getKey());
+ assertNotNull(child);
+ assertNotNull(child.getPlainAttrMap().get("icon").getValues());
+ assertEquals("ancestorIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
+
+ parent = roleService.read(parent.getKey());
+ assertNotNull(parent);
+ assertNotNull(parent.getPlainAttrMap().get("icon").getValues());
+ assertEquals("ancestorIcon", parent.getPlainAttrMap().get("icon").getValues().get(0));
+
+ roleParentMod.setInheritPlainAttrs(Boolean.FALSE);
+ updateRole(roleParentMod);
+
+ child = roleService.read(child.getKey());
+ assertNotNull(child);
+ assertNotNull(child.getPlainAttrMap().get("icon").getValues());
+ assertEquals("parentIcon", child.getPlainAttrMap().get("icon").getValues().get(0));
+ }
+
+ @Test
+ public void issueSYNCOPE632() {
+ RoleTO roleTO = null;
+ try {
+ // 1. create new LDAP resource having account id mapped to a derived attribute
+ ResourceTO newLDAP = resourceService.read(RESOURCE_NAME_LDAP);
+ newLDAP.setKey("new-ldap");
+ newLDAP.setPropagationPrimary(true);
+ MappingItemTO accountId = newLDAP.getRmapping().getAccountIdItem();
+ accountId.setIntMappingType(IntMappingType.RoleDerivedSchema);
+ accountId.setIntAttrName("displayProperty");
+ newLDAP.getRmapping().setAccountIdItem(accountId);
+ newLDAP.getRmapping().setAccountLink("'cn=' + displayProperty + ',ou=groups,o=isp'");
+
+ MappingItemTO description = new MappingItemTO();
+ description.setIntMappingType(IntMappingType.RoleId);
+ description.setExtAttrName("description");
+ description.setPurpose(MappingPurpose.BOTH);
+ newLDAP.getRmapping().addItem(description);
+
+ newLDAP = createResource(newLDAP);
+ assertNotNull(newLDAP);
+
+ // 2. create a role and give the resource created above
+ roleTO = buildRoleTO("lastRole");
+ roleTO.getRAttrTemplates().add("icon");
+ roleTO.getPlainAttrs().add(attrTO("icon", "anIcon"));
+ roleTO.getRAttrTemplates().add("show");
+ roleTO.getPlainAttrs().add(attrTO("show", "true"));
+ roleTO.getRDerAttrTemplates().add("displayProperty");
+ roleTO.getDerAttrs().add(attrTO("displayProperty", null));
+ roleTO.getResources().clear();
+ roleTO.getResources().add("new-ldap");
+
+ roleTO = createRole(roleTO);
+ assertNotNull(roleTO);
+
+ // 3. update the role
+ RoleMod roleMod = new RoleMod();
+ roleMod.setKey(roleTO.getKey());
+ roleMod.getPlainAttrsToRemove().add("icon");
+ roleMod.getPlainAttrsToUpdate().add(attrMod("icon", "anotherIcon"));
+
+ roleTO = updateRole(roleMod);
+ assertNotNull(roleTO);
+
+ // 4. check that a single group exists in LDAP for the role created and updated above
+ int entries = 0;
+ DirContext ctx = null;
+ try {
+ ctx = getLdapResourceDirContext(null, null);
+
+ SearchControls ctls = new SearchControls();
+ ctls.setReturningAttributes(new String[] { "*", "+" });
+ ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+
+ NamingEnumeration<SearchResult> result =
+ ctx.search("ou=groups,o=isp", "(description=" + roleTO.getKey() + ")", ctls);
+ while (result.hasMore()) {
+ result.next();
+ entries++;
+ }
+ } catch (Exception e) {
+ // ignore
+ } finally {
+ if (ctx != null) {
+ try {
+ ctx.close();
+ } catch (NamingException e) {
+ // ignore
+ }
+ }
+ }
+
+ assertEquals(1, entries);
+ } finally {
+ if (roleTO != null) {
+ roleService.delete(roleTO.getKey());
+ }
+ resourceService.delete("new-ldap");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java
new file mode 100644
index 0000000..424ca08
--- /dev/null
+++ b/syncope620/fit/server-reference/src/test/java/org/apache/syncope/fit/server/reference/SchedTaskITCase.java
@@ -0,0 +1,107 @@
+/*
+ * 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.fit.server.reference;
+
+import static org.apache.syncope.fit.server.reference.AbstractITCase.taskService;
+import static org.apache.syncope.fit.server.reference.AbstractTaskITCase.SCHED_TASK_ID;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.SyncTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.rest.api.service.TaskService;
+import org.apache.syncope.server.provisioning.api.job.SyncJob;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class SchedTaskITCase extends AbstractTaskITCase {
+
+ @Test
+ public void getJobClasses() {
+ List<String> jobClasses = syncopeService.info().getTaskJobs();
+ assertNotNull(jobClasses);
+ assertFalse(jobClasses.isEmpty());
+ }
+
+ @Test
+ public void list() {
+ final PagedResult<SchedTaskTO> tasks = taskService.list(TaskType.SCHEDULED);
+ assertFalse(tasks.getResult().isEmpty());
+ for (AbstractTaskTO task : tasks.getResult()) {
+ if (!(task instanceof SchedTaskTO) || task instanceof SyncTaskTO || task instanceof PushTaskTO) {
+ fail();
+ }
+ }
+ }
+
+ @Test
+ public void update() {
+ SchedTaskTO task = taskService.read(SCHED_TASK_ID);
+ assertNotNull(task);
+
+ final SchedTaskTO taskMod = new SchedTaskTO();
+ taskMod.setKey(5);
+ taskMod.setCronExpression(null);
+
+ taskService.update(taskMod.getKey(), taskMod);
+ SchedTaskTO actual = taskService.read(taskMod.getKey());
+ assertNotNull(actual);
+ assertEquals(task.getKey(), actual.getKey());
+ assertNull(actual.getCronExpression());
+ }
+
+ @Test
+ public void issueSYNCOPE144() {
+ SchedTaskTO task = new SchedTaskTO();
+ task.setName("issueSYNCOPE144");
+ task.setDescription("issueSYNCOPE144 Description");
+ task.setJobClassName(SyncJob.class.getName());
+
+ Response response = taskService.create(task);
+ SchedTaskTO actual = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
+ assertNotNull(actual);
+ assertEquals("issueSYNCOPE144", actual.getName());
+ assertEquals("issueSYNCOPE144 Description", actual.getDescription());
+
+ task = taskService.read(actual.getKey());
+ assertNotNull(task);
+ assertEquals("issueSYNCOPE144", task.getName());
+ assertEquals("issueSYNCOPE144 Description", task.getDescription());
+
+ task.setName("issueSYNCOPE144_2");
+ task.setDescription("issueSYNCOPE144 Description_2");
+
+ response = taskService.create(task);
+ actual = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
+ assertNotNull(actual);
+ assertEquals("issueSYNCOPE144_2", actual.getName());
+ assertEquals("issueSYNCOPE144 Description_2", actual.getDescription());
+ }
+}
[39/52] syncope git commit: [SYNCOPE-620] Console (JAR) in,
now time for console-reference
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
new file mode 100644
index 0000000..70b646c
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PolicyModalPage.java
@@ -0,0 +1,451 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.NotificationPanel;
+import org.apache.syncope.client.console.panels.PolicyBeanPanel;
+import org.apache.syncope.client.console.rest.PolicyRestClient;
+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.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.common.lib.to.AbstractPolicyTO;
+import org.apache.syncope.common.lib.to.AccountPolicyTO;
+import org.apache.syncope.common.lib.to.PasswordPolicyTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.SyncPolicyTO;
+import org.apache.syncope.common.lib.types.AccountPolicySpec;
+import org.apache.syncope.common.lib.types.PasswordPolicySpec;
+import org.apache.syncope.common.lib.types.PolicySpec;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.lib.types.SyncPolicySpec;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.model.util.ListModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+
+/**
+ * Modal window with Resource form.
+ */
+public class PolicyModalPage<T extends AbstractPolicyTO> extends BaseModalPage {
+
+ private static final long serialVersionUID = -7325772767481076679L;
+
+ private static final int WIN_HEIGHT = 600;
+
+ private static final int WIN_WIDTH = 1100;
+
+ @SpringBean
+ private PolicyRestClient policyRestClient;
+
+ public PolicyModalPage(final PageReference pageRef, final ModalWindow window, final T policyTO) {
+ super();
+
+ final Form<?> form = new Form<Void>(FORM);
+ form.setOutputMarkupId(true);
+ add(form);
+
+ final AjaxTextFieldPanel policyid = new AjaxTextFieldPanel("id", "id",
+ new PropertyModel<String>(policyTO, "id"));
+ policyid.setEnabled(false);
+ policyid.setStyleSheet("ui-widget-content ui-corner-all short_fixedsize");
+ form.add(policyid);
+
+ final AjaxTextFieldPanel description = new AjaxTextFieldPanel("description", "description",
+ new PropertyModel<String>(policyTO, "description"));
+ description.addRequiredLabel();
+ description.setStyleSheet("ui-widget-content ui-corner-all medium_dynamicsize");
+ form.add(description);
+
+ final AjaxDropDownChoicePanel<PolicyType> type = new AjaxDropDownChoicePanel<PolicyType>("type", "type",
+ new PropertyModel<PolicyType>(policyTO, "type"));
+ switch (policyTO.getType()) {
+ case GLOBAL_ACCOUNT:
+ case ACCOUNT:
+ type.setChoices(Arrays.asList(new PolicyType[] { PolicyType.GLOBAL_ACCOUNT, PolicyType.ACCOUNT }));
+ break;
+
+ case GLOBAL_PASSWORD:
+ case PASSWORD:
+ type.setChoices(Arrays.asList(new PolicyType[] { PolicyType.GLOBAL_PASSWORD, PolicyType.PASSWORD }));
+ break;
+
+ case GLOBAL_SYNC:
+ case SYNC:
+ type.setChoices(Arrays.asList(new PolicyType[] { PolicyType.GLOBAL_SYNC, PolicyType.SYNC }));
+
+ default:
+ }
+ type.setChoiceRenderer(new PolicyTypeRenderer());
+ type.addRequiredLabel();
+ form.add(type);
+
+ // Authentication resources - only for AccountPolicyTO
+ Fragment fragment;
+ if (policyTO instanceof AccountPolicyTO) {
+ fragment = new Fragment("forAccountOnly", "authResourcesFragment", form);
+
+ final List<String> resourceNames = new ArrayList<>();
+ for (ResourceTO resource : resourceRestClient.getAll()) {
+ resourceNames.add(resource.getKey());
+ }
+ fragment.add(new AjaxPalettePanel<>("authResources",
+ new PropertyModel<List<String>>(policyTO, "resources"),
+ new ListModel<>(resourceNames)));
+ } else {
+ fragment = new Fragment("forAccountOnly", "emptyFragment", form);
+ }
+ form.add(fragment);
+ //
+
+ final PolicySpec policy = getPolicySpecification(policyTO);
+
+ form.add(new PolicyBeanPanel("panel", policy));
+
+ final ModalWindow mwindow = new ModalWindow("metaEditModalWin");
+ mwindow.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ mwindow.setInitialHeight(WIN_HEIGHT);
+ mwindow.setInitialWidth(WIN_WIDTH);
+ mwindow.setCookieName("meta-edit-modal");
+ add(mwindow);
+
+ List<IColumn<String, String>> resColumns = new ArrayList<IColumn<String, String>>();
+ resColumns.add(new AbstractColumn<String, String>(new StringResourceModel("name", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<String>> cellItem,
+ final String componentId, final IModel<String> rowModel) {
+
+ cellItem.add(new Label(componentId, rowModel.getObject()));
+ }
+ });
+ resColumns.add(new AbstractColumn<String, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<String>> cellItem, final String componentId,
+ final IModel<String> model) {
+
+ final String resource = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ mwindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ResourceModalPage(PolicyModalPage.this.getPageReference(),
+ mwindow, resourceRestClient.read(resource), false);
+ }
+ });
+
+ mwindow.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Resources");
+
+ cellItem.add(panel);
+ }
+ });
+ ISortableDataProvider<String, String> resDataProvider = new SortableDataProvider<String, String>() {
+
+ private static final long serialVersionUID = 8263758912838836438L;
+
+ @Override
+ public Iterator<? extends String> iterator(final long first, final long count) {
+ return policyTO.getKey() == 0
+ ? Collections.<String>emptyList().iterator()
+ : policyRestClient.getPolicy(policyTO.getKey()).
+ getUsedByResources().subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return policyTO.getKey() == 0
+ ? 0
+ : policyRestClient.getPolicy(policyTO.getKey()).
+ getUsedByResources().size();
+ }
+
+ @Override
+ public IModel<String> model(final String object) {
+ return new Model<String>(object);
+ }
+ };
+ final AjaxFallbackDefaultDataTable<String, String> resources =
+ new AjaxFallbackDefaultDataTable<String, String>("resources", resColumns, resDataProvider, 10);
+ form.add(resources);
+
+ List<IColumn<RoleTO, String>> roleColumns = new ArrayList<IColumn<RoleTO, String>>();
+ roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("id", "id"), "id", "id"));
+ roleColumns.add(new PropertyColumn<RoleTO, String>(new ResourceModel("name", "name"), "name", "name"));
+ roleColumns.add(new AbstractColumn<RoleTO, String>(new StringResourceModel("actions", this, null, "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(final Item<ICellPopulator<RoleTO>> cellItem, final String componentId,
+ final IModel<RoleTO> model) {
+
+ final RoleTO role = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ mwindow.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new RoleModalPage(PolicyModalPage.this.getPageReference(), mwindow, role);
+ }
+ });
+
+ mwindow.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Roles");
+
+ cellItem.add(panel);
+ }
+ });
+ ISortableDataProvider<RoleTO, String> roleDataProvider = new SortableDataProvider<RoleTO, String>() {
+
+ private static final long serialVersionUID = 8263758912838836438L;
+
+ @Override
+ public Iterator<? extends RoleTO> iterator(final long first, final long count) {
+ List<RoleTO> roles = new ArrayList<>();
+
+ if (policyTO.getKey() > 0) {
+ for (Long roleId : policyRestClient.getPolicy(policyTO.getKey()).
+ getUsedByRoles().subList((int) first, (int) first + (int) count)) {
+
+ roles.add(roleRestClient.read(roleId));
+ }
+ }
+
+ return roles.iterator();
+ }
+
+ @Override
+ public long size() {
+ return policyTO.getKey() == 0
+ ? 0
+ : policyRestClient.getPolicy(policyTO.getKey()).
+ getUsedByRoles().size();
+ }
+
+ @Override
+ public IModel<RoleTO> model(final RoleTO object) {
+ return new Model<RoleTO>(object);
+ }
+ };
+ final AjaxFallbackDefaultDataTable<RoleTO, String> roles =
+ new AjaxFallbackDefaultDataTable<RoleTO, String>("roles", roleColumns, roleDataProvider, 10);
+ form.add(roles);
+
+ mwindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ target.add(resources);
+ target.add(roles);
+ if (isModalResult()) {
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ feedbackPanel.refresh(target);
+ setModalResult(false);
+ }
+ }
+ });
+
+ final AjaxButton submit = new IndicatingAjaxButton(APPLY, new ResourceModel(APPLY)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ setPolicySpecification(policyTO, policy);
+
+ try {
+ if (policyTO.getKey() > 0) {
+ policyRestClient.updatePolicy(policyTO);
+ } else {
+ policyRestClient.createPolicy(policyTO);
+ }
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+
+ window.close(target);
+ } catch (Exception e) {
+ LOG.error("While creating policy", e);
+
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
+ }
+ };
+ form.add(submit);
+
+ final IndicatingAjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ }
+ };
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+ }
+
+ private PolicySpec getPolicySpecification(final AbstractPolicyTO policyTO) {
+ PolicySpec spec;
+
+ switch (policyTO.getType()) {
+ case GLOBAL_ACCOUNT:
+ case ACCOUNT:
+ spec = ((AccountPolicyTO) policyTO).getSpecification() != null
+ ? ((AccountPolicyTO) policyTO).getSpecification()
+ : new AccountPolicySpec();
+ break;
+
+ case GLOBAL_PASSWORD:
+ case PASSWORD:
+ spec = ((PasswordPolicyTO) policyTO).getSpecification() != null
+ ? ((PasswordPolicyTO) policyTO).getSpecification()
+ : new PasswordPolicySpec();
+ break;
+
+ case GLOBAL_SYNC:
+ case SYNC:
+ default:
+ spec = ((SyncPolicyTO) policyTO).getSpecification() != null
+ ? ((SyncPolicyTO) policyTO).getSpecification()
+ : new SyncPolicySpec();
+ }
+
+ return spec;
+ }
+
+ private void setPolicySpecification(final AbstractPolicyTO policyTO, final PolicySpec specification) {
+ switch (policyTO.getType()) {
+ case GLOBAL_ACCOUNT:
+ case ACCOUNT:
+ if (!(specification instanceof AccountPolicySpec)) {
+ throw new ClassCastException("policy is type Account, but spec is not: "
+ + specification.getClass().getName());
+ }
+ ((AccountPolicyTO) policyTO).setSpecification((AccountPolicySpec) specification);
+ break;
+
+ case GLOBAL_PASSWORD:
+ case PASSWORD:
+ if (!(specification instanceof PasswordPolicySpec)) {
+ throw new ClassCastException("policy is type Password, but spec is not: "
+ + specification.getClass().getName());
+ }
+ ((PasswordPolicyTO) policyTO).setSpecification((PasswordPolicySpec) specification);
+ break;
+
+ case GLOBAL_SYNC:
+ case SYNC:
+ if (!(specification instanceof SyncPolicySpec)) {
+ throw new ClassCastException("policy is type Sync, but spec is not: "
+ + specification.getClass().getName());
+ }
+ ((SyncPolicyTO) policyTO).setSpecification((SyncPolicySpec) specification);
+
+ default:
+ }
+ }
+
+ private class PolicyTypeRenderer extends ChoiceRenderer<PolicyType> {
+
+ private static final long serialVersionUID = -8993265421104002134L;
+
+ @Override
+ public Object getDisplayValue(final PolicyType object) {
+ return getString(object.name());
+ }
+ };
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PropagationTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PropagationTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PropagationTaskModalPage.java
new file mode 100644
index 0000000..5a6779f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PropagationTaskModalPage.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ * Modal window with Task form (to stop and start execution).
+ */
+public class PropagationTaskModalPage extends TaskModalPage {
+
+ private static final long serialVersionUID = 523379887023786151L;
+
+ public PropagationTaskModalPage(final AbstractTaskTO taskTO) {
+ super(taskTO);
+
+ final AjaxTextFieldPanel accountId = new AjaxTextFieldPanel("accountId", getString("accountId"),
+ new PropertyModel<String>(taskTO, "accountId"));
+ accountId.setEnabled(false);
+ profile.add(accountId);
+
+ final AjaxTextFieldPanel resource = new AjaxTextFieldPanel("resource", getString("resource"),
+ new PropertyModel<String>(taskTO, "resource"));
+ resource.setEnabled(false);
+ profile.add(resource);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
new file mode 100644
index 0000000..c7e192f
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.status.AbstractStatusBeanProvider;
+import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
+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.ActionDataTablePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.wrap.AbstractWrappable;
+import org.apache.syncope.common.lib.wrap.SubjectId;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.StringResourceModel;
+
+public class ProvisioningModalPage<T extends AbstractAttributableTO> extends AbstractStatusModalPage {
+
+ private static final long serialVersionUID = -4285220460543213901L;
+
+ private static final int ROWS_PER_PAGE = 10;
+
+ private final ResourceTO resourceTO;
+
+ private final Class<? extends AbstractAttributableTO> typeRef;
+
+ private final PageReference pageRef;
+
+ private final ModalWindow window;
+
+ private final StatusUtils statusUtils;
+
+ public ProvisioningModalPage(
+ final PageReference pageRef,
+ final ModalWindow window,
+ final ResourceTO resourceTO,
+ final Class<T> typeRef) {
+
+ super();
+
+ this.pageRef = pageRef;
+ this.window = window;
+ this.resourceTO = resourceTO;
+ this.typeRef = typeRef;
+
+ statusUtils = new StatusUtils((UserTO.class.isAssignableFrom(typeRef) ? userRestClient : roleRestClient));
+
+ final List<IColumn<StatusBean, String>> columns = new ArrayList<IColumn<StatusBean, String>>();
+ columns.add(new PropertyColumn<StatusBean, String>(
+ new StringResourceModel("id", this, null, "Attributable id"),
+ "attributableId", "attributableId"));
+ columns.add(new PropertyColumn<StatusBean, String>(
+ new StringResourceModel("name", this, null, "Attributable name"),
+ "attributableName", "attributableName"));
+ columns.add(new PropertyColumn<StatusBean, String>(
+ new StringResourceModel("resourceName", this, null, "Resource name"),
+ "resourceName", "resourceName"));
+ columns.add(new PropertyColumn<StatusBean, String>(
+ new StringResourceModel("accountLink", this, null, "Account link"),
+ "accountLink", "accountLink"));
+ columns.add(new AbstractColumn<StatusBean, String>(
+ new StringResourceModel("status", this, null, "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public String getCssClass() {
+ return "action";
+ }
+
+ @Override
+ public void populateItem(
+ final Item<ICellPopulator<StatusBean>> cellItem,
+ final String componentId,
+ final IModel<StatusBean> model) {
+ cellItem.
+ add(statusUtils.getStatusImagePanel(componentId, model.getObject().getStatus()));
+ }
+ });
+
+ final ActionDataTablePanel<StatusBean, String> table = new ActionDataTablePanel<StatusBean, String>(
+ "resourceDatatable",
+ columns,
+ (ISortableDataProvider<StatusBean, String>) new StatusBeanProvider(),
+ ROWS_PER_PAGE,
+ pageRef);
+
+ final String pageId = "Resources";
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ bulkAssociationAction(target, ResourceDeassociationActionType.UNLINK, table, columns);
+ } catch (Exception e) {
+ LOG.error("Error unlinkink resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.UNLINK, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ bulkAssociationAction(target, ResourceDeassociationActionType.DEPROVISION, table, columns);
+ } catch (Exception e) {
+ LOG.error("Error de-provisioning user", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.DEPROVISION, pageId);
+
+ table.addAction(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ bulkAssociationAction(target, ResourceDeassociationActionType.UNASSIGN, table, columns);
+ } catch (Exception e) {
+ LOG.error("Error unassigning resources", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+ }, ActionLink.ActionType.UNASSIGN, pageId);
+
+ table.addCancelButton(window);
+
+ add(table);
+ }
+
+ private class StatusBeanProvider extends AbstractStatusBeanProvider {
+
+ private static final long serialVersionUID = 4287357360778016173L;
+
+ public StatusBeanProvider() {
+ super("accountLink");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<StatusBean> getStatusBeans() {
+ final String fiql = SyncopeClient.getUserSearchConditionBuilder().hasResources(resourceTO.getKey()).query();
+
+ final List<T> subjects = new ArrayList<T>();
+ if (UserTO.class.isAssignableFrom(typeRef)) {
+ subjects.addAll((List<T>) userRestClient.search(fiql, 1, ROWS_PER_PAGE,
+ new SortParam<String>("id", true)));
+ } else {
+ subjects.addAll((List<T>) roleRestClient.search(fiql, 1, ROWS_PER_PAGE,
+ new SortParam<String>("id", true)));
+ }
+
+ final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects(
+ (List<AbstractSubjectTO>) subjects, Collections.<String>singleton(resourceTO.getKey()));
+
+ final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
+ final LinkedHashMap<String, StatusBean> initialStatusBeanMap = new LinkedHashMap<String, StatusBean>(
+ connObjects.size());
+
+ for (ConnObjectWrapper entry : connObjects) {
+ final StatusBean statusBean = statusUtils.getStatusBean(
+ entry.getAttributable(),
+ entry.getResourceName(),
+ entry.getConnObjectTO(),
+ RoleTO.class.isAssignableFrom(typeRef));
+
+ initialStatusBeanMap.put(entry.getResourceName(), statusBean);
+ statusBeans.add(statusBean);
+ }
+
+ return statusBeans;
+ }
+ }
+
+ private void bulkAssociationAction(
+ final AjaxRequestTarget target,
+ final ResourceDeassociationActionType type,
+ final ActionDataTablePanel<StatusBean, String> table,
+ final List<IColumn<StatusBean, String>> columns) {
+
+ final List<StatusBean> beans = new ArrayList<StatusBean>(table.getModelObject());
+ List<SubjectId> subjectIds = new ArrayList<SubjectId>();
+ for (StatusBean bean : beans) {
+ LOG.debug("Selected bean {}", bean);
+ subjectIds.add(AbstractWrappable.getInstance(SubjectId.class, bean.getAttributableId()));
+ }
+
+ if (beans.isEmpty()) {
+ window.close(target);
+ } else {
+ final BulkActionResult res = resourceRestClient.bulkAssociationAction(
+ resourceTO.getKey(), typeRef, type, subjectIds);
+
+ ((BasePage) pageRef.getPage()).setModalResult(true);
+
+ setResponsePage(new BulkActionResultModalPage<StatusBean, String>(
+ window, beans, columns, res, "attributableId"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java
new file mode 100644
index 0000000..a799b15
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/PushTaskModalPage.java
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.RoleSearchPanel;
+import org.apache.syncope.client.console.panels.UserSearchPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.common.lib.to.PushTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.types.MatchingRule;
+import org.apache.syncope.common.lib.types.UnmatchingRule;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.model.Model;
+
+/**
+ * Modal window with Push Task form.
+ */
+public class PushTaskModalPage extends AbstractSyncTaskModalPage {
+
+ private static final long serialVersionUID = 2148403203517274669L;
+
+ private final UserSearchPanel userFilter;
+
+ private final RoleSearchPanel roleFilter;
+
+ private final AjaxCheckBoxPanel checkUserFilter;
+
+ private final AjaxCheckBoxPanel checkRoleFilter;
+
+ @Override
+ protected List<String> getSyncActions() {
+ return taskRestClient.getPushActionsClasses();
+ }
+
+ public PushTaskModalPage(final ModalWindow window, final PushTaskTO taskTO, final PageReference pageRef) {
+
+ super(window, taskTO, pageRef);
+
+ // set default Matching rule
+ ((DropDownChoice) matchingRule.getField()).setDefaultModelObject(taskTO.getMatchingRule() == null
+ ? MatchingRule.UPDATE
+ : taskTO.getMatchingRule());
+ profile.add(matchingRule);
+
+ // set default Unmatching rule
+ ((DropDownChoice) unmatchingRule.getField()).setDefaultModelObject(taskTO.getUnmatchingRule() == null
+ ? UnmatchingRule.ASSIGN
+ : taskTO.getUnmatchingRule());
+ profile.add(unmatchingRule);
+
+ final WebMarkupContainer filterContainer = new WebMarkupContainer("filterContainer");
+ filterContainer.setOutputMarkupId(true);
+
+ checkUserFilter = new AjaxCheckBoxPanel("checkUserFilter", "checkUserFilter",
+ new Model<Boolean>(taskTO.getUserFilter() != null));
+ filterContainer.add(checkUserFilter);
+
+ checkRoleFilter = new AjaxCheckBoxPanel("checkRoleFilter", "checkRoleFilter",
+ new Model<Boolean>(taskTO.getRoleFilter() != null));
+ filterContainer.add(checkRoleFilter);
+
+ userFilter = new UserSearchPanel.Builder("userFilter").fiql(taskTO.getUserFilter()).build();
+ userFilter.setEnabled(checkUserFilter.getModelObject());
+
+ filterContainer.add(userFilter);
+
+ roleFilter = new RoleSearchPanel.Builder("roleFilter").fiql(taskTO.getRoleFilter()).build();
+ roleFilter.setEnabled(checkRoleFilter.getModelObject());
+ filterContainer.add(roleFilter);
+
+ checkUserFilter.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ userFilter.setEnabled(checkUserFilter.getModelObject());
+ target.add(filterContainer);
+ }
+ });
+
+ checkRoleFilter.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ roleFilter.setEnabled(checkRoleFilter.getModelObject());
+ target.add(filterContainer);
+ }
+ });
+
+ profile.add(filterContainer);
+ }
+
+ @Override
+ public void submitAction(final SchedTaskTO taskTO) {
+ setFilters((PushTaskTO) taskTO);
+ if (taskTO.getKey() > 0) {
+ taskRestClient.updateSchedTask((PushTaskTO) taskTO);
+ } else {
+ taskRestClient.createSchedTask((PushTaskTO) taskTO);
+ }
+ }
+
+ private void setFilters(final PushTaskTO pushTaskTO) {
+ // set user filter if enabled
+ pushTaskTO.setUserFilter(checkUserFilter.getModelObject() ? userFilter.buildFIQL() : null);
+ // set role filter if enabled
+ pushTaskTO.setRoleFilter(checkRoleFilter.getModelObject() ? roleFilter.buildFIQL() : null);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.java
new file mode 100644
index 0000000..c6b57d2
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportExecResultDownloadModalPage.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.Arrays;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.common.lib.types.ReportExecExportFormat;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.Model;
+
+public class ReportExecResultDownloadModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = 3163146190501510888L;
+
+ public ReportExecResultDownloadModalPage(final ModalWindow window, final PageReference callerPageRef) {
+
+ final AjaxDropDownChoicePanel<ReportExecExportFormat> format =
+ new AjaxDropDownChoicePanel<>("format", "format", new Model<ReportExecExportFormat>());
+
+ format.setChoices(Arrays.asList(ReportExecExportFormat.values()));
+
+ format.setChoiceRenderer(new IChoiceRenderer<ReportExecExportFormat>() {
+
+ private static final long serialVersionUID = -3941271550163141339L;
+
+ @Override
+ public Object getDisplayValue(final ReportExecExportFormat object) {
+ return object.name();
+ }
+
+ @Override
+ public String getIdValue(final ReportExecExportFormat object, final int index) {
+
+ return object.name();
+ }
+ });
+
+ format.getField().add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ format.getField();
+
+ ((ReportModalPage) callerPageRef.getPage()).setExportFormat(format.getField().getModelObject());
+ window.close(target);
+ }
+ });
+ add(format);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/32707b3b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
----------------------------------------------------------------------
diff --git a/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
new file mode 100644
index 0000000..ebf91bd
--- /dev/null
+++ b/syncope620/client/console/src/main/java/org/apache/syncope/client/console/pages/ReportModalPage.java
@@ -0,0 +1,640 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DateFormatROModel;
+import org.apache.syncope.client.console.commons.HttpResourceStream;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.wicket.ajax.form.AbstractAjaxDownloadBehavior;
+import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.client.console.wicket.markup.html.CrontabContainer;
+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.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.report.AbstractReportletConf;
+import org.apache.syncope.common.lib.report.ReportletConf;
+import org.apache.syncope.common.lib.to.ReportExecTO;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.ReportExecExportFormat;
+import org.apache.syncope.common.lib.types.ReportExecStatus;
+import org.apache.wicket.Component;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.ListChoice;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.util.resource.IResourceStream;
+import org.springframework.util.StringUtils;
+
+public class ReportModalPage extends BaseModalPage {
+
+ private static final long serialVersionUID = -5747628615211127644L;
+
+ private static final String ADD_BUTTON_ID = "addButton";
+
+ private static final String EDIT_BUTTON_ID = "editButton";
+
+ private static final String REMOVE_BUTTON_ID = "removeButton";
+
+ private static final String UP_BUTTON_ID = "upButton";
+
+ private static final String DOWN_BUTTON_ID = "downButton";
+
+ private static final int EXEC_EXPORT_WIN_HEIGHT = 100;
+
+ private static final int EXEC_EXPORT_WIN_WIDTH = 400;
+
+ private static final int REPORTLET_CONF_WIN_HEIGHT = 500;
+
+ private static final int REPORTLET_CONF_WIN_WIDTH = 800;
+
+ private final ReportTO reportTO;
+
+ private final Form<ReportTO> form;
+
+ private ReportExecExportFormat exportFormat;
+
+ private long exportExecId;
+
+ private AbstractReportletConf modalReportletConf;
+
+ private String modalReportletConfOldName;
+
+ private ListChoice<AbstractReportletConf> reportlets;
+
+ public ReportModalPage(final ModalWindow window, final ReportTO reportTO, final PageReference callerPageRef) {
+ super();
+ this.reportTO = reportTO;
+
+ form = new Form<ReportTO>(FORM);
+ form.setModel(new CompoundPropertyModel<ReportTO>(reportTO));
+ add(form);
+
+ setupProfile();
+ setupExecutions();
+
+ final CrontabContainer crontab = new CrontabContainer("crontab", new PropertyModel<String>(reportTO,
+ "cronExpression"), reportTO.getCronExpression());
+ form.add(crontab);
+
+ final AjaxButton submit =
+ new ClearIndicatingAjaxButton(APPLY, new ResourceModel(APPLY), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ ReportTO toSubmit = (ReportTO) form.getModelObject();
+ toSubmit.setCronExpression(StringUtils.hasText(toSubmit.getCronExpression())
+ ? crontab.getCronExpression()
+ : null);
+
+ try {
+ if (toSubmit.getKey() > 0) {
+ reportRestClient.update(toSubmit);
+ } else {
+ reportRestClient.create(toSubmit);
+ }
+
+ ((BasePage) callerPageRef.getPage()).setModalResult(true);
+
+ window.close(target);
+ } catch (SyncopeClientException e) {
+ LOG.error("While creating or updating report", e);
+ error(getString(Constants.ERROR) + ": " + e.getMessage());
+ feedbackPanel.refresh(target);
+ }
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ feedbackPanel.refresh(target);
+ }
+ };
+
+ if (reportTO.getKey() > 0) {
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
+ xmlRolesReader.getEntitlement("Reports", "update"));
+ } else {
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
+ xmlRolesReader.getEntitlement("Reports", "create"));
+ }
+
+ form.add(submit);
+
+ final AjaxButton cancel =
+ new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), getPageReference()) {
+
+ private static final long serialVersionUID = -958724007591692537L;
+
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ window.close(target);
+ }
+ };
+
+ cancel.setDefaultFormProcessing(false);
+ form.add(cancel);
+ }
+
+ private void setupProfile() {
+ final WebMarkupContainer profile = new WebMarkupContainer("profile");
+ profile.setOutputMarkupId(true);
+ form.add(profile);
+
+ final ModalWindow reportletConfWin = new ModalWindow("reportletConfWin");
+ reportletConfWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ reportletConfWin.setCookieName("reportlet-conf-win-modal");
+ reportletConfWin.setInitialHeight(REPORTLET_CONF_WIN_HEIGHT);
+ reportletConfWin.setInitialWidth(REPORTLET_CONF_WIN_WIDTH);
+ reportletConfWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ int foundIdx = -1;
+ if (modalReportletConfOldName != null) {
+ for (int i = 0; i < reportTO.getReportletConfs().size() && foundIdx == -1; i++) {
+ if (reportTO.getReportletConfs().get(i).getName().equals(modalReportletConfOldName)) {
+ foundIdx = i;
+ }
+ }
+ }
+ if (modalReportletConf != null) {
+ if (foundIdx == -1) {
+ reportTO.getReportletConfs().add(modalReportletConf);
+ } else {
+ reportTO.getReportletConfs().set(foundIdx, modalReportletConf);
+ }
+ }
+
+ target.add(reportlets);
+ }
+ });
+ add(reportletConfWin);
+
+ final Label idLabel = new Label("idLabel", new ResourceModel("id"));
+ profile.add(idLabel);
+
+ final AjaxTextFieldPanel id = new AjaxTextFieldPanel("id", getString("id"), new PropertyModel<String>(reportTO,
+ "id"));
+ id.setEnabled(false);
+ profile.add(id);
+
+ final Label nameLabel = new Label("nameLabel", new ResourceModel("name"));
+ profile.add(nameLabel);
+
+ final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
+ reportTO, "name"));
+ profile.add(name);
+
+ final AjaxTextFieldPanel lastExec = new AjaxTextFieldPanel("lastExec", getString("lastExec"),
+ new DateFormatROModel(new PropertyModel<String>(reportTO, "lastExec")));
+ lastExec.setEnabled(false);
+ profile.add(lastExec);
+
+ final AjaxTextFieldPanel nextExec = new AjaxTextFieldPanel("nextExec", getString("nextExec"),
+ new DateFormatROModel(new PropertyModel<String>(reportTO, "nextExec")));
+ nextExec.setEnabled(false);
+ profile.add(nextExec);
+
+ reportlets = new ListChoice<AbstractReportletConf>("reportletConfs", new Model<AbstractReportletConf>(),
+ reportTO.getReportletConfs(), new IChoiceRenderer<ReportletConf>() {
+
+ private static final long serialVersionUID = 1048000918946220007L;
+
+ @Override
+ public Object getDisplayValue(final ReportletConf object) {
+ return object.getName();
+ }
+
+ @Override
+ public String getIdValue(final ReportletConf object, final int index) {
+ return object.getName();
+ }
+ }) {
+
+ private static final long serialVersionUID = 4022366881854379834L;
+
+ @Override
+ protected CharSequence getDefaultChoice(final String selectedValue) {
+ return null;
+ }
+ };
+
+ reportlets.setNullValid(true);
+ profile.add(reportlets);
+ reportlets.add(new AjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ target.add(reportlets);
+ }
+ });
+
+ profile.add(new AjaxLink<Void>(ADD_BUTTON_ID) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ reportletConfWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ modalReportletConfOldName = null;
+ modalReportletConf = null;
+ return new ReportletConfModalPage(null, reportletConfWin,
+ ReportModalPage.this.getPageReference());
+ }
+ });
+ reportletConfWin.show(target);
+ }
+ });
+
+ profile.add(new AjaxLink<Void>(EDIT_BUTTON_ID) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (reportlets.getModelObject() != null) {
+ reportletConfWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ modalReportletConfOldName = reportlets.getModelObject().getName();
+ modalReportletConf = null;
+ return new ReportletConfModalPage(reportlets.getModelObject(), reportletConfWin,
+ ReportModalPage.this.getPageReference());
+ }
+ });
+ reportletConfWin.show(target);
+ }
+ }
+ });
+
+ profile.add(new AjaxLink<Void>(REMOVE_BUTTON_ID) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ reportTO.getReportletConfs().remove(reportlets.getModelObject());
+ reportlets.setModelObject(null);
+ target.add(reportlets);
+ }
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
+ if (reportlets.getModelObject() != null) {
+
+ super.updateAjaxAttributes(attributes);
+
+ final AjaxCallListener ajaxCallListener = new AjaxCallListener() {
+
+ private static final long serialVersionUID = 7160235486520935153L;
+
+ @Override
+ public CharSequence getPrecondition(final Component component) {
+ return "if (!confirm('" + getString("confirmDelete") + "')) {return false;}";
+ }
+ };
+ attributes.getAjaxCallListeners().add(ajaxCallListener);
+ }
+ }
+ });
+
+ profile.add(new AjaxLink<Void>(UP_BUTTON_ID) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (reportlets.getModelObject() != null) {
+ moveUp(reportlets.getModelObject());
+ target.add(reportlets);
+ }
+ }
+ });
+
+ profile.add(new AjaxLink<Void>(DOWN_BUTTON_ID) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (reportlets.getModelObject() != null) {
+ moveDown(reportlets.getModelObject());
+ target.add(reportlets);
+ }
+ }
+ });
+ }
+
+ private void moveUp(final AbstractReportletConf item) {
+ final List<AbstractReportletConf> list = reportTO.getReportletConfs();
+ int newPosition = list.indexOf(item) - 1;
+ if (newPosition > -1) {
+ list.remove(item);
+ list.add(newPosition, item);
+ }
+ }
+
+ private void moveDown(final AbstractReportletConf item) {
+ final List<AbstractReportletConf> list = reportTO.getReportletConfs();
+ int newPosition = list.indexOf(item) + 1;
+ if (newPosition < list.size()) {
+ list.remove(item);
+ list.add(newPosition, item);
+ }
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private void setupExecutions() {
+ final WebMarkupContainer executions = new WebMarkupContainer("executionContainer");
+ executions.setOutputMarkupId(true);
+ form.add(executions);
+
+ final ModalWindow reportExecMessageWin = new ModalWindow("reportExecMessageWin");
+ reportExecMessageWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ reportExecMessageWin.setCookieName("report-exec-message-win-modal");
+ add(reportExecMessageWin);
+
+ final ModalWindow reportExecExportWin = new ModalWindow("reportExecExportWin");
+ reportExecExportWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
+ reportExecExportWin.setCookieName("report-exec-export-win-modal");
+ reportExecExportWin.setInitialHeight(EXEC_EXPORT_WIN_HEIGHT);
+ reportExecExportWin.setInitialWidth(EXEC_EXPORT_WIN_WIDTH);
+ reportExecExportWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ AjaxExportDownloadBehavior behavior = new AjaxExportDownloadBehavior(ReportModalPage.this.exportFormat,
+ ReportModalPage.this.exportExecId);
+ executions.add(behavior);
+ behavior.initiate(target);
+ }
+ });
+ add(reportExecExportWin);
+
+ final List<IColumn> columns = new ArrayList<IColumn>();
+ columns.add(new PropertyColumn(new ResourceModel("id"), "id", "id"));
+ columns.add(new DatePropertyColumn(new ResourceModel("startDate"), "startDate", "startDate"));
+ columns.add(new DatePropertyColumn(new ResourceModel("endDate"), "endDate", "endDate"));
+ columns.add(new PropertyColumn(new ResourceModel("status"), "status", "status"));
+ columns.add(new ActionColumn<ReportExecTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = 2054811145491901166L;
+
+ @Override
+ public ActionLinksPanel getActions(final String componentId, final IModel<ReportExecTO> model) {
+
+ final ReportExecTO taskExecutionTO = model.getObject();
+
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ reportExecMessageWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ return new ExecMessageModalPage(model.getObject().getMessage());
+ }
+ });
+ reportExecMessageWin.show(target);
+ }
+ }, ActionLink.ActionType.EDIT, "Reports", StringUtils.hasText(model.getObject().getMessage()));
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ reportExecExportWin.setPageCreator(new ModalWindow.PageCreator() {
+
+ private static final long serialVersionUID = -7834632442532690940L;
+
+ @Override
+ public Page createPage() {
+ ReportModalPage.this.exportExecId = model.getObject().getKey();
+ return new ReportExecResultDownloadModalPage(reportExecExportWin,
+ ReportModalPage.this.getPageReference());
+ }
+ });
+ reportExecExportWin.show(target);
+ }
+ }, ActionLink.ActionType.EXPORT, "Reports", ReportExecStatus.SUCCESS.name().equals(
+ model.getObject().getStatus()));
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ try {
+ reportRestClient.deleteExecution(taskExecutionTO.getKey());
+
+ reportTO.getExecutions().remove(taskExecutionTO);
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ } catch (SyncopeClientException scce) {
+ error(scce.getMessage());
+ }
+
+ feedbackPanel.refresh(target);
+ target.add(executions);
+ }
+ }, ActionLink.ActionType.DELETE, "Reports");
+
+ return panel;
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), getPageReference());
+
+ panel.add(new ActionLink() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ if (target != null) {
+ final ReportTO currentReportTO = reportTO.getKey() == 0
+ ? reportTO
+ : reportRestClient.read(reportTO.getKey());
+ reportTO.getExecutions().clear();
+ reportTO.getExecutions().addAll(currentReportTO.getExecutions());
+ final AjaxFallbackDefaultDataTable currentTable =
+ new AjaxFallbackDefaultDataTable("executionsTable", columns,
+ new ReportExecutionsProvider(reportTO), 10);
+ currentTable.setOutputMarkupId(true);
+ target.add(currentTable);
+ executions.addOrReplace(currentTable);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, TASKS, "list");
+
+ return panel;
+ }
+ });
+
+ final AjaxFallbackDefaultDataTable table = new AjaxFallbackDefaultDataTable("executionsTable", columns,
+ new ReportExecutionsProvider(reportTO), 10);
+ executions.add(table);
+ }
+
+ public void setExportFormat(final ReportExecExportFormat exportFormat) {
+ this.exportFormat = exportFormat;
+ }
+
+ public void setModalReportletConf(final AbstractReportletConf modalReportletConf) {
+ this.modalReportletConf = modalReportletConf;
+ }
+
+ private static class ReportExecutionsProvider extends SortableDataProvider<ReportExecTO, String> {
+
+ private static final long serialVersionUID = 2118096121691420539L;
+
+ private final SortableDataProviderComparator<ReportExecTO> comparator;
+
+ private final ReportTO reportTO;
+
+ public ReportExecutionsProvider(final ReportTO reportTO) {
+ super();
+ this.reportTO = reportTO;
+ setSort("startDate", SortOrder.DESCENDING);
+ comparator = new SortableDataProviderComparator<ReportExecTO>(this);
+ }
+
+ @Override
+ public Iterator<ReportExecTO> iterator(final long first, final long count) {
+
+ List<ReportExecTO> list = reportTO.getExecutions();
+
+ Collections.sort(list, comparator);
+
+ return list.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return reportTO.getExecutions().size();
+ }
+
+ @Override
+ public IModel<ReportExecTO> model(final ReportExecTO taskExecution) {
+
+ return new AbstractReadOnlyModel<ReportExecTO>() {
+
+ private static final long serialVersionUID = 7485475149862342421L;
+
+ @Override
+ public ReportExecTO getObject() {
+ return taskExecution;
+ }
+ };
+ }
+ }
+
+ private class AjaxExportDownloadBehavior extends AbstractAjaxDownloadBehavior {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ private final ReportExecExportFormat exportFormat;
+
+ private final long exportExecId;
+
+ private HttpResourceStream stream;
+
+ public AjaxExportDownloadBehavior(final ReportExecExportFormat exportFormat, final long exportExecId) {
+ super();
+ this.exportFormat = exportFormat;
+ this.exportExecId = exportExecId;
+ }
+
+ private void createResourceStream() {
+ if (stream == null) {
+ stream = new HttpResourceStream(reportRestClient.exportExecutionResult(exportExecId, exportFormat));
+ }
+ }
+
+ @Override
+ protected String getFileName() {
+ createResourceStream();
+ return stream == null
+ ? null
+ : stream.getFilename();
+ }
+
+ @Override
+ protected IResourceStream getResourceStream() {
+ createResourceStream();
+ return stream;
+ }
+ }
+}