Skip to content

Instantly share code, notes, and snippets.

View stefankeidel's full-sized avatar

Stefan Keidel stefankeidel

View GitHub Profile
@stefankeidel
stefankeidel / fix_occurrences.php
Created March 7, 2016 13:38
CollectiveAccess data mangling example
<?php
require_once('./setup.php');
require_once(__CA_MODELS_DIR__.'/ca_occurrences.php');
$o_db = new Db();
$qr_prods = $o_db->query('SELECT occurrence_id FROM ca_occurrences WHERE type_id = 116');
while($qr_prods->nextRow()) {
$t_occ = new ca_occurrences($qr_prods->get('occurrence_id'));
@stefankeidel
stefankeidel / create_representation.json
Created February 15, 2016 18:44
create object representation using CA web service API
{
"ok":true,
"intrinsic_fields":{
"locale_id":"1",
"type_id":"136",
"media":"https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png",
"original_filename":"My original file name.png",
"access":"0",
"status":"0"
},
<?php
/** ---------------------------------------------------------------------
* tests/search/queries/SimpleSearchQueryTest.php
* ----------------------------------------------------------------------
* CollectiveAccess
* Open-source collections management software
* ----------------------------------------------------------------------
*
* Software by Whirl-i-Gig (http://www.whirl-i-gig.com)
* Copyright 2015 Whirl-i-Gig
<?php
require_once('./setup.php');
require_once(__CA_APP_DIR__.'/helpers/mediaPluginHelpers.php');
$po_config = Configuration::load();
$po_external_app_config = Configuration::load($po_config->get('external_applications'));
$ps_path_to_ghostscript = $po_external_app_config->get('ghostscript_app');
print "ghostscript path from external conf: $ps_path_to_ghostscript <br/>\n";
@stefankeidel
stefankeidel / item_edit_request.json
Created October 19, 2012 11:52
CollectiveAccess providence web service example request for editing an existing item
{
"intrinsic_fields" : {
"idno" : "NEWTEST-456",
},
"remove_all_labels" : true,
"preferred_labels" : [
{
"locale" : "en_US",
"forename" : "Walter",
"middlename" : "H.",
@stefankeidel
stefankeidel / item_request.json
Created October 11, 2012 11:42
CollectiveAccess providence web service example request for new item
{
"intrinsic_fields" : {
"idno" : "TEST-123",
"type_id" : 43
},
"preferred_labels" : [
{
"locale" : "en_US",
"forename" : "Walter",
"middlename" : "H.",
@stefankeidel
stefankeidel / generic_model_response.json
Created October 8, 2012 21:24
CollectiveAccess providence web service example response for generic model summary
{
"ok":true,
"ind":{
"type_info":{
"item_id":"79",
"parent_id":"78",
"list_id":"18",
"type_id":null,
"idno":"ind",
"idno_sort":"ind ",
@stefankeidel
stefankeidel / generic_item_response.json
Created October 8, 2012 09:26
CollectiveAccess providence web service example response for generic record summary
{
"ok":true,
"preferred_labels":{
"en_US":[
"My new test object"
]
},
"nonpreferred_labels":{
"en_US":[
"Some cool alternate label!"