- no URL request-specific description available (since this method is deprecated for writing data); see the Adlib.Data tab for all information -
command=insertrecord&<parameter>=<value>&...
writeAllowed
setting in adlibweb.xml, otherwise records can’t be written to the database.collect>extern
.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 a new record containing just a multilingual title field (in field group Title) must now be structured similarly to the following:<adlibXML><recordList><record><priref>0</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>0</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>0</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.)
Writing a new record resolves links and it manages reverse links, but internal links are not yet dealt with. From version 3.6.1173.0, non-preferred terms in validated fields are automatically replaced by their preferred terms.
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.
Write a new record with just a title in database 'externalobjects' show
// Create a connection to the wwwopac.ashx conn = new AdlibConnection(url); // Create a new adlib record record = new AdlibRecord(conn, "externalobjects"); // Set the priref field record["priref"] = "0"; // Set the title field record["title"] = "A new title" // Insert the record in the database record.Insert();
Delete the record you created in the previous example show
// Create a connection to the wwwopac.ashx conn = new AdlibConnection(url); // Create a new adlib record record = new AdlibRecord(conn, "externalobjects"); record.Search(10000001); if (record != null) { // Delete the record record.Delete(); }
- no jQuery-specific description available yet; see the Adlib.Data tab for all information -
Write a new record with just a title in database 'externalobjects' show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; var xmldata = '<adlibXML><recordList><record>' + '<priref>0</priref><title>test title</title>' + '</record></recordList></adlibXML>'; $().adlibdata(url, { //arguments database: "externalobjects", command: "insertrecord", data: xmldata, xmltype: "grouped" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
Delete the record you created in the previous example show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "externalobjects", command: "deleterecord", priref: 10000001 }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });