Skip to content

Commit

Permalink
Merge pull request #2 from jembi/objectrefs-fix
Browse files Browse the repository at this point in the history
Fixes objectref handling in GetSubmissionSetAndContents
  • Loading branch information
rcrichton committed Dec 7, 2015
2 parents 0fe5269 + d63fc8b commit a19c209
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,20 @@ public Metadata runImplementation() throws XdsException, LoggerException,
metadata.rmDuplicates();

// some document may have been filtered out, remove the unnecessary Associations
// first collect all the content ids that we want to keep...
List<String> content_ids = new ArrayList<String>();
content_ids.addAll(metadata.getSubmissionSetIds());
content_ids.addAll(metadata.getExtrinsicObjectIds());
content_ids.addAll(metadata.getFolderIds());
content_ids.addAll(metadata.getObjectRefIds());

// add in Associations that link the above parts
content_ids.addAll(metadata.getIds(metadata.getAssociationsInclusive(content_ids)));

// Assocs can link to Assocs to so repeat
content_ids.addAll(metadata.getIds(metadata.getAssociationsInclusive(content_ids)));

// ... Now, filter out all metadata that isn't in this id list
metadata.filter(content_ids);

return metadata;
Expand Down

0 comments on commit a19c209

Please sign in to comment.