Bug 12754

Summary: Add XSLT action to MARC modification templates
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: MARC Bibliographic data supportAssignee: Marcel de Rooy <m.de.rooy>
Status: ASSIGNED --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12973
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 12973    
Bug Blocks:    
Attachments: Bug 12754: Add XSLT action to MARC modification templates
Bug 12754: Add XSLT action to MARC modification templates
Bug 12754: [TESTING ONLY] dbix update for actions table
Bug 12754: Add run_xslt to MarcModificationTemplates.pm
Bug 12754: Template changes for run_xslt in marc mod templates
Bug 12754: Template changes for run_xslt in marc mod templates
Bug 12754: Perform the actual XSLT action for marc mod template
Bug 12754: [TESTING ONLY] Sample XSLT file for testing

Description Marcel de Rooy 2014-08-13 11:56:03 UTC

    
Comment 1 Marcel de Rooy 2014-08-13 12:07:52 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2014-08-13 13:09:52 UTC
Created attachment 30756 [details] [review]
Bug 12754: Add XSLT action to MARC modification templates

This is the dbrev for this report.
It adds enum run_xslt for the action column.
It adds a new columns run_xslt for the XSLT file to run.

Test plan:
Upgrade via the webinstaller and check table
marc_modification_template_actions.
Comment 3 Marcel de Rooy 2014-08-13 13:09:56 UTC
Created attachment 30757 [details] [review]
Bug 12754: [TESTING ONLY] dbix update for actions table

This patch should not be pushed.
The RM will update the DBIx schema.
Comment 4 Marcel de Rooy 2014-08-13 13:10:00 UTC
Created attachment 30758 [details] [review]
Bug 12754: Add run_xslt to MarcModificationTemplates.pm
Comment 5 Marcel de Rooy 2014-08-13 13:10:03 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2014-08-13 15:02:54 UTC
Still one patch forthcoming that performs the actual xslt action..
Comment 7 Marcel de Rooy 2014-08-14 10:55:04 UTC
Created attachment 30782 [details] [review]
Bug 12754: Template changes for run_xslt in marc mod templates

Adds action 'Run XSLT' to the admin template and script.

Test plan:
Go to Manage MARC modification templates.
Select a template.
Add, edit and delete actions, including the Run XSLT type.
Comment 8 Marcel de Rooy 2014-08-14 10:55:08 UTC
Created attachment 30783 [details] [review]
Bug 12754: Perform the actual XSLT action for marc mod template

This patch modifies MarcModificationTemplates.pm.
A local subroutine _RunXSLTAction is added to perform the actual xslt
transformation using the XSLTHandler object.

Test plan:
Add some XSLT actions to a marc mod template.
Run Stage for Import and select the correct marc mod template.
Check your staged records for the expected changes (you can also view these
reservoir records in Cataloging search).
Comment 9 Marcel de Rooy 2014-08-14 10:55:11 UTC
Created attachment 30784 [details] [review]
Bug 12754: [TESTING ONLY] Sample XSLT file for testing

This test XSLT adds a 500 tag to your record.
Comment 10 Kyle M Hall (khall) 2014-08-14 11:41:34 UTC
Very promising! I have a few suggestions before I would sign it off though:
1) Change the database column name from "run_xslt" to just "xslt". To me "run_xslt" sounds like a boolean, and could cause confusion for future developers.
2) Change the phrase "Run XSLT" to "Apply XSLT", which is a more proper way to describe this in English.
3) The form input for the XSLT code should be a textarea, rather than a single line text input.
4) Please add a formal step by step test plan

With those changes, I think this will make an excellent addition for the modification templates!
Comment 11 Kyle M Hall (khall) 2014-08-14 11:43:21 UTC
Looks like you did add a test plan, I just missed it, so you can scratch point 4!
Comment 12 Marcel de Rooy 2014-08-14 11:43:46 UTC
(In reply to Kyle M Hall from comment #10)
> Very promising! I have a few suggestions before I would sign it off though:
> 1) Change the database column name from "run_xslt" to just "xslt". To me
> "run_xslt" sounds like a boolean, and could cause confusion for future
> developers.
> 2) Change the phrase "Run XSLT" to "Apply XSLT", which is a more proper way
> to describe this in English.
> 3) The form input for the XSLT code should be a textarea, rather than a
> single line text input.
> 4) Please add a formal step by step test plan
> 
> With those changes, I think this will make an excellent addition for the
> modification templates!

Will do that.
About point 3: The single line of text refers to a filename instead of the actual xslt code.
Comment 13 Kyle M Hall (khall) 2014-08-14 13:30:38 UTC
(In reply to M. de Rooy from comment #12)
> (In reply to Kyle M Hall from comment #10)
> > Very promising! I have a few suggestions before I would sign it off though:
> > 1) Change the database column name from "run_xslt" to just "xslt". To me
> > "run_xslt" sounds like a boolean, and could cause confusion for future
> > developers.
> > 2) Change the phrase "Run XSLT" to "Apply XSLT", which is a more proper way
> > to describe this in English.
> > 3) The form input for the XSLT code should be a textarea, rather than a
> > single line text input.
> > 4) Please add a formal step by step test plan
> > 
> > With those changes, I think this will make an excellent addition for the
> > modification templates!
> 
> Will do that.
> About point 3: The single line of text refers to a filename instead of the
> actual xslt code.

Is this a reference to a file on the server? Would it not be easier to store the code in the database so it can be viewed and edited from the template editor?
Comment 14 Marcel de Rooy 2014-08-14 15:45:52 UTC
(In reply to Kyle M Hall from comment #13)
> Is this a reference to a file on the server? Would it not be easier to store
> the code in the database so it can be viewed and edited from the template
> editor?

Yes, it refers to a file. But we could offer both approaches..
Comment 15 Kyle M Hall (khall) 2014-08-15 11:41:18 UTC
(In reply to M. de Rooy from comment #14)
> (In reply to Kyle M Hall from comment #13)
> > Is this a reference to a file on the server? Would it not be easier to store
> > the code in the database so it can be viewed and edited from the template
> > editor?
> 
> Yes, it refers to a file. But we could offer both approaches..

I think that would be for the best!
Comment 16 Marcel de Rooy 2014-08-19 11:24:56 UTC
Status back to Assigned. Will send some changes soon.
Comment 17 Owen Leonard 2016-03-25 15:20:19 UTC
This will require rebasing since Bug 15867 was pushed.