[ome-devel] XMLAnnotations from python

Russell Sim russell.sim at monash.edu
Tue Mar 1 03:32:59 GMT 2011


Hi,

I have been trying to add an XML annotation to a Project and I am
receiving some error that I assume is because I am misusing the API. If
someone could give me a bit of insight into what I should be looking to
for examples that would be superb.

from omero import client_wrapper
blitzcon = client_wrapper('user', 'pass', host='localhost', port=4064)
blitzcon.connect()

# gimme the first project
p = [e for e in blitzcon.listProjects()][0]

from omero.gateway import XmlAnnotationWrapper
a = XmlAnnotationWrapper()
a.setNs("ands.org.au/rifcs")

s = """<?xml version="1.0"?>
<rifcs>
<title>Fantastic</title>
<description>some description</description>
</rifcs>
"""

a.setValue(s)
a._conn = p._conn
a.save()
p.linkAnnotation(a)

#EOF

so after running the script i get a permissions error. 

	serverExceptionClass = ome.conditions.PermissionMismatchGroupSecurityViolation
	message = Manually setting permissions currently disallowed

so I was pretty sure I had made a mistake once I started manually
setting 'protected' variables. But I'm having trouble working through
some of the API because of all the reflection.

Incase I have gone completely off track, the basic usecase is that I am
trying to store some highly structured descriptions of experiments.
The descriptions will then be exported through an OAI-PMH interface to
external indexes and repositories. There are also some business rules that
need to be applied before publishing. So I figured XMLAnnotations would
be a more discrete then adding XML files to the repository.

Any help would be greatly appreciated.

Thanks,
Russell

-- 
Russell Sim
Senior Software Developer
Monash ARDC-EIF Data Capture and Metadata Store
Building 75, Clayton Campus, Wellington Road, Clayton, Victoria. 3800
Telephone: +613 9902 0795
Facsimile: +613 9905 9888
Email: russell.sim at monash.edu
Web: http://www.monash.edu/eresearch


More information about the ome-devel mailing list