Skip to content

Instantly share code, notes, and snippets.

@aronr
aronr / collectionobject-import-example.xml
Last active October 13, 2015 22:16
Example of an XML payload for importing an CollectionObject (aka Cataloging) record into CollectionSpace. (This example assigns a provided identifier (CSID) to that record; if the 'CSID=' attribute is omitted, an identifier will automatically be generated and assigned to the record.)
<?xml version="1.0" encoding="UTF-8"?>
<imports>
<import service="CollectionObjects" type="CollectionObject" CSID="be4797f1-08cf-4616-8a73-d763798f8ec3">
<schema xmlns:collectionobjects_common="http://collectionspace.org/services/collectionobject" name="collectionobjects_common">
<collectionobjects_common:objectNumber>UC15565</collectionobjects_common:objectNumber>
</schema>
</import>
</imports>
@aronr
aronr / intake-import-example.xml
Last active October 13, 2015 21:54
Example of an XML payload for importing an Intake record into CollectionSpace. (Note: the value of the intakes_common:valuer field should match the refName of a real Person record, or you can just omit this value from the payload.)
<?xml version="1.0" encoding="UTF-8"?>
<imports>
<import service="Intakes" type="Intake">
<schema name='intakes_common' xmlns:intakes_common='http://collectionspace.org/intake/'>
<intakes_common:conditionCheckReasons/>
<intakes_common:valuationReferenceNumber>valuationReferenceNumberX</intakes_common:valuationReferenceNumber>
<intakes_common:entryReason>entryReasonX</intakes_common:entryReason>
<intakes_common:currentOwner>currentOwnerX</intakes_common:currentOwner>
<intakes_common:depositor>depositorX</intakes_common:depositor>
<intakes_common:valuer>urn:cspace:org.collectionspace.demo:personauthority:id(9505e049-e367-4b51-9425):person:id(f9e46efa-6286-48b3-827d)'David+Bowie'</intakes_common:valuer>
@aronr
aronr / media-import-example.xml
Last active October 13, 2015 21:52
Example of an XML payload for importing a Media record into CollectionSpace.
<?xml version="1.0" encoding="UTF-8"?>
<imports>
<import service="Media" type="Media">
<schema xmlns:media_common="http://collectionspace.org/services/media/" name="media_common">
<media_common:dateGroupList>
<media_common:dateGroup>
<media_common:dateEarliestSingleQualifier/>
<media_common:scalarValuesComputed>true</media_common:scalarValuesComputed>
<media_common:dateLatestYear/>
<media_common:dateLatestDay/>
@aronr
aronr / vagrantfile-cspace-install.md
Last active August 29, 2015 14:23
Mark's Vagrantfile-based CSpace installation

An almost completely unattended way to create a VirtualBox VM running Ubuntu 14.04.x LTS, and then run the automated CollectionSpace server installer within that VM:

  • Install both VirtualBox (https://www.virtualbox.org/) and Vagrant (https://www.vagrantup.com/).
  • Create a new directory.
  • cd to that new directory.
  • In a web browser, visit https://github.com/mark-cooper/cspace_vagrantbox
  • Download the file named Vagrantfile into that new directory. (E.g. right-click or Ctrl-click the Vagrantfile link and choose "Save Link As..." or equivalent, and choose that new directory as the place to download this file.)
  • From within the directory you created, enter: vagrant up (This will initiate the automated installer and start displaying progress messages; allow at least 30 minutes for installation to complete.
  • If any serious errors occur during installation, you can also retry that process; exit from the VM, then at your host computer's shell prompt, enter vagrant halt, vagrant destroy, and then `
@aronr
aronr / low-flow-showerhead-cost-savings-algorithm.txt
Last active June 19, 2017 23:22
Algorithm (and/or heuristics) for low-flow showerhead cost savings calculator
A quick discussion of a generic algorithm for a low-flow showerhead
water and energy savings calculator:
0. First thoughts.
The easiest way to think about these costs, for a current or
prospective customer, are likely to be in:
* Savings per month. (We think of mortgage or rent payments; utility,
car, cell phone contract payments, etc., in monthly terms.)
[aron@lips-128-32-191-42 ~/Documents/VirtualMachines/Vagrant-VMs/mark]$ vagrant up
Bringing machine 'cspace' up with 'virtualbox' provider...
==> cspace: Importing base box 'ubuntu/trusty64'...
==> cspace: Matching MAC address for NAT networking...
==> cspace: Checking if box 'ubuntu/trusty64' is up to date...
==> cspace: Setting the name of the VM: mark_cspace_1418265751397_79664
==> cspace: Clearing any previously set forwarded ports...
==> cspace: Clearing any previously set network interfaces...
==> cspace: Preparing network interfaces based on configuration...
@aronr
aronr / gist:7763527
Created December 3, 2013 03:41
Puppet: reading values from YAML configuration file
http://puppetlabs.com/blog/module-of-the-week-puppetlabs-stdlib-puppet-labs-standard-library-part-4
@aronr
aronr / app-test-results-2013-02-05.txt
Created February 6, 2013 03:10
CollectionSpace App layer test results with latest services and app builds as of approx. 7:00 pm on Tue, Feb 5. 2013.
$ mvn clean test
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.collectionspace:general-utils:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.mortbay.jetty:maven-jetty-plugin is missing. @ line 45, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 36, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ org.collectionspace:svcapp:1.0-SNAPSHOT, /Users/aron/Documents/CollectionSpace/source/cspace-app/application/pom.xml, line 56, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.collectionspace:csp-api:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.mortbay.jetty:maven-jetty-plugin is missing. @ line 57, column 15
diff --git a/services/JaxRsServiceProvider/pom.xml b/services/JaxRsServiceProvider/pom.xml
index b112a0d..a0f7709 100644
--- a/services/JaxRsServiceProvider/pom.xml
+++ b/services/JaxRsServiceProvider/pom.xml
@@ -22,18 +22,15 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
</dependency>
@aronr
aronr / gist:3829229
Created October 3, 2012 19:28
Nuxeo DB after running services tests, late in v3.0 (7ee4c2180e9c3e5415bf673ca6a311a6364ebeb4 as of 2012-10-01)
nuxeo=# SELECT schemaname,relname,n_live_tup FROM pg_stat_user_tables ORDER BY n_live_tup DESC;
schemaname | relname | n_live_tup
------------+--------------------------------------------------+------------
public | hierarchy | 462
public | fulltext | 132
public | hierarchy_read_acl | 132
public | misc | 131
public | dublincore | 131
public | ancestors | 130
public | content | 54