public String toString(BaseProperty property) { return property.toText(); }
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { BaseProperty prop = (BaseProperty) object.safeget(name); if (prop != null) { buffer.append(prop.toText()); } }
/** * {@inheritDoc} * * @see com.xpn.xwiki.objects.PropertyInterface#toFormString() */ public String toFormString() { return Utils.formEncode(toText()); }
protected Object getBaseProperty(String propertyName, String language, boolean text) throws XWikiException { // First we try to get a translated preference object BaseObject baseObject = getBaseObject(language); if (baseObject != null) { BaseProperty property = (BaseProperty) baseObject.getField(propertyName); return property != null ? (text ? property.toText() : property.getValue()) : null; } return null; }
while (it.hasNext()) { BaseProperty< ? > bprop = it.next(); propertyFilter.onWikiClassPropertyField(bprop.getName(), bprop.toText(), FilterEventParameters.EMPTY);
protected Object getBaseProperty(String propertyName, boolean text) throws XWikiException { BaseObject baseObject = getBaseObject(); if (baseObject != null) { BaseProperty property = (BaseProperty) baseObject.getField(propertyName); Object value = property != null ? (text ? property.toText() : property.getValue()) : null; // TODO: In the future we would need the notion of initialized/not-initialized property values in the wiki. // When this is implemented modify the code below. if (isEmpty(value)) { value = null; } return value; } return null; }
if ((newProperty != null) && (!newProperty.toText().equals(""))) { if (pclass != null) { String newPropertyValue = (newProperty.getValue() instanceof String) ? newProperty.toText() : pclass.displayView( propertyName, this, context); difflist.add(new ObjectDiff(getClassName(), getNumber(), "", "added", propertyName, } else if (!oldProperty.toText().equals(((newProperty == null) ? "" : newProperty.toText()))) { (newProperty.getValue() instanceof String) ? newProperty.toText() : pclass.displayView( propertyName, this, context); String oldPropertyValue = (oldProperty.getValue() instanceof String) ? oldProperty.toText() : pclass.displayView( propertyName, oldCollection, context); difflist.add(new ObjectDiff(getClassName(), getNumber(), "", "changed", propertyName, propertyType, oldProperty.toText(), newProperty.toText())); if ((oldProperty != null) && (!oldProperty.toText().equals(""))) { if (pclass != null) { (oldProperty.getValue() instanceof String) ? oldProperty.toText() : pclass.displayView( propertyName, oldCollection, context); difflist.add(new ObjectDiff(oldCollection.getClassName(), oldCollection.getNumber(), "", "removed", propertyName, propertyType, oldProperty.toText(), ""));
if ((newProperty != null) && (!newProperty.toText().equals(""))) { String newPropertyValue = (newProperty.getValue() instanceof String || pclass == null) ? newProperty.toText() : pclass.displayView(propertyName, this, context); difflist.add(new ObjectDiff(getClassName(), getNumber(), getGuid(), "added", propertyName, propertyType, "", newPropertyValue)); } else if (!oldProperty.toText().equals(((newProperty == null) ? "" : newProperty.toText()))) { (newProperty.getValue() instanceof String || pclass == null) ? newProperty.toText() : pclass.displayView(propertyName, this, context); String oldPropertyValue = (oldProperty.getValue() instanceof String || pclass == null) ? oldProperty.toText() : pclass.displayView(propertyName, oldObject, context); difflist.add(new ObjectDiff(getClassName(), getNumber(), getGuid(), "changed", propertyName, propertyType, oldProperty.toText(), newProperty.toText())); if ((oldProperty != null) && (!oldProperty.toText().equals(""))) { if (pclass != null) { (oldProperty.getValue() instanceof String) ? oldProperty.toText() : pclass.displayView(propertyName, oldObject, context); difflist.add(new ObjectDiff(oldObject.getClassName(), oldObject.getNumber(), oldObject.getGuid(), "removed", propertyName, propertyType, oldProperty.toText(), ""));