private Map<DomainConfigurationUnitType, Map<String, Object>> dynamicPropertiesPerUnit(Object value, PersistentEntity persistentEntity) {
if (!adminConfiguration.isManagedDomainType(persistentEntity.getType())) {
return Collections.emptyMap();
}
DomainTypeAdministrationConfiguration managedDomainTypeConfiguration = adminConfiguration.forManagedDomainType(persistentEntity.getType());
List<DomainConfigurationUnitType> units = newArrayList(LIST_VIEW, FORM_VIEW, SHOW_VIEW, QUICK_VIEW);
List<PersistentProperty> persistentProperties = findPersistentFileProperties(persistentEntity);
List<Association> associations = findLinkableAssociations(persistentEntity);
Map<DomainConfigurationUnitType, Map<String, Object>> dynamicPropertiesPerUnit = newHashMap();
for (DomainConfigurationUnitType unit : units) {
Map<String, Object> dynamicProperties = newLinkedHashMap();
for (PersistentProperty persistentProperty : persistentProperties) {
dynamicProperties.put(persistentProperty.getName(), filePropertyValue(persistentProperty, value));
}
for (Association association : associations) {
dynamicProperties.put(association.getInverse().getName(), associationPropertyValue(association, value));
}
for (FieldMetadata customField : customFields(managedDomainTypeConfiguration.fieldsForUnit(unit))) {
dynamicProperties.put(customField.getUuid(), customField.getValue(value));
}
for (FieldMetadata transientField : transientFields(managedDomainTypeConfiguration.fieldsForUnit(unit))) {
dynamicProperties.put(transientField.getUuid(), transientField.getValue(value));
}
dynamicPropertiesPerUnit.put(unit, dynamicProperties);
}
return dynamicPropertiesPerUnit;