com.smartgwt.client.data.DataSource Java Examples

The following examples show how to use com.smartgwt.client.data.DataSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static MultiComboBoxItem newMultiComboBoxItem(String name, String title, DataSource options,
		Object[] values) {
	MultiComboBoxItem item = new MultiComboBoxItem(name, I18N.message(title));
	item.setLayoutStyle(MultiComboBoxLayoutStyle.FLOW);
	item.setWidth(200);
	item.setMultiple(true);
	if (options != null) {
		item.setOptionDataSource(options);
		item.setAutoFetchData(true);
	}

	IButton closeButton = new IButton();
	closeButton.setIcon("[SKIN]/headerIcons/close.gif");
	closeButton.setIconOrientation("body");
	item.setButtonProperties(closeButton);

	if (values != null) {
		item.setValue(values);
	}

	return item;
}
 
Example #2
Source File: CrossrefExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    //dsRequest.setPromptStyle(PromptStyle.DIALOG);
    //dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getCrossref();
    dsAddData(ds, 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 {
                    DesaExportAction.ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
Example #3
Source File: ImportBatchItemEditor.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void updateWidgetsOnSave(Object src) {
    if (src == batchItemGrid) {
        reset();
        DataSource ds = batchItemGrid.getDataSource();
        Record[] records = batchItemGrid.getOriginalResultSet().toArray();
        Record[] copyRecords = ds.copyRecords(records);
        thumbViewer.setData(copyRecords);
        loadItemInChildEditor(getSelection());
        actionSource.fireEvent();
    } else if (src == thumbViewer) {
        reset();
        syncListWithTilesOnReorder();
        actionSource.fireEvent();
    } else {
        refreshData();
    }
}
 
Example #4
Source File: FormGenerator.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void setOptionDataSource(FormItem item, Field f, String lang) {
    Field optionField = f.getOptionDataSource();
    DataSource ds = ValueMapDataSource.getInstance().getOptionDataSource(optionField.getName());
    item.setValueField(f.getOptionValueField()[0]);
    item.setOptionDataSource(ds);

    setPickListValueMapping(item, f);

    Integer pickListWidth = getWidthAsInteger(optionField.getWidth());
    if (item instanceof SelectItem) {
        SelectItem selectItem = (SelectItem) item;
        selectItem.setPickListFields(getPickListFields(optionField, lang));
        if (pickListWidth != null) {
            selectItem.setPickListWidth(pickListWidth);
        }
    } else if (item instanceof ComboBoxItem) {
        ComboBoxItem cbi = (ComboBoxItem) item;
        cbi.setPickListFields(getPickListFields(optionField, lang));
        if (pickListWidth != null) {
            cbi.setPickListWidth(pickListWidth);
        }
    }
}
 
Example #5
Source File: NdkExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
protected void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    //dsRequest.setPromptStyle(PromptStyle.DIALOG);
    //dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getNdk();

    dsAddData(ds, 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);
}
 
Example #6
Source File: ArchiveExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    //dsRequest.setPromptStyle(PromptStyle.DIALOG);
    //dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getArchive();
    dsAddData(ds, 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 {
                    DesaExportAction.ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
Example #7
Source File: NdkSipExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getNdk();

    dsAddData(ds, 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()) {
                    SC.say(i18n.NdkExportAction_ExportDone_Msg());
                } else {
                    DesaExportAction.ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
Example #8
Source File: ExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
protected final void dsAddData(DataSource dataSource, Record record, DSCallback dsCallback, DSRequest dsRequest) {
    DynamicForm optionsForm = createOptionsForm();

    if (optionsForm == null) {
        dataSource.addData(record, dsCallback, dsRequest);
        SC.say(i18n.ExportAction_Sent_Msg());
        return;
    }

    Dialog d = new Dialog(i18n.ExportAction_Request_Title());
    d.getDialogContentContainer().addMember(optionsForm);

    IButton okButton = d.addOkButton((ClickEvent eventX) -> {
        setRequestOptions(record);
        dataSource.addData(record, dsCallback, dsRequest);
        d.destroy();
        SC.say(i18n.ExportAction_Sent_Msg());
    });

    d.addCancelButton(() -> d.destroy());
    d.setWidth(400);
    d.show();

    okButton.focus();
}
 
Example #9
Source File: CejshExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    //dsRequest.setPromptStyle(PromptStyle.DIALOG);
    //dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getCejsh();
    dsAddData(ds, 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 {
                    DesaExportAction.ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
Example #10
Source File: ChronicleExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getNdk();

    dsAddData(ds, 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()) {
                    SC.say(i18n.NdkExportAction_ExportDone_Msg());
                } else {
                    DesaExportAction.ExportResultWidget.showErrors(erl.toArray());
                }
            }
        }
    }, dsRequest);
}
 
Example #11
Source File: DesaExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private void exportOrValidate(final Record export) {
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.KrameriusExportAction_Add_Msg());
    DataSource ds = ExportDataSource.getDesa();
    dsAddData(ds, 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);
}
 
Example #12
Source File: DcRecordDataSource.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
@Override
    protected void transformResponse(DSResponse response, DSRequest request, Object data) {
        // transform oai_dc:dc element to properly resolve namespaces
        Object dcNode = XMLTools.selectNodes(data, FIELD_DC.getQualifiedName(), XML_NAMESPACE_MAP);

        DataSource ds = getDcDataSource();
        Record[] recordsFromXML = new Record[0]; // XXX test
//        Record[] recordsFromXML = ds.recordsFromXML(dcNode);
        Record[] responseData = response.getData();
        if (responseData.length > 0) {
            fixDcRecord(responseData[0].getAttributeAsRecord(FIELD_DC.getQualifiedName()));
//            LOG.fine(ClientUtils.dump(responseData[0], "transformResponse.responseData:"));
        }

        LOG.fine(ClientUtils.format("transformResponse: responseData.length: %s, recordsFromXML.length: %s",
                responseData.length, recordsFromXML.length));
        for (int i = 0; i < recordsFromXML.length; i++) {
//            LOG.fine(ClientUtils.dump(recordsFromXML[i], ""));
            fixDcRecord(recordsFromXML[i]);
            responseData[i].setAttribute(FIELD_DC.getQualifiedName(), recordsFromXML[i]);
        }

        super.transformResponse(response, request, data);
    }
 
Example #13
Source File: DesaExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
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());
    dsRequest.setShowPrompt(false);
    DataSource ds = ExportDataSource.getDesa();
    dsAddData(ds, 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);
}
 
Example #14
Source File: RestoreAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public RecordDeletable(DataSource ds, ClientMessages i18n) {
    if (ds == null) {
        throw new NullPointerException();
    }
    this.ds = ds;
    this.i18n = i18n;
}
 
Example #15
Source File: MediaDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static MediaDataSource getInstance() {
    if (INSTANCE == null) {
        INSTANCE = (MediaDataSource) DataSource.get(ID);
        // DataSource.get does not work reliably
        INSTANCE = INSTANCE != null ? INSTANCE : new MediaDataSource();
    }
    return INSTANCE;
}
 
Example #16
Source File: DeleteAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public RecordDeletable(DataSource ds, ClientMessages i18n) {
    if (ds == null) {
        throw new NullPointerException();
    }
    this.ds = ds;
    this.i18n = i18n;
}
 
Example #17
Source File: WorkflowTaskFormView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private void setOptions(FormItem item, Record profile) {
    String dataSourceId = profile.getAttribute(WorkflowModelConsts.PARAMETER_VALUEMAPID);
    if (dataSourceId != null) {
        DataSource ds = ValueMapDataSource.getInstance().getOptionDataSource(dataSourceId);
        item.setValueField(profile.getAttribute(WorkflowModelConsts.PARAMETER_OPTION_VALUE_FIELD));
        item.setOptionDataSource(ds);
        item.setDisplayField(profile.getAttribute(WorkflowModelConsts.PARAMETER_OPTION_DISPLAY_FIELD));
    }
}
 
Example #18
Source File: NewIssueEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createForm() {
    DataSource ds = new DataSource();
    ds.setClientOnly(true);
    DataSourceIntegerField fDays = new DataSourceIntegerField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_DAYS_INCLUDED_PARAM);
    fDays.setMultiple(true);
    DataSourceDateField fDateFrom = new DataSourceDateField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_DATE_FROM_PARAM);
    DataSourceDateField fDateTo = new DataSourceDateField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_DATE_TO_PARAM);
    DataSourceIntegerField fPartNumberFrom = new DataSourceIntegerField(
            DigitalObjectResourceApi.DIGITALOBJECT_SERIES_PARTNUMBER_FROM_PARAM);
    ds.setFields(fDateFrom, fDateTo, fDays, fPartNumberFrom);

    DynamicForm df = new DynamicForm();
    df.setWidth(200);
    df.setItemHoverWidth(200);
    df.setWrapItemTitles(false);
    df.setSaveOnEnter(true);

    IntegerItem partNumberStart = createPartName(fPartNumberFrom.getName());

    DateRangeValidator dateRangeValidator = new DateRangeValidator();
    DateItem dateStart = createDateFrom(fDateFrom.getName(), dateRangeValidator);

    DateItem dateEnd = new DateItem(fDateTo.getName(), i18n.NewIssueEditor_dateTo_Title());
    dateEnd.setTooltip(i18n.NewIssueEditor_dateTo_Hint());
    dateEnd.setUseTextField(true);
    dateEnd.setValidators(dateRangeValidator);
    dateEnd.setStartDate(new Date(1900 - 1900, 1, 1));

    SelectItem issueDays = createDayChooser(fDays.getName());

    df.setDataSource(ds, partNumberStart, dateStart, dateEnd, issueDays);
    return df;
}
 
Example #19
Source File: RegisterLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public RegisterLayout() {
    super(i18n.registration());
    setStyleName("n52_sensorweb_client_form_content");
    
    DataSourceTextField userNameField = new DataSourceTextField("userName", i18n.userName(), 50, true);
    DataSourceTextField nameField = new DataSourceTextField("name", i18n.name(), 50, false);
    DataSourcePasswordField passwordField = new DataSourcePasswordField("password", i18n.password(), 20, true);
    DataSourceTextField emailField = new DataSourceTextField("email", i18n.email(), 100, true);

    RegExpValidator emailValidator = new RegExpValidator();
    emailValidator.setErrorMessage(i18n.invalidEmail());
    emailValidator.setExpression("^([a-zA-Z0-9_.\\-+])+@(([a-zA-Z0-9\\-])+\\.)+[a-zA-Z0-9]{2,4}$");
    emailField.setValidators(emailValidator);

    DataSource dataSource = new DataSource();
    dataSource.setFields(userNameField, nameField, passwordField, emailField);
    this.form.setDataSource(dataSource);

    createNameTextInputs();
    createPasswordTextInputs();
    createEmailTextInputs();
    createAcceptTermsOfUse();
    ButtonItem registerButton = createRegisterButton();
    LinkItem backToLoginLink = createBackToLoginLink();
    this.form.setFields(this.headerItem, this.userNameItem, this.nameItem, this.passwordItem, this.verifyPasswordItem,
            this.emailItem, this.verifyEmailItem, this.linkTerms, this.acceptBox, registerButton, backToLoginLink);
    
    addMember(this.form);
    setAutoWidth();
}
 
Example #20
Source File: ImportBatchItemDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public DeleteTask(DataSource ds, String batchId, String[] pids,
        Callback<Record[], String> callback) {

    this.ds = ds;
    this.pids = pids;
    this.callback = callback;
    this.i18n = GWT.create(ClientMessages.class);
    this.batchId = batchId;
    this.deleted = new ArrayList<Record>(pids.length);
}
 
Example #21
Source File: RelationDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static RelationDataSource getInstance() {
    if (INSTANCE == null) {
        INSTANCE = (RelationDataSource) DataSource.get(ID);
        // DataSource.get does not work reliably
        INSTANCE = INSTANCE != null ? INSTANCE : new RelationDataSource();
    }
    return INSTANCE;
}
 
Example #22
Source File: ModsCustomDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public ModsCustomDataSource() {
    setID(ID);
    setDataURL(RestConfig.URL_DIGOBJECT_MODS_CUSTOM);

    DataSourceField fieldPid = new DataSourceField(FIELD_PID, FieldType.TEXT);
    fieldPid.setPrimaryKey(true);
    fieldPid.setRequired(true);

    DataSourceField fieldTimestamp = new DataSourceField(FIELD_TIMESTAMP, FieldType.TEXT);
    fieldTimestamp.setRequired(true);
    fieldTimestamp.setHidden(true);

    DataSourceField fieldEditor = new DataSourceField(MetaModelDataSource.FIELD_EDITOR, FieldType.TEXT);
    fieldEditor.setRequired(true);
    fieldEditor.setHidden(true);

    DataSourceField fieldData = new DataSourceField(FIELD_DATA, FieldType.ANY);
    fieldData.setTypeAsDataSource(new DataSource() {
        {
            DataSourceField identifiers = new DataSourceField(FIELD_IDENTIFIERS, FieldType.ANY);
            identifiers.setTypeAsDataSource(IdentifierDataSource.getInstance());
            setFields(identifiers);
        }
    });

    setFields(fieldPid, fieldTimestamp, fieldEditor, fieldData);

    setOperationBindings(RestConfig.createUpdateOperation());

    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
}
 
Example #23
Source File: DcRecordDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static DataSource getDcDataSource() {
    DataSource result = DataSource.get("DcDataSource");
    if (result != null) {
        return result;
    } else {
        return createDcDataSource();
    }
}
 
Example #24
Source File: DcRecordDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
/**
     * Holds element text content and its attributes
     */
    private static DataSource createDcElementDataSource(String name) {
        DataSource ds = new DataSource();
//        ds.setID("DcElementDataSource");
        ds.setTagName(name);
        DataSourceField lang = new DataSourceField(FIELD_XML_LANG, FieldType.TEXT);
        lang.setXmlAttribute(true);

        ds.setFields(lang);

        ds.setXmlNamespaces(XML_NAMESPACES);
        ds.setGlobalNamespaces(XML_NAMESPACE_MAP);

        return ds;
    }
 
Example #25
Source File: RefreshableListGrid.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void refresh(DataSource newDataSource){
	if(getDataSource()!=null){
		getDataSource().destroy();
		invalidateCache();
	}
	
	setDataSource(newDataSource, getAllFields());
	fetchData();
}
 
Example #26
Source File: BibliographyDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public static BibliographyDataSource getInstance() {
    BibliographyDataSource ds = (BibliographyDataSource) DataSource.get(ID);
    ds = (ds != null) ? ds : new BibliographyDataSource();
    return ds;
}
 
Example #27
Source File: ImportBatchItemDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public static ImportBatchItemDataSource getInstance() {
    ImportBatchItemDataSource ds = (ImportBatchItemDataSource) DataSource.get(ID);
    ds = ds != null ? ds : new ImportBatchItemDataSource();
    return ds;
}
 
Example #28
Source File: ImportBatchItemEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Updates data source cache and attached data bounded components (ListGrid, TileGrid).
 * It should be called when child editor changes affects import item descriptions
 * or validation status.
 */
private void updateCache() {
    final Record[] selections = getSelection();
    Criteria criteria = new Criteria(ImportBatchItemDataSource.FIELD_BATCHID, batchRecord.getId());
    if (selections.length == 0) {
        return ;
    } else if (selections.length == 1) {
        // on single selection update only the involved row
        DigitalObject dobj = DigitalObject.create(selections[0]);
        criteria.addCriteria(ImportBatchItemDataSource.FIELD_PID, dobj.getPid());
    }
    final DataSource ds = batchItemGrid.getDataSource();
    ds.fetchData(criteria, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                if (selections.length == 1) {
                    request.setOperationType(DSOperationType.UPDATE);
                    ds.updateCaches(response, request);

                    Record record = response.getData()[0];
                    Record copyRecord = ds.copyRecord(record);
                    int thumbIndex = getThumbIndex(copyRecord);
                    thumbViewer.getRecordList().set(thumbIndex, copyRecord);

                    selectNextChildAndFocus(record);
                } else {
                    request.setOperationType(DSOperationType.UPDATE);
                    ds.updateCaches(response, request);
                    
                    Record[] copyRecords = ds.copyRecords(response.getData());
                    thumbViewer.setData(copyRecords);
                }
                ValidatableList.clearRowErrors(batchItemGrid);
                // refresh the copy selection as updated records are missing the copy attribute
                showCopySelection(DigitalObjectCopyMetadataAction.getSelection());
            }
        }
    });
}
 
Example #29
Source File: ImportTreeDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public static ImportTreeDataSource getInstance() {
    ImportTreeDataSource ds = (ImportTreeDataSource) DataSource.get(ID);
    return ds != null ? ds : new ImportTreeDataSource();
}
 
Example #30
Source File: ProgressTracker.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ProgressHandler(DataSource ds, Criteria criteria) {
    this.ds = ds;
    this.criteria = criteria;
}