Skip to content

Commit

Permalink
Update EDRM.MIH.profile
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlstewart authored Oct 6, 2022
1 parent 1515724 commit 34f7b01
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions EDRM.MIH.profile
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@
<metadata type="SPECIAL" name="EDRM MIH Hash">
<scripted-expression>
<type>ruby</type>
<script><![CDATA[begin
item = $current_item
require 'digest'
metadata_profile_name = "RFC5322 Message ID"
metadata_profile = $utilities.getMetadataProfileStore.getMetadataProfile(metadata_profile_name)
edrm_mih_hash = ""
metadata_profile.getMetadata.each do |field|
field_value = field.evaluate(item)
if field_value == ""
edrm_mih_hash = "null"
else
edrm_mih_hash = Digest::MD5.hexdigest field_value
edrm_mih_hash = edrm_mih_hash.upcase
end
end
edrm_mih_hash
rescue
""
<script><![CDATA[begin
item = $current_item
require 'digest'
metadata_profile_name = "RFC5322 Message ID"
metadata_profile = $utilities.getMetadataProfileStore.getMetadataProfile(metadata_profile_name)
edrm_mih_hash = ""
edrm_spec_first_value = ""
metadata_profile.getMetadata.each do |field|
field_value = field.evaluate(item)
if field_value == ""
edrm_mih_hash = "null"
else
edrm_spec_first_value = field_value.match /^(.*?\>)/
edrm_mih_hash = Digest::MD5.hexdigest edrm_spec_first_value.to_s
edrm_mih_hash = edrm_mih_hash.upcase
end
end
edrm_mih_hash
rescue
""
end]]></script>
</scripted-expression>
</metadata>
Expand Down

0 comments on commit 34f7b01

Please sign in to comment.