當前位置: 首頁>>代碼示例>>Java>>正文


Java DSCallback類代碼示例

本文整理匯總了Java中com.smartgwt.client.data.DSCallback的典型用法代碼示例。如果您正苦於以下問題:Java DSCallback類的具體用法?Java DSCallback怎麽用?Java DSCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DSCallback類屬於com.smartgwt.client.data包,在下文中一共展示了DSCallback類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: jobSubmitted

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
@Override
public void jobSubmitted(Job j) {
    JobRecord jr = new JobRecord(j);
    DSRequest customErrorHandling = new DSRequest();
    customErrorHandling.setWillHandleError(true);
    this.ds.addData(jr, new DSCallback() {
        @Override
        public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
            if (dsResponse.getStatus() < 0) {
                // it could fail because results from the server with the new job are already displayed
                // failed silently since the new job is already displayed or will be anyway with next call
                SC.logWarn(dsResponse.getDataAsString());
            }
        }
    }, customErrorHandling);
    applyCurrentLocalFilter();
}
 
開發者ID:ow2-proactive,項目名稱:scheduling-portal,代碼行數:18,代碼來源:JobsListGrid.java

示例2: onCreateNewTask

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
public void onCreateNewTask(final WorkflowJobFormView jobFormView, Record taskDef) {
        DSRequest req = new DSRequest();
        req.setWillHandleError(true);
        jobFormView.getTasks().addData(taskDef, new DSCallback() {

            @Override
            public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                boolean statusOk = RestConfig.isStatusOk(dsResponse);
                if (statusOk) {
                    StatusView.getInstance().show(i18n.SaveAction_Done_Msg());
                    // reload tasks to get the proper order of tasks
                    jobFormView.refresh();
//                } else if (RestConfig.isConcurrentModification(dsResponse)) {
                } else {
                    ErrorHandler.warn(dsResponse, dsRequest);
                }
            }
        }, req);
    }
 
開發者ID:proarc,項目名稱:proarc,代碼行數:20,代碼來源:WorkflowJobsEditor.java

示例3: saveImpl

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void saveImpl(final BooleanCallback callback) {
    Record update = new Record(valuesManager.getValues());
    update = ClientUtils.normalizeData(update);
    updatingDevice = true;
    DeviceDataSource.getInstance().updateData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            updatingDevice = false;
            boolean status = RestConfig.isStatusOk(response);
            if (status) {
                StatusView.getInstance().show(i18n.SaveAction_Done_Msg());
                Record[] data = response.getData();
                if (data != null && data.length == 1) {
                    Record deviceRecord = data[0];
                    setDescription(deviceRecord);
                }
            }
            callback.execute(status);
        }
    });
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:23,代碼來源:DeviceManager.java

示例4: loadBatch

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void loadBatch(final String batchId, final Runnable callback) {
    Criteria criteria = new Criteria(ImportBatchDataSource.FIELD_ID, batchId);
    ImportBatchDataSource.getInstance().fetchData(criteria, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            BatchRecord batchRecord = null;
            if (RestConfig.isStatusOk(response)) {
                Record[] records = response.getData();
                if (records.length > 0) {
                    batchRecord = new BatchRecord(records[0]);
                } else {
                    SC.warn("Batch not found! " + batchId);
                }
            }
            getImportContext().setBatch(batchRecord);
            callback.run();
        }
    });
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:21,代碼來源:ImportPresenter.java

示例5: ingest

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void ingest(String batchId, String parentId, final BooleanCallback call) {
    ImportBatchDataSource dsBatch = ImportBatchDataSource.getInstance();
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.ImportWizard_UpdateItemsStep_Ingesting_Title());
    Record update = new Record();
    update.setAttribute(ImportBatchDataSource.FIELD_ID, batchId);
    update.setAttribute(ImportBatchDataSource.FIELD_PARENT, parentId);
    update.setAttribute(ImportBatchDataSource.FIELD_STATE, ImportBatchDataSource.State.INGESTING.name());
    dsBatch.updateData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] records = response.getData();
                if (records != null && records.length > 0) {
                    importContext.setBatch(new BatchRecord(records[0]));
                    call.execute(true);
                    return;
                }
            }
            call.execute(false);
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:ImportPresenter.java

示例6: addChild

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
public void addChild(String parentPid, String[] pid, final BooleanCallback call) {
    if (pid == null || pid.length < 1) {
        throw new IllegalArgumentException("Missing PID!");
    }
    if (parentPid == null || parentPid.isEmpty()) {
        throw new IllegalArgumentException("Missing parent PID!");
    }

    DSRequest dsRequest = new DSRequest();

    Record update = new Record();
    update.setAttribute(RelationDataSource.FIELD_PARENT, parentPid);
    update.setAttribute(RelationDataSource.FIELD_PID, pid);
    addData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (!RestConfig.isStatusOk(response)) {
                call.execute(false);
                return;
            }
            call.execute(true);
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:RelationDataSource.java

示例7: removeChild

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
public void removeChild(String parentPid, String[] pid, final BooleanCallback call) {
    if (pid == null || pid.length < 1) {
        throw new IllegalArgumentException("Missing PID!");
    }
    if (parentPid == null || parentPid.isEmpty()) {
        throw new IllegalArgumentException("Missing parent PID!");
    }

    Record update = new Record();
    update.setAttribute(RelationDataSource.FIELD_PARENT, parentPid);
    update.setAttribute(RelationDataSource.FIELD_PID, pid);
    DSRequest dsRequest = new DSRequest();
    dsRequest.setData(update); // prevents removeData to drop other than primary key attributes
    removeData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (!RestConfig.isStatusOk(response)) {
                call.execute(false);
                return;
            }
            call.execute(true);
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:RelationDataSource.java

示例8: delete

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
public void delete(String[] pids, Map<?,?> options) {
    final ClientMessages i18n = GWT.create(ClientMessages.class);
    HashMap<String, String> deleteParams = new HashMap<String, String>();
    deleteParams.put(DigitalObjectResourceApi.DELETE_PURGE_PARAM,
            option(options.get(DigitalObjectResourceApi.DELETE_PURGE_PARAM), Boolean.FALSE.toString()));
    deleteParams.put(DigitalObjectResourceApi.DELETE_HIERARCHY_PARAM,
            option(options.get(DigitalObjectResourceApi.DELETE_HIERARCHY_PARAM), Boolean.TRUE.toString()));
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.DeleteAction_Deleting_Msg());
    dsRequest.setParams(deleteParams);
    Record query = new Record();
    query.setAttribute(FIELD_PID, pids);
    DigitalObjectDataSource.getInstance().removeData(query, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                StatusView.getInstance().show(i18n.DeleteAction_Done_Msg());
                DigitalObjectDataSource.this.updateCaches(response, request);
                SearchDataSource.getInstance().updateCaches(response, request);
                RelationDataSource.getInstance().updateCaches(response, request);
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:27,代碼來源:DigitalObjectDataSource.java

示例9: exportOrValidate

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getCrossref();
    ds.addData(export, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] data = response.getData();
                RecordList erl = errorsFromExportResult(data);
                if (erl.isEmpty()) {
                    String target = "";
                    if (data != null && data.length > 0) {
                        target = data[0].getAttribute(ExportResourceApi.RESULT_TARGET);
                    }
                    SC.say(i18n.ExportResultWidget_Window_Title(), i18n.CrossrefExportAction_ExportDone_Msg(target));
                } else {
                    ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:CrossrefExportAction.java

示例10: download

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void download(final String[] pids) {
    Record export = new Record();
    export.setAttribute(ExportResourceApi.DESA_PID_PARAM, pids[0]);
    export.setAttribute(ExportResourceApi.DESA_FORDOWNLOAD_PARAM, true);
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getDesa();
    ds.addData(export, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] data = response.getData();
                Record[] errors = data[0].getAttributeAsRecordArray(ExportResourceApi.RESULT_ERRORS);
                if (errors != null && errors.length > 0) {
                    ExportResultWidget.showErrors(errors);
                } else {
                    String token = data[0].getAttribute(ExportResourceApi.RESULT_TOKEN);
                    openResult(pids[0], token);
                }
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:DesaExportAction.java

示例11: exportOrValidate

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getDesa();
    ds.addData(export, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] data = response.getData();
                RecordList erl = errorsFromExportResult(data);
                if (erl.isEmpty()) {
                    String dryRun = export.getAttribute(ExportResourceApi.DESA_DRYRUN_PARAM);
                    SC.say(dryRun == null
                            ? i18n.DesaExportAction_ExportDone_Msg()
                            : i18n.DesaExportAction_ValidationDone_Msg());
                } else {
                    ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:25,代碼來源:DesaExportAction.java

示例12: exportOrValidate

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getCejsh();
    ds.addData(export, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] data = response.getData();
                RecordList erl = errorsFromExportResult(data);
                if (erl.isEmpty()) {
                    String target = "";
                    if (data != null && data.length > 0) {
                        target = data[0].getAttribute(ExportResourceApi.RESULT_TARGET);
                    }
                    SC.say(i18n.ExportResultWidget_Window_Title(), i18n.CejshExportAction_ExportDone_Msg(target));
                } else {
                    ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:CejshExportAction.java

示例13: exportOrValidate

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getArchive();
    ds.addData(export, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] data = response.getData();
                RecordList erl = errorsFromExportResult(data);
                if (erl.isEmpty()) {
                    String target = "";
                    if (data != null && data.length > 0) {
                        target = data[0].getAttribute(ExportResourceApi.RESULT_TARGET);
                    }
                    SC.say(i18n.ExportResultWidget_Window_Title(), i18n.ArchiveExportAction_ExportDone_Msg(target));
                } else {
                    ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:26,代碼來源:ArchiveExportAction.java

示例14: deleteItem

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void deleteItem() {
    Record item = (Record) items[itemIndex];
    // TileGrid.removeSelectedData uses queuing support in case of multi-selection.
    // It will require extra support on server. For now remove data in separate requests.
    //thumbGrid.removeSelectedData();
    ds.removeData(item, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                itemIndex++;
                if (itemIndex < items.length) {
                    deleteItem();
                } else {
                    StatusView.getInstance().show(i18n.DeleteAction_Done_Msg());
                }
            }
        }
    });
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:21,代碼來源:DeleteAction.java

示例15: exportOrValidate

import com.smartgwt.client.data.DSCallback; //導入依賴的package包/類
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getNdk();
    ds.addData(export, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] data = response.getData();
                RecordList erl = errorsFromExportResult(data);
                if (erl.isEmpty()) {
                    String dryRun = export.getAttribute(ExportResourceApi.DESA_DRYRUN_PARAM);
                    SC.say(dryRun == null
                            ? i18n.NdkExportAction_ExportDone_Msg()
                            : i18n.DesaExportAction_ValidationDone_Msg());
                } else {
                    ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
開發者ID:proarc,項目名稱:proarc,代碼行數:25,代碼來源:NdkExportAction.java


注:本文中的com.smartgwt.client.data.DSCallback類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。