private void saveTaxonomy() { UriBuilders.SYSTEM_CONF_TAXONOMY.create().build(taxonomy.getName()); fireEvent(new TaxonomyUpdatedEvent(taxonomy.getName())); ResourceRequestBuilderFactory.<TaxonomyDto>newBuilder() .forResource(UriBuilders.SYSTEM_CONF_TAXONOMY.create().build(taxonomy.getName())) // .withResourceBody(TaxonomyDto.stringify(taxonomy)) // .withCallback( new ResponseCodeCallback() { @Override public void onResponseCode(Request request, Response response) { getEventBus().fireEvent(new TaxonomyUpdatedEvent(taxonomy.getName())); getView().setDirty(false); } }, Response.SC_OK, Response.SC_CREATED) // .withCallback( new ResponseCodeCallback() { @Override public void onResponseCode(Request request, Response response) { if (response.getText() != null && !response.getText().isEmpty()) { fireEvent(NotificationEvent.newBuilder().error(response.getText()).build()); } } }, Response.SC_BAD_REQUEST, Response.SC_INTERNAL_SERVER_ERROR) // .put() .send(); }
private void refreshTaxonomy(String name) { ResourceRequestBuilderFactory.<TaxonomyDto>newBuilder() // .forResource(UriBuilders.SYSTEM_CONF_TAXONOMY.create().build(name)) // .withCallback(new TaxonomyFoundCallBack()) // .withCallback(SC_NOT_FOUND, new TaxonomyNotFoundCallBack(name)) // .get() .send(); }
@Override public void onDownload() { String downloadUrl = UriBuilders.SYSTEM_CONF_TAXONOMY.create().build(taxonomy.getName()) + "/_download"; fireEvent(new FileDownloadRequestEvent(downloadUrl)); }