Package org.apache.syncope.common.to

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


        userRequestTO.setUserMod(userMod);
        getService(UserRequestService.class).create(userRequestTO);
    }

    public void requestDelete(final Long userId) {
        UserRequestTO userRequestTO = new UserRequestTO();
        userRequestTO.setType(UserRequestType.DELETE);
        userRequestTO.setUserId(userId);
        getService(UserRequestService.class).create(userRequestTO);
    }
View Full Code Here


            @Override
            public void populateItem(final Item<ICellPopulator<UserRequestTO>> cellItem, final String componentId,
                    final IModel<UserRequestTO> model) {

                final UserRequestTO request = 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) {
                        editUserRequestWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new UserRequestModalPage(Todo.this.getPageReference(), editUserRequestWin,
                                        model.getObject(), UserModalPage.Mode.ADMIN);
                            }
                        });

                        editUserRequestWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "UserRequest",
                        model.getObject().getType() != UserRequestType.DELETE);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            userRestClient.delete(model.getObject().getUserId());
                            userRequestRestClient.delete(model.getObject().getId());
                        } catch (SyncopeClientCompositeErrorException e) {
                            LOG.error("While deleting an user", e);
                            error(e.getMessage());
                            return;
                        }

                        info(getString(Constants.OPERATION_SUCCEEDED));
                        target.add(feedbackPanel);

                        target.add(userRequestContainer);
                    }
                }, ActionLink.ActionType.DELETE, "Users",
                        model.getObject().getType() == UserRequestType.DELETE);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            userRequestRestClient.delete(request.getId());
                        } catch (SyncopeClientCompositeErrorException e) {
                            LOG.error("While deleting an user request", e);
                            error(e.getMessage());
                            return;
                        }
View Full Code Here

        UserRequest request = userRequestDAO.find(requestId);
        if (request == null) {
            throw new NotFoundException("User request " + requestId);
        }

        UserRequestTO requestToDelete = binder.getUserRequestTO(request);
        userRequestDAO.delete(requestId);
        return requestToDelete;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    protected UserRequestTO resolveReference(final Method method, final Object... obj) {
        final UserRequestTO result;

        if (ArrayUtils.isNotEmpty(obj) && obj[0] instanceof Long
                && ("deleteRequest".equals(method.getName()) || "read".equals(method.getName()))) {

            UserRequest request = userRequestDAO.find((Long) obj[0]);
View Full Code Here

TOP

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

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.