Search in sources :

Example 21 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class TaskErrorsTabPanel method initLayout.

private void initLayout(final IModel<TaskDto> taskDtoModel, PageBase pageBase) {
    ObjectDataProvider<TaskErrorDto, ObjectType> provider = new ObjectDataProvider<TaskErrorDto, ObjectType>(TaskErrorsTabPanel.this, ObjectType.class) {

        private static final long serialVersionUID = 1L;

        @Override
        public TaskErrorDto createDataObjectWrapper(PrismObject<ObjectType> obj) {
            return convertToTaskErrorDto(obj.asObjectable(), taskDtoModel);
        }

        @Override
        public void setQuery(ObjectQuery query) {
            super.setQuery(query);
        }

        @Override
        public ObjectQuery getQuery() {
            return createContentQuery(taskDtoModel.getObject().getOid(), pageBase);
        }
    };
    TablePanel resultTablePanel = new TablePanel<>(ID_TASK_ERRORS, provider, initColumns());
    resultTablePanel.setStyle("padding-top: 0px;");
    resultTablePanel.setShowPaging(false);
    resultTablePanel.setOutputMarkupId(true);
    add(resultTablePanel);
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) TaskErrorDto(com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorDto) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 22 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageCertCampaigns method deleteCampaignsPerformed.

private void deleteCampaignsPerformed(AjaxRequestTarget target, List<CertCampaignListItemDto> itemsToDelete) {
    if (itemsToDelete.isEmpty()) {
        warn(getString("PageCertCampaigns.message.noCampaignsSelected"));
        target.add(getFeedbackPanel());
        return;
    }
    OperationResult result = new OperationResult(OPERATION_DELETE_CAMPAIGNS);
    for (CertCampaignListItemDto itemToDelete : itemsToDelete) {
        try {
            Task task = createSimpleTask(OPERATION_DELETE_CAMPAIGNS);
            ObjectDelta<AccessCertificationCampaignType> delta = getPrismContext().deltaFactory().object().createDeleteDelta(AccessCertificationCampaignType.class, itemToDelete.getOid());
            getModelService().executeChanges(MiscUtil.createCollection(delta), null, task, result);
        } catch (Exception ex) {
            result.recordPartialError(createStringResource("PageCertCampaigns.message.deleteCampaignsPerformed.partialError").getString(), ex);
            LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delete campaign", ex);
        }
    }
    result.recomputeStatus();
    if (result.isSuccess()) {
        result.recordStatus(OperationResultStatus.SUCCESS, createStringResource("PageCertCampaigns.message.deleteCampaignsPerformed.success").getString());
    }
    Table campaignsTable = getCampaignsTable();
    ObjectDataProvider provider = (ObjectDataProvider) campaignsTable.getDataTable().getDataProvider();
    provider.clearCache();
    WebComponentUtil.safeResultCleanup(result, LOGGER);
    showResult(result);
    target.add(getFeedbackPanel(), (Component) campaignsTable);
}
Also used : Task(com.evolveum.midpoint.task.api.Task) Table(com.evolveum.midpoint.web.component.data.Table) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) CertCampaignListItemDto(com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignListItemDto) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) AccessCertificationCampaignType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType)

Example 23 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class OrgUnitAddDeletePopup method setState.

public void setState(ActionState state, AjaxRequestTarget target) {
    this.state = state;
    AjaxButton actionButton = (AjaxButton) getContent().get(ID_BUTTON_ACTION);
    actionButton.setModel(createActionButtonStringResource());
    actionButton.add(new AttributeAppender("class", getActionButtonClass()));
    target.add(actionButton);
    TablePanel panel = getTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(getDataProviderQuery());
    target.add(panel);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) AttributeAppender(org.apache.wicket.behavior.AttributeAppender) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Aggregations

ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)23 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)13 DataTable (org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable)12 Table (com.evolveum.midpoint.web.component.data.Table)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)4 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)4 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ObjectSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectSearchDto)2 ConfigurationStorage (com.evolveum.midpoint.web.session.ConfigurationStorage)2 ReportsStorage (com.evolveum.midpoint.web.session.ReportsStorage)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)2 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)2 Form (org.apache.wicket.markup.html.form.Form)2 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 Task (com.evolveum.midpoint.task.api.Task)1 AjaxDownloadBehaviorFromFile (com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile)1