Package org.apache.syncope.common.to

Examples of org.apache.syncope.common.to.MembershipTO


        Map<Long, MembershipTO> membs = result.getMembershipMap();
        for (Long membId : userMod.getMembershipsToBeRemoved()) {
            result.removeMembership(membs.get(membId));
        }
        for (MembershipMod membMod : userMod.getMembershipsToBeAdded()) {
            MembershipTO membTO = new MembershipTO();
            membTO.setRoleId(membMod.getRole());

            apply(membTO, membMod, membTO);
        }

        return result;
View Full Code Here


                    }
                }

                Map<Long, MembershipTO> currentMembs = ((UserTO) attributableTO).getMembershipMap();
                for (MembershipTO membTO : ((UserTO) template).getMemberships()) {
                    MembershipTO membTBU;
                    if (currentMembs.containsKey(membTO.getRoleId())) {
                        membTBU = currentMembs.get(membTO.getRoleId());
                    } else {
                        membTBU = new MembershipTO();
                        membTBU.setRoleId(membTO.getRoleId());
                        ((UserTO) attributableTO).addMembership(membTBU);
                    }
                    fillFromTemplate(membTBU, membTO);
                }
            }
View Full Code Here

        notificationDAO.flush();

        // 2. create user
        UserTO userTO = UserTestITCase.getSampleTO(mailAddress);
        MembershipTO membershipTO = new MembershipTO();
        membershipTO.setRoleId(7);
        userTO.addMembership(membershipTO);

        userController.create(new MockHttpServletResponse(), userTO);

        // 3. force Quartz job execution and verify e-mail
View Full Code Here

        Notification actual = notificationDAO.save(notification);
        assertNotNull(actual);

        // 2. create user
        UserTO userTO = UserTestITCase.getSampleTO(mailAddress);
        MembershipTO membershipTO = new MembershipTO();
        membershipTO.setRoleId(7);
        userTO.addMembership(membershipTO);

        userController.create(new MockHttpServletResponse(), userTO);

        // 3. force Quartz job execution and verify e-mail
View Full Code Here

        notificationDAO.flush();

        // 2. create user
        UserTO userTO = UserTestITCase.getSampleTO(mailAddress);
        MembershipTO membershipTO = new MembershipTO();
        membershipTO.setRoleId(7);
        userTO.addMembership(membershipTO);

        userController.create(new MockHttpServletResponse(), userTO);

        // 3. force Quartz job execution and verify e-mail
View Full Code Here

        notificationDAO.flush();

        // 2. create user
        UserTO userTO = UserTestITCase.getSampleTO(mailAddress);
        MembershipTO membershipTO = new MembershipTO();
        membershipTO.setRoleId(7);
        userTO.addMembership(membershipTO);

        userController.create(new MockHttpServletResponse(), userTO);

        // 3. Set number of retries
View Full Code Here

                                    for (MembershipTO membTO : membView.getList()) {
                                        if (membTO.getRoleId() == roleTO.getId()) {
                                            return new MembershipModalPage(pageRef, membWin, membTO, templateMode);
                                        }
                                    }
                                    MembershipTO membTO = new MembershipTO();
                                    membTO.setRoleId(roleTO.getId());
                                    membTO.setRoleName(roleTO.getName());

                                    return new MembershipModalPage(pageRef, membWin, membTO, templateMode);
                                }
                            });
                            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, templateMode);

                            }
                        });
                        membWin.show(target);
                    }
                };
                item.add(editLink);

                AjaxLink deleteLink = new IndicatingDeleteOnConfirmAjaxLink("deleteLink", pageRef) {

                    private static final long serialVersionUID = -7978723352517770644L;

                    @Override
                    protected void onClickInternal(final AjaxRequestTarget target) {
                        userTO.removeMembership(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()) {
View Full Code Here

    @Test
    public void issueSYNCOPE16() {
        UserTO userTO = UserTestITCase.getUniqueSampleTO("issue16@apache.org");

        MembershipTO membershipTO = new MembershipTO();
        membershipTO.setRoleId(8L);
        userTO.addMembership(membershipTO);

        // 1. create user
        UserTO actual = createUser(userTO);
        assertNotNull(actual);
View Full Code Here

        userTO.getResources().add(resourceName);
        userTO.getVirtualAttributes().clear();
        userTO.getDerivedAttributes().clear();
        userTO.getMemberships().clear();

        final MembershipTO membership = new MembershipTO();
        membership.setRoleId(roleTO.getId());
        membership.getVirtualAttributes().add(attributeTO("mvirtualdata", "mvirtualvalue"));
        userTO.getMemberships().add(membership);

        userTO = createUser(userTO);
        assertEquals(2, userTO.getPropagationStatusTOs().size());
        assertTrue(userTO.getPropagationStatusTOs().get(0).getStatus().isSuccessful());
View Full Code Here

                    }
                }

                Map<Long, MembershipTO> currentMembs = ((UserTO) attributableTO).getMembershipMap();
                for (MembershipTO membTO : ((UserTO) template).getMemberships()) {
                    MembershipTO membTBU;
                    if (currentMembs.containsKey(membTO.getRoleId())) {
                        membTBU = currentMembs.get(membTO.getRoleId());
                    } else {
                        membTBU = new MembershipTO();
                        membTBU.setRoleId(membTO.getRoleId());
                        ((UserTO) attributableTO).addMembership(membTBU);
                    }
                    fillFromTemplate(membTBU, membTO);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.to.MembershipTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.