Examples of ActionLinksPanel


Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

                "selectedObjects",
                new ArrayList<IColumn<T, S>>(columns.subList(1, columns.size() - 1)),
                dataProvider,
                Integer.MAX_VALUE).setVisible(items != null && !items.isEmpty()));

        final ActionLinksPanel actionPanel = new ActionLinksPanel("actions", new Model(), getPageReference());
        add(actionPanel);

        for (ActionLink.ActionType action : actions) {
            final BulkAction bulkAction = new BulkAction();
            for (Object item : items) {
                try {
                    bulkAction.addTarget(getTargetId(item, idFieldName).toString());
                } catch (Exception e) {
                    LOG.error("Error retrieving item id {}", idFieldName, e);
                }
            }

            switch (action) {
                case DELETE:
                    bulkAction.setOperation(BulkAction.Type.DELETE);
                    break;
                case SUSPEND:
                    bulkAction.setOperation(BulkAction.Type.SUSPEND);
                    break;
                case REACTIVATE:
                    bulkAction.setOperation(BulkAction.Type.REACTIVATE);
                    break;
                case EXECUTE:
                    bulkAction.setOperation(BulkAction.Type.EXECUTE);
                    break;
                case DRYRUN:
                    bulkAction.setOperation(BulkAction.Type.DRYRUN);
                    break;
                default:
                    LOG.error("Bulk action type not supported");
            }

            actionPanel.add(new ActionLink() {

                @Override
                public void onClick(final AjaxRequestTarget target) {
                    try {
                        final BulkActionRes res = (BulkActionRes) bulkActionExecutor.getClass().
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

            @Override
            public void populateItem(final Item<ICellPopulator<ResourceTO>> cellItem, final String componentId,
                    final IModel<ResourceTO> model) {
                final ResourceTO resourceTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {

                        editResourceWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                ResourceModalPage form = new ResourceModalPage(Resources.this.getPageReference(),
                                        editResourceWin, resourceTO, false);
                                return form;
                            }
                        });

                        editResourceWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Resources");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

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

                final ConnInstanceTO connectorTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        editConnectorWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new ConnectorModalPage(Resources.this.getPageReference(), editConnectorWin,
                                        connectorTO);
                            }
                        });

                        editConnectorWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Connectors");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

            @Override
            public ActionLinksPanel getActions(final String componentId, final IModel<TaskTO> model) {

                final TaskTO taskTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {

                        window.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new PropagationTaskModalPage(taskTO);
                            }
                        });

                        window.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Tasks");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            restClient.startExecution(taskTO.getId(), false);
                            getSession().info(getString("operation_succeeded"));
                        } catch (SyncopeClientCompositeErrorException scce) {
                            error(scce.getMessage());
                        }

                        target.add(getPage().get("feedback"));
                        target.add(container);
                    }
                }, ActionLink.ActionType.EXECUTE, "Tasks");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            restClient.delete(taskTO.getId(), PropagationTaskTO.class);
                            info(getString("operation_succeeded"));
                        } catch (SyncopeClientCompositeErrorException scce) {
                            error(scce.getMessage());
                        }
                        target.add(container);
                        target.add(getPage().get("feedback"));
                    }
                }, ActionLink.ActionType.DELETE, "Tasks");

                return panel;
            }

            @Override
            public Component getHeader(String componentId) {
                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -7978723352517770644L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

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

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, page.getPageReference());

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        statusmodal.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new StatusModalPage(page.getPageReference(), statusmodal, model.getObject());
                            }
                        });

                        statusmodal.show(target);
                    }
                }, ActionLink.ActionType.SEARCH, PAGEID);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        editmodal.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new RoleModalPage(
                                        page.getPageReference(), editmodal, (RoleTO) model.getObject());
                            }
                        });

                        editmodal.show(target);
                    }
                }, ActionLink.ActionType.EDIT, PAGEID);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

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

                final WorkflowFormTO formTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            approvalRestClient.claimForm(formTO.getTaskId());
                            info(getString("operation_succeeded"));
                        } catch (SyncopeClientCompositeErrorException scee) {
                            error(getString("error") + ":" + scee.getMessage());
                        }
                        target.add(feedbackPanel);
                        target.add(approvalContainer);
                    }
                }, ActionLink.ActionType.CLAIM, "Approval");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

            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("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) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

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

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, rowModel, pageRef);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

            @Override
            public ActionLinksPanel getActions(final String componentId, final IModel<TaskExecTO> model) {

                final TaskExecTO taskExecutionTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        taskExecMessageWin.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new ExecMessageModalPage(model.getObject().getMessage());
                            }
                        });
                        taskExecMessageWin.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Tasks", StringUtils.hasText(model.getObject().getMessage()));

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            taskRestClient.deleteExecution(taskExecutionTO.getId());

                            taskTO.removeExecution(taskExecutionTO);

                            info(getString("operation_succeeded"));
                        } catch (SyncopeClientCompositeErrorException scce) {
                            error(scce.getMessage());
                        }

                        target.add(feedbackPanel);
                        target.add(executions);
                    }
                }, ActionLink.ActionType.DELETE, "Tasks");

                return panel;
            }

            @Override
            public Component getHeader(final String componentId) {
                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), getPageReference());

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -7978723352517770644L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel

            @Override
            public ActionLinksPanel getActions(final String componentId, final IModel<TaskTO> model) {

                final TaskTO taskTO = model.getObject();

                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {

                        window.setPageCreator(new ModalWindow.PageCreator() {

                            private static final long serialVersionUID = -7834632442532690940L;

                            @Override
                            public Page createPage() {
                                return new NotificationTaskModalPage(taskTO);
                            }
                        });

                        window.show(target);
                    }
                }, ActionLink.ActionType.EDIT, "Tasks");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            restClient.startExecution(taskTO.getId(), false);
                            getSession().info(getString("operation_succeeded"));
                        } catch (SyncopeClientCompositeErrorException scce) {
                            error(scce.getMessage());
                        }

                        target.add(getPage().get("feedback"));
                        target.add(container);
                    }
                }, ActionLink.ActionType.EXECUTE, "Tasks");

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -3722207913631435501L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
                        try {
                            restClient.delete(taskTO.getId(), NotificationTaskTO.class);
                            info(getString("operation_succeeded"));
                        } catch (SyncopeClientCompositeErrorException scce) {
                            error(scce.getMessage());
                        }
                        target.add(container);
                        target.add(getPage().get("feedback"));
                    }
                }, ActionLink.ActionType.DELETE, "Tasks");

                return panel;
            }

            @Override
            public Component getHeader(String componentId) {
                final ActionLinksPanel panel = new ActionLinksPanel(componentId, new Model(), pageRef);

                panel.add(new ActionLink() {

                    private static final long serialVersionUID = -7978723352517770644L;

                    @Override
                    public void onClick(final AjaxRequestTarget target) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.