Hello,
I have a problem with storing my own metadata which describes image. What should I do, to store these metadata.
In SimpleIOObjectEntry class is method for storing:
public void storeData(IOObject data, Operator callingOperator, ProgressListener l) throws RepositoryException {
if (l != null) {
l.setTotal(100);
l.setCompleted(10);
}
MetaData md = MetaData.forIOObject(data);
// Serialize Non-ExampleSets as IOO
OutputStream out = null;
...
...
And it calls:
public static MetaData forIOObject(IOObject ioo, boolean shortened) {
MetaData result;
if (ioo instanceof ExampleSet) {
result = new ExampleSetMetaData((ExampleSet)ioo, shortened);
} else {
result = new MetaData(ioo.getClass());
}
result.annotations = new Annotations(ioo.getAnnotations());
return result;
}
This creates new MD with no reference to IOObject, so fields have default values.
Can you change it to:
public static MetaData forIOObject(IOObject ioo, boolean shortened) {
MetaData result;
if (ioo instanceof ExampleSet) {
result = new ExampleSetMetaData((ExampleSet)ioo, shortened);
} else {
result = new MetaData(ioo);
}
result.annotations = new Annotations(ioo.getAnnotations());
return result;
}
Now I realized, that it won't help.
Or is there another solution?
Thank you in advance for your reply.
Best,
Vaclav