use of org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback in project kie-wb-common by kiegroup.
the class ProjectPage method fetchRepository.
private void fetchRepository(final ExampleRepository selectedRepository) {
examplesService.call(new RemoteCallback<Set<ExampleProject>>() {
@Override
public void callback(final Set<ExampleProject> projects) {
activeView = projectsView;
model.getProjects().clear();
model.setSourceRepository(selectedRepository);
final List<ExampleProject> sortedProjects = sort(projects);
projectsView.setProjectsInRepository(sortedProjects);
exampleProjects = sortedProjects;
pageSelectedEvent.fire(new WizardPageSelectedEvent(ProjectPage.this));
}
}, new DefaultErrorCallback() {
@Override
public boolean error(final Message message, final Throwable throwable) {
model.setSourceRepository(null);
model.getSelectedRepository().setUrlValid(false);
return super.error(message, throwable);
}
}).getProjects(selectedRepository);
}
use of org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback in project kie-wb-common by kiegroup.
the class PopulatedAssetsScreen method resolveAssetsCount.
private void resolveAssetsCount() {
if (!isProjectNull()) {
ProjectAssetsQuery query = this.createProjectQuery(filter, filterType, 0, 0);
assetQueryService.getNumberOfAssets(query).call((Integer numberOfAssets) -> {
int offset = getOffset();
this.view.setPageIndicator(offset + 1, this.getAssetsCount(numberOfAssets, offset + this.pageSize), this.getAssetsCount(numberOfAssets, 0));
this.setTotalPages(numberOfAssets, this.pageSize);
this.view.setTotalPages(this.getTotalPages());
this.checkPaginationButtons();
}, new DefaultErrorCallback());
}
}
use of org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback in project kie-wb-common by kiegroup.
the class ImportRepositoryPopUpPresenter method importRepository.
public void importRepository() {
final String repositoryUrl = view.getRepositoryURL();
if (isEmpty(repositoryUrl)) {
view.showError(view.getEmptyRepositoryURLValidationMessage());
return;
}
OrganizationalUnit ou = context.getActiveOrganizationalUnit().orElseThrow(() -> new IllegalStateException("Cannot import project without an active organizational unit."));
view.showBusyIndicator(view.getLoadingMessage());
libraryService.call((WorkspaceProject project) -> {
view.hideBusyIndicator();
view.hide();
libraryPlaces.goToProject(project);
}, new DefaultErrorCallback() {
@Override
public boolean error(Message message, Throwable throwable) {
view.hideBusyIndicator();
view.showError(view.getNoProjectsToImportMessage());
return false;
}
}).importProject(ou, repositoryUrl, view.getUserName(), view.getPassword());
}
use of org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback in project kie-wb-common by kiegroup.
the class PopulatedAssetsScreen method getAssets.
private void getAssets(String filter, String filterType, int startIndex, int amount, RemoteCallback<AssetQueryResult> callback) {
if (!isProjectNull()) {
ProjectAssetsQuery query = this.createProjectQuery(filter, filterType, startIndex, amount);
assetQueryService.getAssets(query).call(callback, new DefaultErrorCallback());
}
}
use of org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback in project kie-wb-common by kiegroup.
the class SettingsPresenter method defaultErrorResolution.
Promise<Void> defaultErrorResolution(final Throwable e) {
new DefaultErrorCallback().error(null, e);
view.hideBusyIndicator();
return promises.resolve();
}
Aggregations