We're Hiring!

Removing link from file as well as deleting the file

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Re: Removing link from file as well as deleting the file

Postby jmoore » Fri May 27, 2011 7:56 am

bhcho wrote:then, what is fa from here?


"fa" is the file annotation created here, created specifically for the example. It should be whatever object you want to delete, so
Code: Select all
#database query
fa =  query.findAllByQuery(string, params) 
fa = fa[0]


Should work fine.

but still I could not delete it with this 'fa'. Please correct me if I'm wrong
BK


Are you getting an exception? An error? Is there anything in the server log?

~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Removing link from file as well as deleting the file

Postby wmoore » Fri May 27, 2011 8:43 am

HI BK,

The query I posted above selects the ImageAnnotationLink.

You need to get the annotation like I said

Code: Select all
link = queryService.findByQuery(query, None)
ann = link.child
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest