public static function getMetadataByWebForm(ContactWebForm $contactWebForm)
 {
     assert('$contactWebForm instanceof ContactWebForm');
     $contactWebFormAttributes = array_keys(ContactWebFormsUtil::getPlacedAttributes($contactWebForm));
     $contactWebFormAttributes = ContactWebFormsUtil::excludeHiddenAttributes($contactWebForm, $contactWebFormAttributes);
     $viewClassName = 'ContactExternalEditAndDetailsView';
     $moduleClassName = 'ContactsModule';
     $modelClassName = $moduleClassName::getPrimaryModelName();
     $editableMetadata = $viewClassName::getMetadata();
     $designerRules = new EditAndDetailsViewDesignerRules();
     $modelAttributesAdapter = DesignerModelToViewUtil::getModelAttributesAdapter($viewClassName, $modelClassName);
     $derivedAttributesAdapter = new DerivedAttributesAdapter($modelClassName);
     $attributeCollection = array_merge($modelAttributesAdapter->getAttributes(), $derivedAttributesAdapter->getAttributes());
     $attributesLayoutAdapter = AttributesLayoutAdapterUtil::makeAttributesLayoutAdapter($attributeCollection, $designerRules, $editableMetadata);
     $layoutMetadataAdapter = new LayoutMetadataAdapter($viewClassName, $moduleClassName, $editableMetadata, $designerRules, $attributesLayoutAdapter->getPlaceableLayoutAttributes(), $attributesLayoutAdapter->getRequiredDerivedLayoutAttributeTypes());
     $metadata = $layoutMetadataAdapter->resolveMetadataFromSelectedListAttributes($viewClassName, $contactWebFormAttributes);
     foreach ($metadata['global']['panels'][0]['rows'] as $index => $data) {
         if ($data['cells'][0]['elements'][0]['type'] == 'EmailAddressInformation') {
             $metadata['global']['panels'][0]['rows'][$index]['cells'][0]['elements'][0]['hideOptOut'] = true;
         }
         if ($data['cells'][0]['elements'][0]['type'] == 'TagCloud') {
             $metadata['global']['panels'][0]['rows'][$index]['cells'][0]['elements'][0]['type'] = 'MultiSelectDropDown';
         }
     }
     return $metadata;
 }