openmicroscopy/openmicroscopy — pull request #2409 by joshmoore (2014-04-30 23:03:26+00:00)
Title: tx.py CLI Command

This is the beginning of a command for creating and modifying objects from the CLI. The eventual intent is that all the operations happen within the same transaction server-side (hence the name), but for the moment all the work is happening client-side.

The immediate use case which it should satisfy is the likes of creating a `Dataset` or a `Screen` for CLI import. /CC @pwalczysko @ximeneuk More complex workflows are possible and planned, including loops, lookups, etc.

Other name proposals: `obj`, `macro`

To test:
* Try a basic creation: `bin/omero tx new Project name=foo`. This should work for any data type that isn't part of a ordered collection (like `Pixels`) and for any field of a basic type, incl `Image acquisitionDate=5`.
* Also try creating a more complicated file and piping it into the command: `cat test.txt | bin/omero tx` (Make sure you are logged in first!)

Example file:
```
new Project name=foo
new Dataset name=bar
new ProjectDatasetLink parent@=0 child@=1
```
Here the `@=` notation points to the N-th object created by the script (base 0). Very much looking for other uses that I haven't thought of yet.