Topic
  • 3 replies
  • Latest Post - ‏2009-03-10T21:42:44Z by bdelima
SystemAdmin
SystemAdmin
123 Posts

Pinned topic Filtering array attributes during compares

‏2009-03-10T15:40:13Z |
I need to filter out attributes that appear as arrays. I get hundreds of these that appear as


displayNames[134]: N/A <=> [lang=..]


I tried a PropertyNameIgnoreFilter as illustrated in the jpg attachment. But this does not eliminate the array.
Updated on 2009-03-10T21:42:44Z at 2009-03-10T21:42:44Z by bdelima
  • SystemAdmin
    SystemAdmin
    123 Posts

    Re: Filtering array attributes during compares

    ‏2009-03-10T17:05:33Z  
    I think I managed to answer my own question by using the built-in "filter-builder." I used a regular expression of

    
    .*::deploymentDescriptor::displayNames::displayNames\[.*\].*
    


    for a PropertyIgnoreMessageFilter and this did the trick.
  • bdelima
    bdelima
    124 Posts

    Re: Filtering array attributes during compares

    ‏2009-03-10T21:31:50Z  
    I think I managed to answer my own question by using the built-in "filter-builder." I used a regular expression of

    <pre class="jive-pre"> .*::deploymentDescriptor::displayNames::displayNames\[.*\].* </pre>

    for a PropertyIgnoreMessageFilter and this did the trick.
    Good job Paul! You figured out a way, so I do think you're getting the hang of it ;-).

    To clarify -

    
    displayNames[134]: N/A <=> [lang=..]   The 
    "N/A <==> [preview text..]" indicates a property instance that is missing entirely from config 1, but present in config 2. The fact the property name ends in 
    "[]" indicates the property is actaully an array of values rather than a single value. So 
    
    this means you have some options -   1. PropertyIgnoreMissingFilter 
    ".*::deploymentDescriptor::displayNames::displayNames\[.*\].*" instructs the comparator to ignore missing instances of the property, but still compare them when they are present in both configs.   2. PropertyNameIgnoreFilter 
    ".*::deploymentDescriptor::displayNames::displayNames\[.*\].*" instructs the comparator to ignore the named property altogether.
    
  • bdelima
    bdelima
    124 Posts

    Re: Filtering array attributes during compares

    ‏2009-03-10T21:42:44Z  
    • bdelima
    • ‏2009-03-10T21:31:50Z
    Good job Paul! You figured out a way, so I do think you're getting the hang of it ;-).

    To clarify -

    <pre class="jive-pre"> displayNames[134]: N/A <=> [lang=..] The "N/A <==> [preview text..]" indicates a property instance that is missing entirely from config 1, but present in config 2. The fact the property name ends in "[]" indicates the property is actaully an array of values rather than a single value. So this means you have some options - 1. PropertyIgnoreMissingFilter ".*::deploymentDescriptor::displayNames::displayNames\[.*\].*" instructs the comparator to ignore missing instances of the property, but still compare them when they are present in both configs. 2. PropertyNameIgnoreFilter ".*::deploymentDescriptor::displayNames::displayNames\[.*\].*" instructs the comparator to ignore the named property altogether. </pre>
    An addendum to my previous post, if you prefer to use the PropertyNameIgnoreFilter for this,
    you can also shorten the property name key to simply -

    
    .*::displayNames::.*
    


    This tell the comparator to ignore any property whose full path has the name "displayNames" somewhere in the middle.