Skip to content

Commit

Permalink
Fixed administrative metadata by also taking rightsMD, techMD and sou…
Browse files Browse the repository at this point in the history
…rceMD into account #118
  • Loading branch information
carlosjepard authored and hmiguim committed Jun 16, 2023
1 parent c098058 commit b0a33e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,12 @@ private ReporterDetails validateCSIP31(final StructureValidatorState structureVa
metadataFiles = metadataFiles.entrySet().stream().filter(entry -> !entry.getKey().contains("/descriptive/"))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
for (AmdSecType amd : metsValidatorState.getMets().getAmdSec()) {
for (MdSecType md : amd.getDigiprovMD()) {
final List<MdSecType> allMdSecTypes = new ArrayList<>();
allMdSecTypes.addAll(amd.getDigiprovMD());
allMdSecTypes.addAll(amd.getRightsMD());
allMdSecTypes.addAll(amd.getTechMD());
allMdSecTypes.addAll(amd.getSourceMD());
for (MdSecType md : allMdSecTypes) {
final MdSecType.MdRef mdRef = md.getMdRef();
if (mdRef != null && mdRef.getHref() != null) {
final String hrefDecoded = URLDecoder.decode(mdRef.getHref(), UTF_8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,12 @@ private ReporterDetails validateCSIP17(final StructureValidatorState structureVa
}
if (metadataFiles.containsValue(false)) {
for (AmdSecType amd : mets.getAmdSec()) {
for (MdSecType md : amd.getDigiprovMD()) {
final List<MdSecType> allMdSecTypes = new ArrayList<>();
allMdSecTypes.addAll(amd.getDigiprovMD());
allMdSecTypes.addAll(amd.getRightsMD());
allMdSecTypes.addAll(amd.getTechMD());
allMdSecTypes.addAll(amd.getSourceMD());
for (MdSecType md : allMdSecTypes) {
final MdSecType.MdRef mdRef = md.getMdRef();
if (mdRef != null && mdRef.getHref() != null) {
final String hrefDecoded = URLDecoder.decode(mdRef.getHref(), ENCODING_UTF_8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,12 @@ private ReporterDetails validateCSIP91(final MetsValidatorState metsValidatorSta
final List<String> amdSecIDs = new ArrayList<>();
if (amdSec != null && !amdSec.isEmpty()) {
for (AmdSecType amdSecType : amdSec) {
final List<MdSecType> digiProv = amdSecType.getDigiprovMD();
for (MdSecType mdSecType : digiProv) {
final List<MdSecType> allMDS = new ArrayList<>();
allMDS.addAll(amdSecType.getDigiprovMD());
allMDS.addAll(amdSecType.getRightsMD());
allMDS.addAll(amdSecType.getTechMD());
allMDS.addAll(amdSecType.getSourceMD());
for (MdSecType mdSecType : allMDS) {
amdSecIDs.add(mdSecType.getID());
}
}
Expand Down

0 comments on commit b0a33e8

Please sign in to comment.