protected boolean mergeMetaData ( final KeyValueNode < ? > metaData , final CSNodeWrapper metaDataEntity ) { boolean changed = false ; // Meta Data Value final Object value = metaData . getValue ( ) ; if ( metaData instanceof FileList ) { if ( metaDataEntity . getAdditionalText ( ) != null ) { metaDataEntity . setAdditionalText ( null ) ; changed = true ; } } else { if ( metaDataEntity . getAdditionalText ( ) == null || ! metaDataEntity . getAdditionalText ( ) . equals ( value . toString ( ) ) ) { metaDataEntity . setAdditionalText ( value . toString ( ) ) ; changed = true ; } } // Node Type if ( metaDataEntity . getNodeType ( ) != null ) { if ( value instanceof SpecTopic && ! metaDataEntity . getNodeType ( ) . equals ( CommonConstants . CS_NODE_META_DATA_TOPIC ) ) { metaDataEntity . setNodeType ( CommonConstants . CS_NODE_META_DATA_TOPIC ) ; } else if ( ! ( value instanceof SpecTopic ) && ! metaDataEntity . getNodeType ( ) . equals ( CommonConstants . CS_NODE_META_DATA ) ) { metaDataEntity . setNodeType ( CommonConstants . CS_NODE_META_DATA ) ; } } // Set the Topic details if the Meta Data is a Spec Topic if ( value instanceof SpecTopic ) { if ( mergeTopic ( ( SpecTopic ) value , metaDataEntity ) ) { changed = true ; } } // Meta Data Title if ( metaDataEntity . getTitle ( ) == null || ! metaDataEntity . getTitle ( ) . equals ( metaData . getKey ( ) ) ) { metaDataEntity . setTitle ( metaData . getKey ( ) ) ; changed = true ; } return changed ; }
Merges a Content Specs meta data with a Content Spec Entities meta data