Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring multi-file media to create files like we do for other der… #816

Merged
merged 2 commits into from
Dec 11, 2020

Conversation

dannylamb
Copy link

…ivatives

Related issue: Islandora/documentation#1731

What does this Pull Request do?

Refactors to use the same method of creating files for "regular" derivatives when generating "multi-file media" derivatives.

What's new?

Not much. Just made another function in the service, copy/pasted from other bits, and call that function from controller.

How should this be tested?

  • Make a new media type and give it
    • A source field
    • Another file field to hold the derivative (I called mine field_derivative_file) and made sure it could accept xml files
    • The media_of field
  • Make a new 'Generate a derivative file for Media Attachment' action. I configured mine to run FITS on the source field like so:
    • Queue Name -> islandora-connector-fits
    • Destination Field File Name -> field_derivative_file
    • Mimetype -> application/xml
    • File Path -> [date:custom:Y]-[date:custom:m]/[media:mid]-fits.xml
  • Make a context to pull it all together
    • Condition -> Check for the new media type with the entity_bundle condition
    • Reaction -> Derive File for Existing Media with the new action you just made
  • Make a repository item, give it a new media of the type you just created
  • The field_derivative_file should be populated with FITS XML

Interested parties

@ajstanley @Islandora/8-x-committers

Copy link

@ajstanley ajstanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good.

Copy link

@ajstanley ajstanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicked the right button this time.

@dannylamb
Copy link
Author

Just pushed some coding standards fixes. Hopefully I can appease Travis.

@elizoller
Copy link
Member

@ajstanley can we get a merge? :D

@elizoller elizoller mentioned this pull request Dec 11, 2020
@ajstanley ajstanley merged commit 792b3d3 into 8.x-1.x Dec 11, 2020
@dannylamb dannylamb deleted the fix-multifile-media branch December 14, 2020 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants