Search in sources :

Example 1 with OrgTreeStateStorage

use of com.evolveum.midpoint.web.session.OrgTreeStateStorage in project midpoint by Evolveum.

the class TreeTablePanel method deleteNodeConfirmedPerformed.

private void deleteNodeConfirmedPerformed(SelectableBeanImpl<OrgType> orgToDelete, AjaxRequestTarget target) {
    OperationResult result = new OperationResult(OPERATION_DELETE_OBJECT);
    PageBase page = getPageBase();
    if (orgToDelete == null) {
        orgToDelete = getTreePanel().getRootFromProvider();
    }
    if (orgToDelete.getValue() == null) {
        return;
    }
    if (CollectionUtils.isEmpty(orgToDelete.getValue().getParentOrgRef())) {
        OrgTreeStateStorage storage = getTreePanel().getOrgTreeStateStorage();
        if (storage != null) {
            storage.setSelectedTabId(-1);
        }
        getTreePanel().setSelectedItem(null, storage);
    }
    String oidToDelete = orgToDelete.getValue().getOid();
    WebModelServiceUtils.deleteObject(OrgType.class, oidToDelete, result, page);
    result.computeStatusIfUnknown();
    page.showResult(result);
    target.add(getPageBase().getFeedbackPanel());
    // TODO is this ok? [pmed]
    throw new RestartResponseException(getPage().getClass());
}
Also used : RestartResponseException(org.apache.wicket.RestartResponseException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) OrgTreeStateStorage(com.evolveum.midpoint.web.session.OrgTreeStateStorage) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Aggregations

PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 OrgTreeStateStorage (com.evolveum.midpoint.web.session.OrgTreeStateStorage)1 RestartResponseException (org.apache.wicket.RestartResponseException)1