Page 1 of 1

Using array-like objects in omero 4.2 models

PostPosted: Wed Jul 14, 2010 3:31 pm
by luca.lianas
Hi everyone,
I'm trying to use the new multi-dimensional items inside omero 4.2 models, I'm writing my own models in order to use Omero's data layer and libraries for I\O operations into the database, i wrote a this test model

<types>
<type id="ome.model.test.SimpleTest">
<properties>
<required name="label" type="string"/>
<required name="items" type="int[]"/>
</properties>
</type>
</types>


I compiled the server and I have the Python SimpleTestI object related to my model, I'm trying to write some data inside the "items" field but I cannot find which object type I have to use for this operation. I created a python list containing int values and I used the new wrap function from omero.rtypes and it turned the python list into an omero.rtypes.RList object which contains several RInt object inside but when I put this list inside the SimpleTest object I created and try yo save it an error (ValueError: invalid value for ::omero::model::LucaTest member `_items') occurs.
Please can you give me some examples or advices for this new feature?

Re: Using array-like objects in omero 4.2 models

PostPosted: Thu Jul 15, 2010 8:57 am
by jmoore
Hi Luca,

unfortunately the array-types tested in 4.2 are only "String[]" and "byte[]". Looking into it briefly, I think that int[] is being mapping to bytea incorrectly.

As we move towards full n-dimensional support, the array-types like "float[]" and "int[]" will also come on line. If you would like to work on it yourself, both components/dsl (especially src/ome/dsl/Property.java) and components/blitz/resources/templates/combined.vm will likely need to be modified.

Sorry for the inconvenience,
~Josh.