[ome-devel] Re: Struggling with augmented XML output from OME

Josiah Johnston siah at nih.gov
Wed Sep 21 23:05:27 BST 2005


Here's a working version of your file. I changed a few lines in 
getPageBody() to sync it with the current code base.
All forms using selection services either need to pass their name to 
the javascript function selectMany() or selectOne(). Alternately, they 
can name themselves 'primary'. Previously the select services assumed 
there was one form per page.
The template directory structure has also been updated. 
$self->actionTemplateDir() is the accepted way of getting the root 
directory now.
You'll have to change those back to get it to work with your setup.

Also, I changed your lines
			my $exporter= OME::Web::XMLFileExportDTGED->new($session);
			$exporter->exportDTGEDToXMLFile(\@images,$filename);
to
			$self->exportDTGEDToXMLFile(\@images,$filename);
I didn't see any point in making a new instance of your own class.

The substantive changes were made to exportDTGEDToXMLFile()

You were only loading one MEX with
		my  $dtged_MEX = $factory->findObject ("OME::ModuleExecution",
			image_id => $image->id(),
			module   => $annotation_module
		);
I assumed you really wanted all the annotation modules, so I changed it 
to:
		my  @dtged_MEX_list = $factory->findObjects ("OME::ModuleExecution",
			image_id => $image->id(),
			module   => $annotation_module
		);

The large bug in your code was trying to load all outputs using the 
import MEX.
		foreach my $output (@untyped_outputs, at dtged_outputs) {
		...
			my $attributes = OME::Tasks::ModuleExecutionManager->
				getAttributesForMEX($import_MEX,$ST);
		...
		}
Really, some outputs came from the import MEX and others came from the 
annotation MEXs.
I wrapped all that in a loop that loads all the outputs for one mex at 
a time:
		# Load all outputs of each of these MEXES
		my @mexes = ( $import_MEX, @dtged_MEX_list );
		foreach my $mex ( @mexes ) {

			my @predeclared_outputs = $image_import_module->outputs();
			my @untyped_outputs     = $mex->untypedOutputs();

			# Collect all the attributes produced by the current mex
			foreach my $output (@predeclared_outputs, @untyped_outputs) {
				my $ST = $output->semantic_type();
	
				# Get the output's attributes, and push them on the list
				my $attributes = OME::Tasks::ModuleExecutionManager->
					getAttributesForMEX($mex,$ST);
				push(@exportObjects,@$attributes);
			}
		}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: XMLFileExportDTGED.pm
Type: application/text
Size: 6937 bytes
Desc: not available
Url : http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20050921/b482b9f5/XMLFileExportDTGED.bin
-------------- next part --------------


-Josiah


More information about the ome-devel mailing list