[ome-users] Custom annotations absent in exported metadata

Ilya Goldberg igg at nih.gov
Fri Aug 5 17:12:04 BST 2005


On Aug 5, 2005, at 9:04 AM, Graham Klyne wrote:

> Ilya Goldberg wrote:
>> On Aug 4, 2005, at 6:52 AM, Graham Klyne wrote:
>
> Although I've been trying to avoid getting into the OME code so far, 
> this is an area where I feel that it would be reasonable to dig in to 
> get the output we want.  For our purposes, a one-off specification of 
> what needs to be exported would be fine (even best), and I don't think 
> we really need a UI to control the details.

Unfortunately, this is the state of OME development.  If you want 
custom solutions often times that means writing custom code.  Obviously 
not ideal, and we've been trying to do things in a way that would cover 
most bases for most users.  Combined with trying very hard to make the 
code easy to use if the only option is to modify code.

>
> I assume I can create a new perl module in the appropriate CGI 
> directory, and subsequently access the required data simply by using 
> an appropriately constructed URI?
>
> The following information would help:
> - is there a sample module that does something close to this?  The 
> current export module described in your other message sounds as if it 
> could be copied and adapted.

The best place to start is definitely the current XML Export module: 
src/perl2/OME/Web/XMLFileExport.pm
The entire web UI is done using sub-classes of OME::Web (in 
src/perl2/OME/Web.pm and the src/perl2/OME/Web/ directory tree)
I would follow the same inheritance pattern and simply make a new class 
similar to XMLFileExport - there's really no point to subclassing this 
since its just an HTML interface for 
src/perl2/OME/Tasks/OMEXMLImportExport.pm.  This 
OME::Tasks::OMEXMLImportExport class performs the logic of gathering 
the objects to export.  The export itself is performed by 
OME::Tasks::OMEExport, which is the generalized exporter.

Since OMEXMLImportExport.pm just gathers objects and calls 
OME::Tasks::OMEExport, the thing to do is copy the 
OMEXMLImportExport->exportToXMLFile() method to your new class and 
modify it to look for additional objects using a OME::Factory call 
documented here:
http://openmicroscopy.org/APIdocs/OME/Factory.html


> - what would I need to tweak to get a link to this external export 
> format placed on the image information page?  (Maybe HTML templates 
> will be the best answer for this?)

I'm guessing you want to set up your OME::Web::XMLFileExport variant to 
export an image using a URL param with an Image ID.

We're about to send an announcement about the customized templates 
thing (stay tuned).  You should be able to easily include a link to 
your customized exporter from there.  You'll also be glad to know that 
your request to allow changing the order of items in the annotation 
form is specifically treated in the example of template customization.  
Actually, so is introducing a hyperlink using one of the image 
annotations (you'd just be using the ImageID in the template instead of 
a categorization value to generate your export URL).

If you don't want to get into custom templates (though we'd appreciate 
any feedback if you give it a whirl), you can modify the image detail 
template here:
src/html/Templates/Display/One/OME/Image/detail.tmpl
Or, if you're using the 2.4.0 tar-ball, here:
src/html/Templates/OME_Image_detail.tmpl

-Ilya


>
> #g
>
> -- 
> Graham Klyne
> Image Bioinformatics Research Group (http://www.bioimage.org/)
> Department of Zoology, University of Oxford
> South Parks Road, Oxford OX1 3PS, UK
> E-mail: <Graham.Klyne at zoo.ox.ac.uk>
> Direct phone: +44-(0)1865-281991
> Departmental fax: +44-(0)1865-310447
>




More information about the ome-users mailing list