Re: [Koha-devel] Marseille16 / REST api

2016-10-11 Thread David Cook
Really curious to see how this plays out!

 

I’ve just added parameter validation to a Koha::Object, and while it works well 
enough, I’m hoping for a more generalized solution. I haven’t looked at 
Koha::Exceptions::* yet, but maybe that will help.

 

Peeking at Koha::Exceptions::MissingParameter, I hope that there’s more 
specificity than just “A required parameter is missing”. I’d want to know which 
required parameter is missing. 

 

Is there a document somewhere saying how to use Koha::Exceptions?

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Direct: 02 8005 0595

 

From: koha-devel-boun...@lists.koha-community.org 
[mailto:koha-devel-boun...@lists.koha-community.org] On Behalf Of Tomas Cohen 
Arazi
Sent: Wednesday, 12 October 2016 2:39 AM
To: koha-devel 
Subject: [Koha-devel] Marseille16 / REST api

 

During the first couple Hackfest days, Jonathan, Benjamin and I worked on a 
reference implementation of CRUD code for a REST endpoint, so others can read 
it, discuss it and use it as a reference for their own developments.

 

We worked on Koha::Cit(y|ies) because it was a really simple class. All our 
work is now on bug 17428.

 

The main goals/concepts we tried to apply were:

* Controller class (Koha::REST::V1::Cities) should be as simple as possible. No 
business logic on it. All business logic is expected to be put on the 
Koha::Cit(ies|y) classes. And fully tested.

* All verbs/use cases should be covered by tests 
(t/db_dependent/api/v1/cities.t). We did it, and this file could be used (with 
little adjustments) as the basis for new endpoint tests.

* Heavy use of exceptions. I wouldn't say we heavily use them, but the point is 
that we pass everything to the business object, and catch exceptions it might 
raise. Martin pointed out that he would help us further simplify it, making 
heavier use of the Swagger plugin's facilities. Specially on parameters sanity 
check. More on this tomorrow!

* Koha::Exceptions got per-class files so the exceptions file is more 
manageable. Bug 17425 introduced Koha/Exceptions/Object.pm, and we propose 
that's the way to go (Koha/Exceptions.pm still has Virtualshelves-related 
exceptions that should be moved).

* Make use of Try::Tiny for try/catch blocks. On the process we wrote bug 
17425, which introduces new exceptions, we added the dependency for Try::Tiny 
(no worries, it is packaged for Jessie/Ubuntu) and Mirko was here to validate.

* Moving business-logic to Koha:: namespace and write REST endpoints on top of 
that business objects. We picked a simple object, Koha::Patron(s) will be a 
more complex one of course. This is what Jonathan has been doing, and people 
willing to write REST endpoints should check with him, and probably help moving 
business logic into Koha:: namespace.

 

There are several patches on bugzilla introducing endpoints. We will try to 
contact patch authors to help them make their work match this proposed 
'guidelines'.

 

We are sticking to the 'patches speak' approach, so feel free to criticize this 
implementation, to improve it or even provide a counter-proposal. We are 
otherwise moving on, trying to get a functional complete REST api ASAP.

 

Thanks!

 

Tomas, Jonathan, Benjamin

 

 

 

-- 

Tomás Cohen Arazi

Theke Solutions (https://theke.io  )
✆ +54 9351 3513384
GPG: B2F3C15F

___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-devel] Trying to generate the package.

2016-10-11 Thread Rodrigo Santellan
Hi,

I'm trying to generate the package to learn how to so can I apply it later.

I follow:
https://wiki.koha-community.org/wiki/Building_Debian_Packages_-_The_Easy_Way
on the kohadevbox (jessie) but when I try to generate the package this
message appear: W: /home/vagrant/.pbuilderrc does not exist

I have to said that I change he file: build-git-snapshot the line 32 to my
$distribution='testing'; because of this warning:

dch --force-distribution -D "squeeze-dev" -v
"16.05.04git+20161011182826.70be2835" "Building git snapshot."
dch warning: Recognised distributions are: unstable, testing, stable,
oldstable, experimental, {testing-,stable-,oldstable-,}proposed-updates,
{testing,stable,oldstable}-se

And the error I have is:

vagrant@kohadevbox:kohaclone(origin/local-16.05.X)$ sudo -E
./debian/build-git-snapshot -r ~/debian -v 16.05.04git -d
git status --porcelain -unormal
git rev-parse --short=8 HEAD
dch --force-distribution -D "squeeze-dev" -v
"16.05.04git+20161011182826.70be2835" "Building git snapshot."
dch warning: Recognised distributions are: unstable, testing, stable,
oldstable, experimental, {testing-,stable-,oldstable-,}proposed-updates,
{testing,stable,oldstable}-security, wheezy-backports, jessie-backports and
UNRELEASED.
Using your request anyway.
dch -r "Building git snapshot."
git archive --format=tar
--prefix="koha-16.05.04git+20161011182826.70be2835/" HEAD | gzip -9 >
"../koha_16.05.04git+20161011182826.70be2835.tar.gz"
pdebuild  --buildresult /home/vagrant/debian
W: /home/vagrant/.pbuilderrc does not exist
dpkg-checkbuilddeps: warning: relation < is deprecated: use << or <=
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package koha
dpkg-buildpackage: source version 16.05.04git+20161011182826.70be2835
dpkg-buildpackage: source distribution squeeze-dev
dpkg-buildpackage: source changed by root 
 dpkg-source --before-build kohaclone
dpkg-source: warning: relation < is deprecated: use << or <=
dpkg-checkbuilddeps: warning: relation < is deprecated: use << or <=
 fakeroot debian/rules clean
dh clean --fail-missing --with bash-completion
   dh_testdir -O--fail-missing
   dh_auto_clean -O--fail-missing
make[1]: Entering directory '/home/vagrant/kohaclone'
make[1]: *** No rule to make target
'/usr/lib/x86_64-linux-gnu/perl/5.22/Config.pm', needed by 'Makefile'.
Stop.
make[1]: Leaving directory '/home/vagrant/kohaclone'
dh_auto_clean: make -j1 distclean returned exit code 2
Command 'pdebuild  --buildresult /home/vagrant/debian' returns an error
(512)
debian/rules:9: recipe for target 'clean' failed
make: *** [clean] Error 2
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit
status 2

Where can I look for information about this?

Regards
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-devel] Marseille16 / REST api

2016-10-11 Thread Tomas Cohen Arazi
During the first couple Hackfest days, Jonathan, Benjamin and I worked on a
reference implementation of CRUD code for a REST endpoint, so others can
read it, discuss it and use it as a reference for their own developments.

We worked on Koha::Cit(y|ies) because it was a really simple class. All our
work is now on bug 17428.

The main goals/concepts we tried to apply were:
* Controller class (Koha::REST::V1::Cities) should be as simple as
possible. No business logic on it. All business logic is expected to be put
on the Koha::Cit(ies|y) classes. And fully tested.
* All verbs/use cases should be covered by tests
(t/db_dependent/api/v1/cities.t). We did it, and this file could be used
(with little adjustments) as the basis for new endpoint tests.
* Heavy use of exceptions. I wouldn't say we heavily use them, but the
point is that we pass everything to the business object, and catch
exceptions it might raise. Martin pointed out that he would help us further
simplify it, making heavier use of the Swagger plugin's facilities.
Specially on parameters sanity check. More on this tomorrow!
* Koha::Exceptions got per-class files so the exceptions file is more
manageable. Bug 17425 introduced Koha/Exceptions/Object.pm, and we propose
that's the way to go (Koha/Exceptions.pm still has Virtualshelves-related
exceptions that should be moved).
* Make use of Try::Tiny for try/catch blocks. On the process we wrote
bug 17425, which introduces new exceptions, we added the dependency for
Try::Tiny (no worries, it is packaged for Jessie/Ubuntu) and Mirko was here
to validate.
* Moving business-logic to Koha:: namespace and write REST endpoints on top
of that business objects. We picked a simple object, Koha::Patron(s) will
be a more complex one of course. This is what Jonathan has been doing, and
people willing to write REST endpoints should check with him, and probably
help moving business logic into Koha:: namespace.

There are several patches on bugzilla introducing endpoints. We will try to
contact patch authors to help them make their work match this proposed
'guidelines'.

We are sticking to the 'patches speak' approach, so feel free to criticize
this implementation, to improve it or even provide a counter-proposal. We
are otherwise moving on, trying to get a functional complete REST api ASAP.

Thanks!

Tomas, Jonathan, Benjamin



-- 
Tomás Cohen Arazi
Theke Solutions (https://theke.io )
✆ +54 9351 3513384
GPG: B2F3C15F
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] What's on in Koha devel #5 - Special hk16

2016-10-11 Thread SUZUKI Arthur

Hello,

I've just seen there is some chat about plugins.

I wanted to add to Opac-details a list of "patron who issued this book 
also issued *** " doing such the Amazon/Ebay way of advertising resources.


I've experimented a little with the Plugin functionnality, I tried to 
write a "Recommendation" plugin based on old issue analysis.


The code is here : https://github.com/Liliputech/KohaReadSuggestion

It kind of works, however I stumbled on a little problem.

It seems not possible to run a plugin publicly (like public reports), 
one has to be connected to execute a plugin, right? Do you see any mean 
to overcome this limitation?


Thanks a lot in advance for your answers

Best regards and happy HackFest!

Arthur

Le 08/10/2016 à 14:25, Kyle Hall a écrit :


Thanks for the overview Jonathan! I know I for one have the react 
discussion as a top priority for the jacket.


Kyle

Sent from my phone. Please excuse my brevity.


On Oct 8, 2016 2:20 PM, "Jonathan Druart" 
> wrote:


Hello librarians and developers,

I send a "What's on in Koha devel" email to koha-devel list each
month. But this one is a bit special as I will focus on the different
subjects you may heard of if you attend the hackfest in Marseille next
week.
It can be helpful for both librarians and developers!

A lot of things are going on in the Koha ecosystem so it might be hard
to follow all the discussions or to jump into one.

So my attempted goal here is to compile the topics currently "à la
mode" for Koha developers.
In this email I will go a bit more into details than usual, to let you
the opportunity to better understand the themes and to ask questions
next week if you want to know more. I hope it will help you to choose
the subject you want to be involved in during the hackfest.

= Sandboxes =

Sandboxes have been developed with the aim to help people without any
technical skills to test patches submitted on the Koha bugtracker.
You will find all the information you want on the dedicated wiki page
https://wiki.koha-community.org/wiki/Sandboxes


= Refactoring =
During the last 3 (more?) years we have integrated DBIx::Class (a Perl
ORM, Object-Relationnal Mapping) into Koha, for several (sometimes
disputed) reasons.
To take advantage of it, we are using it as much as possible through a
home-made object module called Koha::Object.
For the last year, a lot of legacy code has been rewritten and moved
out of the C4 namespace to the new Koha namespace. For instance
Koha::Virtualshelves replaced C4::VirtualShelves::Page (bug 14544),
Koha::Libraries replaces C4::Branch (bug 15293).
At the moment, the job focusses on moving the legacy authorised values
from the C4::Koha module to Koha::AuthorisedValues (bug 15799) and the
patrons/borrowers/users/members code from C4::Members to Koha::Patrons
(bug 16846).
For an overview of this refactoring work, please have a look at bug
15449 and its scary dependency graph:
https://bugs.koha-community.org/bugzilla3/showdependencygraph.cgi?id=15449


Another refactoring work is about moving the biblioitems.marcxml
content out of the biblioitems table. The idea is to create another
table (biblio_metadata) to add the ability to store a record in
different formats. The direct and major addition of this move would be
to bring performance speed. See the comment 1 of bug 17196 for more
information.

= Speed improvements =

During the last 2 releases, we have made a lot of speed improvements.
That has been achieve with the consolidation and the stabilisation of
our caching system and plack integration.
If you are running a recent version of Koha (3.22, 16.05 or later) you
should set them up correctly to fully enjoy the improvement. To be
fair I must say that we have had to concentrate our efforts on these
points because of our previous technical decisions (mainly related to
DBIx::Class).
Two main playgrounds: Plack and Memcached, that I will explain now.

== Plack ==
I bet you already have heard of Plack, because Koha developers have
been talking about it for ages.
Basically it is just an interface between the web server (Apache,
starman, etc.) and the perl application (Koha).
When a user hits the a Koha url, a lot of files (Perl modules) are
compiled. In CGI mode, this compilation step is done for every
request. Using Plack they are compiled only once. The code will be put
in RAM and other requests won't need to process all the modules again.
It is an advantage since we are using DBIx::Class more and more and
its schema is heavy to load. With 

Re: [Koha-devel] Pending 16.11 Release Dates

2016-10-11 Thread Kyle Hall
Ack! Thanks for the correction Marcel, I thought I had caught those typos!

Kyle



http://www.kylehall.info
ByWater Solutions ( http://bywatersolutions.com )
Meadville Public Library ( http://www.meadvillelibrary.org )
Crawford County Federated Library System ( http://www.ccfls.org )

On Tue, Oct 11, 2016 at 5:03 PM, Marcel de Rooy 
wrote:

> Just a minor(?) detail:
>
> If master is now 16.06, 16.12 should be the new master after releasing
> 16.11 ?
>
>
> Marcel
> --
> *Van:* koha-devel-boun...@lists.koha-community.org <
> koha-devel-boun...@lists.koha-community.org> namens Kyle Hall <
> kyle.m.h...@gmail.com>
> *Verzonden:* dinsdag 11 oktober 2016 17:00:27
> *Aan:* Koha; Koha Devel
> *Onderwerp:* [Koha-devel] Pending 16.11 Release Dates
>
> Hey All,
>
> It's that time of the year again! Here is the timeline Brendan and I have
> mapped out for the pending Koha 16.11 release:
>
> Nov 1st - Feature Slush
>
> For the uninitiated, the slush means that no new enhancements, only bug
> fixes, will be pushed to master until some time after the 16.11 release.
> During the slush phase bug fixes may include template string changes that
> will require translation.
>
> Nov 3 - 1st Draft of release notes
>
> The 1st draft of the 16.12 release notes will be published and made
> available so corrections may be submitted.
>
> Nov 10 - 2nd Draft of release notes
>
> Nov 15th - Feature Freeze
>
> From November 15 until the release date, only bug fixes without string
> changes will be pushed to master.
>
> Nov 17 - Final Draft of release notes
>
> Nov 22 - 16.12 Release Day!
>
> Kyle
>
> http://www.kylehall.info
> ByWater Solutions ( http://bywatersolutions.com )
>
>
> ___
> Koha-devel mailing list
> Koha-devel@lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
>
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Pending 16.11 Release Dates

2016-10-11 Thread Marcel de Rooy
Just a minor(?) detail:

If master is now 16.06, 16.12 should be the new master after releasing 16.11 ?


Marcel


Van: koha-devel-boun...@lists.koha-community.org 
 namens Kyle Hall 

Verzonden: dinsdag 11 oktober 2016 17:00:27
Aan: Koha; Koha Devel
Onderwerp: [Koha-devel] Pending 16.11 Release Dates

Hey All,

It's that time of the year again! Here is the timeline Brendan and I have 
mapped out for the pending Koha 16.11 release:

Nov 1st - Feature Slush

For the uninitiated, the slush means that no new enhancements, only bug fixes, 
will be pushed to master until some time after the 16.11 release. During the 
slush phase bug fixes may include template string changes that will require 
translation.

Nov 3 - 1st Draft of release notes

The 1st draft of the 16.12 release notes will be published and made available 
so corrections may be submitted.

Nov 10 - 2nd Draft of release notes

Nov 15th - Feature Freeze

>From November 15 until the release date, only bug fixes without string changes 
>will be pushed to master.

Nov 17 - Final Draft of release notes

Nov 22 - 16.12 Release Day!

Kyle

http://www.kylehall.info
ByWater Solutions ( http://bywatersolutions.com )

___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

[Koha-devel] Pending 16.11 Release Dates

2016-10-11 Thread Kyle Hall
Hey All,

It's that time of the year again! Here is the timeline Brendan and I have
mapped out for the pending Koha 16.11 release:

Nov 1st - Feature Slush

For the uninitiated, the slush means that no new enhancements, only bug
fixes, will be pushed to master until some time after the 16.11 release.
During the slush phase bug fixes may include template string changes that
will require translation.

Nov 3 - 1st Draft of release notes

The 1st draft of the 16.12 release notes will be published and made
available so corrections may be submitted.

Nov 10 - 2nd Draft of release notes

Nov 15th - Feature Freeze

>From November 15 until the release date, only bug fixes without string
changes will be pushed to master.

Nov 17 - Final Draft of release notes

Nov 22 - 16.12 Release Day!

Kyle

http://www.kylehall.info
ByWater Solutions ( http://bywatersolutions.com )
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Re: [Koha-devel] Sandboxes are up

2016-10-11 Thread Fridolin SOMERS

Hie,

Please do not use sandboxes for Signoff yet, there is a problem.
The patch file is not attached to ticket.

Regards,

Le 10/10/2016 à 14:12, Fridolin SOMERS a écrit :

Hie,

Since a few weeks our sandboxes are down.

We have created a new system with Ubuntu Xenial machines.
The virtualisation LXD allows unlimited cloning.

See
https://wiki.koha-community.org/wiki/Sandboxes#BibLibre

Best regards,



--
Fridolin SOMERS
Biblibre - Pôles support et système
fridolin.som...@biblibre.com
___
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/