[Bug 14974] New: Use the REST API for cities
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 Bug ID: 14974 Summary: Use the REST API for cities Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 13799, 14888 One of the simplest script in Koha is admin/cities.pl. There is no relationship, very few columns, etc. The script has been rewritten recently (bug 14888) to use Koha::Object[s]. It has been cleaned and is a good candidate to collect the different point of views/implementations possible to use the REST API (bug 13799). Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 [Bug 13799] Add base for building RESTful API http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14888 [Bug 14888] Move the cities related code to Koha::Cities -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 43194 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43194&action=edit Bug 14974: Joubu's try to use the REST API for cities Here's my try. The naive way is to do AJAX calls and redirect to the list after delete/update/add. The main issue is that it does not simplify the code so far... Question: How to display notif to the user after actions (delete/update/add)? How to simplify the swagger file? How to present a search interface? See other comments in the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |In Discussion --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I would be happy to see a try using AngularJS. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz, | |julian.maurice@biblibre.com | |, | |jweaver@bywatersolutions.co | |m, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, | |olli-antti.kivilahti@jns.fi | |, tomascohen@gmail.com --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hi everyone (ccing some people who could be interested in this discussion), Bug 13799 is going to pass the QA step. I think we need to know where we are going and what is the next step. Beside the authentication problem, how could we use the REST API from Koha scripts? I have submitted my naive implementation (see above), but it's not so nice and would like to see what you have in mind. We need to have good basis, write guidelines and impose them, before pushing any patches, IMO. What is suggested on bug 13799 is too light and need a framework to be used efficiently. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle.m.hall@gmail.com --- Comment #4 from Kyle M Hall <kyle.m.hall@gmail.com> --- (In reply to Jonathan Druart from comment #2)
I would be happy to see a try using AngularJS.
Looks good! I've *love* to see an Angular implementation! I think as a best practice we should build our interfaces so they can interact with Angular's $resource service factory with no customization wherever possible ( see http://www.sitepoint.com/creating-crud-app-minutes-angulars-resource/ for example ). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I've posted a followup to the main api bug to showcase using $ref's to split up the specification file, that 'should' help with that side of things a bit. UI wise, I agree we need a good example implementation an I think AngularJS would be a great one to showcase here too. I'm not entirely sure that $resource is still the way to go with angular now, I've asked a colleague (whose spent the best part of the last year shoulder deep in angular) to come in and comment on angular best practice to help guide us. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 Andrew Isherwood <andrew.isherwood@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew.isherwood@ptfs-europ | |e.com --- Comment #6 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Hi all My first posting to the Koha community, exciting stuff! :) As Martin mentioned, I've been working with Angular for about a year, so I'm by no means an expert (Angular is a big beastie), I've got a good feel for ways to do things and how Angular "works". The $resource service is a nice wrapper around the $http service and enables you to create API resource objects that can be interacted with in the traditional CRUD methods. If you're starting from scratch and looking for a consistent way of accessing API resources then it's a good way to go. Although I'm up to my eyeballs at the moment (aren't we all), I'd be happy to offer any guidance if it's all needed. Cheers Andrew ------ Andrew Isherwood Software Developer PTFS Europe Limited Content Management and Library Solutions +44 (0) 20 8123 4257 email: andrew.isherwood@ptfs-europe.com skype: andrewisherwood.ptfseurope web: http://www.ptfs-europe.com/ -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 --- Comment #7 from Kyle M Hall <kyle.m.hall@gmail.com> --- Thanks for your input Andrew! I'm sure any guidance and guidelines you may suggest would be greatly appreciated! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org