本文整理汇总了Java中com.smartgwt.client.data.Record类的典型用法代码示例。如果您正苦于以下问题:Java Record类的具体用法?Java Record怎么用?Java Record使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Record类属于com.smartgwt.client.data包,在下文中一共展示了Record类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateSelection
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private void updateSelection() {
RecordList rl = taskGrid.getRecordList();
if (rl.isEmpty()) {
return ;
}
if (lastSelection == null) {
taskGrid.selectSingleRecord(0);
return ;
}
Record newRec = rl.find(WorkflowTaskDataSource.FIELD_ID,
lastSelection.getAttribute(WorkflowTaskDataSource.FIELD_ID));
if (newRec != null) {
taskGrid.selectSingleRecord(newRec);
int rowNum = taskGrid.getRecordIndex(newRec);
if (rowNum >= 0) {
taskGrid.scrollToRow(rowNum);
}
}
}
开发者ID:proarc,项目名称:proarc,代码行数:20,代码来源:WorkflowTasksView.java
示例2: exportOrValidate
import com.smartgwt.client.data.Record; //导入依赖的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
示例3: performAction
import com.smartgwt.client.data.Record; //导入依赖的package包/类
@Override
public void performAction(ActionEvent event) {
Record[] selectedRecords = Actions.getSelection(event);
if (accept(selectedRecords)) {
DigitalObject dobj = DigitalObject.create(selectedRecords[0]);
String pid = dobj.getPid();
switch (navigation) {
case PARENT:
openParent(pid);
break;
case NEXT:
case PREV:
openSibling(pid, false);
break;
case CHILD:
openChild(pid, getChildSelection(event));
break;
}
}
}
开发者ID:proarc,项目名称:proarc,代码行数:21,代码来源:DigitalObjectNavigateAction.java
示例4: removeNulls
import com.smartgwt.client.data.Record; //导入依赖的package包/类
/**
* Removes all attributes with {@code null} value.
*
* Useful before passing record to {@link DataSource} that encodes {@code null}
* attributes as {@code "name":"null"} in JSON.
* @param r record to process
* @return copy of the record without {@code null} attributes
*/
public static Record removeNulls(Record r) {
boolean hasNull = false;
HashMap<Object, Object> nonNunlls = new HashMap<Object, Object>();
Map<?, ?> recordMap = r.toMap();
for (Map.Entry<?, ?> entry : recordMap.entrySet()) {
Object value = entry.getValue();
if (value instanceof Collection && ((Collection) value).isEmpty()) {
hasNull = true;
} else if (value instanceof String && ((String) value).isEmpty()) {
hasNull = true;
} else if ("__ref".equals(entry.getKey())) {
// ignore GWT attributes
hasNull = true;
} else if (value != null) {
nonNunlls.put(entry.getKey(), value);
} else {
hasNull = true;
}
}
return hasNull ? new Record(nonNunlls) : r;
}
开发者ID:proarc,项目名称:proarc,代码行数:30,代码来源:ClientUtils.java
示例5: create
import com.smartgwt.client.data.Record; //导入依赖的package包/类
/**
* Creates digital object instance from record.
* @param r record
* @param checked {@code false} means ignore missing attributes and return {@code null}
* @return instance of digital object
*/
private static DigitalObject create(Record r, boolean checked) {
if (r == null) {
throw new NullPointerException();
}
DigitalObject dobj = (DigitalObject) r.getAttributeAsObject(FIELD_INSTANCE);
if (dobj != null) {
return dobj;
}
String pid = getAttribute(r, FIELD_PID, checked);
String modelId = getAttribute(r, FIELD_MODEL, checked);
if (pid == null || modelId == null) {
return null;
}
String batchId = r.getAttribute(ModsCustomDataSource.FIELD_BATCHID);
MetaModelRecord model = MetaModelDataSource.getModel(r);
return new DigitalObject(pid, batchId, modelId, model, r);
}
开发者ID:proarc,项目名称:proarc,代码行数:24,代码来源:DigitalObjectDataSource.java
示例6: onCreateNewTask
import com.smartgwt.client.data.Record; //导入依赖的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
示例7: askForExportOptions
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private void askForExportOptions(String[] pids) {
if (pids == null || pids.length == 0) {
return ;
}
Record export = new Record();
export.setAttribute(ExportResourceApi.CROSSREF_PID_PARAM, pids);
// ExportOptionsWidget.showOptions(export, new Callback<Record, Void>() {
//
// @Override
// public void onFailure(Void reason) {
// // no-op
// }
//
// @Override
// public void onSuccess(Record result) {
// exportOrValidate(result);
// }
// });
exportOrValidate(export);
}
开发者ID:proarc,项目名称:proarc,代码行数:21,代码来源:CrossrefExportAction.java
示例8: refreshData
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private void refreshData() {
reorderTask.reset();
DigitalObjectCopyMetadataAction.resetSelection();
Criteria criteria = new Criteria(ImportBatchItemDataSource.FIELD_BATCHID, batchRecord.getId());
batchItemGrid.invalidateCache();
thumbViewer.setData(new Record[0]);
previewItem(null);
batchItemGrid.fetchData(criteria, new DSCallback() {
@Override
public void execute(DSResponse response, Object rawData, DSRequest request) {
if (RestConfig.isStatusOk(response)) {
Record[] data = response.getData();
Record[] copyRecords = batchItemGrid.getDataSource().copyRecords(data);
thumbViewer.setData(copyRecords);
batchItemGrid.selectSingleRecord(0);
batchItemGrid.focus();
ValidatableList.clearRowErrors(batchItemGrid);
}
}
});
}
开发者ID:proarc,项目名称:proarc,代码行数:25,代码来源:ImportBatchItemEditor.java
示例9: deleteItem
import com.smartgwt.client.data.Record; //导入依赖的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
示例10: updateSelection
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private void updateSelection() {
RecordList rl = jobGrid.getRecordList();
if (rl.isEmpty()) {
return ;
}
if (lastSelection == null) {
jobGrid.selectSingleRecord(0);
return ;
}
Record newRec = rl.find(WorkflowJobDataSource.FIELD_ID,
lastSelection.getAttribute(WorkflowJobDataSource.FIELD_ID));
if (newRec != null) {
jobGrid.selectSingleRecord(newRec);
int rowNum = jobGrid.getRecordIndex(newRec);
if (rowNum >= 0) {
jobGrid.scrollToRow(rowNum);
}
}
}
开发者ID:proarc,项目名称:proarc,代码行数:20,代码来源:WorkflowJobView.java
示例11: exportOrValidate
import com.smartgwt.client.data.Record; //导入依赖的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: condition
import com.smartgwt.client.data.Record; //导入依赖的package包/类
@Override
protected boolean condition(RecordList recordList) {
boolean valid = true;
StringBuilder typesMsg = new StringBuilder();
LinkedHashMap<String, String> typeMap = IdentifierDataSource.getTypeValueMap(getI18n());
for (String type : requiredIdentifiers) {
Record r = recordList.find(IdentifierDataSource.FIELD_TYPE, type);
if (r == null) {
valid = false;
String typeName = typeMap.get(type);
typesMsg.append(", ").append(typeName == null ? type : typeName);
}
}
if (typesMsg.length() > 0) {
setErrorMessage(getI18n().Validation_RequiredIdentifiers_Msg(typesMsg.substring(2)));
}
return valid;
}
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:IdentifiersValidator.java
示例13: fetchAddSubjobMenu
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private void fetchAddSubjobMenu(Record job) {
if (job == null
|| job.getAttribute(WorkflowJobDataSource.FIELD_PARENTID) != null
|| !Job.State.OPEN.name().equals(job.getAttribute(WorkflowJobDataSource.FIELD_STATE))
) {
addSubjobButton.setVisible(false);
return ;
}
String jobName = job.getAttribute(WorkflowJobDataSource.FIELD_PROFILE_ID);
if (jobName == null) {
return ;
}
WorkflowProfileDataSource.getInstance().getSubjobs(false, jobName, (subjobs) -> {
Menu menu = createSubjobMenu(subjobs);
addSubjobButton.setVisible(menu != null);
addSubjobButton.setMenu(menu);
});
}
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:WorkflowJobView.java
示例14: syncListWithTilesOnReorder
import com.smartgwt.client.data.Record; //导入依赖的package包/类
/**
* As there is no API to reorder ListGrid records, it reloads data and
* tries to preserve selection of records.
*/
private void syncListWithTilesOnReorder() {
Record[] selection = thumbViewer.getSelection();
final int[] selectionIndex = new int[selection.length];
for (int i = 0; i < selection.length; i++) {
selectionIndex[i] = thumbViewer.getRecordIndex(selection[i]);
}
Criteria criteria = new Criteria(ImportBatchItemDataSource.FIELD_BATCHID, batchRecord.getId());
DigitalObjectCopyMetadataAction.resetSelection();
batchItemGrid.invalidateCache();
batchItemGrid.fetchData(criteria, new DSCallback() {
@Override
public void execute(DSResponse response, Object rawData, DSRequest request) {
if (RestConfig.isStatusOk(response)) {
batchItemGrid.selectRecords(selectionIndex);
}
}
});
}
开发者ID:proarc,项目名称:proarc,代码行数:24,代码来源:ImportBatchItemEditor.java
示例15: getToken
import com.smartgwt.client.data.Record; //导入依赖的package包/类
@Override
public String getToken(DigitalObjectEditorPlace place) {
String[] digitalObjectPids = place.getPids();
if (digitalObjectPids != null && digitalObjectPids.length > 1) {
// batch edits should not be bookmarked
throw new UnsupportedOperationException(Arrays.toString(digitalObjectPids));
}
Record[] digitalObjects = place.getDigitalObjects();
if (digitalObjects != null && digitalObjects.length > 1) {
// batch edits should not be bookmarked
String[] pids = ClientUtils.toFieldValues(digitalObjects, "pid");
throw new UnsupportedOperationException(Arrays.toString(pids));
}
JSONObject json = new JSONObject();
JsonTokenizer.putString(json, EDITOR, place.editor == null ? null : place.editor.name());
JsonTokenizer.putString(json, PID, place.getPid());
String jsonString = json.toString();
return jsonString;
}
开发者ID:proarc,项目名称:proarc,代码行数:20,代码来源:DigitalObjectEditing.java
示例16: accept
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private boolean accept(Record[] selection) {
if (selection == null || (!filter.isMultiSelection() && selection.length != 1)) {
return false;
}
// check object model of each record
for (Record record : selection) {
DigitalObject dobj = DigitalObject.createOrNull(record);
// is digital object?
if (dobj == null) {
return false;
}
if (filter.isAnyModel()) {
continue;
}
MetaModelRecord model = dobj.getModel();
if (model == null || !model.isSupportedDatastream(editorType.name())) {
return false;
}
}
return true;
}
开发者ID:proarc,项目名称:proarc,代码行数:23,代码来源:DigitalObjectEditAction.java
示例17: transformResponse
import com.smartgwt.client.data.Record; //导入依赖的package包/类
@Override
protected void transformResponse(DSResponse dsResponse, DSRequest dsRequest, Object data) {
if (RestConfig.isStatusOk(dsResponse)) {
Record[] records = dsResponse.getData();
for (Record record : records) {
String mid = record.getAttribute(FIELD_ID);
String way = record.getAttribute(FIELD_WAY);
String pk = mid;
if (way != null) {
pk = mid + way;
}
record.setAttribute(PRIMARY_KEY, pk);
}
// #509: do not use the data object as it breaks super.transformResponse
data = null;
}
super.transformResponse(dsResponse, dsRequest, data);
}
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:WorkflowMaterialDataSource.java
示例18: resolveRecordValues
import com.smartgwt.client.data.Record; //导入依赖的package包/类
/**
* Replace string values of record attributes with types declared by item children.
* This is necessary as declarative forms do not use DataSource stuff.
* @param record record to scan for attributes
* @param item item with possible profile
* @return resolved record
*/
private static Record resolveRecordValues(Record record, FormItem item) {
Field f = getProfile(item);
if (f != null) {
for (Field field : f.getFields()) {
String fType = field.getType();
if ("date".equals(fType) || "datetime".equals(fType)) {
// parses ISO dateTime to Date; otherwise DateItem cannot recognize the value!
Object value = record.getAttributeAsObject(field.getName());
if (!(value instanceof String)) {
continue;
}
String sd = (String) value;
// ClientUtils.severe(LOG, "name: %s, is date, %s", field.getName(), sd);
// Date d = DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse("1994-11-05T13:15:30Z");
try {
Date d = DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse(sd);
record.setAttribute(field.getName(), d);
} catch (IllegalArgumentException ex) {
LOG.log(Level.WARNING, sd, ex);
}
}
}
}
return record;
}
开发者ID:proarc,项目名称:proarc,代码行数:33,代码来源:RepeatableFormItem.java
示例19: fetchSiblings
import com.smartgwt.client.data.Record; //导入依赖的package包/类
private void fetchSiblings(final String pid) {
SearchDataSource.getInstance().findParent(pid, null, new Callback<ResultSet, Void>() {
@Override
public void onFailure(Void reason) {
}
@Override
public void onSuccess(ResultSet result) {
if (result.isEmpty()) {
SC.warn(i18n.DigitalObjectNavigateAction_NoParent_Msg());
} else {
Record parent = result.first();
DigitalObject parentObj = DigitalObject.createOrNull(parent);
if (parentObj != null) {
scheduleFetchSiblings(parentObj.getPid(), pid);
}
}
}
});
}
开发者ID:proarc,项目名称:proarc,代码行数:22,代码来源:DigitalObjectNavigateAction.java
示例20: saveXmlDescription
import com.smartgwt.client.data.Record; //导入依赖的package包/类
public void saveXmlDescription(DigitalObject dobj, String xml, long timestamp, DescriptionSaveHandler callback) {
Record update = new Record();
dobj.toCriteria();
update.setAttribute(FIELD_PID, dobj.getPid());
if (dobj.getBatchId() != null) {
update.setAttribute(FIELD_BATCHID, dobj.getBatchId());
}
if (xml == null || xml.isEmpty()) {
return ;
}
update.setAttribute(DigitalObjectResourceApi.MODS_CUSTOM_CUSTOMXMLDATA, xml);
// timestamp -1 stands for rewrite without concurrency check
update.setAttribute(FIELD_TIMESTAMP, timestamp);
update.setAttribute(FIELD_EDITOR, dobj.getModel().getEditorId());
callback.setUpdateRecord(update);
updateData(update, callback, callback.getUpdateRequest());
}
开发者ID:proarc,项目名称:proarc,代码行数:18,代码来源:ModsCustomDataSource.java
注:本文中的com.smartgwt.client.data.Record类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论