feasibility of external circulation updating Koha items table availability
We're implementing Aeon (a paging system that can handle requests for individual manuscript items from EAD finding aids as well as requests for mongraphs/serials) alongside Koha and we want to be able to display item availability in Koha. Since we're not using Koha's circulation system, we'll need to link Aeon and Koha so that an item checkout from Aeon sends a database UPDATE call to Koha and updates items.onloan with the desired due date (or at least, that's what I've been able to sort out by poking around). First, am I correct that updating the availability status of an item in the Koha Opac requires *only *that we update this field (items.onloan)? Second, in order to generate the SQL query, something like "UPDATE items SET onloan=2010-03-10 WHERE itemnumber=706," we'll need access to the itemnumber from within the OPAC record in order to generate the OpenURL that Aeon uses to generate requests. Is this variable available from within the opac-results.tmpl and opac-details.tmpl templates? Can someone tell me how I can call this data? On that note, does any documentation exist detailing bib/item data variables like this that can be called from within Opac templates? -- Cheers, Christopher Curry Assistant Technical Librarian / Assistant IT Officer American Philosophical Society 105 South Fifth Street Philadelphia, PA 19106-3386 Tel. (215) 599-4299 ccurry@amphilsoc.org <mailto:ccurry@amphilsoc.org> *For technical support, please use helpdesk@amphilsoc.org <mailto:helpdesk@amphilsoc.org>* Main Library number: (215)440-3400 APS website: http://www.amphilsoc.org
Hi, 2010/2/17 Christopher Curry <ccurry@amphilsoc.org>:
First, am I correct that updating the availability status of an item in the Koha Opac requires only that we update this field (items.onloan)?
No, that's not sufficient - it would also be necessary to update the 952 field in the MARC bib record corresponding to that item so that the item status change can be indexed. Running misc/maintenance/sync_items_marc_bib.pl periodically would do it, with some tweaking to update only the bibs whose items have been updated from Aeon.
Second, in order to generate the SQL query, something like "UPDATE items SET onloan=2010-03-10 WHERE itemnumber=706," we'll need access to the itemnumber from within the OPAC record in order to generate the OpenURL that Aeon uses to generate requests. Is this variable available from within the opac-results.tmpl and opac-details.tmpl templates? Can someone tell me how I can call this data?
itemnumber is available to opac-details.tmpl. It is not directly available in the search results, but (assuming you use the XSLT option), a small tweak of buildKohaItemsNamespace() C4/XSLT.pm and a change to the stylesheet would make it available.
On that note, does any documentation exist detailing bib/item data variables like this that can be called from within Opac templates?
I don't know of anything that systematically documents that, I'm afraid. Regards, Galen -- Galen Charlton gmcharlt@gmail.com
Hi, On Wed, Feb 17, 2010 at 5:57 PM, Galen Charlton <gmcharlt@gmail.com> wrote:
Hi,
2010/2/17 Christopher Curry <ccurry@amphilsoc.org>:
First, am I correct that updating the availability status of an item in the Koha Opac requires only that we update this field (items.onloan)?
No, that's not sufficient - it would also be necessary to update the 952 field in the MARC bib record corresponding to that item so that the item status change can be indexed. Running misc/maintenance/sync_items_marc_bib.pl periodically would do it, with some tweaking to update only the bibs whose items have been updated from Aeon.
I would be remiss if I didn't mention that (possibly with the use of a dummy patron record) it might also be possible to accomplish this using Koha's SIP2 interface. Regards, Galen -- Galen Charlton gmcharlt@gmail.com
Dear Christopher, At 22.06 17/02/2010, Christopher Curry wrote:
Since we're not using Koha's circulation system, we'll need to link Aeon and Koha so that an item checkout from Aeon sends a database UPDATE call to Koha and updates items.onloan with the desired due date (or at least, that's what I've been able to sort out by poking around).
First, am I correct that updating the availability status of an item in the Koha Opac requires only that we update this field (items.onloan)?
if you need to operate at SQL level, you can read the SQL documentation here: http://wiki.koha.org/doku.php?id=en:development:dbschema Bye Zeno Tajoli Zeno Tajoli CILEA - Segrate (MI) tajoliAT_SPAM_no_prendiATcilea.it (Indirizzo mascherato anti-spam; sostituisci quanto tra AT con @)
Thanks, all, for your very useful replies. I don't know anything about the SIP2 interface, but I'm going to find out now. Thanks for the pointer. Galen, Just to verify, I can call the itemnumber variable with: <!-- TMPL_VAR NAME="itemnumber" --> right? It seems like these variables usually use the MySQL field name, which is very logical. Is that a good rule of thumb to follow when determining if a variable is available to a template? Any idea where these variables are defined? I have fundamental programming knowledge, but don't know much about perl. Thanks for answering the novice questions. Cheers, Christopher Curry Assistant Technical Librarian / Assistant IT Officer American Philosophical Society 105 South Fifth Street Philadelphia, PA 19106-3386 Tel. (215) 599-4299 ccurry@amphilsoc.org <mailto:ccurry@amphilsoc.org> *For technical support, please use helpdesk@amphilsoc.org <mailto:helpdesk@amphilsoc.org>* Main Library number: (215)440-3400 APS website: http://www.amphilsoc.org Zeno Tajoli wrote:
Dear Christopher,
At 22.06 17/02/2010, Christopher Curry wrote:
Since we're not using Koha's circulation system, we'll need to link Aeon and Koha so that an item checkout from Aeon sends a database UPDATE call to Koha and updates items.onloan with the desired due date (or at least, that's what I've been able to sort out by poking around).
First, am I correct that updating the availability status of an item in the Koha Opac requires only that we update this field (items.onloan)?
if you need to operate at SQL level, you can read the SQL documentation here: http://wiki.koha.org/doku.php?id=en:development:dbschema
Bye Zeno Tajoli
Zeno Tajoli CILEA - Segrate (MI) tajoliAT_SPAM_no_prendiATcilea.it (Indirizzo mascherato anti-spam; sostituisci quanto tra AT con @)
Hi, On Fri, Feb 19, 2010 at 4:48 PM, Christopher Curry <ccurry@amphilsoc.org> wrote:
Just to verify, I can call the itemnumber variable with:
<!-- TMPL_VAR NAME="itemnumber" -->
right?
Correct, although only in the TMPL_LOOP that goes through the item data.
It seems like these variables usually use the MySQL field name, which is very logical. Is that a good rule of thumb to follow when determining if a variable is available to a template?
It's a reasonably good rule of thumb, but not a perfect one.
Any idea where these variables are defined? I have fundamental programming knowledge, but don't know much about perl. Thanks for answering the novice questions.
Koha uses HTML::Template::Pro for its templating. Basically, an HTML::Template::Pro object is created that binds itself to a particular template, and variables are passed to the template via the param() method. get_template_and_user() in C4::Auth is a wrapper that, among other things, creates the template object, which is normally referred to as $template in the Perl scripts. In the simplest case, to pass a scalar value to the template, you would do something like this: $template->param(bar => 'value'); In the template, that value would be retrieved using <!-- TMPL_VAR NAME="bar" --> You can also pass more complicated data structures. For example: $template->param( myloop => [ { value => 'abc' }, { value => 'def' }, ], ); which can be retrieved via <!-- TMPL_LOOP NAME="myloop" --> <!-- TMPL_VAR NAME="value" --> <!-- /TMPL_LOOP --> which would emit abc def Regards, Galen -- Galen Charlton gmcharlt@gmail.com
Galen, Thanks; that helps a lot. Galen and/or Erik, Since you mentioned that the SIP2 interface would be the logical way to interact with the circulation system, I took a look at it. It looks easy enough to configure, using the Koha Manual as a guide: http://koha.org/documentation/manual/3.2/appendices/sip2-integration. However, I don't have the foggiest idea how the interface could be used once it's configured. The testing example on this page might as well be Greek for someone who doesn't know SIP and testing wouldn't get me any closer to getting Aeon to use Koha's SIP interface anyway. I'm going to see if any of Aeon's developers are fluent in SIP; in case I have to set this up myself, can you recommend a good source of documentation for using SIP2 with Koha? Cheers, Christopher Curry Assistant Technical Librarian / Assistant IT Officer American Philosophical Society 105 South Fifth Street Philadelphia, PA 19106-3386 Tel. (215) 599-4299 ccurry@amphilsoc.org <mailto:ccurry@amphilsoc.org> Galen Charlton wrote:
Hi,
On Fri, Feb 19, 2010 at 4:48 PM, Christopher Curry <ccurry@amphilsoc.org> wrote:
Just to verify, I can call the itemnumber variable with:
<!-- TMPL_VAR NAME="itemnumber" -->
right?
Correct, although only in the TMPL_LOOP that goes through the item data.
It seems like these variables usually use the MySQL field name, which is very logical. Is that a good rule of thumb to follow when determining if a variable is available to a template?
It's a reasonably good rule of thumb, but not a perfect one.
Any idea where these variables are defined? I have fundamental programming knowledge, but don't know much about perl. Thanks for answering the novice questions.
Koha uses HTML::Template::Pro for its templating. Basically, an HTML::Template::Pro object is created that binds itself to a particular template, and variables are passed to the template via the param() method. get_template_and_user() in C4::Auth is a wrapper that, among other things, creates the template object, which is normally referred to as $template in the Perl scripts.
In the simplest case, to pass a scalar value to the template, you would do something like this:
$template->param(bar => 'value');
In the template, that value would be retrieved using
<!-- TMPL_VAR NAME="bar" -->
You can also pass more complicated data structures. For example:
$template->param( myloop => [ { value => 'abc' }, { value => 'def' }, ], );
which can be retrieved via
<!-- TMPL_LOOP NAME="myloop" --> <!-- TMPL_VAR NAME="value" --> <!-- /TMPL_LOOP -->
which would emit
abc def
Regards,
Galen
I'm going to see if any of Aeon's developers are fluent in SIP; in case I have to set this up myself, can you recommend a good source of documentation for using SIP2 with Koha?
Have you read 3M SIP2 protocol reference document? It's here: http://solutions.3m.com/wps/portal/3M/en_US/library/home/resources/protocols... Click on 3M™ Standard Interchange Protocol link. -- Frédéric
Frédéric, I did see that documentation. I was hoping for some more Koha-specific docs that would assist with field mapping & interfacing. We'd primarily be using the "11 Checkout" and "09 Checkin" messages, but I'm uncertain what data to include in some of the message required fields, such as "SC renewal policy" & "no block." In addition, this document doesn't go into detail about how a communications session between the SC and ACS is established. Is there a koha best practice for communicating with the SIP service? http://koha.org/documentation/manual/3.2/appendices/sip2-integration includes a session history of connecting to SIP with telnet, but it's unclear in some sections of this example which are the commands and which are the responses from the server. An example that is a bit more broken down would be very helpful. Hopefully the Aeon developers have some experience with SIP, but even if they can set this up without assistance from me, I'll like to know what's going on in the back end and be able to do some simple tests of the SIP functionality. Thanks for your time. Cheers, Christopher Curry Assistant Technical Librarian / Assistant IT Officer American Philosophical Society 105 South Fifth Street Philadelphia, PA 19106-3386 Tel. (215) 599-4299 ccurry@amphilsoc.org <mailto:ccurry@amphilsoc.org> *For technical support, please use helpdesk@amphilsoc.org <mailto:helpdesk@amphilsoc.org>* Main Library number: (215)440-3400 APS website: http://www.amphilsoc.org Frederic Demians wrote:
I'm going to see if any of Aeon's developers are fluent in SIP; in case I have to set this up myself, can you recommend a good source of documentation for using SIP2 with Koha?
Have you read 3M SIP2 protocol reference document? It's here:
http://solutions.3m.com/wps/portal/3M/en_US/library/home/resources/protocols...
Click on 3M™ Standard Interchange Protocol link. -- Frédéric
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-devel
participants (4)
-
Christopher Curry -
Frederic Demians -
Galen Charlton -
Zeno Tajoli