Changeset 6687
- Timestamp:
- Jan 20, 2015, 3:45:46 PM (8 years ago)
- Location:
- trunk/src/clients/web/net/sf/basedb/clients/web/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/plugins/ExportedProperty.java
r6030 r6687 44 44 public final String title; 45 45 public final AnnotationType annotationType; 46 public final boolean loadInherited; 46 47 public final Unit unit; 47 48 public final Formatter formatter; … … 52 53 { 53 54 PropertyPath propertyPath = metadata.getPropertyPath(path, false); 54 return new ExportedProperty(path, title, propertyPath, null, null, formatter, null);55 return new ExportedProperty(path, title, propertyPath, null, false, null, formatter, null); 55 56 } 56 57 … … 67 68 String title = p.length > 2 ? p[2] : p[0]; 68 69 AnnotationType at = null; 70 boolean loadInherited = false; 69 71 Unit unit = null; 70 72 String columnSuffix = null; … … 72 74 if (name.startsWith("#") && annotatable) // && itemType != Item.SPOTDATA) 73 75 { 76 loadInherited = name.startsWith("##"); 74 77 // Annotation: properties[i] = #annotationTypeId 75 int annotationTypeId = Values.getInt( name.substring(1));78 int annotationTypeId = Values.getInt(loadInherited ? name.substring(2) : name.substring(1)); 76 79 at = AnnotationType.getById(dc, annotationTypeId); 77 80 name = "annotationtype_"+annotationTypeId; … … 89 92 if (columnPrefix != null) title = columnPrefix + title; 90 93 if (columnSuffix != null) title += columnSuffix; 91 return new ExportedProperty(name, title, propertyPath, at, unit, formatter, dataloader);94 return new ExportedProperty(name, title, propertyPath, at, loadInherited, unit, formatter, dataloader); 92 95 } 93 96 … … 95 98 @since 2.15 96 99 */ 97 p ublicExportedProperty(String name, String title, PropertyPath propertyPath,98 AnnotationType annotationType, Unit unit, Formatter formatter, DataLoader dataloader)100 private ExportedProperty(String name, String title, PropertyPath propertyPath, 101 AnnotationType annotationType, boolean loadInherited, Unit unit, Formatter formatter, DataLoader dataloader) 99 102 { 100 103 this.name = name; … … 102 105 this.propertyPath = propertyPath; 103 106 this.annotationType = annotationType; 107 this.loadInherited = loadInherited; 104 108 this.formatter = formatter == null ? new ToStringFormatter() : formatter; 105 109 this.unit = unit; -
trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java
r6567 r6687 582 582 if (ep.annotationType != null) 583 583 { 584 List <?>values = null;584 List values = null; 585 585 String unitSymbol = null; 586 586 if (ep.dataloader == null) … … 589 589 { 590 590 filter.setAnnotationType(ep.annotationType); 591 List<AnnotationSnapshot> s = manager.findAnnotations(dc, snapshot, filter, false);592 if ( s.size() == 1)591 List<AnnotationSnapshot> list = manager.findAnnotations(dc, snapshot, filter, !ep.loadInherited, ep.loadInherited); 592 if (list.size() > 0) 593 593 { 594 594 Unit defaultUnit = ep.annotationType.getDefaultUnit(); 595 Type valueType = ep.annotationType.getValueType(); 595 596 UnitConverter unitConverter = null; 596 597 if (defaultUnit != null) … … 599 600 if (ep.unit == null) unitSymbol = defaultUnit.getDisplaySymbol(); 600 601 } 601 values = s.get(0).getValues(unitConverter, ep.annotationType.getValueType()); 602 values = new ArrayList(); 603 for (AnnotationSnapshot s : list) 604 { 605 values.addAll(s.getValues(unitConverter, valueType)); 606 } 602 607 } 603 608 }
Note: See TracChangeset
for help on using the changeset viewer.