use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class ResourceContentPanel method deleteResourceObjectPerformed.
// TODO: as a task?
protected void deleteResourceObjectPerformed(ShadowType selected, AjaxRequestTarget target) {
final List<ShadowType> selectedShadow = getSelectedShadowsList(selected);
final OperationResult result = new OperationResult(OPERATION_DELETE_OBJECT);
if (selectedShadow == null || selectedShadow.isEmpty()) {
result.recordWarning(createStringResource("ResourceContentPanel.message.deleteResourceObjectPerformed.warning").getString());
getPageBase().showResult(result);
target.add(getPageBase().getFeedbackPanel());
return;
}
ConfirmationPanel dialog = new DeleteConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString(selected, "pageContentAccounts.message.deleteConfirmationSingle", "pageContentAccounts.message.deleteConfirmation")) {
@Override
public void yesPerformed(AjaxRequestTarget target) {
deleteAccountConfirmedPerformed(target, result, selectedShadow);
}
};
((PageBase) getPage()).showMainPopup(dialog, target);
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class AbstractRoleMemberPanel method recomputeMembersPerformed.
protected void recomputeMembersPerformed(AjaxRequestTarget target) {
StringResourceModel confirmModel;
if (getSearchBoxConfiguration().isSearchScope(SearchBoxScopeType.SUBTREE)) {
confirmModel = createStringResource("abstractRoleMemberPanel.recomputeAllSubtreeMembersConfirmationLabel");
} else {
confirmModel = getMemberTable().getSelectedObjectsCount() > 0 ? createStringResource("abstractRoleMemberPanel.recomputeSelectedMembersConfirmationLabel") : createStringResource("abstractRoleMemberPanel.recomputeAllMembersConfirmationLabel");
}
ConfigureTaskConfirmationPanel dialog = new ConfigureTaskConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), confirmModel) {
private static final long serialVersionUID = 1L;
@Override
protected PrismObject<TaskType> getTask(AjaxRequestTarget target) {
Task task = MemberOperationsHelperOld.createRecomputeMembersTask(getModelObject(), getPageBase(), getQueryScope(), getActionQuery(getQueryScope(), getRelationsForRecomputeTask()), target);
if (task == null) {
return null;
}
PrismObject<TaskType> recomputeTask = task.getRawTaskObjectClone();
TaskType recomputeTaskType = recomputeTask.asObjectable();
recomputeTaskType.getAssignment().add(ObjectTypeUtil.createAssignmentTo(SystemObjectsType.ARCHETYPE_RECOMPUTATION_TASK.value(), ObjectTypes.ARCHETYPE, getPrismContext()));
return recomputeTask;
}
@Override
public StringResourceModel getTitle() {
return createStringResource("pageUsers.message.confirmActionPopupTitle");
}
@Override
public void yesPerformed(AjaxRequestTarget target) {
MemberOperationsHelperOld.recomputeMembersPerformed(getModelObject(), getPageBase(), getQueryScope(), getActionQuery(getQueryScope(), getRelationsForRecomputeTask()), target);
}
};
((PageBase) getPage()).showMainPopup(dialog, target);
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class PageConnectorHosts method discoveryRemotePerformed.
private void discoveryRemotePerformed(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
PageBase page = (PageBase) getPage();
Task task = page.createSimpleTask(OPERATION_CONNECTOR_DISCOVERY);
OperationResult result = task.getResult();
List<ConnectorHostType> selected = getObjectListPanel().getSelectedRealObjects();
if (selected.isEmpty()) {
warn(getString("pageResources.message.noHostSelected"));
return;
}
for (ConnectorHostType host : selected) {
try {
getModelService().discoverConnectors(host, task, result);
} catch (Exception ex) {
result.recordFatalError(createStringResource("PageConnectorHosts.message.discoveryRemotePerformed.fatalError", host.getHostname(), host.getPort()).getString(), ex);
}
}
result.recomputeStatus();
showResult(result);
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class ResourceDetailsTabPanel method taskDetailsPerformed.
private void taskDetailsPerformed(AjaxRequestTarget target, String taskOid) {
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, taskOid);
((PageBase) getPage()).navigateToNext(PageTask.class, parameters);
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class ProgressPanel method addRefreshingProgressPanel.
// mess
public void addRefreshingProgressPanel() {
if (refreshingBehavior != null) {
return;
}
ProgressReporter reporter = reporterModel.getProcessData();
int refreshInterval = reporter.getRefreshInterval();
refreshingBehavior = new AjaxSelfUpdatingTimerBehavior(java.time.Duration.ofMillis(refreshInterval)) {
@Override
protected void onPostProcessTarget(AjaxRequestTarget target) {
invalidateCache();
ProgressReporter reporter = reporterModel.getProcessData();
OperationResult asyncOperationResult = reporter.getAsyncOperationResult();
if (asyncOperationResult != null) {
// by checking this we know that async operation has been finished
// because we set it to in-progress
asyncOperationResult.recomputeStatus();
PageBase page = getPageBase();
if (reporter.isAbortRequested()) {
page.showResult(asyncOperationResult);
target.add(page.getFeedbackPanel());
return;
}
progressAwarePage.finishProcessing(target, true, asyncOperationResult);
stopRefreshingProgressPanel(target);
reporter.setAsyncOperationResult(null);
}
}
@Override
public boolean isEnabled(Component component) {
return component != null;
}
};
add(refreshingBehavior);
}
Aggregations