/** * Get the list of enabled (the default, normal state) property definitions that exist in this class. The resulting * list is unmodifiable, but the contained elements are live. * * @return an unmodifiable list containing the enabled properties of the class * @see PropertyClass#isDisabled() * @since 2.4M2 */ public List<PropertyClass> getEnabledProperties() { @SuppressWarnings("unchecked") Collection<PropertyClass> allProperties = getFieldList(); if (allProperties == null) { return Collections.emptyList(); } List<PropertyClass> enabledProperties = new ArrayList<PropertyClass>(allProperties.size()); for (PropertyClass property : allProperties) { if (property != null && !property.isDisabled()) { enabledProperties.add(property); } } Collections.sort(enabledProperties); return Collections.unmodifiableList(enabledProperties); }
/** * Get the list of disabled property definitions that exist in this class. The resulting list is unmodifiable, but * the contained elements are live. * * @return an unmodifiable list containing the disabled properties of the class * @see PropertyClass#isDisabled() * @since 2.4M2 */ public List<PropertyClass> getDisabledProperties() { @SuppressWarnings("unchecked") Collection<PropertyClass> allProperties = getFieldList(); if (allProperties == null) { return Collections.emptyList(); } List<PropertyClass> disabledProperties = new ArrayList<PropertyClass>(); for (PropertyClass property : allProperties) { if (property != null && property.isDisabled()) { disabledProperties.add(property); } } Collections.sort(disabledProperties); return Collections.unmodifiableList(disabledProperties); }
public String makeQuery(XWikiCriteria query) { List<String> criteriaList = new ArrayList<String>(); for (PropertyClass property : (Collection<PropertyClass>) getFieldList()) { String name = property.getName(); Map<String, Object> map = query.getParameters(getName() + "_" + name); if (map.size() > 0) { property.makeQuery(map, "", query, criteriaList); } } return StringUtils.join(criteriaList.toArray(), " and "); }
public BaseCollection fromValueMap(Map<String, ? > map, BaseCollection object) { for (PropertyClass property : (Collection<PropertyClass>) getFieldList()) { String name = property.getName(); Object formvalue = map.get(name); if (formvalue != null) { BaseProperty objprop; objprop = property.fromValue(formvalue); if (objprop != null) { objprop.setObject(object); object.safeput(name, objprop); } } } return object; }
public BaseCollection fromMap(Map<String, ? > map, BaseCollection object) { for (PropertyClass property : (Collection<PropertyClass>) getFieldList()) { String name = property.getName(); Object formvalues = map.get(name); if (formvalues != null) { BaseProperty objprop; if (formvalues instanceof String[]) { objprop = property.fromStringArray(((String[]) formvalues)); } else { objprop = property.fromString(formvalues.toString()); } if (objprop != null) { objprop.setObject(object); object.safeput(name, objprop); } } } return object; }
for (PropertyClass newProperty : (Collection<PropertyClass>) getFieldList()) { String propertyName = newProperty.getName(); PropertyClass oldProperty = (PropertyClass) oldClass.get(propertyName); for (PropertyClass oldProperty : (Collection<PropertyClass>) oldClass.getFieldList()) { String propertyName = oldProperty.getName(); PropertyClass newProperty = (PropertyClass) get(propertyName);
Collection coll = bclass.getFieldList(); Iterator it = coll.iterator(); while (it.hasNext()) {
this.files.add(docinfo); BaseClass bclass = doc.getXClass(); if (bclass.getFieldList().size() > 0) { this.classFiles.add(docinfo);
public SessionFactory injectCustomMappingsInSessionFactory(XWikiContext context) throws XWikiException { // If we haven't turned of dynamic custom mappings we should not inject them if (context.getWiki().hasDynamicCustomMappings() == false) { return getSessionFactory(); } List list; if (useClassesTable(true, context)) { list = searchDocuments( ", BaseClass as bclass where bclass.name=doc.fullName and bclass.customMapping is not null", true, false, false, 0, 0, context); } list = searchDocuments("", true, false, false, 0, 0, context); boolean result = false; for (int i = 0; i < list.size(); i++) { XWikiDocument doc = (XWikiDocument) list.get(i); if (doc.getXClass().getFieldList().size() > 0) { result |= injectCustomMapping(doc.getXClass(), context); } } if (result == false) { return getSessionFactory(); } Configuration config = getConfiguration(); return injectInSessionFactory(config); }
Collection fields = bclass.getFieldList(); if (fields.size() > 0) { oel.add(bclass.toXML());
String prefix = baseObject.getXClass(context).getName() + "_" + baseObject.getNumber() + "_"; Object[] propnames = baseObject.getXClass(context).getFieldList().toArray(); for (int i = 0; i < propnames.length; i++) { String propname = ((PropertyInterface) propnames[i]).getName();
Iterator<PropertyClass> itfields = baseclass.getFieldList().iterator(); while (itfields.hasNext()) { PropertyClass property = itfields.next();
if (bclass.getFieldList().size() > 0) { oel.add(bclass.toXML());
if (bclass.getFieldList().size() > 0) { doc.setXClassXML(bclass.toXMLString()); } else { if ((bclass.getFieldList().size() > 0) && (useClassesTable(true, context))) { saveXWikiClass(bclass, context, false); for (Iterator itf = bclass.getFieldList().iterator(); itf.hasNext();) { PropertyClass prop = (PropertyClass) itf.next();
for (PropertyClass originalProperty : (Collection<PropertyClass>) bclass.getFieldList()) { PropertyClass newProperty = (PropertyClass) originalProperty.clone(); String name = newProperty.getName();
if ((bclass.getFieldList().size() > 0) && (useClassesTable(true, context))) { deleteXWikiClass(bclass, context, false);
if (!xclass.getFieldList().isEmpty()) { ((BaseClassEventGenerator) this.classEventGenerator).write(xclass, filter, documentFilter, properties);
if (bclass.getFieldList().size() > 0) {