[Bug 39466] New: Add plugins/js directory
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 Bug ID: 39466 Summary: Add plugins/js directory Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org See also bug 39435. We need a folder to store js associated with a plugin. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 179758 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179758&action=edit Bug 39466: Add plugins/js folder, add access in Apache Test plan: Run the adjusted koha-create-dirs (or copy it to sbin and run koha-create) and verify folder creation. Remove the folders (manually or use koha-remove in case you used koha-create). Create the js folder in your own /var/lib/koha/YOUR_INSTANCE/plugins folder. (Optionally, chmod 550 it.) Copy the change in the apache-shared file into your /etc/koha counterpart. Restart Apache. Touch /var/lib/koha/YOUR_INSTANCE/plugins/js/test.txt. Verify that you can reach it with URL /plugins/js/test.txt. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39435 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #2 from David Cook <dcook@prosentient.com.au> --- I'm not sure that I understand this one. Could you elaborate on it a bit more? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #2)
I'm not sure that I understand this one. Could you elaborate on it a bit more?
On the other bug a plugin sends back html which could include a js link to a script in this plugin folder. This js is not part of Koha, but part of the plugin. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #3)
(In reply to David Cook from comment #2)
I'm not sure that I understand this one. Could you elaborate on it a bit more?
On the other bug a plugin sends back html which could include a js link to a script in this plugin folder. This js is not part of Koha, but part of the plugin.
But how would the Javascript get into this folder? It seems like it would have to be manually set up? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #4)
(In reply to Marcel de Rooy from comment #3)
(In reply to David Cook from comment #2)
I'm not sure that I understand this one. Could you elaborate on it a bit more?
On the other bug a plugin sends back html which could include a js link to a script in this plugin folder. This js is not part of Koha, but part of the plugin.
But how would the Javascript get into this folder? It seems like it would have to be manually set up?
Yes we need some adjustment in the plugin install. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #5)
Yes we need some adjustment in the plugin install.
I don't know that it will work, since there's lots of different ways to deploy the plugins. For instance, I actually separate my plugins into /var/lib/koha/<instance>/<plugin_name> and add them as separate pluginsdir entries, as I find this makes it much easier to manage them. Some people point to places like /opt/all_my_koha_plugins and stuff like that. For the Javascript, you could use the "static_routes" plugin hook. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Cook from comment #6)
(In reply to Marcel de Rooy from comment #5)
Yes we need some adjustment in the plugin install.
I don't know that it will work, since there's lots of different ways to deploy the plugins.
For instance, I actually separate my plugins into /var/lib/koha/<instance>/<plugin_name> and add them as separate pluginsdir entries, as I find this makes it much easier to manage them. Some people point to places like /opt/all_my_koha_plugins and stuff like that.
For the Javascript, you could use the "static_routes" plugin hook.
Ok, didnt think about the static_routes here. But it might still be easier and faster to serve directly from this plugins/js folder. When installing copy js files to that folder, and when uninstalling remove the same files again there. For common js libraries, we could define a dedicated plugin that only serves to install those common js files? Or even call it plugins/static and copy whatever you have in [your_plugin]/static to the common folder? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #7)
Ok, didnt think about the static_routes here. But it might still be easier and faster to serve directly from this plugins/js folder.
That's true.
When installing copy js files to that folder, and when uninstalling remove the same files again there.
Maybe but that would be a big shift in how plugins work I think. It would be interesting to see what heavy plugin users thing of that. Actually, I like the idea of changing how plugin deployments work. Honestly, I think I might prefer a system where plugin code got copied/moved at install/uninstall time. (Not just the JS but all of it.) Food for tought...
For common js libraries, we could define a dedicated plugin that only serves to install those common js files?
Or even call it plugins/static and copy whatever you have in [your_plugin]/static to the common folder?
I'm not sure that I understand what you're saying here. If we did standardize the location of plugins, and install them under a plugin name (after all we already define namespaces in up-to-date plugins), we could use "AliasMatch" to serve static files out of /var/lib/<koha>/pluginsv2/<koha_plugin_namespace>/static or /var/lib/<koha>/pluginsv2/<koha_plugin_namespace>/public -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179758|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39466 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |LATER --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Closing this one for now. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org