/** * Performs initial comparison of two data hierarchies, then examines them recursively if necessary * * @return true when all members of the provided hierarchies are equivalent */ protected static boolean nullsafeEquals(Data o1, Data o2) { if (o1 == null && o2 == null) { return true; } else if (o1 != null && o2 != null && o1.size() != o2.size()) { return false; } else if (o1 != null && o2 != null && o1.size() == o2.size()) { return deepEquals(o1, o2); } else { return false; } }
@Override public void requestModel(final ModelRequestCallback<DataModel> callback) { if(comparisonModel.getRoot() != null && comparisonModel.getRoot().size() != 0){ callback.onModelReady(comparisonModel); } else{ callback.onModelReady(null); } } });
@Override public void requestModel(final ModelRequestCallback<DataModel> callback) { if (programModel.getRoot() == null || programModel.getRoot().size() == 0) { loadModel(callback); } else { callback.onModelReady(programModel); } } });
@Override public void requestModel(final ModelRequestCallback<DataModel> callback) { if(reqModel.getRoot() != null && reqModel.getRoot().size() != 0){ callback.onModelReady(reqModel); } else{ callback.onModelReady(null); } } });
public static String getVersionIndicator(Data data) { String result = null; Data versions = getVersions(data); if (versions == null) { return null; } if (versions.size() > 0) { Data v = versions.get(0); if (v != null) { result = v.get(VersionProperties.VERSION_INDICATOR.getKey()); } } return result; }
@Override public void requestModel(final ModelRequestCallback<DataModel> callback) { if(comparisonModel.getRoot() != null && comparisonModel.getRoot().size() != 0 && getViewContext() != null){ callback.onModelReady(comparisonModel); } else{ callback.onModelReady(null); } } });
@Override public void exec(ButtonEnumerations.ButtonEnum result) { if (result == actionButton) { reqCompController.updateModel(); //validate and retrieve fields if (progReqData.getRoot().size() > 0) { progReqData.validate(new Callback<List<ValidationResultInfo>>() { @Override public void exec(List<ValidationResultInfo> validationResults) { //do not proceed if the user input is not valid if (!reqCompController.isValid(validationResults, true, true)) { return; } //retrieve entered values and set the rule info updateProgramInfo(requirementsPanel, stmtTypeId, internalProgReqID); dialog.hide(); } }); } } else { dialog.hide(); } } });
if (cellData != null && cellData.size() > 0) { StringBuilder sb = new StringBuilder(); Iterator<Data.Property> iter = cellData.realPropertyIterator();
@Override public void onEvent(AddSpecializationEvent event) { String id = getStringProperty(ProgramConstants.ID); ProgramRegistry.setRow((getDataProperty(ProgramConstants.VARIATIONS)).size()); ProgramRegistry.setData(ProgramUtils.createNewSpecializationBasedOnMajor(programModel)); ViewContext viewContext = new ViewContext(); viewContext.setId(id); viewContext.setIdType(IdAttributes.IdType.OBJECT_ID); HistoryManager.navigate(AppLocations.Locations.EDIT_VARIATION.getLocation(), viewContext); } });
private static void _findDirtyElements(Data data, List<QueryPath> results, QueryPath currentFrame) { if (data == null) { return; } Data flags = getDirtyFlags(data); if (flags != null && flags.size() > 0) { for (Data.Property p : flags) { QueryPath q = new QueryPath(); q.addAll(currentFrame); Key key = p.getWrappedKey(); q.add(key); results.add(q); } } for (Data.Property p : data) { if (p.getValueType().equals(Data.class) && p.getValue() != null) { QueryPath q = new QueryPath(); q.addAll(currentFrame); Key key = p.getWrappedKey(); q.add(key); _findDirtyElements((Data) p.getValue(), results, q); } } } public static Data getDirtyFlags(Data data) {
@Override public void onEvent(AddSpecializationEvent event) { String id = getStringProperty(ProgramConstants.ID); ProgramRegistry.setRow((getDataProperty(ProgramConstants.VARIATIONS)).size()); Data variationData = ProgramUtils.createNewSpecializationBasedOnMajor(programModel); ProgramRegistry.setData(variationData); ViewContext viewContext = new ViewContext(); viewContext.setId(id); viewContext.setIdType(IdAttributes.IdType.OBJECT_ID); if(programModel.get("proposal/id") != null){ // It is a proposal variationData.set("isProposal", true); } HistoryManager.navigate(AppLocations.Locations.EDIT_VARIATION.getLocation(), viewContext); } });
} else if (((Data) prop.getValue()).size() == 1 && ((Data) prop.getValue()).get(0) != null) {