private void updateComment(String geneName, XWikiDocument doc, String commentAppend, DocumentReference geneClassReference) throws HibernateException, XWikiException { List<BaseObject> genes = doc.getXObjects(geneClassReference); for (BaseObject gene : genes) { if (gene == null) { continue; } StringProperty geneNameProp = (StringProperty) gene.get(GENE_NAME); if (geneNameProp != null && geneNameProp.getValue().equals(geneName)) { LargeStringProperty oldGeneCommentsProp = (LargeStringProperty) gene.get(COMMENTS_NAME); if (oldGeneCommentsProp == null || StringUtils.isBlank(oldGeneCommentsProp.getValue())) { gene.setLargeStringValue(COMMENTS_NAME, commentAppend); } else { gene.setLargeStringValue(COMMENTS_NAME, oldGeneCommentsProp.getValue() + commentAppend); } } } } }
private void updateComment(String geneName, XWikiDocument doc, String commentAppend, DocumentReference geneClassReference) throws HibernateException, XWikiException { List<BaseObject> genes = doc.getXObjects(geneClassReference); for (BaseObject gene : genes) { if (gene == null) { continue; } StringProperty geneNameProp = (StringProperty) gene.get(GENE_NAME); if (geneNameProp != null && geneNameProp.getValue().equals(geneName)) { LargeStringProperty oldGeneCommentsProp = (LargeStringProperty) gene.get(COMMENTS_NAME); if (oldGeneCommentsProp == null || StringUtils.isBlank(oldGeneCommentsProp.getValue())) { gene.setLargeStringValue(COMMENTS_NAME, commentAppend); } else { gene.setLargeStringValue(COMMENTS_NAME, oldGeneCommentsProp.getValue() + commentAppend); } } } } }
if (oldGeneCommentsProp != null && StringUtils.isNotBlank(oldGeneCommentsProp.getValue())) { freeComments.append(" - " + oldGeneCommentsProp.getValue() + "\n"); String geneComments = null; if (oldGeneCommentsProp != null) { geneComments = StringUtils.defaultIfBlank(oldGeneCommentsProp.getValue(), null);
if (oldGeneCommentsProp != null && StringUtils.isNotBlank(oldGeneCommentsProp.getValue())) { freeComments.append(" - " + oldGeneCommentsProp.getValue() + "\n"); String geneComments = null; if (oldGeneCommentsProp != null) { geneComments = StringUtils.defaultIfBlank(oldGeneCommentsProp.getValue(), null);
newProperty.setName(oldProperty.getName()); newProperty.setList(ListClass.getListFromString(oldProperty.getValue(), ",", false));
property2.setName(name); loadXWikiProperty(property2, context, false); property.setValue(property2.getValue());
field.setValue(performSyntaxConversion(field.getValue(), getSyntaxId(), targetSyntax));