Search in sources :

Example 1 with GroupMetadataOverride

use of org.broadleafcommerce.openadmin.dto.override.GroupMetadataOverride in project BroadleafCommerce by BroadleafCommerce.

the class BasicEntityMetadataProvider method overrideMetadataViaXml.

@Override
public MetadataProviderResponse overrideMetadataViaXml(OverrideViaXmlRequest overrideViaXmlRequest, Map<String, TabMetadata> metadata) {
    Map<String, MetadataOverride> overrides = getTargetedOverride(overrideViaXmlRequest.getDynamicEntityDao(), overrideViaXmlRequest.getRequestedConfigKey(), overrideViaXmlRequest.getRequestedCeilingEntity());
    if (overrides != null) {
        for (String overrideKey : overrides.keySet()) {
            MetadataOverride overrideMetadata = overrides.get(overrideKey);
            if (overrideMetadata instanceof GroupMetadataOverride) {
                GroupMetadataOverride groupOverrideMetadata = (GroupMetadataOverride) overrideMetadata;
                applyGroupMetadataOverrideViaXml(overrideKey, groupOverrideMetadata, metadata);
            } else if (!(overrideMetadata instanceof FieldMetadataOverride)) {
                // Strictly applies to a Tab
                applyTabMetadataOverrideViaXml(overrideKey, overrideMetadata, metadata);
            }
        }
    }
    return MetadataProviderResponse.HANDLED;
}
Also used : FieldMetadataOverride(org.broadleafcommerce.openadmin.dto.override.FieldMetadataOverride) GroupMetadataOverride(org.broadleafcommerce.openadmin.dto.override.GroupMetadataOverride) MetadataOverride(org.broadleafcommerce.openadmin.dto.override.MetadataOverride) GroupMetadataOverride(org.broadleafcommerce.openadmin.dto.override.GroupMetadataOverride) FieldMetadataOverride(org.broadleafcommerce.openadmin.dto.override.FieldMetadataOverride) FieldMetadataOverride(org.broadleafcommerce.openadmin.dto.override.FieldMetadataOverride) AdminTabPresentationOverride(org.broadleafcommerce.common.presentation.override.AdminTabPresentationOverride) AdminGroupPresentationOverride(org.broadleafcommerce.common.presentation.override.AdminGroupPresentationOverride) GroupMetadataOverride(org.broadleafcommerce.openadmin.dto.override.GroupMetadataOverride) MetadataOverride(org.broadleafcommerce.openadmin.dto.override.MetadataOverride)

Aggregations

AdminGroupPresentationOverride (org.broadleafcommerce.common.presentation.override.AdminGroupPresentationOverride)1 AdminTabPresentationOverride (org.broadleafcommerce.common.presentation.override.AdminTabPresentationOverride)1 FieldMetadataOverride (org.broadleafcommerce.openadmin.dto.override.FieldMetadataOverride)1 GroupMetadataOverride (org.broadleafcommerce.openadmin.dto.override.GroupMetadataOverride)1 MetadataOverride (org.broadleafcommerce.openadmin.dto.override.MetadataOverride)1