Search in sources :

Example 1 with SchedTasks

use of org.apache.syncope.client.console.tasks.SchedTasks in project syncope by apache.

the class TopologyTogglePanel method getSyncopeFragment.

private Fragment getSyncopeFragment(final PageReference pageRef) {
    Fragment fragment = new Fragment("actions", "syncopeActions", this);
    AjaxLink<String> reload = new IndicatingOnConfirmAjaxLink<String>("reload", "connectors.confirm.reload", true) {

        private static final long serialVersionUID = -2075933173666007020L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            try {
                connectorRestClient.reload();
                SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
            } catch (Exception e) {
                LOG.error("While reloading all connectors", e);
                SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
            }
            ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
        }
    };
    fragment.add(reload);
    MetaDataRoleAuthorizationStrategy.authorize(reload, RENDER, StandardEntitlement.CONNECTOR_RELOAD);
    AjaxLink<String> tasks = new IndicatingAjaxLink<String>("tasks") {

        private static final long serialVersionUID = 3776750333491622263L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            target.add(schedTaskModal.setContent(new SchedTasks(schedTaskModal, pageRef)));
            schedTaskModal.header(new ResourceModel("task.custom.list"));
            schedTaskModal.show(true);
        }

        @Override
        public String getAjaxIndicatorMarkupId() {
            return Constants.VEIL_INDICATOR_MARKUP_ID;
        }
    };
    fragment.add(tasks);
    MetaDataRoleAuthorizationStrategy.authorize(tasks, RENDER, StandardEntitlement.TASK_LIST);
    return fragment;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IndicatingAjaxLink(org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink) IndicatingOnConfirmAjaxLink(org.apache.syncope.client.console.wicket.markup.html.form.IndicatingOnConfirmAjaxLink) StringResourceModel(org.apache.wicket.model.StringResourceModel) ResourceModel(org.apache.wicket.model.ResourceModel) Fragment(org.apache.wicket.markup.html.panel.Fragment) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) SchedTasks(org.apache.syncope.client.console.tasks.SchedTasks)

Aggregations

SchedTasks (org.apache.syncope.client.console.tasks.SchedTasks)1 IndicatingOnConfirmAjaxLink (org.apache.syncope.client.console.wicket.markup.html.form.IndicatingOnConfirmAjaxLink)1 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 IndicatingAjaxLink (org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink)1 Fragment (org.apache.wicket.markup.html.panel.Fragment)1 ResourceModel (org.apache.wicket.model.ResourceModel)1 StringResourceModel (org.apache.wicket.model.StringResourceModel)1