- no URL request-specific description available (since this method is deprecated for writing data); see the Adlib.Data tab for all information -
command=updaterecord&<parameter>=<value>&...
writeAllowed
setting in adlibweb.xml, otherwise records can’t be written to the database.lang
attribute to specify the data language of the field to write to; previously, specifying the language was not a requirement. The WebAPI will check the data dictionary (.inf file) of the relevant database to find out if fields are multilingual or not. The XML format for an existing record with record number 4783, writing to a multilingual title field (in field group Title) must now be structured similarly to the following:<adlibXML><recordList><record><priref>4783</priref><Title><title><value lang=’en-GB’>Test title English</value><value lang=’nl-NL’>Test titel Dutch</value></title><Title></record></recordList></adlibXML>
<adlibXML><recordList><record><priref>4783</priref><Title><title>Test title</title><Title></record></recordList></adlibXML>
<title>
node had to be repeated for each language you wanted to write, like so:<adlibXML><recordList><record><priref>4783</priref><Title><title><value lang=’en-GB’>Test title English</value></title><title><value lang=’nl-NL’>Test titel Dutch</value></title><Title></record></recordList></adlibXML>
output
can be either json
or xml
(xml
is the default, so you don't need to specify that explicitly). However, the output format produced by jQuery applications is always JSON, so you don't need to specify the output type there either.output=json
, because the output format is JSON by default.
language
parameter is available for the insertrecord
and updaterecord
commands (as well as for the deprecated writerecord
command), to allow the client or user to POST monolingual record XML while specifying the default data language for any multilingual target fields once through the URL. This has the advantage that a lang
attribute no longer needs to be added to fields in monolingual XML source data that is targeted for a multilingual field. So the client no longer needs to be to be aware of any multilingual fields in the target database and may POST its monolingual source data without lang
attributes: the WebAPI will use the new language
parameter (with an ISO 639-1-ISO 3166-1 language code like nl-NL or en-GB for example) to determine which lang
attribute must be added automatically to any monolingual value when it is written to a multilingual field. Of course, if you're sure there exists no multilingual target fields, then you don't need to use this parameter.lang
attribute in the XML body AND you do not provide the language
parameter while writing the data to multilingual fields, an error will be reported as before in the XML diagnostic section.)
To update (edit and save) an existing record via de Axiell WebAPI, you have to know the record number (priref) of the record you want to update. This priref can be obtained by searching for the desired record first, in any of the different ways described elsewhere in this documentation. Although not a strict requirement, it is probably safest to lock the record before editing it, so that no-one else can edit the record simultaneously. After updating or writing a record it will be unlocked automatically. Only if you decide not to update a locked record, you'll have to unlock it explicitly. Any field locks in the existing record will be respected, so you can't overwrite locked field contents.
The writing of records resolves links and it manages reverse links, but internal links are not yet dealt with. However, from version 3.6.1173.0, non-preferred terms in validated fields are automatically replaced by their preferred terms. Moreover, in wwwopac.ashx 3.7.13315.5, new functionality was added to automatically delete relations between records when updating a record, but linked field data in the updated record will be deleted only when the link reference field value gets set to empty.
Further, linked fields in your database may have write-back fields defined for them, which means that in a catalogue record the user can edit or enter information in merged-in fields belonging to a linked record, to be stored with the linked record when the catalogue record is saved. From wwwopac.ashx version 3.7.13301.1, data you write to such merged-in fields will be written back to the relevant linked record if for the linked field the appropriate write-back fields have been specified. In previous versions this data could not be written to the linked record.
Update record 38 in collect.inf, by changing the title show
// Create a connection to the wwwopac.ashx conn = new AdlibConnection(url); record = new AdlibRecord(conn, "collect.inf"); // Find record 38 record.Search(38); if (record != null) { // Change the title record["title"] = "Portrait of the painter"; // Update the record record.Update();
- no jQuery-specific description available yet; see the Adlib.Data tab for all information -
Update record 38 in collect.inf, by changing the title show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; var xmldata = '<adlibXML><recordList><record>' + '<priref>38</priref>’+ ‘<title>Portrait of the painter</title>' + '</record></recordList></adlibXML>'; $().adlibdata(url, { //arguments database: "collect.inf", command: "updaterecord", data: xmldata, xmltype: "grouped" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });