/** * {@inheritDoc} * * Note: This method is overridden to add the deprecation warning so that code using is can see it's deprecated. * * @deprecated since 2.2M2 use {@link #getDocumentReference()} */ @Deprecated @Override public String getName() { return super.getName(); }
/** * Note: This method is overridden to add the deprecation warning so that code using it can see it's deprecated. * * {@inheritDoc} * * @deprecated since 2.2M2 use {@link #getDocumentReference()} */ @Deprecated @Override public String getName() { return super.getName(); }
/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return (getName() + getClassName()).hashCode(); }
@Override public String getName() { return getCollection().getName(); }
/** * Get the name of the {@link com.xpn.xwiki.api.Class XClass} (Object Definition) this property definition belongs * to. For example, {@code XWiki.XWikiUsers} or {@code Blog.BlogPostClass}. * * @return the name of the owner XClass */ public String getClassName() { return getBasePropertyClass().getObject().getName(); }
@Override public void fromSearchMap(XWikiQuery query, Map<String, String[]> map) { String[] data = map.get(""); if (data != null) { query.setParam(getObject().getName() + "_" + getName(), data); } } }
@Override public void fromSearchMap(XWikiQuery query, Map<String, String[]> map) { String[] data = map.get(""); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName(), data[0]); } }
LOG.warn("Invalid number entered for property " + getName() + " of class " + getObject().getName() + ": " + value);
public String getFieldFullName() { if (getObject() == null) { return getName(); } return getObject().getName() + "_" + getName(); }
@Override public void fromSearchMap(XWikiQuery query, Map<String, String[]> map) { String[] data = map.get(""); if (data != null) { Number[] data2 = new Number[data.length]; for (int i = 0; i < data.length; i++) { data2[i] = (Number) fromString(data[i]).getValue(); } query.setParam(getObject().getName() + "_" + getName(), data2); } } }
@Override public void fromSearchMap(XWikiQuery query, Map<String, String[]> map) { String[] data = map.get(""); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName(), fromString(data[0]).getValue()); } else { data = map.get("lessthan"); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName() + "_lessthan", fromString(data[0]).getValue()); } data = map.get("morethan"); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName() + "_morethan", fromString(data[0]).getValue()); } } } }
@Override public void fromSearchMap(XWikiQuery query, Map<String, String[]> map) { String data[] = map.get(""); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName(), fromString(data[0]).getValue()); } else { data = map.get("lessthan"); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName() + "_lessthan", fromString(data[0]).getValue()); } data = map.get("morethan"); if ((data != null) && (data.length == 1)) { query.setParam(getObject().getName() + "_" + getName() + "_morethan", fromString(data[0]).getValue()); } } } }
rowColumns.add((value == null) ? " " : value); } else { BaseObject bobj = doc.getObject(pclass.getObject().getName()); rowColumns.add(doc.display(pclass.getName(), "view", bobj, context));
@Override public Object doInHibernate(Session session) throws HibernateException, XWikiException { Query q = session.createQuery("select p from " + StringListProperty.class.getName() + " as p, BaseObject as o" + " where o.className=? and p.id=o.id and p.name=?"); q.setString(0, this.propertyClass.getObject().getName()).setString(1, this.propertyClass.getName()); @SuppressWarnings("unchecked") List<StringListProperty> wrongProperties = q.list(); for (StringListProperty oldValue : wrongProperties) { DBStringListProperty newValue = (DBStringListProperty) this.propertyClass.newProperty(); newValue.setId(oldValue.getId()); newValue.setName(oldValue.getName()); newValue.setValue(oldValue.getList()); session.delete(oldValue); session.save(newValue); } return null; } }
@Override public Object doInHibernate(Session session) throws HibernateException, XWikiException { Query q = session.createQuery("select p from " + StringListProperty.class.getName() + " as p, BaseObject as o" + " where o.className=? and p.id=o.id and p.name=?"); q.setString(0, this.propertyClass.getObject().getName()).setString(1, this.propertyClass.getName()); @SuppressWarnings("unchecked") List<StringListProperty> wrongProperties = q.list(); for (StringListProperty oldValue : wrongProperties) { DBStringListProperty newValue = (DBStringListProperty) this.propertyClass.newProperty(); newValue.setId(oldValue.getId()); newValue.setName(oldValue.getName()); newValue.setValue(oldValue.getList()); session.delete(oldValue); session.save(newValue); } return null; } }
public boolean validateProperty(BaseProperty property, XWikiContext context) { String regexp = getValidationRegExp(); if ((regexp == null) || (regexp.trim().equals(""))) { return true; } String value = ((property == null) || (property.getValue() == null)) ? "" : property.getValue().toString(); try { if (context.getUtil().match(regexp, value)) { return true; } XWikiValidationStatus.addErrorToContext((getObject() == null) ? "" : getObject().getName(), getName(), getTranslatedPrettyName(context), getValidationMessage(), context); return false; } catch (Exception e) { XWikiValidationStatus.addExceptionToContext((getObject() == null) ? "" : getObject().getName(), getName(), e, context); return false; } }
final Object[] args = {(obj != null) ? obj.getName() : "unknown", property.getName()};
Object[] args = {(obj != null) ? obj.getName() : "unknown", property.getName()}; throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_STORE_HIBERNATE_LOADING_OBJECT,
path = xwiki.getURL("Main.WebHome", "view", context); String classname = this.getObject().getName(); String fieldname = this.getName(); String secondCol = "-", firstCol = "-";
@Override public void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { input input = new input(); BaseProperty prop = (BaseProperty) object.safeget(name); if (prop != null) { input.setValue(prop.toFormString()); } input.setType("text"); input.setName(prefix + name); input.setID(prefix + name); input.setSize(getSize()); input.setDisabled(isDisabled()); if (isPicker()) { input.setClass("suggested"); String path = ""; XWiki xwiki = context.getWiki(); path = xwiki.getURL("Main.WebHome", "view", context); String classname = this.getObject().getName(); String fieldname = this.getName(); String secondCol = "-", firstCol = "-"; String script = "\"" + path + "?xpage=suggest&classname=" + classname + "&fieldname=" + fieldname + "&firCol=" + firstCol + "&secCol=" + secondCol + "&\""; String varname = "\"input\""; input.setOnFocus("new ajaxSuggest(this, {script:" + script + ", varname:" + varname + "} )"); } buffer.append(input.toString()); }