http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupDeprovisionProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupDeprovisionProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupDeprovisionProcessor.java new file mode 100644 index 0000000..7953703 --- /dev/null +++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupDeprovisionProcessor.java @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.core.provisioning.camel.processor; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.syncope.core.misc.spring.ApplicationContextProvider; +import org.apache.syncope.core.persistence.api.dao.GroupDAO; +import org.apache.syncope.core.persistence.api.entity.group.Group; +import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; +import org.apache.syncope.core.provisioning.api.propagation.PropagationException; +import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; +import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; +import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class GroupDeprovisionProcessor implements Processor { + + private static final Logger LOG = LoggerFactory.getLogger(UserDeprovisionProcessor.class); + + @Autowired + protected PropagationManager propagationManager; + + @Autowired + protected PropagationTaskExecutor taskExecutor; + + @Autowired + protected GroupDAO groupDAO; + + @SuppressWarnings("unchecked") + @Override + public void process(final Exchange exchange) { + Long groupKey = exchange.getIn().getBody(Long.class); + List<String> resources = exchange.getProperty("resources", List.class); + + Group group = groupDAO.authFetch(groupKey); + + Set<String> noPropResourceName = group.getResourceNames(); + noPropResourceName.removeAll(resources); + + List<PropagationTask> tasks = + propagationManager.getGroupDeleteTaskIds(groupKey, new HashSet<>(resources), noPropResourceName); + PropagationReporter propagationReporter = + ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); + try { + taskExecutor.execute(tasks, propagationReporter); + } catch (PropagationException e) { + LOG.error("Error propagation primary resource", e); + propagationReporter.onPrimaryResourceFailure(tasks); + } + + exchange.getOut().setBody(propagationReporter.getStatuses()); + } + +}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupUpdateProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupUpdateProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupUpdateProcessor.java new file mode 100644 index 0000000..a4c073a --- /dev/null +++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/GroupUpdateProcessor.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.core.provisioning.camel.processor; + +import java.util.AbstractMap; +import java.util.List; +import java.util.Set; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.syncope.common.lib.mod.GroupMod; +import org.apache.syncope.core.misc.spring.ApplicationContextProvider; +import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; +import org.apache.syncope.core.provisioning.api.WorkflowResult; +import org.apache.syncope.core.provisioning.api.propagation.PropagationException; +import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; +import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; +import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class GroupUpdateProcessor implements Processor { + + private static final Logger LOG = LoggerFactory.getLogger(UserUpdateProcessor.class); + + @Autowired + protected PropagationManager propagationManager; + + @Autowired + protected PropagationTaskExecutor taskExecutor; + + @SuppressWarnings("unchecked") + @Override + public void process(final Exchange exchange) { + WorkflowResult<Long> updated = (WorkflowResult) exchange.getIn().getBody(); + GroupMod subjectMod = exchange.getProperty("subjectMod", GroupMod.class); + Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); + + List<PropagationTask> tasks = propagationManager.getGroupUpdateTaskIds(updated, + subjectMod.getVirAttrsToRemove(), subjectMod.getVirAttrsToUpdate(), excludedResource); + PropagationReporter propagationReporter = + ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); + try { + taskExecutor.execute(tasks, propagationReporter); + } catch (PropagationException e) { + LOG.error("Error propagation primary resource", e); + propagationReporter.onPrimaryResourceFailure(tasks); + } + + exchange.getOut().setBody(new AbstractMap.SimpleEntry<>(updated.getResult(), propagationReporter.getStatuses())); + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateInSyncProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateInSyncProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateInSyncProcessor.java deleted file mode 100644 index 0e52082..0000000 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateInSyncProcessor.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.apache.syncope.core.provisioning.camel.processor; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import java.util.AbstractMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.springframework.beans.factory.annotation.Autowired; -import org.apache.commons.lang3.StringUtils; -import org.apache.syncope.common.lib.to.AttrTO; -import org.apache.syncope.common.lib.to.RoleTO; -import org.apache.syncope.core.misc.security.AuthContextUtil; -import org.apache.syncope.core.persistence.api.RoleEntitlementUtil; -import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.core.provisioning.api.WorkflowResult; -import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; -import org.springframework.stereotype.Component; - -@Component -public class RoleCreateInSyncProcessor implements Processor { - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Override - @SuppressWarnings("unchecked") - public void process(final Exchange exchange) { - WorkflowResult<Long> created = (WorkflowResult) exchange.getIn().getBody(); - - RoleTO actual = exchange.getProperty("subject", RoleTO.class); - Map<Long, String> roleOwnerMap = exchange.getProperty("roleOwnerMap", Map.class); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - AttrTO roleOwner = actual.getPlainAttrMap().get(StringUtils.EMPTY); - if (roleOwner != null) { - roleOwnerMap.put(created.getResult(), roleOwner.getValues().iterator().next()); - } - - AuthContextUtil.extendAuthContext( - created.getResult(), RoleEntitlementUtil.getEntitlementNameFromRoleKey(created.getResult())); - - List<PropagationTask> tasks = propagationManager.getRoleCreateTaskIds( - created, actual.getVirAttrs(), excludedResource); - - taskExecutor.execute(tasks); - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>(created.getResult(), null)); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateProcessor.java deleted file mode 100644 index 76df9f6..0000000 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleCreateProcessor.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.core.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.to.RoleTO; -import org.apache.syncope.core.misc.security.AuthContextUtil; -import org.apache.syncope.core.misc.spring.ApplicationContextProvider; -import org.apache.syncope.core.persistence.api.RoleEntitlementUtil; -import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.core.provisioning.api.WorkflowResult; -import org.apache.syncope.core.provisioning.api.propagation.PropagationException; -import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleCreateProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(RoleCreateProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Long> created = (WorkflowResult) exchange.getIn().getBody(); - RoleTO subject = exchange.getProperty("subject", RoleTO.class); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - AuthContextUtil.extendAuthContext( - created.getResult(), RoleEntitlementUtil.getEntitlementNameFromRoleKey(created.getResult())); - - List<PropagationTask> tasks = - propagationManager.getRoleCreateTaskIds(created, subject.getVirAttrs(), excludedResource); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>( - created.getResult(), propagationReporter.getStatuses())); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeleteProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeleteProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeleteProcessor.java deleted file mode 100644 index 90a89d7..0000000 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeleteProcessor.java +++ /dev/null @@ -1,105 +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.core.provisioning.camel.processor; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.types.PropagationByResource; -import org.apache.syncope.core.misc.spring.ApplicationContextProvider; -import org.apache.syncope.core.persistence.api.dao.RoleDAO; -import org.apache.syncope.core.persistence.api.entity.role.Role; -import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.core.provisioning.api.WorkflowResult; -import org.apache.syncope.core.provisioning.api.propagation.PropagationException; -import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; -import org.apache.syncope.core.workflow.api.RoleWorkflowAdapter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleDeleteProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(RoleDeleteProcessor.class); - - @Autowired - protected RoleWorkflowAdapter rwfAdapter; - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Autowired - protected RoleDAO roleDAO; - - @Override - public void process(final Exchange exchange) throws Exception { - final List<Role> toBeDeprovisioned = new ArrayList<>(); - - Long subjectKey = exchange.getIn().getBody(Long.class); - final Role syncopeRole = roleDAO.find(subjectKey); - - if (syncopeRole != null) { - toBeDeprovisioned.add(syncopeRole); - - final List<Role> descendants = roleDAO.findDescendants(toBeDeprovisioned.get(0)); - if (descendants != null) { - toBeDeprovisioned.addAll(descendants); - } - } - - final List<PropagationTask> tasks = new ArrayList<>(); - - for (Role role : toBeDeprovisioned) { - // Generate propagation tasks for deleting users from role resources, if they are on those resources only - // because of the reason being deleted (see SYNCOPE-357) - for (Map.Entry<Long, PropagationByResource> entry : roleDAO.findUsersWithIndirectResources(role. - getKey()).entrySet()) { - - WorkflowResult<Long> wfResult = - new WorkflowResult<>(entry.getKey(), entry.getValue(), Collections.<String>emptySet()); - tasks.addAll(propagationManager.getUserDeleteTaskIds(wfResult)); - } - - // Generate propagation tasks for deleting this role from resources - tasks.addAll(propagationManager.getRoleDeleteTaskIds(role.getKey())); - } - - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.setProperty("statuses", propagationReporter.getStatuses()); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeprovisionProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeprovisionProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeprovisionProcessor.java deleted file mode 100644 index c0aa4fd..0000000 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleDeprovisionProcessor.java +++ /dev/null @@ -1,78 +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.core.provisioning.camel.processor; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.core.misc.spring.ApplicationContextProvider; -import org.apache.syncope.core.persistence.api.dao.RoleDAO; -import org.apache.syncope.core.persistence.api.entity.role.Role; -import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.core.provisioning.api.propagation.PropagationException; -import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleDeprovisionProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserDeprovisionProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Autowired - protected RoleDAO roleDAO; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - Long roleKey = exchange.getIn().getBody(Long.class); - List<String> resources = exchange.getProperty("resources", List.class); - - Role role = roleDAO.authFetch(roleKey); - - Set<String> noPropResourceName = role.getResourceNames(); - noPropResourceName.removeAll(resources); - - List<PropagationTask> tasks = - propagationManager.getRoleDeleteTaskIds(roleKey, new HashSet<>(resources), noPropResourceName); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(propagationReporter.getStatuses()); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleUpdateProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleUpdateProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleUpdateProcessor.java deleted file mode 100644 index 74e377a..0000000 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/RoleUpdateProcessor.java +++ /dev/null @@ -1,71 +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.core.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.mod.RoleMod; -import org.apache.syncope.core.misc.spring.ApplicationContextProvider; -import org.apache.syncope.core.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.core.provisioning.api.WorkflowResult; -import org.apache.syncope.core.provisioning.api.propagation.PropagationException; -import org.apache.syncope.core.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleUpdateProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserUpdateProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Long> updated = (WorkflowResult) exchange.getIn().getBody(); - RoleMod subjectMod = exchange.getProperty("subjectMod", RoleMod.class); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - List<PropagationTask> tasks = propagationManager.getRoleUpdateTaskIds(updated, - subjectMod.getVirAttrsToRemove(), subjectMod.getVirAttrsToUpdate(), excludedResource); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>(updated.getResult(), propagationReporter.getStatuses())); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserUpdateProcessor.java ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserUpdateProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserUpdateProcessor.java index 600cdf8..1ff28c8 100644 --- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserUpdateProcessor.java +++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserUpdateProcessor.java @@ -74,7 +74,7 @@ public class UserUpdateProcessor implements Processor { for (MembershipMod membershipMod : actual.getMembershipsToAdd()) { if (!virtAttrHandler.fillMembershipVirtual( updated.getResult().getKey().getKey(), - membershipMod.getRole(), + membershipMod.getGroup(), null, membershipMod.getVirAttrsToRemove(), membershipMod.getVirAttrsToUpdate(), http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/resources/groupRoutes.xml ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/resources/groupRoutes.xml b/ext/camel/provisioning-camel/src/main/resources/groupRoutes.xml new file mode 100644 index 0000000..63aa0d3 --- /dev/null +++ b/ext/camel/provisioning-camel/src/main/resources/groupRoutes.xml @@ -0,0 +1,140 @@ +<?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. +--> +<routes> + + <route id="createGroup"> + <from uri="direct:createGroup"/> + <setProperty propertyName="subject"> + <simple>${body}</simple> + </setProperty> + <doTry> + <bean ref="gwfAdapter" method="create(${body})"/> + <process ref="groupCreateProcessor"/> + <to uri="direct:createGroupPort"/> + <doCatch> + <exception>java.lang.RuntimeException</exception> + <handled> + <constant>false</constant> + </handled> + <to uri="direct:createGroupPort"/> + </doCatch> + </doTry> + </route> + + <route id="createGroupSync"> + <from uri="direct:createGroupInSync"/> + <setProperty propertyName="subject"> + <simple>${body}</simple> + </setProperty> + <doTry> + <bean ref="gwfAdapter" method="create(${body})"/> + <process ref="groupCreateInSyncProcessor"/> + <to uri="direct:createGroupInSyncPort"/> + <doCatch> + <exception>java.lang.RuntimeException</exception> + <handled> + <constant>false</constant> + </handled> + <to uri="direct:createGroupInSyncPort"/> + </doCatch> + </doTry> + </route> + + <route id="updateGroup"> + <from uri="direct:updateGroup"/> + <setProperty propertyName="subjectMod"> + <simple>${body}</simple> + </setProperty> + <doTry> + <bean ref="gwfAdapter" method="update(${body})"/> + <process ref="groupUpdateProcessor"/> + <to uri="direct:updateGroupPort"/> + <doCatch> + <exception>java.lang.RuntimeException</exception> + <handled> + <constant>false</constant> + </handled> + <to uri="direct:updateGroupPort"/> + </doCatch> + </doTry> + </route> + + <route id="deleteGroup"> + <from uri="direct:deleteGroup"/> + <doTry> + <process ref="groupDeleteProcessor"/> + <bean ref="gwfAdapter" method="delete(${body})"/> + <setBody> + <simple>${property.statuses}</simple> + </setBody> + <to uri="direct:deleteGroupPort"/> + <doCatch> + <exception>java.lang.RuntimeException</exception> + <handled> + <constant>false</constant> + </handled> + <to uri="direct:deleteGroupPort"/> + </doCatch> + </doTry> + </route> + + <route id="unlinkGroup"> + <from uri="direct:unlinkGroup"/> + <doTry> + <bean ref="gwfAdapter" method="update(${body})"/> + <setBody> + <simple>${body.getResult}</simple> + </setBody> + <to uri="direct:unlinkGroupPort"/> + <doCatch> + <exception>java.lang.RuntimeException</exception> + <handled> + <constant>false</constant> + </handled> + <to uri="direct:unlinkGroupPort"/> + </doCatch> + </doTry> + </route> + + <route id="linkGroup"> + <from uri="direct:linkGroup"/> + <doTry> + <bean ref="gwfAdapter" method="update(${body})"/> + <setBody> + <simple>${body.getResult}</simple> + </setBody> + <to uri="direct:linkGroupPort"/> + <doCatch> + <exception>java.lang.RuntimeException</exception> + <handled> + <constant>false</constant> + </handled> + <to uri="direct:linkGroupPort"/> + </doCatch> + </doTry> + </route> + + <route id="deprovisionGroup"> + <from uri="direct:deprovisionGroup"/> + <process ref="groupDeprovisionProcessor"/> + <to uri="direct:deprovisionGroupPort"/> + </route> + +</routes> http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/resources/provisioning.properties ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/resources/provisioning.properties b/ext/camel/provisioning-camel/src/main/resources/provisioning.properties index 16a895b..40dd3ea 100644 --- a/ext/camel/provisioning-camel/src/main/resources/provisioning.properties +++ b/ext/camel/provisioning-camel/src/main/resources/provisioning.properties @@ -16,4 +16,4 @@ # under the License. camel.directory=${conf.directory} userProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelUserProvisioningManager -roleProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelRoleProvisioningManager +groupProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelGroupProvisioningManager http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml b/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml index cb37941..8eec14d 100644 --- a/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml +++ b/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml @@ -29,9 +29,9 @@ under the License. <property name="primary" value="file:${camel.directory}/userRoutes.xml"/> <property name="fallback" value="classpath:userRoutes.xml"/> </bean> - <bean id="roleRoutes" class="org.apache.syncope.core.misc.spring.ResourceWithFallbackLoader"> - <property name="primary" value="file:${camel.directory}/roleRoutes.xml"/> - <property name="fallback" value="classpath:roleRoutes.xml"/> + <bean id="groupRoutes" class="org.apache.syncope.core.misc.spring.ResourceWithFallbackLoader"> + <property name="primary" value="file:${camel.directory}/groupRoutes.xml"/> + <property name="fallback" value="classpath:groupRoutes.xml"/> </bean> <context:component-scan base-package="org.apache.syncope.core.provisioning.camel"/> http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/ext/camel/provisioning-camel/src/main/resources/roleRoutes.xml ---------------------------------------------------------------------- diff --git a/ext/camel/provisioning-camel/src/main/resources/roleRoutes.xml b/ext/camel/provisioning-camel/src/main/resources/roleRoutes.xml deleted file mode 100644 index 04c2dc4..0000000 --- a/ext/camel/provisioning-camel/src/main/resources/roleRoutes.xml +++ /dev/null @@ -1,140 +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. ---> -<routes> - - <route id="createRole"> - <from uri="direct:createRole"/> - <setProperty propertyName="subject"> - <simple>${body}</simple> - </setProperty> - <doTry> - <bean ref="rwfAdapter" method="create(${body})"/> - <process ref="roleCreateProcessor"/> - <to uri="direct:createRolePort"/> - <doCatch> - <exception>java.lang.RuntimeException</exception> - <handled> - <constant>false</constant> - </handled> - <to uri="direct:createRolePort"/> - </doCatch> - </doTry> - </route> - - <route id="createRoleSync"> - <from uri="direct:createRoleInSync"/> - <setProperty propertyName="subject"> - <simple>${body}</simple> - </setProperty> - <doTry> - <bean ref="rwfAdapter" method="create(${body})"/> - <process ref="roleCreateInSyncProcessor"/> - <to uri="direct:createRoleInSyncPort"/> - <doCatch> - <exception>java.lang.RuntimeException</exception> - <handled> - <constant>false</constant> - </handled> - <to uri="direct:createRoleInSyncPort"/> - </doCatch> - </doTry> - </route> - - <route id="updateRole"> - <from uri="direct:updateRole"/> - <setProperty propertyName="subjectMod"> - <simple>${body}</simple> - </setProperty> - <doTry> - <bean ref="rwfAdapter" method="update(${body})"/> - <process ref="roleUpdateProcessor"/> - <to uri="direct:updateRolePort"/> - <doCatch> - <exception>java.lang.RuntimeException</exception> - <handled> - <constant>false</constant> - </handled> - <to uri="direct:updateRolePort"/> - </doCatch> - </doTry> - </route> - - <route id="deleteRole"> - <from uri="direct:deleteRole"/> - <doTry> - <process ref="roleDeleteProcessor"/> - <bean ref="rwfAdapter" method="delete(${body})"/> - <setBody> - <simple>${property.statuses}</simple> - </setBody> - <to uri="direct:deleteRolePort"/> - <doCatch> - <exception>java.lang.RuntimeException</exception> - <handled> - <constant>false</constant> - </handled> - <to uri="direct:deleteRolePort"/> - </doCatch> - </doTry> - </route> - - <route id="unlinkRole"> - <from uri="direct:unlinkRole"/> - <doTry> - <bean ref="rwfAdapter" method="update(${body})"/> - <setBody> - <simple>${body.getResult}</simple> - </setBody> - <to uri="direct:unlinkRolePort"/> - <doCatch> - <exception>java.lang.RuntimeException</exception> - <handled> - <constant>false</constant> - </handled> - <to uri="direct:unlinkRolePort"/> - </doCatch> - </doTry> - </route> - - <route id="linkRole"> - <from uri="direct:linkRole"/> - <doTry> - <bean ref="rwfAdapter" method="update(${body})"/> - <setBody> - <simple>${body.getResult}</simple> - </setBody> - <to uri="direct:linkRolePort"/> - <doCatch> - <exception>java.lang.RuntimeException</exception> - <handled> - <constant>false</constant> - </handled> - <to uri="direct:linkRolePort"/> - </doCatch> - </doTry> - </route> - - <route id="deprovisionRole"> - <from uri="direct:deprovisionRole"/> - <process ref="roleDeprovisionProcessor"/> - <to uri="direct:deprovisionRolePort"/> - </route> - -</routes> http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/build-tools/src/main/java/org/apache/syncope/fit/buildtools/ApacheDSRootDseServlet.java ---------------------------------------------------------------------- diff --git a/fit/build-tools/src/main/java/org/apache/syncope/fit/buildtools/ApacheDSRootDseServlet.java b/fit/build-tools/src/main/java/org/apache/syncope/fit/buildtools/ApacheDSRootDseServlet.java index bfdbdde..ab02040 100644 --- a/fit/build-tools/src/main/java/org/apache/syncope/fit/buildtools/ApacheDSRootDseServlet.java +++ b/fit/build-tools/src/main/java/org/apache/syncope/fit/buildtools/ApacheDSRootDseServlet.java @@ -19,7 +19,7 @@ package org.apache.syncope.fit.buildtools; import java.io.PrintWriter; -import java.util.Hashtable; +import java.util.Properties; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.directory.Attribute; @@ -80,12 +80,12 @@ public class ApacheDSRootDseServlet extends HttpServlet { /** * Creates an environment configuration for JNDI access. */ - private Hashtable<Object, Object> createEnv() { + private Properties createEnv() { // Fetch directory service from servlet context ServletContext servletContext = this.getServletContext(); DirectoryService directoryService = (DirectoryService) servletContext.getAttribute(DirectoryService.JNDI_KEY); - Hashtable<Object, Object> env = new Hashtable<>(); + Properties env = new Properties(); env.put(DirectoryService.JNDI_KEY, directoryService); env.put(Context.PROVIDER_URL, ""); env.put(Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName()); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java ---------------------------------------------------------------------- diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java index 557e9af..3eb3aa7 100644 --- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java +++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/AccessITCase.java @@ -35,21 +35,18 @@ public class AccessITCase extends AbstractITCase { 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("//div[@id='gschema']/div/div/span/ul/li[2]/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(); + seleniumDriver.findElement(By.xpath("//img[@alt=\"Groups\"]")).click(); wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//img[@alt=\"Resources\"]"))); seleniumDriver.findElement(By.xpath("//img[@alt=\"Resources\"]")).click(); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java ---------------------------------------------------------------------- diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java index b4a06f5..c634d1d 100644 --- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java +++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConfigurationITCase.java @@ -161,11 +161,11 @@ public class ConfigurationITCase extends AbstractITCase { wait.until(ExpectedConditions.presenceOfElementLocated( By.xpath("//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']" - + "/option[text()='role']"))); + + "/option[text()='group']"))); select = new Select(seleniumDriver.findElement(By.xpath( "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']"))); - select.selectByVisibleText("role"); + select.selectByVisibleText("group"); wait.until(ExpectedConditions.presenceOfElementLocated( By.xpath("//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']" @@ -256,12 +256,12 @@ public class ConfigurationITCase extends AbstractITCase { wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath( "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']" - + "/option[text()='role']"))); + + "/option[text()='group']"))); select = new Select( seleniumDriver.findElement(By.xpath( "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']"))); - select.selectByVisibleText("role"); + select.selectByVisibleText("group"); wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath( "//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']" @@ -350,12 +350,12 @@ public class ConfigurationITCase extends AbstractITCase { wait.until(ExpectedConditions.presenceOfElementLocated( By.xpath("//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']" - + "/option[text()='RoleLogic']"))); + + "/option[text()='GroupLogic']"))); select = new Select( seleniumDriver.findElement(By.xpath( "//select[@name='eventSelection:categoryContainer:category:dropDownChoiceField']"))); - select.selectByVisibleText("RoleLogic"); + select.selectByVisibleText("GroupLogic"); wait.until(ExpectedConditions.presenceOfElementLocated( By.xpath("//input[@name='eventSelection:eventsContainer:eventsPanel:successGroup']"))); @@ -366,24 +366,24 @@ public class ConfigurationITCase extends AbstractITCase { 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']" + By.xpath("//select[@name='aboutContainer:groupAbout:searchFormContainer:searchView:0:type']" + "/option[text()='ENTITLEMENT']"))); wait.until(ExpectedConditions.elementToBeClickable( - By.xpath("//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:type']"))); + By.xpath("//select[@name='aboutContainer:groupAbout:searchFormContainer:searchView:0:type']"))); select = new Select( seleniumDriver.findElement(By.xpath( - "//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:type']"))); + "//select[@name='aboutContainer:groupAbout: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[@name='aboutContainer:groupAbout:searchFormContainer:searchView:0:property']" + + "/option[text()='GROUP_CREATE']"))); select = new Select(seleniumDriver.findElement(By.xpath( - "//select[@name='aboutContainer:roleAbout:searchFormContainer:searchView:0:property']"))); - select.selectByVisibleText("ROLE_CREATE"); + "//select[@name='aboutContainer:groupAbout:searchFormContainer:searchView:0:property']"))); + select.selectByVisibleText("GROUP_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']")). http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java ---------------------------------------------------------------------- diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java index 17713fa..fc21e4b 100644 --- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java +++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/ConnectorITCase.java @@ -49,7 +49,7 @@ public class ConnectorITCase extends AbstractITCase { Select select = new Select( seleniumDriver.findElement(By.xpath("//form/div[2]/div[1]/div[1]/div[2]/div[2]/span/select"))); - select.selectByValue("1"); + select.selectByValue("0"); wait.until(ExpectedConditions.presenceOfElementLocated( By.xpath("//select[@name='connectorName:dropDownChoiceField']/option[3]"))); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/GroupITCase.java ---------------------------------------------------------------------- diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/GroupITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/GroupITCase.java new file mode 100644 index 0000000..a4f6ef2 --- /dev/null +++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/GroupITCase.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 GroupITCase extends AbstractITCase { + + @Test + public void createRootNodeModal() { + seleniumDriver.findElement(By.xpath("//img[@alt=\"Groups\"]")).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=\"Groups\"]")).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=\"Groups\"]")).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=\"Groups\"]")).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=\"Groups\"]")).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=\"Groups\"]")).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 deleteGroup() { + seleniumDriver.findElement(By.xpath("//img[@alt=\"Groups\"]")).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=\"Groups\"]")).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/4095f1e8/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java ---------------------------------------------------------------------- diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java deleted file mode 100644 index 111ba5e..0000000 --- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/RoleITCase.java +++ /dev/null @@ -1,211 +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.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/4095f1e8/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java ---------------------------------------------------------------------- diff --git a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java index 130d414..e02ddcb 100644 --- a/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java +++ b/fit/console-reference/src/test/java/org/apache/syncope/fit/console/reference/SchemaITCase.java @@ -35,7 +35,7 @@ public class SchemaITCase extends AbstractITCase { 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(); + seleniumDriver.findElement(By.xpath("//div[@id='gschema']/div/div/div/a")).click(); wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//iframe"))); seleniumDriver.switchTo().frame(0); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java index d9ef279..2103059 100644 --- a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java +++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncActions.java @@ -27,6 +27,9 @@ import org.apache.syncope.core.provisioning.java.sync.DefaultSyncActions; import org.identityconnectors.framework.common.objects.SyncDelta; import org.quartz.JobExecutionException; +/** + * Test synchronization action. + */ public class TestSyncActions extends DefaultSyncActions { private int counter = 0; http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncRule.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncRule.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncRule.java index 50d6790..5cb8b10 100644 --- a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncRule.java +++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestSyncRule.java @@ -23,10 +23,13 @@ import org.apache.syncope.core.persistence.api.dao.search.SearchCond; import org.apache.syncope.core.provisioning.api.sync.SyncCorrelationRule; import org.identityconnectors.framework.common.objects.ConnectorObject; +/** + * Test synchronization rule relying on <tt>email</tt> attribute value. + */ public class TestSyncRule implements SyncCorrelationRule { @Override - public SearchCond getSearchCond(ConnectorObject connObj) { + public SearchCond getSearchCond(final ConnectorObject connObj) { AttributeCond cond = new AttributeCond(); cond.setSchema("email"); cond.setType(AttributeCond.Type.EQ); http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/package-info.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/package-info.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/package-info.java new file mode 100644 index 0000000..d9e45f5 --- /dev/null +++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/package-info.java @@ -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. + */ +package org.apache.syncope.fit.core.reference; http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/resources/all/provisioning.properties ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/resources/all/provisioning.properties b/fit/core-reference/src/main/resources/all/provisioning.properties index 16a895b..40dd3ea 100644 --- a/fit/core-reference/src/main/resources/all/provisioning.properties +++ b/fit/core-reference/src/main/resources/all/provisioning.properties @@ -16,4 +16,4 @@ # under the License. camel.directory=${conf.directory} userProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelUserProvisioningManager -roleProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelRoleProvisioningManager +groupProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelGroupProvisioningManager http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/resources/all/workflow.properties ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/resources/all/workflow.properties b/fit/core-reference/src/main/resources/all/workflow.properties index 04e7d05..5a975cf 100644 --- a/fit/core-reference/src/main/resources/all/workflow.properties +++ b/fit/core-reference/src/main/resources/all/workflow.properties @@ -17,4 +17,4 @@ wf.directory=${conf.directory} jobExecutorActivate=true uwfAdapter=org.apache.syncope.core.workflow.activiti.ActivitiUserWorkflowAdapter -rwfAdapter=org.apache.syncope.core.workflow.java.DefaultRoleWorkflowAdapter \ No newline at end of file +gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/resources/connid.properties ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/resources/connid.properties b/fit/core-reference/src/main/resources/connid.properties index 40d649c..a18252f 100644 --- a/fit/core-reference/src/main/resources/connid.properties +++ b/fit/core-reference/src/main/resources/connid.properties @@ -20,4 +20,5 @@ 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 +connid.db.table.version=${connid.db.table.version} + http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/resources/provisioning.properties ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/resources/provisioning.properties b/fit/core-reference/src/main/resources/provisioning.properties index af5deee..4b87d44 100644 --- a/fit/core-reference/src/main/resources/provisioning.properties +++ b/fit/core-reference/src/main/resources/provisioning.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. userProvisioningManager=org.apache.syncope.core.provisioning.java.DefaultUserProvisioningManager -roleProvisioningManager=org.apache.syncope.core.provisioning.java.DefaultRoleProvisioningManager +groupProvisioningManager=org.apache.syncope.core.provisioning.java.DefaultGroupProvisioningManager http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml index d26dbe3..d0b5604 100644 --- a/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml +++ b/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml @@ -34,10 +34,10 @@ under the License. <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> + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wfExecutor == 'anonymous' || user.getGroupKeys().contains(9)}]]></conditionExpression> </sequenceFlow> <sequenceFlow id="create2Activate" sourceRef="createGW" targetRef="enableGW"> - <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.getRoleKeys().contains(9)}]]></conditionExpression> + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!user.getGroupKeys().contains(9)}]]></conditionExpression> </sequenceFlow> <userTask id="createApproval" name="Create approval" activiti:candidateGroups="7" activiti:formKey="createApproval"> <extensionElements> @@ -56,7 +56,7 @@ under the License. </sequenceFlow> <exclusiveGateway id="enableGW"/> <sequenceFlow id="createApprovalGW2OptIn" sourceRef="enableGW" targetRef="generateToken"> - <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.getRoleKeys().contains(11)}]]></conditionExpression> + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${user.getGroupKeys().contains(11)}]]></conditionExpression> </sequenceFlow> <sequenceFlow id="createApprovalGW2Activate" sourceRef="enableGW" targetRef="activate"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${enabled == null}]]></conditionExpression> @@ -574,4 +574,4 @@ under the License. </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> -</definitions> \ No newline at end of file +</definitions> http://git-wip-us.apache.org/repos/asf/syncope/blob/4095f1e8/fit/core-reference/src/main/resources/workflow.properties ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/main/resources/workflow.properties b/fit/core-reference/src/main/resources/workflow.properties index 9f0e35e..7167164 100644 --- a/fit/core-reference/src/main/resources/workflow.properties +++ b/fit/core-reference/src/main/resources/workflow.properties @@ -17,4 +17,4 @@ wf.directory=${conf.directory} jobExecutorActivate=false uwfAdapter=org.apache.syncope.core.workflow.java.DefaultUserWorkflowAdapter -rwfAdapter=org.apache.syncope.core.workflow.java.DefaultRoleWorkflowAdapter \ No newline at end of file +gwfAdapter=org.apache.syncope.core.workflow.java.DefaultGroupWorkflowAdapter
